Previous | 199869 Revisions | Next |
r18028 Wednesday 19th September, 2012 at 19:48:09 UTC by Aaron Giles |
---|
Since nobody checks for NULLs anyway, make device_memory_interface::space() assert against NULL and return a reference, and pushed references throughout all address space usage in the system. Added a has_space() method to check for those rare case when it is ambiguous. [Aaron Giles] Also reinstated the generic space and added fatal error handlers if anyone tries to actually read/write from it. |
[src/emu] | devcb.c device.h dimemory.h driver.c driver.h machine.c |
[src/emu/cpu] | drcfe.h drcuml.c |
[src/emu/cpu/adsp2100] | adsp2100.c |
[src/emu/cpu/alph8201] | alph8201.c |
[src/emu/cpu/am29000] | am29000.c |
[src/emu/cpu/apexc] | apexc.c |
[src/emu/cpu/arm] | arm.c |
[src/emu/cpu/arm7] | arm7.c arm7core.c |
[src/emu/cpu/asap] | asap.c |
[src/emu/cpu/avr8] | avr8.c |
[src/emu/cpu/ccpu] | ccpu.c |
[src/emu/cpu/cop400] | cop400.c |
[src/emu/cpu/cosmac] | cosmac.c |
[src/emu/cpu/cp1610] | cp1610.c |
[src/emu/cpu/cubeqcpu] | cubeqcpu.c |
[src/emu/cpu/dsp16] | dsp16.c |
[src/emu/cpu/dsp32] | dsp32.c |
[src/emu/cpu/dsp56k] | dsp56k.c |
[src/emu/cpu/e132xs] | e132xs.c |
[src/emu/cpu/esrip] | esrip.c |
[src/emu/cpu/f8] | f8.c |
[src/emu/cpu/g65816] | g65816.c |
[src/emu/cpu/h6280] | h6280.c |
[src/emu/cpu/h83002] | h8_16.c h8_8.c |
[src/emu/cpu/hcd62121] | hcd62121.c |
[src/emu/cpu/hd61700] | hd61700.c |
[src/emu/cpu/hd6309] | hd6309.c |
[src/emu/cpu/i386] | i386.c |
[src/emu/cpu/i4004] | i4004.c |
[src/emu/cpu/i8008] | i8008.c |
[src/emu/cpu/i8085] | i8085.c |
[src/emu/cpu/i86] | i286.c i86.c |
[src/emu/cpu/i860] | i860.c |
[src/emu/cpu/i960] | i960.c |
[src/emu/cpu/jaguar] | jaguar.c |
[src/emu/cpu/konami] | konami.c |
[src/emu/cpu/lh5801] | lh5801.c |
[src/emu/cpu/lr35902] | lr35902.c |
[src/emu/cpu/m37710] | m37710.c |
[src/emu/cpu/m6502] | m4510.c m6502.c m6509.c m65ce02.c |
[src/emu/cpu/m6800] | m6800.c |
[src/emu/cpu/m68000] | m68kcpu.c |
[src/emu/cpu/m6805] | m6805.c |
[src/emu/cpu/m6809] | m6809.c |
[src/emu/cpu/mb86233] | mb86233.c |
[src/emu/cpu/mb88xx] | mb88xx.c |
[src/emu/cpu/mc68hc11] | mc68hc11.c |
[src/emu/cpu/mcs48] | mcs48.c |
[src/emu/cpu/mcs51] | mcs51.c |
[src/emu/cpu/minx] | minx.c |
[src/emu/cpu/mips] | mips3com.c r3000.c |
[src/emu/cpu/mn10200] | mn10200.c |
[src/emu/cpu/nec] | nec.c v25.c |
[src/emu/cpu/pdp1] | pdp1.c tx0.c |
[src/emu/cpu/pic16c5x] | pic16c5x.c |
[src/emu/cpu/pic16c62x] | pic16c62x.c |
[src/emu/cpu/powerpc] | ppc.c ppccom.c |
[src/emu/cpu/pps4] | pps4.c |
[src/emu/cpu/psx] | psx.c |
[src/emu/cpu/rsp] | rsp.c rspdrc.c |
[src/emu/cpu/s2650] | s2650.c |
[src/emu/cpu/saturn] | saturn.c |
[src/emu/cpu/sc61860] | sc61860.c |
[src/emu/cpu/scmp] | scmp.c |
[src/emu/cpu/se3208] | se3208.c |
[src/emu/cpu/sh2] | sh2comn.c |
[src/emu/cpu/sh4] | sh4.c |
[src/emu/cpu/sharc] | sharc.c |
[src/emu/cpu/sm8500] | sm8500.c |
[src/emu/cpu/spc700] | spc700.c |
[src/emu/cpu/ssem] | ssem.c |
[src/emu/cpu/ssp1601] | ssp1601.c |
[src/emu/cpu/superfx] | superfx.c |
[src/emu/cpu/t11] | t11.c |
[src/emu/cpu/tlcs90] | tlcs90.c |
[src/emu/cpu/tlcs900] | tlcs900.c |
[src/emu/cpu/tms0980] | tms0980.c |
[src/emu/cpu/tms32010] | tms32010.c |
[src/emu/cpu/tms32025] | tms32025.c |
[src/emu/cpu/tms32031] | tms32031.c |
[src/emu/cpu/tms32051] | tms32051.c |
[src/emu/cpu/tms34010] | tms34010.c |
[src/emu/cpu/tms57002] | tms57002.c |
[src/emu/cpu/tms7000] | tms7000.c |
[src/emu/cpu/tms9900] | 99xxcore.h tms9900.c tms9995.c |
[src/emu/cpu/unsp] | unsp.c |
[src/emu/cpu/upd7725] | upd7725.c |
[src/emu/cpu/upd7810] | upd7810.c |
[src/emu/cpu/v30mz] | v30mz.c |
[src/emu/cpu/v60] | v60.c |
[src/emu/cpu/v810] | v810.c |
[src/emu/cpu/z180] | z180.c |
[src/emu/cpu/z8] | z8.c |
[src/emu/cpu/z80] | z80.c |
[src/emu/cpu/z8000] | z8000.c |
[src/emu/debug] | debugcmd.c debugcpu.c debugcpu.h dvdisasm.c dvdisasm.h dvmemory.c |
[src/emu/drivers] | testcpu.c |
[src/emu/machine] | 6821pia.h 6840ptm.h amigafdc.c i8155.c i8355.c idectrl.c microtch.c s3c2400.c s3c2410.c s3c2440.c s3c24xx.c |
[src/emu/sound] | bsmt2000.c c352.c cdp1869.c disc_inp.c es5503.c mos6560.c nes_apu.c okim6295.c okim9810.c qs1000.c |
[src/emu/video] | 315_5124.c crt9007.c h63484.c hd61830.c huc6261.c huc6272.c m50458.c mb90082.c mc6845.c pc_cga.c ramdac.c sed1330.c tms9928a.c v9938.c |
[src/mame/audio] | 8080bw.c amiga.c atarijsa.c cage.c cinemat.c dcs.c harddriv.c hyprolyb.c jaguar.c leland.c m72.c mario.c scramble.c seibu.c williams.c |
[src/mame/drivers] | 1943.c 39in1.c 8080bw.c adp.c airbustr.c alpha68k.c appoooh.c arcadia.c arkanoid.c armedf.c artmagic.c asteroid.c astrocde.c astrof.c atarig1.c atarig42.c atarigt.c atarigx2.c atarisy2.c atarisy4.c ataxx.c attckufo.c atvtrack.c backfire.c badlands.c bagman.c balsente.c beathead.c berzerk.c bfm_sc2.c btime.c bublbobl.c bzone.c cabal.c calchase.c calorie.c cd32.c cham24.c chihiro.c cinemat.c cischeat.c cninja.c combatsc.c commando.c coolpool.c coolridr.c cosmic.c cps1.c cps2.c cps3.c crbaloon.c crgolf.c crimfght.c crystal.c cshooter.c csplayh5.c darkmist.c ddealer.c ddenlovr.c ddragon.c deadang.c dec0.c dec8.c deco32.c deco_mlc.c decocass.c deshoros.c dfruit.c dgpix.c dkong.c dynax.c eolith.c eprom.c equites.c exidy.c exidy440.c exprraid.c famibox.c fastfred.c firebeat.c fitfight.c flstory.c freekick.c funworld.c gaiden.c galaga.c galaxian.c galgame.c galivan.c galpani2.c gameplan.c gamtor.c gauntlet.c gei.c ghosteo.c gladiatr.c glass.c gng.c goldstar.c gottlieb.c groundfx.c gstream.c gstriker.c gsword.c guab.c gunbustr.c harddriv.c highvdeo.c hng64.c homedata.c hshavoc.c hyprduel.c igs011.c igs017.c iqblock.c ironhors.c itech32.c itech8.c jack.c jaguar.c jalmah.c jangou.c jchan.c kaneko16.c kangaroo.c kchamp.c konamigv.c konamigx.c ksys573.c kyugo.c ladybug.c lastbank.c leland.c lethalj.c liberate.c limenko.c littlerb.c lkage.c lockon.c looping.c m107.c m72.c m90.c m92.c macrossp.c magictg.c magtouch.c mappy.c maygay1b.c mcr.c mcr3.c mcr68.c mediagx.c megadrvb.c megaplay.c megasys1.c megatech.c meritm.c metalmx.c metro.c midqslvr.c midvunit.c midyunit.c midzeus.c missile.c mitchell.c model2.c model3.c mouser.c mpu3.c mpu4hw.c mquake.c multigam.c namcona1.c namcos11.c namcos12.c namcos22.c naughtyb.c nbmj9195.c neodrvr.c neogeo.c ninjakd2.c niyanpai.c nmk16.c nyny.c offtwall.c omegrace.c pachifev.c pacman.c pangofun.c paradise.c pasha2.c pbaction.c pcat_dyn.c pcat_nit.c pcktgal.c pengadvb.c pengo.c phoenix.c photoply.c pingpong.c pinkiri8.c pipedrm.c pirates.c plygonet.c pntnpuzl.c polepos.c policetr.c progolf.c psikyo.c psikyo4.c psikyosh.c pturn.c qix.c queen.c r2dtank.c r2dx_v33.c raiden.c renegade.c rmhaihai.c safarir.c sangho.c saturn.c savquest.c seattle.c segac2.c segae.c segag80r.c segag80v.c segahang.c segas16a.c segas16b.c segas32.c segaxbd.c seibuspi.c seta.c shootout.c sidepckt.c simpl156.c skydiver.c slapfght.c snesb.c snk.c snowbros.c spacefb.c sprint2.c srumbler.c starwars.c statriv2.c strnskil.c stv.c su2000.c suna16.c suna8.c superchs.c supertnk.c suprnova.c system1.c system16.c taito_f3.c taito_x.c taitogn.c taitojc.c taitosj.c taitowlf.c tcl.c tecmo.c terracre.c thepit.c tiamc1.c tigeroad.c tmaster.c toki.c trackfld.c tumbleb.c turbo.c tx1.c umipoker.c upscope.c vamphalf.c vcombat.c vegaeo.c vegas.c vendetta.c videopin.c viper.c voyager.c williams.c witch.c wiz.c xtom3d.c yunsun16.c zaxxon.c zn.c |
[src/mame/includes] | jaguar.h |
[src/mame/machine] | amiga.c archimds.c asic65.c asteroid.c atari.c atarigen.c bagman.c balsente.c cclimber.c cd32.c cps2crpt.c cx4fn.c cx4oam.c dc.c dec0.c deco102.c fd1089.c fd1094.c fddebug.c galaxold.c irobot.c kabuki.c kaneko_calc3.c kaneko_toybox.c konami1.c konamigx.c mc8123.c mcr68.c md_cart.c mega32x.c megacd.c megadriv.c megasvp.c megavdp.c mhavoc.c micro3d.c midtunit.c midwunit.c midyunit.c n64.c namcos1.c namcos2.c naomi.c neoboot.c neoprot.c nmk004.c pgmprot.c pgmprot1.c pgmprot2.c pgmprot3.c pgmprot4.c pgmprot5.c pgmprot6.c pitnrun.c playch10.c qix.c scramble.c segacrp2.c segacrpt.c segaic16.c segamsys.c segas32.c snes.c snescx4.c stfight.c stvprot.c taitosj.c tatsumi.c tnzs.c toaplan1.c twincobr.c vectrex.c vsnes.c williams.c |
[src/mame/video] | amiga.c astrocde.c atari.c atarisy1.c avgdvg.c blstroid.c cischeat.c combatsc.c dc.c dogfgt.c gp9001.c gtia.c hng64.c leland.c namcos22.c ojankohs.c popeye.c ppu2c0x.c simpsons.c skydiver.c taito_b.c toaplan1.c vdc.c vrender0.c |
[src/mess/audio] | mos7360.c svision.c |
[src/mess/drivers] | a2600.c a310.c a5105.c a7000.c abc1600.c abc80x.c ace.c adam.c amiga.c apexc.c apollo.c apricot.c apricotf.c aquarius.c astrocde.c atari400.c atarist.c atm.c atom.c avigo.c basic52.c bebox.c bigbord2.c bml3.c bw12.c bw2.c c64.c camplynx.c cat.c cd2650.c cosmicos.c crvision.c cxhumax.c d6800.c dc.c dectalk.c elf.c elwro800.c enterp.c exp85.c fk1.c fm7.c fmtowns.c fp1100.c gba.c gp32.c homelab.c ht68k.c indiana.c instruct.c ip22.c itt3030.c kyocera.c lc80.c lynx.c m5.c mc10.c mc1000.c mc80.c micronic.c mikromik.c mpf1.c mpz80.c ms0515.c msbc1.c mstation.c nanos.c nc.c newbrain.c next.c ng_aes.c ob68k1a.c osi.c p8k.c palm.c pasopia7.c pc1512.c pc6001.c pc8001.c pc8401a.c pc88va.c pc9801.c pce220.c pcfx.c pcw.c pcw16.c pdp1.c pentagon.c pes.c pipbug.c plus4.c poly.c portfoli.c prestige.c prof80.c psx.c px4.c px8.c ql.c rex6000.c rx78.c sage2.c samcoupe.c scorpion.c sg1000.c sgi_ip2.c spc1000.c specpls3.c spectrum.c super6.c supracan.c tandy2k.c tek405x.c ti89.c tiki100.c timex.c tmc1800.c tmc600.c tvc.c unixpc.c v1050.c vboy.c vc4000.c vcs80.c vg5k.c vic10.c victor9k.c vii.c vixen.c vt520.c vtech1.c wangpc.c x07.c x1.c x1twin.c x68k.c xerox820.c xor100.c z1013.c z88.c z9001.c |
[src/mess/formats] | ace_ace.c atom_atm.c cbm_snqk.c comx35_comx.c m65_snqk.c spec_snqk.c trs_cmd.c z80bin.c |
[src/mess/machine] | 6883sam.c 990_hd.c 990_tap.c a7800.c advision.c aim65.c amigacd.c amigacrt.c amstrad.c apollo.c apple1.c apple2.c apple2gs.c apple3.c at.c ataricrt.c b2m.c bbc.c bebox.c c128.c c64.c c65.c cgenie.c coco.c coco_multi.c coco_vhd.c compis.c comx_clm.c cpc_ssa1.c cs4031.c cybiko.c dgn_beta.c electron.c galaxy.c gb.c genpc.c hd63450.c hp48.c i82439tx.c intv.c iq151_staper.c isa.c kaypro.c kc.c kc_d004.c lisa.c llc.c lviv.c lynx.c mac.c mbc55x.c mbee.c mface2.c microtan.c mpc105.c msx.c msx_slot.c mtx.c mz700.c nascom1.c nes.c northbridge.c nubus.c ondra.c oric.c orion.c osborne1.c partner.c pc.c pc1350.c pc_lpt.c pce.c pecom.c pet.c pk8020.c pmd85.c pokemini.c poly88.c pp01.c primo.c radio86.c rm380z.c rmnimbus.c s100_wunderbus.c s3c44b0.c samcoupe.c sms.c snescart.c sorcerer.c southbridge.c special.c sym1.c tf20.c thomson.c ti85.c trs80.c upd71071.c vector06.c vtech2.c wswan.c x68k_neptunex.c x68k_scsiext.c z80ne.c z88_flash.c zx.c |
[src/mess/machine/ti99] | datamux.c ti_rs232.c tn_ide.c |
[src/mess/video] | a7800.c ac1.c apple3.c atarist.c cirrus.c dai.c ef9345.c galaxy.c gb.c hd66421.c hp48.c iq151_grafik.c irisha.c isa_cga.c kramermc.c mos6566.c newbrain.c oric.c pc_aga.c pc_t1t.c primo.c ti85.c tms3556.c upd7220.c zx8301.c |
r18027 | r18028 | |
---|---|---|
202 | 202 | |
203 | 203 | #if ENABLE_SPEEDUP_HACKS |
204 | 204 | if (m_hacks_enabled) |
205 | m_dsp->space(AS_PROGRAM) | |
205 | m_dsp->space(AS_PROGRAM).install_write_handler(0xf1a100, 0xf1a103, write32_delegate(FUNC(jaguar_state::dsp_flags_w), this)); | |
206 | 206 | #endif |
207 | 207 | } |
208 | 208 |
r18027 | r18028 | |
---|---|---|
147 | 147 | |
148 | 148 | /* install POKEY memory handlers */ |
149 | 149 | if (pokey != NULL) |
150 | jsacpu->space(AS_PROGRAM) | |
150 | jsacpu->space(AS_PROGRAM).install_readwrite_handler(0x2c00, 0x2c0f, read8_delegate(FUNC(pokey_device::read),pokey), write8_delegate(FUNC(pokey_device::write),pokey)); | |
151 | 151 | |
152 | 152 | init_save_state(machine); |
153 | 153 | atarijsa_reset(); |
r18027 | r18028 | |
---|---|---|
177 | 177 | state->timer[1] = machine.device<timer_device>("cage_timer1"); |
178 | 178 | |
179 | 179 | if (speedup) |
180 | state->speedup_ram = state->cpu->space(AS_PROGRAM) | |
180 | state->speedup_ram = state->cpu->space(AS_PROGRAM).install_legacy_write_handler(speedup, speedup, FUNC(speedup_w)); | |
181 | 181 | |
182 | 182 | for (chan = 0; chan < DAC_BUFFER_CHANNELS; chan++) |
183 | 183 | { |
r18027 | r18028 | |
---|---|---|
385 | 385 | static STREAM_UPDATE( leland_80186_dma_update ) |
386 | 386 | { |
387 | 387 | leland_sound_state *state = get_safe_token(device); |
388 | address_space | |
388 | address_space &dmaspace = *(address_space *)param; | |
389 | 389 | stream_sample_t *buffer = outputs[0]; |
390 | 390 | int i, j; |
391 | 391 | |
r18027 | r18028 | |
434 | 434 | /* sample-rate convert to the output frequency */ |
435 | 435 | for (j = 0; j < samples && count > 0; j++) |
436 | 436 | { |
437 | buffer[j] += ((int)dmaspace | |
437 | buffer[j] += ((int)dmaspace.read_byte(source) - 0x80) * volume; | |
438 | 438 | frac += step; |
439 | 439 | source += frac >> 24; |
440 | 440 | count -= frac >> 24; |
r18027 | r18028 | |
521 | 521 | { |
522 | 522 | leland_sound_state *state = get_safe_token(device); |
523 | 523 | running_machine &machine = device->machine(); |
524 | address_space | |
524 | address_space &dmaspace = machine.device("audiocpu")->memory().space(AS_PROGRAM); | |
525 | 525 | int i; |
526 | 526 | |
527 | 527 | /* determine which sound hardware is installed */ |
528 | 528 | state->m_has_ym2151 = (device->machine().device("ymsnd") != NULL); |
529 | 529 | |
530 | 530 | /* allocate separate streams for the DMA and non-DMA DACs */ |
531 | state->m_dma_stream = device->machine().sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, (void *)dmaspace, leland_80186_dma_update); | |
531 | state->m_dma_stream = device->machine().sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, (void *)&dmaspace, leland_80186_dma_update); | |
532 | 532 | state->m_nondma_stream = device->machine().sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, NULL, leland_80186_dac_update); |
533 | 533 | |
534 | 534 | /* if we have a 2151, install an externally driven DAC stream */ |
r18027 | r18028 | |
539 | 539 | } |
540 | 540 | |
541 | 541 | /* create timers here so they stick around */ |
542 | state->m_i80186.cpu = &dmaspace | |
542 | state->m_i80186.cpu = &dmaspace.device(); | |
543 | 543 | state->m_i80186.timer[0].int_timer = machine.scheduler().timer_alloc(FUNC(internal_timer_int), device); |
544 | 544 | state->m_i80186.timer[1].int_timer = machine.scheduler().timer_alloc(FUNC(internal_timer_int), device); |
545 | 545 | state->m_i80186.timer[2].int_timer = machine.scheduler().timer_alloc(FUNC(internal_timer_int), device); |
r18027 | r18028 | |
1591 | 1591 | temp = (state->m_i80186.mem.peripheral & 0xffc0) << 4; |
1592 | 1592 | if (state->m_i80186.mem.middle_size & 0x0040) |
1593 | 1593 | { |
1594 | state->m_i80186.cpu->memory().space(AS_PROGRAM) | |
1594 | state->m_i80186.cpu->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(*device, temp, temp + 0x2ff, FUNC(peripheral_r), FUNC(peripheral_w)); | |
1595 | 1595 | } |
1596 | 1596 | else |
1597 | 1597 | { |
1598 | 1598 | temp &= 0xffff; |
1599 | state->m_i80186.cpu->memory().space(AS_IO) | |
1599 | state->m_i80186.cpu->memory().space(AS_IO).install_legacy_readwrite_handler(*device, temp, temp + 0x2ff, FUNC(peripheral_r), FUNC(peripheral_w)); | |
1600 | 1600 | } |
1601 | 1601 | |
1602 | 1602 | /* we need to do this at a time when the 80186 context is swapped in */ |
r18027 | r18028 | |
1662 | 1662 | temp = (data & 0x0fff) << 8; |
1663 | 1663 | if (data & 0x1000) |
1664 | 1664 | { |
1665 | state->m_i80186.cpu->memory().space(AS_PROGRAM) | |
1665 | state->m_i80186.cpu->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(*device, temp, temp + 0xff, FUNC(i80186_internal_port_r), FUNC(i80186_internal_port_w)); | |
1666 | 1666 | } |
1667 | 1667 | else |
1668 | 1668 | { |
1669 | 1669 | temp &= 0xffff; |
1670 | state->m_i80186.cpu->memory().space(AS_IO) | |
1670 | state->m_i80186.cpu->memory().space(AS_IO).install_legacy_readwrite_handler(*device, temp, temp + 0xff, FUNC(i80186_internal_port_r), FUNC(i80186_internal_port_w)); | |
1671 | 1671 | } |
1672 | 1672 | /* popmessage("Sound CPU reset");*/ |
1673 | 1673 | break; |
r18027 | r18028 | |
---|---|---|
104 | 104 | |
105 | 105 | void seibu_sound_decrypt(running_machine &machine,const char *cpu,int length) |
106 | 106 | { |
107 | address_space &space = | |
107 | address_space &space = machine.device(cpu)->memory().space(AS_PROGRAM); | |
108 | 108 | UINT8 *decrypt = auto_alloc_array(machine, UINT8, length); |
109 | 109 | UINT8 *rom = machine.root_device().memregion(cpu)->base(); |
110 | 110 | int i; |
r18027 | r18028 | |
---|---|---|
127 | 127 | { |
128 | 128 | driver_device *drvstate = space.machine().driver_data<driver_device>(); |
129 | 129 | space.machine().device("audiocpu")->execute().set_input_line(0, CLEAR_LINE); |
130 | return drvstate->soundlatch_byte_r( | |
130 | return drvstate->soundlatch_byte_r(space.machine().device("audiocpu")->memory().space(AS_PROGRAM),0); | |
131 | 131 | } |
132 | 132 | |
133 | 133 | static void filter_w(device_t *device, int data) |
r18027 | r18028 | |
---|---|---|
944 | 944 | |
945 | 945 | /* find the DCS CPU and the sound ROMs */ |
946 | 946 | dcs.cpu = machine.device<adsp21xx_device>("dcs"); |
947 | dcs.program = dcs.cpu->space(AS_PROGRAM); | |
948 | dcs.data = dcs.cpu->space(AS_DATA); | |
947 | dcs.program = &dcs.cpu->space(AS_PROGRAM); | |
948 | dcs.data = &dcs.cpu->space(AS_DATA); | |
949 | 949 | dcs.rev = 1; |
950 | 950 | dcs.channels = 1; |
951 | 951 | dcs.dmadac[0] = machine.device<dmadac_sound_device>("dac"); |
r18027 | r18028 | |
997 | 997 | dcs.rev = 4; |
998 | 998 | soundbank_words = 0x800; |
999 | 999 | } |
1000 | dcs.program = dcs.cpu->space(AS_PROGRAM); | |
1001 | dcs.data = dcs.cpu->space(AS_DATA); | |
1000 | dcs.program = &dcs.cpu->space(AS_PROGRAM); | |
1001 | dcs.data = &dcs.cpu->space(AS_DATA); | |
1002 | 1002 | dcs.channels = 2; |
1003 | 1003 | dcs.dmadac[0] = machine.device<dmadac_sound_device>("dac1"); |
1004 | 1004 | dcs.dmadac[1] = machine.device<dmadac_sound_device>("dac2"); |
r18027 | r18028 | |
1036 | 1036 | /* install the speedup handler */ |
1037 | 1037 | dcs.polling_offset = polling_offset; |
1038 | 1038 | if (polling_offset) |
1039 | dcs.polling_base = dcs.cpu->space(AS_DATA) | |
1039 | dcs.polling_base = dcs.cpu->space(AS_DATA).install_legacy_readwrite_handler(dcs.polling_offset, dcs.polling_offset, FUNC(dcs_polling_r), FUNC(dcs_polling_w)); | |
1040 | 1040 | |
1041 | 1041 | /* allocate a watchdog timer for HLE transfers */ |
1042 | 1042 | dcs.transfer.hle_enabled = (ENABLE_HLE_TRANSFERS && dram_in_mb != 0); |
r18027 | r18028 | |
1175 | 1175 | |
1176 | 1176 | /* reinstall the polling hotspot */ |
1177 | 1177 | if (dcs.polling_offset) |
1178 | dcs.polling_base = dcs.cpu->space(AS_DATA) | |
1178 | dcs.polling_base = dcs.cpu->space(AS_DATA).install_legacy_readwrite_handler(dcs.polling_offset, dcs.polling_offset, FUNC(dcs_polling_r), FUNC(dcs_polling_w)); | |
1179 | 1179 | } |
1180 | 1180 | |
1181 | 1181 | |
r18027 | r18028 | |
2137 | 2137 | machine.scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback2), param); |
2138 | 2138 | return; |
2139 | 2139 | } |
2140 | output_latch_w( | |
2140 | output_latch_w(dcs.cpu->space(AS_PROGRAM), 0, 0x000a, 0xffff); | |
2141 | 2141 | } |
2142 | 2142 | |
2143 | 2143 | |
r18027 | r18028 | |
2149 | 2149 | machine.scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback1), param); |
2150 | 2150 | return; |
2151 | 2151 | } |
2152 | output_latch_w( | |
2152 | output_latch_w(dcs.cpu->space(AS_PROGRAM), 0, param, 0xffff); | |
2153 | 2153 | |
2154 | 2154 | /* chain to the next word we need to write back */ |
2155 | 2155 | machine.scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback2)); |
r18027 | r18028 | |
2281 | 2281 | |
2282 | 2282 | static TIMER_CALLBACK( s2_ack_callback ) |
2283 | 2283 | { |
2284 | address_space &space = | |
2284 | address_space &space = dcs.cpu->space(AS_PROGRAM); | |
2285 | 2285 | |
2286 | 2286 | /* if the output is full, stall for a usec */ |
2287 | 2287 | if (IS_OUTPUT_FULL()) |
r18027 | r18028 | |
---|---|---|
897 | 897 | |
898 | 898 | static void schaser_reinit_555_time_remain(_8080bw_state *state) |
899 | 899 | { |
900 | address_space &space = | |
900 | address_space &space = state->m_maincpu->space(AS_PROGRAM); | |
901 | 901 | state->m_schaser_effect_555_time_remain = attotime::from_double(state->m_schaser_effect_555_time_remain_savable); |
902 | 902 | state->schaser_sh_port_2_w(space, 0, state->m_port_2_last_extra); |
903 | 903 | } |
r18027 | r18028 | |
918 | 918 | |
919 | 919 | MACHINE_RESET_MEMBER(_8080bw_state,schaser_sh) |
920 | 920 | { |
921 | address_space &space = | |
921 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
922 | 922 | |
923 | 923 | m_schaser_effect_555_is_low = 0; |
924 | 924 | m_schaser_effect_555_timer->adjust(attotime::never); |
r18027 | r18028 | |
---|---|---|
24 | 24 | { |
25 | 25 | hyprolyb_adpcm_state *state = get_safe_token(device); |
26 | 26 | |
27 | state->m_space = device->machine().device("audiocpu")->memory().space(AS_PROGRAM); | |
27 | state->m_space = &device->machine().device("audiocpu")->memory().space(AS_PROGRAM); | |
28 | 28 | state->m_msm = device->machine().device("msm"); |
29 | 29 | device->save_item(NAME(state->m_adpcm_ready)); // only bootlegs |
30 | 30 | device->save_item(NAME(state->m_adpcm_busy)); |
r18027 | r18028 | |
---|---|---|
76 | 76 | |
77 | 77 | static TIMER_CALLBACK( signal_irq ) |
78 | 78 | { |
79 | amiga_custom_w( | |
79 | amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | (0x80 << param), 0xffff); | |
80 | 80 | } |
81 | 81 | |
82 | 82 |
r18027 | r18028 | |
---|---|---|
1491 | 1491 | { |
1492 | 1492 | cinemat_state *state = machine.driver_data<cinemat_state>(); |
1493 | 1493 | SOUND_RESET_CALL(demon_sound); |
1494 | machine.device("maincpu")->memory().space(AS_IO) | |
1494 | machine.device("maincpu")->memory().space(AS_IO).install_write_handler(0x04, 0x04, write8_delegate(FUNC(cinemat_state::qb3_sound_w),state)); | |
1495 | 1495 | |
1496 | 1496 | /* this patch prevents the sound ROM from eating itself when command $0A is sent */ |
1497 | 1497 | /* on a cube rotate */ |
r18027 | r18028 | |
---|---|---|
231 | 231 | |
232 | 232 | READ16_MEMBER(harddriv_state::hdsnd68k_320ports_r) |
233 | 233 | { |
234 | return m_sounddsp->space(AS_IO) | |
234 | return m_sounddsp->space(AS_IO).read_word((offset & 7) << 1); | |
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | WRITE16_MEMBER(harddriv_state::hdsnd68k_320ports_w) |
239 | 239 | { |
240 | m_sounddsp->space(AS_IO) | |
240 | m_sounddsp->space(AS_IO).write_word((offset & 7) << 1, data); | |
241 | 241 | } |
242 | 242 | |
243 | 243 |
r18027 | r18028 | |
---|---|---|
125 | 125 | |
126 | 126 | state->samples = device->machine().root_device().memregion("samples")->base(); |
127 | 127 | state->samples_size = device->machine().root_device().memregion("samples")->bytes(); |
128 | state->space = device->machine().device("soundcpu")->memory().space(AS_IO); | |
128 | state->space = &device->machine().device("soundcpu")->memory().space(AS_IO); | |
129 | 129 | state->dac = device->machine().device<dac_device>("dac"); |
130 | 130 | |
131 | 131 | device->save_item(NAME(state->irqvector)); |
r18027 | r18028 | |
---|---|---|
129 | 129 | // going high halts the CPU |
130 | 130 | if (state) |
131 | 131 | { |
132 | bank_select_w( | |
132 | bank_select_w(m_cpu->space(), 0, 0); | |
133 | 133 | device_reset(); |
134 | 134 | m_cpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); |
135 | 135 | } |
r18027 | r18028 | |
404 | 404 | // going high halts the CPU |
405 | 405 | if (state) |
406 | 406 | { |
407 | master_bank_select_w(*m_cpu0->space(), 0, 0); | |
408 | slave_bank_select_w(*m_cpu1->space(), 0, 0); | |
407 | master_bank_select_w(m_cpu0->space(), 0, 0); | |
408 | slave_bank_select_w(m_cpu1->space(), 0, 0); | |
409 | 409 | device_reset(); |
410 | 410 | m_cpu0->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); |
411 | 411 | m_cpu1->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); |
r18027 | r18028 | |
772 | 772 | // going high halts the CPU |
773 | 773 | if (state) |
774 | 774 | { |
775 | bank_select_w( | |
775 | bank_select_w(m_cpu->space(), 0, 0); | |
776 | 776 | device_reset(); |
777 | 777 | m_cpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); |
778 | 778 | } |
r18027 | r18028 | |
---|---|---|
425 | 425 | if (audiocpu != NULL && audiocpu->type() != Z80) |
426 | 426 | { |
427 | 427 | state->m_eabank = "bank1"; |
428 | audiocpu->memory().space(AS_PROGRAM) | |
428 | audiocpu->memory().space(AS_PROGRAM).install_read_bank(0x000, 0x7ff, "bank1"); | |
429 | 429 | state->membank("bank1")->configure_entry(0, state->memregion("audiocpu")->base()); |
430 | 430 | state->membank("bank1")->configure_entry(1, state->memregion("audiocpu")->base() + 0x1000); |
431 | 431 | } |
r18027 | r18028 | |
437 | 437 | static SOUND_RESET( mario ) |
438 | 438 | { |
439 | 439 | mario_state *state = machine.driver_data<mario_state>(); |
440 | address_space &space = | |
440 | address_space &space = machine.device("audiocpu")->memory().space(AS_PROGRAM); | |
441 | 441 | |
442 | 442 | #if USE_8039 |
443 | 443 | set_ea(machine, 1); |
r18027 | r18028 | |
---|---|---|
60 | 60 | }; |
61 | 61 | |
62 | 62 | |
63 | address_space &space = | |
63 | address_space &space = machine.device(cputag)->memory().space(AS_PROGRAM); | |
64 | 64 | UINT8 *rom = machine.root_device().memregion(cputag)->base(); |
65 | 65 | UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x8000); |
66 | 66 |
r18027 | r18028 | |
---|---|---|
311 | 311 | static void fm_update(int channel) |
312 | 312 | { |
313 | 313 | struct fm_control *fm = &NMK004_state.fm_control[channel]; |
314 | address_space &space = | |
314 | address_space &space = NMK004_state.machine().firstcpu->space(AS_PROGRAM); | |
315 | 315 | |
316 | 316 | // advance the timers |
317 | 317 | if (fm->timer1) |
r18027 | r18028 | |
595 | 595 | }; |
596 | 596 | int channel,i; |
597 | 597 | |
598 | address_space &space = | |
598 | address_space &space = NMK004_state.machine().firstcpu->space(AS_PROGRAM); | |
599 | 599 | for (channel = 0; channel < 3;channel++) |
600 | 600 | { |
601 | 601 | struct fm_control *fm1 = &NMK004_state.fm_control[channel]; |
r18027 | r18028 | |
684 | 684 | static void psg_update(int channel) |
685 | 685 | { |
686 | 686 | struct psg_control *psg = &NMK004_state.psg_control[channel]; |
687 | address_space &space = | |
687 | address_space &space = NMK004_state.machine().firstcpu->space(AS_PROGRAM); | |
688 | 688 | |
689 | 689 | // advance the timers |
690 | 690 | if (psg->note_timer) |
r18027 | r18028 | |
1003 | 1003 | { |
1004 | 1004 | if (irq) |
1005 | 1005 | { |
1006 | address_space &space = | |
1006 | address_space &space = NMK004_state.machine().firstcpu->space(AS_PROGRAM); | |
1007 | 1007 | int status = ym2203_status_port_r(device,space,0); |
1008 | 1008 | |
1009 | 1009 | if (status & 1) // timer A expired |
r18027 | r18028 | |
1039 | 1039 | |
1040 | 1040 | NMK004_state.rom = machine.root_device().memregion("audiocpu")->base(); |
1041 | 1041 | |
1042 | address_space &space = | |
1042 | address_space &space = NMK004_state.machine().firstcpu->space(AS_PROGRAM); | |
1043 | 1043 | ym2203_control_port_w(NMK004_state.ymdevice, space, 0, 0x2f); |
1044 | 1044 | |
1045 | 1045 | i = 0; |
r18027 | r18028 | |
---|---|---|
253 | 253 | decrypt(0x000000, romsize, m_plaintext, m_decrypted_opcodes, rombase); |
254 | 254 | |
255 | 255 | // mark the ROM region as decrypted, pointing to the opcodes (if it is mapped) |
256 | address_space *program = space(AS_PROGRAM); | |
257 | if (program->get_read_ptr(0) != NULL) | |
258 | program->set_decrypted_region(0x000000, romsize - 1, m_decrypted_opcodes); | |
256 | address_space &program = space(AS_PROGRAM); | |
257 | if (program.get_read_ptr(0) != NULL) | |
258 | program.set_decrypted_region(0x000000, romsize - 1, m_decrypted_opcodes); | |
259 | 259 | } |
260 | 260 | |
261 | 261 |
r18027 | r18028 | |
---|---|---|
162 | 162 | |
163 | 163 | void install_twcup98_protection(running_machine &machine) |
164 | 164 | { |
165 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
165 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x4fffff0, 0x4ffffff, FUNC(twcup98_prot_r), FUNC(twcup98_prot_w)); | |
166 | 166 | } |
167 | 167 | |
168 | 168 | /************************** |
r18027 | r18028 | |
227 | 227 | |
228 | 228 | void install_sss_protection(running_machine &machine) |
229 | 229 | { |
230 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
230 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x4fffff0, 0x4ffffff, FUNC(sss_prot_r), FUNC(sss_prot_w)); | |
231 | 231 | } |
232 | 232 | |
233 | 233 | /************************************* |
r18027 | r18028 | |
292 | 292 | |
293 | 293 | void install_rsgun_protection(running_machine &machine) |
294 | 294 | { |
295 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
295 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x4fffff0, 0x4ffffff, FUNC(rsgun_prot_r), FUNC(rsgun_prot_w)); | |
296 | 296 | } |
297 | 297 | |
298 | 298 | /************************* |
r18027 | r18028 | |
387 | 387 | |
388 | 388 | void install_elandore_protection(running_machine &machine) |
389 | 389 | { |
390 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
390 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x4fffff0, 0x4ffffff, FUNC(elandore_prot_r), FUNC(elandore_prot_w)); | |
391 | 391 | } |
392 | 392 | |
393 | 393 | /************************* |
r18027 | r18028 | |
471 | 471 | |
472 | 472 | void install_ffreveng_protection(running_machine &machine) |
473 | 473 | { |
474 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
474 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x4fffff0, 0x4ffffff, FUNC(ffreveng_prot_r), FUNC(ffreveng_prot_w)); | |
475 | 475 | } |
476 | 476 | |
477 | 477 | /************************ |
r18027 | r18028 | |
511 | 511 | void install_astrass_protection(running_machine &machine) |
512 | 512 | { |
513 | 513 | ctrl_index = -1; |
514 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
514 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x4fffff0, 0x4ffffff, FUNC(astrass_prot_r), FUNC(astrass_prot_w)); | |
515 | 515 | } |
516 | 516 | |
517 | 517 | /************************** |
r18027 | r18028 | |
698 | 698 | decathlt_prot_uploadmode = 0; |
699 | 699 | decathlt_prot_uploadoffset = 0; |
700 | 700 | decathlt_part = 1; |
701 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
701 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x37FFFF0, 0x37FFFFF, FUNC(decathlt_prot_r), FUNC(decathlt_prot1_w)); | |
702 | 702 | /* It accesses the device at this address too, with different tables, for the game textures, should it just act like a mirror, or a secondary device? */ |
703 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
703 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x27FFFF0, 0x27FFFFF, FUNC(decathlt_prot_r), FUNC(decathlt_prot2_w)); | |
704 | 704 | } |
705 | 705 | |
706 | 706 | void stv_register_protection_savestates(running_machine &machine) |
r18027 | r18028 | |
---|---|---|
138 | 138 | |
139 | 139 | void asic65_reset(running_machine &machine, int state) |
140 | 140 | { |
141 | address_space &space = | |
141 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
142 | 142 | |
143 | 143 | /* rom-based means reset and clear states */ |
144 | 144 | if (asic65.cpu != NULL) |
r18027 | r18028 | |
---|---|---|
528 | 528 | m_mcu_type = MCU_DRTOPPEL; |
529 | 529 | |
530 | 530 | /* drtoppel writes to the palette RAM area even if it has PROMs! We have to patch it out. */ |
531 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
531 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write(0xf800, 0xfbff); | |
532 | 532 | } |
533 | 533 | |
534 | 534 | DRIVER_INIT_MEMBER(tnzs_state,chukatai) |
r18027 | r18028 | |
540 | 540 | { |
541 | 541 | m_mcu_type = MCU_TNZS; |
542 | 542 | /* we need to install a kludge to avoid problems with a bug in the original code */ |
543 | // machine().device("maincpu")->memory().space(AS_PROGRAM) | |
543 | // machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xef10, 0xef10, FUNC(tnzs_sync_kludge_w)); | |
544 | 544 | } |
545 | 545 | |
546 | 546 | DRIVER_INIT_MEMBER(tnzs_state,tnzsb) |
r18027 | r18028 | |
548 | 548 | m_mcu_type = MCU_NONE_TNZSB; |
549 | 549 | |
550 | 550 | /* we need to install a kludge to avoid problems with a bug in the original code */ |
551 | // machine().device("maincpu")->memory().space(AS_PROGRAM) | |
551 | // machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xef10, 0xef10, FUNC(tnzs_sync_kludge_w)); | |
552 | 552 | } |
553 | 553 | |
554 | 554 | DRIVER_INIT_MEMBER(tnzs_state,kabukiz) |
r18027 | r18028 | |
564 | 564 | m_mcu_type = MCU_NONE_INSECTX; |
565 | 565 | |
566 | 566 | /* this game has no mcu, replace the handler with plain input port handlers */ |
567 | machine().device("sub")->memory().space(AS_PROGRAM)->install_read_port(0xc000, 0xc000, "IN0" ); | |
568 | machine().device("sub")->memory().space(AS_PROGRAM)->install_read_port(0xc001, 0xc001, "IN1" ); | |
569 | machine().device("sub")->memory().space(AS_PROGRAM)->install_read_port(0xc002, 0xc002, "IN2" ); | |
567 | machine().device("sub")->memory().space(AS_PROGRAM).install_read_port(0xc000, 0xc000, "IN0" ); | |
568 | machine().device("sub")->memory().space(AS_PROGRAM).install_read_port(0xc001, 0xc001, "IN1" ); | |
569 | machine().device("sub")->memory().space(AS_PROGRAM).install_read_port(0xc002, 0xc002, "IN2" ); | |
570 | 570 | } |
571 | 571 | |
572 | 572 | DRIVER_INIT_MEMBER(tnzs_state,kageki) |
r18027 | r18028 | |
---|---|---|
297 | 297 | switch (sound) |
298 | 298 | { |
299 | 299 | case SOUND_CVSD_SMALL: |
300 | machine.device("cvsd:cpu")->memory().space(AS_PROGRAM) | |
300 | machine.device("cvsd:cpu")->memory().space(AS_PROGRAM).install_write_handler(prot_start, prot_end, write8_delegate(FUNC(midyunit_state::cvsd_protection_w),state)); | |
301 | 301 | state->m_cvsd_protection_base = machine.root_device().memregion("cvsd:cpu")->base() + 0x10000 + (prot_start - 0x8000); |
302 | 302 | break; |
303 | 303 | |
304 | 304 | case SOUND_CVSD: |
305 | machine.device("cvsd:cpu")->memory().space(AS_PROGRAM) | |
305 | machine.device("cvsd:cpu")->memory().space(AS_PROGRAM).install_ram(prot_start, prot_end); | |
306 | 306 | break; |
307 | 307 | |
308 | 308 | case SOUND_ADPCM: |
309 | machine.device("adpcm:cpu")->memory().space(AS_PROGRAM) | |
309 | machine.device("adpcm:cpu")->memory().space(AS_PROGRAM).install_ram(prot_start, prot_end); | |
310 | 310 | break; |
311 | 311 | |
312 | 312 | case SOUND_NARC: |
313 | machine.device("narcsnd:cpu0")->memory().space(AS_PROGRAM) | |
313 | machine.device("narcsnd:cpu0")->memory().space(AS_PROGRAM).install_ram(prot_start, prot_end); | |
314 | 314 | break; |
315 | 315 | |
316 | 316 | case SOUND_YAWDIM: |
r18027 | r18028 | |
478 | 478 | DRIVER_INIT_MEMBER(midyunit_state,mkyturbo) |
479 | 479 | { |
480 | 480 | /* protection */ |
481 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
481 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xfffff400, 0xfffff40f, read16_delegate(FUNC(midyunit_state::mkturbo_prot_r),this)); | |
482 | 482 | |
483 | 483 | DRIVER_INIT_CALL(mkyunit); |
484 | 484 | } |
r18027 | r18028 | |
500 | 500 | init_generic(machine, 6, SOUND_ADPCM, 0xfa8d, 0xfa9c); |
501 | 501 | |
502 | 502 | /* special inputs */ |
503 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x01c00000, 0x01c0005f, read16_delegate(FUNC(midyunit_state::term2_input_r),state)); | |
504 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x01e00000, 0x01e0001f, write16_delegate(FUNC(midyunit_state::term2_sound_w),state)); | |
503 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x01c00000, 0x01c0005f, read16_delegate(FUNC(midyunit_state::term2_input_r),state)); | |
504 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x01e00000, 0x01e0001f, write16_delegate(FUNC(midyunit_state::term2_sound_w),state)); | |
505 | 505 | |
506 | 506 | /* HACK: this prevents the freeze on the movies */ |
507 | 507 | /* until we figure whats causing it, this is better than nothing */ |
508 | state->m_t2_hack_mem = machine.device("maincpu")->memory().space(AS_PROGRAM) | |
508 | state->m_t2_hack_mem = machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x010aa0e0, 0x010aa0ff, hack_w); | |
509 | 509 | } |
510 | 510 | |
511 | 511 | DRIVER_INIT_MEMBER(midyunit_state,term2) { term2_init_common(machine(), write16_delegate(FUNC(midyunit_state::term2_hack_w),this)); } |
r18027 | r18028 | |
---|---|---|
192 | 192 | |
193 | 193 | DRIVER_INIT_MEMBER(dc_state,naomi) |
194 | 194 | { |
195 | //machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc2ad238, 0xc2ad23f, FUNC(naomi_biose_idle_skip_r)); // rev e bios | |
196 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc2b0600, 0xc2b0607, FUNC(naomi_biosh_idle_skip_r)); // rev h bios | |
195 | //machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xc2ad238, 0xc2ad23f, FUNC(naomi_biose_idle_skip_r)); // rev e bios | |
196 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xc2b0600, 0xc2b0607, FUNC(naomi_biosh_idle_skip_r)); // rev h bios | |
197 | 197 | jvsboard_type = JVSBD_DEFAULT; |
198 | 198 | actel_id = 0xffff; |
199 | 199 | |
r18027 | r18028 | |
202 | 202 | |
203 | 203 | DRIVER_INIT_MEMBER(dc_state,naomi2) |
204 | 204 | { |
205 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
205 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xc2b0600, 0xc2b0607, FUNC(naomi2_biose_idle_skip_r)); // rev e bios | |
206 | 206 | jvsboard_type = JVSBD_DEFAULT; |
207 | 207 | actel_id = 0xffff; |
208 | 208 | |
r18027 | r18028 | |
211 | 211 | |
212 | 212 | DRIVER_INIT_MEMBER(dc_state,naomi_mp) |
213 | 213 | { |
214 | //machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc2ad238, 0xc2ad23f, FUNC(naomi_biose_idle_skip_r)); // rev e bios | |
215 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc2b0600, 0xc2b0607, FUNC(naomi_biosh_idle_skip_r)); // rev h bios | |
214 | //machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xc2ad238, 0xc2ad23f, FUNC(naomi_biose_idle_skip_r)); // rev e bios | |
215 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xc2b0600, 0xc2b0607, FUNC(naomi_biosh_idle_skip_r)); // rev h bios | |
216 | 216 | jvsboard_type = JVSBD_MAHJONG; |
217 | 217 | actel_id = 0xffff; |
218 | 218 | |
r18027 | r18028 | |
221 | 221 | |
222 | 222 | DRIVER_INIT_MEMBER(dc_state,naomigd) |
223 | 223 | { |
224 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc2ad238, 0xc2ad23f, FUNC(naomi_biose_idle_skip_r)); // rev e bios | |
225 | //machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc2b0600, 0xc2b0607, FUNC(naomi_biosh_idle_skip_r)); // rev h bios | |
224 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xc2ad238, 0xc2ad23f, FUNC(naomi_biose_idle_skip_r)); // rev e bios | |
225 | //machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xc2b0600, 0xc2b0607, FUNC(naomi_biosh_idle_skip_r)); // rev h bios | |
226 | 226 | jvsboard_type = JVSBD_DEFAULT; |
227 | 227 | actel_id = 0xffff; |
228 | 228 | |
r18027 | r18028 | |
231 | 231 | |
232 | 232 | DRIVER_INIT_MEMBER(dc_state,naomigd_mp) |
233 | 233 | { |
234 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc2ad238, 0xc2ad23f, FUNC(naomi_biose_idle_skip_r)); // rev e bios | |
235 | //machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc2b0600, 0xc2b0607, FUNC(naomi_biosh_idle_skip_r)); // rev h bios | |
234 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xc2ad238, 0xc2ad23f, FUNC(naomi_biose_idle_skip_r)); // rev e bios | |
235 | //machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xc2b0600, 0xc2b0607, FUNC(naomi_biosh_idle_skip_r)); // rev h bios | |
236 | 236 | jvsboard_type = JVSBD_MAHJONG; |
237 | 237 | actel_id = 0xffff; |
238 | 238 | |
r18027 | r18028 | |
250 | 250 | |
251 | 251 | DRIVER_INIT_MEMBER(dc_state,ggxxsla) |
252 | 252 | { |
253 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
253 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xc1aae18, 0xc1aae1f, FUNC(naomigd_ggxxsla_idle_skip_r)); | |
254 | 254 | DRIVER_INIT_CALL(naomigd); |
255 | 255 | } |
256 | 256 | |
r18027 | r18028 | |
265 | 265 | |
266 | 266 | DRIVER_INIT_MEMBER(dc_state,ggxx) |
267 | 267 | { |
268 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
268 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xc1837b8, 0xc1837bf, FUNC(naomigd_ggxx_idle_skip_r)); | |
269 | 269 | DRIVER_INIT_CALL(naomigd); |
270 | 270 | } |
271 | 271 | |
r18027 | r18028 | |
281 | 281 | |
282 | 282 | DRIVER_INIT_MEMBER(dc_state,ggxxrl) |
283 | 283 | { |
284 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
284 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xc18d6c8, 0xc18d6cf, FUNC(naomigd_ggxxrl_idle_skip_r)); | |
285 | 285 | DRIVER_INIT_CALL(naomigd); |
286 | 286 | } |
287 | 287 | |
r18027 | r18028 | |
296 | 296 | |
297 | 297 | DRIVER_INIT_MEMBER(dc_state,sfz3ugd) |
298 | 298 | { |
299 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
299 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xc5dc900, 0xc5dc907, FUNC(naomigd_sfz3ugd_idle_skip_r)); | |
300 | 300 | DRIVER_INIT_CALL(naomigd); |
301 | 301 | } |
302 | 302 | |
r18027 | r18028 | |
344 | 344 | |
345 | 345 | DRIVER_INIT_MEMBER(dc_state,hotd2) |
346 | 346 | { |
347 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
347 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xca25fb8, 0xca25fbf, FUNC(hotd2_idle_skip_r)); | |
348 | 348 | } |
349 | 349 | |
350 | 350 | // f355 PC=0xc065f7c RAM=0xc26dafc |
r18027 | r18028 | |
---|---|---|
133 | 133 | |
134 | 134 | void asteroid_state::machine_reset() |
135 | 135 | { |
136 | asteroid_bank_switch_w(*machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0); | |
137 | avgdvg_reset_w(*machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0); | |
136 | asteroid_bank_switch_w(machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0); | |
137 | avgdvg_reset_w(machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0); | |
138 | 138 | } |
r18027 | r18028 | |
---|---|---|
82 | 82 | |
83 | 83 | void mhavoc_state::machine_reset() |
84 | 84 | { |
85 | address_space &space = | |
85 | address_space &space = machine().device("alpha")->memory().space(AS_PROGRAM); | |
86 | 86 | m_has_gamma_cpu = (machine().device("gamma") != NULL); |
87 | 87 | |
88 | 88 | membank("bank1")->configure_entry(0, m_zram0); |
r18027 | r18028 | |
324 | 324 | { |
325 | 325 | /* install the speech support that was only optionally stuffed for use */ |
326 | 326 | /* in the Return to Vax hack */ |
327 | machine().device("gamma")->memory().space(AS_PROGRAM)->install_write_handler(0x5800, 0x5800, write8_delegate(FUNC(mhavoc_state::mhavocrv_speech_data_w),this)); | |
328 | machine().device("gamma")->memory().space(AS_PROGRAM)->install_write_handler(0x5900, 0x5900, write8_delegate(FUNC(mhavoc_state::mhavocrv_speech_strobe_w),this)); | |
327 | machine().device("gamma")->memory().space(AS_PROGRAM).install_write_handler(0x5800, 0x5800, write8_delegate(FUNC(mhavoc_state::mhavocrv_speech_data_w),this)); | |
328 | machine().device("gamma")->memory().space(AS_PROGRAM).install_write_handler(0x5900, 0x5900, write8_delegate(FUNC(mhavoc_state::mhavocrv_speech_strobe_w),this)); | |
329 | 329 | } |
r18027 | r18028 | |
---|---|---|
51 | 51 | { |
52 | 52 | /* DSP can read data from main CPU RAM via DSP IO port 1 */ |
53 | 53 | |
54 | address_space *mainspace; | |
55 | 54 | UINT16 input_data = 0; |
56 | 55 | switch (m_main_ram_seg) { |
57 | 56 | case 0x30000: |
58 | 57 | case 0x40000: |
59 | case 0x50000: mainspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
60 | input_data = mainspace->read_word(m_main_ram_seg + m_dsp_addr_w); | |
61 | break; | |
58 | case 0x50000: {address_space &mainspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
59 | input_data = mainspace.read_word(m_main_ram_seg + m_dsp_addr_w); | |
60 | break;} | |
62 | 61 | default: logerror("DSP PC:%04x Warning !!! IO reading from %08x (port 1)\n",space.device().safe_pcbase(),m_main_ram_seg + m_dsp_addr_w); break; |
63 | 62 | } |
64 | 63 | LOG(("DSP PC:%04x IO read %04x at %08x (port 1)\n",space.device().safe_pcbase(),input_data,m_main_ram_seg + m_dsp_addr_w)); |
r18027 | r18028 | |
67 | 66 | |
68 | 67 | WRITE16_MEMBER(twincobr_state::twincobr_dsp_w) |
69 | 68 | { |
70 | address_space *mainspace; | |
71 | ||
72 | 69 | /* Data written to main CPU RAM via DSP IO port 1 */ |
73 | 70 | m_dsp_execute = 0; |
74 | 71 | switch (m_main_ram_seg) { |
75 | 72 | case 0x30000: if ((m_dsp_addr_w < 3) && (data == 0)) m_dsp_execute = 1; |
76 | 73 | case 0x40000: |
77 | case 0x50000: mainspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
78 | mainspace->write_word(m_main_ram_seg + m_dsp_addr_w, data); | |
79 | break; | |
74 | case 0x50000: {address_space &mainspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
75 | mainspace.write_word(m_main_ram_seg + m_dsp_addr_w, data); | |
76 | break;} | |
80 | 77 | default: logerror("DSP PC:%04x Warning !!! IO writing to %08x (port 1)\n",space.device().safe_pcbase(),m_main_ram_seg + m_dsp_addr_w); break; |
81 | 78 | } |
82 | 79 | LOG(("DSP PC:%04x IO write %04x at %08x (port 1)\n",space.device().safe_pcbase(),data,m_main_ram_seg + m_dsp_addr_w)); |
r18027 | r18028 | |
101 | 98 | { |
102 | 99 | /* DSP can read data from main CPU RAM via DSP IO port 1 */ |
103 | 100 | |
104 | address_space *mainspace; | |
105 | 101 | UINT16 input_data = 0; |
106 | 102 | switch (m_main_ram_seg) { |
107 | 103 | case 0x7000: |
108 | 104 | case 0x8000: |
109 | case 0xa000: mainspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
110 | input_data = mainspace->read_byte(m_main_ram_seg + (m_dsp_addr_w + 0)) | |
111 | | (mainspace->read_byte(m_main_ram_seg + (m_dsp_addr_w + 1)) << 8); | |
112 | break; | |
105 | case 0xa000: {address_space &mainspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
106 | input_data = mainspace.read_byte(m_main_ram_seg + (m_dsp_addr_w + 0)) | |
107 | | (mainspace.read_byte(m_main_ram_seg + (m_dsp_addr_w + 1)) << 8); | |
108 | break;} | |
113 | 109 | default: logerror("DSP PC:%04x Warning !!! IO reading from %08x (port 1)\n",space.device().safe_pcbase(),m_main_ram_seg + m_dsp_addr_w); break; |
114 | 110 | } |
115 | 111 | LOG(("DSP PC:%04x IO read %04x at %08x (port 1)\n",space.device().safe_pcbase(),input_data,m_main_ram_seg + m_dsp_addr_w)); |
r18027 | r18028 | |
118 | 114 | |
119 | 115 | WRITE16_MEMBER(twincobr_state::wardner_dsp_w) |
120 | 116 | { |
121 | address_space *mainspace; | |
122 | ||
123 | 117 | /* Data written to main CPU RAM via DSP IO port 1 */ |
124 | 118 | m_dsp_execute = 0; |
125 | 119 | switch (m_main_ram_seg) { |
126 | 120 | case 0x7000: if ((m_dsp_addr_w < 3) && (data == 0)) m_dsp_execute = 1; |
127 | 121 | case 0x8000: |
128 | case 0xa000: mainspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
129 | mainspace->write_byte(m_main_ram_seg + (m_dsp_addr_w + 0), (data & 0xff)); | |
130 | mainspace->write_byte(m_main_ram_seg + (m_dsp_addr_w + 1), ((data >> 8) & 0xff)); | |
131 | break; | |
122 | case 0xa000: {address_space &mainspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
123 | mainspace.write_byte(m_main_ram_seg + (m_dsp_addr_w + 0), (data & 0xff)); | |
124 | mainspace.write_byte(m_main_ram_seg + (m_dsp_addr_w + 1), ((data >> 8) & 0xff)); | |
125 | break;} | |
132 | 126 | default: logerror("DSP PC:%04x Warning !!! IO writing to %08x (port 1)\n",space.device().safe_pcbase(),m_main_ram_seg + m_dsp_addr_w); break; |
133 | 127 | } |
134 | 128 | LOG(("DSP PC:%04x IO write %04x at %08x (port 1)\n",space.device().safe_pcbase(),data,m_main_ram_seg + m_dsp_addr_w)); |
r18027 | r18028 | |
---|---|---|
354 | 354 | |
355 | 355 | /* SVP stuff */ |
356 | 356 | state->m_dram = auto_alloc_array(machine, UINT8, 0x20000); |
357 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0x300000, 0x31ffff, state->m_dram); | |
358 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa15000, 0xa150ff, FUNC(svp_68k_io_r), FUNC(svp_68k_io_w)); | |
357 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_ram(0x300000, 0x31ffff, state->m_dram); | |
358 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0xa15000, 0xa150ff, FUNC(svp_68k_io_r), FUNC(svp_68k_io_w)); | |
359 | 359 | // "cell arrange" 1 and 2 |
360 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x390000, 0x39ffff, FUNC(svp_68k_cell1_r)); | |
361 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3a0000, 0x3affff, FUNC(svp_68k_cell2_r)); | |
360 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x390000, 0x39ffff, FUNC(svp_68k_cell1_r)); | |
361 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x3a0000, 0x3affff, FUNC(svp_68k_cell2_r)); | |
362 | 362 | |
363 | machine.device("svp")->memory().space(AS_PROGRAM) | |
363 | machine.device("svp")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x438, 0x438, FUNC(svp_speedup_r)); | |
364 | 364 | |
365 | 365 | state->m_iram = auto_alloc_array(machine, UINT8, 0x800); |
366 | 366 | state->membank("bank3")->set_base(state->m_iram); |
r18027 | r18028 | |
---|---|---|
178 | 178 | |
179 | 179 | void install_kof10th_protection ( running_machine &machine ) |
180 | 180 | { |
181 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2fe000, 0x2fffff, FUNC(kof10th_RAMB_r)); | |
182 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x200000, 0x23ffff, FUNC(kof10th_custom_w)); | |
183 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x240000, 0x2fffff, FUNC(kof10th_bankswitch_w)); | |
181 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x2fe000, 0x2fffff, FUNC(kof10th_RAMB_r)); | |
182 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x200000, 0x23ffff, FUNC(kof10th_custom_w)); | |
183 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x240000, 0x2fffff, FUNC(kof10th_bankswitch_w)); | |
184 | 184 | } |
185 | 185 | |
186 | 186 | void decrypt_kof10th(running_machine &machine) |
r18027 | r18028 | |
485 | 485 | UINT16 *mem16 = (UINT16 *)machine.root_device().memregion("maincpu")->base(); |
486 | 486 | |
487 | 487 | /* special ROM banking handler */ |
488 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
488 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x2ffff0, 0x2fffff, FUNC(cthd2003_bankswitch_w)); | |
489 | 489 | |
490 | 490 | // theres still a problem on the character select screen but it seems to be related to cpu core timing issues, |
491 | 491 | // overclocking the 68k prevents it. |
r18027 | r18028 | |
729 | 729 | void install_ms5plus_protection(running_machine &machine) |
730 | 730 | { |
731 | 731 | // special ROM banking handler / additional protection |
732 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
732 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x2ffff0, 0x2fffff,FUNC(mslug5_prot_r), FUNC(ms5plus_bankswitch_w)); | |
733 | 733 | } |
734 | 734 | |
735 | 735 | |
r18027 | r18028 | |
972 | 972 | |
973 | 973 | void kf2k3bl_install_protection(running_machine &machine) |
974 | 974 | { |
975 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
975 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x2fe000, 0x2fffff, FUNC(kof2003_r), FUNC(kof2003_w) ); | |
976 | 976 | } |
977 | 977 | |
978 | 978 | |
r18027 | r18028 | |
1000 | 1000 | |
1001 | 1001 | void kf2k3pl_install_protection(running_machine &machine) |
1002 | 1002 | { |
1003 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1003 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x2fe000, 0x2fffff, FUNC(kof2003_r), FUNC(kof2003p_w) ); | |
1004 | 1004 | } |
1005 | 1005 | |
1006 | 1006 | |
r18027 | r18028 | |
1031 | 1031 | |
1032 | 1032 | void kf2k3upl_install_protection(running_machine &machine) |
1033 | 1033 | { |
1034 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1034 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x2fe000, 0x2fffff, FUNC(kof2003_r), FUNC(kof2003_w) ); | |
1035 | 1035 | } |
1036 | 1036 | |
1037 | 1037 |
r18027 | r18028 | |
---|---|---|
414 | 414 | |
415 | 415 | READ16_MEMBER( sega_32x_device::_32x_dreq_common_r ) |
416 | 416 | { |
417 | address_space | |
417 | address_space& _68kspace = space.machine().device("maincpu")->memory().space(AS_PROGRAM); | |
418 | 418 | |
419 | 419 | switch (offset) |
420 | 420 | { |
r18027 | r18028 | |
430 | 430 | return m_dreq_size; |
431 | 431 | |
432 | 432 | case 0x0a/2: // a15112 / 4012 |
433 | if (&space == _68kspace) | |
433 | if (&space == &_68kspace) | |
434 | 434 | { |
435 | 435 | printf("attempting to READ FIFO with 68k!\n"); |
436 | 436 | return 0xffff; |
r18027 | r18028 | |
485 | 485 | |
486 | 486 | WRITE16_MEMBER( sega_32x_device::_32x_dreq_common_w ) |
487 | 487 | { |
488 | address_space | |
488 | address_space& _68kspace = space.machine().device("maincpu")->memory().space(AS_PROGRAM); | |
489 | 489 | |
490 | 490 | switch (offset) |
491 | 491 | { |
492 | 492 | case 0x00/2: // a15108 / 4008 |
493 | 493 | case 0x02/2: // a1510a / 400a |
494 | if (&space != _68kspace) | |
494 | if (&space != &_68kspace) | |
495 | 495 | { |
496 | 496 | printf("attempting to WRITE DREQ SRC with SH2!\n"); |
497 | 497 | return; |
r18027 | r18028 | |
506 | 506 | |
507 | 507 | case 0x04/2: // a1510c / 400c |
508 | 508 | case 0x06/2: // a1510e / 400e |
509 | if (&space != _68kspace) | |
509 | if (&space != &_68kspace) | |
510 | 510 | { |
511 | 511 | printf("attempting to WRITE DREQ DST with SH2!\n"); |
512 | 512 | return; |
r18027 | r18028 | |
520 | 520 | break; |
521 | 521 | |
522 | 522 | case 0x08/2: // a15110 / 4010 |
523 | if (&space != _68kspace) | |
523 | if (&space != &_68kspace) | |
524 | 524 | { |
525 | 525 | printf("attempting to WRITE DREQ SIZE with SH2!\n"); |
526 | 526 | return; |
r18027 | r18028 | |
534 | 534 | break; |
535 | 535 | |
536 | 536 | case 0x0a/2: // a15112 / 4012 - FIFO Write (68k only!) |
537 | if (&space != _68kspace) | |
537 | if (&space != &_68kspace) | |
538 | 538 | { |
539 | 539 | printf("attempting to WRITE FIFO with SH2!\n"); |
540 | 540 | return; |
r18027 | r18028 | |
688 | 688 | |
689 | 689 | |
690 | 690 | |
691 | space.machine().device("maincpu")->memory().space(AS_PROGRAM) | |
691 | space.machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x000070, 0x000073, read16_delegate(FUNC(sega_32x_device::_32x_68k_m_hint_vector_r),this), write16_delegate(FUNC(sega_32x_device::_32x_68k_m_hint_vector_w),this)); // h interrupt vector | |
692 | 692 | } |
693 | 693 | else |
694 | 694 | { |
695 | 695 | m_32x_adapter_enabled = 0; |
696 | 696 | |
697 | 697 | space.install_rom(0x0000000, 0x03fffff, space.machine().root_device().memregion("gamecart")->base()); |
698 | space.machine().device("maincpu")->memory().space(AS_PROGRAM) | |
698 | space.machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x000070, 0x000073, read16_delegate(FUNC(sega_32x_device::_32x_68k_m_hint_vector_r),this), write16_delegate(FUNC(sega_32x_device::_32x_68k_m_hint_vector_w),this)); // h interrupt vector | |
699 | 699 | } |
700 | 700 | } |
701 | 701 | |
r18027 | r18028 | |
1063 | 1063 | { |
1064 | 1064 | // what happens if the z80 accesses it, what authorization do we use? which address space do we get?? the z80 *can* write here and to the framebuffer via the window |
1065 | 1065 | |
1066 | address_space | |
1066 | address_space& _68kspace = space.machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1067 | 1067 | |
1068 | if (&space!= _68kspace) | |
1068 | if (&space!= &_68kspace) | |
1069 | 1069 | { |
1070 | 1070 | if (m_32x_access_auth!=1) |
1071 | 1071 | return; |
1072 | 1072 | } |
1073 | 1073 | |
1074 | if (&space== _68kspace) | |
1074 | if (&space== &_68kspace) | |
1075 | 1075 | { |
1076 | 1076 | if (m_32x_access_auth!=0) |
1077 | 1077 | return; |
r18027 | r18028 | |
1889 | 1889 | |
1890 | 1890 | if (m_32x_adapter_enabled == 0) |
1891 | 1891 | { |
1892 | machine().device(":maincpu")->memory().space(AS_PROGRAM)->install_rom(0x0000000, 0x03fffff, machine().root_device().memregion(":gamecart")->base()); | |
1893 | machine().device(":maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x000070, 0x000073, read16_delegate(FUNC(sega_32x_device::_32x_68k_m_hint_vector_r),this), write16_delegate(FUNC(sega_32x_device::_32x_68k_m_hint_vector_w),this)); // h interrupt vector | |
1892 | machine().device(":maincpu")->memory().space(AS_PROGRAM).install_rom(0x0000000, 0x03fffff, machine().root_device().memregion(":gamecart")->base()); | |
1893 | machine().device(":maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x000070, 0x000073, read16_delegate(FUNC(sega_32x_device::_32x_68k_m_hint_vector_r),this), write16_delegate(FUNC(sega_32x_device::_32x_68k_m_hint_vector_w),this)); // h interrupt vector | |
1894 | 1894 | }; |
1895 | 1895 | |
1896 | 1896 | |
1897 | 1897 | m_a15100_reg = 0x0000; |
1898 | machine().device(":maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xa15100, 0xa15101, read16_delegate(FUNC(sega_32x_device::_32x_68k_a15100_r),this), write16_delegate(FUNC(sega_32x_device::_32x_68k_a15100_w),this)); // framebuffer control regs | |
1899 | machine().device(":maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xa15102, 0xa15103, read16_delegate(FUNC(sega_32x_device::_32x_68k_a15102_r),this), write16_delegate(FUNC(sega_32x_device::_32x_68k_a15102_w),this)); // send irq to sh2 | |
1900 | machine().device(":maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xa15104, 0xa15105, read16_delegate(FUNC(sega_32x_device::_32x_68k_a15104_r),this), write16_delegate(FUNC(sega_32x_device::_32x_68k_a15104_w),this)); // 68k BANK rom set | |
1901 | machine().device(":maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xa15106, 0xa15107, read16_delegate(FUNC(sega_32x_device::_32x_68k_a15106_r),this), write16_delegate(FUNC(sega_32x_device::_32x_68k_a15106_w),this)); // dreq stuff | |
1902 | machine().device(":maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xa15108, 0xa15113, read16_delegate(FUNC(sega_32x_device::_32x_dreq_common_r),this), write16_delegate(FUNC(sega_32x_device::_32x_dreq_common_w),this)); // dreq src / dst / length /fifo | |
1898 | machine().device(":maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xa15100, 0xa15101, read16_delegate(FUNC(sega_32x_device::_32x_68k_a15100_r),this), write16_delegate(FUNC(sega_32x_device::_32x_68k_a15100_w),this)); // framebuffer control regs | |
1899 | machine().device(":maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xa15102, 0xa15103, read16_delegate(FUNC(sega_32x_device::_32x_68k_a15102_r),this), write16_delegate(FUNC(sega_32x_device::_32x_68k_a15102_w),this)); // send irq to sh2 | |
1900 | machine().device(":maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xa15104, 0xa15105, read16_delegate(FUNC(sega_32x_device::_32x_68k_a15104_r),this), write16_delegate(FUNC(sega_32x_device::_32x_68k_a15104_w),this)); // 68k BANK rom set | |
1901 | machine().device(":maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xa15106, 0xa15107, read16_delegate(FUNC(sega_32x_device::_32x_68k_a15106_r),this), write16_delegate(FUNC(sega_32x_device::_32x_68k_a15106_w),this)); // dreq stuff | |
1902 | machine().device(":maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xa15108, 0xa15113, read16_delegate(FUNC(sega_32x_device::_32x_dreq_common_r),this), write16_delegate(FUNC(sega_32x_device::_32x_dreq_common_w),this)); // dreq src / dst / length /fifo | |
1903 | 1903 | |
1904 | machine().device(":maincpu")->memory().space(AS_PROGRAM) | |
1904 | machine().device(":maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xa1511a, 0xa1511b, read16_delegate(FUNC(sega_32x_device::_32x_68k_a1511a_r),this), write16_delegate(FUNC(sega_32x_device::_32x_68k_a1511a_w),this)); // SEGA TV | |
1905 | 1905 | |
1906 | machine().device(":maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xa15120, 0xa1512f, read16_delegate(FUNC(sega_32x_device::_32x_68k_m_commsram_r),this), write16_delegate(FUNC(sega_32x_device::_32x_68k_m_commsram_w),this)); // comms reg 0-7 | |
1907 | machine().device(":maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xa15130, 0xa1513f, read16_delegate(FUNC(sega_32x_device::_32x_pwm_r),this), write16_delegate(FUNC(sega_32x_device::_32x_68k_pwm_w),this)); | |
1906 | machine().device(":maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xa15120, 0xa1512f, read16_delegate(FUNC(sega_32x_device::_32x_68k_m_commsram_r),this), write16_delegate(FUNC(sega_32x_device::_32x_68k_m_commsram_w),this)); // comms reg 0-7 | |
1907 | machine().device(":maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xa15130, 0xa1513f, read16_delegate(FUNC(sega_32x_device::_32x_pwm_r),this), write16_delegate(FUNC(sega_32x_device::_32x_68k_pwm_w),this)); | |
1908 | 1908 | |
1909 | machine().device(":maincpu")->memory().space(AS_PROGRAM) | |
1909 | machine().device(":maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0a130ec, 0x0a130ef, read16_delegate(FUNC(sega_32x_device::_32x_68k_MARS_r),this)); // system ID | |
1910 | 1910 | |
1911 | 1911 | |
1912 | 1912 |
r18027 | r18028 | |
---|---|---|
445 | 445 | init_tunit_generic(machine(), SOUND_ADPCM); |
446 | 446 | |
447 | 447 | /* protection */ |
448 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
448 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x1b00000, 0x1b6ffff, read16_delegate(FUNC(midtunit_state::mk_prot_r),this), write16_delegate(FUNC(midtunit_state::mk_prot_w),this)); | |
449 | 449 | |
450 | 450 | /* sound chip protection (hidden RAM) */ |
451 | machine().device("adpcm:cpu")->memory().space(AS_PROGRAM) | |
451 | machine().device("adpcm:cpu")->memory().space(AS_PROGRAM).install_ram(0xfb9c, 0xfbc6); | |
452 | 452 | } |
453 | 453 | |
454 | 454 | DRIVER_INIT_MEMBER(midtunit_state,mkturbo) |
455 | 455 | { |
456 | 456 | /* protection */ |
457 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
457 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xfffff400, 0xfffff40f, read16_delegate(FUNC(midtunit_state::mkturbo_prot_r),this)); | |
458 | 458 | |
459 | 459 | DRIVER_INIT_CALL(mktunit); |
460 | 460 | } |
r18027 | r18028 | |
469 | 469 | if (!te_protection) |
470 | 470 | { |
471 | 471 | nbajam_prot_table = nbajam_prot_values; |
472 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
472 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x1b14020, 0x1b2503f, read16_delegate(FUNC(midtunit_state::nbajam_prot_r),state), write16_delegate(FUNC(midtunit_state::nbajam_prot_w),state)); | |
473 | 473 | } |
474 | 474 | else |
475 | 475 | { |
476 | 476 | nbajam_prot_table = nbajamte_prot_values; |
477 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x1b15f40, 0x1b37f5f, read16_delegate(FUNC(midtunit_state::nbajam_prot_r),state), write16_delegate(FUNC(midtunit_state::nbajam_prot_w),state)); | |
478 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x1b95f40, 0x1bb7f5f, read16_delegate(FUNC(midtunit_state::nbajam_prot_r),state), write16_delegate(FUNC(midtunit_state::nbajam_prot_w),state)); | |
477 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x1b15f40, 0x1b37f5f, read16_delegate(FUNC(midtunit_state::nbajam_prot_r),state), write16_delegate(FUNC(midtunit_state::nbajam_prot_w),state)); | |
478 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x1b95f40, 0x1bb7f5f, read16_delegate(FUNC(midtunit_state::nbajam_prot_r),state), write16_delegate(FUNC(midtunit_state::nbajam_prot_w),state)); | |
479 | 479 | } |
480 | 480 | |
481 | 481 | /* sound chip protection (hidden RAM) */ |
482 | 482 | if (!te_protection) |
483 | machine.device("adpcm:cpu")->memory().space(AS_PROGRAM) | |
483 | machine.device("adpcm:cpu")->memory().space(AS_PROGRAM).install_ram(0xfbaa, 0xfbd4); | |
484 | 484 | else |
485 | machine.device("adpcm:cpu")->memory().space(AS_PROGRAM) | |
485 | machine.device("adpcm:cpu")->memory().space(AS_PROGRAM).install_ram(0xfbec, 0xfc16); | |
486 | 486 | } |
487 | 487 | |
488 | 488 | DRIVER_INIT_MEMBER(midtunit_state,nbajam) |
r18027 | r18028 | |
501 | 501 | init_tunit_generic(machine(), SOUND_ADPCM_LARGE); |
502 | 502 | |
503 | 503 | /* looks like the watchdog needs to be disabled */ |
504 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
504 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write(0x01d81060, 0x01d8107f); | |
505 | 505 | |
506 | 506 | /* protection */ |
507 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
507 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x1b00000, 0x1bfffff, read16_delegate(FUNC(midtunit_state::jdredd_prot_r),this), write16_delegate(FUNC(midtunit_state::jdredd_prot_w),this)); | |
508 | 508 | |
509 | 509 | /* sound chip protection (hidden RAM) */ |
510 | machine().device("adpcm:cpu")->memory().space(AS_PROGRAM)->install_read_bank(0xfbcf, 0xfbf9, "bank7"); | |
511 | machine().device("adpcm:cpu")->memory().space(AS_PROGRAM)->install_write_bank(0xfbcf, 0xfbf9, "bank9"); | |
510 | machine().device("adpcm:cpu")->memory().space(AS_PROGRAM).install_read_bank(0xfbcf, 0xfbf9, "bank7"); | |
511 | machine().device("adpcm:cpu")->memory().space(AS_PROGRAM).install_write_bank(0xfbcf, 0xfbf9, "bank9"); | |
512 | 512 | membank("adpcm:bank9")->set_base(auto_alloc_array(machine(), UINT8, 0x80)); |
513 | 513 | |
514 | 514 | #if ENABLE_ALL_JDREDD_LEVELS |
515 | 515 | /* how about the final levels? */ |
516 | jdredd_hack = machine().device("maincpu")->memory().space(AS_PROGRAM) | |
516 | jdredd_hack = machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xFFBA7FF0, 0xFFBA7FFf, FUNC(jdredd_hack_r)); | |
517 | 517 | #endif |
518 | 518 | } |
519 | 519 | |
r18027 | r18028 | |
534 | 534 | midtunit_gfx_rom_large = 1; |
535 | 535 | |
536 | 536 | /* protection */ |
537 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x00f20c60, 0x00f20c7f, write16_delegate(FUNC(midtunit_state::mk2_prot_w),this)); | |
538 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x00f42820, 0x00f4283f, write16_delegate(FUNC(midtunit_state::mk2_prot_w),this)); | |
539 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x01a190e0, 0x01a190ff, read16_delegate(FUNC(midtunit_state::mk2_prot_r),this)); | |
540 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x01a191c0, 0x01a191df, read16_delegate(FUNC(midtunit_state::mk2_prot_shift_r),this)); | |
541 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x01a3d0c0, 0x01a3d0ff, read16_delegate(FUNC(midtunit_state::mk2_prot_r),this)); | |
542 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x01d9d1e0, 0x01d9d1ff, read16_delegate(FUNC(midtunit_state::mk2_prot_const_r),this)); | |
543 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x01def920, 0x01def93f, read16_delegate(FUNC(midtunit_state::mk2_prot_const_r),this)); | |
537 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x00f20c60, 0x00f20c7f, write16_delegate(FUNC(midtunit_state::mk2_prot_w),this)); | |
538 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x00f42820, 0x00f4283f, write16_delegate(FUNC(midtunit_state::mk2_prot_w),this)); | |
539 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x01a190e0, 0x01a190ff, read16_delegate(FUNC(midtunit_state::mk2_prot_r),this)); | |
540 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x01a191c0, 0x01a191df, read16_delegate(FUNC(midtunit_state::mk2_prot_shift_r),this)); | |
541 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x01a3d0c0, 0x01a3d0ff, read16_delegate(FUNC(midtunit_state::mk2_prot_r),this)); | |
542 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x01d9d1e0, 0x01d9d1ff, read16_delegate(FUNC(midtunit_state::mk2_prot_const_r),this)); | |
543 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x01def920, 0x01def93f, read16_delegate(FUNC(midtunit_state::mk2_prot_const_r),this)); | |
544 | 544 | } |
545 | 545 | |
546 | 546 |
r18027 | r18028 | |
---|---|---|
42 | 42 | |
43 | 43 | UINT8 *konami1_decode(running_machine &machine, const char *cpu) |
44 | 44 | { |
45 | address_space &space = | |
45 | address_space &space = machine.device(cpu)->memory().space(AS_PROGRAM); | |
46 | 46 | const UINT8 *rom = machine.root_device().memregion(cpu)->base(); |
47 | 47 | int size = machine.root_device().memregion(cpu)->bytes(); |
48 | 48 | int A; |
r18027 | r18028 | |
---|---|---|
672 | 672 | "bank9", "bank10", "bank11", "bank12", "bank13", "bank14", "bank15", "bank16" |
673 | 673 | }; |
674 | 674 | static const char *const cputags[] = { "maincpu", "sub" }; |
675 | address_space &space = | |
675 | address_space &space = machine.device(cputags[(banknum >> 3) & 1])->memory().space(AS_PROGRAM); | |
676 | 676 | int bankstart = (banknum & 7) * 0x2000; |
677 | 677 | |
678 | 678 | /* for BANK handlers , memory direct and OP-code base */ |
r18027 | r18028 | |
1216 | 1216 | }; |
1217 | 1217 | namcos1_driver_init(machine(), &tankfrce_specific); |
1218 | 1218 | |
1219 | machine().device("mcu")->memory().space(AS_PROGRAM) | |
1219 | machine().device("mcu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x1400, 0x1401, FUNC(faceoff_inputs_r)); | |
1220 | 1220 | } |
1221 | 1221 | |
1222 | 1222 | /******************************************************************************* |
r18027 | r18028 | |
1307 | 1307 | DRIVER_INIT_MEMBER(namcos1_state,quester) |
1308 | 1308 | { |
1309 | 1309 | namcos1_driver_init(machine(), NULL); |
1310 | machine().device("mcu")->memory().space(AS_PROGRAM) | |
1310 | machine().device("mcu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x1400, 0x1401, FUNC(quester_paddle_r)); | |
1311 | 1311 | } |
1312 | 1312 | |
1313 | 1313 | |
r18027 | r18028 | |
1396 | 1396 | DRIVER_INIT_MEMBER(namcos1_state,berabohm) |
1397 | 1397 | { |
1398 | 1398 | namcos1_driver_init(machine(), NULL); |
1399 | machine().device("mcu")->memory().space(AS_PROGRAM) | |
1399 | machine().device("mcu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x1400, 0x1401, FUNC(berabohm_buttons_r)); | |
1400 | 1400 | } |
1401 | 1401 | |
1402 | 1402 | |
r18027 | r18028 | |
1466 | 1466 | DRIVER_INIT_MEMBER(namcos1_state,faceoff) |
1467 | 1467 | { |
1468 | 1468 | namcos1_driver_init(machine(), NULL); |
1469 | machine().device("mcu")->memory().space(AS_PROGRAM) | |
1469 | machine().device("mcu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x1400, 0x1401, FUNC(faceoff_inputs_r)); | |
1470 | 1470 | } |
r18027 | r18028 | |
---|---|---|
286 | 286 | pgm_photoy2k_decrypt(machine()); |
287 | 287 | pgm_arm7_type1_latch_init(machine()); |
288 | 288 | /* we only have a china internal ROM dumped for now.. allow region to be changed for debugging (to ensure all alt titles / regions can be seen) */ |
289 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
289 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x4f0008, 0x4f0009, FUNC(kovsh_fake_region_r)); | |
290 | 290 | } |
291 | 291 | |
292 | 292 | DRIVER_INIT_MEMBER(pgm_arm_type1_state,kovsh) |
r18027 | r18028 | |
295 | 295 | pgm_kovsh_decrypt(machine()); |
296 | 296 | pgm_arm7_type1_latch_init(machine()); |
297 | 297 | /* we only have a china internal ROM dumped for now.. allow region to be changed for debugging (to ensure all alt titles / regions can be seen) */ |
298 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
298 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x4f0008, 0x4f0009, FUNC(kovsh_fake_region_r)); | |
299 | 299 | } |
300 | 300 | |
301 | 301 | /* Fake remapping of ASIC commands to the ones used by KOVSH due to the lack of the real ARM rom for this set */ |
r18027 | r18028 | |
365 | 365 | pgm_basic_init(machine()); |
366 | 366 | pgm_kovshp_decrypt(machine()); |
367 | 367 | pgm_arm7_type1_latch_init(machine()); |
368 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4f0008, 0x4f0009, FUNC(kovsh_fake_region_r)); | |
369 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x500000, 0x500005, FUNC(kovshp_asic27a_write_word)); | |
368 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x4f0008, 0x4f0009, FUNC(kovsh_fake_region_r)); | |
369 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x500000, 0x500005, FUNC(kovshp_asic27a_write_word)); | |
370 | 370 | } |
371 | 371 | |
372 | 372 | |
r18027 | r18028 | |
378 | 378 | pgm_basic_init(machine()); |
379 | 379 | // pgm_kovshp_decrypt(machine()); |
380 | 380 | pgm_arm7_type1_latch_init(machine()); |
381 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4f0008, 0x4f0009, FUNC(kovsh_fake_region_r)); | |
382 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x500000, 0x500005, FUNC(kovshp_asic27a_write_word)); | |
381 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x4f0008, 0x4f0009, FUNC(kovsh_fake_region_r)); | |
382 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x500000, 0x500005, FUNC(kovshp_asic27a_write_word)); | |
383 | 383 | } |
384 | 384 | |
385 | 385 | static void pgm_decode_kovlsqh2_tiles( running_machine &machine ) |
r18027 | r18028 | |
483 | 483 | pgm_decode_kovlsqh2_samples(machine()); |
484 | 484 | pgm_basic_init(machine()); |
485 | 485 | pgm_arm7_type1_latch_init(machine()); |
486 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4f0008, 0x4f0009, FUNC(kovsh_fake_region_r)); | |
487 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x500000, 0x500005, FUNC(kovshp_asic27a_write_word)); | |
486 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x4f0008, 0x4f0009, FUNC(kovsh_fake_region_r)); | |
487 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x500000, 0x500005, FUNC(kovshp_asic27a_write_word)); | |
488 | 488 | } |
489 | 489 | |
490 | 490 | DRIVER_INIT_MEMBER(pgm_arm_type1_state,kovqhsgs) |
r18027 | r18028 | |
505 | 505 | pgm_basic_init(machine()); |
506 | 506 | pgm_arm7_type1_latch_init(machine()); |
507 | 507 | /* we only have a china internal ROM dumped for now.. allow region to be changed for debugging (to ensure all alt titles / regions can be seen) */ |
508 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
508 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x4f0008, 0x4f0009, FUNC(kovsh_fake_region_r)); | |
509 | 509 | } |
510 | 510 | |
511 | 511 | /* |
r18027 | r18028 | |
1412 | 1412 | pgm_basic_init(machine(), false); |
1413 | 1413 | pgm_py2k2_decrypt(machine()); // yes, it's the same as photo y2k2 |
1414 | 1414 | arm_sim_handler = command_handler_ddp3; |
1415 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1415 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x500000, 0x500005, FUNC(pgm_arm7_type1_sim_r), FUNC(pgm_arm7_type1_sim_w)); | |
1416 | 1416 | } |
1417 | 1417 | |
1418 | 1418 | DRIVER_INIT_MEMBER(pgm_arm_type1_state,ket) |
r18027 | r18028 | |
1420 | 1420 | pgm_basic_init(machine(), false); |
1421 | 1421 | pgm_ket_decrypt(machine()); |
1422 | 1422 | arm_sim_handler = command_handler_ddp3; |
1423 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1423 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x400000, 0x400005, FUNC(pgm_arm7_type1_sim_r), FUNC(pgm_arm7_type1_sim_w)); | |
1424 | 1424 | } |
1425 | 1425 | |
1426 | 1426 | DRIVER_INIT_MEMBER(pgm_arm_type1_state,espgal) |
r18027 | r18028 | |
1428 | 1428 | pgm_basic_init(machine(), false); |
1429 | 1429 | pgm_espgal_decrypt(machine()); |
1430 | 1430 | arm_sim_handler = command_handler_ddp3; |
1431 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1431 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x400000, 0x400005, FUNC(pgm_arm7_type1_sim_r), FUNC(pgm_arm7_type1_sim_w)); | |
1432 | 1432 | } |
1433 | 1433 | |
1434 | 1434 | DRIVER_INIT_MEMBER(pgm_arm_type1_state,puzzli2) |
r18027 | r18028 | |
1436 | 1436 | pgm_basic_init(machine()); |
1437 | 1437 | pgm_puzzli2_decrypt(machine()); |
1438 | 1438 | arm_sim_handler = command_handler_puzzli2; |
1439 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x500000, 0x500005, FUNC(pgm_arm7_type1_sim_r), FUNC(pgm_arm7_type1_sim_w)); | |
1440 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4f0000, 0x4f003f, FUNC(pgm_arm7_type1_sim_protram_r)); | |
1439 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x500000, 0x500005, FUNC(pgm_arm7_type1_sim_r), FUNC(pgm_arm7_type1_sim_w)); | |
1440 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x4f0000, 0x4f003f, FUNC(pgm_arm7_type1_sim_protram_r)); | |
1441 | 1441 | m_irq4_disabled = 1; // // doesn't like this irq?? |
1442 | 1442 | } |
1443 | 1443 | |
r18027 | r18028 | |
1446 | 1446 | pgm_basic_init(machine()); |
1447 | 1447 | pgm_py2k2_decrypt(machine()); |
1448 | 1448 | arm_sim_handler = command_handler_py2k2; |
1449 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x500000, 0x500005, FUNC(pgm_arm7_type1_sim_r), FUNC(pgm_arm7_type1_sim_w)); | |
1450 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4f0000, 0x4f003f, FUNC(pgm_arm7_type1_sim_protram_r)); | |
1449 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x500000, 0x500005, FUNC(pgm_arm7_type1_sim_r), FUNC(pgm_arm7_type1_sim_w)); | |
1450 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x4f0000, 0x4f003f, FUNC(pgm_arm7_type1_sim_protram_r)); | |
1451 | 1451 | } |
1452 | 1452 | |
1453 | 1453 | DRIVER_INIT_MEMBER(pgm_arm_type1_state,pstar) |
r18027 | r18028 | |
1465 | 1465 | memset(m_slots, 0, 16 * sizeof(UINT32)); |
1466 | 1466 | |
1467 | 1467 | arm_sim_handler = command_handler_pstars; |
1468 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x500000, 0x500005, FUNC(pgm_arm7_type1_sim_r), FUNC(pgm_arm7_type1_sim_w)); | |
1469 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4f0000, 0x4f003f, FUNC(pstars_arm7_type1_sim_protram_r)); | |
1468 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x500000, 0x500005, FUNC(pgm_arm7_type1_sim_r), FUNC(pgm_arm7_type1_sim_w)); | |
1469 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x4f0000, 0x4f003f, FUNC(pstars_arm7_type1_sim_protram_r)); | |
1470 | 1470 | |
1471 | 1471 | save_item(NAME(m_pstar_e7_value)); |
1472 | 1472 | save_item(NAME(m_pstar_b1_value)); |
r18027 | r18028 | |
1484 | 1484 | m_kov_cb_value = 0; |
1485 | 1485 | m_kov_fe_value = 0; |
1486 | 1486 | arm_sim_handler = command_handler_kov; |
1487 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x500000, 0x500005, FUNC(pgm_arm7_type1_sim_r), FUNC(pgm_arm7_type1_sim_w)); | |
1488 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4f0000, 0x4f003f, FUNC(pgm_arm7_type1_sim_protram_r)); | |
1487 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x500000, 0x500005, FUNC(pgm_arm7_type1_sim_r), FUNC(pgm_arm7_type1_sim_w)); | |
1488 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x4f0000, 0x4f003f, FUNC(pgm_arm7_type1_sim_protram_r)); | |
1489 | 1489 | } |
1490 | 1490 | |
1491 | 1491 | DRIVER_INIT_MEMBER(pgm_arm_type1_state,kovboot) |
r18027 | r18028 | |
1498 | 1498 | m_kov_cb_value = 0; |
1499 | 1499 | m_kov_fe_value = 0; |
1500 | 1500 | arm_sim_handler = command_handler_kov; |
1501 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x500000, 0x500005, FUNC(pgm_arm7_type1_sim_r), FUNC(pgm_arm7_type1_sim_w)); | |
1502 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4f0000, 0x4f003f, FUNC(pgm_arm7_type1_sim_protram_r)); | |
1501 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x500000, 0x500005, FUNC(pgm_arm7_type1_sim_r), FUNC(pgm_arm7_type1_sim_w)); | |
1502 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x4f0000, 0x4f003f, FUNC(pgm_arm7_type1_sim_protram_r)); | |
1503 | 1503 | |
1504 | 1504 | } |
1505 | 1505 | |
r18027 | r18028 | |
1511 | 1511 | memset(m_extra_ram, 0, 0x100 * sizeof(UINT16)); |
1512 | 1512 | memset(m_slots, 0, 0x100 * sizeof(UINT32)); |
1513 | 1513 | arm_sim_handler = command_handler_oldsplus; |
1514 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x500000, 0x500005, FUNC(pgm_arm7_type1_sim_r), FUNC(pgm_arm7_type1_sim_w)); | |
1515 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4f0000, 0x4f003f, FUNC(pgm_arm7_type1_sim_protram_r)); | |
1514 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x500000, 0x500005, FUNC(pgm_arm7_type1_sim_r), FUNC(pgm_arm7_type1_sim_w)); | |
1515 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x4f0000, 0x4f003f, FUNC(pgm_arm7_type1_sim_protram_r)); | |
1516 | 1516 | state_save_register_global_array(machine(), m_extra_ram); |
1517 | 1517 | state_save_register_global_array(machine(), m_slots); |
1518 | 1518 | } |
r18027 | r18028 | |
---|---|---|
137 | 137 | |
138 | 138 | void balsente_state::machine_reset() |
139 | 139 | { |
140 | address_space &space = | |
140 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
141 | 141 | int numbanks; |
142 | 142 | |
143 | 143 | /* reset counters; counter 2's gate is tied high */ |
r18027 | r18028 | |
---|---|---|
800 | 800 | // z80 area of the 68k if games misbehave |
801 | 801 | static READ8_HANDLER( z80_read_68k_banked_data ) |
802 | 802 | { |
803 | address_space *space68k = space.machine().device<legacy_cpu_device>("maincpu")->space(); | |
804 | UINT8 ret = space68k->read_byte(genz80.z80_bank_addr+offset); | |
803 | address_space &space68k = space.machine().device<legacy_cpu_device>("maincpu")->space(); | |
804 | UINT8 ret = space68k.read_byte(genz80.z80_bank_addr+offset); | |
805 | 805 | return ret; |
806 | 806 | } |
807 | 807 | |
808 | 808 | static WRITE8_HANDLER( z80_write_68k_banked_data ) |
809 | 809 | { |
810 | address_space *space68k = space.machine().device<legacy_cpu_device>("maincpu")->space(); | |
811 | space68k->write_byte(genz80.z80_bank_addr+offset,data); | |
810 | address_space &space68k = space.machine().device<legacy_cpu_device>("maincpu")->space(); | |
811 | space68k.write_byte(genz80.z80_bank_addr+offset,data); | |
812 | 812 | } |
813 | 813 | |
814 | 814 | |
r18027 | r18028 | |
1511 | 1511 | device_t *ym = machine.device("ymsnd"); |
1512 | 1512 | |
1513 | 1513 | /* INIT THE PORTS *********************************************************************************************/ |
1514 | machine.device(tag)->memory().space(AS_IO) | |
1514 | machine.device(tag)->memory().space(AS_IO).install_legacy_readwrite_handler(0x0000, 0xffff, FUNC(z80_unmapped_port_r), FUNC(z80_unmapped_port_w)); | |
1515 | 1515 | |
1516 | 1516 | /* catch any addresses that don't get mapped */ |
1517 | machine.device(tag)->memory().space(AS_PROGRAM) | |
1517 | machine.device(tag)->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x0000, 0xffff, FUNC(z80_unmapped_r), FUNC(z80_unmapped_w)); | |
1518 | 1518 | |
1519 | 1519 | |
1520 | machine.device(tag)->memory().space(AS_PROGRAM) | |
1520 | machine.device(tag)->memory().space(AS_PROGRAM).install_readwrite_bank(0x0000, 0x1fff, "bank1"); | |
1521 | 1521 | machine.root_device().membank("bank1")->set_base(genz80.z80_prgram ); |
1522 | 1522 | |
1523 | machine.device(tag)->memory().space(AS_PROGRAM) | |
1523 | machine.device(tag)->memory().space(AS_PROGRAM).install_ram(0x0000, 0x1fff, genz80.z80_prgram); | |
1524 | 1524 | |
1525 | 1525 | |
1526 | machine.device(tag)->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(*ym, 0x4000, 0x4003, FUNC(ym2612_r), FUNC(ym2612_w)); | |
1527 | machine.device(tag)->memory().space(AS_PROGRAM)->install_legacy_write_handler (0x6000, 0x6000, FUNC(megadriv_z80_z80_bank_w)); | |
1528 | machine.device(tag)->memory().space(AS_PROGRAM)->install_legacy_write_handler (0x6001, 0x6001, FUNC(megadriv_z80_z80_bank_w)); | |
1529 | machine.device(tag)->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x6100, 0x7eff, FUNC(megadriv_z80_unmapped_read)); | |
1530 | machine.device(tag)->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x7f00, 0x7fff, FUNC(megadriv_z80_vdp_read), FUNC(megadriv_z80_vdp_write)); | |
1531 | machine.device(tag)->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x8000, 0xffff, FUNC(z80_read_68k_banked_data), FUNC(z80_write_68k_banked_data)); | |
1526 | machine.device(tag)->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(*ym, 0x4000, 0x4003, FUNC(ym2612_r), FUNC(ym2612_w)); | |
1527 | machine.device(tag)->memory().space(AS_PROGRAM).install_legacy_write_handler (0x6000, 0x6000, FUNC(megadriv_z80_z80_bank_w)); | |
1528 | machine.device(tag)->memory().space(AS_PROGRAM).install_legacy_write_handler (0x6001, 0x6001, FUNC(megadriv_z80_z80_bank_w)); | |
1529 | machine.device(tag)->memory().space(AS_PROGRAM).install_legacy_read_handler (0x6100, 0x7eff, FUNC(megadriv_z80_unmapped_read)); | |
1530 | machine.device(tag)->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x7f00, 0x7fff, FUNC(megadriv_z80_vdp_read), FUNC(megadriv_z80_vdp_write)); | |
1531 | machine.device(tag)->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x8000, 0xffff, FUNC(z80_read_68k_banked_data), FUNC(z80_write_68k_banked_data)); | |
1532 | 1532 | } |
1533 | 1533 | |
1534 | 1534 |
r18027 | r18028 | |
---|---|---|
186 | 186 | |
187 | 187 | MACHINE_START_MEMBER(vsnes_state,vsnes) |
188 | 188 | { |
189 | address_space | |
189 | address_space &ppu1_space = machine().device("ppu1")->memory().space(AS_PROGRAM); | |
190 | 190 | int i; |
191 | 191 | |
192 | 192 | /* establish nametable ram */ |
r18027 | r18028 | |
197 | 197 | m_nt_page[0][2] = m_nt_ram[0] + 0x800; |
198 | 198 | m_nt_page[0][3] = m_nt_ram[0] + 0xc00; |
199 | 199 | |
200 | ppu1_space | |
200 | ppu1_space.install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(vsnes_state::vsnes_nt0_r),this), write8_delegate(FUNC(vsnes_state::vsnes_nt0_w),this)); | |
201 | 201 | |
202 | 202 | m_vrom[0] = memregion("gfx1")->base(); |
203 | 203 | m_vrom_size[0] = memregion("gfx1")->bytes(); |
r18027 | r18028 | |
210 | 210 | { |
211 | 211 | for (i = 0; i < 8; i++) |
212 | 212 | { |
213 | ppu1_space | |
213 | ppu1_space.install_read_bank(0x0400 * i, 0x0400 * i + 0x03ff, chr_banknames[i]); | |
214 | 214 | membank(chr_banknames[i])->configure_entries(0, m_vrom_banks, m_vrom[0], 0x400); |
215 | 215 | } |
216 | 216 | v_set_videorom_bank(machine(), 0, 8, 0); |
217 | 217 | } |
218 | 218 | else |
219 | 219 | { |
220 | ppu1_space | |
220 | ppu1_space.install_ram(0x0000, 0x1fff, m_vram); | |
221 | 221 | } |
222 | 222 | } |
223 | 223 | |
r18027 | r18028 | |
241 | 241 | m_nt_page[1][2] = m_nt_ram[1] + 0x800; |
242 | 242 | m_nt_page[1][3] = m_nt_ram[1] + 0xc00; |
243 | 243 | |
244 | machine().device("ppu1")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(vsnes_state::vsnes_nt0_r),this), write8_delegate(FUNC(vsnes_state::vsnes_nt0_w),this)); | |
245 | machine().device("ppu2")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(vsnes_state::vsnes_nt1_r),this), write8_delegate(FUNC(vsnes_state::vsnes_nt1_w),this)); | |
244 | machine().device("ppu1")->memory().space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(vsnes_state::vsnes_nt0_r),this), write8_delegate(FUNC(vsnes_state::vsnes_nt0_w),this)); | |
245 | machine().device("ppu2")->memory().space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(vsnes_state::vsnes_nt1_r),this), write8_delegate(FUNC(vsnes_state::vsnes_nt1_w),this)); | |
246 | 246 | // read only! |
247 | machine().device("ppu1")->memory().space(AS_PROGRAM) | |
247 | machine().device("ppu1")->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x1fff, "bank2"); | |
248 | 248 | // read only! |
249 | machine().device("ppu2")->memory().space(AS_PROGRAM) | |
249 | machine().device("ppu2")->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x1fff, "bank3"); | |
250 | 250 | membank("bank2")->configure_entries(0, m_vrom_size[0] / 0x2000, m_vrom[0], 0x2000); |
251 | 251 | membank("bank3")->configure_entries(0, m_vrom_size[1] / 0x2000, m_vrom[1], 0x2000); |
252 | 252 | membank("bank2")->set_entry(0); |
r18027 | r18028 | |
339 | 339 | DRIVER_INIT_MEMBER(vsnes_state,vsnormal) |
340 | 340 | { |
341 | 341 | /* vrom switching is enabled with bit 2 of $4016 */ |
342 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
342 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x4016, 0x4016, write8_delegate(FUNC(vsnes_state::vsnormal_vrom_banking),this)); | |
343 | 343 | } |
344 | 344 | |
345 | 345 | /**********************************************************************************/ |
r18027 | r18028 | |
395 | 395 | DRIVER_INIT_MEMBER(vsnes_state,vsgun) |
396 | 396 | { |
397 | 397 | /* VROM switching is enabled with bit 2 of $4016 */ |
398 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
398 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x4016, 0x4016, read8_delegate(FUNC(vsnes_state::gun_in0_r),this), write8_delegate(FUNC(vsnes_state::gun_in0_w),this)); | |
399 | 399 | m_do_vrom_bank = 1; |
400 | 400 | } |
401 | 401 | |
r18027 | r18028 | |
436 | 436 | memcpy(&prg[0x08000], &prg[0x18000], 0x8000); |
437 | 437 | |
438 | 438 | /* banking is done with writes to the $8000-$ffff area */ |
439 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
439 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(vsnes_state::vskonami_rom_banking),this)); | |
440 | 440 | } |
441 | 441 | |
442 | 442 | /***********************************************************************/ |
r18027 | r18028 | |
463 | 463 | memcpy (&prg[0x08000], &prg[0x12000], 0x2000); |
464 | 464 | |
465 | 465 | /* vrom switching is enabled with bit 2 of $4016 */ |
466 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
466 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x4016, 0x4016, read8_delegate(FUNC(vsnes_state::gun_in0_r),this), write8_delegate(FUNC(vsnes_state::vsgshoe_gun_in0_w),this)); | |
467 | 467 | |
468 | 468 | m_do_vrom_bank = 1; |
469 | 469 | } |
r18027 | r18028 | |
592 | 592 | memcpy(&prg[0x0c000], &prg[0x1c000], 0x4000); |
593 | 593 | |
594 | 594 | /* MMC1 mapper at writes to $8000-$ffff */ |
595 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
595 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(vsnes_state::drmario_rom_banking),this)); | |
596 | 596 | |
597 | 597 | m_drmario_shiftreg = 0; |
598 | 598 | m_drmario_shiftcount = 0; |
r18027 | r18028 | |
616 | 616 | memcpy(&prg[0x08000], &prg[0x28000], 0x8000); |
617 | 617 | |
618 | 618 | /* banking is done with writes to the $8000-$ffff area */ |
619 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
619 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(vsnes_state::vsvram_rom_banking),this)); | |
620 | 620 | |
621 | 621 | /* allocate m_vram */ |
622 | 622 | m_vram = auto_alloc_array(machine(), UINT8, 0x2000); |
r18027 | r18028 | |
778 | 778 | memcpy(&prg[0xe000], &prg[(MMC3_prg_chunks - 1) * 0x4000 + 0x12000], 0x2000); |
779 | 779 | |
780 | 780 | /* MMC3 mapper at writes to $8000-$ffff */ |
781 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
781 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(vsnes_state::mapper4_w),this)); | |
782 | 782 | |
783 | 783 | /* extra ram at $6000-$7fff */ |
784 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
784 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_ram(0x6000, 0x7fff); | |
785 | 785 | } |
786 | 786 | |
787 | 787 | /* Vs. RBI Baseball */ |
r18027 | r18028 | |
818 | 818 | DRIVER_INIT_CALL(MMC3); |
819 | 819 | |
820 | 820 | /* RBI Base ball hack */ |
821 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
821 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x5e00, 0x5e01, read8_delegate(FUNC(vsnes_state::rbi_hack_r),this)) ; | |
822 | 822 | } |
823 | 823 | |
824 | 824 | /* Vs. Super Xevious */ |
r18027 | r18028 | |
865 | 865 | DRIVER_INIT_CALL(MMC3); |
866 | 866 | |
867 | 867 | /* Vs. Super Xevious Protection */ |
868 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x54ff, 0x54ff, read8_delegate(FUNC(vsnes_state::supxevs_read_prot_1_r),this)); | |
869 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x5678, 0x5678, read8_delegate(FUNC(vsnes_state::supxevs_read_prot_2_r),this)); | |
870 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x578f, 0x578f, read8_delegate(FUNC(vsnes_state::supxevs_read_prot_3_r),this)); | |
871 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x5567, 0x5567, read8_delegate(FUNC(vsnes_state::supxevs_read_prot_4_r),this)); | |
868 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x54ff, 0x54ff, read8_delegate(FUNC(vsnes_state::supxevs_read_prot_1_r),this)); | |
869 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x5678, 0x5678, read8_delegate(FUNC(vsnes_state::supxevs_read_prot_2_r),this)); | |
870 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x578f, 0x578f, read8_delegate(FUNC(vsnes_state::supxevs_read_prot_3_r),this)); | |
871 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x5567, 0x5567, read8_delegate(FUNC(vsnes_state::supxevs_read_prot_4_r),this)); | |
872 | 872 | } |
873 | 873 | |
874 | 874 | /* Vs. TKO Boxing */ |
r18027 | r18028 | |
897 | 897 | DRIVER_INIT_CALL(MMC3); |
898 | 898 | |
899 | 899 | /* security device at $5e00-$5e01 */ |
900 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
900 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x5e00, 0x5e01, read8_delegate(FUNC(vsnes_state::tko_security_r),this)); | |
901 | 901 | } |
902 | 902 | |
903 | 903 | /* Vs. Freedom Force */ |
r18027 | r18028 | |
906 | 906 | { |
907 | 907 | DRIVER_INIT_CALL(MMC3); |
908 | 908 | |
909 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
909 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x4016, 0x4016, read8_delegate(FUNC(vsnes_state::gun_in0_r),this), write8_delegate(FUNC(vsnes_state::gun_in0_w),this)); | |
910 | 910 | |
911 | 911 | m_do_vrom_bank = 0; |
912 | 912 | } |
r18027 | r18028 | |
956 | 956 | memcpy(&prg[0x08000], &prg[0x10000], 0x4000); |
957 | 957 | memcpy(&prg[0x0c000], &prg[0x2c000], 0x4000); |
958 | 958 | |
959 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
959 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(vsnes_state::mapper68_rom_banking),this)); | |
960 | 960 | } |
961 | 961 | |
962 | 962 | /**********************************************************************************/ |
r18027 | r18028 | |
977 | 977 | |
978 | 978 | DRIVER_INIT_MEMBER(vsnes_state,bnglngby) |
979 | 979 | { |
980 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
980 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x0231, 0x0231, read8_delegate(FUNC(vsnes_state::set_bnglngby_irq_r),this), write8_delegate(FUNC(vsnes_state::set_bnglngby_irq_w),this)); | |
981 | 981 | |
982 | 982 | /* extra ram */ |
983 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
983 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_ram(0x6000, 0x7fff); | |
984 | 984 | |
985 | 985 | m_ret = 0; |
986 | 986 | |
r18027 | r18028 | |
1012 | 1012 | UINT8 *prg = machine().root_device().memregion("maincpu")->base(); |
1013 | 1013 | |
1014 | 1014 | /* vrom switching is enabled with bit 2 of $4016 */ |
1015 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x4016, 0x4016, write8_delegate(FUNC(vsnes_state::vsdual_vrom_banking),this)); | |
1016 | machine().device("sub")->memory().space(AS_PROGRAM)->install_write_handler(0x4016, 0x4016, write8_delegate(FUNC(vsnes_state::vsdual_vrom_banking),this)); | |
1015 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x4016, 0x4016, write8_delegate(FUNC(vsnes_state::vsdual_vrom_banking),this)); | |
1016 | machine().device("sub")->memory().space(AS_PROGRAM).install_write_handler(0x4016, 0x4016, write8_delegate(FUNC(vsnes_state::vsdual_vrom_banking),this)); | |
1017 | 1017 | |
1018 | 1018 | /* shared ram at $6000 */ |
1019 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x7fff, &prg[0x6000]); | |
1020 | machine().device("sub")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x7fff, &prg[0x6000]); | |
1019 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_ram(0x6000, 0x7fff, &prg[0x6000]); | |
1020 | machine().device("sub")->memory().space(AS_PROGRAM).install_ram(0x6000, 0x7fff, &prg[0x6000]); | |
1021 | 1021 | } |
1022 | 1022 |
r18027 | r18028 | |
---|---|---|
36 | 36 | |
37 | 37 | void taitosj_state::machine_reset() |
38 | 38 | { |
39 | address_space &space = | |
39 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
40 | 40 | /* set the default ROM bank (many games only have one bank and */ |
41 | 41 | /* never write to the bank selector register) */ |
42 | 42 | taitosj_bankswitch_w(space, 0, 0); |
r18027 | r18028 | |
211 | 211 | } |
212 | 212 | if (~data & 0x10) |
213 | 213 | { |
214 | address_space | |
214 | address_space &cpu0space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
215 | 215 | LOG(("%04x: 68705 write %02x to address %04x\n",space.device().safe_pc(), m_portA_out, m_address)); |
216 | 216 | |
217 | cpu0space | |
217 | cpu0space.write_byte(m_address, m_portA_out); | |
218 | 218 | |
219 | 219 | /* increase low 8 bits of latched address for burst writes */ |
220 | 220 | m_address = (m_address & 0xff00) | ((m_address + 1) & 0xff); |
221 | 221 | } |
222 | 222 | if (~data & 0x20) |
223 | 223 | { |
224 | address_space *cpu0space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
225 | m_portA_in = cpu0space->read_byte(m_address); | |
224 | address_space &cpu0space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
225 | m_portA_in = cpu0space.read_byte(m_address); | |
226 | 226 | LOG(("%04x: 68705 read %02x from address %04x\n", space.device().safe_pc(), m_portA_in, m_address)); |
227 | 227 | } |
228 | 228 | if (~data & 0x40) |
r18027 | r18028 | |
---|---|---|
377 | 377 | |
378 | 378 | void mc8123_decrypt_rom(running_machine &machine, const char *cpu, const char *keyrgn, const char *bankname, int numbanks) |
379 | 379 | { |
380 | address_space &space = | |
380 | address_space &space = machine.device(cpu)->memory().space(AS_PROGRAM); | |
381 | 381 | int fixed_length = numbanks == 1 ? 0xc000 : 0x8000; |
382 | 382 | UINT8 *decrypted1 = auto_alloc_array(machine, UINT8, fixed_length); |
383 | 383 | UINT8 *decrypted2 = numbanks > 1 ? auto_alloc_array(machine, UINT8, 0x4000 * numbanks) : 0; |
r18027 | r18028 | |
---|---|---|
261 | 261 | static void amiga_m68k_reset(device_t *device) |
262 | 262 | { |
263 | 263 | amiga_state *state = device->machine().driver_data<amiga_state>(); |
264 | address_space &space = | |
264 | address_space &space = device->memory().space(AS_PROGRAM); | |
265 | 265 | |
266 | 266 | logerror("Executed RESET at PC=%06x\n", space.device().safe_pc()); |
267 | 267 | |
r18027 | r18028 | |
318 | 318 | if (scanline == 0) |
319 | 319 | { |
320 | 320 | /* signal VBLANK IRQ */ |
321 | amiga_custom_w( | |
321 | amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_VERTB, 0xffff); | |
322 | 322 | |
323 | 323 | /* clock the first CIA TOD */ |
324 | 324 | mos6526_tod_w(cia_0, 1); |
r18027 | r18028 | |
939 | 939 | CUSTOM_REG(REG_DMACON) &= ~0x4000; |
940 | 940 | |
941 | 941 | /* signal an interrupt */ |
942 | amiga_custom_w( | |
942 | amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_BLIT, 0xffff); | |
943 | 943 | |
944 | 944 | /* reset the blitter timer */ |
945 | 945 | state->m_blitter_timer->reset( ); |
r18027 | r18028 | |
1094 | 1094 | |
1095 | 1095 | void amiga_cia_0_irq(device_t *device, int state) |
1096 | 1096 | { |
1097 | amiga_custom_w( | |
1097 | amiga_custom_w(device->machine().device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, (state ? 0x8000 : 0x0000) | INTENA_PORTS, 0xffff); | |
1098 | 1098 | } |
1099 | 1099 | |
1100 | 1100 | |
1101 | 1101 | void amiga_cia_1_irq(device_t *device, int state) |
1102 | 1102 | { |
1103 | amiga_custom_w( | |
1103 | amiga_custom_w(device->machine().device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, (state ? 0x8000 : 0x0000) | INTENA_EXTER, 0xffff); | |
1104 | 1104 | } |
1105 | 1105 | |
1106 | 1106 | |
r18027 | r18028 | |
1249 | 1249 | CUSTOM_REG(REG_SERDATR) |= 0x3000; |
1250 | 1250 | |
1251 | 1251 | /* signal an interrupt */ |
1252 | amiga_custom_w( | |
1252 | amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_TBE, 0xffff); | |
1253 | 1253 | } |
1254 | 1254 | |
1255 | 1255 | |
r18027 | r18028 | |
1509 | 1509 | void amiga_serial_in_w(running_machine &machine, UINT16 data) |
1510 | 1510 | { |
1511 | 1511 | amiga_state *state = machine.driver_data<amiga_state>(); |
1512 | address_space &space = | |
1512 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1513 | 1513 | int mask = (CUSTOM_REG(REG_SERPER) & 0x8000) ? 0x1ff : 0xff; |
1514 | 1514 | |
1515 | 1515 | /* copy the data to the low 8 bits of SERDATR and set RBF */ |
r18027 | r18028 | |
---|---|---|
101 | 101 | |
102 | 102 | /* the protection involves reading and writing addresses in the */ |
103 | 103 | /* 0x2xxxxx range. There are several checks all around the code. */ |
104 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
104 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x200000, 0x2fffff, FUNC(fatfury2_protection_16_r), FUNC(fatfury2_protection_16_w)); | |
105 | 105 | |
106 | 106 | state->m_fatfury2_prot_data = 0; |
107 | 107 | |
r18027 | r18028 | |
146 | 146 | { |
147 | 147 | /* when 0x20aaaa contains 0x0090 (word) then 0x100 (normally the neogeo header) should return 0x00c200fd worked out using real hw */ |
148 | 148 | |
149 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
149 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x20aaaa, 0x20aaab, FUNC(kof98_prot_w)); | |
150 | 150 | } |
151 | 151 | |
152 | 152 | |
r18027 | r18028 | |
405 | 405 | neogeo_state *state = machine.driver_data<neogeo_state>(); |
406 | 406 | state->save_item(NAME(state->m_neogeo_rng)); |
407 | 407 | |
408 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(addr1, addr1 + 1, FUNC(sma_random_r)); | |
409 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(addr2, addr2 + 1, FUNC(sma_random_r)); | |
408 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(addr1, addr1 + 1, FUNC(sma_random_r)); | |
409 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(addr2, addr2 + 1, FUNC(sma_random_r)); | |
410 | 410 | } |
411 | 411 | |
412 | 412 | |
413 | 413 | void kof99_install_protection( running_machine &machine ) |
414 | 414 | { |
415 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2ffff0, 0x2ffff1, FUNC(kof99_bankswitch_w)); | |
416 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2fe446, 0x2fe447, FUNC(prot_9a37_r)); | |
415 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x2ffff0, 0x2ffff1, FUNC(kof99_bankswitch_w)); | |
416 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x2fe446, 0x2fe447, FUNC(prot_9a37_r)); | |
417 | 417 | |
418 | 418 | sma_install_random_read_handler(machine, 0x2ffff8, 0x2ffffa); |
419 | 419 | } |
r18027 | r18028 | |
421 | 421 | |
422 | 422 | void garou_install_protection( running_machine &machine ) |
423 | 423 | { |
424 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2fffc0, 0x2fffc1, FUNC(garou_bankswitch_w)); | |
425 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2fe446, 0x2fe447, FUNC(prot_9a37_r)); | |
424 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x2fffc0, 0x2fffc1, FUNC(garou_bankswitch_w)); | |
425 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x2fe446, 0x2fe447, FUNC(prot_9a37_r)); | |
426 | 426 | |
427 | 427 | sma_install_random_read_handler(machine, 0x2fffcc, 0x2ffff0); |
428 | 428 | } |
r18027 | r18028 | |
430 | 430 | |
431 | 431 | void garouh_install_protection( running_machine &machine ) |
432 | 432 | { |
433 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2fffc0, 0x2fffc1, FUNC(garouh_bankswitch_w)); | |
434 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2fe446, 0x2fe447, FUNC(prot_9a37_r)); | |
433 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x2fffc0, 0x2fffc1, FUNC(garouh_bankswitch_w)); | |
434 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x2fe446, 0x2fe447, FUNC(prot_9a37_r)); | |
435 | 435 | |
436 | 436 | sma_install_random_read_handler(machine, 0x2fffcc, 0x2ffff0); |
437 | 437 | } |
r18027 | r18028 | |
439 | 439 | |
440 | 440 | void mslug3_install_protection( running_machine &machine ) |
441 | 441 | { |
442 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2fffe4, 0x2fffe5, FUNC(mslug3_bankswitch_w)); | |
443 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2fe446, 0x2fe447, FUNC(prot_9a37_r)); | |
442 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x2fffe4, 0x2fffe5, FUNC(mslug3_bankswitch_w)); | |
443 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x2fe446, 0x2fe447, FUNC(prot_9a37_r)); | |
444 | 444 | |
445 | 445 | // sma_install_random_read_handler(machine, 0x2ffff8, 0x2ffffa); |
446 | 446 | } |
r18027 | r18028 | |
448 | 448 | |
449 | 449 | void kof2000_install_protection( running_machine &machine ) |
450 | 450 | { |
451 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2fffec, 0x2fffed, FUNC(kof2000_bankswitch_w)); | |
452 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2fe446, 0x2fe447, FUNC(prot_9a37_r)); | |
451 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x2fffec, 0x2fffed, FUNC(kof2000_bankswitch_w)); | |
452 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x2fe446, 0x2fe447, FUNC(prot_9a37_r)); | |
453 | 453 | |
454 | 454 | sma_install_random_read_handler(machine, 0x2fffd8, 0x2fffda); |
455 | 455 | } |
r18027 | r18028 | |
540 | 540 | state->m_pvc_cartridge_ram = auto_alloc_array(machine, UINT16, 0x2000 / 2); |
541 | 541 | state->save_pointer(NAME(state->m_pvc_cartridge_ram), 0x2000 / 2); |
542 | 542 | |
543 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
543 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x2fe000, 0x2fffff, FUNC(pvc_prot_r), FUNC(pvc_prot_w)); | |
544 | 544 | } |
r18027 | r18028 | |
---|---|---|
221 | 221 | DRIVER_INIT_MEMBER(midwunit_state,umk3) |
222 | 222 | { |
223 | 223 | init_mk3_common(machine()); |
224 | m_umk3_palette = machine().device("maincpu")->memory().space(AS_PROGRAM) | |
224 | m_umk3_palette = machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x0106a060, 0x0106a09f, write16_delegate(FUNC(midwunit_state::umk3_palette_hack_w),this)); | |
225 | 225 | } |
226 | 226 | |
227 | 227 | DRIVER_INIT_MEMBER(midwunit_state,umk3r11) |
228 | 228 | { |
229 | 229 | init_mk3_common(machine()); |
230 | m_umk3_palette = machine().device("maincpu")->memory().space(AS_PROGRAM) | |
230 | m_umk3_palette = machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x0106a060, 0x0106a09f,write16_delegate(FUNC(midwunit_state::umk3_palette_hack_w),this)); | |
231 | 231 | } |
232 | 232 | |
233 | 233 | |
r18027 | r18028 | |
312 | 312 | init_wunit_generic(machine()); |
313 | 313 | |
314 | 314 | /* enable I/O shuffling */ |
315 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
315 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x01800000, 0x0180000f, write16_delegate(FUNC(midwunit_state::wwfmania_io_0_w),this)); | |
316 | 316 | |
317 | 317 | /* serial prefixes 430, 528 */ |
318 | 318 | midway_serial_pic_init(machine(), 528); |
r18027 | r18028 | |
---|---|---|
113 | 113 | |
114 | 114 | MACHINE_RESET_MEMBER(namcos2_shared_state,namcos2) |
115 | 115 | { |
116 | address_space &space = | |
116 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
117 | 117 | mFinalLapProtCount = 0; |
118 | 118 | namcos2_mcu_analog_ctrl = 0; |
119 | 119 | namcos2_mcu_analog_data = 0xaa; |
r18027 | r18028 | |
---|---|---|
188 | 188 | kov2_latch_init(machine()); |
189 | 189 | |
190 | 190 | // we only have a HK internal ROM dumped for now, allow us to override that for debugging purposes. |
191 | machine().device("prot")->memory().space(AS_PROGRAM) | |
191 | machine().device("prot")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x48000138, 0x4800013b, FUNC(kov2_arm_region_w)); | |
192 | 192 | } |
193 | 193 | |
194 | 194 | |
r18027 | r18028 | |
222 | 222 | mem8[0x1FFFFD] = 0x99; |
223 | 223 | |
224 | 224 | // we only have a HK internal ROM dumped for now, allow us to override that for debugging purposes. |
225 | machine().device("prot")->memory().space(AS_PROGRAM) | |
225 | machine().device("prot")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x48000138, 0x4800013b, FUNC(kov2_arm_region_w)); | |
226 | 226 | } |
227 | 227 | |
228 | 228 | static WRITE32_HANDLER( martmast_arm_region_w ) |
r18027 | r18028 | |
242 | 242 | kov2_latch_init(machine()); |
243 | 243 | |
244 | 244 | // we only have a USA / CHINA internal ROMs dumped for now, allow us to override that for debugging purposes. |
245 | machine().device("prot")->memory().space(AS_PROGRAM) | |
245 | machine().device("prot")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x48000138, 0x4800013b, FUNC(martmast_arm_region_w)); | |
246 | 246 | } |
247 | 247 | |
248 | 248 | |
r18027 | r18028 | |
297 | 297 | kov2_latch_init(machine()); |
298 | 298 | |
299 | 299 | // we only have a Japan internal ROM dumped for now, allow us to override that for debugging purposes. |
300 | machine().device("prot")->memory().space(AS_PROGRAM) | |
300 | machine().device("prot")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x48000000, 0x48000003, FUNC(ddp2_arm_region_w)); | |
301 | 301 | |
302 | machine().device("prot")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x1800300c, 0x1800300f, FUNC(ddp2_speedup_r)); | |
303 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80ee54, 0x80ee55, FUNC(ddp2_main_speedup_r)); | |
302 | machine().device("prot")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x1800300c, 0x1800300f, FUNC(ddp2_speedup_r)); | |
303 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x80ee54, 0x80ee55, FUNC(ddp2_main_speedup_r)); | |
304 | 304 | } |
305 | 305 | |
306 | 306 |
r18027 | r18028 | |
---|---|---|
6 | 6 | |
7 | 7 | static void cclimber_decode(running_machine &machine, const UINT8 convtable[8][16]) |
8 | 8 | { |
9 | address_space &space = | |
9 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
10 | 10 | UINT8 *rom = machine.root_device().memregion("maincpu")->base(); |
11 | 11 | UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x10000); |
12 | 12 | int A; |
r18027 | r18028 | |
---|---|---|
66 | 66 | |
67 | 67 | READ16_MEMBER(tatsumi_state::apache3_v30_v20_r) |
68 | 68 | { |
69 | address_space | |
69 | address_space &targetspace = machine().device("audiocpu")->memory().space(AS_PROGRAM); | |
70 | 70 | |
71 | 71 | /* Each V20 byte maps to a V30 word */ |
72 | 72 | if ((m_control_word & 0xe0) == 0xe0) |
r18027 | r18028 | |
77 | 77 | offset += 0x00000; // main ram |
78 | 78 | else |
79 | 79 | logerror("%08x: unmapped read z80 rom %08x\n", space.device().safe_pc(), offset); |
80 | return 0xff00 | targetspace | |
80 | return 0xff00 | targetspace.read_byte(offset); | |
81 | 81 | } |
82 | 82 | |
83 | 83 | WRITE16_MEMBER(tatsumi_state::apache3_v30_v20_w) |
84 | 84 | { |
85 | address_space | |
85 | address_space &targetspace = machine().device("audiocpu")->memory().space(AS_PROGRAM); | |
86 | 86 | |
87 | 87 | if ((m_control_word & 0xe0) != 0x80) |
88 | 88 | logerror("%08x: write unmapped v30 rom %08x\n", space.device().safe_pc(), offset); |
r18027 | r18028 | |
90 | 90 | /* Only 8 bits of the V30 data bus are connected - ignore writes to the other half */ |
91 | 91 | if (ACCESSING_BITS_0_7) |
92 | 92 | { |
93 | targetspace | |
93 | targetspace.write_byte(offset, data & 0xff); | |
94 | 94 | } |
95 | 95 | } |
96 | 96 | |
r18027 | r18028 | |
142 | 142 | |
143 | 143 | READ16_MEMBER(tatsumi_state::roundup_v30_z80_r) |
144 | 144 | { |
145 | address_space | |
145 | address_space &targetspace = machine().device("audiocpu")->memory().space(AS_PROGRAM); | |
146 | 146 | |
147 | 147 | /* Each Z80 byte maps to a V30 word */ |
148 | 148 | if (m_control_word & 0x20) |
149 | 149 | offset += 0x8000; /* Upper half */ |
150 | 150 | |
151 | return 0xff00 | targetspace | |
151 | return 0xff00 | targetspace.read_byte(offset); | |
152 | 152 | } |
153 | 153 | |
154 | 154 | WRITE16_MEMBER(tatsumi_state::roundup_v30_z80_w) |
155 | 155 | { |
156 | address_space | |
156 | address_space &targetspace = machine().device("audiocpu")->memory().space(AS_PROGRAM); | |
157 | 157 | |
158 | 158 | /* Only 8 bits of the V30 data bus are connected - ignore writes to the other half */ |
159 | 159 | if (ACCESSING_BITS_0_7) |
r18027 | r18028 | |
161 | 161 | if (m_control_word & 0x20) |
162 | 162 | offset += 0x8000; /* Upper half of Z80 address &space */ |
163 | 163 | |
164 | targetspace | |
164 | targetspace.write_byte(offset, data & 0xff); | |
165 | 165 | } |
166 | 166 | } |
167 | 167 |
r18027 | r18028 | |
---|---|---|
1485 | 1485 | |
1486 | 1486 | void init_extra_gg_ports(running_machine& machine, const char* tag) |
1487 | 1487 | { |
1488 | address_space *io = machine.device(tag)->memory().space(AS_IO); | |
1489 | io->install_legacy_read_handler (0x00, 0x00, FUNC(sms_ioport_gg00_r)); | |
1488 | address_space &io = machine.device(tag)->memory().space(AS_IO); | |
1489 | io.install_legacy_read_handler (0x00, 0x00, FUNC(sms_ioport_gg00_r)); | |
1490 | 1490 | } |
1491 | 1491 | |
1492 | 1492 | void init_smsgg(running_machine &machine) |
r18027 | r18028 | |
1648 | 1648 | { |
1649 | 1649 | /* INIT THE PORTS *********************************************************************************************/ |
1650 | 1650 | |
1651 | address_space | |
1651 | address_space &io = machine.device(tag)->memory().space(AS_IO); | |
1652 | 1652 | device_t *sn = machine.device("snsnd"); |
1653 | 1653 | |
1654 | io | |
1654 | io.install_legacy_readwrite_handler(0x0000, 0xffff, FUNC(z80_unmapped_port_r), FUNC(z80_unmapped_port_w)); | |
1655 | 1655 | |
1656 | io->install_legacy_read_handler (0x7e, 0x7e, FUNC(md_sms_vdp_vcounter_r)); | |
1657 | io->install_legacy_write_handler(*sn, 0x7e, 0x7f, FUNC(sn76496_w)); | |
1658 | io->install_legacy_readwrite_handler (0xbe, 0xbe, FUNC(md_sms_vdp_data_r), FUNC(md_sms_vdp_data_w)); | |
1659 | io->install_legacy_readwrite_handler (0xbf, 0xbf, FUNC(md_sms_vdp_ctrl_r), FUNC(md_sms_vdp_ctrl_w)); | |
1656 | io.install_legacy_read_handler (0x7e, 0x7e, FUNC(md_sms_vdp_vcounter_r)); | |
1657 | io.install_legacy_write_handler(*sn, 0x7e, 0x7f, FUNC(sn76496_w)); | |
1658 | io.install_legacy_readwrite_handler (0xbe, 0xbe, FUNC(md_sms_vdp_data_r), FUNC(md_sms_vdp_data_w)); | |
1659 | io.install_legacy_readwrite_handler (0xbf, 0xbf, FUNC(md_sms_vdp_ctrl_r), FUNC(md_sms_vdp_ctrl_w)); | |
1660 | 1660 | |
1661 | io | |
1661 | io.install_legacy_read_handler (0x10, 0x10, FUNC(megatech_sms_ioport_dd_r)); // super tetris | |
1662 | 1662 | |
1663 | io->install_legacy_read_handler (0xdc, 0xdc, FUNC(megatech_sms_ioport_dc_r)); | |
1664 | io->install_legacy_read_handler (0xdd, 0xdd, FUNC(megatech_sms_ioport_dd_r)); | |
1665 | io->install_legacy_read_handler (0xde, 0xde, FUNC(megatech_sms_ioport_dd_r)); | |
1666 | io->install_legacy_read_handler (0xdf, 0xdf, FUNC(megatech_sms_ioport_dd_r)); // adams family | |
1663 | io.install_legacy_read_handler (0xdc, 0xdc, FUNC(megatech_sms_ioport_dc_r)); | |
1664 | io.install_legacy_read_handler (0xdd, 0xdd, FUNC(megatech_sms_ioport_dd_r)); | |
1665 | io.install_legacy_read_handler (0xde, 0xde, FUNC(megatech_sms_ioport_dd_r)); | |
1666 | io.install_legacy_read_handler (0xdf, 0xdf, FUNC(megatech_sms_ioport_dd_r)); // adams family | |
1667 | 1667 | } |
1668 | 1668 | |
1669 | 1669 | void megatech_set_genz80_as_sms_standard_map(running_machine &machine, const char* tag, int mapper) |
r18027 | r18028 | |
1671 | 1671 | /* INIT THE MEMMAP / BANKING *********************************************************************************/ |
1672 | 1672 | |
1673 | 1673 | /* catch any addresses that don't get mapped */ |
1674 | machine.device(tag)->memory().space(AS_PROGRAM) | |
1674 | machine.device(tag)->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x0000, 0xffff, FUNC(z80_unmapped_r), FUNC(z80_unmapped_w)); | |
1675 | 1675 | |
1676 | 1676 | /* main ram area */ |
1677 | sms_mainram = (UINT8 *)machine.device(tag)->memory().space(AS_PROGRAM) | |
1677 | sms_mainram = (UINT8 *)machine.device(tag)->memory().space(AS_PROGRAM).install_ram(0xc000, 0xdfff, 0, 0x2000); | |
1678 | 1678 | memset(sms_mainram,0x00,0x2000); |
1679 | 1679 | |
1680 | 1680 | megatech_set_genz80_as_sms_standard_ports(machine, tag); |
1681 | 1681 | |
1682 | 1682 | /* fixed rom bank area */ |
1683 | sms_rom = (UINT8 *)machine.device(tag)->memory().space(AS_PROGRAM) | |
1683 | sms_rom = (UINT8 *)machine.device(tag)->memory().space(AS_PROGRAM).install_rom(0x0000, 0xbfff, NULL); | |
1684 | 1684 | |
1685 | 1685 | memcpy(sms_rom, machine.root_device().memregion("maincpu")->base(), 0xc000); |
1686 | 1686 | |
r18027 | r18028 | |
1688 | 1688 | { |
1689 | 1689 | |
1690 | 1690 | |
1691 | machine.device(tag)->memory().space(AS_PROGRAM) | |
1691 | machine.device(tag)->memory().space(AS_PROGRAM).install_legacy_write_handler(0xfffc, 0xffff, FUNC(mt_sms_standard_rom_bank_w)); | |
1692 | 1692 | |
1693 | 1693 | } |
1694 | 1694 | else if (mapper == MAPPER_CODEMASTERS ) |
1695 | 1695 | { |
1696 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0000, 0x0000, FUNC(codemasters_rom_bank_0000_w)); | |
1697 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4000, 0x4000, FUNC(codemasters_rom_bank_4000_w)); | |
1698 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0x8000, FUNC(codemasters_rom_bank_8000_w)); | |
1696 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x0000, 0x0000, FUNC(codemasters_rom_bank_0000_w)); | |
1697 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x4000, 0x4000, FUNC(codemasters_rom_bank_4000_w)); | |
1698 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x8000, 0x8000, FUNC(codemasters_rom_bank_8000_w)); | |
1699 | 1699 | } |
1700 | 1700 | // smsgg_backupram = NULL; |
1701 | 1701 | } |
r18027 | r18028 | |
---|---|---|
217 | 217 | { |
218 | 218 | int A; |
219 | 219 | |
220 | address_space &space = | |
220 | address_space &space = machine.device(cputag)->memory().space(AS_PROGRAM); | |
221 | 221 | int length = machine.root_device().memregion(cputag)->bytes(); |
222 | 222 | int cryptlen = MIN(length, 0x8000); |
223 | 223 | UINT8 *rom = machine.root_device().memregion(cputag)->base(); |
r18027 | r18028 | |
439 | 439 | |
440 | 440 | int A; |
441 | 441 | |
442 | address_space &space = | |
442 | address_space &space = machine.device(cputag)->memory().space(AS_PROGRAM); | |
443 | 443 | UINT8 *rom = machine.root_device().memregion(regiontag)->base(); |
444 | 444 | int bankstart; |
445 | 445 | decrypted = auto_alloc_array(machine, UINT8, 0x6000*3); |
r18027 | r18028 | |
797 | 797 | |
798 | 798 | int A; |
799 | 799 | |
800 | address_space &space = | |
800 | address_space &space = machine.device(cputag)->memory().space(AS_PROGRAM); | |
801 | 801 | UINT8 *rom = machine.root_device().memregion(cputag)->base(); |
802 | 802 | decrypted = auto_alloc_array(machine, UINT8, 0x9000); |
803 | 803 |
r18027 | r18028 | |
---|---|---|
886 | 886 | |
887 | 887 | void CDC_Do_DMA(running_machine& machine, int rate) |
888 | 888 | { |
889 | address_space& space = | |
889 | address_space& space = machine.device(":segacd:segacd_68k")->memory().space(AS_PROGRAM); | |
890 | 890 | |
891 | 891 | UINT32 dstoffset, length; |
892 | 892 | UINT8 *dest; |
r18027 | r18028 | |
2304 | 2304 | /* main CPU map set up in INIT */ |
2305 | 2305 | void segacd_init_main_cpu( running_machine& machine ) |
2306 | 2306 | { |
2307 | address_space& space = | |
2307 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
2308 | 2308 | |
2309 | 2309 | segacd_font_bits = reinterpret_cast<UINT16 *>(machine.root_device().memshare(":segacd:segacd_font")->ptr()); |
2310 | 2310 | segacd_backupram = reinterpret_cast<UINT16 *>(machine.root_device().memshare(":segacd:backupram")->ptr()); |
r18027 | r18028 | |
2324 | 2324 | segacd_wordram_mapped = 1; |
2325 | 2325 | |
2326 | 2326 | |
2327 | space.machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2327 | space.machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x200000, 0x23ffff, FUNC(segacd_main_dataram_part1_r), FUNC(segacd_main_dataram_part1_w)); // RAM shared with sub | |
2328 | 2328 | |
2329 | space.machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12000, 0xa12001, FUNC(scd_a12000_halt_reset_r), FUNC(scd_a12000_halt_reset_w)); // sub-cpu control | |
2330 | space.machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12002, 0xa12003, FUNC(scd_a12002_memory_mode_r), FUNC(scd_a12002_memory_mode_w)); // memory mode / write protect | |
2331 | //space.machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12004, 0xa12005, FUNC(segacd_cdc_mode_address_r), FUNC(segacd_cdc_mode_address_w)); | |
2332 | space.machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12006, 0xa12007, FUNC(scd_a12006_hint_register_r), FUNC(scd_a12006_hint_register_w)); // where HINT points on main CPU | |
2333 | //space.machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0xa12008, 0xa12009, FUNC(cdc_data_main_r)); | |
2329 | space.machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0xa12000, 0xa12001, FUNC(scd_a12000_halt_reset_r), FUNC(scd_a12000_halt_reset_w)); // sub-cpu control | |
2330 | space.machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0xa12002, 0xa12003, FUNC(scd_a12002_memory_mode_r), FUNC(scd_a12002_memory_mode_w)); // memory mode / write protect | |
2331 | //space.machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0xa12004, 0xa12005, FUNC(segacd_cdc_mode_address_r), FUNC(segacd_cdc_mode_address_w)); | |
2332 | space.machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0xa12006, 0xa12007, FUNC(scd_a12006_hint_register_r), FUNC(scd_a12006_hint_register_w)); // where HINT points on main CPU | |
2333 | //space.machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler (0xa12008, 0xa12009, FUNC(cdc_data_main_r)); | |
2334 | 2334 | |
2335 | 2335 | |
2336 | space.machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2336 | space.machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0xa1200c, 0xa1200d, FUNC(segacd_stopwatch_timer_r), FUNC(segacd_stopwatch_timer_w)); // starblad | |
2337 | 2337 | |
2338 | space.machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2338 | space.machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0xa1200e, 0xa1200f, FUNC(segacd_comms_flags_r), FUNC(segacd_comms_flags_maincpu_w)); // communication flags block | |
2339 | 2339 | |
2340 | space.machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12010, 0xa1201f, FUNC(segacd_comms_main_part1_r), FUNC(segacd_comms_main_part1_w)); | |
2341 | space.machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12020, 0xa1202f, FUNC(segacd_comms_main_part2_r), FUNC(segacd_comms_main_part2_w)); | |
2340 | space.machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0xa12010, 0xa1201f, FUNC(segacd_comms_main_part1_r), FUNC(segacd_comms_main_part1_w)); | |
2341 | space.machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0xa12020, 0xa1202f, FUNC(segacd_comms_main_part2_r), FUNC(segacd_comms_main_part2_w)); | |
2342 | 2342 | |
2343 | 2343 | |
2344 | 2344 |
r18027 | r18028 | |
---|---|---|
150 | 150 | { |
151 | 151 | pgm_basic_init(machine()); |
152 | 152 | |
153 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xC0400e, 0xC0400f, FUNC(pgm_asic3_r), FUNC(pgm_asic3_w)); | |
154 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xC04000, 0xC04001, FUNC(pgm_asic3_reg_w)); | |
153 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0xC0400e, 0xC0400f, FUNC(pgm_asic3_r), FUNC(pgm_asic3_w)); | |
154 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xC04000, 0xC04001, FUNC(pgm_asic3_reg_w)); | |
155 | 155 | |
156 | 156 | m_asic3_reg = 0; |
157 | 157 | m_asic3_latch[0] = 0; |
r18027 | r18028 | |
---|---|---|
44 | 44 | offset = (cx4.ram[0x626] & 3) * 2; |
45 | 45 | srcptr = 0x220; |
46 | 46 | |
47 | address_space &space = | |
47 | address_space &space = machine.device<cpu_device>("maincpu")->space(AS_PROGRAM); | |
48 | 48 | for(i = cx4.ram[0x620]; i > 0 && sprcount > 0; i--, srcptr += 16) |
49 | 49 | { |
50 | 50 | UINT32 spraddr = CX4_readl(srcptr + 7); |
r18027 | r18028 | |
---|---|---|
288 | 288 | WRITE_LINE_DEVICE_HANDLER( zwackery_ca2_w ) |
289 | 289 | { |
290 | 290 | mcr68_state *drvstate = device->machine().driver_data<mcr68_state>(); |
291 | address_space &space = | |
291 | address_space &space = device->machine().device("maincpu")->memory().space(AS_PROGRAM); | |
292 | 292 | drvstate->m_chip_squeak_deluxe->write(space, 0, (state << 4) | drvstate->m_zwackery_sound_data); |
293 | 293 | } |
294 | 294 |
r18027 | r18028 | |
---|---|---|
632 | 632 | |
633 | 633 | static void cps2_decrypt(running_machine &machine, const UINT32 *master_key, UINT32 upper_limit) |
634 | 634 | { |
635 | address_space &space = | |
635 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
636 | 636 | UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base(); |
637 | 637 | int length = machine.root_device().memregion("maincpu")->bytes(); |
638 | 638 | UINT16 *dec = auto_alloc_array(machine, UINT16, length/2); |
r18027 | r18028 | |
---|---|---|
293 | 293 | /* put some fake code for the ARM here ... */ |
294 | 294 | pgm_create_dummy_internal_arm_region(machine()); |
295 | 295 | |
296 | machine().device("prot")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x18000444, 0x18000447, FUNC(dmnfrnt_speedup_r)); | |
297 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80a03c, 0x80a03d, FUNC(dmnfrnt_main_speedup_r)); | |
296 | machine().device("prot")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x18000444, 0x18000447, FUNC(dmnfrnt_speedup_r)); | |
297 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x80a03c, 0x80a03d, FUNC(dmnfrnt_main_speedup_r)); | |
298 | 298 | |
299 | 299 | m_svg_ram_sel = 1; |
300 | 300 |
r18027 | r18028 | |
---|---|---|
204 | 204 | irq4_on_timer = machine().scheduler().timer_alloc(FUNC(irq4_on_timer_callback), (void*)this); |
205 | 205 | megadriv_render_timer = machine().scheduler().timer_alloc(FUNC(megadriv_render_timer_callback), (void*)this); |
206 | 206 | |
207 | m_space68k = machine().device<legacy_cpu_device>(":maincpu")->space(); | |
207 | m_space68k = &machine().device<legacy_cpu_device>(":maincpu")->space(); | |
208 | 208 | m_cpu68k = machine().device<legacy_cpu_device>(":maincpu"); |
209 | 209 | } |
210 | 210 |
r18027 | r18028 | |
---|---|---|
174 | 174 | akiko_state *state = get_safe_token(device); |
175 | 175 | |
176 | 176 | state->set_machine(machine); |
177 | state->m_space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
177 | state->m_space = &machine.device("maincpu")->memory().space(AS_PROGRAM); | |
178 | 178 | state->m_c2p_input_index = 0; |
179 | 179 | state->m_c2p_output_index = 0; |
180 | 180 |
r18027 | r18028 | |
---|---|---|
605 | 605 | |
606 | 606 | DRIVER_INIT_MEMBER(micro3d_state,micro3d) |
607 | 607 | { |
608 | address_space &space = | |
608 | address_space &space = machine().device("drmath")->memory().space(AS_DATA); | |
609 | 609 | |
610 | 610 | i8051_set_serial_tx_callback(machine().device("audiocpu"), data_from_i8031); |
611 | 611 | i8051_set_serial_rx_callback(machine().device("audiocpu"), data_to_i8031); |
r18027 | r18028 | |
624 | 624 | |
625 | 625 | DRIVER_INIT_MEMBER(micro3d_state,botss) |
626 | 626 | { |
627 | address_space &space = | |
627 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
628 | 628 | |
629 | 629 | /* Required to pass the hardware version check */ |
630 | 630 | space.install_read_handler(0x140000, 0x140001, read16_delegate(FUNC(micro3d_state::botss_140000_r),this)); |
r18027 | r18028 | |
---|---|---|
916 | 916 | image->battery_load(state->m_md_cart.sram, state->m_md_cart.sram_end - state->m_md_cart.sram_start + 1, 0xff); // Dino Dini's Soccer needs backup RAM to be 1fill |
917 | 917 | memcpy(megadriv_backupram, state->m_md_cart.sram, state->m_md_cart.sram_end - state->m_md_cart.sram_start + 1); |
918 | 918 | |
919 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(state->m_md_cart.sram_start & mask, state->m_md_cart.sram_end & mask, FUNC(genesis_sram_read)); | |
920 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(state->m_md_cart.sram_start & mask, state->m_md_cart.sram_end & mask, FUNC(genesis_sram_write)); | |
919 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(state->m_md_cart.sram_start & mask, state->m_md_cart.sram_end & mask, FUNC(genesis_sram_read)); | |
920 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(state->m_md_cart.sram_start & mask, state->m_md_cart.sram_end & mask, FUNC(genesis_sram_write)); | |
921 | 921 | state->m_md_cart.sram_handlers_installed = 1; |
922 | 922 | } |
923 | 923 | |
r18027 | r18028 | |
1245 | 1245 | case CM_JCART: |
1246 | 1246 | case CM_JCART_SEPROM: |
1247 | 1247 | /* Codemasters PCB (J-Carts) */ |
1248 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x38fffe, 0x38ffff, FUNC(jcart_ctrl_r)); | |
1249 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x38fffe, 0x38ffff, FUNC(jcart_ctrl_w)); | |
1248 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x38fffe, 0x38ffff, FUNC(jcart_ctrl_r)); | |
1249 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x38fffe, 0x38ffff, FUNC(jcart_ctrl_w)); | |
1250 | 1250 | break; |
1251 | 1251 | |
1252 | 1252 | case SSF2: |
r18027 | r18028 | |
1254 | 1254 | memcpy(&ROM[0x400000], &ROM[VIRGIN_COPY_GEN], 0x400000); |
1255 | 1255 | memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x400000); |
1256 | 1256 | |
1257 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1257 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa130f0, 0xa130ff, FUNC(genesis_ssf2_bank_w)); | |
1258 | 1258 | break; |
1259 | 1259 | |
1260 | 1260 | case LIONK3: |
r18027 | r18028 | |
1263 | 1263 | memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x200000); /* default rom */ |
1264 | 1264 | memcpy(&ROM[0x200000], &ROM[VIRGIN_COPY_GEN], 0x200000); /* default rom */ |
1265 | 1265 | |
1266 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x600000, 0x6fffff, FUNC(l3alt_prot_r), FUNC(l3alt_prot_w)); | |
1267 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x700000, 0x7fffff, FUNC(l3alt_bank_w)); | |
1266 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x600000, 0x6fffff, FUNC(l3alt_prot_r), FUNC(l3alt_prot_w)); | |
1267 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x700000, 0x7fffff, FUNC(l3alt_bank_w)); | |
1268 | 1268 | break; |
1269 | 1269 | |
1270 | 1270 | case SDK99: |
r18027 | r18028 | |
1273 | 1273 | memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x300000); /* default rom */ |
1274 | 1274 | memcpy(&ROM[0x300000], &ROM[VIRGIN_COPY_GEN], 0x100000); /* default rom */ |
1275 | 1275 | |
1276 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x600000, 0x6fffff, FUNC(l3alt_prot_r), FUNC(l3alt_prot_w)); | |
1277 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x700000, 0x7fffff, FUNC(l3alt_bank_w)); | |
1276 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x600000, 0x6fffff, FUNC(l3alt_prot_r), FUNC(l3alt_prot_w)); | |
1277 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x700000, 0x7fffff, FUNC(l3alt_bank_w)); | |
1278 | 1278 | break; |
1279 | 1279 | |
1280 | 1280 | case REDCLIFF: |
1281 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400001, FUNC(redclif_prot2_r)); | |
1282 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400004, 0x400005, FUNC(redclif_prot_r)); | |
1281 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400000, 0x400001, FUNC(redclif_prot2_r)); | |
1282 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400004, 0x400005, FUNC(redclif_prot_r)); | |
1283 | 1283 | break; |
1284 | 1284 | |
1285 | 1285 | case REDCL_EN: |
r18027 | r18028 | |
1287 | 1287 | ROM[x] ^= 0x40; |
1288 | 1288 | memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN + 4], 0x200000); /* default rom */ |
1289 | 1289 | |
1290 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400001, FUNC(redclif_prot2_r)); | |
1291 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400004, 0x400005, FUNC(redclif_prot_r)); | |
1290 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400000, 0x400001, FUNC(redclif_prot2_r)); | |
1291 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400004, 0x400005, FUNC(redclif_prot_r)); | |
1292 | 1292 | break; |
1293 | 1293 | |
1294 | 1294 | case RADICA: |
r18027 | r18028 | |
1296 | 1296 | memcpy(&ROM[0x400000], &ROM[VIRGIN_COPY_GEN], 0x400000); // keep a copy for later banking.. making use of huge ROM_REGION allocated to genesis driver |
1297 | 1297 | memcpy(&ROM[0x800000], &ROM[VIRGIN_COPY_GEN], 0x400000); // wraparound banking (from hazemd code) |
1298 | 1298 | |
1299 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1299 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xa13000, 0xa1307f, FUNC(radica_bank_select)); | |
1300 | 1300 | break; |
1301 | 1301 | |
1302 | 1302 | case KOF99: |
1303 | 1303 | //memcpy(&ROM[0x000000],&ROM[VIRGIN_COPY_GEN],0x300000); |
1304 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa13000, 0xa13001, FUNC(kof99_A13000_r)); | |
1305 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa13002, 0xa13003, FUNC(kof99_A13002_r)); | |
1306 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa1303e, 0xa1303f, FUNC(kof99_00A1303E_r)); | |
1304 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xa13000, 0xa13001, FUNC(kof99_A13000_r)); | |
1305 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xa13002, 0xa13003, FUNC(kof99_A13002_r)); | |
1306 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xa1303e, 0xa1303f, FUNC(kof99_00A1303E_r)); | |
1307 | 1307 | break; |
1308 | 1308 | |
1309 | 1309 | case SOULBLAD: |
1310 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400002, 0x400003, FUNC(soulb_400002_r)); | |
1311 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400004, 0x400005, FUNC(soulb_400004_r)); | |
1312 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400006, 0x400007, FUNC(soulb_400006_r)); | |
1310 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400002, 0x400003, FUNC(soulb_400002_r)); | |
1311 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400004, 0x400005, FUNC(soulb_400004_r)); | |
1312 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400006, 0x400007, FUNC(soulb_400006_r)); | |
1313 | 1313 | break; |
1314 | 1314 | |
1315 | 1315 | case MJLOVER: |
1316 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400001, FUNC(mjlovr_prot_1_r)); | |
1317 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x401000, 0x401001, FUNC(mjlovr_prot_2_r)); | |
1316 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400000, 0x400001, FUNC(mjlovr_prot_1_r)); | |
1317 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x401000, 0x401001, FUNC(mjlovr_prot_2_r)); | |
1318 | 1318 | break; |
1319 | 1319 | |
1320 | 1320 | case SQUIRRELK: |
1321 | 1321 | state->m_md_cart.squirrel_king_extra = 0; |
1322 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400007, FUNC(squirrel_king_extra_r)); | |
1323 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x400000, 0x400007, FUNC(squirrel_king_extra_w)); | |
1322 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400000, 0x400007, FUNC(squirrel_king_extra_r)); | |
1323 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x400000, 0x400007, FUNC(squirrel_king_extra_w)); | |
1324 | 1324 | break; |
1325 | 1325 | |
1326 | 1326 | case SMOUSE: |
1327 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1327 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400000, 0x400007, FUNC(smous_prot_r)); | |
1328 | 1328 | break; |
1329 | 1329 | |
1330 | 1330 | case SMB: |
1331 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1331 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xa13000, 0xa13001, FUNC(smbro_prot_r)); | |
1332 | 1332 | break; |
1333 | 1333 | |
1334 | 1334 | case SMB2: |
1335 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1335 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xa13000, 0xa13001, FUNC(smb2_extra_r)); | |
1336 | 1336 | break; |
1337 | 1337 | |
1338 | 1338 | case KAIJU: |
r18027 | r18028 | |
1340 | 1340 | memcpy(&ROM[0x600000], &ROM[VIRGIN_COPY_GEN], 0x200000); |
1341 | 1341 | memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x200000); |
1342 | 1342 | |
1343 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1343 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x700000, 0x7fffff, FUNC(kaiju_bank_w)); | |
1344 | 1344 | break; |
1345 | 1345 | |
1346 | 1346 | case CHINFIGHT3: |
r18027 | r18028 | |
1348 | 1348 | memcpy(&ROM[0x600000], &ROM[VIRGIN_COPY_GEN], 0x200000); |
1349 | 1349 | memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x200000); |
1350 | 1350 | |
1351 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x4fffff, FUNC(chifi3_prot_r)); | |
1352 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x600000, 0x6fffff, FUNC(chifi3_bank_w)); | |
1351 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400000, 0x4fffff, FUNC(chifi3_prot_r)); | |
1352 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x600000, 0x6fffff, FUNC(chifi3_bank_w)); | |
1353 | 1353 | break; |
1354 | 1354 | |
1355 | 1355 | case LIONK2: |
1356 | 1356 | state->m_md_cart.lion2_prot1_data = state->m_md_cart.lion2_prot2_data = 0; |
1357 | 1357 | |
1358 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400002, 0x400003, FUNC(lion2_prot1_r)); | |
1359 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400006, 0x400007, FUNC(lion2_prot2_r)); | |
1360 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x400000, 0x400001, FUNC(lion2_prot1_w)); | |
1361 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x400004, 0x400005, FUNC(lion2_prot2_w)); | |
1358 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400002, 0x400003, FUNC(lion2_prot1_r)); | |
1359 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400006, 0x400007, FUNC(lion2_prot2_r)); | |
1360 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x400000, 0x400001, FUNC(lion2_prot1_w)); | |
1361 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x400004, 0x400005, FUNC(lion2_prot2_w)); | |
1362 | 1362 | break; |
1363 | 1363 | |
1364 | 1364 | case BUGSLIFE: |
1365 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1365 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xa13000, 0xa13001, FUNC(bugl_extra_r)); | |
1366 | 1366 | break; |
1367 | 1367 | |
1368 | 1368 | case ELFWOR: |
1369 | 1369 | /* It return (0x55 @ 0x400000 OR 0xc9 @ 0x400004) AND (0x0f @ 0x400002 OR 0x18 @ 0x400006). It is probably best to add handlers for all 4 addresses. */ |
1370 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400001, FUNC(elfwor_400000_r)); | |
1371 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400002, 0x400003, FUNC(elfwor_400002_r)); | |
1372 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400004, 0x400005, FUNC(elfwor_400004_r)); | |
1373 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400006, 0x400007, FUNC(elfwor_400006_r)); | |
1370 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400000, 0x400001, FUNC(elfwor_400000_r)); | |
1371 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400002, 0x400003, FUNC(elfwor_400002_r)); | |
1372 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400004, 0x400005, FUNC(elfwor_400004_r)); | |
1373 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400006, 0x400007, FUNC(elfwor_400006_r)); | |
1374 | 1374 | break; |
1375 | 1375 | |
1376 | 1376 | case ROCKMANX3: |
1377 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1377 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xa13000, 0xa13001, FUNC(rx3_extra_r)); | |
1378 | 1378 | break; |
1379 | 1379 | |
1380 | 1380 | case SBUBBOB: |
1381 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400001, FUNC(sbub_extra1_r)); | |
1382 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400002, 0x400003, FUNC(sbub_extra2_r)); | |
1381 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400000, 0x400001, FUNC(sbub_extra1_r)); | |
1382 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400002, 0x400003, FUNC(sbub_extra2_r)); | |
1383 | 1383 | break; |
1384 | 1384 | |
1385 | 1385 | case KOF98: |
1386 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x480000, 0x480001, FUNC(kof98_aa_r)); | |
1387 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4800e0, 0x4800e1, FUNC(kof98_aa_r)); | |
1388 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4824a0, 0x4824a1, FUNC(kof98_aa_r)); | |
1389 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x488880, 0x488881, FUNC(kof98_aa_r)); | |
1386 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x480000, 0x480001, FUNC(kof98_aa_r)); | |
1387 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x4800e0, 0x4800e1, FUNC(kof98_aa_r)); | |
1388 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x4824a0, 0x4824a1, FUNC(kof98_aa_r)); | |
1389 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x488880, 0x488881, FUNC(kof98_aa_r)); | |
1390 | 1390 | |
1391 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4a8820, 0x4a8821, FUNC(kof98_0a_r)); | |
1392 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4f8820, 0x4f8821, FUNC(kof98_00_r)); | |
1391 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x4a8820, 0x4a8821, FUNC(kof98_0a_r)); | |
1392 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x4f8820, 0x4f8821, FUNC(kof98_00_r)); | |
1393 | 1393 | break; |
1394 | 1394 | |
1395 | 1395 | case REALTEC: |
r18027 | r18028 | |
1402 | 1402 | for (mirroraddr = 0; mirroraddr < 0x400000; mirroraddr += 0x2000) |
1403 | 1403 | memcpy(ROM + mirroraddr, ROM + VIRGIN_COPY_GEN + 0x7e000, 0x002000); /* copy last 8kb across the whole rom region */ |
1404 | 1404 | |
1405 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x400000, 0x400001, FUNC(realtec_400000_w)); | |
1406 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x402000, 0x402001, FUNC(realtec_402000_w)); | |
1407 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x404000, 0x404001, FUNC(realtec_404000_w)); | |
1405 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x400000, 0x400001, FUNC(realtec_400000_w)); | |
1406 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x402000, 0x402001, FUNC(realtec_402000_w)); | |
1407 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x404000, 0x404001, FUNC(realtec_404000_w)); | |
1408 | 1408 | break; |
1409 | 1409 | |
1410 | 1410 | case MC_SUP19IN1: |
1411 | 1411 | memcpy(&ROM[0x400000], &ROM[VIRGIN_COPY_GEN], 0x400000); // allow hard reset to menu |
1412 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1412 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa13000, 0xa13039, FUNC(s19in1_bank)); | |
1413 | 1413 | break; |
1414 | 1414 | |
1415 | 1415 | case MC_SUP15IN1: |
1416 | 1416 | memcpy(&ROM[0x400000], &ROM[VIRGIN_COPY_GEN], 0x200000); // allow hard reset to menu |
1417 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1417 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa13000, 0xa13039, FUNC(s19in1_bank)); | |
1418 | 1418 | break; |
1419 | 1419 | |
1420 | 1420 | case MC_12IN1: |
1421 | 1421 | memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x400000); /* default rom */ |
1422 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1422 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa13000, 0xa1303f, FUNC(mc_12in1_bank_w)); | |
1423 | 1423 | break; |
1424 | 1424 | |
1425 | 1425 | case TOPFIGHTER: |
1426 | 1426 | memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x400000); /* default rom */ |
1427 | 1427 | |
1428 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6f5344, 0x6f5345, FUNC(topfig_6F5344_r) ); | |
1429 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6bd294, 0x6bd295, FUNC(topfig_6BD294_r) ); | |
1430 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x645b44, 0x645b45, FUNC(topfig_645B44_r) ); | |
1428 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x6f5344, 0x6f5345, FUNC(topfig_6F5344_r) ); | |
1429 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x6bd294, 0x6bd295, FUNC(topfig_6BD294_r) ); | |
1430 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x645b44, 0x645b45, FUNC(topfig_645B44_r) ); | |
1431 | 1431 | |
1432 | 1432 | /* readd */ |
1433 | //machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x689b80, 0x689b81, FUNC(MWA16_NOP)); | |
1434 | //machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x6d8b02, 0x6d8b03, FUNC(MWA16_NOP)); | |
1433 | //machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x689b80, 0x689b81, FUNC(MWA16_NOP)); | |
1434 | //machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x6d8b02, 0x6d8b03, FUNC(MWA16_NOP)); | |
1435 | 1435 | |
1436 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1436 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x700000, 0x7fffff, FUNC(topfig_bank_w) ); | |
1437 | 1437 | break; |
1438 | 1438 | case PSOLAR: |
1439 | 1439 | memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x400000); |
1440 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa13002, 0xa13007, FUNC(psolar_bank_w)); | |
1441 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa13000, 0xa13001, FUNC(psolar_unk_w)); | |
1442 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0015e6, 0x0015e9, FUNC(psolar_hack_r)); | |
1440 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa13002, 0xa13007, FUNC(psolar_bank_w)); | |
1441 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa13000, 0xa13001, FUNC(psolar_unk_w)); | |
1442 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x0015e6, 0x0015e9, FUNC(psolar_hack_r)); | |
1443 | 1443 | psolar_rdcnt = 0; |
1444 | 1444 | break; |
1445 | 1445 | } |
r18027 | r18028 | |
1507 | 1507 | } |
1508 | 1508 | |
1509 | 1509 | /* install NOP handler for TMSS */ |
1510 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1510 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa14000, 0xa14003, FUNC(genesis_TMSS_bank_w)); | |
1511 | 1511 | } |
1512 | 1512 | |
1513 | 1513 | static void setup_megadriv_sram(device_image_interface &image) |
r18027 | r18028 | |
1535 | 1535 | state->m_md_cart.sram_end = state->m_md_cart.sram_start + image.get_software_region_length("sram") - 1; |
1536 | 1536 | state->m_md_cart.sram_detected = 1; |
1537 | 1537 | megadriv_backupram = (UINT16*) (ROM + state->m_md_cart.sram_start); |
1538 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1538 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa130f0, 0xa130f1, FUNC(genesis_sram_toggle)); | |
1539 | 1539 | if (state->m_md_cart.last_loaded_image_length <= state->m_md_cart.sram_start) |
1540 | 1540 | { |
1541 | 1541 | state->m_md_cart.sram_active = 1; |
r18027 | r18028 | |
1557 | 1557 | state->m_md_cart.sram_end = state->m_md_cart.sram_start + image.get_software_region_length("fram") - 1; |
1558 | 1558 | state->m_md_cart.sram_detected = 1; |
1559 | 1559 | megadriv_backupram = (UINT16*) (ROM + state->m_md_cart.sram_start); |
1560 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa130f0, 0xa130f1, FUNC(sega_6658a_reg_r)); | |
1561 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa130f0, 0xa130f1, FUNC(sega_6658a_reg_w)); | |
1560 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xa130f0, 0xa130f1, FUNC(sega_6658a_reg_r)); | |
1561 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa130f0, 0xa130f1, FUNC(sega_6658a_reg_w)); | |
1562 | 1562 | install_sram_rw_handlers(machine, FALSE); |
1563 | 1563 | break; |
1564 | 1564 | |
1565 | 1565 | // These types might come either from xml or from old-styele loading |
1566 | 1566 | case SEGA_EEPROM: |
1567 | 1567 | state->m_md_cart.has_serial_eeprom = 1; |
1568 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1568 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x200000, 0x200001, FUNC(wboy_v_eeprom_r), FUNC(wboy_v_eeprom_w)); | |
1569 | 1569 | break; |
1570 | 1570 | |
1571 | 1571 | case NBA_JAM: |
1572 | 1572 | state->m_md_cart.has_serial_eeprom = 1; |
1573 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1573 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x200000, 0x200001, FUNC(nba_jam_eeprom_r), FUNC(nba_jam_eeprom_w)); | |
1574 | 1574 | break; |
1575 | 1575 | |
1576 | 1576 | case NBA_JAM_TE: |
1577 | 1577 | case NFL_QB_96: |
1578 | 1578 | case C_SLAM: // same handling but different sizes |
1579 | 1579 | state->m_md_cart.has_serial_eeprom = 1; |
1580 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1580 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x200000, 0x200001, FUNC(nba_jam_te_eeprom_r), FUNC(nba_jam_te_eeprom_w)); | |
1581 | 1581 | break; |
1582 | 1582 | |
1583 | 1583 | case EA_NHLPA: |
1584 | 1584 | state->m_md_cart.has_serial_eeprom = 1; |
1585 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1585 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x200000, 0x200001, FUNC(ea_nhlpa_eeprom_r), FUNC(ea_nhlpa_eeprom_w)); | |
1586 | 1586 | break; |
1587 | 1587 | |
1588 | 1588 | case CODE_MASTERS: |
1589 | 1589 | case CM_JCART_SEPROM: |
1590 | 1590 | state->m_md_cart.has_serial_eeprom = 1; |
1591 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x300000, 0x300001, FUNC(codemasters_eeprom_w)); | |
1592 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x380000, 0x380001, FUNC(codemasters_eeprom_r)); | |
1591 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x300000, 0x300001, FUNC(codemasters_eeprom_w)); | |
1592 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x380000, 0x380001, FUNC(codemasters_eeprom_r)); | |
1593 | 1593 | break; |
1594 | 1594 | case PSOLAR: |
1595 | 1595 | state->m_md_cart.sram_start = 0x800000; |
r18027 | r18028 | |
1599 | 1599 | STM95.eeprom_data = (UINT8*)state->m_md_cart.sram; |
1600 | 1600 | |
1601 | 1601 | state->m_md_cart.has_serial_eeprom = 1; |
1602 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa13008, 0xa13009, FUNC(psolar_eeprom_w)); | |
1603 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa1300a, 0xa1300b, FUNC(psolar_eeprom_r)); | |
1602 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa13008, 0xa13009, FUNC(psolar_eeprom_w)); | |
1603 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xa1300a, 0xa1300b, FUNC(psolar_eeprom_r)); | |
1604 | 1604 | break; |
1605 | 1605 | } |
1606 | 1606 | |
r18027 | r18028 | |
1652 | 1652 | if (state->m_md_cart.last_loaded_image_length <= state->m_md_cart.sram_start) |
1653 | 1653 | state->m_md_cart.sram_active = 1; |
1654 | 1654 | |
1655 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1655 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa130f0, 0xa130f1, FUNC(genesis_sram_toggle)); | |
1656 | 1656 | //printf("res: start %x, end %x, det %d, active %d\n", state->m_md_cart.sram_start, state->m_md_cart.sram_end, state->m_md_cart.sram_detected, state->m_md_cart.sram_active); |
1657 | 1657 | |
1658 | 1658 | /* Sonic 1 included in Sonic Classics doesn't have SRAM and |
r18027 | r18028 | |
---|---|---|
1243 | 1243 | int kaneko_calc3_device::calc3_decompress_table(running_machine& machine, int tabnum, UINT8* dstram, int dstoffset) |
1244 | 1244 | { |
1245 | 1245 | calc3_t &calc3 = m_calc3; |
1246 | address_space &space = | |
1246 | address_space &space = machine.device(":maincpu")->memory().space(AS_PROGRAM); | |
1247 | 1247 | UINT8* datarom = memregion(":calc3_rom")->base(); |
1248 | 1248 | |
1249 | 1249 | UINT8 numregions; |
r18027 | r18028 | |
1344 | 1344 | //printf("save to eeprom\n"); |
1345 | 1345 | |
1346 | 1346 | { |
1347 | address_space | |
1347 | address_space &eeprom_space = space.machine().device<eeprom_device>(":eeprom")->space(); | |
1348 | 1348 | |
1349 | 1349 | for (i=0;i<0x80;i++) |
1350 | 1350 | { |
1351 | eeprom_space | |
1351 | eeprom_space.write_byte(i, space.read_byte(calc3.eeprom_addr+0x200000+i)); | |
1352 | 1352 | } |
1353 | 1353 | |
1354 | 1354 | } |
r18027 | r18028 | |
1633 | 1633 | calc3_t &calc3 = m_calc3; |
1634 | 1634 | UINT16 mcu_command; |
1635 | 1635 | int i; |
1636 | address_space &space = | |
1636 | address_space &space = machine.device(":maincpu")->memory().space(AS_PROGRAM); | |
1637 | 1637 | |
1638 | 1638 | if ( calc3.mcu_status != (1|2|4|8) ) return; |
1639 | 1639 | |
r18027 | r18028 | |
1689 | 1689 | } |
1690 | 1690 | #endif |
1691 | 1691 | { |
1692 | address_space | |
1692 | address_space &eeprom_space = space.machine().device<eeprom_device>(":eeprom")->space(); | |
1693 | 1693 | |
1694 | 1694 | for (i=0;i<0x80;i++) |
1695 | 1695 | { |
1696 | space.write_byte(calc3.eeprom_addr+0x200000+i, eeprom_space | |
1696 | space.write_byte(calc3.eeprom_addr+0x200000+i, eeprom_space.read_byte(i)); | |
1697 | 1697 | } |
1698 | 1698 | |
1699 | 1699 | } |
r18027 | r18028 | |
---|---|---|
51 | 51 | /* move to individual boards as documentation of actual boards allows */ |
52 | 52 | m_nt_ram = auto_alloc_array(machine(), UINT8, 0x1000); |
53 | 53 | |
54 | machine().device("ppu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0, 0x1fff, read8_delegate(FUNC(playch10_state::pc10_chr_r),this), write8_delegate(FUNC(playch10_state::pc10_chr_w),this)); | |
55 | machine().device("ppu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(playch10_state::pc10_nt_r),this),write8_delegate(FUNC(playch10_state::pc10_nt_w),this)); | |
54 | machine().device("ppu")->memory().space(AS_PROGRAM).install_readwrite_handler(0, 0x1fff, read8_delegate(FUNC(playch10_state::pc10_chr_r),this), write8_delegate(FUNC(playch10_state::pc10_chr_w),this)); | |
55 | machine().device("ppu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(playch10_state::pc10_nt_r),this),write8_delegate(FUNC(playch10_state::pc10_nt_w),this)); | |
56 | 56 | |
57 | 57 | if (NULL != m_vram) |
58 | 58 | set_videoram_bank(machine(), 0, 8, 0, 8); |
r18027 | r18028 | |
74 | 74 | |
75 | 75 | m_vram = auto_alloc_array(machine(), UINT8, 0x2000); |
76 | 76 | |
77 | machine().device("ppu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0, 0x1fff, read8_delegate(FUNC(playch10_state::pc10_chr_r),this), write8_delegate(FUNC(playch10_state::pc10_chr_w),this)); | |
78 | machine().device("ppu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(playch10_state::pc10_nt_r),this), write8_delegate(FUNC(playch10_state::pc10_nt_w),this)); | |
77 | machine().device("ppu")->memory().space(AS_PROGRAM).install_readwrite_handler(0, 0x1fff, read8_delegate(FUNC(playch10_state::pc10_chr_r),this), write8_delegate(FUNC(playch10_state::pc10_chr_w),this)); | |
78 | machine().device("ppu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(playch10_state::pc10_nt_r),this), write8_delegate(FUNC(playch10_state::pc10_nt_w),this)); | |
79 | 79 | } |
80 | 80 | |
81 | 81 | /************************************* |
r18027 | r18028 | |
581 | 581 | DRIVER_INIT_MEMBER(playch10_state,pcaboard) |
582 | 582 | { |
583 | 583 | /* switches vrom with writes to the $803e-$8041 area */ |
584 | machine().device("cart")->memory().space(AS_PROGRAM) | |
584 | machine().device("cart")->memory().space(AS_PROGRAM).install_write_handler(0x8000, 0x8fff, write8_delegate(FUNC(playch10_state::aboard_vrom_switch_w),this)); | |
585 | 585 | |
586 | 586 | /* common init */ |
587 | 587 | DRIVER_INIT_CALL(playch10); |
r18027 | r18028 | |
613 | 613 | memcpy(&prg[0x08000], &prg[0x28000], 0x8000); |
614 | 614 | |
615 | 615 | /* Roms are banked at $8000 to $bfff */ |
616 | machine().device("cart")->memory().space(AS_PROGRAM) | |
616 | machine().device("cart")->memory().space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(playch10_state::bboard_rom_switch_w),this)); | |
617 | 617 | |
618 | 618 | /* common init */ |
619 | 619 | DRIVER_INIT_CALL(playch10); |
r18027 | r18028 | |
638 | 638 | DRIVER_INIT_MEMBER(playch10_state,pccboard) |
639 | 639 | { |
640 | 640 | /* switches vrom with writes to $6000 */ |
641 | machine().device("cart")->memory().space(AS_PROGRAM) | |
641 | machine().device("cart")->memory().space(AS_PROGRAM).install_write_handler(0x6000, 0x6000, write8_delegate(FUNC(playch10_state::cboard_vrom_switch_w),this)); | |
642 | 642 | |
643 | 643 | /* we have no vram, make sure switching games doesn't point to an old allocation */ |
644 | 644 | m_vram = NULL; |
r18027 | r18028 | |
661 | 661 | m_mmc1_rom_mask = 0x07; |
662 | 662 | |
663 | 663 | /* MMC mapper at writes to $8000-$ffff */ |
664 | machine().device("cart")->memory().space(AS_PROGRAM) | |
664 | machine().device("cart")->memory().space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(playch10_state::mmc1_rom_switch_w),this)); | |
665 | 665 | |
666 | 666 | |
667 | 667 | /* common init */ |
r18027 | r18028 | |
677 | 677 | DRIVER_INIT_MEMBER(playch10_state,pcdboard_2) |
678 | 678 | { |
679 | 679 | /* extra ram at $6000-$7fff */ |
680 | machine().device("cart")->memory().space(AS_PROGRAM) | |
680 | machine().device("cart")->memory().space(AS_PROGRAM).install_ram(0x6000, 0x7fff); | |
681 | 681 | |
682 | 682 | /* common init */ |
683 | 683 | DRIVER_INIT_CALL(pcdboard); |
r18027 | r18028 | |
775 | 775 | memcpy(&prg[0x08000], &prg[0x28000], 0x8000); |
776 | 776 | |
777 | 777 | /* basically a mapper 9 on a nes */ |
778 | machine().device("cart")->memory().space(AS_PROGRAM) | |
778 | machine().device("cart")->memory().space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(playch10_state::eboard_rom_switch_w),this)); | |
779 | 779 | |
780 | 780 | /* ppu_latch callback */ |
781 | 781 | ppu->set_latch(mapper9_latch); |
782 | 782 | |
783 | 783 | /* nvram at $6000-$6fff */ |
784 | machine().device("cart")->memory().space(AS_PROGRAM) | |
784 | machine().device("cart")->memory().space(AS_PROGRAM).install_ram(0x6000, 0x6fff); | |
785 | 785 | |
786 | 786 | /* common init */ |
787 | 787 | DRIVER_INIT_CALL(playch10); |
r18027 | r18028 | |
804 | 804 | m_mmc1_rom_mask = 0x07; |
805 | 805 | |
806 | 806 | /* MMC mapper at writes to $8000-$ffff */ |
807 | machine().device("cart")->memory().space(AS_PROGRAM) | |
807 | machine().device("cart")->memory().space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(playch10_state::mmc1_rom_switch_w),this)); | |
808 | 808 | |
809 | 809 | /* common init */ |
810 | 810 | DRIVER_INIT_CALL(playch10); |
r18027 | r18028 | |
815 | 815 | DRIVER_INIT_MEMBER(playch10_state,pcfboard_2) |
816 | 816 | { |
817 | 817 | /* extra ram at $6000-$6fff */ |
818 | machine().device("cart")->memory().space(AS_PROGRAM) | |
818 | machine().device("cart")->memory().space(AS_PROGRAM).install_ram(0x6000, 0x6fff); | |
819 | 819 | |
820 | 820 | m_vram = NULL; |
821 | 821 | |
r18027 | r18028 | |
991 | 991 | memcpy(&prg[0x0c000], &prg[0x4c000], 0x4000); |
992 | 992 | |
993 | 993 | /* MMC3 mapper at writes to $8000-$ffff */ |
994 | machine().device("cart")->memory().space(AS_PROGRAM) | |
994 | machine().device("cart")->memory().space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(playch10_state::gboard_rom_switch_w),this)); | |
995 | 995 | |
996 | 996 | /* extra ram at $6000-$7fff */ |
997 | machine().device("cart")->memory().space(AS_PROGRAM) | |
997 | machine().device("cart")->memory().space(AS_PROGRAM).install_ram(0x6000, 0x7fff); | |
998 | 998 | |
999 | 999 | m_gboard_banks[0] = 0x1e; |
1000 | 1000 | m_gboard_banks[1] = 0x1f; |
r18027 | r18028 | |
1045 | 1045 | memcpy(&prg[0x08000], &prg[0x10000], 0x8000); |
1046 | 1046 | |
1047 | 1047 | /* Roms are banked at $8000 to $bfff */ |
1048 | machine().device("cart")->memory().space(AS_PROGRAM) | |
1048 | machine().device("cart")->memory().space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(playch10_state::iboard_rom_switch_w),this)); | |
1049 | 1049 | |
1050 | 1050 | /* common init */ |
1051 | 1051 | DRIVER_INIT_CALL(playch10); |
r18027 | r18028 | |
1112 | 1112 | memcpy(&prg[0x0c000], &prg[0x4c000], 0x4000); |
1113 | 1113 | |
1114 | 1114 | /* Roms are banked at $8000 to $bfff */ |
1115 | machine().device("cart")->memory().space(AS_PROGRAM) | |
1115 | machine().device("cart")->memory().space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(playch10_state::hboard_rom_switch_w),this)); | |
1116 | 1116 | |
1117 | 1117 | /* extra ram at $6000-$7fff */ |
1118 | machine().device("cart")->memory().space(AS_PROGRAM) | |
1118 | machine().device("cart")->memory().space(AS_PROGRAM).install_ram(0x6000, 0x7fff); | |
1119 | 1119 | |
1120 | 1120 | m_gboard_banks[0] = 0x1e; |
1121 | 1121 | m_gboard_banks[1] = 0x1f; |
r18027 | r18028 | |
1142 | 1142 | m_mmc1_rom_mask = 0x0f; |
1143 | 1143 | |
1144 | 1144 | /* extra ram at $6000-$7fff */ |
1145 | machine().device("cart")->memory().space(AS_PROGRAM) | |
1145 | machine().device("cart")->memory().space(AS_PROGRAM).install_ram(0x6000, 0x7fff); | |
1146 | 1146 | |
1147 | 1147 | /* Roms are banked at $8000 to $bfff */ |
1148 | machine().device("cart")->memory().space(AS_PROGRAM) | |
1148 | machine().device("cart")->memory().space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(playch10_state::mmc1_rom_switch_w),this)); | |
1149 | 1149 | |
1150 | 1150 | /* common init */ |
1151 | 1151 | DRIVER_INIT_CALL(playch10); |
r18027 | r18028 | |
---|---|---|
105 | 105 | if ( new_mmu & 0x80 ) |
106 | 106 | { |
107 | 107 | logerror("%s MMU SELFTEST RAM\n", machine.system().name); |
108 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
108 | machine.device("maincpu")->memory().space(AS_PROGRAM).nop_readwrite(0x5000, 0x57ff); | |
109 | 109 | } |
110 | 110 | else |
111 | 111 | { |
112 | 112 | logerror("%s MMU SELFTEST ROM\n", machine.system().name); |
113 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5000, 0x57ff, "bank2"); | |
114 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x5000, 0x57ff); | |
113 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x5000, 0x57ff, "bank2"); | |
114 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x5000, 0x57ff); | |
115 | 115 | machine.root_device().membank("bank2")->set_base(machine.root_device().memregion("maincpu")->base() + 0x5000); |
116 | 116 | } |
117 | 117 | } |
r18027 | r18028 | |
---|---|---|
712 | 712 | |
713 | 713 | // if address 0 is mapped to ROM, assume this is a state memory mapping and |
714 | 714 | // use the internal state change callback |
715 | if (space(AS_PROGRAM) | |
715 | if (space(AS_PROGRAM).get_read_ptr(0) != NULL) | |
716 | 716 | m_state_change = state_change_delegate(FUNC(fd1094_device::default_state_change), this); |
717 | 717 | |
718 | 718 | // determine length and configure our cache |
r18027 | r18028 | |
961 | 961 | |
962 | 962 | void fd1094_device::default_state_change(UINT8 state) |
963 | 963 | { |
964 | space(AS_PROGRAM) | |
964 | space(AS_PROGRAM).set_decrypted_region(0x000000, m_srcbytes - 1, m_cache.decrypted_opcodes(state)); | |
965 | 965 | } |
966 | 966 | |
967 | 967 |
r18027 | r18028 | |
---|---|---|
207 | 207 | |
208 | 208 | void darkedge_fd1149_vblank(device_t *device) |
209 | 209 | { |
210 | address_space &space = | |
210 | address_space &space = device->memory().space(AS_PROGRAM); | |
211 | 211 | |
212 | 212 | space.write_word(0x20f072, 0); |
213 | 213 | space.write_word(0x20f082, 0); |
r18027 | r18028 | |
243 | 243 | |
244 | 244 | void f1lap_fd1149_vblank(device_t *device) |
245 | 245 | { |
246 | address_space &space = | |
246 | address_space &space = device->memory().space(AS_PROGRAM); | |
247 | 247 | |
248 | 248 | space.write_byte(0x20F7C6, 0); |
249 | 249 |
r18027 | r18028 | |
---|---|---|
200 | 200 | { |
201 | 201 | UINT8* nvdat = (UINT8*)&kaneko16_mcu_ram[mcu_offset]; |
202 | 202 | |
203 | address_space | |
203 | address_space &eeprom_space = machine.device<eeprom_device>(":eeprom")->space(); | |
204 | 204 | |
205 | 205 | for (int i=0;i<0x80;i++) |
206 | 206 | { |
207 | nvdat[i] = eeprom_space | |
207 | nvdat[i] = eeprom_space.read_byte(i); | |
208 | 208 | } |
209 | 209 | |
210 | 210 | logerror("%s : MCU executed command: %04X %04X (load NVRAM settings)\n", machine.describe_context(), mcu_command, mcu_offset*2); |
r18027 | r18028 | |
214 | 214 | |
215 | 215 | case 0x42: // Write to NVRAM |
216 | 216 | { |
217 | address_space | |
217 | address_space &eeprom_space = machine.device<eeprom_device>(":eeprom")->space(); | |
218 | 218 | UINT8* nvdat = (UINT8*)&kaneko16_mcu_ram[mcu_offset]; |
219 | 219 | for (int i=0;i<0x80;i++) |
220 | 220 | { |
221 | eeprom_space | |
221 | eeprom_space.write_byte(i, nvdat[i]); | |
222 | 222 | } |
223 | 223 | |
224 | 224 | logerror("%s : MCU executed command: %04X %04X (save NVRAM settings)\n", machine.describe_context(), mcu_command, mcu_offset*2); |
r18027 | r18028 | |
233 | 233 | //memcpy(m_nvram_save, bonkadv_mcu_43, sizeof(bonkadv_mcu_43)); |
234 | 234 | |
235 | 235 | |
236 | address_space | |
236 | address_space &eeprom_space = machine.device<eeprom_device>(":eeprom")->space(); | |
237 | 237 | UINT8* nvdat = (UINT8*)&bonkadv_mcu_43[0]; |
238 | 238 | for (int i=0;i<0x80;i++) |
239 | 239 | { |
240 | eeprom_space | |
240 | eeprom_space.write_byte(i, nvdat[i]); | |
241 | 241 | } |
242 | 242 | logerror("%s : MCU executed command: %04X %04X (restore default NVRAM settings)\n", machine.describe_context(), mcu_command, mcu_offset*2); |
243 | 243 | } |
r18027 | r18028 | |
---|---|---|
373 | 373 | pgm_basic_init(machine()); |
374 | 374 | pgm_killbld_decrypt(machine()); |
375 | 375 | |
376 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
376 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0xd40000, 0xd40003, FUNC(killbld_igs025_prot_r), FUNC(killbld_igs025_prot_w)); | |
377 | 377 | |
378 | 378 | m_kb_cmd = 0; |
379 | 379 | m_kb_reg = 0; |
r18027 | r18028 | |
536 | 536 | } |
537 | 537 | } |
538 | 538 | */ |
539 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
539 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0xDA5610, 0xDA5613, FUNC(drgw3_igs025_prot_r), FUNC(drgw3_igs025_prot_w)); | |
540 | 540 | |
541 | 541 | pgm_dw3_decrypt(machine()); |
542 | 542 | } |
r18027 | r18028 | |
---|---|---|
101 | 101 | UINT8 Color; |
102 | 102 | INT32 i; |
103 | 103 | |
104 | address_space &space = | |
104 | address_space &space = machine.device<cpu_device>("maincpu")->space(AS_PROGRAM); | |
105 | 105 | for(i = cx4.ram[0x0295]; i > 0; i--, line += 5) |
106 | 106 | { |
107 | 107 | if(space.read_byte(line) == 0xff && |
r18027 | r18028 | |
---|---|---|
186 | 186 | /* set an initial timer to go off on scanline 0 */ |
187 | 187 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), FUNC(scanline_callback)); |
188 | 188 | |
189 | irobot_rom_banksel_w(*machine().device("maincpu")->memory().space(AS_PROGRAM),0,0); | |
190 | irobot_out0_w(*machine().device("maincpu")->memory().space(AS_PROGRAM),0,0); | |
189 | irobot_rom_banksel_w(machine().device("maincpu")->memory().space(AS_PROGRAM),0,0); | |
190 | irobot_out0_w(machine().device("maincpu")->memory().space(AS_PROGRAM),0,0); | |
191 | 191 | m_combase = m_comRAM[0]; |
192 | 192 | m_combase_mb = m_comRAM[1]; |
193 | 193 | m_outx = 0; |
r18027 | r18028 | |
---|---|---|
161 | 161 | |
162 | 162 | static void mitchell_decode(running_machine &machine, int swap_key1,int swap_key2,int addr_key,int xor_key) |
163 | 163 | { |
164 | address_space &space = | |
164 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
165 | 165 | UINT8 *rom = machine.root_device().memregion("maincpu")->base(); |
166 | 166 | UINT8 *decrypt = auto_alloc_array(machine, UINT8, machine.root_device().memregion("maincpu")->bytes()); |
167 | 167 | int numbanks = (machine.root_device().memregion("maincpu")->bytes() - 0x10000) / 0x4000; |
r18027 | r18028 | |
202 | 202 | |
203 | 203 | static void cps1_decode(running_machine &machine,int swap_key1,int swap_key2,int addr_key,int xor_key) |
204 | 204 | { |
205 | address_space &space = | |
205 | address_space &space = machine.device("audiocpu")->memory().space(AS_PROGRAM); | |
206 | 206 | UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x8000); |
207 | 207 | UINT8 *rom = machine.root_device().memregion("audiocpu")->base(); |
208 | 208 |
r18027 | r18028 | |
---|---|---|
443 | 443 | { |
444 | 444 | konamigx_state *state = machine.driver_data<konamigx_state>(); |
445 | 445 | state_save_register_global_array(machine, fantjour_dma); |
446 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
446 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xdb0000, 0xdb001f, write32_delegate(FUNC(konamigx_state::fantjour_dma_w),state)); | |
447 | 447 | memset(fantjour_dma, 0, sizeof(fantjour_dma)); |
448 | 448 | } |
449 | 449 |
r18027 | r18028 | |
---|---|---|
75 | 75 | { |
76 | 76 | /* DSP can read data from main CPU RAM via DSP IO port 1 */ |
77 | 77 | |
78 | address_space *mainspace; | |
79 | 78 | UINT16 input_data = 0; |
80 | 79 | |
81 | 80 | switch (m_main_ram_seg) { |
82 | case 0xc00000: mainspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
83 | input_data = mainspace->read_word(m_main_ram_seg + m_dsp_addr_w); | |
84 | break; | |
81 | case 0xc00000: {address_space &mainspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
82 | input_data = mainspace.read_word(m_main_ram_seg + m_dsp_addr_w); | |
83 | break;} | |
85 | 84 | default: logerror("DSP PC:%04x Warning !!! IO reading from %08x (port 1)\n", space.device().safe_pcbase(), m_main_ram_seg + m_dsp_addr_w); |
86 | 85 | } |
87 | 86 | logerror("DSP PC:%04x IO read %04x at %08x (port 1)\n", space.device().safe_pcbase(), input_data, m_main_ram_seg + m_dsp_addr_w); |
r18027 | r18028 | |
90 | 89 | |
91 | 90 | WRITE16_MEMBER(toaplan1_state::demonwld_dsp_w) |
92 | 91 | { |
93 | address_space *mainspace; | |
94 | ||
95 | 92 | /* Data written to main CPU RAM via DSP IO port 1 */ |
96 | 93 | m_dsp_execute = 0; |
97 | 94 | switch (m_main_ram_seg) { |
98 | case 0xc00000: if ((m_dsp_addr_w < 3) && (data == 0)) m_dsp_execute = 1; | |
99 | mainspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
100 | mainspace->write_word(m_main_ram_seg + m_dsp_addr_w, data); | |
101 | break; | |
95 | case 0xc00000: {if ((m_dsp_addr_w < 3) && (data == 0)) m_dsp_execute = 1; | |
96 | address_space &mainspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
97 | mainspace.write_word(m_main_ram_seg + m_dsp_addr_w, data); | |
98 | break;} | |
102 | 99 | default: logerror("DSP PC:%04x Warning !!! IO writing to %08x (port 1)\n", space.device().safe_pcbase(), m_main_ram_seg + m_dsp_addr_w); |
103 | 100 | } |
104 | 101 | logerror("DSP PC:%04x IO write %04x at %08x (port 1)\n", space.device().safe_pcbase(), data, m_main_ram_seg + m_dsp_addr_w); |
r18027 | r18028 | |
---|---|---|
89 | 89 | } |
90 | 90 | |
91 | 91 | if (memcmp(mem + 0x06,"SRAM",4)) { |
92 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM) | |
92 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x0000, 0x7fff); | |
93 | 93 | } |
94 | 94 | |
95 | 95 | /* If VIA T2 starts, reset refresh timer. |
r18027 | r18028 | |
---|---|---|
321 | 321 | { |
322 | 322 | if((state->dc_sysctrl_regs[SB_G2DTNRM] & state->dc_sysctrl_regs[SB_ISTNRM]) || (state->dc_sysctrl_regs[SB_G2DTEXT] & state->dc_sysctrl_regs[SB_ISTEXT])) |
323 | 323 | { |
324 | address_space &space = | |
324 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
325 | 325 | |
326 | 326 | printf("Wave DMA HW trigger\n"); |
327 | 327 | wave_dma_execute(space); |
r18027 | r18028 | |
333 | 333 | { |
334 | 334 | if((state->dc_sysctrl_regs[SB_PDTNRM] & state->dc_sysctrl_regs[SB_ISTNRM]) || (state->dc_sysctrl_regs[SB_PDTEXT] & state->dc_sysctrl_regs[SB_ISTEXT])) |
335 | 335 | { |
336 | address_space &space = | |
336 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
337 | 337 | |
338 | 338 | printf("PVR-DMA HW trigger\n"); |
339 | 339 | pvr_dma_execute(space); |
r18027 | r18028 | |
---|---|---|
156 | 156 | |
157 | 157 | DRIVER_INIT_MEMBER(scramble_state,scobra) |
158 | 158 | { |
159 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
159 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xa803, 0xa803, write8_delegate(FUNC(scramble_state::scrambold_background_enable_w),this)); | |
160 | 160 | } |
161 | 161 | |
162 | 162 | #ifdef UNUSED_FUNCTION |
163 | 163 | DRIVER_INIT_MEMBER(scramble_state,atlantis) |
164 | 164 | { |
165 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
165 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x6803, 0x6803, FUNC(scrambold_background_enable_w)); | |
166 | 166 | } |
167 | 167 | |
168 | 168 | DRIVER_INIT_MEMBER(scramble_state,scramble) |
r18027 | r18028 | |
173 | 173 | |
174 | 174 | DRIVER_INIT_MEMBER(scramble_state,stratgyx) |
175 | 175 | { |
176 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xb000, 0xb000, write8_delegate(FUNC(scramble_state::scrambold_background_green_w),this)); | |
177 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xb002, 0xb002, write8_delegate(FUNC(scramble_state::scrambold_background_blue_w),this)); | |
178 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xb00a, 0xb00a, write8_delegate(FUNC(scramble_state::scrambold_background_red_w),this)); | |
176 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xb000, 0xb000, write8_delegate(FUNC(scramble_state::scrambold_background_green_w),this)); | |
177 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xb002, 0xb002, write8_delegate(FUNC(scramble_state::scrambold_background_blue_w),this)); | |
178 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xb00a, 0xb00a, write8_delegate(FUNC(scramble_state::scrambold_background_red_w),this)); | |
179 | 179 | } |
180 | 180 | |
181 | 181 | DRIVER_INIT_MEMBER(scramble_state,tazmani2) |
182 | 182 | { |
183 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
183 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xb002, 0xb002, write8_delegate(FUNC(scramble_state::scrambold_background_enable_w),this)); | |
184 | 184 | } |
185 | 185 | |
186 | 186 | DRIVER_INIT_MEMBER(scramble_state,ckongs) |
r18027 | r18028 | |
190 | 190 | DRIVER_INIT_MEMBER(scramble_state,mariner) |
191 | 191 | { |
192 | 192 | /* extra ROM */ |
193 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5800, 0x67ff, "bank1"); | |
194 | machine().device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x5800, 0x67ff); | |
193 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x5800, 0x67ff, "bank1"); | |
194 | machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x5800, 0x67ff); | |
195 | 195 | machine().root_device().membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x5800); |
196 | 196 | |
197 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x9008, 0x9008, FUNC(mariner_protection_2_r)); | |
198 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xb401, 0xb401, FUNC(mariner_protection_1_r)); | |
197 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x9008, 0x9008, FUNC(mariner_protection_2_r)); | |
198 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xb401, 0xb401, FUNC(mariner_protection_1_r)); | |
199 | 199 | |
200 | 200 | /* ??? (it's NOT a background enable) */ |
201 | /*machine().device("maincpu")->memory().space(AS_PROGRAM) | |
201 | /*machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write(0x6803, 0x6803);*/ | |
202 | 202 | } |
203 | 203 | |
204 | 204 | #ifdef UNUSED_FUNCTION |
r18027 | r18028 | |
276 | 276 | UINT8 *ROM = memregion("maincpu")->base(); |
277 | 277 | |
278 | 278 | /* banked ROM */ |
279 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
279 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x3fff, "bank1"); | |
280 | 280 | membank("bank1")->configure_entries(0, 2, &ROM[0x00000], 0x10000); |
281 | 281 | cavelon_banksw(machine()); |
282 | 282 | |
283 | 283 | /* A15 switches memory banks */ |
284 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
284 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x8000, 0xffff, FUNC(cavelon_banksw_r), FUNC(cavelon_banksw_w)); | |
285 | 285 | |
286 | machine().device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x2000, 0x2000); /* ??? */ | |
287 | machine().device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x3800, 0x3801); /* looks suspicously like | |
286 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write(0x2000, 0x2000); /* ??? */ | |
287 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write(0x3800, 0x3801); /* looks suspicously like | |
288 | 288 | an AY8910, but not sure */ |
289 | 289 | state_save_register_global(machine(), m_cavelon_bank); |
290 | 290 | } |
r18027 | r18028 | |
293 | 293 | |
294 | 294 | DRIVER_INIT_MEMBER(scramble_state,darkplnt) |
295 | 295 | { |
296 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
296 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xb00a, 0xb00a, write8_delegate(FUNC(scramble_state::darkplnt_bullet_color_w),this)); | |
297 | 297 | } |
298 | 298 | |
299 | 299 | DRIVER_INIT_MEMBER(scramble_state,mimonkey) |
r18027 | r18028 | |
328 | 328 | ROM[A] = ROM[A] ^ xortable[line][col]; |
329 | 329 | ctr++; |
330 | 330 | } |
331 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
331 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xa804, 0xa804, write8_delegate(FUNC(scramble_state::scrambold_background_enable_w),this)); | |
332 | 332 | } |
333 | 333 | |
334 | 334 | DRIVER_INIT_MEMBER(scramble_state,mimonsco) |
335 | 335 | { |
336 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
336 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xa804, 0xa804, write8_delegate(FUNC(scramble_state::scrambold_background_enable_w),this)); | |
337 | 337 | } |
338 | 338 | |
339 | 339 | DRIVER_INIT_MEMBER(scramble_state,mimonscr) |
340 | 340 | { |
341 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
341 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x6804, 0x6804, write8_delegate(FUNC(scramble_state::scrambold_background_enable_w),this)); | |
342 | 342 | } |
343 | 343 | |
344 | 344 |
r18027 | r18028 | |
---|---|---|
105 | 105 | |
106 | 106 | WRITE8_MEMBER(pitnrun_state::pitnrun_68705_portB_w) |
107 | 107 | { |
108 | address_space | |
108 | address_space &cpu0space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
109 | 109 | if (~data & 0x02) |
110 | 110 | { |
111 | 111 | /* 68705 is going to read data from the Z80 */ |
r18027 | r18028 | |
120 | 120 | } |
121 | 121 | if (~data & 0x10) |
122 | 122 | { |
123 | cpu0space | |
123 | cpu0space.write_byte(m_address, m_portA_out); | |
124 | 124 | } |
125 | 125 | if (~data & 0x20) |
126 | 126 | { |
127 | m_portA_in = cpu0space | |
127 | m_portA_in = cpu0space.read_byte(m_address); | |
128 | 128 | } |
129 | 129 | if (~data & 0x40) |
130 | 130 | { |
r18027 | r18028 | |
---|---|---|
747 | 747 | } |
748 | 748 | |
749 | 749 | /* try all possible decodings at the current pc */ |
750 | posscount = try_all_possibilities( | |
750 | posscount = try_all_possibilities(device.memory().space(AS_PROGRAM), curpc, 0, 0, instrbuffer, keybuffer, posslist) - posslist; | |
751 | 751 | if (keydirty) |
752 | 752 | fd1094_regenerate_key(device.machine()); |
753 | 753 | |
r18027 | r18028 | |
1075 | 1075 | |
1076 | 1076 | static void execute_fdsearch(running_machine &machine, int ref, int params, const char **param) |
1077 | 1077 | { |
1078 | address_space &space = | |
1078 | address_space &space = debug_cpu_get_visible_cpu(machine)->memory().space(AS_PROGRAM); | |
1079 | 1079 | int pc = space.device().safe_pc(); |
1080 | 1080 | int length, first = TRUE; |
1081 | 1081 | UINT8 instrdata[2]; |
r18027 | r18028 | |
1201 | 1201 | |
1202 | 1202 | static void execute_fddasm(running_machine &machine, int ref, int params, const char **param) |
1203 | 1203 | { |
1204 | address_space &space = | |
1204 | address_space &space = debug_cpu_get_visible_cpu(machine)->memory().space(AS_PROGRAM); | |
1205 | 1205 | int origstate = fd1094_set_state(keyregion, -1); |
1206 | 1206 | const char *filename; |
1207 | 1207 | int skipped = FALSE; |
r18027 | r18028 | |
---|---|---|
541 | 541 | } |
542 | 542 | |
543 | 543 | // find the address space that is to be mapped |
544 | m_space = m_cpu->space(AS_PROGRAM); | |
544 | m_space = &m_cpu->space(AS_PROGRAM); | |
545 | 545 | if (m_space == NULL) |
546 | 546 | throw emu_fatalerror("Unable to find program address space on device '%s'", m_cputag); |
547 | 547 |
r18027 | r18028 | |
---|---|---|
75 | 75 | |
76 | 76 | maincpu = machine().device("maincpu"); |
77 | 77 | rspcpu = machine().device("rsp"); |
78 | mem_map = maincpu->memory().space(AS_PROGRAM); | |
78 | mem_map = &maincpu->memory().space(AS_PROGRAM); | |
79 | 79 | |
80 | 80 | mi_version = 0x01010101; |
81 | 81 | mi_interrupt = 0; |
r18027 | r18028 | |
---|---|---|
38 | 38 | |
39 | 39 | DRIVER_INIT_MEMBER(stfight_state,empcity) |
40 | 40 | { |
41 | address_space &space = | |
41 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
42 | 42 | UINT8 *rom = memregion("maincpu")->base(); |
43 | 43 | int A; |
44 | 44 | |
r18027 | r18028 | |
82 | 82 | |
83 | 83 | void stfight_state::machine_reset() |
84 | 84 | { |
85 | address_space &space = | |
85 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
86 | 86 | m_adpcm_data_offs = m_adpcm_data_end = 0; |
87 | 87 | m_toggle = 0; |
88 | 88 | m_fm_data = 0; |
r18027 | r18028 | |
---|---|---|
62 | 62 | select and after failing in the 2nd stage (probably there are other checks |
63 | 63 | out there). |
64 | 64 | */ |
65 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
65 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xd80000, 0xd80003, FUNC(dw2_d80000_r)); | |
66 | 66 | } |
67 | 67 | |
68 | 68 | DRIVER_INIT_MEMBER(pgm_state,drgw2) |
r18027 | r18028 | |
---|---|---|
108 | 108 | count = (cx4.reg[0x43]) | (cx4.reg[0x44] << 8); |
109 | 109 | dest = (cx4.reg[0x45]) | (cx4.reg[0x46] << 8); |
110 | 110 | |
111 | address_space &space = | |
111 | address_space &space = machine.device<cpu_device>("maincpu")->space(AS_PROGRAM); | |
112 | 112 | for(i=0;i<count;i++) |
113 | 113 | { |
114 | 114 | CX4_write(machine, dest++, space.read_byte(src++)); |
r18027 | r18028 | |
---|---|---|
50 | 50 | void deco102_decrypt_cpu(running_machine &machine, const char *cputag, int address_xor, int data_select_xor, int opcode_select_xor) |
51 | 51 | { |
52 | 52 | int i; |
53 | address_space &space = | |
53 | address_space &space = machine.device(cputag)->memory().space(AS_PROGRAM); | |
54 | 54 | UINT16 *rom = (UINT16 *)machine.root_device().memregion(cputag)->base(); |
55 | 55 | int size = machine.root_device().memregion(cputag)->bytes(); |
56 | 56 | UINT16 *opcodes = auto_alloc_array(machine, UINT16, size / 2); |
r18027 | r18028 | |
---|---|---|
465 | 465 | static TIMER_CALLBACK( pia_w_callback ) |
466 | 466 | { |
467 | 467 | pia6821_device *device = (pia6821_device *)ptr; |
468 | device->write( | |
468 | device->write(device->machine().driver_data()->generic_space(), param >> 8, param & 0xff); | |
469 | 469 | } |
470 | 470 | |
471 | 471 | |
r18027 | r18028 | |
503 | 503 | qix_state *state = device->machine().driver_data<qix_state>(); |
504 | 504 | |
505 | 505 | /* write to the sound chip */ |
506 | state->m_sn1->write( | |
506 | state->m_sn1->write(device->machine().device<legacy_cpu_device>("maincpu")->space(), 0, data); | |
507 | 507 | |
508 | 508 | /* clock the ready line going back into CB1 */ |
509 | 509 | pia6821_device *pia = downcast<pia6821_device *>(device); |
r18027 | r18028 | |
517 | 517 | qix_state *state = device->machine().driver_data<qix_state>(); |
518 | 518 | |
519 | 519 | /* write to the sound chip */ |
520 | state->m_sn2->write( | |
520 | state->m_sn2->write(device->machine().device<legacy_cpu_device>("maincpu")->space(), 0, data); | |
521 | 521 | |
522 | 522 | /* clock the ready line going back into CB1 */ |
523 | 523 | pia6821_device *pia = downcast<pia6821_device *>(device); |
r18027 | r18028 | |
---|---|---|
135 | 135 | { |
136 | 136 | snes_state *state = machine.driver_data<snes_state>(); |
137 | 137 | // make sure we're in the 65816's context since we're messing with the OAM and stuff |
138 | address_space &space = | |
138 | address_space &space = state->m_maincpu->space(AS_PROGRAM); | |
139 | 139 | |
140 | 140 | if (!(snes_ppu.screen_disabled)) //Reset OAM address, byuu says it happens at H=10 |
141 | 141 | { |
r18027 | r18028 | |
148 | 148 | static TIMER_CALLBACK( snes_reset_hdma ) |
149 | 149 | { |
150 | 150 | snes_state *state = machine.driver_data<snes_state>(); |
151 | address_space &cpu0space = | |
151 | address_space &cpu0space = state->m_maincpu->space(AS_PROGRAM); | |
152 | 152 | snes_hdma_init(cpu0space); |
153 | 153 | } |
154 | 154 | |
155 | 155 | static TIMER_CALLBACK( snes_update_io ) |
156 | 156 | { |
157 | 157 | snes_state *state = machine.driver_data<snes_state>(); |
158 | address_space *cpu0space = state->m_maincpu->space(AS_PROGRAM); | |
159 | state->m_io_read(cpu0space->machine()); | |
158 | address_space &cpu0space = state->m_maincpu->space(AS_PROGRAM); | |
159 | state->m_io_read(cpu0space.machine()); | |
160 | 160 | snes_ram[HVBJOY] &= 0xfe; /* Clear busy bit */ |
161 | 161 | |
162 | 162 | state->m_io_timer->adjust(attotime::never); |
r18027 | r18028 | |
233 | 233 | // hdma reset happens at scanline 0, H=~6 |
234 | 234 | if (snes_ppu.beam.current_vert == 0) |
235 | 235 | { |
236 | address_space &cpu0space = | |
236 | address_space &cpu0space = state->m_maincpu->space(AS_PROGRAM); | |
237 | 237 | snes_hdma_init(cpu0space); |
238 | 238 | } |
239 | 239 | |
r18027 | r18028 | |
257 | 257 | static TIMER_CALLBACK( snes_hblank_tick ) |
258 | 258 | { |
259 | 259 | snes_state *state = machine.driver_data<snes_state>(); |
260 | address_space &cpu0space = | |
260 | address_space &cpu0space = state->m_maincpu->space(AS_PROGRAM); | |
261 | 261 | int nextscan; |
262 | 262 | |
263 | 263 | snes_ppu.beam.current_vert = machine.primary_screen->vpos(); |
r18027 | r18028 | |
1558 | 1558 | static void snes_init_ram( running_machine &machine ) |
1559 | 1559 | { |
1560 | 1560 | snes_state *state = machine.driver_data<snes_state>(); |
1561 | address_space | |
1561 | address_space &cpu0space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1562 | 1562 | int i; |
1563 | 1563 | |
1564 | 1564 | /* Init work RAM - 0x55 isn't exactly right but it's close */ |
1565 | 1565 | /* make sure it happens to the 65816 (CPU 0) */ |
1566 | 1566 | for (i = 0; i < (128*1024); i++) |
1567 | 1567 | { |
1568 | cpu0space | |
1568 | cpu0space.write_byte(0x7e0000 + i, 0x55); | |
1569 | 1569 | } |
1570 | 1570 | |
1571 | 1571 | /* Inititialize registers/variables */ |
r18027 | r18028 | |
1680 | 1680 | state->m_spc700 = machine.device<snes_sound_device>("spc700"); |
1681 | 1681 | state->m_superfx = machine.device<cpu_device>("superfx"); |
1682 | 1682 | |
1683 | state->m_maincpu->space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate(FUNC(snes_state::snes_direct), state)); | |
1684 | // state->m_soundcpu->space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate(FUNC(snes_state::snes_spc_direct), state)); | |
1683 | state->m_maincpu->space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(snes_state::snes_direct), state)); | |
1684 | // state->m_soundcpu->space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(snes_state::snes_spc_direct), state)); | |
1685 | 1685 | |
1686 | 1686 | // power-on sets these registers like this |
1687 | 1687 | snes_ram[WRIO] = 0xff; |
r18027 | r18028 | |
1816 | 1816 | /* for mame we use an init, maybe we will need more for the different games */ |
1817 | 1817 | DRIVER_INIT_MEMBER(snes_state,snes) |
1818 | 1818 | { |
1819 | address_space &space = | |
1819 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1820 | 1820 | UINT16 total_blocks, read_blocks; |
1821 | 1821 | UINT8 *rom; |
1822 | 1822 | |
r18027 | r18028 | |
1881 | 1881 | |
1882 | 1882 | DRIVER_INIT_MEMBER(snes_state,snes_hirom) |
1883 | 1883 | { |
1884 | address_space &space = | |
1884 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1885 | 1885 | UINT16 total_blocks, read_blocks; |
1886 | 1886 | UINT8 *rom; |
1887 | 1887 |
r18027 | r18028 | |
---|---|---|
498 | 498 | slapstic_init(device->machine(), chipnum); |
499 | 499 | |
500 | 500 | /* install the memory handlers */ |
501 | state->m_slapstic = device->memory().space(AS_PROGRAM) | |
501 | state->m_slapstic = device->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(base, base + 0x7fff, 0, mirror, FUNC(atarigen_slapstic_r), FUNC(atarigen_slapstic_w)); | |
502 | 502 | |
503 | 503 | /* allocate memory for a copy of bank 0 */ |
504 | 504 | state->m_slapstic_bank0 = auto_alloc_array(device->machine(), UINT8, 0x2000); |
r18027 | r18028 | |
511 | 511 | state->m_slapstic_base = base; |
512 | 512 | state->m_slapstic_mirror = mirror; |
513 | 513 | |
514 | address_space &space = | |
514 | address_space &space = device->memory().space(AS_PROGRAM); | |
515 | 515 | space.set_direct_update_handler(direct_update_delegate(FUNC(atarigen_state::atarigen_slapstic_setdirect), state)); |
516 | 516 | } |
517 | 517 | } |
r18027 | r18028 | |
764 | 764 | static TIMER_CALLBACK( delayed_sound_reset ) |
765 | 765 | { |
766 | 766 | atarigen_state *state = machine.driver_data<atarigen_state>(); |
767 | address_space &space = | |
767 | address_space &space = state->m_sound_cpu->memory().space(AS_PROGRAM); | |
768 | 768 | |
769 | 769 | /* unhalt and reset the sound CPU */ |
770 | 770 | if (param == 0) |
r18027 | r18028 | |
1125 | 1125 | /* scanline IRQ ack here */ |
1126 | 1126 | case 0x1e: |
1127 | 1127 | /* hack: this should be a device */ |
1128 | atarigen_scanline_int_ack_w( | |
1128 | atarigen_scanline_int_ack_w(screen.machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0, 0xffff); | |
1129 | 1129 | break; |
1130 | 1130 | |
1131 | 1131 | /* log anything else */ |
r18027 | r18028 | |
---|---|---|
196 | 196 | { |
197 | 197 | pgm_basic_init(machine()); |
198 | 198 | |
199 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xdcb400, 0xdcb403, FUNC(olds_r), FUNC(olds_w)); | |
200 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x8178f4, 0x8178f5, FUNC(olds_prot_swap_r)); | |
199 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0xdcb400, 0xdcb403, FUNC(olds_r), FUNC(olds_w)); | |
200 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x8178f4, 0x8178f5, FUNC(olds_prot_swap_r)); | |
201 | 201 | |
202 | 202 | m_kb_cmd = 0; |
203 | 203 | m_kb_reg = 0; |
r18027 | r18028 | |
---|---|---|
115 | 115 | /* TODO: what type of DMA this is, burst or cycle steal? Docs doesn't explain it (4 usec is the DRAM refresh). */ |
116 | 116 | static TIMER_CALLBACK( vidc_video_tick ) |
117 | 117 | { |
118 | address_space &space = | |
118 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
119 | 119 | static UINT8 *vram = machine.root_device().memregion("vram")->base(); |
120 | 120 | UINT32 size; |
121 | 121 | |
r18027 | r18028 | |
133 | 133 | /* audio DMA */ |
134 | 134 | static TIMER_CALLBACK( vidc_audio_tick ) |
135 | 135 | { |
136 | address_space &space = | |
136 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
137 | 137 | UINT8 ulaw_comp; |
138 | 138 | INT16 res; |
139 | 139 | UINT8 ch; |
r18027 | r18028 | |
423 | 423 | void archimedes_driver_init(running_machine &machine) |
424 | 424 | { |
425 | 425 | archimedes_memc_physmem = reinterpret_cast<UINT32 *>(machine.root_device().memshare("physicalram")->ptr()); |
426 | // address_space &space = | |
426 | // address_space &space = machine.device<arm_device>("maincpu")->space(AS_PROGRAM); | |
427 | 427 | // space.set_direct_update_handler(direct_update_delegate(FUNC(a310_setopbase), &machine)); |
428 | 428 | } |
429 | 429 |
r18027 | r18028 | |
---|---|---|
217 | 217 | rom[i] = BITSWAP8(rom[i],7,6,5,0,3,2,1,4); |
218 | 218 | } |
219 | 219 | |
220 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
220 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x3001, 0x3001, FUNC(dingoe_3001_r)); /* Protection check */ | |
221 | 221 | |
222 | 222 | } |
223 | 223 | #endif |
r18027 | r18028 | |
266 | 266 | DRIVER_INIT_MEMBER(galaxold_state,pisces) |
267 | 267 | { |
268 | 268 | /* the coin lockout was replaced */ |
269 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
269 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x6002, 0x6002, FUNC(galaxold_gfxbank_w)); | |
270 | 270 | } |
271 | 271 | |
272 | 272 | DRIVER_INIT_MEMBER(galaxold_state,checkmaj) |
273 | 273 | { |
274 | 274 | /* for the title screen */ |
275 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
275 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x3800, 0x3800, FUNC(checkmaj_protection_r)); | |
276 | 276 | } |
277 | 277 | |
278 | 278 | DRIVER_INIT_MEMBER(galaxold_state,dingo) |
279 | 279 | { |
280 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3000, 0x3000, FUNC(dingo_3000_r)); | |
281 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3035, 0x3035, FUNC(dingo_3035_r)); | |
280 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x3000, 0x3000, FUNC(dingo_3000_r)); | |
281 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x3035, 0x3035, FUNC(dingo_3035_r)); | |
282 | 282 | } |
283 | 283 | |
284 | 284 | |
r18027 | r18028 | |
296 | 296 | |
297 | 297 | DRIVER_INIT_MEMBER(galaxold_state,mooncrsu) |
298 | 298 | { |
299 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
299 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xa000, 0xa002, FUNC(galaxold_gfxbank_w)); | |
300 | 300 | } |
301 | 301 | |
302 | 302 | DRIVER_INIT_MEMBER(galaxold_state,mooncrst) |
r18027 | r18028 | |
313 | 313 | |
314 | 314 | DRIVER_INIT_MEMBER(galaxold_state,mooncrgx) |
315 | 315 | { |
316 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
316 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x6000, 0x6002, FUNC(galaxold_gfxbank_w)); | |
317 | 317 | } |
318 | 318 | |
319 | 319 | DRIVER_INIT_MEMBER(galaxold_state,moonqsr) |
320 | 320 | { |
321 | 321 | offs_t i; |
322 | address_space &space = | |
322 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
323 | 323 | UINT8 *rom = machine().root_device().memregion("maincpu")->base(); |
324 | 324 | UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0x8000); |
325 | 325 | |
r18027 | r18028 | |
397 | 397 | |
398 | 398 | DRIVER_INIT_MEMBER(galaxold_state,4in1) |
399 | 399 | { |
400 | address_space &space = | |
400 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
401 | 401 | offs_t i, len = memregion("maincpu")->bytes(); |
402 | 402 | UINT8 *RAM = memregion("maincpu")->base(); |
403 | 403 | |
r18027 | r18028 | |
421 | 421 | DRIVER_INIT_MEMBER(galaxold_state,ladybugg) |
422 | 422 | { |
423 | 423 | /* Doesn't actually use the bank, but it mustn't have a coin lock! */ |
424 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
424 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x6002, 0x6002, write8_delegate(FUNC(galaxold_state::galaxold_gfxbank_w),this)); | |
425 | 425 | } |
426 | 426 | |
427 | 427 | DRIVER_INIT_MEMBER(galaxold_state,bullsdrtg) |
r18027 | r18028 | |
---|---|---|
361 | 361 | DRIVER_INIT_MEMBER(dec0_state,hippodrm) |
362 | 362 | { |
363 | 363 | UINT8 *RAM = machine().root_device().memregion("sub")->base(); |
364 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x180000, 0x180fff, read16_delegate(FUNC(dec0_state::hippodrm_68000_share_r),this), write16_delegate(FUNC(dec0_state::hippodrm_68000_share_w),this)); | |
365 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xffc800, 0xffcfff, write16_delegate(FUNC(dec0_state::sprite_mirror_w),this)); | |
364 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x180000, 0x180fff, read16_delegate(FUNC(dec0_state::hippodrm_68000_share_r),this), write16_delegate(FUNC(dec0_state::hippodrm_68000_share_w),this)); | |
365 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xffc800, 0xffcfff, write16_delegate(FUNC(dec0_state::sprite_mirror_w),this)); | |
366 | 366 | |
367 | 367 | h6280_decrypt(machine(), "sub"); |
368 | 368 | |
r18027 | r18028 | |
386 | 386 | |
387 | 387 | DRIVER_INIT_MEMBER(dec0_state,robocop) |
388 | 388 | { |
389 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
389 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x180000, 0x180fff, read16_delegate(FUNC(dec0_state::robocop_68000_share_r),this), write16_delegate(FUNC(dec0_state::robocop_68000_share_w),this)); | |
390 | 390 | } |
391 | 391 | |
392 | 392 | DRIVER_INIT_MEMBER(dec0_state,baddudes) |
r18027 | r18028 | |
---|---|---|
456 | 456 | static void williams2_postload(running_machine &machine) |
457 | 457 | { |
458 | 458 | williams_state *state = machine.driver_data<williams_state>(); |
459 | address_space &space = | |
459 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
460 | 460 | state->williams2_bank_select_w(space, 0, state->m_vram_bank); |
461 | 461 | } |
462 | 462 | |
r18027 | r18028 | |
475 | 475 | |
476 | 476 | MACHINE_RESET_MEMBER(williams_state,williams2) |
477 | 477 | { |
478 | address_space &space = | |
478 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
479 | 479 | |
480 | 480 | /* make sure our banking is reset */ |
481 | 481 | williams2_bank_select_w(space, 0, 0); |
r18027 | r18028 | |
759 | 759 | static void defender_postload(running_machine &machine) |
760 | 760 | { |
761 | 761 | williams_state *state = machine.driver_data<williams_state>(); |
762 | address_space &space = | |
762 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
763 | 763 | state->defender_bank_select_w(space, 0, state->m_vram_bank); |
764 | 764 | } |
765 | 765 | |
r18027 | r18028 | |
777 | 777 | |
778 | 778 | MACHINE_RESET_MEMBER(williams_state,defender) |
779 | 779 | { |
780 | address_space &space = | |
780 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
781 | 781 | |
782 | 782 | MACHINE_RESET_CALL_MEMBER(williams_common); |
783 | 783 | |
r18027 | r18028 | |
1002 | 1002 | { |
1003 | 1003 | joust2_state *state = device->machine().driver_data<joust2_state>(); |
1004 | 1004 | state->m_joust2_current_sound_data = (state->m_joust2_current_sound_data & ~0x100) | ((data << 8) & 0x100); |
1005 | state->m_cvsd_sound->write( | |
1005 | state->m_cvsd_sound->write(device->machine().driver_data()->generic_space(), 0, state->m_joust2_current_sound_data); | |
1006 | 1006 | } |
1007 | 1007 | |
1008 | 1008 | |
r18027 | r18028 | |
1010 | 1010 | { |
1011 | 1011 | joust2_state *state = device->machine().driver_data<joust2_state>(); |
1012 | 1012 | state->m_joust2_current_sound_data = (state->m_joust2_current_sound_data & ~0xff) | (data & 0xff); |
1013 | state->m_cvsd_sound->write( | |
1013 | state->m_cvsd_sound->write(device->machine().driver_data()->generic_space(), 0, state->m_joust2_current_sound_data); | |
1014 | 1014 | device->machine().scheduler().synchronize(FUNC(joust2_deferred_snd_cmd_w), state->m_joust2_current_sound_data); |
1015 | 1015 | } |
r18027 | r18028 | |
---|---|---|
210 | 210 | |
211 | 211 | MACHINE_RESET_MEMBER(bagman_state,bagman) |
212 | 212 | { |
213 | address_space &space = | |
213 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
214 | 214 | bagman_pal16r6_w(space, 0, 1); /*pin 2*/ |
215 | 215 | bagman_pal16r6_w(space, 1, 1); /*pin 3*/ |
216 | 216 | bagman_pal16r6_w(space, 2, 1); /*pin 4*/ |
r18027 | r18028 | |
---|---|---|
206 | 206 | { |
207 | 207 | if (LOG_COPPER) |
208 | 208 | logerror("%02X.%02X: Write to %s = %04x\n", state->m_last_scanline, xpos / 2, amiga_custom_names[state->m_copper_pending_offset & 0xff], state->m_copper_pending_data); |
209 | amiga_custom_w( | |
209 | amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), state->m_copper_pending_offset, state->m_copper_pending_data, 0xffff); | |
210 | 210 | state->m_copper_pending_offset = 0; |
211 | 211 | } |
212 | 212 | |
r18027 | r18028 | |
262 | 262 | { |
263 | 263 | if (LOG_COPPER) |
264 | 264 | logerror("%02X.%02X: Write to %s = %04x\n", state->m_last_scanline, xpos / 2, amiga_custom_names[word0 & 0xff], word1); |
265 | amiga_custom_w( | |
265 | amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), word0, word1, 0xffff); | |
266 | 266 | } |
267 | 267 | else // additional 2 cycles needed for non-Agnus registers |
268 | 268 | { |
r18027 | r18028 | |
---|---|---|
1185 | 1185 | |
1186 | 1186 | static void vpc_init( running_machine &machine ) |
1187 | 1187 | { |
1188 | address_space &space = | |
1188 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1189 | 1189 | vpc_w( space, 0, 0x11 ); |
1190 | 1190 | vpc_w( space, 1, 0x11 ); |
1191 | 1191 | vpc.window1.w = 0; |
r18027 | r18028 | |
---|---|---|
93 | 93 | void simpsons_video_banking( running_machine &machine, int bank ) |
94 | 94 | { |
95 | 95 | simpsons_state *state = machine.driver_data<simpsons_state>(); |
96 | address_space &space = | |
96 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
97 | 97 | |
98 | 98 | if (bank & 1) |
99 | 99 | { |
r18027 | r18028 | |
---|---|---|
27 | 27 | { |
28 | 28 | int i; |
29 | 29 | taitob_state *state = machine.driver_data<taitob_state>(); |
30 | address_space &space = | |
30 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
31 | 31 | |
32 | 32 | for (i = 0; i < 0x40000; i++) |
33 | 33 | state->hitice_pixelram_w(space, i, 0, 0xffff); |
r18027 | r18028 | |
---|---|---|
290 | 290 | |
291 | 291 | static TIMER_CALLBACK( leland_delayed_mvram_w ) |
292 | 292 | { |
293 | address_space &space = | |
293 | address_space &space = machine.device("master")->memory().space(AS_PROGRAM); | |
294 | 294 | |
295 | 295 | int num = (param >> 16) & 1; |
296 | 296 | int offset = (param >> 8) & 0xff; |
r18027 | r18028 | |
---|---|---|
277 | 277 | { |
278 | 278 | popeye_state *state = machine.driver_data<popeye_state>(); |
279 | 279 | int offs; |
280 | address_space &space = | |
280 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
281 | 281 | |
282 | 282 | if (state->m_lastflip != state->flip_screen()) |
283 | 283 | { |
r18027 | r18028 | |
---|---|---|
286 | 286 | static void rallybik_flipscreen(running_machine &machine) |
287 | 287 | { |
288 | 288 | toaplan1_state *state = machine.driver_data<toaplan1_state>(); |
289 | address_space &space = | |
289 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
290 | 290 | |
291 | 291 | state->rallybik_bcu_flipscreen_w(space, 0, state->m_bcu_flipscreen, 0xffff); |
292 | 292 | } |
r18027 | r18028 | |
294 | 294 | static void toaplan1_flipscreen(running_machine &machine) |
295 | 295 | { |
296 | 296 | toaplan1_state *state = machine.driver_data<toaplan1_state>(); |
297 | address_space &space = | |
297 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
298 | 298 | |
299 | 299 | state->toaplan1_bcu_flipscreen_w(space, 0, state->m_bcu_flipscreen, 0xffff); |
300 | 300 | } |
r18027 | r18028 | |
---|---|---|
1975 | 1975 | static void render_to_accumulation_buffer(running_machine &machine,bitmap_rgb32 &bitmap,const rectangle &cliprect) |
1976 | 1976 | { |
1977 | 1977 | dc_state *state = machine.driver_data<dc_state>(); |
1978 | address_space &space = | |
1978 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1979 | 1979 | int cs,rs,ns; |
1980 | 1980 | UINT32 c; |
1981 | 1981 | #if 0 |
r18027 | r18028 | |
---|---|---|
1419 | 1419 | if (msk != 0) m_active_layers &= msk; |
1420 | 1420 | #if 1 |
1421 | 1421 | { |
1422 | address_space &space = | |
1422 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1423 | 1423 | |
1424 | 1424 | popmessage("Cmd: %04X Pos:%04X Lim:%04X Inp:%04X", |
1425 | 1425 | m_scudhamm_motor_command, |
r18027 | r18028 | |
---|---|---|
2813 | 2813 | FILE *f = fopen( "dump.txt", "wb" ); |
2814 | 2814 | if( f ) |
2815 | 2815 | { |
2816 | address_space &space = | |
2816 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
2817 | 2817 | |
2818 | 2818 | if (1) // czram |
2819 | 2819 | { |
r18027 | r18028 | |
2878 | 2878 | FILE *f = fopen( "dump.txt", "wb" ); |
2879 | 2879 | if( f ) |
2880 | 2880 | { |
2881 | address_space &space = | |
2881 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
2882 | 2882 | |
2883 | 2883 | //Dump(space, f,0x90000000, 0x90000003, "led?" ); |
2884 | 2884 | Dump(space, f,0x90010000, 0x90017fff, "cz_ram"); |
r18027 | r18028 | |
---|---|---|
384 | 384 | |
385 | 385 | TIMER_DEVICE_CALLBACK( atarisy1_int3off_callback ) |
386 | 386 | { |
387 | address_space &space = | |
387 | address_space &space = timer.machine().device("maincpu")->memory().space(AS_PROGRAM); | |
388 | 388 | |
389 | 389 | /* clear the state */ |
390 | 390 | atarigen_scanline_int_ack_w(space, 0, 0, 0xffff); |
r18027 | r18028 | |
---|---|---|
157 | 157 | static void gtia_reset(running_machine &machine) |
158 | 158 | { |
159 | 159 | int i; |
160 | address_space &space = | |
160 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
161 | 161 | |
162 | 162 | /* reset the GTIA read/write/helper registers */ |
163 | 163 | for (i = 0; i < 32; i++) |
r18027 | r18028 | |
---|---|---|
11 | 11 | |
12 | 12 | void skydiver_state::machine_reset() |
13 | 13 | { |
14 | address_space &space = | |
14 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
15 | 15 | |
16 | 16 | /* reset all latches */ |
17 | 17 | skydiver_start_lamp_1_w(space, 0, 0); |
r18027 | r18028 | |
---|---|---|
307 | 307 | |
308 | 308 | if (m_screen_refresh) |
309 | 309 | { |
310 | address_space &space = | |
310 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
311 | 311 | |
312 | 312 | /* redraw bitmap */ |
313 | 313 | for (offs = 0; offs < 0x8000; offs++) |
r18027 | r18028 | |
---|---|---|
866 | 866 | |
867 | 867 | case 6: /* height of blit and initiator */ |
868 | 868 | m_pattern_height = data; |
869 | execute_blit( | |
869 | execute_blit(space.device().memory().space(AS_PROGRAM)); | |
870 | 870 | break; |
871 | 871 | } |
872 | 872 | } |
r18027 | r18028 | |
---|---|---|
215 | 215 | |
216 | 216 | if (m_lastflip != flip_screen() || m_lastpixcolor != m_pixcolor) |
217 | 217 | { |
218 | address_space &space = | |
218 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
219 | 219 | |
220 | 220 | m_lastflip = flip_screen(); |
221 | 221 | m_lastpixcolor = m_pixcolor; |
r18027 | r18028 | |
---|---|---|
1289 | 1289 | |
1290 | 1290 | MACHINE_RESET( avgdvg ) |
1291 | 1291 | { |
1292 | avgdvg_reset_w ( | |
1292 | avgdvg_reset_w (machine.device("maincpu")->memory().space(AS_PROGRAM),0,0); | |
1293 | 1293 | } |
1294 | 1294 | |
1295 | 1295 |
r18027 | r18028 | |
---|---|---|
89 | 89 | |
90 | 90 | static TIMER_CALLBACK( irq_off ) |
91 | 91 | { |
92 | address_space &space = | |
92 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
93 | 93 | |
94 | 94 | /* clear the interrupt */ |
95 | 95 | atarigen_scanline_int_ack_w(space, 0, 0, 0xffff); |
r18027 | r18028 | |
---|---|---|
402 | 402 | int vrender0_ProcessPacket(device_t *device, UINT32 PacketPtr, UINT16 *Dest, UINT8 *TEXTURE) |
403 | 403 | { |
404 | 404 | vr0video_state *vr0 = get_safe_token(device); |
405 | address_space &space = | |
405 | address_space &space = vr0->cpu->memory().space(AS_PROGRAM); | |
406 | 406 | UINT32 Dx = Packet(1) & 0x3ff; |
407 | 407 | UINT32 Dy = Packet(2) & 0x1ff; |
408 | 408 | UINT32 Endx = Packet(3) & 0x3ff; |
r18027 | r18028 | |
---|---|---|
1174 | 1174 | *****************************************************************************/ |
1175 | 1175 | static TIMER_CALLBACK( antic_scanline_render ) |
1176 | 1176 | { |
1177 | address_space &space = | |
1177 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1178 | 1178 | |
1179 | 1179 | VIDEO *video = antic.video[antic.scanline]; |
1180 | 1180 | LOG((" @cycle #%3d render mode $%X lines to go #%d\n", cycle(machine), (antic.cmd & 0x0f), antic.modelines)); |
r18027 | r18028 | |
1244 | 1244 | **************************************************************/ |
1245 | 1245 | if( new_cmd & ANTIC_LMS ) |
1246 | 1246 | { |
1247 | address_space &space = | |
1247 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1248 | 1248 | int addr = RDANTIC(space); |
1249 | 1249 | antic.doffs = (antic.doffs + 1) & DOFFS; |
1250 | 1250 | addr += 256 * RDANTIC(space); |
r18027 | r18028 | |
1269 | 1269 | *****************************************************************************/ |
1270 | 1270 | static void antic_scanline_dma(running_machine &machine, int param) |
1271 | 1271 | { |
1272 | address_space &space = | |
1272 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1273 | 1273 | LOG((" @cycle #%3d DMA fetch\n", cycle(machine))); |
1274 | 1274 | if (antic.scanline == VBL_END) |
1275 | 1275 | antic.r.nmist &= ~VBL_NMI; |
r18027 | r18028 | |
---|---|---|
507 | 507 | |
508 | 508 | static void bootleg_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8 *source, int circuit ) |
509 | 509 | { |
510 | address_space &space = | |
510 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
511 | 511 | gfx_element *gfx = machine.gfx[circuit + 2]; |
512 | 512 | |
513 | 513 | int limit = circuit ? (space.read_byte(0xc2) * 256 + space.read_byte(0xc3)) : (space.read_byte(0xc0) * 256 + space.read_byte(0xc1)); |
r18027 | r18028 | |
---|---|---|
265 | 265 | |
266 | 266 | inline UINT8 ppu2c0x_device::readbyte(offs_t address) |
267 | 267 | { |
268 | return space() | |
268 | return space().read_byte(address); | |
269 | 269 | } |
270 | 270 | |
271 | 271 | |
r18027 | r18028 | |
275 | 275 | |
276 | 276 | inline void ppu2c0x_device::writebyte(offs_t address, UINT8 data) |
277 | 277 | { |
278 | space() | |
278 | space().write_byte(address, data); | |
279 | 279 | } |
280 | 280 | |
281 | 281 |
r18027 | r18028 | |
---|---|---|
1446 | 1446 | // but it could be useful |
1447 | 1447 | if ( machine().input().code_pressed_once(KEYCODE_L) ) |
1448 | 1448 | { |
1449 | address_space &space = | |
1449 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1450 | 1450 | space.write_byte(0x2f27c8, 0x2); |
1451 | 1451 | } |
1452 | 1452 | #endif |
r18027 | r18028 | |
---|---|---|
400 | 400 | { |
401 | 401 | int offs = vdp->gp9001_voffs; |
402 | 402 | vdp->gp9001_voffs++; |
403 | return vdp->space() | |
403 | return vdp->space().read_word(offs*2); | |
404 | 404 | } |
405 | 405 | |
406 | 406 | |
r18027 | r18028 | |
408 | 408 | { |
409 | 409 | int offs = vdp->gp9001_voffs; |
410 | 410 | vdp->gp9001_voffs++; |
411 | vdp->space() | |
411 | vdp->space().write_word(offs*2, data, mem_mask); | |
412 | 412 | } |
413 | 413 | |
414 | 414 | static WRITE16_DEVICE_HANDLER( gp9001_devvoffs_w ) |
r18027 | r18028 | |
---|---|---|
251 | 251 | int effective_hvalue(int value); |
252 | 252 | bool adjust_object_timer(int vc); |
253 | 253 | void update_cpu_irq(); |
254 | UINT8 *memory_base(UINT32 offset) { return reinterpret_cast<UINT8 *>(m_gpu->space(AS_PROGRAM) | |
254 | UINT8 *memory_base(UINT32 offset) { return reinterpret_cast<UINT8 *>(m_gpu->space(AS_PROGRAM).get_read_ptr(offset)); } | |
255 | 255 | void blitter_run(); |
256 | 256 | void scanline_update(int param); |
257 | 257 | void set_palette(UINT16 vmode); |
r18027 | r18028 | |
---|---|---|
2104 | 2104 | |
2105 | 2105 | static void bootleg_decode( running_machine &machine ) |
2106 | 2106 | { |
2107 | address_space &space = | |
2107 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
2108 | 2108 | space.set_decrypted_region(0x0000, 0x7fff, machine.root_device().memregion("maincpu")->base() + 0x50000); |
2109 | 2109 | machine.root_device().membank("bank1")->configure_decrypted_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x60000, 0x4000); |
2110 | 2110 | } |
r18027 | r18028 | |
2203 | 2203 | { |
2204 | 2204 | m_input_type = 1; |
2205 | 2205 | configure_banks(machine()); |
2206 | machine().device("maincpu")->memory().space(AS_IO)->install_read_port(0x03, 0x03, "DSW0"); | |
2207 | machine().device("maincpu")->memory().space(AS_IO)->install_read_port(0x04, 0x04, "DSW1"); | |
2206 | machine().device("maincpu")->memory().space(AS_IO).install_read_port(0x03, 0x03, "DSW0"); | |
2207 | machine().device("maincpu")->memory().space(AS_IO).install_read_port(0x04, 0x04, "DSW1"); | |
2208 | 2208 | } |
2209 | 2209 | DRIVER_INIT_MEMBER(mitchell_state,mgakuen2) |
2210 | 2210 | { |
r18027 | r18028 | |
---|---|---|
738 | 738 | sh2drc_add_pcflush(machine().device("maincpu"), 0x32dc); |
739 | 739 | |
740 | 740 | m_mainCpuIsArm = 0; |
741 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
741 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x01089a0, 0x01089a3, read32_delegate(FUNC(deco_mlc_state::avengrgs_speedup_r),this)); | |
742 | 742 | descramble_sound(machine()); |
743 | 743 | } |
744 | 744 |
r18027 | r18028 | |
---|---|---|
481 | 481 | |
482 | 482 | DRIVER_INIT_MEMBER(pasha2_state,pasha2) |
483 | 483 | { |
484 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
484 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x95744, 0x95747, read16_delegate(FUNC(pasha2_state::pasha2_speedup_r), this)); | |
485 | 485 | |
486 | 486 | membank("bank1")->set_base(memregion("user2")->base()); |
487 | 487 | } |
r18027 | r18028 | |
---|---|---|
1568 | 1568 | { |
1569 | 1569 | DRIVER_INIT_CALL(tokio); |
1570 | 1570 | |
1571 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1571 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xfe00, 0xfe00, read8_delegate(FUNC(bublbobl_state::tokiob_mcu_r),this) ); | |
1572 | 1572 | } |
1573 | 1573 | |
1574 | 1574 | DRIVER_INIT_MEMBER(bublbobl_state,dland) |
r18027 | r18028 | |
---|---|---|
2342 | 2342 | // m_hyperpac_ram[0xf000/2 + i] = PROTDATA[i]; |
2343 | 2343 | |
2344 | 2344 | /* explicit check in the code */ |
2345 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2345 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x200000, 0x200001, read16_delegate(FUNC(snowbros_state::moremorp_0a_read),this)); | |
2346 | 2346 | } |
2347 | 2347 | |
2348 | 2348 | |
r18027 | r18028 | |
2741 | 2741 | memcpy(src,buffer,len); |
2742 | 2742 | auto_free(machine(), buffer); |
2743 | 2743 | } |
2744 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2744 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x200000, 0x200001, read16_delegate(FUNC(snowbros_state::_4in1_02_read),this)); | |
2745 | 2745 | } |
2746 | 2746 | |
2747 | 2747 | DRIVER_INIT_MEMBER(snowbros_state,snowbro3) |
r18027 | r18028 | |
2768 | 2768 | |
2769 | 2769 | DRIVER_INIT_MEMBER(snowbros_state,3in1semi) |
2770 | 2770 | { |
2771 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2771 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x200000, 0x200001, read16_delegate(FUNC(snowbros_state::_3in1_read),this)); | |
2772 | 2772 | } |
2773 | 2773 | |
2774 | 2774 | READ16_MEMBER(snowbros_state::cookbib3_read) |
r18027 | r18028 | |
2778 | 2778 | |
2779 | 2779 | DRIVER_INIT_MEMBER(snowbros_state,cookbib3) |
2780 | 2780 | { |
2781 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2781 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x200000, 0x200001, read16_delegate(FUNC(snowbros_state::cookbib3_read),this)); | |
2782 | 2782 | } |
2783 | 2783 | |
2784 | 2784 | DRIVER_INIT_MEMBER(snowbros_state,pzlbreak) |
r18027 | r18028 | |
---|---|---|
3256 | 3256 | m_adc_reverse[1] = m_adc_reverse[3] = true; |
3257 | 3257 | |
3258 | 3258 | // install sync hack on core shared memory |
3259 | m_loffire_sync = m_maincpu->space(AS_PROGRAM) | |
3259 | m_loffire_sync = m_maincpu->space(AS_PROGRAM).install_write_handler(0x29c000, 0x29c011, write16_delegate(FUNC(segaxbd_state::loffire_sync0_w), this)); | |
3260 | 3260 | } |
3261 | 3261 | |
3262 | 3262 | DRIVER_INIT_MEMBER(segaxbd_state,smgp) |
r18027 | r18028 | |
3266 | 3266 | m_iochip_custom_io_w[0][1] = iowrite_delegate(FUNC(segaxbd_state::smgp_iochip0_motor_w), this); |
3267 | 3267 | |
3268 | 3268 | // map /EXCS space |
3269 | m_maincpu->space(AS_PROGRAM) | |
3269 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x2f0000, 0x2f3fff, read16_delegate(FUNC(segaxbd_state::smgp_excs_r), this), write16_delegate(FUNC(segaxbd_state::smgp_excs_w), this)); | |
3270 | 3270 | } |
3271 | 3271 | |
3272 | 3272 | DRIVER_INIT_MEMBER(segaxbd_state,rascot) |
r18027 | r18028 | |
3281 | 3281 | rom[0x606/2] = 0x4e71; |
3282 | 3282 | |
3283 | 3283 | // map /EXCS space |
3284 | m_maincpu->space(AS_PROGRAM) | |
3284 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x0f0000, 0x0f3fff, read16_delegate(FUNC(segaxbd_state::rascot_excs_r), this), write16_delegate(FUNC(segaxbd_state::rascot_excs_w), this)); | |
3285 | 3285 | } |
3286 | 3286 | |
3287 | 3287 | DRIVER_INIT_MEMBER(segaxbd_state,gprider) |
r18027 | r18028 | |
---|---|---|
636 | 636 | |
637 | 637 | void nbmj9195_state::machine_reset() |
638 | 638 | { |
639 | address_space &space = | |
639 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
640 | 640 | int i; |
641 | 641 | |
642 | 642 | // initialize TMPZ84C011 PIO |
r18027 | r18028 | |
649 | 649 | |
650 | 650 | DRIVER_INIT_MEMBER(nbmj9195_state,nbmj9195) |
651 | 651 | { |
652 | address_space &space = | |
652 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
653 | 653 | UINT8 *ROM = memregion("audiocpu")->base(); |
654 | 654 | |
655 | 655 | // sound program patch |
r18027 | r18028 | |
---|---|---|
585 | 585 | |
586 | 586 | void csplayh5_state::machine_reset() |
587 | 587 | { |
588 | address_space &space = | |
588 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
589 | 589 | int i; |
590 | 590 | |
591 | 591 | // initialize TMPZ84C011 PIO |
r18027 | r18028 | |
---|---|---|
877 | 877 | |
878 | 878 | /* sprite RAM lives at the end of palette RAM */ |
879 | 879 | m_spriteram.set_target(&m_generic_paletteram_8[0xc00], 0x400); |
880 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
880 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_ram(0xcc00, 0xcfff, m_spriteram); | |
881 | 881 | } |
882 | 882 | |
883 | 883 | |
884 | 884 | DRIVER_INIT_MEMBER(fromance_state,hatris) |
885 | 885 | { |
886 | machine().device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x20, 0x20, FUNC(sound_command_nonmi_w)); | |
887 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x21, 0x21, write8_delegate(FUNC(fromance_state::fromance_gfxreg_w),this)); | |
886 | machine().device("maincpu")->memory().space(AS_IO).install_legacy_write_handler(0x20, 0x20, FUNC(sound_command_nonmi_w)); | |
887 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x21, 0x21, write8_delegate(FUNC(fromance_state::fromance_gfxreg_w),this)); | |
888 | 888 | } |
889 | 889 | |
890 | 890 |
r18027 | r18028 | |
---|---|---|
1313 | 1313 | state->m_speedup_count = count; |
1314 | 1314 | |
1315 | 1315 | for (i = 0; i < count; i++) |
1316 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1316 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(entries[i].offset, entries[i].offset + 3, speedup_handlers[i].func, speedup_handlers[i].name); | |
1317 | 1317 | |
1318 | 1318 | #ifdef MAME_DEBUG |
1319 | 1319 | machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(report_speedups), &machine)); |
r18027 | r18028 | |
---|---|---|
697 | 697 | |
698 | 698 | DRIVER_INIT_MEMBER(policetr_state,policetr) |
699 | 699 | { |
700 | m_speedup_data = machine().device("maincpu")->memory().space(AS_PROGRAM) | |
700 | m_speedup_data = machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x00000fc8, 0x00000fcb, write32_delegate(FUNC(policetr_state::speedup_w),this)); | |
701 | 701 | m_speedup_pc = 0x1fc028ac; |
702 | 702 | } |
703 | 703 | |
704 | 704 | DRIVER_INIT_MEMBER(policetr_state,plctr13b) |
705 | 705 | { |
706 | m_speedup_data = machine().device("maincpu")->memory().space(AS_PROGRAM) | |
706 | m_speedup_data = machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x00000fc8, 0x00000fcb, write32_delegate(FUNC(policetr_state::speedup_w),this)); | |
707 | 707 | m_speedup_pc = 0x1fc028bc; |
708 | 708 | } |
709 | 709 | |
710 | 710 | |
711 | 711 | DRIVER_INIT_MEMBER(policetr_state,sshooter) |
712 | 712 | { |
713 | m_speedup_data = machine().device("maincpu")->memory().space(AS_PROGRAM) | |
713 | m_speedup_data = machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x00018fd8, 0x00018fdb, write32_delegate(FUNC(policetr_state::speedup_w),this)); | |
714 | 714 | m_speedup_pc = 0x1fc03470; |
715 | 715 | } |
716 | 716 | |
717 | 717 | DRIVER_INIT_MEMBER(policetr_state,sshoot12) |
718 | 718 | { |
719 | m_speedup_data = machine().device("maincpu")->memory().space(AS_PROGRAM) | |
719 | m_speedup_data = machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x00018fd8, 0x00018fdb, write32_delegate(FUNC(policetr_state::speedup_w),this)); | |
720 | 720 | m_speedup_pc = 0x1fc033e0; |
721 | 721 | } |
722 | 722 |
r18027 | r18028 | |
---|---|---|
664 | 664 | #endif |
665 | 665 | |
666 | 666 | // 220000 = writes to mcu? 330000 = reads? |
667 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x220000, 0x220001, FUNC(aladmdb_w)); | |
668 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x330000, 0x330001, FUNC(aladmdb_r)); | |
667 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x220000, 0x220001, FUNC(aladmdb_w)); | |
668 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x330000, 0x330001, FUNC(aladmdb_r)); | |
669 | 669 | |
670 | 670 | megadrive_6buttons_pad = 0; |
671 | 671 | DRIVER_INIT_CALL(megadrij); |
r18027 | r18028 | |
714 | 714 | rom[0x07] = 0x02; |
715 | 715 | rom[0x06] = 0x10; |
716 | 716 | |
717 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
717 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x770070, 0x770075, FUNC(mk3mdb_dsw_r) ); | |
718 | 718 | |
719 | 719 | megadrive_6buttons_pad = 1; |
720 | 720 | DRIVER_INIT_CALL(megadriv); |
r18027 | r18028 | |
722 | 722 | |
723 | 723 | DRIVER_INIT_MEMBER(md_boot_state,ssf2mdb) |
724 | 724 | { |
725 | machine().device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xA130F0, 0xA130FF); // custom banking is disabled (!) | |
726 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x400000, 0x5fffff, "bank5"); | |
727 | machine().device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x400000, 0x5fffff); | |
725 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write(0xA130F0, 0xA130FF); // custom banking is disabled (!) | |
726 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x400000, 0x5fffff, "bank5"); | |
727 | machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x400000, 0x5fffff); | |
728 | 728 | |
729 | 729 | machine().root_device().membank("bank5")->set_base(machine().root_device().memregion( "maincpu" )->base() + 0x400000 ); |
730 | 730 | |
731 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
731 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x770070, 0x770075, FUNC(ssf2mdb_dsw_r) ); | |
732 | 732 | |
733 | 733 | megadrive_6buttons_pad = 1; |
734 | 734 | DRIVER_INIT_CALL(megadrij); |
r18027 | r18028 | |
770 | 770 | rom[0x06] = 0xd2; |
771 | 771 | rom[0x07] = 0x00; |
772 | 772 | |
773 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
773 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x770070, 0x770075, FUNC(srmdb_dsw_r) ); | |
774 | 774 | |
775 | 775 | megadrive_6buttons_pad = 0; |
776 | 776 | DRIVER_INIT_CALL(megadriv); |
r18027 | r18028 | |
778 | 778 | |
779 | 779 | DRIVER_INIT_MEMBER(md_cons_state,topshoot) |
780 | 780 | { |
781 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200050, 0x200051, FUNC(topshoot_200051_r) ); | |
782 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x200042, 0x200043, "IN0"); | |
783 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x200044, 0x200045, "IN1"); | |
784 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x200046, 0x200047, "IN2"); | |
785 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x200048, 0x200049, "IN3"); | |
781 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x200050, 0x200051, FUNC(topshoot_200051_r) ); | |
782 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x200042, 0x200043, "IN0"); | |
783 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x200044, 0x200045, "IN1"); | |
784 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x200046, 0x200047, "IN2"); | |
785 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x200048, 0x200049, "IN3"); | |
786 | 786 | |
787 | 787 | megadrive_6buttons_pad = 0; |
788 | 788 | DRIVER_INIT_CALL(megadriv); |
r18027 | r18028 | |
---|---|---|
733 | 733 | |
734 | 734 | DRIVER_INIT_MEMBER(zn_state,coh1000c) |
735 | 735 | { |
736 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f3fffff, "bank1" ); /* fixed game rom */ | |
737 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f400000, 0x1f7fffff, "bank2" ); /* banked game rom */ | |
738 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1fb00000, 0x1fb00003, write32_delegate(FUNC(zn_state::bank_coh1000c_w),this)); /* bankswitch */ | |
739 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1fb40010, 0x1fb40013, read32_delegate(FUNC(zn_state::capcom_kickharness_r),this)); | |
740 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1fb40020, 0x1fb40023, read32_delegate(FUNC(zn_state::capcom_kickharness_r),this)); | |
741 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1fb80000, 0x1fbfffff, "bank3" ); /* country rom */ | |
742 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1fb60000, 0x1fb60003, write32_delegate(FUNC(zn_state::zn_qsound_w),this)); | |
736 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank ( 0x1f000000, 0x1f3fffff, "bank1" ); /* fixed game rom */ | |
737 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank ( 0x1f400000, 0x1f7fffff, "bank2" ); /* banked game rom */ | |
738 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler( 0x1fb00000, 0x1fb00003, write32_delegate(FUNC(zn_state::bank_coh1000c_w),this)); /* bankswitch */ | |
739 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler ( 0x1fb40010, 0x1fb40013, read32_delegate(FUNC(zn_state::capcom_kickharness_r),this)); | |
740 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler ( 0x1fb40020, 0x1fb40023, read32_delegate(FUNC(zn_state::capcom_kickharness_r),this)); | |
741 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank ( 0x1fb80000, 0x1fbfffff, "bank3" ); /* country rom */ | |
742 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler( 0x1fb60000, 0x1fb60003, write32_delegate(FUNC(zn_state::zn_qsound_w),this)); | |
743 | 743 | |
744 | 744 | zn_driver_init(machine()); |
745 | 745 | |
r18027 | r18028 | |
950 | 950 | |
951 | 951 | DRIVER_INIT_MEMBER(zn_state,coh3002c) |
952 | 952 | { |
953 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f3fffff, "bank1" ); /* fixed game rom */ | |
954 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f400000, 0x1f7fffff, "bank2" ); /* banked game rom */ | |
955 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1fb40010, 0x1fb40013, read32_delegate(FUNC(zn_state::capcom_kickharness_r),this)); | |
956 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1fb40020, 0x1fb40023, read32_delegate(FUNC(zn_state::capcom_kickharness_r),this)); | |
957 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1fb00000, 0x1fb00003, write32_delegate(FUNC(zn_state::bank_coh3002c_w),this)); /* bankswitch */ | |
958 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1fb80000, 0x1fbfffff, "bank3" ); /* country rom */ | |
959 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1fb60000, 0x1fb60003, write32_delegate(FUNC(zn_state::zn_qsound_w),this)); | |
953 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank ( 0x1f000000, 0x1f3fffff, "bank1" ); /* fixed game rom */ | |
954 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank ( 0x1f400000, 0x1f7fffff, "bank2" ); /* banked game rom */ | |
955 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler ( 0x1fb40010, 0x1fb40013, read32_delegate(FUNC(zn_state::capcom_kickharness_r),this)); | |
956 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler ( 0x1fb40020, 0x1fb40023, read32_delegate(FUNC(zn_state::capcom_kickharness_r),this)); | |
957 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler( 0x1fb00000, 0x1fb00003, write32_delegate(FUNC(zn_state::bank_coh3002c_w),this)); /* bankswitch */ | |
958 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank ( 0x1fb80000, 0x1fbfffff, "bank3" ); /* country rom */ | |
959 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler( 0x1fb60000, 0x1fb60003, write32_delegate(FUNC(zn_state::zn_qsound_w),this)); | |
960 | 960 | |
961 | 961 | zn_driver_init(machine()); |
962 | 962 | } |
r18027 | r18028 | |
1239 | 1239 | m_taitofx1_eeprom_size1 = 0x200; m_taitofx1_eeprom1 = auto_alloc_array( machine(), UINT8, m_taitofx1_eeprom_size1 ); |
1240 | 1240 | machine().device<nvram_device>("eeprom1")->set_base(m_taitofx1_eeprom1, m_taitofx1_eeprom_size1); |
1241 | 1241 | |
1242 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" ); /* banked game rom */ | |
1243 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler ( 0x1fb40000, 0x1fb40003, write32_delegate(FUNC(zn_state::bank_coh1000t_w),this)); /* bankswitch */ | |
1244 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler( 0x1fb80000, 0x1fb80003, read32_delegate(FUNC(zn_state::taitofx1a_ymsound_r),this), write32_delegate(FUNC(zn_state::taitofx1a_ymsound_w),this)); | |
1245 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank( 0x1fbe0000, 0x1fbe0000 + ( m_taitofx1_eeprom_size1 - 1 ), "bank2" ); | |
1242 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" ); /* banked game rom */ | |
1243 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler ( 0x1fb40000, 0x1fb40003, write32_delegate(FUNC(zn_state::bank_coh1000t_w),this)); /* bankswitch */ | |
1244 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler( 0x1fb80000, 0x1fb80003, read32_delegate(FUNC(zn_state::taitofx1a_ymsound_r),this), write32_delegate(FUNC(zn_state::taitofx1a_ymsound_w),this)); | |
1245 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank( 0x1fbe0000, 0x1fbe0000 + ( m_taitofx1_eeprom_size1 - 1 ), "bank2" ); | |
1246 | 1246 | |
1247 | 1247 | zn_driver_init(machine()); |
1248 | 1248 | } |
r18027 | r18028 | |
1328 | 1328 | machine().device<nvram_device>("eeprom1")->set_base(m_taitofx1_eeprom1, m_taitofx1_eeprom_size1); |
1329 | 1329 | machine().device<nvram_device>("eeprom2")->set_base(m_taitofx1_eeprom2, m_taitofx1_eeprom_size2); |
1330 | 1330 | |
1331 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" ); /* banked game rom */ | |
1332 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank( 0x1fb00000, 0x1fb00000 + ( m_taitofx1_eeprom_size1 - 1 ), "bank2" ); | |
1333 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler ( 0x1fb40000, 0x1fb40003, write32_delegate(FUNC(zn_state::bank_coh1000t_w),this)); /* bankswitch */ | |
1334 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler ( 0x1fb80000, 0x1fb8ffff, write32_delegate(FUNC(zn_state::taitofx1b_volume_w),this)); | |
1335 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler ( 0x1fba0000, 0x1fbaffff, write32_delegate(FUNC(zn_state::taitofx1b_sound_w),this)); | |
1336 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1fbc0000, 0x1fbc0003, read32_delegate(FUNC(zn_state::taitofx1b_sound_r),this)); | |
1337 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank( 0x1fbe0000, 0x1fbe0000 + ( m_taitofx1_eeprom_size2 - 1 ), "bank3" ); | |
1331 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" ); /* banked game rom */ | |
1332 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank( 0x1fb00000, 0x1fb00000 + ( m_taitofx1_eeprom_size1 - 1 ), "bank2" ); | |
1333 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler ( 0x1fb40000, 0x1fb40003, write32_delegate(FUNC(zn_state::bank_coh1000t_w),this)); /* bankswitch */ | |
1334 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler ( 0x1fb80000, 0x1fb8ffff, write32_delegate(FUNC(zn_state::taitofx1b_volume_w),this)); | |
1335 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler ( 0x1fba0000, 0x1fbaffff, write32_delegate(FUNC(zn_state::taitofx1b_sound_w),this)); | |
1336 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler ( 0x1fbc0000, 0x1fbc0003, read32_delegate(FUNC(zn_state::taitofx1b_sound_r),this)); | |
1337 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank( 0x1fbe0000, 0x1fbe0000 + ( m_taitofx1_eeprom_size2 - 1 ), "bank3" ); | |
1338 | 1338 | |
1339 | 1339 | zn_driver_init(machine()); |
1340 | 1340 | } |
r18027 | r18028 | |
1499 | 1499 | |
1500 | 1500 | /* dma size is in 32-bit words, convert to bytes */ |
1501 | 1501 | n_size <<= 2; |
1502 | address_space &space = | |
1502 | address_space &space = state->machine().firstcpu->space(AS_PROGRAM); | |
1503 | 1503 | while( n_size > 0 ) |
1504 | 1504 | { |
1505 | 1505 | psxwritebyte( p_n_psxram, n_address, ide_controller32_r( ide, space, 0x1f0 / 4, 0x000000ff ) ); |
r18027 | r18028 | |
1517 | 1517 | { |
1518 | 1518 | device_t *ide = machine().device("ide"); |
1519 | 1519 | |
1520 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f1fffff, "bank1" ); | |
1521 | machine().device("maincpu")->memory().space(AS_PROGRAM)->nop_write ( 0x1f000000, 0x1f000003); | |
1522 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( *ide, 0x1f7e4000, 0x1f7e4fff, FUNC(ide_controller32_r), FUNC(ide_controller32_w) ); | |
1523 | machine().device("maincpu")->memory().space(AS_PROGRAM)->nop_readwrite ( 0x1f7e8000, 0x1f7e8003); | |
1524 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( *ide, 0x1f7f4000, 0x1f7f4fff, FUNC(ide_controller32_r), FUNC(ide_controller32_w) ); | |
1520 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank ( 0x1f000000, 0x1f1fffff, "bank1" ); | |
1521 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write ( 0x1f000000, 0x1f000003); | |
1522 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler( *ide, 0x1f7e4000, 0x1f7e4fff, FUNC(ide_controller32_r), FUNC(ide_controller32_w) ); | |
1523 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_readwrite ( 0x1f7e8000, 0x1f7e8003); | |
1524 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler( *ide, 0x1f7f4000, 0x1f7f4fff, FUNC(ide_controller32_r), FUNC(ide_controller32_w) ); | |
1525 | 1525 | |
1526 | 1526 | zn_driver_init(machine()); |
1527 | 1527 | } |
r18027 | r18028 | |
1713 | 1713 | |
1714 | 1714 | DRIVER_INIT_MEMBER(zn_state,coh1002e) |
1715 | 1715 | { |
1716 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" ); | |
1717 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1fa10300, 0x1fa10303, write32_delegate(FUNC(zn_state::coh1002e_bank_w),this)); | |
1718 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1fb00000, 0x1fb00007, write32_delegate(FUNC(zn_state::coh1002e_latch_w),this)); | |
1716 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" ); | |
1717 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler( 0x1fa10300, 0x1fa10303, write32_delegate(FUNC(zn_state::coh1002e_bank_w),this)); | |
1718 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler( 0x1fb00000, 0x1fb00007, write32_delegate(FUNC(zn_state::coh1002e_latch_w),this)); | |
1719 | 1719 | |
1720 | 1720 | zn_driver_init(machine()); |
1721 | 1721 | } |
r18027 | r18028 | |
1853 | 1853 | |
1854 | 1854 | DRIVER_INIT_MEMBER(zn_state,bam2) |
1855 | 1855 | { |
1856 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f3fffff, "bank1" ); | |
1857 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f400000, 0x1f7fffff, "bank2" ); | |
1858 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1fb00000, 0x1fb00007, read32_delegate(FUNC(zn_state::bam2_mcu_r),this)); | |
1859 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1fa20000, 0x1fa20003, read32_delegate(FUNC(zn_state::bam2_unk_r),this)); | |
1860 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1fa10300, 0x1fa10303, write32_delegate(FUNC(zn_state::bam2_sec_w),this)); | |
1861 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1fb00000, 0x1fb00007, write32_delegate(FUNC(zn_state::bam2_mcu_w),this)); | |
1856 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank ( 0x1f000000, 0x1f3fffff, "bank1" ); | |
1857 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank ( 0x1f400000, 0x1f7fffff, "bank2" ); | |
1858 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler ( 0x1fb00000, 0x1fb00007, read32_delegate(FUNC(zn_state::bam2_mcu_r),this)); | |
1859 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler ( 0x1fa20000, 0x1fa20003, read32_delegate(FUNC(zn_state::bam2_unk_r),this)); | |
1860 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler( 0x1fa10300, 0x1fa10303, write32_delegate(FUNC(zn_state::bam2_sec_w),this)); | |
1861 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler( 0x1fb00000, 0x1fb00007, write32_delegate(FUNC(zn_state::bam2_mcu_w),this)); | |
1862 | 1862 | |
1863 | 1863 | zn_driver_init(machine()); |
1864 | 1864 | } |
r18027 | r18028 | |
2172 | 2172 | DRIVER_INIT_MEMBER(zn_state,coh1000a) |
2173 | 2173 | { |
2174 | 2174 | |
2175 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f1fffff, "bank1" ); | |
2176 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1fbfff00, 0x1fbfff03, write32_delegate(FUNC(zn_state::acpsx_00_w),this)); | |
2177 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1fbfff10, 0x1fbfff13, write32_delegate(FUNC(zn_state::acpsx_10_w),this)); | |
2175 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank ( 0x1f000000, 0x1f1fffff, "bank1" ); | |
2176 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler( 0x1fbfff00, 0x1fbfff03, write32_delegate(FUNC(zn_state::acpsx_00_w),this)); | |
2177 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler( 0x1fbfff10, 0x1fbfff13, write32_delegate(FUNC(zn_state::acpsx_10_w),this)); | |
2178 | 2178 | |
2179 | 2179 | if( strcmp( machine().system().name, "nbajamex" ) == 0 ) |
2180 | 2180 | { |
2181 | 2181 | m_nbajamex_eeprom_size = 0x8000; |
2182 | 2182 | m_nbajamex_eeprom = auto_alloc_array( machine(), UINT8, m_nbajamex_eeprom_size ); |
2183 | 2183 | |
2184 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank( 0x1f200000, 0x1f200000 + ( m_nbajamex_eeprom_size - 1 ), "bank2" ); | |
2185 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1fbfff08, 0x1fbfff0b, read32_delegate(FUNC(zn_state::nbajamex_08_r),this)); | |
2186 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler( 0x1fbfff80, 0x1fbfff83, read32_delegate(FUNC(zn_state::nbajamex_80_r),this), write32_delegate(FUNC(zn_state::nbajamex_80_w),this)); | |
2184 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank( 0x1f200000, 0x1f200000 + ( m_nbajamex_eeprom_size - 1 ), "bank2" ); | |
2185 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler ( 0x1fbfff08, 0x1fbfff0b, read32_delegate(FUNC(zn_state::nbajamex_08_r),this)); | |
2186 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler( 0x1fbfff80, 0x1fbfff83, read32_delegate(FUNC(zn_state::nbajamex_80_r),this), write32_delegate(FUNC(zn_state::nbajamex_80_w),this)); | |
2187 | 2187 | |
2188 | 2188 | membank( "bank2" )->set_base( m_nbajamex_eeprom ); /* ram/eeprom/?? */ |
2189 | 2189 | } |
r18027 | r18028 | |
2191 | 2191 | if( ( !strcmp( machine().system().name, "jdredd" ) ) || |
2192 | 2192 | ( !strcmp( machine().system().name, "jdreddb" ) ) ) |
2193 | 2193 | { |
2194 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x1fbfff8c, 0x1fbfff8f,read32_delegate(FUNC(zn_state::jdredd_idestat_r),this) ); | |
2195 | machine().device("maincpu")->memory().space(AS_PROGRAM)->nop_write ( 0x1fbfff8c, 0x1fbfff8f); | |
2196 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x1fbfff90, 0x1fbfff9f, read32_delegate(FUNC(zn_state::jdredd_ide_r),this), write32_delegate(FUNC(zn_state::jdredd_ide_w),this) ); | |
2194 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x1fbfff8c, 0x1fbfff8f,read32_delegate(FUNC(zn_state::jdredd_idestat_r),this) ); | |
2195 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write ( 0x1fbfff8c, 0x1fbfff8f); | |
2196 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x1fbfff90, 0x1fbfff9f, read32_delegate(FUNC(zn_state::jdredd_ide_r),this), write32_delegate(FUNC(zn_state::jdredd_ide_w),this) ); | |
2197 | 2197 | } |
2198 | 2198 | |
2199 | 2199 | zn_driver_init(machine()); |
r18027 | r18028 | |
2355 | 2355 | |
2356 | 2356 | DRIVER_INIT_MEMBER(zn_state,coh1001l) |
2357 | 2357 | { |
2358 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" ); /* banked rom */ | |
2359 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1fb00000, 0x1fb00003, write32_delegate(FUNC(zn_state::coh1001l_bnk_w),this) ); | |
2358 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" ); /* banked rom */ | |
2359 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler( 0x1fb00000, 0x1fb00003, write32_delegate(FUNC(zn_state::coh1001l_bnk_w),this) ); | |
2360 | 2360 | |
2361 | 2361 | zn_driver_init(machine()); |
2362 | 2362 | } |
r18027 | r18028 | |
2397 | 2397 | |
2398 | 2398 | DRIVER_INIT_MEMBER(zn_state,coh1002v) |
2399 | 2399 | { |
2400 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f27ffff, "bank1" ); | |
2401 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1fb00000, 0x1fbfffff, "bank2" ); | |
2402 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1fb00000, 0x1fb00003, write32_delegate(FUNC(zn_state::coh1002v_bnk_w),this)); | |
2400 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank ( 0x1f000000, 0x1f27ffff, "bank1" ); | |
2401 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank ( 0x1fb00000, 0x1fbfffff, "bank2" ); | |
2402 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler( 0x1fb00000, 0x1fb00003, write32_delegate(FUNC(zn_state::coh1002v_bnk_w),this)); | |
2403 | 2403 | |
2404 | 2404 | zn_driver_init(machine()); |
2405 | 2405 | } |
r18027 | r18028 | |
2600 | 2600 | |
2601 | 2601 | DRIVER_INIT_MEMBER(zn_state,coh1002m) |
2602 | 2602 | { |
2603 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" ); | |
2604 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler( 0x1fb00000, 0x1fb00003, read32_delegate(FUNC(zn_state::cbaj_z80_r),this), write32_delegate(FUNC(zn_state::cbaj_z80_w),this)); | |
2605 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler ( 0x1fb00004, 0x1fb00007, write32_delegate(FUNC(zn_state::coh1002m_bank_w),this)); | |
2603 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" ); | |
2604 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler( 0x1fb00000, 0x1fb00003, read32_delegate(FUNC(zn_state::cbaj_z80_r),this), write32_delegate(FUNC(zn_state::cbaj_z80_w),this)); | |
2605 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler ( 0x1fb00004, 0x1fb00007, write32_delegate(FUNC(zn_state::coh1002m_bank_w),this)); | |
2606 | 2606 | |
2607 | 2607 | zn_driver_init(machine()); |
2608 | 2608 | } |
r18027 | r18028 | |
---|---|---|
1259 | 1259 | DRIVER_INIT_MEMBER(paradise_state,tgtball) |
1260 | 1260 | { |
1261 | 1261 | m_sprite_inc = 4; |
1262 | machine().device("maincpu")->memory().space(AS_IO) | |
1262 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x2001, 0x2001, write8_delegate(FUNC(paradise_state::tgtball_flipscreen_w),this)); | |
1263 | 1263 | |
1264 | 1264 | } |
1265 | 1265 | |
1266 | 1266 | DRIVER_INIT_MEMBER(paradise_state,torus) |
1267 | 1267 | { |
1268 | 1268 | m_sprite_inc = 4; |
1269 | machine().device("maincpu")->memory().space(AS_IO) | |
1269 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x2070, 0x2070, write8_delegate(FUNC(paradise_state::torus_coin_counter_w),this)); | |
1270 | 1270 | } |
1271 | 1271 | |
1272 | 1272 |
r18027 | r18028 | |
---|---|---|
2163 | 2163 | DRIVER_INIT_MEMBER(balsente_state,toggle) { expand_roms(machine(), EXPAND_ALL); config_shooter_adc(machine(), FALSE, 0 /* noanalog */); } |
2164 | 2164 | DRIVER_INIT_MEMBER(balsente_state,nametune) |
2165 | 2165 | { |
2166 | address_space &space = | |
2166 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2167 | 2167 | space.install_write_handler(0x9f00, 0x9f00, write8_delegate(FUNC(balsente_state::balsente_rombank2_select_w),this)); |
2168 | 2168 | expand_roms(machine(), EXPAND_NONE | SWAP_HALVES); config_shooter_adc(machine(), FALSE, 0 /* noanalog */); |
2169 | 2169 | } |
2170 | 2170 | DRIVER_INIT_MEMBER(balsente_state,nstocker) |
2171 | 2171 | { |
2172 | address_space &space = | |
2172 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2173 | 2173 | space.install_write_handler(0x9f00, 0x9f00, write8_delegate(FUNC(balsente_state::balsente_rombank2_select_w),this)); |
2174 | 2174 | expand_roms(machine(), EXPAND_NONE | SWAP_HALVES); config_shooter_adc(machine(), TRUE, 1); |
2175 | 2175 | } |
2176 | 2176 | DRIVER_INIT_MEMBER(balsente_state,sfootbal) |
2177 | 2177 | { |
2178 | address_space &space = | |
2178 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2179 | 2179 | space.install_write_handler(0x9f00, 0x9f00, write8_delegate(FUNC(balsente_state::balsente_rombank2_select_w),this)); |
2180 | 2180 | expand_roms(machine(), EXPAND_ALL | SWAP_HALVES); config_shooter_adc(machine(), FALSE, 0); |
2181 | 2181 | } |
2182 | 2182 | DRIVER_INIT_MEMBER(balsente_state,spiker) |
2183 | 2183 | { |
2184 | address_space &space = | |
2184 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2185 | 2185 | space.install_readwrite_handler(0x9f80, 0x9f8f, read8_delegate(FUNC(balsente_state::spiker_expand_r),this), write8_delegate(FUNC(balsente_state::spiker_expand_w),this)); |
2186 | 2186 | space.install_write_handler(0x9f00, 0x9f00, write8_delegate(FUNC(balsente_state::balsente_rombank2_select_w),this)); |
2187 | 2187 | expand_roms(machine(), EXPAND_ALL | SWAP_HALVES); config_shooter_adc(machine(), FALSE, 1); |
2188 | 2188 | } |
2189 | 2189 | DRIVER_INIT_MEMBER(balsente_state,stompin) |
2190 | 2190 | { |
2191 | address_space &space = | |
2191 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2192 | 2192 | space.install_write_handler(0x9f00, 0x9f00, write8_delegate(FUNC(balsente_state::balsente_rombank2_select_w),this)); |
2193 | 2193 | expand_roms(machine(), 0x0c | SWAP_HALVES); config_shooter_adc(machine(), FALSE, 32); |
2194 | 2194 | } |
2195 | 2195 | DRIVER_INIT_MEMBER(balsente_state,rescraid) { expand_roms(machine(), EXPAND_NONE); config_shooter_adc(machine(), FALSE, 0 /* noanalog */); } |
2196 | 2196 | DRIVER_INIT_MEMBER(balsente_state,grudge) |
2197 | 2197 | { |
2198 | address_space &space = | |
2198 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2199 | 2199 | space.install_read_handler(0x9400, 0x9400, read8_delegate(FUNC(balsente_state::grudge_steering_r),this)); |
2200 | 2200 | expand_roms(machine(), EXPAND_NONE); config_shooter_adc(machine(), FALSE, 0); |
2201 | 2201 | } |
2202 | 2202 | DRIVER_INIT_MEMBER(balsente_state,shrike) |
2203 | 2203 | { |
2204 | address_space &space = | |
2204 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2205 | 2205 | space.install_readwrite_handler(0x9e00, 0x9fff, read8_delegate(FUNC(balsente_state::shrike_shared_6809_r),this), write8_delegate(FUNC(balsente_state::shrike_shared_6809_w),this)); |
2206 | 2206 | space.install_write_handler(0x9e01, 0x9e01, write8_delegate(FUNC(balsente_state::shrike_sprite_select_w),this)); |
2207 | machine().device("68k")->memory().space(AS_PROGRAM) | |
2207 | machine().device("68k")->memory().space(AS_PROGRAM).install_readwrite_handler(0x10000, 0x1001f, read16_delegate(FUNC(balsente_state::shrike_io_68k_r),this), write16_delegate(FUNC(balsente_state::shrike_io_68k_w),this)); | |
2208 | 2208 | |
2209 | 2209 | expand_roms(machine(), EXPAND_ALL); config_shooter_adc(machine(), FALSE, 32); |
2210 | 2210 | } |
r18027 | r18028 | |
---|---|---|
996 | 996 | { |
997 | 997 | // UINT16 *mem16 = (UINT16 *)machine().root_device().memregion("maincpu")->base(); |
998 | 998 | // mem16[0x0165B2/2] = 0x4e71; // for now so it boots |
999 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
999 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x700000, 0x700001, read16_delegate(FUNC(fitfight_state::fitfight_700000_r),this)); | |
1000 | 1000 | m_bbprot_kludge = 0; |
1001 | 1001 | } |
1002 | 1002 | |
r18027 | r18028 | |
1004 | 1004 | { |
1005 | 1005 | // UINT16 *mem16 = (UINT16 *)machine().root_device().memregion("maincpu")->base(); |
1006 | 1006 | // mem16[0x017FDC/2] = 0x4e71; // for now so it boots |
1007 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1007 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x700000, 0x700001, read16_delegate(FUNC(fitfight_state::histryma_700000_r),this)); | |
1008 | 1008 | m_bbprot_kludge = 0; |
1009 | 1009 | } |
1010 | 1010 | |
r18027 | r18028 | |
1015 | 1015 | |
1016 | 1016 | DRIVER_INIT_MEMBER(fitfight_state,hotmindff) |
1017 | 1017 | { |
1018 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1018 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x200000, 0x200001, 0, 0, read16_delegate(FUNC(fitfight_state::hotmindff_unk_r),this)); | |
1019 | 1019 | DRIVER_INIT_CALL(fitfight); |
1020 | 1020 | } |
1021 | 1021 |
r18027 | r18028 | |
---|---|---|
1014 | 1014 | DRIVER_INIT_MEMBER(terracre_state,horekid) |
1015 | 1015 | { |
1016 | 1016 | m_mpProtData = mHoreKidProtData; |
1017 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1017 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x44004, 0x44005, read16_delegate(FUNC(terracre_state::horekid_IN2_r),this)); | |
1018 | 1018 | } |
1019 | 1019 | |
1020 | 1020 | /* YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR, COMPANY, FULLNAME, FLAGS */ |
r18027 | r18028 | |
---|---|---|
506 | 506 | WRITE32_MEMBER(deco32_state::tattass_control_w) |
507 | 507 | { |
508 | 508 | eeprom_device *eeprom = machine().device<eeprom_device>("eeprom"); |
509 | address_space | |
509 | address_space &eeprom_space = eeprom->space(); | |
510 | 510 | |
511 | 511 | /* Eprom in low byte */ |
512 | 512 | if (mem_mask==0x000000ff) { /* Byte write to low byte only (different from word writing including low byte) */ |
r18027 | r18028 | |
556 | 556 | int d=m_readBitCount/8; |
557 | 557 | int m=7-(m_readBitCount%8); |
558 | 558 | int a=(m_byteAddr+d)%1024; |
559 | int b=eeprom_space | |
559 | int b=eeprom_space.read_byte(a); | |
560 | 560 | |
561 | 561 | m_tattass_eprom_bit=(b>>m)&1; |
562 | 562 | |
r18027 | r18028 | |
573 | 573 | int b=(m_buffer[24]<<7)|(m_buffer[25]<<6)|(m_buffer[26]<<5)|(m_buffer[27]<<4) |
574 | 574 | |(m_buffer[28]<<3)|(m_buffer[29]<<2)|(m_buffer[30]<<1)|(m_buffer[31]<<0); |
575 | 575 | |
576 | eeprom_space | |
576 | eeprom_space.write_byte(m_byteAddr, b); | |
577 | 577 | } |
578 | 578 | m_lastClock=data&0x20; |
579 | 579 | return; |
r18027 | r18028 | |
588 | 588 | |
589 | 589 | /* Check for read command */ |
590 | 590 | if (m_buffer[0] && m_buffer[1]) { |
591 | m_tattass_eprom_bit=(eeprom_space | |
591 | m_tattass_eprom_bit=(eeprom_space.read_byte(m_byteAddr)>>7)&1; | |
592 | 592 | m_readBitCount=1; |
593 | 593 | m_pendingCommand=1; |
594 | 594 | } |
r18027 | r18028 | |
---|---|---|
1433 | 1433 | { |
1434 | 1434 | dcs2_init(machine(), 0, 0); |
1435 | 1435 | midway_ioasic_init(machine(), MIDWAY_IOASIC_STANDARD, 468/* or 488 */, 94, NULL); |
1436 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1436 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x9c0000, 0x9c0000, read32_delegate(FUNC(midzeus_state::invasn_gun_r),this), write32_delegate(FUNC(midzeus_state::invasn_gun_w),this)); | |
1437 | 1437 | } |
1438 | 1438 | |
1439 | 1439 | |
r18027 | r18028 | |
1442 | 1442 | dcs2_init(machine(), 0, 0); |
1443 | 1443 | midway_ioasic_init(machine(), MIDWAY_IOASIC_STANDARD, 472/* or 476,477,478,110 */, 99, NULL); |
1444 | 1444 | machine().root_device().membank("bank1")->configure_entries(0, 3, machine().root_device().memregion("user2")->base(), 0x400000*4); |
1445 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x9b0004, 0x9b0007, read32_delegate(FUNC(midzeus_state::crusnexo_leds_r),this), write32_delegate(FUNC(midzeus_state::crusnexo_leds_w),this)); | |
1446 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler (0x8d0009, 0x8d000a, write32_delegate(FUNC(midzeus_state::keypad_select_w),this)); | |
1445 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x9b0004, 0x9b0007, read32_delegate(FUNC(midzeus_state::crusnexo_leds_r),this), write32_delegate(FUNC(midzeus_state::crusnexo_leds_w),this)); | |
1446 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler (0x8d0009, 0x8d000a, write32_delegate(FUNC(midzeus_state::keypad_select_w),this)); | |
1447 | 1447 | } |
1448 | 1448 | |
1449 | 1449 |
r18027 | r18028 | |
---|---|---|
1522 | 1522 | }; |
1523 | 1523 | |
1524 | 1524 | int A; |
1525 | address_space &space = | |
1525 | address_space &space = machine.device(cputag)->memory().space(AS_PROGRAM); | |
1526 | 1526 | UINT8 *rom = machine.root_device().memregion(cputag)->base(); |
1527 | 1527 | int size = machine.root_device().memregion(cputag)->bytes(); |
1528 | 1528 | UINT8 *decrypt = auto_alloc_array(machine, UINT8, size); |
r18027 | r18028 | |
1582 | 1582 | |
1583 | 1583 | DRIVER_INIT_MEMBER(zaxxon_state,razmataz) |
1584 | 1584 | { |
1585 | address_space | |
1585 | address_space &pgmspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1586 | 1586 | |
1587 | 1587 | nprinces_decode(machine(), "maincpu"); |
1588 | 1588 | |
1589 | 1589 | /* additional input ports are wired */ |
1590 | pgmspace->install_read_port(0xc004, 0xc004, 0, 0x18f3, "SW04"); | |
1591 | pgmspace->install_read_port(0xc008, 0xc008, 0, 0x18f3, "SW08"); | |
1592 | pgmspace->install_read_port(0xc00c, 0xc00c, 0, 0x18f3, "SW0C"); | |
1590 | pgmspace.install_read_port(0xc004, 0xc004, 0, 0x18f3, "SW04"); | |
1591 | pgmspace.install_read_port(0xc008, 0xc008, 0, 0x18f3, "SW08"); | |
1592 | pgmspace.install_read_port(0xc00c, 0xc00c, 0, 0x18f3, "SW0C"); | |
1593 | 1593 | |
1594 | 1594 | /* unknown behavior expected here */ |
1595 | pgmspace | |
1595 | pgmspace.install_read_handler(0xc80a, 0xc80a, read8_delegate(FUNC(zaxxon_state::razmataz_counter_r),this)); | |
1596 | 1596 | |
1597 | 1597 | /* additional state saving */ |
1598 | 1598 | save_item(NAME(m_razmataz_dial_pos)); |
r18027 | r18028 | |
---|---|---|
1000 | 1000 | |
1001 | 1001 | DRIVER_INIT_MEMBER(fastfred_state,flyboy) |
1002 | 1002 | { |
1003 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xc085, 0xc099, read8_delegate(FUNC(fastfred_state::flyboy_custom1_io_r),this)); | |
1004 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xc8fb, 0xc900, read8_delegate(FUNC(fastfred_state::flyboy_custom2_io_r),this)); | |
1003 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xc085, 0xc099, read8_delegate(FUNC(fastfred_state::flyboy_custom1_io_r),this)); | |
1004 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xc8fb, 0xc900, read8_delegate(FUNC(fastfred_state::flyboy_custom2_io_r),this)); | |
1005 | 1005 | m_hardware_type = 1; |
1006 | 1006 | } |
1007 | 1007 | |
r18027 | r18028 | |
1012 | 1012 | |
1013 | 1013 | DRIVER_INIT_MEMBER(fastfred_state,fastfred) |
1014 | 1014 | { |
1015 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xc800, 0xcfff, read8_delegate(FUNC(fastfred_state::fastfred_custom_io_r),this)); | |
1016 | machine().device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff); | |
1015 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xc800, 0xcfff, read8_delegate(FUNC(fastfred_state::fastfred_custom_io_r),this)); | |
1016 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write(0xc800, 0xcfff); | |
1017 | 1017 | m_hardware_type = 1; |
1018 | 1018 | } |
1019 | 1019 | |
1020 | 1020 | DRIVER_INIT_MEMBER(fastfred_state,jumpcoas) |
1021 | 1021 | { |
1022 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xc800, 0xcfff, read8_delegate(FUNC(fastfred_state::jumpcoas_custom_io_r),this)); | |
1023 | machine().device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff); | |
1022 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xc800, 0xcfff, read8_delegate(FUNC(fastfred_state::jumpcoas_custom_io_r),this)); | |
1023 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write(0xc800, 0xcfff); | |
1024 | 1024 | m_hardware_type = 0; |
1025 | 1025 | } |
1026 | 1026 | |
1027 | 1027 | DRIVER_INIT_MEMBER(fastfred_state,boggy84b) |
1028 | 1028 | { |
1029 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xc800, 0xcfff, read8_delegate(FUNC(fastfred_state::jumpcoas_custom_io_r),this)); | |
1030 | machine().device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff); | |
1029 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xc800, 0xcfff, read8_delegate(FUNC(fastfred_state::jumpcoas_custom_io_r),this)); | |
1030 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write(0xc800, 0xcfff); | |
1031 | 1031 | m_hardware_type = 2; |
1032 | 1032 | } |
1033 | 1033 | |
1034 | 1034 | DRIVER_INIT_MEMBER(fastfred_state,boggy84) |
1035 | 1035 | { |
1036 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xc800, 0xcfff, read8_delegate(FUNC(fastfred_state::boggy84_custom_io_r),this)); | |
1037 | machine().device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff); | |
1036 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xc800, 0xcfff, read8_delegate(FUNC(fastfred_state::boggy84_custom_io_r),this)); | |
1037 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write(0xc800, 0xcfff); | |
1038 | 1038 | m_hardware_type = 2; |
1039 | 1039 | } |
1040 | 1040 |
r18027 | r18028 | |
---|---|---|
327 | 327 | void atvtrack_state::machine_start() |
328 | 328 | { |
329 | 329 | UINT8 *src, *dst; |
330 | address_space *as; | |
331 | 330 | |
332 | 331 | nandaddressstep = 0; |
333 | 332 | nandregion = machine().root_device().memregion("maincpu"); |
334 | as = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
335 | dst = (UINT8 *)(as->get_write_ptr(0x0c7f0000)); | |
333 | address_space &as = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
334 | dst = (UINT8 *)(as.get_write_ptr(0x0c7f0000)); | |
336 | 335 | src = nandregion->base()+0x10; |
337 | 336 | // copy 0x10000 bytes from region "maincpu" offset 0x10 to 0x0c7f0000 |
338 | 337 | memcpy(dst, src, 0x10000); |
r18027 | r18028 | |
344 | 343 | // The routine initializes the cpu, copies the boot program from the flash memories into the cpu sdram |
345 | 344 | // and finally executes it. |
346 | 345 | // Here there is the setup of the cpu, the boot program is copied in machine_start |
347 | address_space &as = | |
346 | address_space &as = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
348 | 347 | // set cpu PC register to 0x0c7f0000 |
349 | 348 | machine().device("maincpu")->state().set_pc(0x0c7f0000); |
350 | 349 | // set BCR2 to 1 |
r18027 | r18028 | |
---|---|---|
10122 | 10122 | version of the game might be a bootleg with the protection |
10123 | 10123 | patched. (both sets need this) |
10124 | 10124 | */ |
10125 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
10125 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_read(0x60d4, 0x60d4); | |
10126 | 10126 | } |
10127 | 10127 | |
10128 | 10128 | /*************************************************************************** |
r18027 | r18028 | |
11387 | 11387 | |
11388 | 11388 | DRIVER_INIT_MEMBER(dynax_state,momotaro) |
11389 | 11389 | { |
11390 | machine().device("maincpu")->memory().space(AS_IO) | |
11390 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0xe0, 0xe0, read8_delegate(FUNC(dynax_state::momotaro_protection_r),this)); | |
11391 | 11391 | } |
11392 | 11392 | |
11393 | 11393 | GAME( 1992, mmpanic, 0, mmpanic, mmpanic, driver_device, 0, ROT0, "Nakanihon / East Technology (Taito license)", "Monkey Mole Panic (USA)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) |
r18027 | r18028 | |
---|---|---|
3838 | 3838 | DRIVER_INIT_MEMBER( kaneko16_shogwarr_state, brapboys ) |
3839 | 3839 | { |
3840 | 3840 | // sample banking is different on brap boys for the music, why? GALs / PALs ? |
3841 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
3841 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xe00000, 0xe00001, write16_delegate(FUNC(kaneko16_shogwarr_state::brapboys_oki_bank_w),this)); | |
3842 | 3842 | |
3843 | 3843 | // default sample banks |
3844 | 3844 | kaneko16_common_oki_bank_w(machine(), "bank10", "oki1", 0, 0x30000, 0x10000); |
r18027 | r18028 | |
---|---|---|
145 | 145 | |
146 | 146 | static void scanline_update(screen_device &screen, int scanline) |
147 | 147 | { |
148 | address_space &space = | |
148 | address_space &space = screen.machine().device("audiocpu")->memory().space(AS_PROGRAM); | |
149 | 149 | |
150 | 150 | /* sound IRQ is on 32V */ |
151 | 151 | if (scanline & 32) |
r18027 | r18028 | |
---|---|---|
1525 | 1525 | DRIVER_INIT_MEMBER(mcr3_state,demoderm) |
1526 | 1526 | { |
1527 | 1527 | mcr_common_init(machine()); |
1528 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x01, 0x01, read8_delegate(FUNC(mcr3_state::demoderm_ip1_r),this)); | |
1529 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x02, 0x02, read8_delegate(FUNC(mcr3_state::demoderm_ip2_r),this)); | |
1530 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x06, 0x06, write8_delegate(FUNC(mcr3_state::demoderm_op6_w),this)); | |
1528 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x01, 0x01, read8_delegate(FUNC(mcr3_state::demoderm_ip1_r),this)); | |
1529 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x02, 0x02, read8_delegate(FUNC(mcr3_state::demoderm_ip2_r),this)); | |
1530 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x06, 0x06, write8_delegate(FUNC(mcr3_state::demoderm_op6_w),this)); | |
1531 | 1531 | } |
1532 | 1532 | |
1533 | 1533 | |
1534 | 1534 | DRIVER_INIT_MEMBER(mcr3_state,sarge) |
1535 | 1535 | { |
1536 | 1536 | mcr_common_init(machine()); |
1537 | machine().device("maincpu")->memory().space(AS_IO) | |
1537 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x06, 0x06, write8_delegate(FUNC(midway_turbo_chip_squeak_device::write),m_turbo_chip_squeak.target())); | |
1538 | 1538 | } |
1539 | 1539 | |
1540 | 1540 | |
1541 | 1541 | DRIVER_INIT_MEMBER(mcr3_state,maxrpm) |
1542 | 1542 | { |
1543 | 1543 | mcr_common_init(machine()); |
1544 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x01, 0x01, read8_delegate(FUNC(mcr3_state::maxrpm_ip1_r),this)); | |
1545 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x02, 0x02, read8_delegate(FUNC(mcr3_state::maxrpm_ip2_r),this)); | |
1546 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x05, 0x05, write8_delegate(FUNC(mcr3_state::maxrpm_op5_w),this)); | |
1547 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x06, 0x06, write8_delegate(FUNC(mcr3_state::maxrpm_op6_w),this)); | |
1544 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x01, 0x01, read8_delegate(FUNC(mcr3_state::maxrpm_ip1_r),this)); | |
1545 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x02, 0x02, read8_delegate(FUNC(mcr3_state::maxrpm_ip2_r),this)); | |
1546 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x05, 0x05, write8_delegate(FUNC(mcr3_state::maxrpm_op5_w),this)); | |
1547 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x06, 0x06, write8_delegate(FUNC(mcr3_state::maxrpm_op6_w),this)); | |
1548 | 1548 | |
1549 | 1549 | state_save_register_global(machine(), m_maxrpm_adc_control); |
1550 | 1550 | state_save_register_global(machine(), m_maxrpm_adc_select); |
r18027 | r18028 | |
1557 | 1557 | DRIVER_INIT_MEMBER(mcr3_state,rampage) |
1558 | 1558 | { |
1559 | 1559 | mcr_common_init(machine()); |
1560 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x04, 0x04, read8_delegate(FUNC(mcr3_state::rampage_ip4_r),this)); | |
1561 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x06, 0x06, write8_delegate(FUNC(mcr3_state::rampage_op6_w),this)); | |
1560 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x04, 0x04, read8_delegate(FUNC(mcr3_state::rampage_ip4_r),this)); | |
1561 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x06, 0x06, write8_delegate(FUNC(mcr3_state::rampage_op6_w),this)); | |
1562 | 1562 | } |
1563 | 1563 | |
1564 | 1564 | |
1565 | 1565 | DRIVER_INIT_MEMBER(mcr3_state,powerdrv) |
1566 | 1566 | { |
1567 | 1567 | mcr_common_init(machine()); |
1568 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x02, 0x02, read8_delegate(FUNC(mcr3_state::powerdrv_ip2_r),this)); | |
1569 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x05, 0x05, write8_delegate(FUNC(mcr3_state::powerdrv_op5_w),this)); | |
1570 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x06, 0x06, write8_delegate(FUNC(mcr3_state::powerdrv_op6_w),this)); | |
1568 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x02, 0x02, read8_delegate(FUNC(mcr3_state::powerdrv_ip2_r),this)); | |
1569 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x05, 0x05, write8_delegate(FUNC(mcr3_state::powerdrv_op5_w),this)); | |
1570 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x06, 0x06, write8_delegate(FUNC(mcr3_state::powerdrv_op6_w),this)); | |
1571 | 1571 | } |
1572 | 1572 | |
1573 | 1573 | |
1574 | 1574 | DRIVER_INIT_MEMBER(mcr3_state,stargrds) |
1575 | 1575 | { |
1576 | 1576 | mcr_common_init(machine()); |
1577 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x00, 0x00, read8_delegate(FUNC(mcr3_state::stargrds_ip0_r),this)); | |
1578 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x05, 0x05, write8_delegate(FUNC(mcr3_state::stargrds_op5_w),this)); | |
1579 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x06, 0x06, write8_delegate(FUNC(mcr3_state::stargrds_op6_w),this)); | |
1577 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x00, 0x00, read8_delegate(FUNC(mcr3_state::stargrds_ip0_r),this)); | |
1578 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x05, 0x05, write8_delegate(FUNC(mcr3_state::stargrds_op5_w),this)); | |
1579 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x06, 0x06, write8_delegate(FUNC(mcr3_state::stargrds_op6_w),this)); | |
1580 | 1580 | } |
1581 | 1581 | |
1582 | 1582 | |
r18027 | r18028 | |
1615 | 1615 | machine().device<cpu_device>("csd:cpu")->suspend(SUSPEND_REASON_DISABLE, 1); |
1616 | 1616 | |
1617 | 1617 | /* kludge for bad ROM read */ |
1618 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1618 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0b53, 0x0b53, read8_delegate(FUNC(mcr3_state::turbotag_kludge_r),this)); | |
1619 | 1619 | } |
1620 | 1620 | |
1621 | 1621 |
r18027 | r18028 | |
---|---|---|
2026 | 2026 | |
2027 | 2027 | DRIVER_INIT_MEMBER(viper_state,viper) |
2028 | 2028 | { |
2029 | // machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2029 | // machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler( *ide, 0xff200000, 0xff207fff, FUNC(hdd_r), FUNC(hdd_w) ); //TODO | |
2030 | 2030 | } |
2031 | 2031 | |
2032 | 2032 | DRIVER_INIT_MEMBER(viper_state,vipercf) |
2033 | 2033 | { |
2034 | 2034 | DRIVER_INIT_CALL(viper); |
2035 | 2035 | |
2036 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xff000000, 0xff000fff, read64_delegate(FUNC(viper_state::cf_card_data_r), this), write64_delegate(FUNC(viper_state::cf_card_data_w), this) ); | |
2037 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xff200000, 0xff200fff, read64_delegate(FUNC(viper_state::cf_card_r), this), write64_delegate(FUNC(viper_state::cf_card_w), this) ); | |
2036 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xff000000, 0xff000fff, read64_delegate(FUNC(viper_state::cf_card_data_r), this), write64_delegate(FUNC(viper_state::cf_card_data_w), this) ); | |
2037 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xff200000, 0xff200fff, read64_delegate(FUNC(viper_state::cf_card_r), this), write64_delegate(FUNC(viper_state::cf_card_w), this) ); | |
2038 | 2038 | } |
2039 | 2039 | |
2040 | 2040 |
r18027 | r18028 | |
---|---|---|
453 | 453 | break; |
454 | 454 | |
455 | 455 | case 3: |
456 | { | |
457 | address_space &vdp_space = machine().device<janshi_vdp_device>("janshivdp")->space(); | |
456 | 458 | |
457 | address_space *vdp_space = machine().device<janshi_vdp_device>("janshivdp")->space(); | |
458 | ||
459 | 459 | if (LOG_VRAM) printf("%02x ", data); |
460 | 460 | m_prev_writes++; |
461 | 461 | m_vram_addr++; |
462 | 462 | |
463 | vdp_space | |
463 | vdp_space.write_byte(m_vram_addr, data); | |
464 | 464 | break; |
465 | } | |
465 | 466 | } |
466 | 467 | } |
467 | 468 | |
r18027 | r18028 | |
1250 | 1251 | |
1251 | 1252 | DRIVER_INIT_MEMBER(pinkiri8_state,ronjan) |
1252 | 1253 | { |
1253 | machine().device("maincpu")->memory().space(AS_IO)->install_readwrite_handler(0x90, 0x90, read8_delegate(FUNC(pinkiri8_state::ronjan_prot_r), this), write8_delegate(FUNC(pinkiri8_state::ronjan_prot_w), this)); | |
1254 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x66, 0x66, read8_delegate(FUNC(pinkiri8_state::ronjan_prot_status_r), this)); | |
1255 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x9f, 0x9f, read8_delegate(FUNC(pinkiri8_state::ronjan_patched_prot_r), this)); | |
1254 | machine().device("maincpu")->memory().space(AS_IO).install_readwrite_handler(0x90, 0x90, read8_delegate(FUNC(pinkiri8_state::ronjan_prot_r), this), write8_delegate(FUNC(pinkiri8_state::ronjan_prot_w), this)); | |
1255 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x66, 0x66, read8_delegate(FUNC(pinkiri8_state::ronjan_prot_status_r), this)); | |
1256 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x9f, 0x9f, read8_delegate(FUNC(pinkiri8_state::ronjan_patched_prot_r), this)); | |
1256 | 1257 | } |
1257 | 1258 | |
1258 | 1259 | GAME( 1992, janshi, 0, pinkiri8, janshi, driver_device, 0, ROT0, "Eagle", "Janshi", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING ) |
r18027 | r18028 | |
---|---|---|
81 | 81 | /* Non encrypted bootleg */ |
82 | 82 | DRIVER_INIT_MEMBER(suna8_state,hardhedb) |
83 | 83 | { |
84 | address_space &space = | |
84 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
85 | 85 | space.set_decrypted_region(0x0000, 0x7fff, machine().root_device().memregion("maincpu")->base() + 0x48000); |
86 | 86 | machine().root_device().membank("bank1")->configure_entries(0, 16, machine().root_device().memregion("maincpu")->base() + 0x10000, 0x4000); |
87 | 87 | } |
r18027 | r18028 | |
92 | 92 | |
93 | 93 | static UINT8 *brickzn_decrypt(running_machine &machine) |
94 | 94 | { |
95 | address_space &space = | |
95 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
96 | 96 | UINT8 *RAM = machine.root_device().memregion("maincpu")->base(); |
97 | 97 | size_t size = machine.root_device().memregion("maincpu")->bytes(); |
98 | 98 | UINT8 *decrypt = auto_alloc_array(machine, UINT8, size); |
r18027 | r18028 | |
222 | 222 | |
223 | 223 | DRIVER_INIT_MEMBER(suna8_state,hardhea2) |
224 | 224 | { |
225 | address_space &space = | |
225 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
226 | 226 | UINT8 *RAM = machine().root_device().memregion("maincpu")->base(); |
227 | 227 | size_t size = machine().root_device().memregion("maincpu")->bytes(); |
228 | 228 | UINT8 *decrypt = auto_alloc_array(machine(), UINT8, size); |
r18027 | r18028 | |
309 | 309 | |
310 | 310 | DRIVER_INIT_MEMBER(suna8_state,starfigh) |
311 | 311 | { |
312 | address_space &space = | |
312 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
313 | 313 | UINT8 *RAM = machine().root_device().memregion("maincpu")->base(); |
314 | 314 | size_t size = machine().root_device().memregion("maincpu")->bytes(); |
315 | 315 | UINT8 *decrypt = auto_alloc_array(machine(), UINT8, size); |
r18027 | r18028 | |
377 | 377 | |
378 | 378 | DRIVER_INIT_MEMBER(suna8_state,sparkman) |
379 | 379 | { |
380 | address_space &space = | |
380 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
381 | 381 | UINT8 *RAM = machine().root_device().memregion("maincpu")->base(); |
382 | 382 | size_t size = machine().root_device().memregion("maincpu")->bytes(); |
383 | 383 | UINT8 *decrypt = auto_alloc_array(machine(), UINT8, size); |
r18027 | r18028 | |
1832 | 1832 | |
1833 | 1833 | MACHINE_RESET_MEMBER(suna8_state,hardhea2) |
1834 | 1834 | { |
1835 | address_space &space = | |
1835 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1836 | 1836 | hardhea2_rambank_0_w(space,0,0); |
1837 | 1837 | } |
1838 | 1838 |
r18027 | r18028 | |
---|---|---|
2038 | 2038 | |
2039 | 2039 | static void decrypt_C10707_cpu(running_machine &machine, const char *cputag) |
2040 | 2040 | { |
2041 | address_space &space = | |
2041 | address_space &space = machine.device(cputag)->memory().space(AS_PROGRAM); | |
2042 | 2042 | UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x10000); |
2043 | 2043 | UINT8 *rom = machine.root_device().memregion(cputag)->base(); |
2044 | 2044 | offs_t addr; |
r18027 | r18028 | |
2068 | 2068 | |
2069 | 2069 | static void init_rom1(running_machine &machine) |
2070 | 2070 | { |
2071 | address_space &space = | |
2071 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
2072 | 2072 | UINT8 *rom = machine.root_device().memregion("maincpu")->base(); |
2073 | 2073 | |
2074 | 2074 | decrypted = auto_alloc_array(machine, UINT8, 0x10000); |
r18027 | r18028 | |
2136 | 2136 | { |
2137 | 2137 | decrypt_C10707_cpu(machine(), "maincpu"); |
2138 | 2138 | |
2139 | machine().device("audiocpu")->memory().space(AS_PROGRAM) | |
2139 | machine().device("audiocpu")->memory().space(AS_PROGRAM).install_read_bank(0x0200, 0x0fff, "bank10"); | |
2140 | 2140 | membank("bank10")->set_base(memregion("audiocpu")->base() + 0xe200); |
2141 | 2141 | m_audio_nmi_enable_type = AUDIO_ENABLE_DIRECT; |
2142 | 2142 | } |
r18027 | r18028 | |
2151 | 2151 | { |
2152 | 2152 | decrypt_C10707_cpu(machine(), "maincpu"); |
2153 | 2153 | |
2154 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2154 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xc15f, 0xc15f, read8_delegate(FUNC(btime_state::wtennis_reset_hack_r),this)); | |
2155 | 2155 | |
2156 | machine().device("audiocpu")->memory().space(AS_PROGRAM) | |
2156 | machine().device("audiocpu")->memory().space(AS_PROGRAM).install_read_bank(0x0200, 0x0fff, "bank10"); | |
2157 | 2157 | membank("bank10")->set_base(memregion("audiocpu")->base() + 0xe200); |
2158 | 2158 | m_audio_nmi_enable_type = AUDIO_ENABLE_AY8910; |
2159 | 2159 | } |
r18027 | r18028 | |
---|---|---|
1013 | 1013 | state->m_pending_command = 0; |
1014 | 1014 | state->m_mcu_data = 0; |
1015 | 1015 | |
1016 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x20008a, 0x20008b, write16_delegate(FUNC(gstriker_state::twrldc94_mcu_w),state)); | |
1017 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x20008a, 0x20008b, read16_delegate(FUNC(gstriker_state::twrldc94_mcu_r),state)); | |
1016 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x20008a, 0x20008b, write16_delegate(FUNC(gstriker_state::twrldc94_mcu_w),state)); | |
1017 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x20008a, 0x20008b, read16_delegate(FUNC(gstriker_state::twrldc94_mcu_r),state)); | |
1018 | 1018 | |
1019 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x20008e, 0x20008f, write16_delegate(FUNC(gstriker_state::twrldc94_prot_reg_w),state)); | |
1020 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x20008e, 0x20008f, read16_delegate(FUNC(gstriker_state::twrldc94_prot_reg_r),state)); | |
1019 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x20008e, 0x20008f, write16_delegate(FUNC(gstriker_state::twrldc94_prot_reg_w),state)); | |
1020 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x20008e, 0x20008f, read16_delegate(FUNC(gstriker_state::twrldc94_prot_reg_r),state)); | |
1021 | 1021 | } |
1022 | 1022 | |
1023 | 1023 | DRIVER_INIT_MEMBER(gstriker_state,twrldc94) |
r18027 | r18028 | |
1037 | 1037 | m_gametype = 3; |
1038 | 1038 | mcu_init( machine() ); |
1039 | 1039 | |
1040 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x200090, 0x200091, write16_delegate(FUNC(gstriker_state::vbl_toggle_w),this)); // vblank toggle | |
1041 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x200090, 0x200091, read16_delegate(FUNC(gstriker_state::vbl_toggle_r),this)); | |
1040 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x200090, 0x200091, write16_delegate(FUNC(gstriker_state::vbl_toggle_w),this)); // vblank toggle | |
1041 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x200090, 0x200091, read16_delegate(FUNC(gstriker_state::vbl_toggle_r),this)); | |
1042 | 1042 | } |
1043 | 1043 | |
1044 | 1044 | /*** GAME DRIVERS ************************************************************/ |
r18027 | r18028 | |
---|---|---|
6266 | 6266 | DRIVER_INIT_MEMBER(snk_state,countryc) |
6267 | 6267 | { |
6268 | 6268 | // replace coin counter with trackball select |
6269 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
6269 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xc300, 0xc300, write8_delegate(FUNC(snk_state::countryc_trackball_w),this)); | |
6270 | 6270 | } |
6271 | 6271 | |
6272 | 6272 |
r18027 | r18028 | |
---|---|---|
1201 | 1201 | |
1202 | 1202 | DRIVER_INIT_MEMBER(highvdeo_state,ciclone) |
1203 | 1203 | { |
1204 | machine().device("maincpu")->memory().space(AS_IO) | |
1204 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x0030, 0x0033, read16_delegate(FUNC(highvdeo_state::ciclone_status_r), this)); | |
1205 | 1205 | } |
1206 | 1206 | |
1207 | 1207 | /* |
r18027 | r18028 | |
1271 | 1271 | |
1272 | 1272 | DRIVER_INIT_MEMBER(highvdeo_state,fashion) |
1273 | 1273 | { |
1274 | machine().device("maincpu")->memory().space(AS_IO) | |
1274 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x0002, 0x0003, write16_delegate(FUNC(highvdeo_state::fashion_output_w), this)); | |
1275 | 1275 | } |
1276 | 1276 | |
1277 | 1277 | GAMEL( 2000, tour4000, 0, tv_vcf, tv_vcf, driver_device, 0, ROT0, "High Video", "Tour 4000", 0, layout_fashion ) |
r18027 | r18028 | |
---|---|---|
539 | 539 | // AM_RANGE(0xd806, 0xd806) AM_READ_LEGACY(protection_r) /* protection data read (pettanp) */ |
540 | 540 | |
541 | 541 | /* Fujitsu MB8841 4-Bit MCU */ |
542 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xd806, 0xd806, read8_delegate(FUNC(strnskil_state::pettanp_protection_r),this)); | |
543 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xd80d, 0xd80d, write8_delegate(FUNC(strnskil_state::protection_w),this)); | |
542 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xd806, 0xd806, read8_delegate(FUNC(strnskil_state::pettanp_protection_r),this)); | |
543 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xd80d, 0xd80d, write8_delegate(FUNC(strnskil_state::protection_w),this)); | |
544 | 544 | |
545 | 545 | } |
546 | 546 | |
547 | 547 | DRIVER_INIT_MEMBER(strnskil_state,banbam) |
548 | 548 | { |
549 | 549 | /* Fujitsu MB8841 4-Bit MCU */ |
550 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xd806, 0xd806, read8_delegate(FUNC(strnskil_state::banbam_protection_r),this)); | |
551 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xd80d, 0xd80d, write8_delegate(FUNC(strnskil_state::protection_w),this)); | |
550 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xd806, 0xd806, read8_delegate(FUNC(strnskil_state::banbam_protection_r),this)); | |
551 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xd80d, 0xd80d, write8_delegate(FUNC(strnskil_state::protection_w),this)); | |
552 | 552 | } |
553 | 553 | |
554 | 554 | GAME( 1984, strnskil, 0, strnskil, strnskil, driver_device, 0, ROT0, "Sun Electronics", "Strength & Skill", 0 ) |
r18027 | r18028 | |
---|---|---|
411 | 411 | |
412 | 412 | INPUT_CHANGED_MEMBER(cosmic_state::panic_coin_inserted) |
413 | 413 | { |
414 | panic_sound_output_w( | |
414 | panic_sound_output_w(machine().device("maincpu")->memory().space(AS_PROGRAM), 17, newval == 0); | |
415 | 415 | } |
416 | 416 | |
417 | 417 | static INPUT_PORTS_START( panic ) |
r18027 | r18028 | |
1538 | 1538 | |
1539 | 1539 | DRIVER_INIT_MEMBER(cosmic_state,devzone) |
1540 | 1540 | { |
1541 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1541 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x4807, 0x4807,write8_delegate(FUNC(cosmic_state::cosmic_background_enable_w),this)); | |
1542 | 1542 | } |
1543 | 1543 | |
1544 | 1544 | |
1545 | 1545 | DRIVER_INIT_MEMBER(cosmic_state,nomnlnd) |
1546 | 1546 | { |
1547 | 1547 | dac_device *dac = machine().device<dac_device>("dac"); |
1548 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x5000, 0x5001, read8_delegate(FUNC(cosmic_state::nomnlnd_port_0_1_r),this)); | |
1549 | machine().device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x4800, 0x4800); | |
1550 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x4807, 0x4807, write8_delegate(FUNC(cosmic_state::cosmic_background_enable_w),this)); | |
1551 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x480a, 0x480a, write8_delegate(FUNC(dac_device::write_unsigned8),dac)); | |
1548 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x5000, 0x5001, read8_delegate(FUNC(cosmic_state::nomnlnd_port_0_1_r),this)); | |
1549 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write(0x4800, 0x4800); | |
1550 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x4807, 0x4807, write8_delegate(FUNC(cosmic_state::cosmic_background_enable_w),this)); | |
1551 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x480a, 0x480a, write8_delegate(FUNC(dac_device::write_unsigned8),dac)); | |
1552 | 1552 | } |
1553 | 1553 | |
1554 | 1554 | DRIVER_INIT_MEMBER(cosmic_state,panic) |
r18027 | r18028 | |
---|---|---|
5224 | 5224 | |
5225 | 5225 | DRIVER_INIT_MEMBER(model2_state,genprot) |
5226 | 5226 | { |
5227 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5227 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::model2_prot_r),this), write32_delegate(FUNC(model2_state::model2_prot_w),this)); | |
5228 | 5228 | m_protstate = m_protpos = 0; |
5229 | 5229 | } |
5230 | 5230 | |
r18027 | r18028 | |
5232 | 5232 | { |
5233 | 5233 | UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); |
5234 | 5234 | |
5235 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5235 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::model2_prot_r),this), write32_delegate(FUNC(model2_state::model2_prot_w),this)); | |
5236 | 5236 | m_protstate = m_protpos = 0; |
5237 | 5237 | |
5238 | 5238 | // fix bug in program: it destroys the interrupt table and never fixes it |
r18027 | r18028 | |
5243 | 5243 | { |
5244 | 5244 | UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); |
5245 | 5245 | |
5246 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5246 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::model2_prot_r),this), write32_delegate(FUNC(model2_state::model2_prot_w),this)); | |
5247 | 5247 | m_protstate = m_protpos = 0; |
5248 | 5248 | |
5249 | 5249 | // fix bug in program: it destroys the interrupt table and never fixes it |
r18027 | r18028 | |
5252 | 5252 | |
5253 | 5253 | DRIVER_INIT_MEMBER(model2_state,daytonam) |
5254 | 5254 | { |
5255 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5255 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x240000, 0x24ffff, read32_delegate(FUNC(model2_state::maxx_r),this)); | |
5256 | 5256 | } |
5257 | 5257 | |
5258 | 5258 | /* very crude support for let the game set itself into stand-alone mode */ |
r18027 | r18028 | |
5285 | 5285 | { |
5286 | 5286 | UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); |
5287 | 5287 | |
5288 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::model2_prot_r),this), write32_delegate(FUNC(model2_state::model2_prot_w),this)); | |
5289 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x01a10000, 0x01a1ffff, read32_delegate(FUNC(model2_state::jaleco_network_r),this), write32_delegate(FUNC(model2_state::jaleco_network_w),this)); | |
5288 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::model2_prot_r),this), write32_delegate(FUNC(model2_state::model2_prot_w),this)); | |
5289 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x01a10000, 0x01a1ffff, read32_delegate(FUNC(model2_state::jaleco_network_r),this), write32_delegate(FUNC(model2_state::jaleco_network_w),this)); | |
5290 | 5290 | |
5291 | 5291 | m_protstate = m_protpos = 0; |
5292 | 5292 | |
r18027 | r18028 | |
5296 | 5296 | |
5297 | 5297 | DRIVER_INIT_MEMBER(model2_state,overrev) |
5298 | 5298 | { |
5299 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5299 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x01a10000, 0x01a1ffff, read32_delegate(FUNC(model2_state::jaleco_network_r),this), write32_delegate(FUNC(model2_state::jaleco_network_w),this)); | |
5300 | 5300 | |
5301 | 5301 | //TODO: cache patch? |
5302 | 5302 | } |
r18027 | r18028 | |
5306 | 5306 | { |
5307 | 5307 | UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); |
5308 | 5308 | |
5309 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5309 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::model2_prot_r),this), write32_delegate(FUNC(model2_state::model2_prot_w),this)); | |
5310 | 5310 | m_protstate = m_protpos = 0; |
5311 | 5311 | |
5312 | 5312 | ROM[0x630/4] = 0x08000004; |
r18027 | r18028 | |
5315 | 5315 | |
5316 | 5316 | DRIVER_INIT_MEMBER(model2_state,rchase2) |
5317 | 5317 | { |
5318 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5318 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x01c00008, 0x01c0000b, write32_delegate(FUNC(model2_state::rchase2_devices_w),this)); | |
5319 | 5319 | } |
5320 | 5320 | |
5321 | 5321 | DRIVER_INIT_MEMBER(model2_state,srallyc) |
5322 | 5322 | { |
5323 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5323 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x01c00008, 0x01c0000b, write32_delegate(FUNC(model2_state::srallyc_devices_w),this)); | |
5324 | 5324 | } |
5325 | 5325 | |
5326 | 5326 |
r18027 | r18028 | |
---|---|---|
711 | 711 | leland_rotate_memory(machine(), "slave"); |
712 | 712 | |
713 | 713 | /* set up additional input ports */ |
714 | machine().device("master")->memory().space(AS_IO) | |
714 | machine().device("master")->memory().space(AS_IO).install_read_handler(0x00, 0x03, read8_delegate(FUNC(leland_state::ataxx_trackball_r),this)); | |
715 | 715 | } |
716 | 716 | |
717 | 717 | |
r18027 | r18028 | |
721 | 721 | leland_rotate_memory(machine(), "slave"); |
722 | 722 | |
723 | 723 | /* set up additional input ports */ |
724 | machine().device("master")->memory().space(AS_IO) | |
724 | machine().device("master")->memory().space(AS_IO).install_read_handler(0x00, 0x03, read8_delegate(FUNC(leland_state::ataxx_trackball_r),this)); | |
725 | 725 | } |
726 | 726 | |
727 | 727 | |
r18027 | r18028 | |
731 | 731 | leland_rotate_memory(machine(), "slave"); |
732 | 732 | |
733 | 733 | /* set up additional input ports */ |
734 | machine().device("master")->memory().space(AS_IO)->install_read_port(0x0d, 0x0d, "P1_P2"); | |
735 | machine().device("master")->memory().space(AS_IO)->install_read_port(0x0e, 0x0e, "P3_P4"); | |
736 | machine().device("master")->memory().space(AS_IO)->install_read_port(0x0f, 0x0f, "BUTTONS"); | |
734 | machine().device("master")->memory().space(AS_IO).install_read_port(0x0d, 0x0d, "P1_P2"); | |
735 | machine().device("master")->memory().space(AS_IO).install_read_port(0x0e, 0x0e, "P3_P4"); | |
736 | machine().device("master")->memory().space(AS_IO).install_read_port(0x0f, 0x0f, "BUTTONS"); | |
737 | 737 | } |
738 | 738 | |
739 | 739 | |
r18027 | r18028 | |
743 | 743 | leland_rotate_memory(machine(), "slave"); |
744 | 744 | |
745 | 745 | /* set up additional input ports */ |
746 | machine().device("master")->memory().space(AS_IO)->install_read_handler(0x00, 0x02, read8_delegate(FUNC(leland_state::indyheat_wheel_r),this)); | |
747 | machine().device("master")->memory().space(AS_IO)->install_read_handler(0x08, 0x0b, read8_delegate(FUNC(leland_state::indyheat_analog_r),this)); | |
748 | machine().device("master")->memory().space(AS_IO)->install_read_port(0x0d, 0x0d, "P1"); | |
749 | machine().device("master")->memory().space(AS_IO)->install_read_port(0x0e, 0x0e, "P2"); | |
750 | machine().device("master")->memory().space(AS_IO)->install_read_port(0x0f, 0x0f, "P3"); | |
746 | machine().device("master")->memory().space(AS_IO).install_read_handler(0x00, 0x02, read8_delegate(FUNC(leland_state::indyheat_wheel_r),this)); | |
747 | machine().device("master")->memory().space(AS_IO).install_read_handler(0x08, 0x0b, read8_delegate(FUNC(leland_state::indyheat_analog_r),this)); | |
748 | machine().device("master")->memory().space(AS_IO).install_read_port(0x0d, 0x0d, "P1"); | |
749 | machine().device("master")->memory().space(AS_IO).install_read_port(0x0e, 0x0e, "P2"); | |
750 | machine().device("master")->memory().space(AS_IO).install_read_port(0x0f, 0x0f, "P3"); | |
751 | 751 | |
752 | 752 | /* set up additional output ports */ |
753 | machine().device("master")->memory().space(AS_IO) | |
753 | machine().device("master")->memory().space(AS_IO).install_write_handler(0x08, 0x0b, write8_delegate(FUNC(leland_state::indyheat_analog_w),this)); | |
754 | 754 | } |
755 | 755 | |
756 | 756 | |
r18027 | r18028 | |
760 | 760 | leland_rotate_memory(machine(), "slave"); |
761 | 761 | |
762 | 762 | /* set up additional input ports */ |
763 | machine().device("master")->memory().space(AS_IO)->install_read_port(0x0d, 0x0d, "P2"); | |
764 | machine().device("master")->memory().space(AS_IO)->install_read_port(0x0e, 0x0e, "P1"); | |
765 | machine().device("master")->memory().space(AS_IO)->install_read_port(0x0f, 0x0f, "P3"); | |
763 | machine().device("master")->memory().space(AS_IO).install_read_port(0x0d, 0x0d, "P2"); | |
764 | machine().device("master")->memory().space(AS_IO).install_read_port(0x0e, 0x0e, "P1"); | |
765 | machine().device("master")->memory().space(AS_IO).install_read_port(0x0f, 0x0f, "P3"); | |
766 | 766 | } |
767 | 767 | |
768 | 768 | |
r18027 | r18028 | |
772 | 772 | leland_rotate_memory(machine(), "slave"); |
773 | 773 | |
774 | 774 | /* asylum appears to have some extra RAM for the slave CPU */ |
775 | machine().device("slave")->memory().space(AS_PROGRAM) | |
775 | machine().device("slave")->memory().space(AS_PROGRAM).install_ram(0xf000, 0xfffb); | |
776 | 776 | |
777 | 777 | /* set up additional input ports */ |
778 | machine().device("master")->memory().space(AS_IO)->install_read_port(0x0d, 0x0d, "P2"); | |
779 | machine().device("master")->memory().space(AS_IO)->install_read_port(0x0e, 0x0e, "P1"); | |
780 | machine().device("master")->memory().space(AS_IO)->install_read_port(0x0f, 0x0f, "P3"); | |
778 | machine().device("master")->memory().space(AS_IO).install_read_port(0x0d, 0x0d, "P2"); | |
779 | machine().device("master")->memory().space(AS_IO).install_read_port(0x0e, 0x0e, "P1"); | |
780 | machine().device("master")->memory().space(AS_IO).install_read_port(0x0f, 0x0f, "P3"); | |
781 | 781 | } |
782 | 782 | |
783 | 783 |
r18027 | r18028 | |
---|---|---|
640 | 640 | |
641 | 641 | DRIVER_INIT_MEMBER(gstream_state,gstream) |
642 | 642 | { |
643 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
643 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xd1ee0, 0xd1ee3, read32_delegate(FUNC(gstream_state::gstream_speedup_r), this)); | |
644 | 644 | } |
645 | 645 | |
646 | 646 |
r18027 | r18028 | |
---|---|---|
8142 | 8142 | |
8143 | 8143 | save_item(NAME(m_readpaddle)); |
8144 | 8144 | |
8145 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
8145 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x804000, 0x804001, FUNC(joy_or_paddle_r)); | |
8146 | 8146 | } |
8147 | 8147 | |
8148 | 8148 | static READ16_HANDLER( gigaman2_dummyqsound_r ) |
r18027 | r18028 | |
8176 | 8176 | |
8177 | 8177 | DRIVER_INIT_MEMBER(cps_state,gigaman2) |
8178 | 8178 | { |
8179 | address_space &space = | |
8179 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
8180 | 8180 | UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); |
8181 | 8181 | int length = memregion("maincpu")->bytes(); |
8182 | 8182 | |
r18027 | r18028 | |
8187 | 8187 | m_gigaman2_dummyqsound_ram = auto_alloc_array(machine(), UINT16, 0x20000 / 2); |
8188 | 8188 | save_pointer(NAME(m_gigaman2_dummyqsound_ram), 0x20000 / 2); |
8189 | 8189 | |
8190 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
8190 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x618000, 0x619fff, FUNC(gigaman2_dummyqsound_r), FUNC(gigaman2_dummyqsound_w)); // no qsound.. | |
8191 | 8191 | space.set_decrypted_region(0x000000, (length) - 1, &rom[length/4]); |
8192 | 8192 | m68k_set_encrypted_opcode_range(machine().device("maincpu"), 0, length); |
8193 | 8193 | } |
r18027 | r18028 | |
---|---|---|
797 | 797 | starzan_decrypt(data, size, false); // data |
798 | 798 | starzan_decrypt(code, size, true); // opcodes |
799 | 799 | |
800 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
800 | machine().device("maincpu")->memory().space(AS_PROGRAM).set_decrypted_region(0x00000, 0x3ffff, code); | |
801 | 801 | |
802 | 802 | mgcs_flip_sprites(machine()); |
803 | 803 | } |
r18027 | r18028 | |
3393 | 3393 | MACHINE_RESET_MEMBER(igs017_state,lhzb2a) |
3394 | 3394 | { |
3395 | 3395 | MACHINE_RESET_CALL_MEMBER( mgcs ); |
3396 | lhzb2a_input_addr_w( | |
3396 | lhzb2a_input_addr_w(m_maincpu->space(AS_PROGRAM), 0, 0xf0); | |
3397 | 3397 | } |
3398 | 3398 | |
3399 | 3399 | static MACHINE_CONFIG_START( lhzb2a, igs017_state ) |
r18027 | r18028 | |
---|---|---|
1318 | 1318 | static void system11gun_install( running_machine &machine ) |
1319 | 1319 | { |
1320 | 1320 | namcos12_state *state = machine.driver_data<namcos12_state>(); |
1321 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x1f788000, 0x1f788003, write32_delegate(FUNC(namcos12_state::system11gun_w),state)); | |
1322 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler (0x1f780000, 0x1f78000f, read32_delegate(FUNC(namcos12_state::system11gun_r),state)); | |
1321 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x1f788000, 0x1f788003, write32_delegate(FUNC(namcos12_state::system11gun_w),state)); | |
1322 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler (0x1f780000, 0x1f78000f, read32_delegate(FUNC(namcos12_state::system11gun_r),state)); | |
1323 | 1323 | } |
1324 | 1324 | |
1325 | 1325 | WRITE32_MEMBER(namcos12_state::kcoff_w) |
r18027 | r18028 | |
1386 | 1386 | |
1387 | 1387 | MACHINE_RESET_MEMBER(namcos12_state,namcos12) |
1388 | 1388 | { |
1389 | address_space &space = | |
1389 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1390 | 1390 | bankoffset_w(space,0,0,0xffffffff); |
1391 | 1391 | |
1392 | 1392 | space.install_write_handler(0x1f801000, 0x1f801003, write32_delegate(FUNC(namcos12_state::s12_dma_bias_w),this)); |
r18027 | r18028 | |
---|---|---|
1363 | 1363 | |
1364 | 1364 | DRIVER_INIT_MEMBER(jangou_state,jngolady) |
1365 | 1365 | { |
1366 | machine().device("nsc")->memory().space(AS_PROGRAM) | |
1366 | machine().device("nsc")->memory().space(AS_PROGRAM).install_read_handler(0x08, 0x08, read8_delegate(FUNC(jangou_state::jngolady_rng_r),this) ); | |
1367 | 1367 | } |
1368 | 1368 | |
1369 | 1369 | DRIVER_INIT_MEMBER(jangou_state,luckygrl) |
r18027 | r18028 | |
---|---|---|
187 | 187 | |
188 | 188 | WRITE8_MEMBER(gameplan_state::r6532_soundlatch_w) |
189 | 189 | { |
190 | address_space *progspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
191 | soundlatch_byte_w(*progspace, 0, data); | |
190 | address_space &progspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
191 | soundlatch_byte_w(progspace, 0, data); | |
192 | 192 | } |
193 | 193 | |
194 | 194 |
r18027 | r18028 | |
---|---|---|
67 | 67 | { |
68 | 68 | case 0: |
69 | 69 | // BIOS |
70 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
70 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x3fff, "bank1" ); | |
71 | 71 | state->membank("bank1")->set_base(state->memregion("maincpu")->base()); |
72 | 72 | break; |
73 | 73 | |
74 | 74 | default: |
75 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
75 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_read(0x0000, 0x3fff); | |
76 | 76 | break; |
77 | 77 | } |
78 | 78 | |
r18027 | r18028 | |
81 | 81 | { |
82 | 82 | case 0: |
83 | 83 | // BIOS |
84 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x5fff, "bank21" ); | |
85 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x6000, 0x7fff, "bank22" ); | |
84 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x4000, 0x5fff, "bank21" ); | |
85 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x6000, 0x7fff, "bank22" ); | |
86 | 86 | state->membank("bank21")->set_base(machine.root_device().memregion("maincpu")->base() + 0x4000); |
87 | 87 | state->membank("bank22")->set_base(machine.root_device().memregion("maincpu")->base() + 0x4000 + 0x2000); |
88 | 88 | break; |
89 | 89 | |
90 | 90 | case 1: |
91 | 91 | // game |
92 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x5fff, "bank21" ); | |
93 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x6000, 0x7fff, "bank22" ); | |
92 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x4000, 0x5fff, "bank21" ); | |
93 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x6000, 0x7fff, "bank22" ); | |
94 | 94 | state->membank("bank21")->set_base(machine.root_device().memregion("game")->base() + state->m_mem_banks[0]*0x2000); |
95 | 95 | state->membank("bank22")->set_base(machine.root_device().memregion("game")->base() + state->m_mem_banks[1]*0x2000); |
96 | 96 | break; |
97 | 97 | |
98 | 98 | default: |
99 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
99 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_read(0x4000, 0x7fff); | |
100 | 100 | break; |
101 | 101 | } |
102 | 102 | |
r18027 | r18028 | |
105 | 105 | { |
106 | 106 | case 1: |
107 | 107 | // game |
108 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0x9fff, "bank31" ); | |
109 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xa000, 0xbfff, "bank32" ); | |
108 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x8000, 0x9fff, "bank31" ); | |
109 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xa000, 0xbfff, "bank32" ); | |
110 | 110 | state->membank("bank31")->set_base(machine.root_device().memregion("game")->base() + state->m_mem_banks[2]*0x2000); |
111 | 111 | state->membank("bank32")->set_base(machine.root_device().memregion("game")->base() + state->m_mem_banks[3]*0x2000); |
112 | 112 | break; |
113 | 113 | |
114 | 114 | default: |
115 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
115 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_read(0x8000, 0xbfff); | |
116 | 116 | break; |
117 | 117 | } |
118 | 118 | |
r18027 | r18028 | |
121 | 121 | { |
122 | 122 | case 3: |
123 | 123 | // RAM |
124 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
124 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xc000, 0xffff, "bank4" ); | |
125 | 125 | state->membank("bank4")->set_base(state->m_main_mem); |
126 | 126 | break; |
127 | 127 | |
128 | 128 | default: |
129 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
129 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_read(0xc000, 0xffff); | |
130 | 130 | break; |
131 | 131 | } |
132 | 132 | } |
r18027 | r18028 | |
---|---|---|
532 | 532 | atarijsa_init(machine(), "IN2", 0x0040); |
533 | 533 | |
534 | 534 | /* prepare the speedups */ |
535 | m_speedup_data = m_maincpu->space(AS_PROGRAM)->install_read_handler(0x00000ae8, 0x00000aeb, 0, 0, read32_delegate(FUNC(beathead_state::speedup_r), this)); | |
536 | m_movie_speedup_data = m_maincpu->space(AS_PROGRAM)->install_read_handler(0x00000804, 0x00000807, 0, 0, read32_delegate(FUNC(beathead_state::movie_speedup_r), this)); | |
535 | m_speedup_data = m_maincpu->space(AS_PROGRAM).install_read_handler(0x00000ae8, 0x00000aeb, 0, 0, read32_delegate(FUNC(beathead_state::speedup_r), this)); | |
536 | m_movie_speedup_data = m_maincpu->space(AS_PROGRAM).install_read_handler(0x00000804, 0x00000807, 0, 0, read32_delegate(FUNC(beathead_state::movie_speedup_r), this)); | |
537 | 537 | } |
538 | 538 | |
539 | 539 |
r18027 | r18028 | |
---|---|---|
137 | 137 | |
138 | 138 | UINT8 lastbank_state::ram_bank_r(UINT16 offset, UINT8 bank_num) |
139 | 139 | { |
140 | address_space *vdp_space = machine().device<tc0091lvc_device>("tc0091lvc")->space(); | |
141 | return vdp_space->read_byte(offset + (m_ram_bank[bank_num]) * 0x1000);; | |
140 | address_space &vdp_space = machine().device<tc0091lvc_device>("tc0091lvc")->space(); | |
141 | return vdp_space.read_byte(offset + (m_ram_bank[bank_num]) * 0x1000);; | |
142 | 142 | } |
143 | 143 | |
144 | 144 | void lastbank_state::ram_bank_w(UINT16 offset, UINT8 data, UINT8 bank_num) |
145 | 145 | { |
146 | address_space *vdp_space = machine().device<tc0091lvc_device>("tc0091lvc")->space(); | |
147 | vdp_space->write_byte(offset + (m_ram_bank[bank_num]) * 0x1000,data);; | |
146 | address_space &vdp_space = machine().device<tc0091lvc_device>("tc0091lvc")->space(); | |
147 | vdp_space.write_byte(offset + (m_ram_bank[bank_num]) * 0x1000,data);; | |
148 | 148 | } |
149 | 149 | |
150 | 150 | READ8_MEMBER(lastbank_state::lastbank_ram_0_r) { return ram_bank_r(offset, 0); } |
r18027 | r18028 | |
---|---|---|
1256 | 1256 | |
1257 | 1257 | DRIVER_INIT_MEMBER(qix_state,kram3) |
1258 | 1258 | { |
1259 | address_space *mainspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1260 | address_space *videospace = machine().device("videocpu")->memory().space(AS_PROGRAM); | |
1259 | address_space &mainspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1260 | address_space &videospace = machine().device("videocpu")->memory().space(AS_PROGRAM); | |
1261 | 1261 | //const UINT8 *patch; |
1262 | 1262 | UINT8 *rom, *decrypted; |
1263 | 1263 | int i; |
r18027 | r18028 | |
1281 | 1281 | rom = machine().root_device().memregion("maincpu")->base(); |
1282 | 1282 | decrypted = auto_alloc_array(machine(), UINT8, 0x6000); |
1283 | 1283 | |
1284 | mainspace | |
1284 | mainspace.set_decrypted_region(0xa000, 0xffff, decrypted); | |
1285 | 1285 | |
1286 | 1286 | memcpy(decrypted,&rom[0xa000],0x6000); |
1287 | 1287 | for (i = 0xa000; i < 0x10000; ++i) |
r18027 | r18028 | |
1294 | 1294 | rom = machine().root_device().memregion("videocpu")->base(); |
1295 | 1295 | decrypted = auto_alloc_array(machine(), UINT8, 0x6000); |
1296 | 1296 | |
1297 | videospace | |
1297 | videospace.set_decrypted_region(0xa000, 0xffff, decrypted); | |
1298 | 1298 | |
1299 | 1299 | memcpy(decrypted,&rom[0xa000],0x6000); |
1300 | 1300 | for (i = 0xa000; i < 0x10000; ++i) |
r18027 | r18028 | |
---|---|---|
280 | 280 | adp_state *state = device->machine().driver_data<adp_state>(); |
281 | 281 | if (channel == 0) |
282 | 282 | { |
283 | state->m_microtouch->rx( | |
283 | state->m_microtouch->rx(device->machine().driver_data()->generic_space(), 0, data); | |
284 | 284 | } |
285 | 285 | } |
286 | 286 |
r18027 | r18028 | |
---|---|---|
662 | 662 | } |
663 | 663 | |
664 | 664 | m_shared_ram = auto_alloc_array(machine(), INT8, 0x100); |
665 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
665 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x781000, 0x7810ff, read8_delegate(FUNC(snesb_state::sharedram_r),this), write8_delegate(FUNC(snesb_state::sharedram_w),this)); | |
666 | 666 | |
667 | 667 | /* extra inputs */ |
668 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770071, 0x770071, read8_delegate(FUNC(snesb_state::snesb_dsw1_r),this)); | |
669 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770073, 0x770073, read8_delegate(FUNC(snesb_state::snesb_dsw2_r),this)); | |
670 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770079, 0x770079, read8_delegate(FUNC(snesb_state::snesb_coin_r),this)); | |
668 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x770071, 0x770071, read8_delegate(FUNC(snesb_state::snesb_dsw1_r),this)); | |
669 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x770073, 0x770073, read8_delegate(FUNC(snesb_state::snesb_dsw2_r),this)); | |
670 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x770079, 0x770079, read8_delegate(FUNC(snesb_state::snesb_coin_r),this)); | |
671 | 671 | |
672 | 672 | DRIVER_INIT_CALL(snes_hirom); |
673 | 673 | } |
r18027 | r18028 | |
708 | 708 | rom[0x7ffc] = 0x54; |
709 | 709 | |
710 | 710 | /* extra inputs */ |
711 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770071, 0x770071, read8_delegate(FUNC(snesb_state::snesb_dsw1_r),this)); | |
712 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770073, 0x770073, read8_delegate(FUNC(snesb_state::snesb_dsw2_r),this)); | |
713 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770079, 0x770079, read8_delegate(FUNC(snesb_state::snesb_coin_r),this)); | |
711 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x770071, 0x770071, read8_delegate(FUNC(snesb_state::snesb_dsw1_r),this)); | |
712 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x770073, 0x770073, read8_delegate(FUNC(snesb_state::snesb_dsw2_r),this)); | |
713 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x770079, 0x770079, read8_delegate(FUNC(snesb_state::snesb_coin_r),this)); | |
714 | 714 | |
715 | 715 | DRIVER_INIT_CALL(snes); |
716 | 716 | } |
r18027 | r18028 | |
733 | 733 | } |
734 | 734 | |
735 | 735 | /* extra inputs */ |
736 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770071, 0x770071, read8_delegate(FUNC(snesb_state::snesb_dsw1_r),this)); | |
737 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770073, 0x770073, read8_delegate(FUNC(snesb_state::snesb_dsw2_r),this)); | |
738 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770079, 0x770079, read8_delegate(FUNC(snesb_state::snesb_coin_r),this)); | |
736 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x770071, 0x770071, read8_delegate(FUNC(snesb_state::snesb_dsw1_r),this)); | |
737 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x770073, 0x770073, read8_delegate(FUNC(snesb_state::snesb_dsw2_r),this)); | |
738 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x770079, 0x770079, read8_delegate(FUNC(snesb_state::snesb_coin_r),this)); | |
739 | 739 | |
740 | 740 | DRIVER_INIT_CALL(snes); |
741 | 741 | } |
r18027 | r18028 | |
764 | 764 | rom[0xfffd] = 0xf7; |
765 | 765 | |
766 | 766 | /* extra inputs */ |
767 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770071, 0x770071, read8_delegate(FUNC(snesb_state::snesb_dsw1_r),this)); | |
768 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770073, 0x770073, read8_delegate(FUNC(snesb_state::snesb_dsw2_r),this)); | |
769 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770079, 0x770079, read8_delegate(FUNC(snesb_state::snesb_coin_r),this)); | |
767 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x770071, 0x770071, read8_delegate(FUNC(snesb_state::snesb_dsw1_r),this)); | |
768 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x770073, 0x770073, read8_delegate(FUNC(snesb_state::snesb_dsw2_r),this)); | |
769 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x770079, 0x770079, read8_delegate(FUNC(snesb_state::snesb_coin_r),this)); | |
770 | 770 | |
771 | 771 | DRIVER_INIT_CALL(snes_hirom); |
772 | 772 | } |
r18027 | r18028 | |
824 | 824 | dst[0xfffd] = 0x7a; |
825 | 825 | |
826 | 826 | /* protection checks */ |
827 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x75bd37, 0x75bd37, read8_delegate(FUNC(snesb_state::sb2b_75bd37_r),this)); | |
828 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x6a6000, 0x6a6fff, read8_delegate(FUNC(snesb_state::sb2b_6a6xxx_r),this)); | |
827 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x75bd37, 0x75bd37, read8_delegate(FUNC(snesb_state::sb2b_75bd37_r),this)); | |
828 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6a6000, 0x6a6fff, read8_delegate(FUNC(snesb_state::sb2b_6a6xxx_r),this)); | |
829 | 829 | |
830 | 830 | /* handler to read boot code */ |
831 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
831 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x007000, 0x007fff, read8_delegate(FUNC(snesb_state::sb2b_7xxx_r),this)); | |
832 | 832 | |
833 | 833 | /* extra inputs */ |
834 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770071, 0x770071, read8_delegate(FUNC(snesb_state::snesb_dsw1_r),this)); | |
835 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770073, 0x770073, read8_delegate(FUNC(snesb_state::snesb_dsw2_r),this)); | |
836 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770079, 0x770079, read8_delegate(FUNC(snesb_state::snesb_coin_r),this)); | |
834 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x770071, 0x770071, read8_delegate(FUNC(snesb_state::snesb_dsw1_r),this)); | |
835 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x770073, 0x770073, read8_delegate(FUNC(snesb_state::snesb_dsw2_r),this)); | |
836 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x770079, 0x770079, read8_delegate(FUNC(snesb_state::snesb_coin_r),this)); | |
837 | 837 | |
838 | 838 | DRIVER_INIT_CALL(snes_hirom); |
839 | 839 | } |
r18027 | r18028 | |
---|---|---|
1448 | 1448 | DRIVER_INIT_MEMBER(cinemat_state,speedfrk) |
1449 | 1449 | { |
1450 | 1450 | m_gear = 0xe; |
1451 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x00, 0x03, read8_delegate(FUNC(cinemat_state::speedfrk_wheel_r),this)); | |
1452 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x04, 0x06, read8_delegate(FUNC(cinemat_state::speedfrk_gear_r),this)); | |
1451 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x00, 0x03, read8_delegate(FUNC(cinemat_state::speedfrk_wheel_r),this)); | |
1452 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x04, 0x06, read8_delegate(FUNC(cinemat_state::speedfrk_gear_r),this)); | |
1453 | 1453 | } |
1454 | 1454 | |
1455 | 1455 | |
1456 | 1456 | DRIVER_INIT_MEMBER(cinemat_state,sundance) |
1457 | 1457 | { |
1458 | machine().device("maincpu")->memory().space(AS_IO) | |
1458 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x00, 0x0f, read8_delegate(FUNC(cinemat_state::sundance_inputs_r),this)); | |
1459 | 1459 | } |
1460 | 1460 | |
1461 | 1461 | |
1462 | 1462 | DRIVER_INIT_MEMBER(cinemat_state,tailg) |
1463 | 1463 | { |
1464 | machine().device("maincpu")->memory().space(AS_IO) | |
1464 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x07, 0x07, write8_delegate(FUNC(cinemat_state::mux_select_w),this)); | |
1465 | 1465 | } |
1466 | 1466 | |
1467 | 1467 | |
1468 | 1468 | DRIVER_INIT_MEMBER(cinemat_state,boxingb) |
1469 | 1469 | { |
1470 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x0c, 0x0f, read8_delegate(FUNC(cinemat_state::boxingb_dial_r),this)); | |
1471 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x07, 0x07, write8_delegate(FUNC(cinemat_state::mux_select_w),this)); | |
1470 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x0c, 0x0f, read8_delegate(FUNC(cinemat_state::boxingb_dial_r),this)); | |
1471 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x07, 0x07, write8_delegate(FUNC(cinemat_state::mux_select_w),this)); | |
1472 | 1472 | } |
1473 | 1473 | |
1474 | 1474 | |
1475 | 1475 | DRIVER_INIT_MEMBER(cinemat_state,qb3) |
1476 | 1476 | { |
1477 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x0f, 0x0f, read8_delegate(FUNC(cinemat_state::qb3_frame_r),this)); | |
1478 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x00, 0x00, write8_delegate(FUNC(cinemat_state::qb3_ram_bank_w),this)); | |
1477 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x0f, 0x0f, read8_delegate(FUNC(cinemat_state::qb3_frame_r),this)); | |
1478 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x00, 0x00, write8_delegate(FUNC(cinemat_state::qb3_ram_bank_w),this)); | |
1479 | 1479 | |
1480 | 1480 | membank("bank1")->configure_entries(0, 4, m_rambase, 0x100*2); |
1481 | 1481 | } |
r18027 | r18028 | |
---|---|---|
260 | 260 | |
261 | 261 | void su2000_state::machine_start() |
262 | 262 | { |
263 | address_space &space = | |
263 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
264 | 264 | |
265 | 265 | m_pit8254 = machine().device("pit8254"); |
266 | 266 | m_pic8259_1 = machine().device("pic8259_1"); |
r18027 | r18028 | |
287 | 287 | kbdc8042_init(machine(), &at8042); |
288 | 288 | |
289 | 289 | pc_vga_init(machine(), vga_setting, NULL); |
290 | pc_vga_io_init(machine(), | |
290 | pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); | |
291 | 291 | } |
292 | 292 | |
293 | 293 | void su2000_state::machine_reset() |
r18027 | r18028 | |
---|---|---|
339 | 339 | |
340 | 340 | void crbaloon_state::machine_reset() |
341 | 341 | { |
342 | address_space &space = | |
342 | address_space &space = machine().device("maincpu")->memory().space(AS_IO); | |
343 | 343 | device_t *discrete = machine().device("discrete"); |
344 | 344 | |
345 | 345 | pc3092_reset(); |
r18027 | r18028 | |
---|---|---|
801 | 801 | m_bios_ram = auto_alloc_array(machine(), UINT32, 0x20000/4); |
802 | 802 | |
803 | 803 | pc_vga_init(machine(), vga_setting, NULL); |
804 | pc_svga_trident_io_init(machine(), | |
804 | pc_svga_trident_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); | |
805 | 805 | init_pc_common(machine(), PCCOMMON_KEYBOARD_AT, voyager_set_keyb_int); |
806 | 806 | |
807 | 807 | intel82439tx_init(machine()); |
r18027 | r18028 | |
---|---|---|
1124 | 1124 | |
1125 | 1125 | DRIVER_INIT_MEMBER(freekick_state,gigasb) |
1126 | 1126 | { |
1127 | address_space &space = | |
1127 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1128 | 1128 | space.set_decrypted_region(0x0000, 0xbfff, machine().root_device().memregion("maincpu")->base() + 0x10000); |
1129 | 1129 | } |
1130 | 1130 |
r18027 | r18028 | |
---|---|---|
2481 | 2481 | |
2482 | 2482 | DRIVER_INIT_MEMBER(cischeat_state,wildplt) |
2483 | 2483 | { |
2484 | machine().device("cpu1")->memory().space(AS_PROGRAM) | |
2484 | machine().device("cpu1")->memory().space(AS_PROGRAM).install_read_handler(0x080000, 0x087fff, read16_delegate(FUNC(cischeat_state::wildplt_vregs_r),this)); | |
2485 | 2485 | |
2486 | 2486 | DRIVER_INIT_CALL(f1gpstar); |
2487 | 2487 | } |
r18027 | r18028 | |
---|---|---|
133 | 133 | static void update_irq_state( running_machine &machine ) |
134 | 134 | { |
135 | 135 | metro_state *state = machine.driver_data<metro_state>(); |
136 | address_space &space = | |
136 | address_space &space = state->m_maincpu->space(AS_PROGRAM); | |
137 | 137 | |
138 | 138 | /* Get the pending IRQs (only the enabled ones, e.g. where irq_enable is *0*) */ |
139 | 139 | UINT16 irq = state->metro_irq_cause_r(space, 0, 0xffff) & ~*state->m_irq_enable; |
r18027 | r18028 | |
262 | 262 | static int metro_io_callback( device_t *device, int ioline, int state ) |
263 | 263 | { |
264 | 264 | metro_state *driver_state = device->machine().driver_data<metro_state>(); |
265 | address_space &space = | |
265 | address_space &space = driver_state->m_maincpu->space(AS_PROGRAM); | |
266 | 266 | UINT8 data = 0; |
267 | 267 | |
268 | 268 | switch (ioline) |
r18027 | r18028 | |
5941 | 5941 | |
5942 | 5942 | DRIVER_INIT_MEMBER(metro_state,metro) |
5943 | 5943 | { |
5944 | address_space &space = | |
5944 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
5945 | 5945 | |
5946 | 5946 | metro_common(machine()); |
5947 | 5947 | |
r18027 | r18028 | |
5968 | 5968 | |
5969 | 5969 | DRIVER_INIT_MEMBER(metro_state,daitorid) |
5970 | 5970 | { |
5971 | address_space &space = | |
5971 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
5972 | 5972 | |
5973 | 5973 | metro_common(machine()); |
5974 | 5974 |
r18027 | r18028 | |
---|---|---|
218 | 218 | */ |
219 | 219 | |
220 | 220 | { |
221 | address_space &space = | |
221 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
222 | 222 | space.nop_write(0x200000, 0x201fff); |
223 | 223 | } |
224 | 224 |
r18027 | r18028 | |
---|---|---|
96 | 96 | |
97 | 97 | READ8_MEMBER(attckufo_state::vic_videoram_r) |
98 | 98 | { |
99 | return m_maincpu->space(AS_PROGRAM) | |
99 | return m_maincpu->space(AS_PROGRAM).read_byte(offset); | |
100 | 100 | } |
101 | 101 | |
102 | 102 | READ8_MEMBER(attckufo_state::vic_colorram_r) |
103 | 103 | { |
104 | return m_maincpu->space(AS_PROGRAM) | |
104 | return m_maincpu->space(AS_PROGRAM).read_byte(offset + 0x400); | |
105 | 105 | } |
106 | 106 | |
107 | 107 | static ADDRESS_MAP_START( cpu_map, AS_PROGRAM, 8, attckufo_state ) |
r18027 | r18028 | |
---|---|---|
303 | 303 | { |
304 | 304 | littlerb_state *state = machine.driver_data<littlerb_state>(); |
305 | 305 | UINT32 addr = state->m_write_address >> 3; // almost surely raw addresses are actually shifted by 3 |
306 | address_space | |
306 | address_space &vdp_space = machine.device<littlerb_vdp_device>("littlerbvdp")->space(); | |
307 | 307 | |
308 | return vdp_space | |
308 | return vdp_space.read_word(addr, mem_mask); | |
309 | 309 | } |
310 | 310 | |
311 | 311 | static void littlerb_data_write(running_machine &machine, UINT16 data, UINT16 mem_mask) |
312 | 312 | { |
313 | 313 | littlerb_state *state = machine.driver_data<littlerb_state>(); |
314 | 314 | UINT32 addr = state->m_write_address >> 3; // almost surely raw addresses are actually shifted by 3 |
315 | address_space | |
315 | address_space &vdp_space = machine.device<littlerb_vdp_device>("littlerbvdp")->space(); | |
316 | 316 | int mode = state->m_vdp_writemode; |
317 | 317 | |
318 | 318 | |
r18027 | r18028 | |
323 | 323 | } |
324 | 324 | else |
325 | 325 | { |
326 | vdp_space | |
326 | vdp_space.write_word(addr, data, mem_mask); | |
327 | 327 | |
328 | 328 | // 2000 is used for palette writes which appears to be a RAMDAC, no auto-inc. |
329 | 329 | // 1ff80806 is our 'spritelist' |
r18027 | r18028 | |
612 | 612 | { |
613 | 613 | int x,y; |
614 | 614 | fulloffs >>= 3; |
615 | address_space | |
615 | address_space &vdp_space = machine.device<littlerb_vdp_device>("littlerbvdp")->space(); | |
616 | 616 | |
617 | 617 | for (y=0;y<ysize;y++) |
618 | 618 | { |
r18027 | r18028 | |
620 | 620 | { |
621 | 621 | int drawxpos, drawypos; |
622 | 622 | // the addresses provided are the same as the offsets as the vdp writes |
623 | UINT16 pix = vdp_space | |
623 | UINT16 pix = vdp_space.read_byte(fulloffs); | |
624 | 624 | |
625 | 625 | drawxpos = xpos+x; |
626 | 626 | drawypos = ypos+y; |
r18027 | r18028 | |
---|---|---|
1481 | 1481 | |
1482 | 1482 | DRIVER_INIT_MEMBER(eolith_state,hidctch3) |
1483 | 1483 | { |
1484 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1484 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write(0xfc200000, 0xfc200003); // this generates pens vibration | |
1485 | 1485 | |
1486 | 1486 | // It is not clear why the first reads are needed too |
1487 | 1487 | |
1488 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xfce00000, 0xfce00003, read32_delegate(FUNC(eolith_state::hidctch3_pen1_r),this)); | |
1489 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xfce80000, 0xfce80003, read32_delegate(FUNC(eolith_state::hidctch3_pen1_r),this)); | |
1488 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xfce00000, 0xfce00003, read32_delegate(FUNC(eolith_state::hidctch3_pen1_r),this)); | |
1489 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xfce80000, 0xfce80003, read32_delegate(FUNC(eolith_state::hidctch3_pen1_r),this)); | |
1490 | 1490 | |
1491 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xfcf00000, 0xfcf00003, read32_delegate(FUNC(eolith_state::hidctch3_pen2_r),this)); | |
1492 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xfcf80000, 0xfcf80003, read32_delegate(FUNC(eolith_state::hidctch3_pen2_r),this)); | |
1491 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xfcf00000, 0xfcf00003, read32_delegate(FUNC(eolith_state::hidctch3_pen2_r),this)); | |
1492 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xfcf80000, 0xfcf80003, read32_delegate(FUNC(eolith_state::hidctch3_pen2_r),this)); | |
1493 | 1493 | |
1494 | 1494 | DRIVER_INIT_CALL(eolith); |
1495 | 1495 | } |
r18027 | r18028 | |
---|---|---|
448 | 448 | memset(pmc,0,sizeof(pmc)); |
449 | 449 | memset(ramin,0,sizeof(ramin)); |
450 | 450 | computedilated(); |
451 | video_memory=(UINT32 *)machine.firstcpu->space() | |
451 | video_memory=(UINT32 *)machine.firstcpu->space().get_read_ptr(0xf0000000); | |
452 | 452 | fb.allocate(640,480); |
453 | 453 | objectdata=&(object_data_alloc()); |
454 | 454 | objectdata->data=this; |
r18027 | r18028 | |
717 | 717 | |
718 | 718 | static void jamtable_disasm_command(running_machine &machine, int ref, int params, const char **param) |
719 | 719 | { |
720 | address_space &space= | |
720 | address_space &space=machine.firstcpu->space(); | |
721 | 721 | UINT64 addr,size; |
722 | 722 | |
723 | 723 | if (params < 2) |
r18027 | r18028 | |
731 | 731 | |
732 | 732 | static void dump_string_command(running_machine &machine, int ref, int params, const char **param) |
733 | 733 | { |
734 | address_space &space= | |
734 | address_space &space=machine.firstcpu->space(); | |
735 | 735 | UINT64 addr; |
736 | 736 | offs_t address; |
737 | 737 | UINT32 length,maximumlength; |
r18027 | r18028 | |
770 | 770 | |
771 | 771 | static void dump_process_command(running_machine &machine, int ref, int params, const char **param) |
772 | 772 | { |
773 | address_space &space= | |
773 | address_space &space=machine.firstcpu->space(); | |
774 | 774 | UINT64 addr; |
775 | 775 | offs_t address; |
776 | 776 | |
r18027 | r18028 | |
796 | 796 | |
797 | 797 | static void dump_list_command(running_machine &machine, int ref, int params, const char **param) |
798 | 798 | { |
799 | address_space &space= | |
799 | address_space &space=machine.firstcpu->space(); | |
800 | 800 | UINT64 addr,offs,start,old; |
801 | 801 | offs_t address,offset; |
802 | 802 | |
r18027 | r18028 | |
1365 | 1365 | READ32_MEMBER( chihiro_state::usbctrl_r ) |
1366 | 1366 | { |
1367 | 1367 | if (offset == 0) { /* hack needed until usb (and jvs) is implemented */ |
1368 | chihiro_devs.pic8259_1->machine().firstcpu->space(0)->write_byte(0x6a79f,0x01); | |
1369 | chihiro_devs.pic8259_1->machine().firstcpu->space(0)->write_byte(0x6a7a0,0x00); | |
1368 | chihiro_devs.pic8259_1->machine().firstcpu->space(0).write_byte(0x6a79f,0x01); | |
1369 | chihiro_devs.pic8259_1->machine().firstcpu->space(0).write_byte(0x6a7a0,0x00); | |
1370 | 1370 | } |
1371 | 1371 | #ifdef LOG_OHCI |
1372 | 1372 | if (offset >= 0x54/4) |
r18027 | r18028 | |
1689 | 1689 | // hack to avoid hanging if eeprom contents are not correct |
1690 | 1690 | // this would need dumping the serial eeprom on the xbox board |
1691 | 1691 | if (command == 0) { |
1692 | chihiro_devs.pic8259_1->machine().firstcpu->space(0)->write_byte(0x3b744,0x90); | |
1693 | chihiro_devs.pic8259_1->machine().firstcpu->space(0)->write_byte(0x3b745,0x90); | |
1694 | chihiro_devs.pic8259_1->machine().firstcpu->space(0)->write_byte(0x3b766,0xc9); | |
1695 | chihiro_devs.pic8259_1->machine().firstcpu->space(0)->write_byte(0x3b767,0xc3); | |
1692 | chihiro_devs.pic8259_1->machine().firstcpu->space(0).write_byte(0x3b744,0x90); | |
1693 | chihiro_devs.pic8259_1->machine().firstcpu->space(0).write_byte(0x3b745,0x90); | |
1694 | chihiro_devs.pic8259_1->machine().firstcpu->space(0).write_byte(0x3b766,0xc9); | |
1695 | chihiro_devs.pic8259_1->machine().firstcpu->space(0).write_byte(0x3b767,0xc3); | |
1696 | 1696 | } |
1697 | 1697 | data = dummyeeprom[command]+dummyeeprom[command+1]*256; |
1698 | 1698 | logerror("eeprom: %d %d %d\n",command,rw,data); |
r18027 | r18028 | |
---|---|---|
511 | 511 | |
512 | 512 | DRIVER_INIT_MEMBER(commando_state,commando) |
513 | 513 | { |
514 | address_space &space = | |
514 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
515 | 515 | UINT8 *rom = machine().root_device().memregion("maincpu")->base(); |
516 | 516 | UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0xc000); |
517 | 517 | int A; |
r18027 | r18028 | |
531 | 531 | |
532 | 532 | DRIVER_INIT_MEMBER(commando_state,spaceinv) |
533 | 533 | { |
534 | address_space &space = | |
534 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
535 | 535 | UINT8 *rom = machine().root_device().memregion("maincpu")->base(); |
536 | 536 | UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0xc000); |
537 | 537 | int A; |
r18027 | r18028 | |
---|---|---|
242 | 242 | atarigen_sound_io_reset(machine().device("soundcpu")); |
243 | 243 | atarigen_scanline_timer_reset(*machine().primary_screen, scanline_update, 64); |
244 | 244 | |
245 | address_space *main = machine().device<t11_device>("maincpu")->space(AS_PROGRAM); | |
246 | main->set_direct_update_handler(direct_update_delegate(FUNC(atarisy2_state::atarisy2_direct_handler), this)); | |
245 | address_space &main = machine().device<t11_device>("maincpu")->space(AS_PROGRAM); | |
246 | main.set_direct_update_handler(direct_update_delegate(FUNC(atarisy2_state::atarisy2_direct_handler), this)); | |
247 | 247 | |
248 | 248 | m_p2portwr_state = 0; |
249 | 249 | m_p2portrd_state = 0; |
r18027 | r18028 | |
340 | 340 | |
341 | 341 | static void bankselect_postload(running_machine &machine) |
342 | 342 | { |
343 | address_space &space = | |
343 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
344 | 344 | atarisy2_state *state = machine.driver_data<atarisy2_state>(); |
345 | 345 | |
346 | 346 | state->bankselect_w(space, 0, state->m_bankselect[0], 0xffff); |
r18027 | r18028 | |
---|---|---|
148 | 148 | device_t *discrete = machine().device("discrete"); |
149 | 149 | |
150 | 150 | /* Convert range data to divide value and write to sound */ |
151 | address_space &space = | |
151 | address_space &space = machine().firstcpu->space(AS_PROGRAM); | |
152 | 152 | discrete_sound_w(discrete, space, SKYDIVER_RANGE_DATA, (0x01 << (~m_videoram[0x394] & 0x07)) & 0xff); // Range 0-2 |
153 | 153 | |
154 | 154 | discrete_sound_w(discrete, space, SKYDIVER_RANGE3_EN, m_videoram[0x394] & 0x08); // Range 3 - note disable |
r18027 | r18028 | |
---|---|---|
1469 | 1469 | |
1470 | 1470 | DRIVER_INIT_MEMBER(ninjakd2_state,bootleg) |
1471 | 1471 | { |
1472 | address_space &space = | |
1472 | address_space &space = machine().device("soundcpu")->memory().space(AS_PROGRAM); | |
1473 | 1473 | space.set_decrypted_region(0x0000, 0x7fff, machine().root_device().memregion("soundcpu")->base() + 0x10000); |
1474 | 1474 | |
1475 | 1475 | gfx_unscramble(machine()); |
r18027 | r18028 | |
---|---|---|
180 | 180 | |
181 | 181 | void spacefb_state::machine_reset() |
182 | 182 | { |
183 | address_space &space = | |
183 | address_space &space = machine().device("maincpu")->memory().space(AS_IO); | |
184 | 184 | /* the 3 output ports are cleared on reset */ |
185 | 185 | spacefb_port_0_w(space, 0, 0); |
186 | 186 | spacefb_port_1_w(space, 0, 0); |
r18027 | r18028 | |
---|---|---|
2273 | 2273 | |
2274 | 2274 | /* install synchronization hooks for GPU */ |
2275 | 2275 | if (m_is_r3000) |
2276 | m_main_cpu->space(AS_PROGRAM) | |
2276 | m_main_cpu->space(AS_PROGRAM).install_write_handler(0x04f0b000 + gpu_jump_offs, 0x04f0b003 + gpu_jump_offs, write32_delegate(FUNC(jaguar_state::gpu_jump_w), this)); | |
2277 | 2277 | else |
2278 | m_main_cpu->space(AS_PROGRAM)->install_write_handler(0xf0b000 + gpu_jump_offs, 0xf0b003 + gpu_jump_offs, write32_delegate(FUNC(jaguar_state::gpu_jump_w), this)); | |
2279 | m_gpu->space(AS_PROGRAM)->install_read_handler(0xf03000 + gpu_jump_offs, 0xf03003 + gpu_jump_offs, read32_delegate(FUNC(jaguar_state::gpu_jump_r), this)); | |
2278 | m_main_cpu->space(AS_PROGRAM).install_write_handler(0xf0b000 + gpu_jump_offs, 0xf0b003 + gpu_jump_offs, write32_delegate(FUNC(jaguar_state::gpu_jump_w), this)); | |
2279 | m_gpu->space(AS_PROGRAM).install_read_handler(0xf03000 + gpu_jump_offs, 0xf03003 + gpu_jump_offs, read32_delegate(FUNC(jaguar_state::gpu_jump_r), this)); | |
2280 | 2280 | m_gpu_jump_address = &m_gpu_ram[gpu_jump_offs/4]; |
2281 | 2281 | m_gpu_spin_pc = 0xf03000 + spin_pc; |
2282 | 2282 | |
r18027 | r18028 | |
2294 | 2294 | |
2295 | 2295 | #if ENABLE_SPEEDUP_HACKS |
2296 | 2296 | /* install speedup for main CPU */ |
2297 | m_main_speedup = m_main_cpu->space(AS_PROGRAM) | |
2297 | m_main_speedup = m_main_cpu->space(AS_PROGRAM).install_write_handler(0xa02030, 0xa02033, write32_delegate(FUNC(jaguar_state::area51_main_speedup_w),this)); | |
2298 | 2298 | #endif |
2299 | 2299 | } |
2300 | 2300 | |
r18027 | r18028 | |
2307 | 2307 | #if ENABLE_SPEEDUP_HACKS |
2308 | 2308 | /* install speedup for main CPU */ |
2309 | 2309 | m_main_speedup_max_cycles = 120; |
2310 | m_main_speedup = m_main_cpu->space(AS_PROGRAM) | |
2310 | m_main_speedup = m_main_cpu->space(AS_PROGRAM).install_read_handler(0x100062e8, 0x100062eb, read32_delegate(FUNC(jaguar_state::cojagr3k_main_speedup_r),this)); | |
2311 | 2311 | #endif |
2312 | 2312 | } |
2313 | 2313 | |
r18027 | r18028 | |
2322 | 2322 | #if ENABLE_SPEEDUP_HACKS |
2323 | 2323 | /* install speedup for main CPU */ |
2324 | 2324 | m_main_speedup_max_cycles = 120; |
2325 | m_main_speedup = m_main_cpu->space(AS_PROGRAM) | |
2325 | m_main_speedup = m_main_cpu->space(AS_PROGRAM).install_read_handler(0x1000865c, 0x1000865f, read32_delegate(FUNC(jaguar_state::cojagr3k_main_speedup_r),this)); | |
2326 | 2326 | #endif |
2327 | 2327 | } |
2328 | 2328 | |
r18027 | r18028 | |
2337 | 2337 | |
2338 | 2338 | #if ENABLE_SPEEDUP_HACKS |
2339 | 2339 | /* install speedup for main CPU */ |
2340 | m_main_speedup = m_main_cpu->space(AS_PROGRAM) | |
2340 | m_main_speedup = m_main_cpu->space(AS_PROGRAM).install_write_handler(0xa19550, 0xa19557, write32_delegate(FUNC(jaguar_state::area51mx_main_speedup_w),this)); | |
2341 | 2341 | #endif |
2342 | 2342 | } |
2343 | 2343 | |
r18027 | r18028 | |
2353 | 2353 | #if ENABLE_SPEEDUP_HACKS |
2354 | 2354 | /* install speedup for main CPU */ |
2355 | 2355 | m_main_speedup_max_cycles = 120; |
2356 | m_main_speedup = m_main_cpu->space(AS_PROGRAM) | |
2356 | m_main_speedup = m_main_cpu->space(AS_PROGRAM).install_read_handler(0x10006f0c, 0x10006f0f, read32_delegate(FUNC(jaguar_state::cojagr3k_main_speedup_r),this)); | |
2357 | 2357 | #endif |
2358 | 2358 | } |
2359 | 2359 | |
r18027 | r18028 | |
2366 | 2366 | #if ENABLE_SPEEDUP_HACKS |
2367 | 2367 | /* install speedup for main CPU */ |
2368 | 2368 | m_main_speedup_max_cycles = 200; |
2369 | m_main_speedup = m_main_cpu->space(AS_PROGRAM) | |
2369 | m_main_speedup = m_main_cpu->space(AS_PROGRAM).install_read_handler(0x10021b60, 0x10021b63, read32_delegate(FUNC(jaguar_state::cojagr3k_main_speedup_r),this)); | |
2370 | 2370 | #endif |
2371 | 2371 | } |
2372 | 2372 | |
r18027 | r18028 | |
2379 | 2379 | /* install speedup for main CPU */ |
2380 | 2380 | m_main_speedup_max_cycles = 200; |
2381 | 2381 | if (main_speedup_addr != 0) |
2382 | m_main_speedup = m_main_cpu->space(AS_PROGRAM)->install_read_handler(main_speedup_addr, main_speedup_addr + 3, read32_delegate(FUNC(jaguar_state::cojagr3k_main_speedup_r), this)); | |
2383 | m_main_gpu_wait = m_main_cpu->space(AS_PROGRAM)->install_read_handler(0x0400d900, 0x0400d900 + 3, read32_delegate(FUNC(jaguar_state::main_gpu_wait_r), this)); | |
2382 | m_main_speedup = m_main_cpu->space(AS_PROGRAM).install_read_handler(main_speedup_addr, main_speedup_addr + 3, read32_delegate(FUNC(jaguar_state::cojagr3k_main_speedup_r), this)); | |
2383 | m_main_gpu_wait = m_main_cpu->space(AS_PROGRAM).install_read_handler(0x0400d900, 0x0400d900 + 3, read32_delegate(FUNC(jaguar_state::main_gpu_wait_r), this)); | |
2384 | 2384 | #endif |
2385 | 2385 | } |
2386 | 2386 | |
r18027 | r18028 | |
2399 | 2399 | #if ENABLE_SPEEDUP_HACKS |
2400 | 2400 | /* install speedup for main CPU */ |
2401 | 2401 | m_main_speedup_max_cycles = 50; |
2402 | m_main_speedup = m_main_cpu->space(AS_PROGRAM) | |
2402 | m_main_speedup = m_main_cpu->space(AS_PROGRAM).install_read_handler(0x12005b34, 0x12005b37, read32_delegate(FUNC(jaguar_state::cojagr3k_main_speedup_r),this)); | |
2403 | 2403 | #endif |
2404 | 2404 | } |
2405 | 2405 |
r18027 | r18028 | |
---|---|---|
764 | 764 | |
765 | 765 | DRIVER_INIT_MEMBER(gng_state,diamond) |
766 | 766 | { |
767 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
767 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, read8_delegate(FUNC(gng_state::diamond_hack_r),this)); | |
768 | 768 | } |
769 | 769 | |
770 | 770 |
r18027 | r18028 | |
---|---|---|
69 | 69 | m_bank = data; |
70 | 70 | |
71 | 71 | if (m_bank) |
72 | m_maincpu->space(AS_PROGRAM) | |
72 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0x800f, read8_delegate(FUNC(liberate_state::deco16_io_r),this)); | |
73 | 73 | else |
74 | m_maincpu->space(AS_PROGRAM) | |
74 | m_maincpu->space(AS_PROGRAM).install_read_bank(0x8000, 0x800f, "bank1"); | |
75 | 75 | } |
76 | 76 | |
77 | 77 | READ8_MEMBER(liberate_state::prosoccr_bank_r) |
r18027 | r18028 | |
174 | 174 | m_bank = data & 1; |
175 | 175 | |
176 | 176 | if (m_bank) |
177 | m_maincpu->space(AS_PROGRAM) | |
177 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0x800f, read8_delegate(FUNC(liberate_state::deco16_io_r),this)); | |
178 | 178 | else |
179 | m_maincpu->space(AS_PROGRAM) | |
179 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0x800f, read8_delegate(FUNC(liberate_state::prosoccr_charram_r),this)); | |
180 | 180 | |
181 | 181 | } |
182 | 182 | |
r18027 | r18028 | |
1345 | 1345 | |
1346 | 1346 | static void sound_cpu_decrypt(running_machine &machine) |
1347 | 1347 | { |
1348 | address_space &space = | |
1348 | address_space &space = machine.device("audiocpu")->memory().space(AS_PROGRAM); | |
1349 | 1349 | UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x4000); |
1350 | 1350 | UINT8 *rom = machine.root_device().memregion("audiocpu")->base(); |
1351 | 1351 | int i; |
r18027 | r18028 | |
1373 | 1373 | { |
1374 | 1374 | DRIVER_INIT_CALL(prosport); |
1375 | 1375 | |
1376 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1376 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0xa000, 0xa000, "IN0"); | |
1377 | 1377 | } |
1378 | 1378 | |
1379 | 1379 | DRIVER_INIT_MEMBER(liberate_state,liberate) |
1380 | 1380 | { |
1381 | 1381 | int A; |
1382 | address_space &space = | |
1382 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1383 | 1383 | UINT8 *decrypted = auto_alloc_array(machine(), UINT8, 0x10000); |
1384 | 1384 | UINT8 *ROM = machine().root_device().memregion("maincpu")->base(); |
1385 | 1385 |
r18027 | r18028 | |
---|---|---|
3176 | 3176 | |
3177 | 3177 | MACHINE_RESET_MEMBER(seta_state,calibr50) |
3178 | 3178 | { |
3179 | address_space &space = | |
3179 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
3180 | 3180 | sub_bankswitch_w(space, 0, 0); |
3181 | 3181 | } |
3182 | 3182 | |
r18027 | r18028 | |
10721 | 10721 | DRIVER_INIT_MEMBER(seta_state,twineagl) |
10722 | 10722 | { |
10723 | 10723 | /* debug? */ |
10724 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
10724 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x800000, 0x8000ff, read16_delegate(FUNC(seta_state::twineagl_debug_r),this)); | |
10725 | 10725 | |
10726 | 10726 | /* This allows 2 simultaneous players and the use of the "Copyright" Dip Switch. */ |
10727 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
10727 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x200100, 0x20010f, read16_delegate(FUNC(seta_state::twineagl_200100_r),this), write16_delegate(FUNC(seta_state::twineagl_200100_w),this)); | |
10728 | 10728 | } |
10729 | 10729 | |
10730 | 10730 | |
r18027 | r18028 | |
10753 | 10753 | |
10754 | 10754 | DRIVER_INIT_MEMBER(seta_state,downtown) |
10755 | 10755 | { |
10756 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
10756 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x200000, 0x2001ff, read16_delegate(FUNC(seta_state::downtown_protection_r),this), write16_delegate(FUNC(seta_state::downtown_protection_w),this)); | |
10757 | 10757 | } |
10758 | 10758 | |
10759 | 10759 | |
r18027 | r18028 | |
10773 | 10773 | |
10774 | 10774 | DRIVER_INIT_MEMBER(seta_state,arbalest) |
10775 | 10775 | { |
10776 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
10776 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x80000, 0x8000f, read16_delegate(FUNC(seta_state::arbalest_debug_r),this)); | |
10777 | 10777 | } |
10778 | 10778 | |
10779 | 10779 | |
r18027 | r18028 | |
10782 | 10782 | UINT16 *RAM = (UINT16 *) machine().root_device().memregion("maincpu")->base(); |
10783 | 10783 | |
10784 | 10784 | /* This game uses the 21c000-21ffff area for protection? */ |
10785 | // machine().device("maincpu")->memory().space(AS_PROGRAM) | |
10785 | // machine().device("maincpu")->memory().space(AS_PROGRAM).nop_readwrite(0x21c000, 0x21ffff); | |
10786 | 10786 | |
10787 | 10787 | RAM[0x8ab1c/2] = 0x4e71; // patch protection test: "cp error" |
10788 | 10788 | RAM[0x8ab1e/2] = 0x4e71; |
r18027 | r18028 | |
10826 | 10826 | |
10827 | 10827 | DRIVER_INIT_MEMBER(seta_state,eightfrc) |
10828 | 10828 | { |
10829 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
10829 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_read(0x500004, 0x500005); // watchdog?? | |
10830 | 10830 | } |
10831 | 10831 | |
10832 | 10832 | |
10833 | 10833 | DRIVER_INIT_MEMBER(seta_state,zombraid) |
10834 | 10834 | { |
10835 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xf00002, 0xf00003, read16_delegate(FUNC(seta_state::zombraid_gun_r),this)); | |
10836 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xf00000, 0xf00001, write16_delegate(FUNC(seta_state::zombraid_gun_w),this)); | |
10835 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xf00002, 0xf00003, read16_delegate(FUNC(seta_state::zombraid_gun_r),this)); | |
10836 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xf00000, 0xf00001, write16_delegate(FUNC(seta_state::zombraid_gun_w),this)); | |
10837 | 10837 | } |
10838 | 10838 | |
10839 | 10839 | |
r18027 | r18028 | |
10851 | 10851 | |
10852 | 10852 | DRIVER_INIT_MEMBER(seta_state,rezon) |
10853 | 10853 | { |
10854 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
10854 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_read(0x500006, 0x500007); // irq ack? | |
10855 | 10855 | } |
10856 | 10856 | |
10857 | 10857 | DRIVER_INIT_MEMBER(seta_state,wiggie) |
r18027 | r18028 | |
10883 | 10883 | } |
10884 | 10884 | |
10885 | 10885 | /* X1_010 is not used. */ |
10886 | machine().device("maincpu")->memory().space(AS_PROGRAM)->nop_readwrite(0x100000, 0x103fff); | |
10887 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xB00008, 0xB00009, write16_delegate(FUNC(seta_state::wiggie_soundlatch_w),this)); | |
10886 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_readwrite(0x100000, 0x103fff); | |
10887 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xB00008, 0xB00009, write16_delegate(FUNC(seta_state::wiggie_soundlatch_w),this)); | |
10888 | 10888 | |
10889 | 10889 | } |
10890 | 10890 |
r18027 | r18028 | |
---|---|---|
951 | 951 | |
952 | 952 | DRIVER_INIT_MEMBER(asteroid_state,asteroidb) |
953 | 953 | { |
954 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2000, 0x2000, "IN0"); | |
955 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2003, 0x2003, "HS"); | |
954 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x2000, 0x2000, "IN0"); | |
955 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x2003, 0x2003, "HS"); | |
956 | 956 | } |
957 | 957 | |
958 | 958 | |
959 | 959 | DRIVER_INIT_MEMBER(asteroid_state,asterock) |
960 | 960 | { |
961 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
961 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x2000, 0x2007, read8_delegate(FUNC(asteroid_state::asterock_IN0_r),this)); | |
962 | 962 | } |
963 | 963 | |
964 | 964 |
r18027 | r18028 | |
---|---|---|
343 | 343 | sh2drc_set_options(machine().device("maincpu"), SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL); |
344 | 344 | sh2drc_set_options(machine().device("slave"), SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL); |
345 | 345 | |
346 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::stv_ioga_r32),this), write32_delegate(FUNC(saturn_state::stv_ioga_w32),this)); | |
347 | machine().device("slave")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::stv_ioga_r32),this), write32_delegate(FUNC(saturn_state::stv_ioga_w32),this)); | |
346 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::stv_ioga_r32),this), write32_delegate(FUNC(saturn_state::stv_ioga_w32),this)); | |
347 | machine().device("slave")->memory().space(AS_PROGRAM).install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::stv_ioga_r32),this), write32_delegate(FUNC(saturn_state::stv_ioga_w32),this)); | |
348 | 348 | |
349 | 349 | m_vdp2.pal = 0; |
350 | 350 | } |
r18027 | r18028 | |
352 | 352 | DRIVER_INIT_MEMBER(saturn_state,critcrsh) |
353 | 353 | { |
354 | 354 | DRIVER_INIT_CALL(stv); |
355 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::critcrsh_ioga_r32),this), write32_delegate(FUNC(saturn_state::stv_ioga_w32),this)); | |
356 | machine().device("slave")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::critcrsh_ioga_r32),this), write32_delegate(FUNC(saturn_state::stv_ioga_w32),this)); | |
355 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::critcrsh_ioga_r32),this), write32_delegate(FUNC(saturn_state::stv_ioga_w32),this)); | |
356 | machine().device("slave")->memory().space(AS_PROGRAM).install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::critcrsh_ioga_r32),this), write32_delegate(FUNC(saturn_state::stv_ioga_w32),this)); | |
357 | 357 | } |
358 | 358 | |
359 | 359 | /* |
r18027 | r18028 | |
390 | 390 | |
391 | 391 | DRIVER_INIT_CALL(stv); |
392 | 392 | |
393 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::magzun_ioga_r32),this), write32_delegate(FUNC(saturn_state::magzun_ioga_w32),this)); | |
394 | machine().device("slave")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::magzun_ioga_r32),this), write32_delegate(FUNC(saturn_state::magzun_ioga_w32),this)); | |
393 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::magzun_ioga_r32),this), write32_delegate(FUNC(saturn_state::magzun_ioga_w32),this)); | |
394 | machine().device("slave")->memory().space(AS_PROGRAM).install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::magzun_ioga_r32),this), write32_delegate(FUNC(saturn_state::magzun_ioga_w32),this)); | |
395 | 395 | |
396 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x608e830, 0x608e833, read32_delegate(FUNC(saturn_state::magzun_hef_hack_r),this)); | |
397 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x60ff3b4, 0x60ff3b7, read32_delegate(FUNC(saturn_state::magzun_rx_hack_r),this)); | |
396 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x608e830, 0x608e833, read32_delegate(FUNC(saturn_state::magzun_hef_hack_r),this)); | |
397 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x60ff3b4, 0x60ff3b7, read32_delegate(FUNC(saturn_state::magzun_rx_hack_r),this)); | |
398 | 398 | |
399 | 399 | /* Program ROM patches, don't understand how to avoid these two checks ... */ |
400 | 400 | { |
r18027 | r18028 | |
410 | 410 | DRIVER_INIT_MEMBER(saturn_state,stvmp) |
411 | 411 | { |
412 | 412 | DRIVER_INIT_CALL(stv); |
413 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::stvmp_ioga_r32),this), write32_delegate(FUNC(saturn_state::stvmp_ioga_w32),this)); | |
414 | machine().device("slave")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::stvmp_ioga_r32),this), write32_delegate(FUNC(saturn_state::stvmp_ioga_w32),this)); | |
413 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::stvmp_ioga_r32),this), write32_delegate(FUNC(saturn_state::stvmp_ioga_w32),this)); | |
414 | machine().device("slave")->memory().space(AS_PROGRAM).install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::stvmp_ioga_r32),this), write32_delegate(FUNC(saturn_state::stvmp_ioga_w32),this)); | |
415 | 415 | } |
416 | 416 | |
417 | 417 | |
r18027 | r18028 | |
663 | 663 | sh2drc_add_pcflush(machine().device("maincpu"), 0x60011ba); |
664 | 664 | sh2drc_add_pcflush(machine().device("maincpu"), 0x605b9da); |
665 | 665 | |
666 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
666 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x06000770, 0x06000773, read32_delegate(FUNC(saturn_state::astrass_hack_r),this)); | |
667 | 667 | |
668 | 668 | install_astrass_protection(machine()); |
669 | 669 |
r18027 | r18028 | |
---|---|---|
656 | 656 | |
657 | 657 | kbdc8042_init(machine(), &at8042); |
658 | 658 | pc_vga_init(machine(), ::vga_setting, NULL); |
659 | pc_vga_io_init(machine(), | |
659 | pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); | |
660 | 660 | } |
661 | 661 | |
662 | 662 | void queen_state::machine_reset() |
r18027 | r18028 | |
---|---|---|
334 | 334 | static READ8_HANDLER( megatech_z80_read_68k_banked_data ) |
335 | 335 | { |
336 | 336 | mtech_state *state = space.machine().driver_data<mtech_state>(); |
337 | address_space *space68k = space.machine().device<legacy_cpu_device>("maincpu")->space(); | |
338 | UINT8 ret = space68k->read_byte(state->m_mt_bank_addr + offset); | |
337 | address_space &space68k = space.machine().device<legacy_cpu_device>("maincpu")->space(); | |
338 | UINT8 ret = space68k.read_byte(state->m_mt_bank_addr + offset); | |
339 | 339 | return ret; |
340 | 340 | } |
341 | 341 | |
342 | 342 | static WRITE8_HANDLER( megatech_z80_write_68k_banked_data ) |
343 | 343 | { |
344 | 344 | mtech_state *state = space.machine().driver_data<mtech_state>(); |
345 | address_space *space68k = space.machine().device<legacy_cpu_device>("maincpu")->space(); | |
346 | space68k->write_byte(state->m_mt_bank_addr + offset,data); | |
345 | address_space &space68k = space.machine().device<legacy_cpu_device>("maincpu")->space(); | |
346 | space68k.write_byte(state->m_mt_bank_addr + offset,data); | |
347 | 347 | } |
348 | 348 | |
349 | 349 | static void megatech_z80_bank_w(running_machine &machine, UINT16 data) |
r18027 | r18028 | |
---|---|---|
2471 | 2471 | |
2472 | 2472 | DRIVER_INIT_MEMBER(vamphalf_state,vamphalf) |
2473 | 2473 | { |
2474 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2474 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0004a840, 0x0004a843, read16_delegate(FUNC(vamphalf_state::vamphalf_speedup_r), this)); | |
2475 | 2475 | |
2476 | 2476 | m_palshift = 0; |
2477 | 2477 | m_flip_bit = 0x80; |
r18027 | r18028 | |
2479 | 2479 | |
2480 | 2480 | DRIVER_INIT_MEMBER(vamphalf_state,vamphafk) |
2481 | 2481 | { |
2482 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2482 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0004a6d0, 0x0004a6d3, read16_delegate(FUNC(vamphalf_state::vamphafk_speedup_r), this)); | |
2483 | 2483 | |
2484 | 2484 | m_palshift = 0; |
2485 | 2485 | m_flip_bit = 0x80; |
r18027 | r18028 | |
2487 | 2487 | |
2488 | 2488 | DRIVER_INIT_MEMBER(vamphalf_state,misncrft) |
2489 | 2489 | { |
2490 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2490 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00072eb4, 0x00072eb7, read16_delegate(FUNC(vamphalf_state::misncrft_speedup_r), this)); | |
2491 | 2491 | |
2492 | 2492 | m_palshift = 0; |
2493 | 2493 | m_flip_bit = 1; |
2494 | 2494 | |
2495 | 2495 | // Configure the QS1000 ROM banking. Care must be taken not to overlap the 256b internal RAM |
2496 | machine().device("qs1000:cpu")->memory().space(AS_IO) | |
2496 | machine().device("qs1000:cpu")->memory().space(AS_IO).install_read_bank(0x0100, 0xffff, "data"); | |
2497 | 2497 | membank("qs1000:data")->configure_entries(0, 16, memregion("qs1000:cpu")->base()+0x100, 0x8000-0x100); |
2498 | 2498 | } |
2499 | 2499 | |
2500 | 2500 | DRIVER_INIT_MEMBER(vamphalf_state,coolmini) |
2501 | 2501 | { |
2502 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2502 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x000d2e80, 0x000d2e83, read16_delegate(FUNC(vamphalf_state::coolmini_speedup_r), this)); | |
2503 | 2503 | |
2504 | 2504 | m_palshift = 0; |
2505 | 2505 | m_flip_bit = 1; |
r18027 | r18028 | |
2507 | 2507 | |
2508 | 2508 | DRIVER_INIT_MEMBER(vamphalf_state,suplup) |
2509 | 2509 | { |
2510 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2510 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0011605c, 0x0011605f, read16_delegate(FUNC(vamphalf_state::suplup_speedup_r), this)); | |
2511 | 2511 | |
2512 | 2512 | m_palshift = 8; |
2513 | 2513 | /* no flipscreen */ |
r18027 | r18028 | |
2515 | 2515 | |
2516 | 2516 | DRIVER_INIT_MEMBER(vamphalf_state,luplup) |
2517 | 2517 | { |
2518 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2518 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00115e84, 0x00115e87, read16_delegate(FUNC(vamphalf_state::luplup_speedup_r), this)); | |
2519 | 2519 | |
2520 | 2520 | m_palshift = 8; |
2521 | 2521 | /* no flipscreen */ |
r18027 | r18028 | |
2523 | 2523 | |
2524 | 2524 | DRIVER_INIT_MEMBER(vamphalf_state,luplup29) |
2525 | 2525 | { |
2526 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2526 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00113f08, 0x00113f0b, read16_delegate(FUNC(vamphalf_state::luplup29_speedup_r), this)); | |
2527 | 2527 | |
2528 | 2528 | m_palshift = 8; |
2529 | 2529 | /* no flipscreen */ |
r18027 | r18028 | |
2531 | 2531 | |
2532 | 2532 | DRIVER_INIT_MEMBER(vamphalf_state,puzlbang) |
2533 | 2533 | { |
2534 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2534 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00113ecc, 0x00113ecf, read16_delegate(FUNC(vamphalf_state::puzlbang_speedup_r), this)); | |
2535 | 2535 | |
2536 | 2536 | m_palshift = 8; |
2537 | 2537 | /* no flipscreen */ |
r18027 | r18028 | |
2539 | 2539 | |
2540 | 2540 | DRIVER_INIT_MEMBER(vamphalf_state,wyvernwg) |
2541 | 2541 | { |
2542 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x00b56fc, 0x00b56ff, read32_delegate(FUNC(vamphalf_state::wyvernwg_speedup_r), this)); | |
2543 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x00b74f8, 0x00b74fb, read32_delegate(FUNC(vamphalf_state::wyvernwga_speedup_r), this)); | |
2542 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00b56fc, 0x00b56ff, read32_delegate(FUNC(vamphalf_state::wyvernwg_speedup_r), this)); | |
2543 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00b74f8, 0x00b74fb, read32_delegate(FUNC(vamphalf_state::wyvernwga_speedup_r), this)); | |
2544 | 2544 | |
2545 | 2545 | m_palshift = 0; |
2546 | 2546 | m_flip_bit = 1; |
r18027 | r18028 | |
2550 | 2550 | m_semicom_prot_data[1] = 1; |
2551 | 2551 | |
2552 | 2552 | // Configure the QS1000 ROM banking. Care must be taken not to overlap the 256b internal RAM |
2553 | machine().device("qs1000:cpu")->memory().space(AS_IO) | |
2553 | machine().device("qs1000:cpu")->memory().space(AS_IO).install_read_bank(0x0100, 0xffff, "data"); | |
2554 | 2554 | membank("qs1000:data")->configure_entries(0, 16, memregion("qs1000:cpu")->base()+0x100, 0x8000-0x100); |
2555 | 2555 | } |
2556 | 2556 | |
r18027 | r18028 | |
2558 | 2558 | { |
2559 | 2559 | m_finalgdr_backupram_bank = 1; |
2560 | 2560 | m_finalgdr_backupram = auto_alloc_array(machine(), UINT8, 0x80*0x100); |
2561 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2561 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x005e874, 0x005e877, read32_delegate(FUNC(vamphalf_state::finalgdr_speedup_r), this)); | |
2562 | 2562 | machine().device<nvram_device>("nvram")->set_base(m_finalgdr_backupram, 0x80*0x100); |
2563 | 2563 | |
2564 | 2564 | m_palshift = 0; |
r18027 | r18028 | |
2574 | 2574 | // backup ram isn't used |
2575 | 2575 | m_finalgdr_backupram_bank = 1; |
2576 | 2576 | m_finalgdr_backupram = auto_alloc_array(machine(), UINT8, 0x80*0x100); |
2577 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2577 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00701a4, 0x00701a7, read32_delegate(FUNC(vamphalf_state::mrkicker_speedup_r), this)); | |
2578 | 2578 | machine().device<nvram_device>("nvram")->set_base(m_finalgdr_backupram, 0x80*0x100); |
2579 | 2579 | |
2580 | 2580 | m_palshift = 0; |
r18027 | r18028 | |
2587 | 2587 | |
2588 | 2588 | DRIVER_INIT_MEMBER(vamphalf_state,dquizgo2) |
2589 | 2589 | { |
2590 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2590 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00cde70, 0x00cde73, read16_delegate(FUNC(vamphalf_state::dquizgo2_speedup_r), this)); | |
2591 | 2591 | |
2592 | 2592 | m_palshift = 0; |
2593 | 2593 | m_flip_bit = 1; |
r18027 | r18028 | |
2595 | 2595 | |
2596 | 2596 | DRIVER_INIT_MEMBER(vamphalf_state,dtfamily) |
2597 | 2597 | { |
2598 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2598 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xcc2a8, 0xcc2a9, read16_delegate(FUNC(vamphalf_state::dtfamily_speedup_r), this)); | |
2599 | 2599 | |
2600 | 2600 | m_palshift = 0; |
2601 | 2601 | m_flip_bit = 1; |
r18027 | r18028 | |
2604 | 2604 | |
2605 | 2605 | DRIVER_INIT_MEMBER(vamphalf_state,toyland) |
2606 | 2606 | { |
2607 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2607 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x780d8, 0x780d9, read16_delegate(FUNC(vamphalf_state::toyland_speedup_r), this)); | |
2608 | 2608 | |
2609 | 2609 | m_palshift = 0; |
2610 | 2610 | m_flip_bit = 1; |
r18027 | r18028 | |
2612 | 2612 | |
2613 | 2613 | DRIVER_INIT_MEMBER(vamphalf_state,aoh) |
2614 | 2614 | { |
2615 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2615 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x028a09c, 0x028a09f, read32_delegate(FUNC(vamphalf_state::aoh_speedup_r), this)); | |
2616 | 2616 | |
2617 | 2617 | m_palshift = 0; |
2618 | 2618 | /* no flipscreen */ |
r18027 | r18028 | |
2620 | 2620 | |
2621 | 2621 | DRIVER_INIT_MEMBER(vamphalf_state,jmpbreak) |
2622 | 2622 | { |
2623 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x00906fc, 0x00906ff, read16_delegate(FUNC(vamphalf_state::jmpbreak_speedup_r), this)); | |
2624 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xe0000000, 0xe0000003, write16_delegate(FUNC(vamphalf_state::jmpbreak_flipscreen_w), this)); | |
2623 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00906fc, 0x00906ff, read16_delegate(FUNC(vamphalf_state::jmpbreak_speedup_r), this)); | |
2624 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xe0000000, 0xe0000003, write16_delegate(FUNC(vamphalf_state::jmpbreak_flipscreen_w), this)); | |
2625 | 2625 | |
2626 | 2626 | m_palshift = 0; |
2627 | 2627 | } |
2628 | 2628 | |
2629 | 2629 | DRIVER_INIT_MEMBER(vamphalf_state,mrdig) |
2630 | 2630 | { |
2631 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x00a99c, 0x00a99f, read16_delegate(FUNC(vamphalf_state::mrdig_speedup_r), this)); | |
2632 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xe0000000, 0xe0000003, write16_delegate(FUNC(vamphalf_state::jmpbreak_flipscreen_w), this)); | |
2631 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00a99c, 0x00a99f, read16_delegate(FUNC(vamphalf_state::mrdig_speedup_r), this)); | |
2632 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xe0000000, 0xe0000003, write16_delegate(FUNC(vamphalf_state::jmpbreak_flipscreen_w), this)); | |
2633 | 2633 | |
2634 | 2634 | m_palshift = 0; |
2635 | 2635 | } |
r18027 | r18028 | |
2637 | 2637 | |
2638 | 2638 | DRIVER_INIT_MEMBER(vamphalf_state,boonggab) |
2639 | 2639 | { |
2640 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2640 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x000f1b7c, 0x000f1b7f, read16_delegate(FUNC(vamphalf_state::boonggab_speedup_r), this)); | |
2641 | 2641 | |
2642 | 2642 | m_palshift = 0; |
2643 | 2643 | m_has_extra_gfx = 1; |
r18027 | r18028 | |
---|---|---|
606 | 606 | DRIVER_INIT_MEMBER(raiden_state,raidena) |
607 | 607 | { |
608 | 608 | #ifdef SYNC_HACK |
609 | machine().device("sub")->memory().space(AS_PROGRAM) | |
609 | machine().device("sub")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x4008, 0x4009, FUNC(sub_cpu_spin_r)); | |
610 | 610 | #endif |
611 | 611 | } |
612 | 612 |
r18027 | r18028 | |
---|---|---|
356 | 356 | { |
357 | 357 | |
358 | 358 | // Set up the QS1000 program ROM banking, taking care not to overlap the internal RAM |
359 | machine().device("qs1000:cpu")->memory().space(AS_IO) | |
359 | machine().device("qs1000:cpu")->memory().space(AS_IO).install_read_bank(0x0100, 0xffff, "bank"); | |
360 | 360 | membank("qs1000:bank")->configure_entries(0, 8, memregion("qs1000:cpu")->base()+0x100, 0x10000); |
361 | 361 | |
362 | 362 | init_eolith_speedup(machine()); |
r18027 | r18028 | |
---|---|---|
122 | 122 | /* swap the write handlers between ROM and bank 1 based on the bit */ |
123 | 123 | if ((data & 1) == 0) |
124 | 124 | /* overlay disabled, map RAM on 0x000000 */ |
125 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
125 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(0x000000, 0x07ffff, "bank1"); | |
126 | 126 | |
127 | 127 | else |
128 | 128 | /* overlay enabled, map Amiga system ROM on 0x000000 */ |
129 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
129 | machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x000000, 0x07ffff); | |
130 | 130 | |
131 | 131 | /* bit 2 = Power Led on Amiga */ |
132 | 132 | set_led_status(machine(), 0, (data & 2) ? 0 : 1); |
r18027 | r18028 | |
---|---|---|
453 | 453 | DRIVER_INIT_MEMBER(superchs_state,superchs) |
454 | 454 | { |
455 | 455 | /* Speedup handlers */ |
456 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x100000, 0x100003, read32_delegate(FUNC(superchs_state::main_cycle_r),this)); | |
457 | machine().device("sub")->memory().space(AS_PROGRAM)->install_read_handler(0x80000a, 0x80000b, read16_delegate(FUNC(superchs_state::sub_cycle_r),this)); | |
456 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x100000, 0x100003, read32_delegate(FUNC(superchs_state::main_cycle_r),this)); | |
457 | machine().device("sub")->memory().space(AS_PROGRAM).install_read_handler(0x80000a, 0x80000b, read16_delegate(FUNC(superchs_state::sub_cycle_r),this)); | |
458 | 458 | } |
459 | 459 | |
460 | 460 | GAMEL( 1992, superchs, 0, superchs, superchs, superchs_state, superchs, ROT0, "Taito America Corporation", "Super Chase - Criminal Termination (US)", 0, layout_superchs ) |
r18027 | r18028 | |
---|---|---|
860 | 860 | |
861 | 861 | /* Decrypt data for z80 program */ |
862 | 862 | { |
863 | address_space &space = | |
863 | address_space &space = machine().device("audiocpu")->memory().space(AS_PROGRAM); | |
864 | 864 | UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0x20000); |
865 | 865 | UINT8 *rom = machine().root_device().memregion("audiocpu")->base(); |
866 | 866 | int i; |
r18027 | r18028 | |
---|---|---|
316 | 316 | |
317 | 317 | DRIVER_INIT_MEMBER(renegade_state,kuniokunb) |
318 | 318 | { |
319 | address_space &space = | |
319 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
320 | 320 | |
321 | 321 | /* Remove the MCU handlers */ |
322 | 322 | space.unmap_readwrite(0x3804, 0x3804); |
r18027 | r18028 | |
---|---|---|
371 | 371 | { |
372 | 372 | meritm_state *state = machine.driver_data<meritm_state>(); |
373 | 373 | for(int i = 0; i < count; i++) |
374 | state->m_microtouch->rx( | |
374 | state->m_microtouch->rx(machine.driver_data()->generic_space(), 0, data[i]); | |
375 | 375 | } |
376 | 376 | |
377 | 377 | WRITE8_MEMBER(meritm_state::microtouch_tx) |
r18027 | r18028 | |
2047 | 2047 | |
2048 | 2048 | ds1204_init(machine(), megat3_ds1204_key, megat3_ds1204_nvram); |
2049 | 2049 | |
2050 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2050 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xfff8, 0xffff, read8_delegate(FUNC(meritm_state::meritm_ds1644_r), this), write8_delegate(FUNC(meritm_state::meritm_ds1644_w), this)); | |
2051 | 2051 | |
2052 | 2052 | }; |
2053 | 2053 | |
r18027 | r18028 | |
2077 | 2077 | |
2078 | 2078 | ds1204_init(machine(), 0, megat4te_ds1204_nvram); |
2079 | 2079 | |
2080 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2080 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xfff8, 0xffff, read8_delegate(FUNC(meritm_state::meritm_ds1644_r), this), write8_delegate(FUNC(meritm_state::meritm_ds1644_w), this)); | |
2081 | 2081 | |
2082 | 2082 | }; |
2083 | 2083 | |
r18027 | r18028 | |
2088 | 2088 | |
2089 | 2089 | ds1204_init(machine(), 0, megat4te_ds1204_nvram); |
2090 | 2090 | |
2091 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2091 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xfff8, 0xffff, read8_delegate(FUNC(meritm_state::meritm_ds1644_r), this), write8_delegate(FUNC(meritm_state::meritm_ds1644_w), this)); | |
2092 | 2092 | |
2093 | 2093 | }; |
2094 | 2094 | |
r18027 | r18028 | |
2108 | 2108 | |
2109 | 2109 | ds1204_init(machine(), 0, megat5_ds1204_nvram); |
2110 | 2110 | |
2111 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2111 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xfff8, 0xffff, read8_delegate(FUNC(meritm_state::meritm_ds1644_r), this), write8_delegate(FUNC(meritm_state::meritm_ds1644_w), this)); | |
2112 | 2112 | |
2113 | 2113 | } |
2114 | 2114 |
r18027 | r18028 | |
---|---|---|
964 | 964 | |
965 | 965 | DRIVER_INIT_MEMBER(atarisy4_state,laststar) |
966 | 966 | { |
967 | address_space &main = | |
967 | address_space &main = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
968 | 968 | |
969 | 969 | /* Allocate 16kB of shared RAM */ |
970 | 970 | m_shared_ram[0] = auto_alloc_array_clear(machine(), UINT16, 0x2000); |
r18027 | r18028 | |
976 | 976 | /* Set up the DSP */ |
977 | 977 | membank("dsp0_bank0")->set_base(m_shared_ram[0]); |
978 | 978 | membank("dsp0_bank1")->set_base(&m_shared_ram[0][0x800]); |
979 | load_ldafile( | |
979 | load_ldafile(machine().device("dsp0")->memory().space(AS_PROGRAM), memregion("dsp")->base()); | |
980 | 980 | } |
981 | 981 | |
982 | 982 | DRIVER_INIT_MEMBER(atarisy4_state,airrace) |
r18027 | r18028 | |
986 | 986 | m_shared_ram[1] = auto_alloc_array_clear(machine(), UINT16, 0x4000); |
987 | 987 | |
988 | 988 | /* Populate RAM with data from the HEX files */ |
989 | load_hexfile( | |
989 | load_hexfile(machine().device("maincpu")->memory().space(AS_PROGRAM), memregion("code")->base()); | |
990 | 990 | |
991 | 991 | /* Set up the first DSP */ |
992 | 992 | membank("dsp0_bank0")->set_base(m_shared_ram[0]); |
993 | 993 | membank("dsp0_bank1")->set_base(&m_shared_ram[0][0x800]); |
994 | load_ldafile( | |
994 | load_ldafile(machine().device("dsp0")->memory().space(AS_PROGRAM), memregion("dsp")->base()); | |
995 | 995 | |
996 | 996 | /* Set up the second DSP */ |
997 | 997 | membank("dsp1_bank0")->set_base(m_shared_ram[1]); |
998 | 998 | membank("dsp1_bank1")->set_base(&m_shared_ram[1][0x800]); |
999 | load_ldafile( | |
999 | load_ldafile(machine().device("dsp1")->memory().space(AS_PROGRAM), memregion("dsp")->base()); | |
1000 | 1000 | } |
1001 | 1001 | |
1002 | 1002 | void atarisy4_state::machine_reset() |
r18027 | r18028 | |
---|---|---|
2083 | 2083 | |
2084 | 2084 | DRIVER_INIT_MEMBER(cninja_state,cninja) |
2085 | 2085 | { |
2086 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2086 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x1bc0a8, 0x1bc0a9, write16_delegate(FUNC(cninja_state::cninja_sound_w),this)); | |
2087 | 2087 | cninja_patch(machine()); |
2088 | 2088 | } |
2089 | 2089 | |
2090 | 2090 | DRIVER_INIT_MEMBER(cninja_state,stoneage) |
2091 | 2091 | { |
2092 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2092 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x1bc0a8, 0x1bc0a9, write16_delegate(FUNC(cninja_state::stoneage_sound_w),this)); | |
2093 | 2093 | } |
2094 | 2094 | |
2095 | 2095 | DRIVER_INIT_MEMBER(cninja_state,mutantf) |
r18027 | r18028 | |
---|---|---|
518 | 518 | m_flipscreen = 0; |
519 | 519 | |
520 | 520 | /* set up an opcode base handler since we use mapped handlers for RAM */ |
521 | address_space &space = | |
521 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
522 | 522 | space.set_direct_update_handler(direct_update_delegate(FUNC(missile_state::missile_direct_handler), this)); |
523 | 523 | |
524 | 524 | /* create a timer to speed/slow the CPU */ |
r18027 | r18028 | |
731 | 731 | else if (offset < 0x4800) |
732 | 732 | { |
733 | 733 | pokey_device *pokey_dev = downcast<pokey_device *>(machine().device("pokey")); |
734 | pokey_dev->write( | |
734 | pokey_dev->write(machine().firstcpu->space(), offset, data, 0xff); | |
735 | 735 | } |
736 | 736 | |
737 | 737 | /* OUT0 */ |
r18027 | r18028 | |
794 | 794 | else if (offset < 0x4800) |
795 | 795 | { |
796 | 796 | pokey_device *pokey_dev = downcast<pokey_device *>(machine().device("pokey")); |
797 | result = pokey_dev->read( | |
797 | result = pokey_dev->read(machine().firstcpu->space(), offset & 0x0f, 0xff); | |
798 | 798 | } |
799 | 799 | |
800 | 800 | /* IN0 */ |
r18027 | r18028 | |
---|---|---|
1290 | 1290 | static void treahunt_decode( running_machine &machine ) |
1291 | 1291 | { |
1292 | 1292 | int A; |
1293 | address_space &space = | |
1293 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1294 | 1294 | UINT8 *rom = machine.root_device().memregion("maincpu")->base(); |
1295 | 1295 | UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x4000); |
1296 | 1296 | int data; |
r18027 | r18028 | |
1399 | 1399 | } |
1400 | 1400 | |
1401 | 1401 | // Set-up the weirdest questions read ever done |
1402 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1402 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xc000, 0xcfff, read8_delegate(FUNC(jack_state::striv_question_r),this)); | |
1403 | 1403 | |
1404 | 1404 | // Nop out unused sprites writes |
1405 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1405 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write(0xb000, 0xb0ff); | |
1406 | 1406 | |
1407 | 1407 | m_timer_rate = 128; |
1408 | 1408 | } |
r18027 | r18028 | |
---|---|---|
2765 | 2765 | init_common(machine()); |
2766 | 2766 | |
2767 | 2767 | /* install protection handler */ |
2768 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2768 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xd48b, 0xd48b, read8_delegate(FUNC(taitosj_state::spacecr_prot_r),this)); | |
2769 | 2769 | } |
2770 | 2770 | |
2771 | 2771 | DRIVER_INIT_MEMBER(taitosj_state,alpine) |
r18027 | r18028 | |
2773 | 2773 | init_common(machine()); |
2774 | 2774 | |
2775 | 2775 | /* install protection handlers */ |
2776 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xd40b, 0xd40b, read8_delegate(FUNC(taitosj_state::alpine_port_2_r),this)); | |
2777 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xd50f, 0xd50f, write8_delegate(FUNC(taitosj_state::alpine_protection_w),this)); | |
2776 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xd40b, 0xd40b, read8_delegate(FUNC(taitosj_state::alpine_port_2_r),this)); | |
2777 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xd50f, 0xd50f, write8_delegate(FUNC(taitosj_state::alpine_protection_w),this)); | |
2778 | 2778 | } |
2779 | 2779 | |
2780 | 2780 | DRIVER_INIT_MEMBER(taitosj_state,alpinea) |
r18027 | r18028 | |
2782 | 2782 | init_common(machine()); |
2783 | 2783 | |
2784 | 2784 | /* install protection handlers */ |
2785 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xd40b, 0xd40b, read8_delegate(FUNC(taitosj_state::alpine_port_2_r),this)); | |
2786 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xd50e, 0xd50e, write8_delegate(FUNC(taitosj_state::alpinea_bankswitch_w),this)); | |
2785 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xd40b, 0xd40b, read8_delegate(FUNC(taitosj_state::alpine_port_2_r),this)); | |
2786 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xd50e, 0xd50e, write8_delegate(FUNC(taitosj_state::alpinea_bankswitch_w),this)); | |
2787 | 2787 | } |
2788 | 2788 | |
2789 | 2789 | DRIVER_INIT_MEMBER(taitosj_state,junglhbr) |
r18027 | r18028 | |
2791 | 2791 | init_common(machine()); |
2792 | 2792 | |
2793 | 2793 | /* inverter on bits 0 and 1 */ |
2794 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2794 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x9000, 0xbfff, write8_delegate(FUNC(taitosj_state::junglhbr_characterram_w),this)); | |
2795 | 2795 | } |
2796 | 2796 | |
2797 | 2797 | GAME( 1981, spaceskr, 0, nomcu, spaceskr, taitosj_state, taitosj, ROT0, "Taito Corporation", "Space Seeker", GAME_SUPPORTS_SAVE ) |
r18027 | r18028 | |
---|---|---|
1076 | 1076 | |
1077 | 1077 | DRIVER_INIT_MEMBER(galivan_state,youmab) |
1078 | 1078 | { |
1079 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x82, 0x82, write8_delegate(FUNC(galivan_state::youmab_extra_bank_w),this)); // banks rom at 0x8000? writes 0xff and 0x00 before executing code there | |
1080 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x7fff, "bank3"); | |
1079 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x82, 0x82, write8_delegate(FUNC(galivan_state::youmab_extra_bank_w),this)); // banks rom at 0x8000? writes 0xff and 0x00 before executing code there | |
1080 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x7fff, "bank3"); | |
1081 | 1081 | membank("bank3")->set_base(memregion("maincpu")->base()); |
1082 | 1082 | |
1083 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1083 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x8000, 0xbfff, "bank2"); | |
1084 | 1084 | membank("bank2")->configure_entries(0, 2, memregion("user2")->base(), 0x4000); |
1085 | 1085 | membank("bank2")->set_entry(0); |
1086 | 1086 | |
1087 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x81, 0x81, write8_delegate(FUNC(galivan_state::youmab_81_w),this)); // ?? often, alternating values | |
1088 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x84, 0x84, write8_delegate(FUNC(galivan_state::youmab_84_w),this)); // ?? often, sequence.. | |
1087 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x81, 0x81, write8_delegate(FUNC(galivan_state::youmab_81_w),this)); // ?? often, alternating values | |
1088 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x84, 0x84, write8_delegate(FUNC(galivan_state::youmab_84_w),this)); // ?? often, sequence.. | |
1089 | 1089 | |
1090 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1090 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write(0xd800, 0xd81f); // scrolling isn't here.. | |
1091 | 1091 | |
1092 | machine().device("maincpu")->memory().space(AS_IO) | |
1092 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x8a, 0x8a, read8_delegate(FUNC(galivan_state::youmab_8a_r),this)); // ??? | |
1093 | 1093 | |
1094 | machine().device("maincpu")->memory().space(AS_IO) | |
1094 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x86, 0x86, write8_delegate(FUNC(galivan_state::youmab_86_w),this)); | |
1095 | 1095 | |
1096 | 1096 | } |
1097 | 1097 |
r18027 | r18028 | |
---|---|---|
253 | 253 | |
254 | 254 | void destiny_state::machine_reset() |
255 | 255 | { |
256 | bank_select_w( | |
256 | bank_select_w(m_maincpu->space(AS_PROGRAM), 0, 0); | |
257 | 257 | } |
258 | 258 | |
259 | 259 | static MACHINE_CONFIG_START( destiny, destiny_state ) |
r18027 | r18028 | |
---|---|---|
301 | 301 | if (state->m_showdown_bank_data[0] != NULL) |
302 | 302 | { |
303 | 303 | if (bank == 0 && state->m_bank != 0) |
304 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
304 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x4000, 0x7fff, read8_delegate(FUNC(exidy440_state::showdown_bank0_r),state)); | |
305 | 305 | else if (bank != 0 && state->m_bank == 0) |
306 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
306 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x4000, 0x7fff, "bank1"); | |
307 | 307 | } |
308 | 308 | |
309 | 309 | /* select the bank and update the bank pointer */ |
r18027 | r18028 | |
1931 | 1931 | DRIVER_INIT_MEMBER(exidy440_state,claypign) |
1932 | 1932 | { |
1933 | 1933 | DRIVER_INIT_CALL(exidy440); |
1934 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1934 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x2ec0, 0x2ec3, read8_delegate(FUNC(exidy440_state::claypign_protection_r),this)); | |
1935 | 1935 | } |
1936 | 1936 | |
1937 | 1937 | |
r18027 | r18028 | |
1940 | 1940 | DRIVER_INIT_CALL(exidy440); |
1941 | 1941 | |
1942 | 1942 | /* extra input ports and scrolling */ |
1943 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x2ec5, 0x2ec5, read8_delegate(FUNC(exidy440_state::topsecex_input_port_5_r),this)); | |
1944 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2ec6, 0x2ec6, "AN0"); | |
1945 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2ec7, 0x2ec7, "IN4"); | |
1943 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x2ec5, 0x2ec5, read8_delegate(FUNC(exidy440_state::topsecex_input_port_5_r),this)); | |
1944 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x2ec6, 0x2ec6, "AN0"); | |
1945 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x2ec7, 0x2ec7, "IN4"); | |
1946 | 1946 | |
1947 | m_topsecex_yscroll = machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1947 | m_topsecex_yscroll = machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x2ec1, 0x2ec1, write8_delegate(FUNC(exidy440_state::topsecex_yscroll_w),this)); | |
1948 | 1948 | } |
1949 | 1949 | |
1950 | 1950 |
r18027 | r18028 | |
---|---|---|
882 | 882 | mplay_start(machine()); |
883 | 883 | |
884 | 884 | /* for now ... */ |
885 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
885 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0xa10000, 0xa1001f, FUNC(megaplay_io_read), FUNC(megaplay_io_write)); | |
886 | 886 | |
887 | 887 | /* megaplay has ram shared with the bios cpu here */ |
888 | machine().device("genesis_snd_z80")->memory().space(AS_PROGRAM) | |
888 | machine().device("genesis_snd_z80")->memory().space(AS_PROGRAM).install_ram(0x2000, 0x3fff, &m_ic36_ram[0]); | |
889 | 889 | |
890 | 890 | /* instead of a RAM mirror the 68k sees the extra ram of the 2nd z80 too */ |
891 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
891 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0xa02000, 0xa03fff, FUNC(megadriv_68k_read_z80_extra_ram), FUNC(megadriv_68k_write_z80_extra_ram)); | |
892 | 892 | |
893 | 893 | init_megatech_bios(machine()); |
894 | 894 |
r18027 | r18028 | |
---|---|---|
352 | 352 | |
353 | 353 | DRIVER_INIT_MEMBER(m72_state,m72_8751) |
354 | 354 | { |
355 | address_space *program = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
356 | address_space *io = machine().device("maincpu")->memory().space(AS_IO); | |
357 | address_space *sndio = machine().device("soundcpu")->memory().space(AS_IO); | |
355 | address_space &program = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
356 | address_space &io = machine().device("maincpu")->memory().space(AS_IO); | |
357 | address_space &sndio = machine().device("soundcpu")->memory().space(AS_IO); | |
358 | 358 | |
359 | 359 | m_protection_ram = auto_alloc_array(machine(), UINT16, 0x10000/2); |
360 | program->install_read_bank(0xb0000, 0xbffff, "bank1"); | |
361 | program->install_write_handler(0xb0000, 0xb0fff, write16_delegate(FUNC(m72_state::m72_main_mcu_w),this)); | |
360 | program.install_read_bank(0xb0000, 0xbffff, "bank1"); | |
361 | program.install_write_handler(0xb0000, 0xb0fff, write16_delegate(FUNC(m72_state::m72_main_mcu_w),this)); | |
362 | 362 | membank("bank1")->set_base(m_protection_ram); |
363 | 363 | |
364 | //io->install_legacy_write_handler(0xc0, 0xc1, FUNC(loht_sample_trigger_w)); | |
365 | io->install_write_handler(0xc0, 0xc1, write16_delegate(FUNC(m72_state::m72_main_mcu_sound_w),this)); | |
364 | //io.install_legacy_write_handler(0xc0, 0xc1, FUNC(loht_sample_trigger_w)); | |
365 | io.install_write_handler(0xc0, 0xc1, write16_delegate(FUNC(m72_state::m72_main_mcu_sound_w),this)); | |
366 | 366 | |
367 | 367 | /* sound cpu */ |
368 | sndio->install_write_handler(0x82, 0x82, 0xff, 0, write8_delegate(FUNC(m72_state::m72_snd_cpu_sample_w),this)); | |
369 | sndio->install_read_handler (0x84, 0x84, 0xff, 0, read8_delegate(FUNC(m72_state::m72_snd_cpu_sample_r),this)); | |
368 | sndio.install_write_handler(0x82, 0x82, 0xff, 0, write8_delegate(FUNC(m72_state::m72_snd_cpu_sample_w),this)); | |
369 | sndio.install_read_handler (0x84, 0x84, 0xff, 0, read8_delegate(FUNC(m72_state::m72_snd_cpu_sample_r),this)); | |
370 | 370 | |
371 | 371 | /* lohtb2 */ |
372 | 372 | #if 0 |
r18027 | r18028 | |
717 | 717 | state->m_protection_ram = auto_alloc_array(machine, UINT16, 0x1000/2); |
718 | 718 | state->m_protection_code = code; |
719 | 719 | state->m_protection_crc = crc; |
720 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xb0000, 0xb0fff, "bank1"); | |
721 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xb0ffa, 0xb0ffb, read16_delegate(FUNC(m72_state::protection_r),state)); | |
722 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xb0000, 0xb0fff, write16_delegate(FUNC(m72_state::protection_w),state)); | |
720 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xb0000, 0xb0fff, "bank1"); | |
721 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xb0ffa, 0xb0ffb, read16_delegate(FUNC(m72_state::protection_r),state)); | |
722 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xb0000, 0xb0fff, write16_delegate(FUNC(m72_state::protection_w),state)); | |
723 | 723 | state->membank("bank1")->set_base(state->m_protection_ram); |
724 | 724 | } |
725 | 725 | |
726 | 726 | DRIVER_INIT_MEMBER(m72_state,bchopper) |
727 | 727 | { |
728 | 728 | install_protection_handler(machine(), bchopper_code,bchopper_crc); |
729 | machine().device("maincpu")->memory().space(AS_IO) | |
729 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0xc0, 0xc1, write16_delegate(FUNC(m72_state::bchopper_sample_trigger_w),this)); | |
730 | 730 | } |
731 | 731 | |
732 | 732 | DRIVER_INIT_MEMBER(m72_state,mrheli) |
733 | 733 | { |
734 | 734 | install_protection_handler(machine(), bchopper_code,mrheli_crc); |
735 | machine().device("maincpu")->memory().space(AS_IO) | |
735 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0xc0, 0xc1, write16_delegate(FUNC(m72_state::bchopper_sample_trigger_w),this)); | |
736 | 736 | } |
737 | 737 | |
738 | 738 | DRIVER_INIT_MEMBER(m72_state,nspirit) |
739 | 739 | { |
740 | 740 | install_protection_handler(machine(), nspirit_code,nspirit_crc); |
741 | machine().device("maincpu")->memory().space(AS_IO) | |
741 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0xc0, 0xc1, write16_delegate(FUNC(m72_state::nspirit_sample_trigger_w),this)); | |
742 | 742 | } |
743 | 743 | |
744 | 744 | DRIVER_INIT_MEMBER(m72_state,imgfight) |
745 | 745 | { |
746 | 746 | install_protection_handler(machine(), imgfight_code,imgfightj_crc); |
747 | machine().device("maincpu")->memory().space(AS_IO) | |
747 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0xc0, 0xc1, write16_delegate(FUNC(m72_state::imgfight_sample_trigger_w),this)); | |
748 | 748 | } |
749 | 749 | |
750 | 750 | DRIVER_INIT_MEMBER(m72_state,loht) |
751 | 751 | { |
752 | 752 | install_protection_handler(machine(), loht_code,loht_crc); |
753 | 753 | |
754 | machine().device("maincpu")->memory().space(AS_IO) | |
754 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0xc0, 0xc1, write16_delegate(FUNC(m72_state::loht_sample_trigger_w),this)); | |
755 | 755 | |
756 | 756 | /* since we skip the startup tests, clear video RAM to prevent garbage on title screen */ |
757 | 757 | memset(m_videoram2,0,0x4000); |
r18027 | r18028 | |
760 | 760 | DRIVER_INIT_MEMBER(m72_state,xmultiplm72) |
761 | 761 | { |
762 | 762 | install_protection_handler(machine(), xmultiplm72_code,xmultiplm72_crc); |
763 | machine().device("maincpu")->memory().space(AS_IO) | |
763 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0xc0, 0xc1, write16_delegate(FUNC(m72_state::xmultiplm72_sample_trigger_w),this)); | |
764 | 764 | } |
765 | 765 | |
766 | 766 | DRIVER_INIT_MEMBER(m72_state,dbreedm72) |
767 | 767 | { |
768 | 768 | install_protection_handler(machine(), dbreedm72_code,dbreedm72_crc); |
769 | machine().device("maincpu")->memory().space(AS_IO) | |
769 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0xc0, 0xc1, write16_delegate(FUNC(m72_state::dbreedm72_sample_trigger_w),this)); | |
770 | 770 | } |
771 | 771 | |
772 | 772 | DRIVER_INIT_MEMBER(m72_state,airduel) |
773 | 773 | { |
774 | 774 | install_protection_handler(machine(), airduel_code,airduel_crc); |
775 | machine().device("maincpu")->memory().space(AS_IO) | |
775 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0xc0, 0xc1, write16_delegate(FUNC(m72_state::airduel_sample_trigger_w),this)); | |
776 | 776 | } |
777 | 777 | |
778 | 778 | DRIVER_INIT_MEMBER(m72_state,dkgenm72) |
779 | 779 | { |
780 | 780 | install_protection_handler(machine(), dkgenm72_code,dkgenm72_crc); |
781 | machine().device("maincpu")->memory().space(AS_IO) | |
781 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0xc0, 0xc1, write16_delegate(FUNC(m72_state::dkgenm72_sample_trigger_w),this)); | |
782 | 782 | } |
783 | 783 | |
784 | 784 | DRIVER_INIT_MEMBER(m72_state,gallop) |
785 | 785 | { |
786 | machine().device("maincpu")->memory().space(AS_IO) | |
786 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0xc0, 0xc1, write16_delegate(FUNC(m72_state::gallop_sample_trigger_w),this)); | |
787 | 787 | } |
788 | 788 | |
789 | 789 |
r18027 | r18028 | |
---|---|---|
417 | 417 | WRITE8_MEMBER(r2dtank_state::pia_comp_w) |
418 | 418 | { |
419 | 419 | device_t *device = machine().device("pia_main"); |
420 | downcast<pia6821_device *>(device)->write( | |
420 | downcast<pia6821_device *>(device)->write(machine().driver_data()->generic_space(), offset, ~data); | |
421 | 421 | } |
422 | 422 | |
423 | 423 |
r18027 | r18028 | |
---|---|---|
614 | 614 | |
615 | 615 | DRIVER_INIT_MEMBER(crgolf_state,crgolfhi) |
616 | 616 | { |
617 | machine().device("audiocpu")->memory().space(AS_PROGRAM) | |
617 | machine().device("audiocpu")->memory().space(AS_PROGRAM).install_write_handler(0xa000, 0xa003, write8_delegate(FUNC(crgolf_state::crgolfhi_sample_w),this)); | |
618 | 618 | } |
619 | 619 | |
620 | 620 |
r18027 | r18028 | |
---|---|---|
194 | 194 | |
195 | 195 | MACHINE_RESET_MEMBER(rmhaihai_state,themj) |
196 | 196 | { |
197 | themj_rombank_w( | |
197 | themj_rombank_w(machine().device("maincpu")->memory().space(AS_IO), 0, 0); | |
198 | 198 | } |
199 | 199 | |
200 | 200 |
r18027 | r18028 | |
---|---|---|
512 | 512 | { |
513 | 513 | systeme_state::driver_start(); |
514 | 514 | |
515 | m_maincpu->space(AS_IO)->install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(systeme_state::ridleofp_port_f8_read), this)); | |
516 | m_maincpu->space(AS_IO)->install_write_handler(0xfa, 0xfa, write8_delegate(FUNC(systeme_state::ridleofp_port_fa_write), this)); | |
515 | m_maincpu->space(AS_IO).install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(systeme_state::ridleofp_port_f8_read), this)); | |
516 | m_maincpu->space(AS_IO).install_write_handler(0xfa, 0xfa, write8_delegate(FUNC(systeme_state::ridleofp_port_fa_write), this)); | |
517 | 517 | } |
518 | 518 | |
519 | 519 | |
r18027 | r18028 | |
521 | 521 | { |
522 | 522 | systeme_state::driver_start(); |
523 | 523 | |
524 | m_maincpu->space(AS_IO)->install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(systeme_state::hangonjr_port_f8_read), this)); | |
525 | m_maincpu->space(AS_IO)->install_write_handler(0xfa, 0xfa, write8_delegate(FUNC(systeme_state::hangonjr_port_fa_write), this)); | |
524 | m_maincpu->space(AS_IO).install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(systeme_state::hangonjr_port_f8_read), this)); | |
525 | m_maincpu->space(AS_IO).install_write_handler(0xfa, 0xfa, write8_delegate(FUNC(systeme_state::hangonjr_port_fa_write), this)); | |
526 | 526 | } |
527 | 527 | |
528 | 528 |
r18027 | r18028 | |
---|---|---|
184 | 184 | atarig1_state *state = machine.driver_data<atarig1_state>(); |
185 | 185 | |
186 | 186 | /* install a read handler */ |
187 | state->m_bslapstic_base = machine.device("maincpu")->memory().space(AS_PROGRAM) | |
187 | state->m_bslapstic_base = machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x038000, 0x03ffff, read16_delegate(FUNC(atarig1_state::pitfightb_cheap_slapstic_r),state)); | |
188 | 188 | |
189 | 189 | /* allocate memory for a copy of bank 0 */ |
190 | 190 | state->m_bslapstic_bank0 = auto_alloc_array(machine, UINT8, 0x2000); |
r18027 | r18028 | |
---|---|---|
68 | 68 | |
69 | 69 | /* both output latches are cleared on reset */ |
70 | 70 | |
71 | videopin_out1_w(*machine().memory().first_space(), 0, 0); | |
72 | videopin_out2_w(*machine().memory().first_space(), 0, 0); | |
71 | videopin_out1_w(machine().driver_data()->generic_space(), 0, 0); | |
72 | videopin_out2_w(machine().driver_data()->generic_space(), 0, 0); | |
73 | 73 | } |
74 | 74 | |
75 | 75 |
r18027 | r18028 | |
---|---|---|
3232 | 3232 | #if TUMBLEP_HACK |
3233 | 3233 | tumblepb_patch_code(machine(), 0x000132); |
3234 | 3234 | #endif |
3235 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
3235 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x100000, 0x100001, write16_delegate(FUNC(tumbleb_state::tumbleb2_soundmcu_w),this)); | |
3236 | 3236 | |
3237 | 3237 | } |
3238 | 3238 | |
r18027 | r18028 | |
3270 | 3270 | DRIVER_INIT_MEMBER(tumbleb_state,bcstory) |
3271 | 3271 | { |
3272 | 3272 | tumblepb_gfx1_rearrange(machine()); |
3273 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
3273 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x180008, 0x180009, read16_delegate(FUNC(tumbleb_state::bcstory_1a0_read),this)); // io should be here?? | |
3274 | 3274 | } |
3275 | 3275 | |
3276 | 3276 | |
r18027 | r18028 | |
3334 | 3334 | DRIVER_INIT_CALL(htchctch); |
3335 | 3335 | |
3336 | 3336 | /* different palette format, closer to tumblep -- is this controlled by a register? the palette was right with the hatch catch trojan */ |
3337 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
3337 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x140000, 0x140fff, write16_delegate(FUNC(tumbleb_state::paletteram_xxxxBBBBGGGGRRRR_word_w), this)); | |
3338 | 3338 | |
3339 | 3339 | /* slightly different banking */ |
3340 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
3340 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x100002, 0x100003, write16_delegate(FUNC(tumbleb_state::chokchok_tilebank_w),this)); | |
3341 | 3341 | } |
3342 | 3342 | |
3343 | 3343 | DRIVER_INIT_MEMBER(tumbleb_state,wlstar) |
r18027 | r18028 | |
3345 | 3345 | tumblepb_gfx1_rearrange(machine()); |
3346 | 3346 | |
3347 | 3347 | /* slightly different banking */ |
3348 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
3348 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x100002, 0x100003, write16_delegate(FUNC(tumbleb_state::wlstar_tilebank_w),this)); | |
3349 | 3349 | |
3350 | 3350 | m_protbase = 0x0000; |
3351 | 3351 | } |
r18027 | r18028 | |
---|---|---|
1438 | 1438 | cd32_state *state = machine.driver_data<cd32_state>(); |
1439 | 1439 | UINT8 data8 = data & 0xff; |
1440 | 1440 | if ( data8 != 0x00 ) |
1441 | state->m_microtouch->rx( | |
1441 | state->m_microtouch->rx(machine.driver_data()->generic_space(), 0, data8); | |
1442 | 1442 | } |
1443 | 1443 | |
1444 | 1444 | WRITE8_MEMBER (cd32_state::microtouch_tx) |
r18027 | r18028 | |
---|---|---|
711 | 711 | |
712 | 712 | static UINT8 *decrypt_code(running_machine &machine) |
713 | 713 | { |
714 | address_space &space = | |
714 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
715 | 715 | UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x10000); |
716 | 716 | UINT8 *rom = machine.root_device().memregion("maincpu")->base(); |
717 | 717 | int A; |
r18027 | r18028 | |
---|---|---|
679 | 679 | |
680 | 680 | INTERRUPT_GEN_MEMBER(m90_state::fake_nmi) |
681 | 681 | { |
682 | address_space &space = | |
682 | address_space &space = machine().firstcpu->space(AS_PROGRAM); | |
683 | 683 | int sample = m72_sample_r(m_audio,space,0); |
684 | 684 | if (sample) |
685 | 685 | m72_sample_w(m_audio,space,0,sample); |
r18027 | r18028 | |
687 | 687 | |
688 | 688 | INTERRUPT_GEN_MEMBER(m90_state::bomblord_fake_nmi) |
689 | 689 | { |
690 | address_space &space = | |
690 | address_space &space = machine().firstcpu->space(AS_PROGRAM); | |
691 | 691 | int sample = m72_sample_r(m_audio,space,0); |
692 | 692 | if (sample != 0x80) |
693 | 693 | m72_sample_w(m_audio,space,0,sample); |
r18027 | r18028 | |
1183 | 1183 | DRIVER_INIT_MEMBER(m90_state,quizf1) |
1184 | 1184 | { |
1185 | 1185 | membank("bank1")->configure_entries(0, 16, memregion("user1")->base(), 0x10000); |
1186 | machine().device("maincpu")->memory().space(AS_IO) | |
1186 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x04, 0x05, write16_delegate(FUNC(m90_state::quizf1_bankswitch_w),this)); | |
1187 | 1187 | } |
1188 | 1188 | |
1189 | 1189 |
r18027 | r18028 | |
---|---|---|
1083 | 1083 | DRIVER_INIT_MEMBER(phoenix_state,condor) |
1084 | 1084 | { |
1085 | 1085 | /* additional inputs for coinage */ |
1086 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1086 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x5000, 0x5000, "DSW1"); | |
1087 | 1087 | } |
1088 | 1088 | |
1089 | 1089 |
r18027 | r18028 | |
---|---|---|
232 | 232 | { |
233 | 233 | static UINT32 src_addr = 0x100000; |
234 | 234 | static int frame; |
235 | address_space &space = | |
235 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
236 | 236 | |
237 | 237 | //if(machine().input().code_pressed_once(KEYCODE_A)) |
238 | 238 | // src_addr+=0x800; |
r18027 | r18028 | |
---|---|---|
63 | 63 | |
64 | 64 | READ16_MEMBER(lockon_state::main_gnd_r) |
65 | 65 | { |
66 | address_space *gndspace = m_ground->memory().space(AS_PROGRAM); | |
67 | return gndspace->read_word(V30_GND_ADDR | offset * 2); | |
66 | address_space &gndspace = m_ground->memory().space(AS_PROGRAM); | |
67 | return gndspace.read_word(V30_GND_ADDR | offset * 2); | |
68 | 68 | } |
69 | 69 | |
70 | 70 | WRITE16_MEMBER(lockon_state::main_gnd_w) |
71 | 71 | { |
72 | address_space | |
72 | address_space &gndspace = m_ground->memory().space(AS_PROGRAM); | |
73 | 73 | |
74 | 74 | if (ACCESSING_BITS_0_7) |
75 | gndspace | |
75 | gndspace.write_byte(V30_GND_ADDR | (offset * 2 + 0), data); | |
76 | 76 | if (ACCESSING_BITS_8_15) |
77 | gndspace | |
77 | gndspace.write_byte(V30_GND_ADDR | (offset * 2 + 1), data >> 8); | |
78 | 78 | } |
79 | 79 | |
80 | 80 | READ16_MEMBER(lockon_state::main_obj_r) |
81 | 81 | { |
82 | address_space *objspace = m_object->memory().space(AS_PROGRAM); | |
83 | return objspace->read_word(V30_OBJ_ADDR | offset * 2); | |
82 | address_space &objspace = m_object->memory().space(AS_PROGRAM); | |
83 | return objspace.read_word(V30_OBJ_ADDR | offset * 2); | |
84 | 84 | } |
85 | 85 | |
86 | 86 | WRITE16_MEMBER(lockon_state::main_obj_w) |
87 | 87 | { |
88 | address_space | |
88 | address_space &objspace =m_object->memory().space(AS_PROGRAM); | |
89 | 89 | |
90 | 90 | if (ACCESSING_BITS_0_7) |
91 | objspace | |
91 | objspace.write_byte(V30_OBJ_ADDR | (offset * 2 + 0), data); | |
92 | 92 | if (ACCESSING_BITS_8_15) |
93 | objspace | |
93 | objspace.write_byte(V30_OBJ_ADDR | (offset * 2 + 1), data >> 8); | |
94 | 94 | } |
95 | 95 | |
96 | 96 | WRITE16_MEMBER(lockon_state::tst_w) |
r18027 | r18028 | |
98 | 98 | |
99 | 99 | if (offset < 0x800) |
100 | 100 | { |
101 | address_space *gndspace = m_ground->memory().space(AS_PROGRAM); | |
102 | address_space *objspace = m_object->memory().space(AS_PROGRAM); | |
101 | address_space &gndspace = m_ground->memory().space(AS_PROGRAM); | |
102 | address_space &objspace = m_object->memory().space(AS_PROGRAM); | |
103 | 103 | |
104 | 104 | if (ACCESSING_BITS_0_7) |
105 | gndspace | |
105 | gndspace.write_byte(V30_GND_ADDR | (offset * 2 + 0), data); | |
106 | 106 | if (ACCESSING_BITS_8_15) |
107 | gndspace | |
107 | gndspace.write_byte(V30_GND_ADDR | (offset * 2 + 1), data >> 8); | |
108 | 108 | |
109 | 109 | if (ACCESSING_BITS_0_7) |
110 | objspace | |
110 | objspace.write_byte(V30_OBJ_ADDR | (offset * 2 + 0), data); | |
111 | 111 | if (ACCESSING_BITS_8_15) |
112 | objspace | |
112 | objspace.write_byte(V30_OBJ_ADDR | (offset * 2 + 1), data >> 8); | |
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
116 | 116 | READ16_MEMBER(lockon_state::main_z80_r) |
117 | 117 | { |
118 | address_space *sndspace = m_audiocpu->space(AS_PROGRAM); | |
119 | return 0xff00 | sndspace->read_byte(offset); | |
118 | address_space &sndspace = m_audiocpu->space(AS_PROGRAM); | |
119 | return 0xff00 | sndspace.read_byte(offset); | |
120 | 120 | } |
121 | 121 | |
122 | 122 | WRITE16_MEMBER(lockon_state::main_z80_w) |
123 | 123 | { |
124 | address_space *sndspace = m_audiocpu->space(AS_PROGRAM); | |
125 | sndspace->write_byte(offset, data); | |
124 | address_space &sndspace = m_audiocpu->space(AS_PROGRAM); | |
125 | sndspace.write_byte(offset, data); | |
126 | 126 | } |
127 | 127 | |
128 | 128 | WRITE16_MEMBER(lockon_state::inten_w) |
r18027 | r18028 | |
---|---|---|
764 | 764 | |
765 | 765 | DRIVER_INIT_MEMBER(tigeroad_state,tigeroad) |
766 | 766 | { |
767 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
767 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xfe4002, 0xfe4003, write16_delegate(FUNC(tigeroad_state::tigeroad_soundcmd_w),this)); | |
768 | 768 | } |
769 | 769 | |
770 | 770 | DRIVER_INIT_MEMBER(tigeroad_state,f1dream) |
771 | 771 | { |
772 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
772 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xfe4002, 0xfe4003, write16_delegate(FUNC(tigeroad_state::f1dream_control_w),this)); | |
773 | 773 | } |
774 | 774 | |
775 | 775 |
r18027 | r18028 | |
---|---|---|
220 | 220 | set_led_status(machine(), 9,data & 0x08); |
221 | 221 | |
222 | 222 | /* bit 5 - ticket out in trivia games */ |
223 | machine().device<ticket_dispenser_device>("ticket")->write( | |
223 | machine().device<ticket_dispenser_device>("ticket")->write(machine().driver_data()->generic_space(), 0, (data & 0x20)<< 2); | |
224 | 224 | |
225 | 225 | /* bit 6 enables NMI */ |
226 | 226 | m_nmi_mask = data & 0x40; |
r18027 | r18028 | |
---|---|---|
4209 | 4209 | DRIVER_INIT_MEMBER(segas32_state,arescue) |
4210 | 4210 | { |
4211 | 4211 | segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this)); |
4212 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
4212 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xa00000, 0xa00007, read16_delegate(FUNC(segas32_state::arescue_dsp_r),this), write16_delegate(FUNC(segas32_state::arescue_dsp_w),this)); | |
4213 | 4213 | |
4214 | 4214 | m_dual_pcb_comms = auto_alloc_array(machine(), UINT16, 0x1000/2); |
4215 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x810000, 0x810fff, read16_delegate(FUNC(segas32_state::dual_pcb_comms_r),this), write16_delegate(FUNC(segas32_state::dual_pcb_comms_w),this)); | |
4216 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x818000, 0x818003, read16_delegate(FUNC(segas32_state::dual_pcb_masterslave),this)); | |
4215 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x810000, 0x810fff, read16_delegate(FUNC(segas32_state::dual_pcb_comms_r),this), write16_delegate(FUNC(segas32_state::dual_pcb_comms_w),this)); | |
4216 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x818000, 0x818003, read16_delegate(FUNC(segas32_state::dual_pcb_masterslave),this)); | |
4217 | 4217 | |
4218 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x810000, 0x810001, read16_delegate(FUNC(segas32_state::arescue_handshake_r),this)); | |
4219 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x81000e, 0x81000f, read16_delegate(FUNC(segas32_state::arescue_slavebusy_r),this)); | |
4218 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x810000, 0x810001, read16_delegate(FUNC(segas32_state::arescue_handshake_r),this)); | |
4219 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x81000e, 0x81000f, read16_delegate(FUNC(segas32_state::arescue_slavebusy_r),this)); | |
4220 | 4220 | |
4221 | 4221 | m_sw1_output = arescue_sw1_output; |
4222 | 4222 | } |
r18027 | r18028 | |
4227 | 4227 | segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate()); |
4228 | 4228 | |
4229 | 4229 | /* install protection handlers */ |
4230 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xa00100, 0xa0011f, read16_delegate(FUNC(segas32_state::arf_wakeup_protection_r),this)); | |
4231 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xa00000, 0xa00fff, read16_delegate(FUNC(segas32_state::arabfgt_protection_r),this), write16_delegate(FUNC(segas32_state::arabfgt_protection_w),this)); | |
4230 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xa00100, 0xa0011f, read16_delegate(FUNC(segas32_state::arf_wakeup_protection_r),this)); | |
4231 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xa00000, 0xa00fff, read16_delegate(FUNC(segas32_state::arabfgt_protection_r),this), write16_delegate(FUNC(segas32_state::arabfgt_protection_w),this)); | |
4232 | 4232 | } |
4233 | 4233 | |
4234 | 4234 | |
r18027 | r18028 | |
4238 | 4238 | |
4239 | 4239 | /* install protection handlers */ |
4240 | 4240 | m_system32_protram = auto_alloc_array(machine(), UINT16, 0x1000/2); |
4241 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x20ba00, 0x20ba07, read16_delegate(FUNC(segas32_state::brival_protection_r),this)); | |
4242 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xa00000, 0xa00fff, write16_delegate(FUNC(segas32_state::brival_protection_w),this)); | |
4241 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x20ba00, 0x20ba07, read16_delegate(FUNC(segas32_state::brival_protection_r),this)); | |
4242 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xa00000, 0xa00fff, write16_delegate(FUNC(segas32_state::brival_protection_w),this)); | |
4243 | 4243 | } |
4244 | 4244 | |
4245 | 4245 | |
r18027 | r18028 | |
4248 | 4248 | segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate()); |
4249 | 4249 | |
4250 | 4250 | /* install protection handlers */ |
4251 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
4251 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xa00000, 0xa7ffff, read16_delegate(FUNC(segas32_state::darkedge_protection_r),this), write16_delegate(FUNC(segas32_state::darkedge_protection_w),this)); | |
4252 | 4252 | m_system32_prot_vblank = darkedge_fd1149_vblank; |
4253 | 4253 | } |
4254 | 4254 | |
r18027 | r18028 | |
4257 | 4257 | segas32_common_init(machine(), read16_delegate(), write16_delegate()); |
4258 | 4258 | |
4259 | 4259 | /* install protection handlers */ |
4260 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
4260 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xa00000, 0xa7ffff, read16_delegate(FUNC(segas32_state::dbzvrvs_protection_r),this), write16_delegate(FUNC(segas32_state::dbzvrvs_protection_w),this)); | |
4261 | 4261 | } |
4262 | 4262 | |
4263 | 4263 | WRITE16_MEMBER(segas32_state::f1en_comms_echo_w) |
r18027 | r18028 | |
4272 | 4272 | segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this)); |
4273 | 4273 | |
4274 | 4274 | m_dual_pcb_comms = auto_alloc_array(machine(), UINT16, 0x1000/2); |
4275 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x810000, 0x810fff, read16_delegate(FUNC(segas32_state::dual_pcb_comms_r),this), write16_delegate(FUNC(segas32_state::dual_pcb_comms_w),this)); | |
4276 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x818000, 0x818003, read16_delegate(FUNC(segas32_state::dual_pcb_masterslave),this)); | |
4275 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x810000, 0x810fff, read16_delegate(FUNC(segas32_state::dual_pcb_comms_r),this), write16_delegate(FUNC(segas32_state::dual_pcb_comms_w),this)); | |
4276 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x818000, 0x818003, read16_delegate(FUNC(segas32_state::dual_pcb_masterslave),this)); | |
4277 | 4277 | |
4278 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
4278 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x810048, 0x810049, write16_delegate(FUNC(segas32_state::f1en_comms_echo_w),this)); | |
4279 | 4279 | |
4280 | 4280 | m_sw1_output = radm_sw1_output; |
4281 | 4281 | } |
r18027 | r18028 | |
4288 | 4288 | segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this)); |
4289 | 4289 | |
4290 | 4290 | m_dual_pcb_comms = auto_alloc_array(machine(), UINT16, 0x1000/2); |
4291 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x800000, 0x800fff, read16_delegate(FUNC(segas32_state::dual_pcb_comms_r),this), write16_delegate(FUNC(segas32_state::dual_pcb_comms_w),this)); | |
4292 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x801000, 0x801003, read16_delegate(FUNC(segas32_state::dual_pcb_masterslave),this)); | |
4291 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x800000, 0x800fff, read16_delegate(FUNC(segas32_state::dual_pcb_comms_r),this), write16_delegate(FUNC(segas32_state::dual_pcb_comms_w),this)); | |
4292 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x801000, 0x801003, read16_delegate(FUNC(segas32_state::dual_pcb_masterslave),this)); | |
4293 | 4293 | |
4294 | // machine().device("maincpu")->memory().space(AS_PROGRAM) | |
4294 | // machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x800048, 0x800049, write16_delegate(FUNC(segas32_state::f1en_comms_echo_w),this)); | |
4295 | 4295 | m_system32_prot_vblank = f1lap_fd1149_vblank; |
4296 | 4296 | |
4297 | 4297 | m_sw1_output = f1lap_sw1_output; |
r18027 | r18028 | |
4303 | 4303 | segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate()); |
4304 | 4304 | |
4305 | 4305 | decrypt_ga2_protrom(machine()); |
4306 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
4306 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xa00000, 0xa00fff, read16_delegate(FUNC(segas32_state::ga2_dpram_r),this), write16_delegate(FUNC(segas32_state::ga2_dpram_w),this)); | |
4307 | 4307 | } |
4308 | 4308 | |
4309 | 4309 | |
r18027 | r18028 | |
4363 | 4363 | DRIVER_INIT_MEMBER(segas32_state,scross) |
4364 | 4364 | { |
4365 | 4365 | segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this)); |
4366 | machine().device("soundcpu")->memory().space(AS_PROGRAM) | |
4366 | machine().device("soundcpu")->memory().space(AS_PROGRAM).install_write_handler(0xb0, 0xbf, write8_delegate(FUNC(segas32_state::scross_bank_w),this)); | |
4367 | 4367 | |
4368 | 4368 | m_sw1_output = scross_sw1_output; |
4369 | 4369 | m_sw2_output = scross_sw2_output; |
r18027 | r18028 | |
4381 | 4381 | segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::sonic_custom_io_r),this), write16_delegate(FUNC(segas32_state::sonic_custom_io_w),this)); |
4382 | 4382 | |
4383 | 4383 | /* install protection handlers */ |
4384 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
4384 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x20E5C4, 0x20E5C5, write16_delegate(FUNC(segas32_state::sonic_level_load_protection),this)); | |
4385 | 4385 | } |
4386 | 4386 | |
4387 | 4387 | |
r18027 | r18028 | |
4406 | 4406 | DRIVER_INIT_MEMBER(segas32_state,jleague) |
4407 | 4407 | { |
4408 | 4408 | segas32_common_init(machine(), read16_delegate(), write16_delegate()); |
4409 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
4409 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x20F700, 0x20F705, write16_delegate(FUNC(segas32_state::jleague_protection_w),this)); | |
4410 | 4410 | } |
4411 | 4411 | |
4412 | 4412 |
r18027 | r18028 | |
---|---|---|
916 | 916 | rom[i] = BITSWAP8(rom[i], 0,1,2,3,4,5,6,7); |
917 | 917 | |
918 | 918 | /* install protection handlers */ |
919 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
919 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x7000, 0x7007, read8_delegate(FUNC(looping_state::protection_r), this)); | |
920 | 920 | } |
921 | 921 | |
922 | 922 |
r18027 | r18028 | |
---|---|---|
187 | 187 | |
188 | 188 | static void scanline_update(screen_device &screen, int scanline) |
189 | 189 | { |
190 | address_space &space = | |
190 | address_space &space = screen.machine().device("audiocpu")->memory().space(AS_PROGRAM); | |
191 | 191 | |
192 | 192 | /* sound IRQ is on 32V */ |
193 | 193 | if (scanline & 32) |
r18027 | r18028 | |
---|---|---|
1739 | 1739 | |
1740 | 1740 | DRIVER_INIT_MEMBER(slapfght_state,tigerh) |
1741 | 1741 | { |
1742 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1742 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xe803, 0xe803, read8_delegate(FUNC(slapfght_state::tigerh_mcu_r),this), write8_delegate(FUNC(slapfght_state::tigerh_mcu_w),this)); | |
1743 | 1743 | } |
1744 | 1744 | |
1745 | 1745 | DRIVER_INIT_MEMBER(slapfght_state,tigerhb) |
1746 | 1746 | { |
1747 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1747 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xe803, 0xe803, read8_delegate(FUNC(slapfght_state::tigerhb_e803_r),this), write8_delegate(FUNC(slapfght_state::tigerhb_e803_w),this)); | |
1748 | 1748 | } |
1749 | 1749 | |
1750 | 1750 | |
r18027 | r18028 | |
1805 | 1805 | static void getstar_init( running_machine &machine ) |
1806 | 1806 | { |
1807 | 1807 | slapfght_state *state = machine.driver_data<slapfght_state>(); |
1808 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xe803, 0xe803, read8_delegate(FUNC(slapfght_state::getstar_e803_r),state), write8_delegate(FUNC(slapfght_state::getstar_e803_w),state)); | |
1809 | machine.device("maincpu")->memory().space(AS_IO)->install_read_handler(0x00, 0x00, read8_delegate(FUNC(slapfght_state::slapfight_port_00_r),state)); | |
1808 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xe803, 0xe803, read8_delegate(FUNC(slapfght_state::getstar_e803_r),state), write8_delegate(FUNC(slapfght_state::getstar_e803_w),state)); | |
1809 | machine.device("maincpu")->memory().space(AS_IO).install_read_handler(0x00, 0x00, read8_delegate(FUNC(slapfght_state::slapfight_port_00_r),state)); | |
1810 | 1810 | } |
1811 | 1811 | |
1812 | 1812 | DRIVER_INIT_MEMBER(slapfght_state,getstar) |
r18027 | r18028 | |
1829 | 1829 | getstar_init(machine()); |
1830 | 1830 | |
1831 | 1831 | /* specific handlers for this bootleg */ |
1832 | machine().device("maincpu")->memory().space(AS_IO) | |
1832 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x0, 0x0, read8_delegate(FUNC(slapfght_state::gtstarb1_port_0_read),this)); | |
1833 | 1833 | /* requires this or it gets stuck with 'rom test' on screen */ |
1834 | 1834 | /* it is possible the program roms are slighly corrupt like the gfx roms, or |
1835 | 1835 | that the bootleg simply shouldn't execute the code due to the modified roms */ |
r18027 | r18028 | |
1845 | 1845 | |
1846 | 1846 | DRIVER_INIT_MEMBER(slapfght_state,slapfigh) |
1847 | 1847 | { |
1848 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xe803, 0xe803, read8_delegate(FUNC(slapfght_state::slapfight_mcu_r),this), write8_delegate(FUNC(slapfght_state::slapfight_mcu_w),this)); | |
1849 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x00, 0x00, read8_delegate(FUNC(slapfght_state::slapfight_mcu_status_r),this)); | |
1848 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xe803, 0xe803, read8_delegate(FUNC(slapfght_state::slapfight_mcu_r),this), write8_delegate(FUNC(slapfght_state::slapfight_mcu_w),this)); | |
1849 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x00, 0x00, read8_delegate(FUNC(slapfght_state::slapfight_mcu_status_r),this)); | |
1850 | 1850 | } |
1851 | 1851 | |
1852 | 1852 | DRIVER_INIT_MEMBER(slapfght_state,perfrman) |
1853 | 1853 | { |
1854 | machine().device("maincpu")->memory().space(AS_IO) | |
1854 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x00, 0x00, read8_delegate(FUNC(slapfght_state::perfrman_port_00_r),this)); | |
1855 | 1855 | } |
1856 | 1856 | |
1857 | 1857 | /* ( YEAR NAME PARENT MACHINE INPUT INIT MONITOR COMPANY FULLNAME FLAGS ) */ |
r18027 | r18028 | |
---|---|---|
1259 | 1259 | { |
1260 | 1260 | sh2drc_set_options(machine().device("maincpu"), SH2DRC_FASTEST_OPTIONS); |
1261 | 1261 | /* needs to install mahjong controls too (can select joystick in test mode tho) */ |
1262 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1262 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x03000000, 0x03000003, read32_delegate(FUNC(psikyosh_state::mjgtaste_input_r),this)); | |
1263 | 1263 | } |
1264 | 1264 | |
1265 | 1265 |
r18027 | r18028 | |
---|---|---|
288 | 288 | |
289 | 289 | void supertnk_state::machine_reset() |
290 | 290 | { |
291 | address_space &space = | |
291 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
292 | 292 | supertnk_bankswitch_0_w(space, 0, 0); |
293 | 293 | supertnk_bankswitch_1_w(space, 0, 0); |
294 | 294 |
r18027 | r18028 | |
---|---|---|
490 | 490 | atarijsa_init(machine(), "260010", 0x0040); |
491 | 491 | |
492 | 492 | /* install son-of-slapstic workarounds */ |
493 | m_spritecache_count = machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x3fde42, 0x3fde43, read16_delegate(FUNC(offtwall_state::spritecache_count_r),this)); | |
494 | m_bankswitch_base = machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x037ec2, 0x037f39, read16_delegate(FUNC(offtwall_state::bankswitch_r),this)); | |
495 | m_unknown_verify_base = machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x3fdf1e, 0x3fdf1f, read16_delegate(FUNC(offtwall_state::unknown_verify_r),this)); | |
493 | m_spritecache_count = machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x3fde42, 0x3fde43, read16_delegate(FUNC(offtwall_state::spritecache_count_r),this)); | |
494 | m_bankswitch_base = machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x037ec2, 0x037f39, read16_delegate(FUNC(offtwall_state::bankswitch_r),this)); | |
495 | m_unknown_verify_base = machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x3fdf1e, 0x3fdf1f, read16_delegate(FUNC(offtwall_state::unknown_verify_r),this)); | |
496 | 496 | } |
497 | 497 | |
498 | 498 | |
r18027 | r18028 | |
502 | 502 | atarijsa_init(machine(), "260010", 0x0040); |
503 | 503 | |
504 | 504 | /* install son-of-slapstic workarounds */ |
505 | m_spritecache_count = machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x3fde42, 0x3fde43, read16_delegate(FUNC(offtwall_state::spritecache_count_r),this)); | |
506 | m_bankswitch_base = machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x037eca, 0x037f43, read16_delegate(FUNC(offtwall_state::bankswitch_r),this)); | |
507 | m_unknown_verify_base = machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x3fdf24, 0x3fdf25, read16_delegate(FUNC(offtwall_state::unknown_verify_r),this)); | |
505 | m_spritecache_count = machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x3fde42, 0x3fde43, read16_delegate(FUNC(offtwall_state::spritecache_count_r),this)); | |
506 | m_bankswitch_base = machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x037eca, 0x037f43, read16_delegate(FUNC(offtwall_state::bankswitch_r),this)); | |
507 | m_unknown_verify_base = machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x3fdf24, 0x3fdf25, read16_delegate(FUNC(offtwall_state::unknown_verify_r),this)); | |
508 | 508 | } |
509 | 509 | |
510 | 510 |
r18027 | r18028 | |
---|---|---|
9724 | 9724 | neo_pcm2_swap(machine(), 5); |
9725 | 9725 | m_fixed_layer_bank_type = 2; |
9726 | 9726 | install_pvc_protection(machine()); |
9727 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
9727 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xc00000, 0xc7ffff, "bios" ); // 512k bios | |
9728 | 9728 | } |
9729 | 9729 | |
9730 | 9730 | DRIVER_INIT_MEMBER(neogeo_state,kof2003) |
r18027 | r18028 | |
9796 | 9796 | kof2000_neogeo_gfx_decrypt(machine(), 0xac); |
9797 | 9797 | |
9798 | 9798 | /* install some extra RAM */ |
9799 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
9799 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_ram(0x200000, 0x201fff); | |
9800 | 9800 | |
9801 | // machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x280000, 0x280001, "IN5"); | |
9802 | // machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2c0000, 0x2c0001, "IN6"); | |
9801 | // machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x280000, 0x280001, "IN5"); | |
9802 | // machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x2c0000, 0x2c0001, "IN6"); | |
9803 | 9803 | } |
9804 | 9804 | |
9805 | 9805 | DRIVER_INIT_MEMBER(neogeo_state,vliner) |
9806 | 9806 | { |
9807 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
9807 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_ram(0x200000, 0x201fff); | |
9808 | 9808 | |
9809 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x280000, 0x280001, "IN5"); | |
9810 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2c0000, 0x2c0001, "IN6"); | |
9809 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x280000, 0x280001, "IN5"); | |
9810 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x2c0000, 0x2c0001, "IN6"); | |
9811 | 9811 | |
9812 | 9812 | DRIVER_INIT_CALL(neogeo); |
9813 | 9813 | } |
r18027 | r18028 | |
9815 | 9815 | DRIVER_INIT_MEMBER(neogeo_state,kog) |
9816 | 9816 | { |
9817 | 9817 | /* overlay cartridge ROM */ |
9818 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
9818 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x0ffffe, 0x0fffff, "JUMPER"); | |
9819 | 9819 | |
9820 | 9820 | kog_px_decrypt(machine()); |
9821 | 9821 | neogeo_bootleg_sx_decrypt(machine(), 1); |
r18027 | r18028 | |
9875 | 9875 | // there are also writes to 0x1080.. |
9876 | 9876 | // |
9877 | 9877 | // other stuff going on as well tho, the main overlay is still missing, and p1 inputs don't work |
9878 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00200, 0x001fff, FUNC(sbp_lowerrom_r)); | |
9879 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00200, 0x001fff, FUNC(sbp_lowerrom_w)); | |
9878 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x00200, 0x001fff, FUNC(sbp_lowerrom_r)); | |
9879 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x00200, 0x001fff, FUNC(sbp_lowerrom_w)); | |
9880 | 9880 | |
9881 | 9881 | /* the game code clears the text overlay used ingame immediately after writing it.. why? protection? sloppy code that the hw ignores? imperfect emulation? */ |
9882 | 9882 | { |
r18027 | r18028 | |
---|---|---|
427 | 427 | WRITE8_DEVICE_HANDLER( segas16a_state::static_n7751_rom_offset_w ) |
428 | 428 | { |
429 | 429 | segas16a_state *state = device->machine().driver_data<segas16a_state>(); |
430 | state->n7751_rom_offset_w( | |
430 | state->n7751_rom_offset_w(state->m_maincpu->space(AS_PROGRAM), offset, data); | |
431 | 431 | } |
432 | 432 | |
433 | 433 | |
r18027 | r18028 | |
539 | 539 | case 0: |
540 | 540 | // access main work RAM |
541 | 541 | if (offset >= 0x4000 && offset < 0x8000) |
542 | m_maincpu->space(AS_PROGRAM) | |
542 | m_maincpu->space(AS_PROGRAM).write_byte(0xc70001 ^ (offset & 0x3fff), data); | |
543 | 543 | |
544 | 544 | // access misc I/O space |
545 | 545 | else if (offset >= 0x8000 && offset < 0xc000) |
546 | m_maincpu->space(AS_PROGRAM) | |
546 | m_maincpu->space(AS_PROGRAM).write_byte(0xc40001 ^ (offset & 0x3fff), data); | |
547 | 547 | else |
548 | 548 | logerror("%03X: MCU movx write mode %02X offset %04X = %02X\n", m_mcu->pc(), m_mcu_control, offset, data); |
549 | 549 | break; |
r18027 | r18028 | |
551 | 551 | // access text RAM |
552 | 552 | case 1: |
553 | 553 | if (offset >= 0x8000 && offset < 0x9000) |
554 | m_maincpu->space(AS_PROGRAM) | |
554 | m_maincpu->space(AS_PROGRAM).write_byte(0x410001 ^ (offset & 0xfff), data); | |
555 | 555 | else |
556 | 556 | logerror("%03X: MCU movx write mode %02X offset %04X = %02X\n", m_mcu->pc(), m_mcu_control, offset, data); |
557 | 557 | break; |
558 | 558 | |
559 | 559 | // access palette RAM |
560 | 560 | case 3: |
561 | m_maincpu->space(AS_PROGRAM) | |
561 | m_maincpu->space(AS_PROGRAM).write_byte(0x840001 ^ offset, data); | |
562 | 562 | break; |
563 | 563 | |
564 | 564 | // access ROMs - fall through to logging |
r18027 | r18028 | |
590 | 590 | |
591 | 591 | // access main work RAM |
592 | 592 | else if (offset >= 0x4000 && offset < 0x8000) |
593 | return m_maincpu->space(AS_PROGRAM) | |
593 | return m_maincpu->space(AS_PROGRAM).read_byte(0xc70001 ^ (offset & 0x3fff)); | |
594 | 594 | |
595 | 595 | // access misc I/O space |
596 | 596 | else if (offset >= 0x8000 && offset < 0xc000) |
597 | return m_maincpu->space(AS_PROGRAM) | |
597 | return m_maincpu->space(AS_PROGRAM).read_byte(0xc40001 ^ (offset & 0x3fff)); | |
598 | 598 | logerror("%03X: MCU movx read mode %02X offset %04X\n", m_mcu->pc(), m_mcu_control, offset); |
599 | 599 | return 0xff; |
600 | 600 | |
601 | 601 | // access text RAM |
602 | 602 | case 1: |
603 | 603 | if (offset >= 0x8000 && offset < 0x9000) |
604 | return m_maincpu->space(AS_PROGRAM) | |
604 | return m_maincpu->space(AS_PROGRAM).read_byte(0x410001 ^ (offset & 0xfff)); | |
605 | 605 | logerror("%03X: MCU movx read mode %02X offset %04X\n", m_mcu->pc(), m_mcu_control, offset); |
606 | 606 | return 0xff; |
607 | 607 | |
608 | 608 | // access palette RAM |
609 | 609 | case 3: |
610 | return m_maincpu->space(AS_PROGRAM) | |
610 | return m_maincpu->space(AS_PROGRAM).read_byte(0x840001 ^ offset); | |
611 | 611 | |
612 | 612 | // access ROMs |
613 | 613 | case 5: |
r18027 | r18028 | |
695 | 695 | |
696 | 696 | // synchronize writes to the 8255 PPI |
697 | 697 | case TID_PPI_WRITE: |
698 | m_i8255->write( | |
698 | m_i8255->write(m_maincpu->space(AS_PROGRAM), param >> 8, param & 0xff); | |
699 | 699 | break; |
700 | 700 | } |
701 | 701 | } |
r18027 | r18028 | |
767 | 767 | m_maincpu->set_input_line(4, HOLD_LINE); |
768 | 768 | |
769 | 769 | // X scroll values |
770 | address_space &space = | |
770 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
771 | 771 | segaic16_textram_0_w(space, 0xff8/2, m_workram[0x0d14/2], 0xffff); |
772 | 772 | segaic16_textram_0_w(space, 0xffa/2, m_workram[0x0d18/2], 0xffff); |
773 | 773 |
r18027 | r18028 | |
---|---|---|
685 | 685 | |
686 | 686 | static void main_cpu_banking_init( running_machine &machine ) |
687 | 687 | { |
688 | address_space &mainspace = | |
688 | address_space &mainspace = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
689 | 689 | |
690 | 690 | /* create vector banks */ |
691 | 691 | machine.root_device().membank(NEOGEO_BANK_VECTORS)->configure_entry(0, machine.root_device().memregion("mainbios")->base()); |
r18027 | r18028 | |
826 | 826 | set_audio_cpu_banking(machine); |
827 | 827 | |
828 | 828 | state->m_audio_cpu_rom_source_last = 0; |
829 | set_audio_cpu_rom_source( | |
829 | set_audio_cpu_rom_source(machine.device("maincpu")->memory().space(AS_PROGRAM), 0); | |
830 | 830 | } |
831 | 831 | |
832 | 832 | |
r18027 | r18028 | |
982 | 982 | _set_main_cpu_bank_address(machine); |
983 | 983 | _set_main_cpu_vector_table_source(machine); |
984 | 984 | set_audio_cpu_banking(machine); |
985 | _set_audio_cpu_rom_source( | |
985 | _set_audio_cpu_rom_source(machine.device("maincpu")->memory().space(AS_PROGRAM)); | |
986 | 986 | set_outputs(machine); |
987 | 987 | } |
988 | 988 | |
r18027 | r18028 | |
1050 | 1050 | void neogeo_state::machine_reset() |
1051 | 1051 | { |
1052 | 1052 | offs_t offs; |
1053 | address_space &space = | |
1053 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1054 | 1054 | |
1055 | 1055 | /* reset system control registers */ |
1056 | 1056 | for (offs = 0; offs < 8; offs++) |
r18027 | r18028 | |
1336 | 1336 | } |
1337 | 1337 | |
1338 | 1338 | // setup cartridge ROM area |
1339 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1339 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x000080,0x0fffff,"cart_rom"); | |
1340 | 1340 | image.device().machine().root_device().membank("cart_rom")->set_base(&image.device().machine().root_device().memregion("maincpu")->base()[0x80]); |
1341 | 1341 | |
1342 | 1342 | // handle possible protection |
r18027 | r18028 | |
---|---|---|
437 | 437 | |
438 | 438 | // synchronize writes to the 8255 PPI |
439 | 439 | case TID_PPI_WRITE: |
440 | m_i8255_1->write( | |
440 | m_i8255_1->write(m_maincpu->space(AS_PROGRAM), param >> 8, param & 0xff); | |
441 | 441 | break; |
442 | 442 | } |
443 | 443 | } |
r18027 | r18028 | |
1791 | 1791 | UINT16 *decrypt = auto_alloc_array(machine(), UINT16, 0x40000/2); |
1792 | 1792 | memcpy(decrypt + 0x00000/2, rom + 0x30000/2, 0x10000); |
1793 | 1793 | memcpy(decrypt + 0x10000/2, rom + 0x10000/2, 0x20000); |
1794 | m_maincpu->space(AS_PROGRAM) | |
1794 | m_maincpu->space(AS_PROGRAM).set_decrypted_region(0x000000, 0x03ffff, decrypt); | |
1795 | 1795 | } |
1796 | 1796 | |
1797 | 1797 | DRIVER_INIT_MEMBER(segahang_state,endurob2) |
r18027 | r18028 | |
1802 | 1802 | UINT16 *rom = reinterpret_cast<UINT16 *>(memregion("maincpu")->base()); |
1803 | 1803 | UINT16 *decrypt = auto_alloc_array(machine(), UINT16, 0x40000/2); |
1804 | 1804 | memcpy(decrypt, rom, 0x30000); |
1805 | m_maincpu->space(AS_PROGRAM) | |
1805 | m_maincpu->space(AS_PROGRAM).set_decrypted_region(0x000000, 0x03ffff, decrypt); | |
1806 | 1806 | } |
1807 | 1807 | |
1808 | 1808 |
r18027 | r18028 | |
---|---|---|
1128 | 1128 | |
1129 | 1129 | DRIVER_INIT_MEMBER(statriv2_state,laserdisc) |
1130 | 1130 | { |
1131 | address_space *iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1132 | iospace->install_readwrite_handler(0x28, 0x2b, read8_delegate(FUNC(statriv2_state::laserdisc_io_r), this), write8_delegate(FUNC(statriv2_state::laserdisc_io_w), this)); | |
1131 | address_space &iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1132 | iospace.install_readwrite_handler(0x28, 0x2b, read8_delegate(FUNC(statriv2_state::laserdisc_io_r), this), write8_delegate(FUNC(statriv2_state::laserdisc_io_w), this)); | |
1133 | 1133 | } |
1134 | 1134 | |
1135 | 1135 |
r18027 | r18028 | |
---|---|---|
1068 | 1068 | /* decode the opcodes */ |
1069 | 1069 | |
1070 | 1070 | offs_t i; |
1071 | address_space &space = | |
1071 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1072 | 1072 | UINT8 *decrypted = auto_alloc_array(machine(), UINT8, 0x6000); |
1073 | 1073 | UINT8 *rom = machine().root_device().memregion("maincpu")->base(); |
1074 | 1074 | UINT8 *table = machine().root_device().memregion("user1")->base(); |
r18027 | r18028 | |
---|---|---|
244 | 244 | if (m_laserdisc != NULL) |
245 | 245 | { |
246 | 246 | /* attach to the I/O ports */ |
247 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x05805, 0x05807, 0, 0x07f8, read8_delegate(FUNC(gottlieb_state::laserdisc_status_r),this)); | |
248 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x05805, 0x05805, 0, 0x07f8, write8_delegate(FUNC(gottlieb_state::laserdisc_command_w),this)); /* command for the player */ | |
249 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x05806, 0x05806, 0, 0x07f8, write8_delegate(FUNC(gottlieb_state::laserdisc_select_w),this)); | |
247 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x05805, 0x05807, 0, 0x07f8, read8_delegate(FUNC(gottlieb_state::laserdisc_status_r),this)); | |
248 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x05805, 0x05805, 0, 0x07f8, write8_delegate(FUNC(gottlieb_state::laserdisc_command_w),this)); /* command for the player */ | |
249 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x05806, 0x05806, 0, 0x07f8, write8_delegate(FUNC(gottlieb_state::laserdisc_select_w),this)); | |
250 | 250 | |
251 | 251 | /* allocate a timer for serial transmission, and one for philips code processing */ |
252 | 252 | m_laserdisc_bit_timer = machine().scheduler().timer_alloc(FUNC(laserdisc_bit_callback)); |
r18027 | r18028 | |
2451 | 2451 | DRIVER_INIT_MEMBER(gottlieb_state,stooges) |
2452 | 2452 | { |
2453 | 2453 | DRIVER_INIT_CALL(ramtiles); |
2454 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2454 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x05803, 0x05803, 0, 0x07f8, write8_delegate(FUNC(gottlieb_state::stooges_output_w),this)); | |
2455 | 2455 | } |
2456 | 2456 | |
2457 | 2457 |
r18027 | r18028 | |
---|---|---|
2002 | 2002 | m_sound_irq = M6809_IRQ_LINE; |
2003 | 2003 | m_ym_irq = M6809_FIRQ_LINE; |
2004 | 2004 | m_technos_video_hw = 0; |
2005 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2005 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x3808, 0x3808, write8_delegate(FUNC(ddragon_state::darktowr_bankswitch_w),this)); | |
2006 | 2006 | } |
2007 | 2007 | |
2008 | 2008 | |
r18027 | r18028 | |
2014 | 2014 | m_sound_irq = M6809_IRQ_LINE; |
2015 | 2015 | m_ym_irq = M6809_FIRQ_LINE; |
2016 | 2016 | m_technos_video_hw = 0; |
2017 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2017 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x3808, 0x3808, write8_delegate(FUNC(ddragon_state::toffy_bankswitch_w),this)); | |
2018 | 2018 | |
2019 | 2019 | /* the program rom has a simple bitswap encryption */ |
2020 | 2020 | rom = memregion("maincpu")->base(); |
r18027 | r18028 | |
---|---|---|
456 | 456 | int data; |
457 | 457 | |
458 | 458 | /* Speedup handlers */ |
459 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
459 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x20b574, 0x20b577, read32_delegate(FUNC(groundfx_state::irq_speedup_r_groundfx),this)); | |
460 | 460 | |
461 | 461 | /* make piv tile GFX format suitable for gfxdecode */ |
462 | 462 | offset = size/2; |
r18027 | r18028 | |
---|---|---|
2186 | 2186 | UINT8 *ROM = memregion("maincpu")->base(); |
2187 | 2187 | |
2188 | 2188 | membank("bank1")->configure_entries(0, 4, &ROM[0x80000], 0x20000); |
2189 | machine().device("maincpu")->memory().space(AS_IO) | |
2189 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x20, 0x21, write16_delegate(FUNC(m92_state::m92_bankswitch_w),this)); | |
2190 | 2190 | |
2191 | 2191 | m_game_kludge = 0; |
2192 | 2192 | m_irq_vectorbase = 0x80; |
r18027 | r18028 | |
2198 | 2198 | UINT8 *ROM = memregion("maincpu")->base(); |
2199 | 2199 | |
2200 | 2200 | membank("bank1")->configure_entries(0, 4, &ROM[0x80000], 0x20000); |
2201 | machine().device("maincpu")->memory().space(AS_IO) | |
2201 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x20, 0x21, write16_delegate(FUNC(m92_state::m92_bankswitch_w),this)); | |
2202 | 2202 | |
2203 | 2203 | /* This game has an eeprom on the game board */ |
2204 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2204 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf0000, 0xf3fff, read16_delegate(FUNC(m92_state::m92_eeprom_r),this), write16_delegate(FUNC(m92_state::m92_eeprom_w),this)); | |
2205 | 2205 | |
2206 | 2206 | m_game_kludge = 2; |
2207 | 2207 | m_irq_vectorbase = 0x80; |
r18027 | r18028 | |
---|---|---|
570 | 570 | memcpy(&dst[0x8000], prg_base + (prg_size - 0x4000), 0x4000); |
571 | 571 | memcpy(&dst[0xc000], prg_base + (prg_size - 0x4000), 0x4000); |
572 | 572 | |
573 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
573 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(multigam_state::multigam3_mmc3_rom_switch_w),state)); | |
574 | 574 | |
575 | 575 | state->m_multigam3_mmc3_banks[0] = 0x1e; |
576 | 576 | state->m_multigam3_mmc3_banks[1] = 0x1f; |
r18027 | r18028 | |
679 | 679 | ppu2c0x_device *ppu = machine.device<ppu2c0x_device>("ppu"); |
680 | 680 | UINT8* mem = state->memregion("maincpu")->base(); |
681 | 681 | memcpy(mem + 0x8000, prg_base + prg_size - 0x8000, 0x8000); |
682 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
682 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(multigam_state::multigam3_mapper02_rom_switch_w),state)); | |
683 | 683 | |
684 | 684 | state->m_mapper02_prg_base = prg_base; |
685 | 685 | state->m_mapper02_prg_size = prg_size; |
r18027 | r18028 | |
835 | 835 | |
836 | 836 | memcpy(&dst[0x8000], prg_base + (prg_size - 0x8000), 0x8000); |
837 | 837 | |
838 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
838 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(multigam_state::mmc1_rom_switch_w),state)); | |
839 | 839 | |
840 | 840 | state->m_mmc1_reg_write_enable = 1; |
841 | 841 | state->m_mmc1_rom_mask = (prg_size / 0x4000) - 1; |
r18027 | r18028 | |
880 | 880 | state->m_supergm3_chr_bank == 0x40 ) |
881 | 881 | { |
882 | 882 | // VRAM |
883 | ppu->space(AS_PROGRAM)->install_read_bank(0x0000, 0x1fff, "bank1"); | |
884 | ppu->space(AS_PROGRAM)->install_write_bank(0x0000, 0x1fff, "bank1"); | |
883 | ppu->space(AS_PROGRAM).install_read_bank(0x0000, 0x1fff, "bank1"); | |
884 | ppu->space(AS_PROGRAM).install_write_bank(0x0000, 0x1fff, "bank1"); | |
885 | 885 | state->membank("bank1")->set_base(state->m_vram); |
886 | 886 | |
887 | 887 | if (state->m_supergm3_chr_bank == 0x40) |
r18027 | r18028 | |
889 | 889 | } |
890 | 890 | else |
891 | 891 | { |
892 | ppu->space(AS_PROGRAM)->install_read_bank(0x0000, 0x03ff, "bank2"); | |
893 | ppu->space(AS_PROGRAM)->install_read_bank(0x0400, 0x07ff, "bank3"); | |
894 | ppu->space(AS_PROGRAM)->install_read_bank(0x0800, 0x0bff, "bank4"); | |
895 | ppu->space(AS_PROGRAM)->install_read_bank(0x0c00, 0x0fff, "bank5"); | |
896 | ppu->space(AS_PROGRAM)->install_read_bank(0x1000, 0x13ff, "bank6"); | |
897 | ppu->space(AS_PROGRAM)->install_read_bank(0x1400, 0x17ff, "bank7"); | |
898 | ppu->space(AS_PROGRAM)->install_read_bank(0x1800, 0x1bff, "bank8"); | |
899 | ppu->space(AS_PROGRAM)->install_read_bank(0x1c00, 0x1fff, "bank9"); | |
900 | ppu->space(AS_PROGRAM)->unmap_write(0x0000, 0x1fff); | |
892 | ppu->space(AS_PROGRAM).install_read_bank(0x0000, 0x03ff, "bank2"); | |
893 | ppu->space(AS_PROGRAM).install_read_bank(0x0400, 0x07ff, "bank3"); | |
894 | ppu->space(AS_PROGRAM).install_read_bank(0x0800, 0x0bff, "bank4"); | |
895 | ppu->space(AS_PROGRAM).install_read_bank(0x0c00, 0x0fff, "bank5"); | |
896 | ppu->space(AS_PROGRAM).install_read_bank(0x1000, 0x13ff, "bank6"); | |
897 | ppu->space(AS_PROGRAM).install_read_bank(0x1400, 0x17ff, "bank7"); | |
898 | ppu->space(AS_PROGRAM).install_read_bank(0x1800, 0x1bff, "bank8"); | |
899 | ppu->space(AS_PROGRAM).install_read_bank(0x1c00, 0x1fff, "bank9"); | |
900 | ppu->space(AS_PROGRAM).unmap_write(0x0000, 0x1fff); | |
901 | 901 | |
902 | 902 | set_videorom_bank(machine, 0, 8, 0, 8); |
903 | 903 | } |
r18027 | r18028 | |
1139 | 1139 | |
1140 | 1140 | MACHINE_RESET_MEMBER(multigam_state,multigm3) |
1141 | 1141 | { |
1142 | address_space &space = | |
1142 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1143 | 1143 | /* reset the ppu */ |
1144 | 1144 | multigm3_switch_prg_rom(space, 0, 0x01 ); |
1145 | 1145 | }; |
r18027 | r18028 | |
1152 | 1152 | m_nt_page[2] = m_nt_ram + 0x800; |
1153 | 1153 | m_nt_page[3] = m_nt_ram + 0xc00; |
1154 | 1154 | |
1155 | machine().device("ppu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(multigam_state::multigam_nt_r),this), write8_delegate(FUNC(multigam_state::multigam_nt_w),this)); | |
1156 | machine().device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x1fff, "bank1"); | |
1155 | machine().device("ppu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(multigam_state::multigam_nt_r),this), write8_delegate(FUNC(multigam_state::multigam_nt_w),this)); | |
1156 | machine().device("ppu")->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x1fff, "bank1"); | |
1157 | 1157 | membank("bank1")->set_base(memregion("gfx1")->base()); |
1158 | 1158 | } |
1159 | 1159 | |
r18027 | r18028 | |
1165 | 1165 | m_nt_page[2] = m_nt_ram + 0x800; |
1166 | 1166 | m_nt_page[3] = m_nt_ram + 0xc00; |
1167 | 1167 | |
1168 | machine().device("ppu")->memory().space(AS_PROGRAM) | |
1168 | machine().device("ppu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(multigam_state::multigam_nt_r),this), write8_delegate(FUNC(multigam_state::multigam_nt_w),this)); | |
1169 | 1169 | |
1170 | machine().device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x03ff, "bank2"); | |
1171 | machine().device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0400, 0x07ff, "bank3"); | |
1172 | machine().device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0800, 0x0bff, "bank4"); | |
1173 | machine().device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0c00, 0x0fff, "bank5"); | |
1174 | machine().device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x1000, 0x13ff, "bank6"); | |
1175 | machine().device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x1400, 0x17ff, "bank7"); | |
1176 | machine().device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x1800, 0x1bff, "bank8"); | |
1177 | machine().device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x1c00, 0x1fff, "bank9"); | |
1170 | machine().device("ppu")->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x03ff, "bank2"); | |
1171 | machine().device("ppu")->memory().space(AS_PROGRAM).install_read_bank(0x0400, 0x07ff, "bank3"); | |
1172 | machine().device("ppu")->memory().space(AS_PROGRAM).install_read_bank(0x0800, 0x0bff, "bank4"); | |
1173 | machine().device("ppu")->memory().space(AS_PROGRAM).install_read_bank(0x0c00, 0x0fff, "bank5"); | |
1174 | machine().device("ppu")->memory().space(AS_PROGRAM).install_read_bank(0x1000, 0x13ff, "bank6"); | |
1175 | machine().device("ppu")->memory().space(AS_PROGRAM).install_read_bank(0x1400, 0x17ff, "bank7"); | |
1176 | machine().device("ppu")->memory().space(AS_PROGRAM).install_read_bank(0x1800, 0x1bff, "bank8"); | |
1177 | machine().device("ppu")->memory().space(AS_PROGRAM).install_read_bank(0x1c00, 0x1fff, "bank9"); | |
1178 | 1178 | |
1179 | 1179 | set_videorom_bank(machine(), 0, 8, 0, 8); |
1180 | 1180 | }; |
r18027 | r18028 | |
1187 | 1187 | m_nt_page[2] = m_nt_ram + 0x800; |
1188 | 1188 | m_nt_page[3] = m_nt_ram + 0xc00; |
1189 | 1189 | |
1190 | machine().device("ppu")->memory().space(AS_PROGRAM) | |
1190 | machine().device("ppu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(multigam_state::multigam_nt_r),this), write8_delegate(FUNC(multigam_state::multigam_nt_w),this)); | |
1191 | 1191 | |
1192 | 1192 | m_vram = auto_alloc_array(machine(), UINT8, 0x2000); |
1193 | 1193 | m_multigmc_mmc3_6000_ram = auto_alloc_array(machine(), UINT8, 0x2000); |
r18027 | r18028 | |
1361 | 1361 | |
1362 | 1362 | DRIVER_INIT_MEMBER(multigam_state,multigam) |
1363 | 1363 | { |
1364 | address_space &space = | |
1364 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1365 | 1365 | multigam_switch_prg_rom(space, 0x0, 0x01); |
1366 | 1366 | } |
1367 | 1367 | |
r18027 | r18028 | |
1376 | 1376 | |
1377 | 1377 | DRIVER_INIT_MEMBER(multigam_state,multigm3) |
1378 | 1378 | { |
1379 | address_space &space = | |
1379 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1380 | 1380 | |
1381 | 1381 | const UINT8 decode[16] = { 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a }; |
1382 | 1382 | |
r18027 | r18028 | |
1390 | 1390 | |
1391 | 1391 | DRIVER_INIT_MEMBER(multigam_state,multigmt) |
1392 | 1392 | { |
1393 | address_space &space = | |
1393 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1394 | 1394 | |
1395 | 1395 | UINT8* buf = auto_alloc_array(machine(), UINT8, 0x80000); |
1396 | 1396 | UINT8 *rom; |
r18027 | r18028 | |
---|---|---|
448 | 448 | UINT8 *ROM = memregion("maincpu")->base(); |
449 | 449 | |
450 | 450 | /* The two i860s execute out of RAM */ |
451 | address_space &v0space = | |
451 | address_space &v0space = machine().device<i860_device>("vid_0")->space(AS_PROGRAM); | |
452 | 452 | v0space.set_direct_update_handler(direct_update_delegate(FUNC(vcombat_state::vcombat_vid_0_direct_handler), this)); |
453 | 453 | |
454 | address_space &v1space = | |
454 | address_space &v1space = machine().device<i860_device>("vid_1")->space(AS_PROGRAM); | |
455 | 455 | v1space.set_direct_update_handler(direct_update_delegate(FUNC(vcombat_state::vcombat_vid_1_direct_handler), this)); |
456 | 456 | |
457 | 457 | /* Allocate the 68000 framebuffers */ |
r18027 | r18028 | |
495 | 495 | m_i860_framebuffer[1][1] = NULL; |
496 | 496 | |
497 | 497 | /* The i860 executes out of RAM */ |
498 | address_space &space = | |
498 | address_space &space = machine().device<i860_device>("vid_0")->space(AS_PROGRAM); | |
499 | 499 | space.set_direct_update_handler(direct_update_delegate(FUNC(vcombat_state::vcombat_vid_0_direct_handler), this)); |
500 | 500 | } |
501 | 501 |
r18027 | r18028 | |
---|---|---|
280 | 280 | |
281 | 281 | // Load the next descriptor |
282 | 282 | |
283 | address_space &space = | |
283 | address_space &space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM); | |
284 | 284 | dma_regs->dsadr[channel] = space.read_dword(dma_regs->ddadr[channel] + 0x4); |
285 | 285 | dma_regs->dtadr[channel] = space.read_dword(dma_regs->ddadr[channel] + 0x8); |
286 | 286 | dma_regs->dcmd[channel] = space.read_dword(dma_regs->ddadr[channel] + 0xc); |
r18027 | r18028 | |
320 | 320 | UINT16 temp16; |
321 | 321 | UINT32 temp32; |
322 | 322 | |
323 | address_space &space = | |
323 | address_space &space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM); | |
324 | 324 | switch(param) |
325 | 325 | { |
326 | 326 | case 3: |
r18027 | r18028 | |
1113 | 1113 | |
1114 | 1114 | if(lcd_regs->dma[channel].ldcmd & PXA255_LDCMD_PAL) |
1115 | 1115 | { |
1116 | address_space &space = | |
1116 | address_space &space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM); | |
1117 | 1117 | int length = lcd_regs->dma[channel].ldcmd & 0x000fffff; |
1118 | 1118 | int index = 0; |
1119 | 1119 | for(index = 0; index < length; index += 2) |
r18027 | r18028 | |
1125 | 1125 | } |
1126 | 1126 | else |
1127 | 1127 | { |
1128 | address_space &space = | |
1128 | address_space &space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM); | |
1129 | 1129 | int length = lcd_regs->dma[channel].ldcmd & 0x000fffff; |
1130 | 1130 | int index = 0; |
1131 | 1131 | for(index = 0; index < length; index++) |
r18027 | r18028 | |
1145 | 1145 | { |
1146 | 1146 | verboselog( machine, 4, "pxa255_lcd_check_load_next_branch: Taking branch\n" ); |
1147 | 1147 | lcd_regs->fbr[channel] &= ~1; |
1148 | address_space &space = | |
1148 | address_space &space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM); | |
1149 | 1149 | //lcd_regs->fbr[channel] = (space.read_dword(lcd_regs->fbr[channel] & 0xfffffff0) & 0xfffffff0) | (lcd_regs->fbr[channel] & 0x00000003); |
1150 | 1150 | //printf( "%08x\n", lcd_regs->fbr[channel] ); |
1151 | 1151 | pxa255_lcd_load_dma_descriptor(space, lcd_regs->fbr[channel] & 0xfffffff0, 0); |
r18027 | r18028 | |
1466 | 1466 | m_dmadac[1] = machine().device<dmadac_sound_device>("dac2"); |
1467 | 1467 | m_eeprom = machine().device<eeprom_device>("eeprom"); |
1468 | 1468 | |
1469 | address_space &space = | |
1469 | address_space &space = machine().device<pxa255_device>("maincpu")->space(AS_PROGRAM); | |
1470 | 1470 | space.install_read_handler (0xa0151648, 0xa015164b, read32_delegate(FUNC(_39in1_state::prot_cheater_r), this)); |
1471 | 1471 | } |
1472 | 1472 |
r18027 | r18028 | |
---|---|---|
608 | 608 | if (newval == 0) |
609 | 609 | { |
610 | 610 | UINT32 credit; |
611 | address_space &space = | |
611 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
612 | 612 | |
613 | 613 | /* Get the current credit value and add the new coin value */ |
614 | 614 | credit = space.read_dword(0x8002c) + (UINT32)(FPTR)param; |
r18027 | r18028 | |
---|---|---|
2800 | 2800 | machine().device<midway_ssio_device>("ssio")->set_custom_input(0, 0x8e, read8_delegate(FUNC(mcr_state::dpoker_ip0_r),this)); |
2801 | 2801 | |
2802 | 2802 | // meter ram, is it battery backed? |
2803 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2803 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_ram(0x8000, 0x81ff); | |
2804 | 2804 | |
2805 | 2805 | // extra I/O |
2806 | machine().device("maincpu")->memory().space(AS_IO)->install_read_port(0x24, 0x24, "P24"); | |
2807 | machine().device("maincpu")->memory().space(AS_IO)->install_read_port(0x28, 0x28, "P28"); | |
2808 | machine().device("maincpu")->memory().space(AS_IO)->install_read_port(0x2c, 0x2c, "P2C"); | |
2806 | machine().device("maincpu")->memory().space(AS_IO).install_read_port(0x24, 0x24, "P24"); | |
2807 | machine().device("maincpu")->memory().space(AS_IO).install_read_port(0x28, 0x28, "P28"); | |
2808 | machine().device("maincpu")->memory().space(AS_IO).install_read_port(0x2c, 0x2c, "P2C"); | |
2809 | 2809 | |
2810 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x2c, 0x2c, write8_delegate(FUNC(mcr_state::dpoker_lamps1_w),this)); | |
2811 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x30, 0x30, write8_delegate(FUNC(mcr_state::dpoker_lamps2_w),this)); | |
2812 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x34, 0x34, write8_delegate(FUNC(mcr_state::dpoker_output_w),this)); | |
2813 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x3f, 0x3f, write8_delegate(FUNC(mcr_state::dpoker_meters_w),this)); | |
2810 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x2c, 0x2c, write8_delegate(FUNC(mcr_state::dpoker_lamps1_w),this)); | |
2811 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x30, 0x30, write8_delegate(FUNC(mcr_state::dpoker_lamps2_w),this)); | |
2812 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x34, 0x34, write8_delegate(FUNC(mcr_state::dpoker_output_w),this)); | |
2813 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x3f, 0x3f, write8_delegate(FUNC(mcr_state::dpoker_meters_w),this)); | |
2814 | 2814 | |
2815 | 2815 | dpoker_coin_status = 0; |
2816 | 2816 | dpoker_output = 0; |
r18027 | r18028 | |
2841 | 2841 | mcr_init(machine(), 90010, 91399, 90913); |
2842 | 2842 | |
2843 | 2843 | machine().device<midway_ssio_device>("ssio")->set_custom_output(4, 0xff, write8_delegate(FUNC(mcr_state::twotiger_op4_w),this)); |
2844 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2844 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xe800, 0xefff, 0, 0x1000, read8_delegate(FUNC(mcr_state::twotiger_videoram_r),this), write8_delegate(FUNC(mcr_state::twotiger_videoram_w),this)); | |
2845 | 2845 | } |
2846 | 2846 | |
2847 | 2847 |
r18027 | r18028 | |
---|---|---|
322 | 322 | memcpy(&dst[0xc000], &src[0x0f8000], 0x4000); |
323 | 323 | |
324 | 324 | /* uses 8K swapping, all ROM!*/ |
325 | machine().device("ppu")->memory().space(AS_PROGRAM) | |
325 | machine().device("ppu")->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x1fff, "bank1"); | |
326 | 326 | membank("bank1")->set_base(memregion("gfx1")->base()); |
327 | 327 | |
328 | 328 | /* need nametable ram, though. I doubt this uses more than 2k, but it starts up configured for 4 */ |
r18027 | r18028 | |
333 | 333 | m_nt_page[3] = m_nt_ram + 0xc00; |
334 | 334 | |
335 | 335 | /* and read/write handlers */ |
336 | machine().device("ppu")->memory().space(AS_PROGRAM) | |
336 | machine().device("ppu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff,read8_delegate(FUNC(cham24_state::nt_r), this), write8_delegate(FUNC(cham24_state::nt_w), this)); | |
337 | 337 | } |
338 | 338 | |
339 | 339 | DRIVER_INIT_MEMBER(cham24_state,cham24) |
r18027 | r18028 | |
---|---|---|
1091 | 1091 | DRIVER_INIT_MEMBER(thepit_state,rtriv) |
1092 | 1092 | { |
1093 | 1093 | // Set-up the weirdest questions read ever done |
1094 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1094 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x4000, 0x4fff, read8_delegate(FUNC(thepit_state::rtriv_question_r),this)); | |
1095 | 1095 | } |
1096 | 1096 | |
1097 | 1097 |
r18027 | r18028 | |
---|---|---|
714 | 714 | deco156_decrypt(machine()); |
715 | 715 | machine().device("maincpu")->set_clock_scale(4.0f); /* core timings aren't accurate */ |
716 | 716 | descramble_sound(machine()); |
717 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
717 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0170018, 0x017001b, read32_delegate(FUNC(backfire_state::backfire_speedup_r), this)); | |
718 | 718 | } |
719 | 719 | |
720 | 720 | GAME( 1995, backfire, 0, backfire, backfire, backfire_state, backfire, ROT0, "Data East Corporation", "Backfire! (set 1)", GAME_SUPPORTS_SAVE ) |
r18027 | r18028 | |
---|---|---|
502 | 502 | |
503 | 503 | DRIVER_INIT_MEMBER(sidepckt_state,sidepckt) |
504 | 504 | { |
505 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x3014, 0x3014, read8_delegate(FUNC(sidepckt_state::sidepckt_i8751_r),this)); | |
506 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x3018, 0x3018, write8_delegate(FUNC(sidepckt_state::sidepckt_i8751_w),this)); | |
505 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x3014, 0x3014, read8_delegate(FUNC(sidepckt_state::sidepckt_i8751_r),this)); | |
506 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x3018, 0x3018, write8_delegate(FUNC(sidepckt_state::sidepckt_i8751_w),this)); | |
507 | 507 | } |
508 | 508 | |
509 | 509 | DRIVER_INIT_MEMBER(sidepckt_state,sidepctj) |
510 | 510 | { |
511 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x3014, 0x3014, read8_delegate(FUNC(sidepckt_state::sidepckt_i8751_r),this)); | |
512 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x3018, 0x3018, write8_delegate(FUNC(sidepckt_state::sidepctj_i8751_w),this)); | |
511 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x3014, 0x3014, read8_delegate(FUNC(sidepckt_state::sidepckt_i8751_r),this)); | |
512 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x3018, 0x3018, write8_delegate(FUNC(sidepckt_state::sidepctj_i8751_w),this)); | |
513 | 513 | } |
514 | 514 | |
515 | 515 |
r18027 | r18028 | |
---|---|---|
48 | 48 | /* ESB-specific */ |
49 | 49 | if (m_is_esb) |
50 | 50 | { |
51 | address_space &space = | |
51 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
52 | 52 | |
53 | 53 | /* reset the slapstic */ |
54 | 54 | slapstic_reset(); |
r18027 | r18028 | |
514 | 514 | m_slapstic_base = &rom[0x08000]; |
515 | 515 | |
516 | 516 | /* install an opcode base handler */ |
517 | address_space &space = | |
517 | address_space &space = machine().device<m6809_device>("maincpu")->space(AS_PROGRAM); | |
518 | 518 | space.set_direct_update_handler(direct_update_delegate(FUNC(starwars_state::esb_setdirect), this)); |
519 | 519 | |
520 | 520 | /* install read/write handlers for it */ |
521 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
521 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x8000, 0x9fff, read8_delegate(FUNC(starwars_state::esb_slapstic_r),this), write8_delegate(FUNC(starwars_state::esb_slapstic_w),this)); | |
522 | 522 | |
523 | 523 | /* install additional banking */ |
524 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
524 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xa000, 0xffff, "bank2"); | |
525 | 525 | |
526 | 526 | /* prepare the matrix processor */ |
527 | 527 | m_is_esb = 1; |
r18027 | r18028 | |
---|---|---|
529 | 529 | |
530 | 530 | kbdc8042_init(machine(), &at8042); |
531 | 531 | pc_vga_init(machine(), vga_setting, NULL); |
532 | pc_vga_io_init(machine(), | |
532 | pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); | |
533 | 533 | } |
534 | 534 | |
535 | 535 | void savquest_state::machine_reset() |
r18027 | r18028 | |
---|---|---|
1252 | 1252 | |
1253 | 1253 | DRIVER_INIT_MEMBER(coolridr_state,coolridr) |
1254 | 1254 | { |
1255 | // machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x60d88a4, 0x060d88a7, FUNC(coolridr_hack1_r) ); | |
1256 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x60d8894, 0x060d8897, read32_delegate(FUNC(coolridr_state::coolridr_hack2_r), this)); | |
1255 | // machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x60d88a4, 0x060d88a7, FUNC(coolridr_hack1_r) ); | |
1256 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x60d8894, 0x060d8897, read32_delegate(FUNC(coolridr_state::coolridr_hack2_r), this)); | |
1257 | 1257 | } |
1258 | 1258 | |
1259 | 1259 | GAME( 1995, coolridr, 0, coolridr, coolridr, coolridr_state, coolridr, ROT0, "Sega", "Cool Riders (US)",GAME_NOT_WORKING|GAME_NO_SOUND ) |
r18027 | r18028 | |
---|---|---|
2359 | 2359 | |
2360 | 2360 | MACHINE_START_MEMBER(mpu4_state,mpu4yam) |
2361 | 2361 | { |
2362 | address_space &space = | |
2362 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2363 | 2363 | mpu4_config_common(machine()); |
2364 | 2364 | |
2365 | 2365 | m_link7a_connected=0; |
r18027 | r18028 | |
2369 | 2369 | |
2370 | 2370 | MACHINE_START_MEMBER(mpu4_state,mpu4oki) |
2371 | 2371 | { |
2372 | address_space &space = | |
2372 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2373 | 2373 | mpu4_config_common(machine()); |
2374 | 2374 | |
2375 | 2375 | m_link7a_connected=0; |
r18027 | r18028 | |
2379 | 2379 | |
2380 | 2380 | MACHINE_START_MEMBER(mpu4_state,mpu4bwb) |
2381 | 2381 | { |
2382 | address_space &space = | |
2382 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2383 | 2383 | mpu4_config_common(machine()); |
2384 | 2384 | |
2385 | 2385 | m_link7a_connected=0; |
r18027 | r18028 | |
2588 | 2588 | |
2589 | 2589 | DRIVER_INIT_MEMBER(mpu4_state,m4default_big) |
2590 | 2590 | { |
2591 | address_space &space = | |
2591 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2592 | 2592 | DRIVER_INIT_CALL(m4default); |
2593 | 2593 | |
2594 | 2594 | int size = machine().root_device().memregion( "maincpu" )->bytes(); |
r18027 | r18028 | |
2620 | 2620 | |
2621 | 2621 | DRIVER_INIT_MEMBER(mpu4_state,m_frkstn) |
2622 | 2622 | { |
2623 | address_space &space = | |
2623 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2624 | 2624 | DRIVER_INIT_CALL(m4default_big); |
2625 | 2625 | space.install_read_handler(0x0880, 0x0880, 0, 0, read8_delegate(FUNC(mpu4_state::crystal_sound_r),this)); |
2626 | 2626 | space.install_write_handler(0x0881, 0x0881, 0, 0, write8_delegate(FUNC(mpu4_state::crystal_sound_w),this)); |
r18027 | r18028 | |
---|---|---|
1254 | 1254 | DRIVER_INIT_MEMBER(gaminator_state,gaminator) |
1255 | 1255 | { |
1256 | 1256 | pc_vga_init(machine(), vga_setting, NULL); |
1257 | pc_vga_gamtor_io_init(machine(), | |
1257 | pc_vga_gamtor_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0x44000000, machine().device("maincpu")->memory().space(AS_PROGRAM), 0x40000000); | |
1258 | 1258 | } |
1259 | 1259 | |
1260 | 1260 |
r18027 | r18028 | |
---|---|---|
378 | 378 | DRIVER_INIT_MEMBER(photoply_state,photoply) |
379 | 379 | { |
380 | 380 | pc_vga_init(machine(), vga_setting, NULL); |
381 | pc_vga_io_init(machine(), | |
381 | pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); | |
382 | 382 | } |
383 | 383 | |
384 | 384 | GAME( 199?, photoply, 0, photoply, photoply, photoply_state, photoply, ROT0, "Funworld", "Photo Play 2000 (v2.01)", GAME_NOT_WORKING|GAME_NO_SOUND ) |
r18027 | r18028 | |
---|---|---|
198 | 198 | static void IntReq( running_machine &machine, int num ) |
199 | 199 | { |
200 | 200 | crystal_state *state = machine.driver_data<crystal_state>(); |
201 | address_space &space = | |
201 | address_space &space = state->m_maincpu->space(AS_PROGRAM); | |
202 | 202 | UINT32 IntEn = space.read_dword(0x01800c08); |
203 | 203 | UINT32 IntPend = space.read_dword(0x01800c0c); |
204 | 204 | if (IntEn & (1 << num)) |
r18027 | r18028 | |
276 | 276 | static IRQ_CALLBACK( icallback ) |
277 | 277 | { |
278 | 278 | crystal_state *state = device->machine().driver_data<crystal_state>(); |
279 | address_space &space = | |
279 | address_space &space = device->memory().space(AS_PROGRAM); | |
280 | 280 | UINT32 IntPend = space.read_dword(0x01800c0c); |
281 | 281 | int i; |
282 | 282 | |
r18027 | r18028 | |
652 | 652 | |
653 | 653 | UINT32 crystal_state::screen_update_crystal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
654 | 654 | { |
655 | address_space &space = | |
655 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
656 | 656 | int DoFlip; |
657 | 657 | |
658 | 658 | UINT32 B0 = 0x0; |
r18027 | r18028 | |
717 | 717 | // rising edge |
718 | 718 | if (state) |
719 | 719 | { |
720 | address_space &space = | |
720 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
721 | 721 | UINT16 head, tail; |
722 | 722 | int DoFlip = 0; |
723 | 723 |
r18027 | r18028 | |
---|---|---|
721 | 721 | atarijsa_init(machine(), "260010", 0x0002); |
722 | 722 | |
723 | 723 | /* install CPU synchronization handlers */ |
724 | m_sync_data = machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x16cc00, 0x16cc01, read16_delegate(FUNC(eprom_state::sync_r),this), write16_delegate(FUNC(eprom_state::sync_w),this)); | |
725 | m_sync_data = machine().device("extra")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x16cc00, 0x16cc01, read16_delegate(FUNC(eprom_state::sync_r),this), write16_delegate(FUNC(eprom_state::sync_w),this)); | |
724 | m_sync_data = machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x16cc00, 0x16cc01, read16_delegate(FUNC(eprom_state::sync_r),this), write16_delegate(FUNC(eprom_state::sync_w),this)); | |
725 | m_sync_data = machine().device("extra")->memory().space(AS_PROGRAM).install_readwrite_handler(0x16cc00, 0x16cc01, read16_delegate(FUNC(eprom_state::sync_r),this), write16_delegate(FUNC(eprom_state::sync_w),this)); | |
726 | 726 | } |
727 | 727 | |
728 | 728 |
r18027 | r18028 | |
---|---|---|
564 | 564 | m_nt_page[2] = m_nt_ram + 0x800; |
565 | 565 | m_nt_page[3] = m_nt_ram + 0xc00; |
566 | 566 | |
567 | machine().device("ppu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(famibox_state::famibox_nt_r), this), write8_delegate(FUNC(famibox_state::famibox_nt_w), this)); | |
568 | machine().device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x1fff, "ppubank1"); | |
567 | machine().device("ppu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(famibox_state::famibox_nt_r), this), write8_delegate(FUNC(famibox_state::famibox_nt_w), this)); | |
568 | machine().device("ppu")->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x1fff, "ppubank1"); | |
569 | 569 | |
570 | 570 | famicombox_bankswitch(machine(), 0); |
571 | 571 |
r18027 | r18028 | |
---|---|---|
676 | 676 | |
677 | 677 | DRIVER_INIT_MEMBER(cshooter_state,cshootere) |
678 | 678 | { |
679 | address_space &space = | |
679 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
680 | 680 | int A; |
681 | 681 | UINT8 *rom = machine().root_device().memregion("maincpu")->base(); |
682 | 682 | UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0x8000); |
r18027 | r18028 | |
---|---|---|
152 | 152 | |
153 | 153 | CUSTOM_INPUT_MEMBER(midyunit_state::narc_talkback_strobe_r) |
154 | 154 | { |
155 | return (m_narc_sound->read( | |
155 | return (m_narc_sound->read(machine().driver_data()->generic_space(), 0) >> 8) & 1; | |
156 | 156 | } |
157 | 157 | |
158 | 158 | |
159 | 159 | CUSTOM_INPUT_MEMBER(midyunit_state::narc_talkback_data_r) |
160 | 160 | { |
161 | return m_narc_sound->read( | |
161 | return m_narc_sound->read(machine().driver_data()->generic_space(), 0) & 0xff; | |
162 | 162 | } |
163 | 163 | |
164 | 164 |
r18027 | r18028 | |
---|---|---|
4432 | 4432 | UINT8 *okirom = machine().root_device().memregion( "msm6376" )->base(); |
4433 | 4433 | |
4434 | 4434 | if (!okirom) { |
4435 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
4435 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x2420, 0x2421, write8_delegate(FUNC(maygay1b_state::m1ab_no_oki_w), this)); | |
4436 | 4436 | } |
4437 | 4437 | // print out the rom id / header info to give us some hints |
4438 | 4438 | // note this isn't always correct, alley cat has 'Calpsyo' still in the ident string? |
r18027 | r18028 | |
---|---|---|
876 | 876 | |
877 | 877 | DRIVER_INIT_MEMBER(bzone_state,bradley) |
878 | 878 | { |
879 | address_space &space = | |
879 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
880 | 880 | space.install_ram(0x400, 0x7ff); |
881 | 881 | space.install_read_port(0x1808, 0x1808, "1808"); |
882 | 882 | space.install_read_port(0x1809, 0x1809, "1809"); |
r18027 | r18028 | |
---|---|---|
1061 | 1061 | |
1062 | 1062 | DRIVER_INIT_MEMBER(simpl156_state,joemacr) |
1063 | 1063 | { |
1064 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1064 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0201018, 0x020101b, read32_delegate(FUNC(simpl156_state::joemacr_speedup_r),this)); | |
1065 | 1065 | DRIVER_INIT_CALL(simpl156); |
1066 | 1066 | } |
1067 | 1067 | |
r18027 | r18028 | |
1074 | 1074 | |
1075 | 1075 | DRIVER_INIT_MEMBER(simpl156_state,chainrec) |
1076 | 1076 | { |
1077 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1077 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0201018, 0x020101b, read32_delegate(FUNC(simpl156_state::chainrec_speedup_r),this)); | |
1078 | 1078 | DRIVER_INIT_CALL(simpl156); |
1079 | 1079 | } |
1080 | 1080 | |
r18027 | r18028 | |
1087 | 1087 | |
1088 | 1088 | DRIVER_INIT_MEMBER(simpl156_state,prtytime) |
1089 | 1089 | { |
1090 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1090 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0201ae0, 0x0201ae3, read32_delegate(FUNC(simpl156_state::prtytime_speedup_r),this)); | |
1091 | 1091 | DRIVER_INIT_CALL(simpl156); |
1092 | 1092 | } |
1093 | 1093 | |
r18027 | r18028 | |
1101 | 1101 | |
1102 | 1102 | DRIVER_INIT_MEMBER(simpl156_state,charlien) |
1103 | 1103 | { |
1104 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1104 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0201010, 0x0201013, read32_delegate(FUNC(simpl156_state::charlien_speedup_r),this)); | |
1105 | 1105 | DRIVER_INIT_CALL(simpl156); |
1106 | 1106 | } |
1107 | 1107 | |
r18027 | r18028 | |
1114 | 1114 | |
1115 | 1115 | DRIVER_INIT_MEMBER(simpl156_state,osman) |
1116 | 1116 | { |
1117 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1117 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0201010, 0x0201013, read32_delegate(FUNC(simpl156_state::osman_speedup_r),this)); | |
1118 | 1118 | DRIVER_INIT_CALL(simpl156); |
1119 | 1119 | |
1120 | 1120 | } |
r18027 | r18028 | |
---|---|---|
422 | 422 | seibu_adpcm_decrypt(machine(), "adpcm1"); |
423 | 423 | seibu_adpcm_decrypt(machine(), "adpcm2"); |
424 | 424 | |
425 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x80000, 0x80001, read16_delegate(FUNC(deadang_state::ghunter_trackball_low_r),this)); | |
426 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xb0000, 0xb0001, read16_delegate(FUNC(deadang_state::ghunter_trackball_high_r),this)); | |
425 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x80000, 0x80001, read16_delegate(FUNC(deadang_state::ghunter_trackball_low_r),this)); | |
426 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xb0000, 0xb0001, read16_delegate(FUNC(deadang_state::ghunter_trackball_high_r),this)); | |
427 | 427 | } |
428 | 428 | |
429 | 429 | /* Game Drivers */ |
r18027 | r18028 | |
---|---|---|
1164 | 1164 | m_protection_handler = ultennis_protection; |
1165 | 1165 | |
1166 | 1166 | /* additional (protection?) hack */ |
1167 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1167 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x300000, 0x300001, read16_delegate(FUNC(artmagic_state::ultennis_hack_r),this)); | |
1168 | 1168 | } |
1169 | 1169 | |
1170 | 1170 |
r18027 | r18028 | |
---|---|---|
77 | 77 | |
78 | 78 | static void galpani2_write_kaneko(device_t *device) |
79 | 79 | { |
80 | address_space | |
80 | address_space &dstspace = device->memory().space(AS_PROGRAM); | |
81 | 81 | int i,x,tpattidx; |
82 | 82 | unsigned char testpattern[] = {0xFF,0x55,0xAA,0xDD,0xBB,0x99}; |
83 | 83 | |
r18027 | r18028 | |
89 | 89 | { |
90 | 90 | for (tpattidx = 0; tpattidx < 6; tpattidx++) |
91 | 91 | { |
92 | if (dstspace | |
92 | if (dstspace.read_byte(i) == testpattern[tpattidx]) x = 1; //ram test fragment present | |
93 | 93 | } |
94 | 94 | } |
95 | 95 | |
96 | 96 | if ( x == 0 ) |
97 | 97 | { |
98 | dstspace->write_byte(0x100000,0x4b); //K | |
99 | dstspace->write_byte(0x100001,0x41); //A | |
100 | dstspace->write_byte(0x100002,0x4e); //N | |
101 | dstspace->write_byte(0x100003,0x45); //E | |
102 | dstspace->write_byte(0x100004,0x4b); //K | |
103 | dstspace->write_byte(0x100005,0x4f); //O | |
98 | dstspace.write_byte(0x100000,0x4b); //K | |
99 | dstspace.write_byte(0x100001,0x41); //A | |
100 | dstspace.write_byte(0x100002,0x4e); //N | |
101 | dstspace.write_byte(0x100003,0x45); //E | |
102 | dstspace.write_byte(0x100004,0x4b); //K | |
103 | dstspace.write_byte(0x100005,0x4f); //O | |
104 | 104 | } |
105 | 105 | } |
106 | 106 | |
107 | 107 | WRITE8_MEMBER(galpani2_state::galpani2_mcu_init_w) |
108 | 108 | { |
109 | address_space *srcspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
110 | address_space *dstspace = machine().device("sub")->memory().space(AS_PROGRAM); | |
109 | address_space &srcspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
110 | address_space &dstspace = machine().device("sub")->memory().space(AS_PROGRAM); | |
111 | 111 | UINT32 mcu_address, mcu_data; |
112 | 112 | |
113 | 113 | for ( mcu_address = 0x100010; mcu_address < (0x100010 + 6); mcu_address += 1 ) |
114 | 114 | { |
115 | mcu_data = srcspace->read_byte(mcu_address ); | |
116 | dstspace->write_byte(mcu_address-0x10, mcu_data); | |
115 | mcu_data = srcspace.read_byte(mcu_address ); | |
116 | dstspace.write_byte(mcu_address-0x10, mcu_data); | |
117 | 117 | } |
118 | 118 | machine().device("sub")->execute().set_input_line(INPUT_LINE_IRQ7, HOLD_LINE); //MCU Initialised |
119 | 119 | } |
120 | 120 | |
121 | 121 | static void galpani2_mcu_nmi1(running_machine &machine) |
122 | 122 | { |
123 | address_space *srcspace = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
124 | address_space *dstspace = machine.device("sub")->memory().space(AS_PROGRAM); | |
123 | address_space &srcspace = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
124 | address_space &dstspace = machine.device("sub")->memory().space(AS_PROGRAM); | |
125 | 125 | UINT32 mcu_list, mcu_command, mcu_address, mcu_extra, mcu_src, mcu_dst, mcu_size; |
126 | 126 | |
127 | 127 | for ( mcu_list = 0x100021; mcu_list < (0x100021 + 0x40); mcu_list += 4 ) |
128 | 128 | { |
129 | mcu_command = srcspace | |
129 | mcu_command = srcspace.read_byte(mcu_list); | |
130 | 130 | |
131 | 131 | mcu_address = 0x100000 + |
132 | (srcspace->read_byte(mcu_list + 1)<<8) + | |
133 | (srcspace->read_byte(mcu_list + 2)<<0) ; | |
132 | (srcspace.read_byte(mcu_list + 1)<<8) + | |
133 | (srcspace.read_byte(mcu_list + 2)<<0) ; | |
134 | 134 | |
135 | mcu_extra = srcspace | |
135 | mcu_extra = srcspace.read_byte(mcu_list + 3); //0xff for command $A and $2, 0x02 for others | |
136 | 136 | |
137 | 137 | if (mcu_command != 0) |
138 | 138 | { |
139 | 139 | logerror("%s : MCU [$%06X] endidx = $%02X / command = $%02X addr = $%04X ? = $%02X.\n", |
140 | 140 | machine.describe_context(), |
141 | 141 | mcu_list, |
142 | srcspace | |
142 | srcspace.read_byte(0x100020), | |
143 | 143 | mcu_command, |
144 | 144 | mcu_address, |
145 | 145 | mcu_extra |
r18027 | r18028 | |
152 | 152 | break; |
153 | 153 | |
154 | 154 | case 0x02: //Copy N bytes from RAM2 to RAM1?, gp2se is the only one to use it, often! |
155 | mcu_src = (srcspace->read_byte(mcu_address + 2)<<8) + | |
156 | (srcspace->read_byte(mcu_address + 3)<<0) ; | |
155 | mcu_src = (srcspace.read_byte(mcu_address + 2)<<8) + | |
156 | (srcspace.read_byte(mcu_address + 3)<<0) ; | |
157 | 157 | |
158 | mcu_dst = (srcspace->read_byte(mcu_address + 6)<<8) + | |
159 | (srcspace->read_byte(mcu_address + 7)<<0) ; | |
158 | mcu_dst = (srcspace.read_byte(mcu_address + 6)<<8) + | |
159 | (srcspace.read_byte(mcu_address + 7)<<0) ; | |
160 | 160 | |
161 | mcu_size = (srcspace->read_byte(mcu_address + 8)<<8) + | |
162 | (srcspace->read_byte(mcu_address + 9)<<0) ; | |
161 | mcu_size = (srcspace.read_byte(mcu_address + 8)<<8) + | |
162 | (srcspace.read_byte(mcu_address + 9)<<0) ; | |
163 | 163 | logerror("%s : MCU executes command $%02X, %04X %02X-> %04x\n",machine.describe_context(),mcu_command,mcu_src,mcu_size,mcu_dst); |
164 | 164 | |
165 | 165 | for( ; mcu_size > 0 ; mcu_size-- ) |
166 | 166 | { |
167 | 167 | mcu_src &= 0xffff; mcu_dst &= 0xffff; |
168 | srcspace | |
168 | srcspace.write_byte(0x100000 + mcu_dst,dstspace.read_byte(0x100000 + mcu_src)); | |
169 | 169 | mcu_src ++; mcu_dst ++; |
170 | 170 | } |
171 | 171 | |
172 | 172 | /* Raise a "job done" flag */ |
173 | srcspace->write_byte(mcu_address+0,0xff); | |
174 | srcspace->write_byte(mcu_address+1,0xff); | |
173 | srcspace.write_byte(mcu_address+0,0xff); | |
174 | srcspace.write_byte(mcu_address+1,0xff); | |
175 | 175 | |
176 | 176 | break; |
177 | 177 | |
178 | 178 | case 0x0a: // Copy N bytes from RAM1 to RAM2 |
179 | mcu_src = (srcspace->read_byte(mcu_address + 2)<<8) + | |
180 | (srcspace->read_byte(mcu_address + 3)<<0) ; | |
179 | mcu_src = (srcspace.read_byte(mcu_address + 2)<<8) + | |
180 | (srcspace.read_byte(mcu_address + 3)<<0) ; | |
181 | 181 | |
182 | mcu_dst = (srcspace->read_byte(mcu_address + 6)<<8) + | |
183 | (srcspace->read_byte(mcu_address + 7)<<0) ; | |
182 | mcu_dst = (srcspace.read_byte(mcu_address + 6)<<8) + | |
183 | (srcspace.read_byte(mcu_address + 7)<<0) ; | |
184 | 184 | |
185 | mcu_size = (srcspace->read_byte(mcu_address + 8)<<8) + | |
186 | (srcspace->read_byte(mcu_address + 9)<<0) ; | |
185 | mcu_size = (srcspace.read_byte(mcu_address + 8)<<8) + | |
186 | (srcspace.read_byte(mcu_address + 9)<<0) ; | |
187 | 187 | |
188 | 188 | logerror("%s : MCU executes command $%02X, %04X %02X-> %04x\n",machine.describe_context(),mcu_command,mcu_src,mcu_size,mcu_dst); |
189 | 189 | |
190 | 190 | for( ; mcu_size > 0 ; mcu_size-- ) |
191 | 191 | { |
192 | 192 | mcu_src &= 0xffff; mcu_dst &= 0xffff; |
193 | dstspace | |
193 | dstspace.write_byte(0x100000 + mcu_dst,srcspace.read_byte(0x100000 + mcu_src)); | |
194 | 194 | mcu_src ++; mcu_dst ++; |
195 | 195 | } |
196 | 196 | |
197 | 197 | /* Raise a "job done" flag */ |
198 | srcspace->write_byte(mcu_address+0,0xff); | |
199 | srcspace->write_byte(mcu_address+1,0xff); | |
198 | srcspace.write_byte(mcu_address+0,0xff); | |
199 | srcspace.write_byte(mcu_address+1,0xff); | |
200 | 200 | |
201 | 201 | break; |
202 | 202 | |
r18027 | r18028 | |
210 | 210 | //case 0x85: //? Do what? |
211 | 211 | default: |
212 | 212 | /* Raise a "job done" flag */ |
213 | srcspace->write_byte(mcu_address+0,0xff); | |
214 | srcspace->write_byte(mcu_address+1,0xff); | |
213 | srcspace.write_byte(mcu_address+0,0xff); | |
214 | srcspace.write_byte(mcu_address+1,0xff); | |
215 | 215 | |
216 | 216 | logerror("%s : MCU ERROR, unknown command $%02X\n",machine.describe_context(),mcu_command); |
217 | 217 | } |
218 | 218 | |
219 | 219 | /* Erase command (so that it won't be processed again)? */ |
220 | srcspace | |
220 | srcspace.write_byte(mcu_list,0x00); | |
221 | 221 | } |
222 | 222 | } |
223 | 223 |
r18027 | r18028 | |
---|---|---|
102 | 102 | } |
103 | 103 | } |
104 | 104 | |
105 | address_space &space = | |
105 | address_space &space = machine().firstcpu->space(AS_PROGRAM); | |
106 | 106 | discrete_sound_w(discrete, space, SPRINT2_MOTORSND1_DATA, m_video_ram[0x394] & 15); // also DOMINOS_FREQ_DATA |
107 | 107 | discrete_sound_w(discrete, space, SPRINT2_MOTORSND2_DATA, m_video_ram[0x395] & 15); |
108 | 108 | discrete_sound_w(discrete, space, SPRINT2_CRASHSND_DATA, m_video_ram[0x396] & 15); // also DOMINOS_AMP_DATA |
r18027 | r18028 | |
---|---|---|
253 | 253 | |
254 | 254 | static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, int reg) |
255 | 255 | { |
256 | address_space &space = | |
256 | address_space &space = busdevice->machine().firstcpu->space( AS_PROGRAM ); | |
257 | 257 | midqslvr_state *state = busdevice->machine().driver_data<midqslvr_state>(); |
258 | 258 | |
259 | 259 | function &= 3; |
r18027 | r18028 | |
672 | 672 | |
673 | 673 | kbdc8042_init(machine(), &at8042); |
674 | 674 | pc_vga_init(machine(), vga_setting, NULL); |
675 | pc_vga_io_init(machine(), | |
675 | pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); | |
676 | 676 | } |
677 | 677 | |
678 | 678 | void midqslvr_state::machine_reset() |
r18027 | r18028 | |
---|---|---|
1817 | 1817 | machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE ); |
1818 | 1818 | machine().device("maincpu")->execute().set_irq_acknowledge_callback(spi_irq_callback); |
1819 | 1819 | |
1820 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x00000680, 0x00000683, read32_delegate(FUNC(seibuspi_state::sound_fifo_r),this)); | |
1821 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x00000688, 0x0000068b, write32_delegate(FUNC(seibuspi_state::z80_prg_fifo_w),this)); | |
1822 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x0000068c, 0x0000068f, write32_delegate(FUNC(seibuspi_state::z80_enable_w),this)); | |
1820 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00000680, 0x00000683, read32_delegate(FUNC(seibuspi_state::sound_fifo_r),this)); | |
1821 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x00000688, 0x0000068b, write32_delegate(FUNC(seibuspi_state::z80_prg_fifo_w),this)); | |
1822 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x0000068c, 0x0000068f, write32_delegate(FUNC(seibuspi_state::z80_enable_w),this)); | |
1823 | 1823 | |
1824 | 1824 | membank("bank4")->set_base(m_z80_rom); |
1825 | 1825 | membank("bank5")->set_base(m_z80_rom); |
r18027 | r18028 | |
1899 | 1899 | |
1900 | 1900 | memcpy(m_z80_rom, rom, 0x40000); |
1901 | 1901 | |
1902 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x0000068c, 0x0000068f, write32_delegate(FUNC(seibuspi_state::eeprom_w),this)); | |
1903 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x00000680, 0x00000683, read32_delegate(FUNC(seibuspi_state::sb_coin_r),this)); | |
1902 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x0000068c, 0x0000068f, write32_delegate(FUNC(seibuspi_state::eeprom_w),this)); | |
1903 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00000680, 0x00000683, read32_delegate(FUNC(seibuspi_state::sb_coin_r),this)); | |
1904 | 1904 | |
1905 | 1905 | machine().device("maincpu")->execute().set_irq_acknowledge_callback(spi_irq_callback); |
1906 | 1906 | |
r18027 | r18028 | |
2077 | 2077 | |
2078 | 2078 | DRIVER_INIT_MEMBER(seibuspi_state,rdft) |
2079 | 2079 | { |
2080 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2080 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00298d0, 0x00298d3, read32_delegate(FUNC(seibuspi_state::rdft_speedup_r),this)); | |
2081 | 2081 | |
2082 | 2082 | init_spi(machine()); |
2083 | 2083 | } |
2084 | 2084 | |
2085 | 2085 | DRIVER_INIT_MEMBER(seibuspi_state,senkyu) |
2086 | 2086 | { |
2087 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2087 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0018cb4, 0x0018cb7, read32_delegate(FUNC(seibuspi_state::senkyu_speedup_r),this)); | |
2088 | 2088 | |
2089 | 2089 | init_spi(machine()); |
2090 | 2090 | } |
2091 | 2091 | |
2092 | 2092 | DRIVER_INIT_MEMBER(seibuspi_state,senkyua) |
2093 | 2093 | { |
2094 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2094 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0018c9c, 0x0018c9f, read32_delegate(FUNC(seibuspi_state::senkyua_speedup_r),this)); | |
2095 | 2095 | |
2096 | 2096 | init_spi(machine()); |
2097 | 2097 | } |
2098 | 2098 | |
2099 | 2099 | DRIVER_INIT_MEMBER(seibuspi_state,batlball) |
2100 | 2100 | { |
2101 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2101 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0018db4, 0x0018db7, read32_delegate(FUNC(seibuspi_state::batlball_speedup_r),this)); | |
2102 | 2102 | |
2103 | 2103 | init_spi(machine()); |
2104 | 2104 | } |
r18027 | r18028 | |
2106 | 2106 | DRIVER_INIT_MEMBER(seibuspi_state,ejanhs) |
2107 | 2107 | { |
2108 | 2108 | // idle skip doesn't work properly? |
2109 | // machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2109 | // machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x002d224, 0x002d227, read32_delegate(FUNC(seibuspi_state::ejanhs_speedup_r),this)); | |
2110 | 2110 | |
2111 | 2111 | init_spi(machine()); |
2112 | 2112 | } |
2113 | 2113 | |
2114 | 2114 | DRIVER_INIT_MEMBER(seibuspi_state,viprp1) |
2115 | 2115 | { |
2116 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2116 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x001e2e0, 0x001e2e3, read32_delegate(FUNC(seibuspi_state::viprp1_speedup_r),this)); | |
2117 | 2117 | |
2118 | 2118 | init_spi(machine()); |
2119 | 2119 | } |
2120 | 2120 | |
2121 | 2121 | DRIVER_INIT_MEMBER(seibuspi_state,viprp1o) |
2122 | 2122 | { |
2123 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2123 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x001d49c, 0x001d49f, read32_delegate(FUNC(seibuspi_state::viprp1o_speedup_r),this)); | |
2124 | 2124 | |
2125 | 2125 | init_spi(machine()); |
2126 | 2126 | } |
r18027 | r18028 | |
2133 | 2133 | state->m_flash[0] = machine.device<intel_e28f008sa_device>("flash0"); |
2134 | 2134 | state->m_flash[1] = machine.device<intel_e28f008sa_device>("flash1"); |
2135 | 2135 | |
2136 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
2136 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0282AC, 0x0282AF, read32_delegate(FUNC(seibuspi_state::rf2_speedup_r),state)); | |
2137 | 2137 | seibuspi_rise10_text_decrypt(state->memregion("gfx1")->base()); |
2138 | 2138 | seibuspi_rise10_bg_decrypt(state->memregion("gfx2")->base(), state->memregion("gfx2")->bytes()); |
2139 | 2139 | seibuspi_rise10_sprite_decrypt(state->memregion("gfx3")->base(), 0x600000); |
2140 | 2140 | |
2141 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
2141 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x560, 0x563, write32_delegate(FUNC(seibuspi_state::sprite_dma_start_w),state)); | |
2142 | 2142 | } |
2143 | 2143 | |
2144 | 2144 | DRIVER_INIT_MEMBER(seibuspi_state,rdft2) |
r18027 | r18028 | |
2158 | 2158 | state->m_flash[0] = machine.device<intel_e28f008sa_device>("flash0"); |
2159 | 2159 | state->m_flash[1] = machine.device<intel_e28f008sa_device>("flash1"); |
2160 | 2160 | |
2161 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
2161 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x002894c, 0x002894f, read32_delegate(FUNC(seibuspi_state::rfjet_speedup_r),state)); | |
2162 | 2162 | seibuspi_rise11_text_decrypt(state->memregion("gfx1")->base()); |
2163 | 2163 | seibuspi_rise11_bg_decrypt(state->memregion("gfx2")->base(), state->memregion("gfx2")->bytes()); |
2164 | 2164 | seibuspi_rise11_sprite_decrypt_rfjet(state->memregion("gfx3")->base(), 0x800000); |
2165 | 2165 | |
2166 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
2166 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x560, 0x563, write32_delegate(FUNC(seibuspi_state::sprite_dma_start_w),state)); | |
2167 | 2167 | } |
2168 | 2168 | |
2169 | 2169 | DRIVER_INIT_MEMBER(seibuspi_state,rfjet) |
r18027 | r18028 | |
---|---|---|
1184 | 1184 | DRIVER_INIT_MEMBER(coolpool_state,coolpool) |
1185 | 1185 | { |
1186 | 1186 | |
1187 | machine().device("dsp")->memory().space(AS_IO) | |
1187 | machine().device("dsp")->memory().space(AS_IO).install_read_handler(0x07, 0x07, read16_delegate(FUNC(coolpool_state::coolpool_input_r),this)); | |
1188 | 1188 | |
1189 | 1189 | register_state_save(machine()); |
1190 | 1190 | } |
r18027 | r18028 | |
---|---|---|
555 | 555 | switch ((m_mcu_control >> 3) & 3) |
556 | 556 | { |
557 | 557 | case 0: |
558 | machine().device<z80_device>("maincpu")->space(AS_PROGRAM) | |
558 | machine().device<z80_device>("maincpu")->space(AS_PROGRAM).write_byte(offset, data); | |
559 | 559 | break; |
560 | 560 | |
561 | 561 | case 2: |
562 | machine().device<z80_device>("maincpu")->space(AS_IO) | |
562 | machine().device<z80_device>("maincpu")->space(AS_IO).write_byte(offset, data); | |
563 | 563 | break; |
564 | 564 | |
565 | 565 | default: |
r18027 | r18028 | |
575 | 575 | switch ((m_mcu_control >> 3) & 3) |
576 | 576 | { |
577 | 577 | case 0: |
578 | return machine().device<z80_device>("maincpu")->space(AS_PROGRAM) | |
578 | return machine().device<z80_device>("maincpu")->space(AS_PROGRAM).read_byte(offset); | |
579 | 579 | |
580 | 580 | case 1: |
581 | 581 | return memregion("maincpu")->base()[offset + 0x10000]; |
582 | 582 | |
583 | 583 | case 2: |
584 | return machine().device<z80_device>("maincpu")->space(AS_IO) | |
584 | return machine().device<z80_device>("maincpu")->space(AS_IO).read_byte(offset); | |
585 | 585 | |
586 | 586 | default: |
587 | 587 | logerror("%03X: MCU movx read mode %02X offset %04X\n", |
r18027 | r18028 | |
4642 | 4642 | |
4643 | 4643 | mc8123_decrypt_rom(machine(), "maincpu", "key", "bank1", 4); |
4644 | 4644 | |
4645 | // machine().device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x00, FUNC(dakkochn_port_00_r)); | |
4646 | // machine().device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x03, 0x03, FUNC(dakkochn_port_03_r)); | |
4647 | // machine().device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x04, 0x04, FUNC(dakkochn_port_04_r)); | |
4645 | // machine().device("maincpu")->memory().space(AS_IO).install_legacy_read_handler(0x00, 0x00, FUNC(dakkochn_port_00_r)); | |
4646 | // machine().device("maincpu")->memory().space(AS_IO).install_legacy_read_handler(0x03, 0x03, FUNC(dakkochn_port_03_r)); | |
4647 | // machine().device("maincpu")->memory().space(AS_IO).install_legacy_read_handler(0x04, 0x04, FUNC(dakkochn_port_04_r)); | |
4648 | 4648 | |
4649 | // machine().device("maincpu")->memory().space(AS_IO) | |
4649 | // machine().device("maincpu")->memory().space(AS_IO).install_legacy_write_handler(0x15, 0x15, FUNC(dakkochn_port_15_w)); | |
4650 | 4650 | } |
4651 | 4651 | |
4652 | 4652 | |
r18027 | r18028 | |
4704 | 4704 | |
4705 | 4705 | DRIVER_INIT_MEMBER(system1_state,nob) |
4706 | 4706 | { |
4707 | address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM); | |
4708 | address_space *iospace = machine().device("maincpu")->memory().space(AS_IO); | |
4707 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
4708 | address_space &iospace = machine().device("maincpu")->memory().space(AS_IO); | |
4709 | 4709 | |
4710 | 4710 | DRIVER_INIT_CALL(bank44); |
4711 | 4711 | |
r18027 | r18028 | |
4715 | 4715 | space.install_read_handler(0x0001, 0x0001, read8_delegate(FUNC(system1_state::nob_start_r),this)); |
4716 | 4716 | |
4717 | 4717 | /* install MCU communications */ |
4718 | iospace->install_readwrite_handler(0x18, 0x18, 0x00, 0x00, read8_delegate(FUNC(system1_state::nob_maincpu_latch_r),this), write8_delegate(FUNC(system1_state::nob_maincpu_latch_w),this)); | |
4719 | iospace->install_read_handler(0x1c, 0x1c, read8_delegate(FUNC(system1_state::nob_mcu_status_r),this)); | |
4718 | iospace.install_readwrite_handler(0x18, 0x18, 0x00, 0x00, read8_delegate(FUNC(system1_state::nob_maincpu_latch_r),this), write8_delegate(FUNC(system1_state::nob_maincpu_latch_w),this)); | |
4719 | iospace.install_read_handler(0x1c, 0x1c, read8_delegate(FUNC(system1_state::nob_mcu_status_r),this)); | |
4720 | 4720 | } |
4721 | 4721 | |
4722 | 4722 | DRIVER_INIT_MEMBER(system1_state,nobb) |
r18027 | r18028 | |
4736 | 4736 | // ROM[0x10000 + 0 * 0x8000 + 0x3347] = 0x18; // 'jr' instead of 'jr z' |
4737 | 4737 | |
4738 | 4738 | /* Patch to get sound in later levels(the program enters into a tight loop)*/ |
4739 | address_space | |
4739 | address_space &iospace = machine().device("maincpu")->memory().space(AS_IO); | |
4740 | 4740 | UINT8 *ROM2 = machine().root_device().memregion("soundcpu")->base(); |
4741 | 4741 | |
4742 | 4742 | ROM2[0x02f9] = 0x28;//'jr z' instead of 'jr' |
4743 | 4743 | |
4744 | 4744 | DRIVER_INIT_CALL(bank44); |
4745 | 4745 | |
4746 | iospace->install_read_handler(0x1c, 0x1c, read8_delegate(FUNC(system1_state::nobb_inport1c_r),this)); | |
4747 | iospace->install_read_handler(0x22, 0x22, read8_delegate(FUNC(system1_state::nobb_inport22_r),this)); | |
4748 | iospace->install_read_handler(0x23, 0x23, read8_delegate(FUNC(system1_state::nobb_inport23_r),this)); | |
4749 | iospace->install_write_handler(0x24, 0x24, write8_delegate(FUNC(system1_state::nobb_outport24_w),this)); | |
4746 | iospace.install_read_handler(0x1c, 0x1c, read8_delegate(FUNC(system1_state::nobb_inport1c_r),this)); | |
4747 | iospace.install_read_handler(0x22, 0x22, read8_delegate(FUNC(system1_state::nobb_inport22_r),this)); | |
4748 | iospace.install_read_handler(0x23, 0x23, read8_delegate(FUNC(system1_state::nobb_inport23_r),this)); | |
4749 | iospace.install_write_handler(0x24, 0x24, write8_delegate(FUNC(system1_state::nobb_outport24_w),this)); | |
4750 | 4750 | } |
4751 | 4751 | |
4752 | 4752 | |
4753 | 4753 | DRIVER_INIT_MEMBER(system1_state,bootleg) |
4754 | 4754 | { |
4755 | address_space &space = | |
4755 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
4756 | 4756 | space.set_decrypted_region(0x0000, 0x7fff, machine().root_device().memregion("maincpu")->base() + 0x10000); |
4757 | 4757 | DRIVER_INIT_CALL(bank00); |
4758 | 4758 | } |
r18027 | r18028 | |
4760 | 4760 | |
4761 | 4761 | DRIVER_INIT_MEMBER(system1_state,bootsys2) |
4762 | 4762 | { |
4763 | address_space &space = | |
4763 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
4764 | 4764 | space.set_decrypted_region(0x0000, 0x7fff, machine().root_device().memregion("maincpu")->base() + 0x20000); |
4765 | 4765 | machine().root_device().membank("bank1")->configure_decrypted_entries(0, 4, machine().root_device().memregion("maincpu")->base() + 0x30000, 0x4000); |
4766 | 4766 | DRIVER_INIT_CALL(bank0c); |
r18027 | r18028 | |
4780 | 4780 | |
4781 | 4781 | DRIVER_INIT_MEMBER(system1_state,shtngmst) |
4782 | 4782 | { |
4783 | address_space *iospace = machine().device("maincpu")->memory().space(AS_IO); | |
4784 | iospace->install_read_port(0x12, 0x12, 0x00, 0x00, "TRIGGER"); | |
4785 | iospace->install_read_port(0x18, 0x18, 0x00, 0x03, "18"); | |
4786 | iospace->install_read_port(0x1c, 0x1c, 0x00, 0x02, "GUNX"); | |
4787 | iospace->install_read_port(0x1d, 0x1d, 0x00, 0x02, "GUNY"); | |
4783 | address_space &iospace = machine().device("maincpu")->memory().space(AS_IO); | |
4784 | iospace.install_read_port(0x12, 0x12, 0x00, 0x00, "TRIGGER"); | |
4785 | iospace.install_read_port(0x18, 0x18, 0x00, 0x03, "18"); | |
4786 | iospace.install_read_port(0x1c, 0x1c, 0x00, 0x02, "GUNX"); | |
4787 | iospace.install_read_port(0x1d, 0x1d, 0x00, 0x02, "GUNY"); | |
4788 | 4788 | DRIVER_INIT_CALL(bank0c); |
4789 | 4789 | } |
4790 | 4790 |
r18027 | r18028 | |
---|---|---|
245 | 245 | |
246 | 246 | void niyanpai_state::machine_reset() |
247 | 247 | { |
248 | address_space &space = | |
248 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
249 | 249 | int i; |
250 | 250 | |
251 | 251 | // initialize TMPZ84C011 PIO |
r18027 | r18028 | |
308 | 308 | |
309 | 309 | CUSTOM_INPUT_MEMBER(niyanpai_state::musobana_outcoin_flag_r) |
310 | 310 | { |
311 | address_space &space = | |
311 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
312 | 312 | // tmp68301_parallel_interface[0x05] |
313 | 313 | // bit 0 coin counter |
314 | 314 | // bit 2 motor on |
r18027 | r18028 | |
---|---|---|
3692 | 3692 | MACHINE_START_MEMBER(bfm_sc2_state,sc2dmd) |
3693 | 3693 | { |
3694 | 3694 | |
3695 | address_space &space = | |
3695 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
3696 | 3696 | space.install_write_handler(0x2800, 0x2800, 0, 0, write8_delegate(FUNC(bfm_sc2_state::vfd1_dmd_w),this)); |
3697 | 3697 | space.install_write_handler(0x2900, 0x2900, 0, 0, write8_delegate(FUNC(bfm_sc2_state::dmd_reset_w),this)); |
3698 | 3698 | } |
r18027 | r18028 | |
---|---|---|
970 | 970 | |
971 | 971 | DRIVER_INIT_MEMBER(skns_state,galpani4) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-5,-1); init_skns(machine()); } |
972 | 972 | DRIVER_INIT_MEMBER(skns_state,galpanis) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-5,-1); init_skns(machine()); } |
973 | DRIVER_INIT_MEMBER(skns_state,cyvern) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+0,+2); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x604d3c8, 0x604d3cb, read32_delegate(FUNC(skns_state::cyvern_speedup_r),this) ); set_drc_pcflush(machine(), 0x402ebd2); } | |
974 | DRIVER_INIT_MEMBER(skns_state,galpans2) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x60fb6bc, 0x60fb6bf, read32_delegate(FUNC(skns_state::galpans2_speedup_r),this) ); set_drc_pcflush(machine(), 0x4049ae2); } | |
975 | DRIVER_INIT_MEMBER(skns_state,gutsn) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+0,+0); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x600c780, 0x600c783, read32_delegate(FUNC(skns_state::gutsn_speedup_r),this) ); set_drc_pcflush(machine(), 0x402206e); } | |
976 | DRIVER_INIT_MEMBER(skns_state,panicstr) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x60f19e4, 0x60f19e7, read32_delegate(FUNC(skns_state::panicstr_speedup_r),this) ); set_drc_pcflush(machine(), 0x404e68a); } | |
977 | DRIVER_INIT_MEMBER(skns_state,senknow) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+1,+1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x60000dc, 0x60000df, read32_delegate(FUNC(skns_state::senknow_speedup_r),this) ); set_drc_pcflush(machine(), 0x4017dce); } | |
978 | DRIVER_INIT_MEMBER(skns_state,puzzloope) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x6081d38, 0x6081d3b, read32_delegate(FUNC(skns_state::puzzloope_speedup_r),this) ); set_drc_pcflush(machine(), 0x401da14); } | |
979 | DRIVER_INIT_MEMBER(skns_state,puzzloopj) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x6086714, 0x6086717, read32_delegate(FUNC(skns_state::puzzloopj_speedup_r),this) ); set_drc_pcflush(machine(), 0x401dca0); } | |
980 | DRIVER_INIT_MEMBER(skns_state,puzzloopa) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x6085bcc, 0x6085bcf, read32_delegate(FUNC(skns_state::puzzloopa_speedup_r),this) ); set_drc_pcflush(machine(), 0x401d9d4); } | |
981 | DRIVER_INIT_MEMBER(skns_state,puzzloopu) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x6085cec, 0x6085cef, read32_delegate(FUNC(skns_state::puzzloopu_speedup_r),this) ); set_drc_pcflush(machine(), 0x401dab0); } | |
982 | DRIVER_INIT_MEMBER(skns_state,jjparads) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x6000994, 0x6000997, read32_delegate(FUNC(skns_state::jjparads_speedup_r),this) ); set_drc_pcflush(machine(), 0x4015e84); } | |
983 | DRIVER_INIT_MEMBER(skns_state,jjparad2) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x6000984, 0x6000987, read32_delegate(FUNC(skns_state::jjparad2_speedup_r),this) ); set_drc_pcflush(machine(), 0x401620a); } | |
984 | DRIVER_INIT_MEMBER(skns_state,ryouran) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x6000a14, 0x6000a17, read32_delegate(FUNC(skns_state::ryouran_speedup_r),this) ); set_drc_pcflush(machine(), 0x40182ce); } | |
985 | DRIVER_INIT_MEMBER(skns_state,teljan) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x6002fb4, 0x6002fb7, read32_delegate(FUNC(skns_state::teljan_speedup_r),this) ); set_drc_pcflush(machine(), 0x401ba32); } | |
986 | DRIVER_INIT_MEMBER(skns_state,sengekis) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-192,-272); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x60b74bc, 0x60b74bf, read32_delegate(FUNC(skns_state::sengekis_speedup_r),this) ); set_drc_pcflush(machine(), 0x60006ec); } | |
987 | DRIVER_INIT_MEMBER(skns_state,sengekij) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-192,-272); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x60b7380, 0x60b7383, read32_delegate(FUNC(skns_state::sengekij_speedup_r),this) ); set_drc_pcflush(machine(), 0x60006ec); } | |
973 | DRIVER_INIT_MEMBER(skns_state,cyvern) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+0,+2); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x604d3c8, 0x604d3cb, read32_delegate(FUNC(skns_state::cyvern_speedup_r),this) ); set_drc_pcflush(machine(), 0x402ebd2); } | |
974 | DRIVER_INIT_MEMBER(skns_state,galpans2) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x60fb6bc, 0x60fb6bf, read32_delegate(FUNC(skns_state::galpans2_speedup_r),this) ); set_drc_pcflush(machine(), 0x4049ae2); } | |
975 | DRIVER_INIT_MEMBER(skns_state,gutsn) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+0,+0); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x600c780, 0x600c783, read32_delegate(FUNC(skns_state::gutsn_speedup_r),this) ); set_drc_pcflush(machine(), 0x402206e); } | |
976 | DRIVER_INIT_MEMBER(skns_state,panicstr) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x60f19e4, 0x60f19e7, read32_delegate(FUNC(skns_state::panicstr_speedup_r),this) ); set_drc_pcflush(machine(), 0x404e68a); } | |
977 | DRIVER_INIT_MEMBER(skns_state,senknow) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+1,+1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x60000dc, 0x60000df, read32_delegate(FUNC(skns_state::senknow_speedup_r),this) ); set_drc_pcflush(machine(), 0x4017dce); } | |
978 | DRIVER_INIT_MEMBER(skns_state,puzzloope) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6081d38, 0x6081d3b, read32_delegate(FUNC(skns_state::puzzloope_speedup_r),this) ); set_drc_pcflush(machine(), 0x401da14); } | |
979 | DRIVER_INIT_MEMBER(skns_state,puzzloopj) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6086714, 0x6086717, read32_delegate(FUNC(skns_state::puzzloopj_speedup_r),this) ); set_drc_pcflush(machine(), 0x401dca0); } | |
980 | DRIVER_INIT_MEMBER(skns_state,puzzloopa) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6085bcc, 0x6085bcf, read32_delegate(FUNC(skns_state::puzzloopa_speedup_r),this) ); set_drc_pcflush(machine(), 0x401d9d4); } | |
981 | DRIVER_INIT_MEMBER(skns_state,puzzloopu) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6085cec, 0x6085cef, read32_delegate(FUNC(skns_state::puzzloopu_speedup_r),this) ); set_drc_pcflush(machine(), 0x401dab0); } | |
982 | DRIVER_INIT_MEMBER(skns_state,jjparads) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6000994, 0x6000997, read32_delegate(FUNC(skns_state::jjparads_speedup_r),this) ); set_drc_pcflush(machine(), 0x4015e84); } | |
983 | DRIVER_INIT_MEMBER(skns_state,jjparad2) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6000984, 0x6000987, read32_delegate(FUNC(skns_state::jjparad2_speedup_r),this) ); set_drc_pcflush(machine(), 0x401620a); } | |
984 | DRIVER_INIT_MEMBER(skns_state,ryouran) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6000a14, 0x6000a17, read32_delegate(FUNC(skns_state::ryouran_speedup_r),this) ); set_drc_pcflush(machine(), 0x40182ce); } | |
985 | DRIVER_INIT_MEMBER(skns_state,teljan) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6002fb4, 0x6002fb7, read32_delegate(FUNC(skns_state::teljan_speedup_r),this) ); set_drc_pcflush(machine(), 0x401ba32); } | |
986 | DRIVER_INIT_MEMBER(skns_state,sengekis) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-192,-272); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x60b74bc, 0x60b74bf, read32_delegate(FUNC(skns_state::sengekis_speedup_r),this) ); set_drc_pcflush(machine(), 0x60006ec); } | |
987 | DRIVER_INIT_MEMBER(skns_state,sengekij) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-192,-272); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x60b7380, 0x60b7383, read32_delegate(FUNC(skns_state::sengekij_speedup_r),this) ); set_drc_pcflush(machine(), 0x60006ec); } | |
988 | 988 | DRIVER_INIT_MEMBER(skns_state,sarukani) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns(machine()); set_drc_pcflush(machine(), 0x4013b42); } // Speedup is in skns_io_w() |
989 | 989 | DRIVER_INIT_MEMBER(skns_state,galpans3) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns(machine()); } |
990 | 990 |
r18027 | r18028 | |
---|---|---|
875 | 875 | UINT8 *ROM = (UINT8 *)memregion("maincpu")->base(); |
876 | 876 | membank("bank1")->set_base(&ROM[0x10000+UNBANKED_SIZE]); |
877 | 877 | |
878 | machine().device("sub")->memory().space(AS_PROGRAM) | |
878 | machine().device("sub")->memory().space(AS_PROGRAM).install_read_handler(0x7000, 0x700f, read8_delegate(FUNC(witch_state::prot_read_700x), this)); | |
879 | 879 | m_bank = -1; |
880 | 880 | } |
881 | 881 |
r18027 | r18028 | |
---|---|---|
6477 | 6477 | |
6478 | 6478 | DRIVER_INIT_MEMBER(dynax_state,mjreach) |
6479 | 6479 | { |
6480 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
6480 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x10060, 0x10060, write8_delegate(FUNC(dynax_state::yarunara_flipscreen_w),this)); | |
6481 | 6481 | } |
6482 | 6482 | |
6483 | 6483 | /*************************************************************************** |
r18027 | r18028 | |
---|---|---|
404 | 404 | |
405 | 405 | DRIVER_INIT_MEMBER(shootout_state,shootout) |
406 | 406 | { |
407 | address_space &space = | |
407 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
408 | 408 | int length = machine().root_device().memregion("maincpu")->bytes(); |
409 | 409 | UINT8 *decrypt = auto_alloc_array(machine(), UINT8, length - 0x8000); |
410 | 410 | UINT8 *rom = machine().root_device().memregion("maincpu")->base(); |
r18027 | r18028 | |
---|---|---|
704 | 704 | set_led_status(machine(), 1, data & 0x01); |
705 | 705 | set_led_status(machine(), 2, data & 0x02); |
706 | 706 | set_led_status(machine(), 3, data & 0x04); |
707 | machine().device<ticket_dispenser_device>("ticket")->write( | |
707 | machine().device<ticket_dispenser_device>("ticket")->write(machine().driver_data()->generic_space(), 0, (data & 0x10) << 3); | |
708 | 708 | coin_counter_w(machine(), 0, (data & 0x20) >> 5); |
709 | 709 | } |
710 | 710 | |
r18027 | r18028 | |
722 | 722 | /* bit 4 controls the ticket dispenser */ |
723 | 723 | /* bit 5 controls the coin counter */ |
724 | 724 | /* bit 6 controls the diagnostic sound LED */ |
725 | machine().device<ticket_dispenser_device>("ticket")->write( | |
725 | machine().device<ticket_dispenser_device>("ticket")->write(machine().driver_data()->generic_space(), 0, (data & 0x10) << 3); | |
726 | 726 | coin_counter_w(machine(), 0, (data & 0x20) >> 5); |
727 | 727 | } |
728 | 728 | |
r18027 | r18028 | |
4037 | 4037 | m_planes = 1; |
4038 | 4038 | m_is_drivedge = 1; |
4039 | 4039 | |
4040 | machine().device("dsp1")->memory().space(AS_PROGRAM)->install_read_handler(0x8382, 0x8382, read32_delegate(FUNC(itech32_state::drivedge_tms1_speedup_r),this)); | |
4041 | machine().device("dsp2")->memory().space(AS_PROGRAM)->install_read_handler(0x8382, 0x8382, read32_delegate(FUNC(itech32_state::drivedge_tms2_speedup_r),this)); | |
4040 | machine().device("dsp1")->memory().space(AS_PROGRAM).install_read_handler(0x8382, 0x8382, read32_delegate(FUNC(itech32_state::drivedge_tms1_speedup_r),this)); | |
4041 | machine().device("dsp2")->memory().space(AS_PROGRAM).install_read_handler(0x8382, 0x8382, read32_delegate(FUNC(itech32_state::drivedge_tms2_speedup_r),this)); | |
4042 | 4042 | } |
4043 | 4043 | |
4044 | 4044 | |
r18027 | r18028 | |
4054 | 4054 | m_vram_height = 1024; |
4055 | 4055 | m_planes = 1; |
4056 | 4056 | |
4057 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
4057 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x680000, 0x680001, read16_delegate(FUNC(itech32_state::trackball_r),this)); | |
4058 | 4058 | |
4059 | machine().device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0x578000, 0x57ffff); | |
4060 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x680080, 0x680081, read16_delegate(FUNC(itech32_state::wcbowl_prot_result_r),this)); | |
4061 | machine().device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x680080, 0x680081); | |
4059 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_read(0x578000, 0x57ffff); | |
4060 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x680080, 0x680081, read16_delegate(FUNC(itech32_state::wcbowl_prot_result_r),this)); | |
4061 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write(0x680080, 0x680081); | |
4062 | 4062 | } |
4063 | 4063 | |
4064 | 4064 | |
r18027 | r18028 | |
4072 | 4072 | |
4073 | 4073 | state->m_itech020_prot_address = prot_addr; |
4074 | 4074 | |
4075 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x300000, 0x300003, write32_delegate(FUNC(itech32_state::itech020_color2_w),state)); | |
4076 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x380000, 0x380003, write32_delegate(FUNC(itech32_state::itech020_color1_w),state)); | |
4075 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x300000, 0x300003, write32_delegate(FUNC(itech32_state::itech020_color2_w),state)); | |
4076 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x380000, 0x380003, write32_delegate(FUNC(itech32_state::itech020_color1_w),state)); | |
4077 | 4077 | } |
4078 | 4078 | |
4079 | 4079 | |
r18027 | r18028 | |
4104 | 4104 | |
4105 | 4105 | state->m_itech020_prot_address = prot_addr; |
4106 | 4106 | |
4107 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x300000, 0x300003, write32_delegate(FUNC(itech32_state::itech020_color2_w),state)); | |
4108 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x380000, 0x380003, write32_delegate(FUNC(itech32_state::itech020_color1_w),state)); | |
4109 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x180800, 0x180803, read32_delegate(FUNC(itech32_state::trackball32_4bit_p1_r),state)); | |
4110 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x181000, 0x181003, read32_delegate(FUNC(itech32_state::trackball32_4bit_p2_r),state)); | |
4107 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x300000, 0x300003, write32_delegate(FUNC(itech32_state::itech020_color2_w),state)); | |
4108 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x380000, 0x380003, write32_delegate(FUNC(itech32_state::itech020_color1_w),state)); | |
4109 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x180800, 0x180803, read32_delegate(FUNC(itech32_state::trackball32_4bit_p1_r),state)); | |
4110 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x181000, 0x181003, read32_delegate(FUNC(itech32_state::trackball32_4bit_p2_r),state)); | |
4111 | 4111 | } |
4112 | 4112 | |
4113 | 4113 | |
r18027 | r18028 | |
4126 | 4126 | static void install_timekeeper(running_machine &machine) |
4127 | 4127 | { |
4128 | 4128 | device_t *device = machine.device("m48t02"); |
4129 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
4129 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(*device, 0x681000, 0x6817ff, FUNC(timekeeper_r), FUNC(timekeeper_w), 0xffffffff); | |
4130 | 4130 | } |
4131 | 4131 | |
4132 | 4132 | DRIVER_INIT_MEMBER(itech32_state,wcbowlt) |
r18027 | r18028 | |
4158 | 4158 | Hacked versions of this PCB have been found with GT97 |
4159 | 4159 | through GTClassic. This is _NOT_ a factory modification |
4160 | 4160 | */ |
4161 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
4161 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x200000, 0x200003, read32_delegate(FUNC(itech32_state::trackball32_8bit_r),this)); | |
4162 | 4162 | init_gt_common(machine()); |
4163 | 4163 | } |
4164 | 4164 | |
r18027 | r18028 | |
4171 | 4171 | board share the same sound CPU code and sample ROMs. |
4172 | 4172 | This board has all versions of GT for it, GT3D through GTClassic |
4173 | 4173 | */ |
4174 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x180800, 0x180803, read32_delegate(FUNC(itech32_state::trackball32_4bit_p1_r),this)); | |
4175 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x181000, 0x181003, read32_delegate(FUNC(itech32_state::trackball32_4bit_p2_r),this)); | |
4174 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x180800, 0x180803, read32_delegate(FUNC(itech32_state::trackball32_4bit_p1_r),this)); | |
4175 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x181000, 0x181003, read32_delegate(FUNC(itech32_state::trackball32_4bit_p2_r),this)); | |
4176 | 4176 | init_gt_common(machine()); |
4177 | 4177 | } |
4178 | 4178 | |
r18027 | r18028 | |
4196 | 4196 | board: GT97 v1.21S, GT98, GT99, GT2K & GT Classic Versions 1.00S |
4197 | 4197 | Trackball info is read through 200202 (actually 200203). |
4198 | 4198 | */ |
4199 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
4199 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x200200, 0x200203, read32_delegate(FUNC(itech32_state::trackball32_4bit_p1_r),this)); | |
4200 | 4200 | init_gt_common(machine()); |
4201 | 4201 | } |
4202 | 4202 | |
r18027 | r18028 | |
4210 | 4210 | Player 1 trackball read through 200003 |
4211 | 4211 | Player 2 trackball read through 200002 |
4212 | 4212 | */ |
4213 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
4213 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x200000, 0x200003, read32_delegate(FUNC(itech32_state::trackball32_4bit_combined_r),this)); | |
4214 | 4214 | init_gt_common(machine()); |
4215 | 4215 | } |
4216 | 4216 | |
r18027 | r18028 | |
4218 | 4218 | DRIVER_INIT_MEMBER(itech32_state,gt2kp) |
4219 | 4219 | { |
4220 | 4220 | /* a little extra protection */ |
4221 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
4221 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x680000, 0x680003, read32_delegate(FUNC(itech32_state::gt2kp_prot_result_r),this)); | |
4222 | 4222 | DRIVER_INIT_CALL(aama); |
4223 | 4223 | |
4224 | 4224 | /* The protection code is: |
r18027 | r18028 | |
4239 | 4239 | DRIVER_INIT_MEMBER(itech32_state,gtclasscp) |
4240 | 4240 | { |
4241 | 4241 | /* a little extra protection */ |
4242 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
4242 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x680000, 0x680003, read32_delegate(FUNC(itech32_state::gtclass_prot_result_r),this)); | |
4243 | 4243 | DRIVER_INIT_CALL(aama); |
4244 | 4244 | |
4245 | 4245 | /* The protection code is: |
r18027 | r18028 | |
---|---|---|
977 | 977 | m_bios_ram = auto_alloc_array(machine(), UINT32, 0x20000/4); |
978 | 978 | |
979 | 979 | pc_vga_init(machine(), vga_setting, NULL); |
980 | pc_svga_trident_io_init(machine(), | |
980 | pc_svga_trident_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); | |
981 | 981 | init_pc_common(machine(), PCCOMMON_KEYBOARD_AT, calchase_set_keyb_int); |
982 | 982 | |
983 | 983 | intel82439tx_init(machine()); |
984 | 984 | |
985 | 985 | kbdc8042_init(machine(), &at8042); |
986 | 986 | |
987 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
987 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x3f0b160, 0x3f0b163, read32_delegate(FUNC(calchase_state::calchase_idle_skip_r),this), write32_delegate(FUNC(calchase_state::calchase_idle_skip_w),this)); | |
988 | 988 | } |
989 | 989 | |
990 | 990 | ROM_START( calchase ) |
r18027 | r18028 | |
---|---|---|
287 | 287 | /* Decode the opcodes */ |
288 | 288 | |
289 | 289 | offs_t i; |
290 | address_space &space = | |
290 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
291 | 291 | UINT8 *rom = machine().root_device().memregion("maincpu")->base(); |
292 | 292 | UINT8 *decrypted = auto_alloc_array(machine(), UINT8, 0x6000); |
293 | 293 | UINT8 *table = machine().root_device().memregion("user1")->base(); |
r18027 | r18028 | |
---|---|---|
960 | 960 | |
961 | 961 | DRIVER_INIT_MEMBER(lkage_state,lkageb) |
962 | 962 | { |
963 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xf062, 0xf062, read8_delegate(FUNC(lkage_state::fake_mcu_r),this)); | |
964 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xf087, 0xf087, read8_delegate(FUNC(lkage_state::fake_status_r),this)); | |
965 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xf062, 0xf062, write8_delegate(FUNC(lkage_state::fake_mcu_w),this)); | |
963 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xf062, 0xf062, read8_delegate(FUNC(lkage_state::fake_mcu_r),this)); | |
964 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xf087, 0xf087, read8_delegate(FUNC(lkage_state::fake_status_r),this)); | |
965 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xf062, 0xf062, write8_delegate(FUNC(lkage_state::fake_mcu_w),this)); | |
966 | 966 | m_sprite_dx=0; |
967 | 967 | } |
968 | 968 |
r18027 | r18028 | |
---|---|---|
935 | 935 | |
936 | 936 | DRIVER_INIT_MEMBER(mpu3_state,m3hprvpr) |
937 | 937 | { |
938 | address_space &space = | |
938 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
939 | 939 | |
940 | 940 | m_disp_func=METER_PORT; |
941 | 941 | m_current_chr_table = hprvpr_data; |
r18027 | r18028 | |
---|---|---|
1495 | 1495 | |
1496 | 1496 | m_prot = 0; |
1497 | 1497 | m_jumpcode = 0; |
1498 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x07a006, 0x07a007, read16_delegate(FUNC(gaiden_state::wildfang_protection_r),this)); | |
1499 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x07a804, 0x07a805, write16_delegate(FUNC(gaiden_state::wildfang_protection_w),this)); | |
1498 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x07a006, 0x07a007, read16_delegate(FUNC(gaiden_state::wildfang_protection_r),this)); | |
1499 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x07a804, 0x07a805, write16_delegate(FUNC(gaiden_state::wildfang_protection_w),this)); | |
1500 | 1500 | } |
1501 | 1501 | |
1502 | 1502 | DRIVER_INIT_MEMBER(gaiden_state,raiga) |
r18027 | r18028 | |
1507 | 1507 | |
1508 | 1508 | m_prot = 0; |
1509 | 1509 | m_jumpcode = 0; |
1510 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x07a006, 0x07a007, read16_delegate(FUNC(gaiden_state::raiga_protection_r),this)); | |
1511 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x07a804, 0x07a805, write16_delegate(FUNC(gaiden_state::raiga_protection_w),this)); | |
1510 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x07a006, 0x07a007, read16_delegate(FUNC(gaiden_state::raiga_protection_r),this)); | |
1511 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x07a804, 0x07a805, write16_delegate(FUNC(gaiden_state::raiga_protection_w),this)); | |
1512 | 1512 | } |
1513 | 1513 | |
1514 | 1514 | static void descramble_drgnbowl_gfx(running_machine &machine) |
r18027 | r18028 | |
---|---|---|
1444 | 1444 | |
1445 | 1445 | DRIVER_INIT_MEMBER(trackfld_state,atlantol) |
1446 | 1446 | { |
1447 | address_space &space = | |
1447 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1448 | 1448 | UINT8 *rom = machine().root_device().memregion("maincpu")->base(); |
1449 | 1449 | UINT8 *decrypt; |
1450 | 1450 | int A; |
r18027 | r18028 | |
---|---|---|
1290 | 1290 | rom[i] = prom[rom[i]]; |
1291 | 1291 | |
1292 | 1292 | /* set up protection handlers */ |
1293 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xa003, 0xa003, read8_delegate(FUNC(astrof_state::shoot_r),this)); | |
1294 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xa004, 0xa004, read8_delegate(FUNC(astrof_state::abattle_coin_prot_r),this)); | |
1293 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xa003, 0xa003, read8_delegate(FUNC(astrof_state::shoot_r),this)); | |
1294 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xa004, 0xa004, read8_delegate(FUNC(astrof_state::abattle_coin_prot_r),this)); | |
1295 | 1295 | } |
1296 | 1296 | |
1297 | 1297 | |
r18027 | r18028 | |
1304 | 1304 | rom[i] = ~rom[i]; |
1305 | 1305 | |
1306 | 1306 | /* set up protection handlers */ |
1307 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xa003, 0xa003, read8_delegate(FUNC(astrof_state::shoot_r),this)); | |
1308 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xa004, 0xa004, read8_delegate(FUNC(astrof_state::afire_coin_prot_r),this)); | |
1307 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xa003, 0xa003, read8_delegate(FUNC(astrof_state::shoot_r),this)); | |
1308 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xa004, 0xa004, read8_delegate(FUNC(astrof_state::afire_coin_prot_r),this)); | |
1309 | 1309 | } |
1310 | 1310 | |
1311 | 1311 | |
r18027 | r18028 | |
1318 | 1318 | rom[i] = ~rom[i]; |
1319 | 1319 | |
1320 | 1320 | /* set up protection handlers */ |
1321 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xa003, 0xa003, read8_delegate(FUNC(astrof_state::shoot_r),this)); | |
1322 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xa004, 0xa004, read8_delegate(FUNC(astrof_state::abattle_coin_prot_r),this)); | |
1321 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xa003, 0xa003, read8_delegate(FUNC(astrof_state::shoot_r),this)); | |
1322 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xa004, 0xa004, read8_delegate(FUNC(astrof_state::abattle_coin_prot_r),this)); | |
1323 | 1323 | } |
1324 | 1324 | |
1325 | 1325 |
r18027 | r18028 | |
---|---|---|
1565 | 1565 | |
1566 | 1566 | /* unmap everything we know about */ |
1567 | 1567 | for (addr = 0; addr < state->m_dynamic_count; addr++) |
1568 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1568 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_readwrite(dynamic[addr].start, dynamic[addr].end); | |
1569 | 1569 | |
1570 | 1570 | /* the build the list of stuff */ |
1571 | 1571 | state->m_dynamic_count = 0; |
r18027 | r18028 | |
1681 | 1681 | |
1682 | 1682 | /* now remap everything */ |
1683 | 1683 | if (LOG_DYNAMIC) logerror("remap_dynamic_addresses:\n"); |
1684 | address_space &space = | |
1684 | address_space &space = machine.device<cpu_device>("maincpu")->space(AS_PROGRAM); | |
1685 | 1685 | for (addr = 0; addr < state->m_dynamic_count; addr++) |
1686 | 1686 | { |
1687 | 1687 | if (LOG_DYNAMIC) logerror(" installing: %08X-%08X %s,%s\n", dynamic[addr].start, dynamic[addr].end, dynamic[addr].rdname, dynamic[addr].wrname); |
r18027 | r18028 | |
---|---|---|
1141 | 1141 | m_video_type = 2; |
1142 | 1142 | |
1143 | 1143 | /* no MSM */ |
1144 | machine().device("soundcpu")->memory().space(AS_PROGRAM)->nop_write(0xc000, 0xc000); | |
1145 | machine().device("soundcpu")->memory().space(AS_PROGRAM)->nop_write(0xc400, 0xc400); | |
1146 | machine().device("soundcpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xc800); | |
1144 | machine().device("soundcpu")->memory().space(AS_PROGRAM).nop_write(0xc000, 0xc000); | |
1145 | machine().device("soundcpu")->memory().space(AS_PROGRAM).nop_write(0xc400, 0xc400); | |
1146 | machine().device("soundcpu")->memory().space(AS_PROGRAM).nop_write(0xc800, 0xc800); | |
1147 | 1147 | } |
1148 | 1148 | |
1149 | 1149 |
r18027 | r18028 | |
---|---|---|
753 | 753 | |
754 | 754 | if (data > 0) |
755 | 755 | { |
756 | address_space* addr_space; | |
757 | 756 | UINT8* adsp_rom = (UINT8*)space.machine().root_device().memregion("adsp")->base(); |
758 | 757 | |
759 | 758 | UINT32 page = (m_adsp_regs.bdma_control >> 8) & 0xff; |
r18027 | r18028 | |
762 | 761 | |
763 | 762 | UINT32 src_addr = (page << 14) | m_adsp_regs.bdma_external_addr; |
764 | 763 | |
765 | if (type == 0) | |
766 | addr_space = m_adsp->space(AS_PROGRAM); | |
767 | else | |
768 | addr_space = m_adsp->space(AS_DATA); | |
764 | address_space &addr_space = m_adsp->space((type == 0) ? AS_PROGRAM : AS_DATA); | |
769 | 765 | |
770 | 766 | if (dir == 0) |
771 | 767 | { |
r18027 | r18028 | |
777 | 773 | (adsp_rom[src_addr + 1] << 8) | |
778 | 774 | (adsp_rom[src_addr + 2]); |
779 | 775 | |
780 | addr_space | |
776 | addr_space.write_dword(m_adsp_regs.bdma_internal_addr * 4, src_word); | |
781 | 777 | |
782 | 778 | src_addr += 3; |
783 | 779 | m_adsp_regs.bdma_internal_addr ++; |
r18027 | r18028 | |
786 | 782 | { |
787 | 783 | UINT32 src_word =(adsp_rom[src_addr + 0] << 8) | adsp_rom[src_addr + 1]; |
788 | 784 | |
789 | addr_space | |
785 | addr_space.write_dword(m_adsp_regs.bdma_internal_addr * 2, src_word); | |
790 | 786 | |
791 | 787 | src_addr += 2; |
792 | 788 | m_adsp_regs.bdma_internal_addr ++; |
r18027 | r18028 | |
---|---|---|
664 | 664 | |
665 | 665 | kbdc8042_init(machine(), &at8042); |
666 | 666 | pc_vga_init(machine(), vga_setting, NULL); |
667 | pc_vga_io_init(machine(), | |
667 | pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); | |
668 | 668 | } |
669 | 669 | |
670 | 670 | void xtom3d_state::machine_reset() |
r18027 | r18028 | |
---|---|---|
495 | 495 | { |
496 | 496 | namcona1_state *state = machine.driver_data<namcona1_state>(); |
497 | 497 | UINT16 data; |
498 | address_space &space = | |
498 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
499 | 499 | |
500 | 500 | if( source>=0x400000 && source<0xc00000 ) |
501 | 501 | { |
r18027 | r18028 | |
---|---|---|
2036 | 2036 | { |
2037 | 2037 | m_scroll_type = 0; |
2038 | 2038 | |
2039 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x07c000, 0x07c001, write16_delegate(FUNC(armedf_state::bootleg_io_w),this)); | |
2040 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x07c006, 0x07c007, write16_delegate(FUNC(armedf_state::terraf_fg_scrolly_w),this)); | |
2041 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x07c008, 0x07c009, write16_delegate(FUNC(armedf_state::terraf_fg_scrollx_w),this)); | |
2042 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x0c0000, 0x0c0001, write16_delegate(FUNC(armedf_state::terraf_fg_scroll_msb_arm_w),this)); | |
2039 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x07c000, 0x07c001, write16_delegate(FUNC(armedf_state::bootleg_io_w),this)); | |
2040 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x07c006, 0x07c007, write16_delegate(FUNC(armedf_state::terraf_fg_scrolly_w),this)); | |
2041 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x07c008, 0x07c009, write16_delegate(FUNC(armedf_state::terraf_fg_scrollx_w),this)); | |
2042 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x0c0000, 0x0c0001, write16_delegate(FUNC(armedf_state::terraf_fg_scroll_msb_arm_w),this)); | |
2043 | 2043 | } |
2044 | 2044 | |
2045 | 2045 | DRIVER_INIT_MEMBER(armedf_state,terrafu) |
2046 | 2046 | { |
2047 | 2047 | m_scroll_type = 0; |
2048 | 2048 | |
2049 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2049 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x07c000, 0x07c001, write16_delegate(FUNC(armedf_state::terraf_io_w),this)); | |
2050 | 2050 | } |
2051 | 2051 | |
2052 | 2052 | DRIVER_INIT_MEMBER(armedf_state,terrafb) |
2053 | 2053 | { |
2054 | 2054 | m_scroll_type = 0; |
2055 | 2055 | |
2056 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2056 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x07c000, 0x07c001, write16_delegate(FUNC(armedf_state::terrafb_io_w),this)); | |
2057 | 2057 | } |
2058 | 2058 | |
2059 | 2059 | DRIVER_INIT_MEMBER(armedf_state,armedf) |
r18027 | r18028 | |
2066 | 2066 | { |
2067 | 2067 | m_scroll_type = 0; |
2068 | 2068 | |
2069 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2069 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x07c000, 0x07c001, write16_delegate(FUNC(armedf_state::terraf_io_w),this)); | |
2070 | 2070 | |
2071 | 2071 | } |
2072 | 2072 | |
r18027 | r18028 | |
2081 | 2081 | RAM[0x000488 / 2] = 0x4e71; |
2082 | 2082 | #endif |
2083 | 2083 | |
2084 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2084 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x07c000, 0x07c001, write16_delegate(FUNC(armedf_state::terraf_io_w),this)); | |
2085 | 2085 | |
2086 | 2086 | m_scroll_type = 2; |
2087 | 2087 | } |
r18027 | r18028 | |
2096 | 2096 | /* No need to patch the checksum routine (see notes) ! */ |
2097 | 2097 | #endif |
2098 | 2098 | |
2099 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2099 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x07c000, 0x07c001, write16_delegate(FUNC(armedf_state::bootleg_io_w),this)); | |
2100 | 2100 | |
2101 | 2101 | m_scroll_type = 2; |
2102 | 2102 | } |
r18027 | r18028 | |
2104 | 2104 | DRIVER_INIT_MEMBER(armedf_state,cclimbr2) |
2105 | 2105 | { |
2106 | 2106 | |
2107 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2107 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x07c000, 0x07c001, write16_delegate(FUNC(armedf_state::terraf_io_w),this)); | |
2108 | 2108 | |
2109 | 2109 | m_scroll_type = 3; |
2110 | 2110 | } |
r18027 | r18028 | |
---|---|---|
197 | 197 | DRIVER_INIT_MEMBER(pcat_dyn_state,pcat_dyn) |
198 | 198 | { |
199 | 199 | pc_vga_init(machine(), vga_setting, NULL); |
200 | pc_vga_io_init(machine(), | |
200 | pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); | |
201 | 201 | } |
202 | 202 | |
203 | 203 | GAME( 1995, toursol, 0, pcat_dyn, pcat_dyn, pcat_dyn_state, pcat_dyn, ROT0, "Dynamo", "Tournament Solitaire (V1.06, 08/03/95)", GAME_NOT_WORKING|GAME_NO_SOUND ) |
r18027 | r18028 | |
---|---|---|
519 | 519 | fatalerror("hb_dma_read_byte - unmapped access for 0x%02x - bucket 0x%02x\n", offset, bucket); |
520 | 520 | |
521 | 521 | addr = ((bucket << 7) & 0x7c00) | (offset & 0x3ff); |
522 | address_space *prog_space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
523 | return prog_space->read_byte(addr); | |
522 | address_space &prog_space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
523 | return prog_space.read_byte(addr); | |
524 | 524 | } |
525 | 525 | |
526 | 526 | WRITE8_MEMBER(dkong_state::hb_dma_write_byte) |
r18027 | r18028 | |
532 | 532 | fatalerror("hb_dma_read_byte - unmapped access for 0x%02x - bucket 0x%02x\n", offset, bucket); |
533 | 533 | |
534 | 534 | addr = ((bucket << 7) & 0x7c00) | (offset & 0x3ff); |
535 | address_space *prog_space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
536 | prog_space->write_byte(addr, data); | |
535 | address_space &prog_space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
536 | prog_space.write_byte(addr, data); | |
537 | 537 | } |
538 | 538 | |
539 | 539 | READ8_MEMBER(dkong_state::p8257_ctl_r) |
r18027 | r18028 | |
3097 | 3097 | {7,1,4,0,3,6,2,5}, |
3098 | 3098 | }; |
3099 | 3099 | |
3100 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
3100 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x3fff, "bank1" ); | |
3101 | 3101 | |
3102 | 3102 | /* While the PAL supports up to 16 decryption methods, only four |
3103 | 3103 | are actually used in the PAL. Therefore, we'll take a little |
r18027 | r18028 | |
3119 | 3119 | {6,3,4,1,0,7,2,5}, |
3120 | 3120 | }; |
3121 | 3121 | |
3122 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
3122 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x3fff, "bank1" ); | |
3123 | 3123 | |
3124 | 3124 | /* While the PAL supports up to 16 decryption methods, only four |
3125 | 3125 | are actually used in the PAL. Therefore, we'll take a little |
r18027 | r18028 | |
3130 | 3130 | drakton_decrypt_rom(machine(), 0x88, 0x1c000, bs[3]); |
3131 | 3131 | |
3132 | 3132 | /* custom handlers supporting Joystick or Steering Wheel */ |
3133 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x7c00, 0x7c00, read8_delegate(FUNC(dkong_state::strtheat_inputport_0_r),this)); | |
3134 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x7c80, 0x7c80, read8_delegate(FUNC(dkong_state::strtheat_inputport_1_r),this)); | |
3133 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x7c00, 0x7c00, read8_delegate(FUNC(dkong_state::strtheat_inputport_0_r),this)); | |
3134 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x7c80, 0x7c80, read8_delegate(FUNC(dkong_state::strtheat_inputport_1_r),this)); | |
3135 | 3135 | } |
3136 | 3136 | |
3137 | 3137 | |
3138 | 3138 | DRIVER_INIT_MEMBER(dkong_state,dkongx) |
3139 | 3139 | { |
3140 | 3140 | UINT8 *decrypted; |
3141 | address_space &space = | |
3141 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
3142 | 3142 | |
3143 | 3143 | decrypted = auto_alloc_array(machine(), UINT8, 0x10000); |
3144 | 3144 | |
3145 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x5fff, "bank1" ); | |
3146 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0xffff, "bank2" ); | |
3145 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x5fff, "bank1" ); | |
3146 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x8000, 0xffff, "bank2" ); | |
3147 | 3147 | |
3148 | 3148 | space.install_write_handler(0xe000, 0xe000, write8_delegate(FUNC(dkong_state::braze_a15_w),this)); |
3149 | 3149 |
r18027 | r18028 | |
---|---|---|
612 | 612 | |
613 | 613 | DRIVER_INIT_MEMBER(appoooh_state,robowresb) |
614 | 614 | { |
615 | address_space &space = | |
615 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
616 | 616 | space.set_decrypted_region(0x0000, 0x7fff, machine().root_device().memregion("maincpu")->base() + 0x1c000); |
617 | 617 | } |
618 | 618 |
r18027 | r18028 | |
---|---|---|
10313 | 10313 | |
10314 | 10314 | ROM[i] = x; |
10315 | 10315 | } |
10316 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x1d, 0x1d, read8_delegate(FUNC(goldstar_state::fixedvala8_r),this)); | |
10317 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x2a, 0x2a, read8_delegate(FUNC(goldstar_state::fixedvalb4_r),this)); | |
10316 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x1d, 0x1d, read8_delegate(FUNC(goldstar_state::fixedvala8_r),this)); | |
10317 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x2a, 0x2a, read8_delegate(FUNC(goldstar_state::fixedvalb4_r),this)); | |
10318 | 10318 | /* Oki 6295 at 0x20 */ |
10319 | 10319 | } |
10320 | 10320 | |
r18027 | r18028 | |
10342 | 10342 | } |
10343 | 10343 | |
10344 | 10344 | |
10345 | machine().device("maincpu")->memory().space(AS_IO) | |
10345 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x16, 0x16, read8_delegate(FUNC(goldstar_state::fixedval38_r),this)); | |
10346 | 10346 | /* Oki 6295 at 0x20 */ |
10347 | 10347 | } |
10348 | 10348 | |
r18027 | r18028 | |
10368 | 10368 | |
10369 | 10369 | ROM[i] = x; |
10370 | 10370 | } |
10371 | machine().device("maincpu")->memory().space(AS_IO) | |
10371 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x1e, 0x1e, read8_delegate(FUNC(goldstar_state::fixedvalea_r),this)); | |
10372 | 10372 | /* Oki 6295 at 0x20 */ |
10373 | 10373 | } |
10374 | 10374 | |
r18027 | r18028 | |
10394 | 10394 | } |
10395 | 10395 | ROM[i] = x; |
10396 | 10396 | } |
10397 | machine().device("maincpu")->memory().space(AS_IO) | |
10397 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x31, 0x31, read8_delegate(FUNC(goldstar_state::fixedval68_r),this)); | |
10398 | 10398 | |
10399 | 10399 | } |
10400 | 10400 | |
r18027 | r18028 | |
10421 | 10421 | |
10422 | 10422 | ROM[i] = x; |
10423 | 10423 | } |
10424 | machine().device("maincpu")->memory().space(AS_IO) | |
10424 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x21, 0x21, read8_delegate(FUNC(goldstar_state::fixedval58_r),this)); | |
10425 | 10425 | } |
10426 | 10426 | |
10427 | 10427 | READ8_MEMBER(goldstar_state::fixedval80_r) |
r18027 | r18028 | |
10457 | 10457 | ROM[i] = x; |
10458 | 10458 | } |
10459 | 10459 | // nfb96b needs both of these |
10460 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x23, 0x23, read8_delegate(FUNC(goldstar_state::fixedval80_r),this)); | |
10461 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x5a, 0x5a, read8_delegate(FUNC(goldstar_state::fixedvalaa_r),this)); | |
10460 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x23, 0x23, read8_delegate(FUNC(goldstar_state::fixedval80_r),this)); | |
10461 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x5a, 0x5a, read8_delegate(FUNC(goldstar_state::fixedvalaa_r),this)); | |
10462 | 10462 | |
10463 | 10463 | // csel96b |
10464 | machine().device("maincpu")->memory().space(AS_IO) | |
10464 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x6e, 0x6e, read8_delegate(FUNC(goldstar_state::fixedval96_r),this)); | |
10465 | 10465 | |
10466 | 10466 | } |
10467 | 10467 | |
r18027 | r18028 | |
10488 | 10488 | } |
10489 | 10489 | ROM[i] = x; |
10490 | 10490 | } |
10491 | machine().device("maincpu")->memory().space(AS_IO) | |
10491 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x2e, 0x2e, read8_delegate(FUNC(goldstar_state::fixedvalbe_r),this)); | |
10492 | 10492 | |
10493 | 10493 | } |
10494 | 10494 | |
r18027 | r18028 | |
10520 | 10520 | ROM[i] = x; |
10521 | 10521 | } |
10522 | 10522 | |
10523 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x5e, 0x5e, read8_delegate(FUNC(goldstar_state::fixedval84_r),this)); | |
10524 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x36, 0x36, read8_delegate(FUNC(goldstar_state::fixedval90_r),this)); | |
10523 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x5e, 0x5e, read8_delegate(FUNC(goldstar_state::fixedval84_r),this)); | |
10524 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x36, 0x36, read8_delegate(FUNC(goldstar_state::fixedval90_r),this)); | |
10525 | 10525 | } |
10526 | 10526 | |
10527 | 10527 | READ8_MEMBER(goldstar_state::fixedvalb2_r) |
r18027 | r18028 | |
10548 | 10548 | ROM[i] = x; |
10549 | 10549 | } |
10550 | 10550 | |
10551 | machine().device("maincpu")->memory().space(AS_IO) | |
10551 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x34, 0x34, read8_delegate(FUNC(goldstar_state::fixedvalb2_r),this)); | |
10552 | 10552 | } |
10553 | 10553 | |
10554 | 10554 | READ8_MEMBER(goldstar_state::fixedval48_r) |
r18027 | r18028 | |
10575 | 10575 | ROM[i] = x; |
10576 | 10576 | } |
10577 | 10577 | |
10578 | machine().device("maincpu")->memory().space(AS_IO) | |
10578 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x17, 0x17, read8_delegate(FUNC(goldstar_state::fixedval48_r),this)); | |
10579 | 10579 | } |
10580 | 10580 | |
10581 | 10581 | READ8_MEMBER(goldstar_state::fixedval09_r) |
r18027 | r18028 | |
10607 | 10607 | |
10608 | 10608 | ROM[i] = x; |
10609 | 10609 | } |
10610 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x32, 0x32, read8_delegate(FUNC(goldstar_state::fixedval74_r),this)); | |
10611 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x12, 0x12, read8_delegate(FUNC(goldstar_state::fixedval09_r),this)); | |
10610 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x32, 0x32, read8_delegate(FUNC(goldstar_state::fixedval74_r),this)); | |
10611 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x12, 0x12, read8_delegate(FUNC(goldstar_state::fixedval09_r),this)); | |
10612 | 10612 | /* oki6295 at 0x20 */ |
10613 | 10613 | } |
10614 | 10614 | |
r18027 | r18028 | |
10641 | 10641 | ROM[i] = x; |
10642 | 10642 | } |
10643 | 10643 | |
10644 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x16, 0x16, read8_delegate(FUNC(goldstar_state::fixedvalc7_r),this)); | |
10645 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x1a, 0x1a, read8_delegate(FUNC(goldstar_state::fixedvale4_r),this)); | |
10644 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x16, 0x16, read8_delegate(FUNC(goldstar_state::fixedvalc7_r),this)); | |
10645 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x1a, 0x1a, read8_delegate(FUNC(goldstar_state::fixedvale4_r),this)); | |
10646 | 10646 | } |
10647 | 10647 | |
10648 | 10648 | DRIVER_INIT_MEMBER(goldstar_state,cherrys) |
r18027 | r18028 | |
10707 | 10707 | DRIVER_INIT_MEMBER(goldstar_state,tonypok) |
10708 | 10708 | { |
10709 | 10709 | // the ppi doesn't seem to work properly, so just install the inputs directly |
10710 | address_space *io = machine().device("maincpu")->memory().space(AS_IO); | |
10711 | io->install_read_port(0x04, 0x04, "IN0" ); | |
10712 | io->install_read_port(0x05, 0x05, "IN1" ); | |
10713 | io->install_read_port(0x06, 0x06, "IN2" ); | |
10710 | address_space &io = machine().device("maincpu")->memory().space(AS_IO); | |
10711 | io.install_read_port(0x04, 0x04, "IN0" ); | |
10712 | io.install_read_port(0x05, 0x05, "IN1" ); | |
10713 | io.install_read_port(0x06, 0x06, "IN2" ); | |
10714 | 10714 | |
10715 | 10715 | } |
10716 | 10716 |
r18027 | r18028 | |
---|---|---|
3294 | 3294 | int i; |
3295 | 3295 | UINT8 *ROM = memregion("maincpu")->base(); |
3296 | 3296 | UINT8 *KEY = memregion("decryption")->base(); |
3297 | address_space &space = | |
3297 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
3298 | 3298 | UINT8 data[0x1000]; |
3299 | 3299 | |
3300 | 3300 | // the decryption key is in a rom (part of an MSDOS executable...) |
r18027 | r18028 | |
---|---|---|
228 | 228 | m_star_enable = data & 0x10; |
229 | 229 | |
230 | 230 | /* bits 5-7 go to the music board connector */ |
231 | audio_2_command_w( | |
231 | audio_2_command_w(m_maincpu->space(AS_PROGRAM), 0, data & 0xe0); | |
232 | 232 | } |
233 | 233 | |
234 | 234 |
r18027 | r18028 | |
---|---|---|
1118 | 1118 | { |
1119 | 1119 | |
1120 | 1120 | // Set up the QS1000 program ROM banking, taking care not to overlap the internal RAM |
1121 | machine().device("qs1000:cpu")->memory().space(AS_IO) | |
1121 | machine().device("qs1000:cpu")->memory().space(AS_IO).install_read_bank(0x0100, 0xffff, "bank"); | |
1122 | 1122 | membank("qs1000:bank")->configure_entries(0, 8, memregion("qs1000:cpu")->base()+0x100, 0x10000); |
1123 | 1123 | |
1124 | 1124 | m_spriteram_bit = 1; |
r18027 | r18028 | |
1126 | 1126 | |
1127 | 1127 | DRIVER_INIT_MEMBER(limenko_state,dynabomb) |
1128 | 1128 | { |
1129 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1129 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xe2784, 0xe2787, read32_delegate(FUNC(limenko_state::dynabomb_speedup_r), this)); | |
1130 | 1130 | |
1131 | 1131 | DRIVER_INIT_CALL(common); |
1132 | 1132 | } |
1133 | 1133 | |
1134 | 1134 | DRIVER_INIT_MEMBER(limenko_state,legendoh) |
1135 | 1135 | { |
1136 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1136 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x32ab0, 0x32ab3, read32_delegate(FUNC(limenko_state::legendoh_speedup_r), this)); | |
1137 | 1137 | |
1138 | 1138 | DRIVER_INIT_CALL(common); |
1139 | 1139 | } |
1140 | 1140 | |
1141 | 1141 | DRIVER_INIT_MEMBER(limenko_state,sb2003) |
1142 | 1142 | { |
1143 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1143 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x135800, 0x135803, read32_delegate(FUNC(limenko_state::sb2003_speedup_r), this)); | |
1144 | 1144 | |
1145 | 1145 | DRIVER_INIT_CALL(common); |
1146 | 1146 | } |
r18027 | r18028 | |
1161 | 1161 | dst[x+2] = (src[x+1]&0x0f) >> 0; |
1162 | 1162 | } |
1163 | 1163 | |
1164 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1164 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6626c, 0x6626f, read32_delegate(FUNC(limenko_state::spotty_speedup_r), this)); | |
1165 | 1165 | |
1166 | 1166 | m_spriteram_bit = 1; |
1167 | 1167 | } |
r18027 | r18028 | |
---|---|---|
692 | 692 | { 0x88,0x0a,0x82,0x00,0xa0,0x22,0xaa,0x28 }, /* ...1...1...0.... */ |
693 | 693 | { 0x88,0x0a,0x82,0x00,0xa0,0x22,0xaa,0x28 } /* ...1...1...1.... */ |
694 | 694 | }; |
695 | address_space &space = | |
695 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
696 | 696 | UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0x8000); |
697 | 697 | UINT8 *rom = machine().root_device().memregion("maincpu")->base(); |
698 | 698 | int A; |
r18027 | r18028 | |
---|---|---|
463 | 463 | |
464 | 464 | MACHINE_RESET_MEMBER(polepos_state,polepos) |
465 | 465 | { |
466 | address_space &space = | |
466 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
467 | 467 | int i; |
468 | 468 | |
469 | 469 | /* Reset all latches */ |
r18027 | r18028 | |
1990 | 1990 | DRIVER_INIT_MEMBER(polepos_state,topracern) |
1991 | 1991 | { |
1992 | 1992 | /* extra direct mapped inputs read */ |
1993 | machine().device("maincpu")->memory().space(AS_IO)->install_read_port(0x02, 0x02, "STEER"); | |
1994 | machine().device("maincpu")->memory().space(AS_IO)->install_read_port(0x03, 0x03, "IN0"); | |
1995 | machine().device("maincpu")->memory().space(AS_IO)->install_read_port(0x04, 0x04, "DSWA"); | |
1993 | machine().device("maincpu")->memory().space(AS_IO).install_read_port(0x02, 0x02, "STEER"); | |
1994 | machine().device("maincpu")->memory().space(AS_IO).install_read_port(0x03, 0x03, "IN0"); | |
1995 | machine().device("maincpu")->memory().space(AS_IO).install_read_port(0x04, 0x04, "DSWA"); | |
1996 | 1996 | } |
1997 | 1997 | |
1998 | 1998 | DRIVER_INIT_MEMBER(polepos_state,polepos2) |
1999 | 1999 | { |
2000 | 2000 | /* note that the bootleg version doesn't need this custom IC; it has a hacked ROM in its place */ |
2001 | machine().device("sub")->memory().space(AS_PROGRAM) | |
2001 | machine().device("sub")->memory().space(AS_PROGRAM).install_read_handler(0x4000, 0x5fff, read16_delegate(FUNC(polepos_state::polepos2_ic25_r),this)); | |
2002 | 2002 | } |
2003 | 2003 | |
2004 | 2004 |
r18027 | r18028 | |
---|---|---|
396 | 396 | |
397 | 397 | DRIVER_INIT_MEMBER(galaxygame_state,galaxygame) |
398 | 398 | { |
399 | address_space | |
399 | address_space &main = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
400 | 400 | UINT8 *code = machine().root_device().memregion("code")->base(); |
401 | 401 | |
402 | 402 | int filepos = 0, linepos, linelen; |
r18027 | r18028 | |
426 | 426 | if ( (linelen >= 15+6) && (line[15] != ' ') ) |
427 | 427 | { |
428 | 428 | read_uint16(&val, 15, line, linelen); |
429 | main | |
429 | main.write_word(address, val, 0xffff); | |
430 | 430 | address += 2; |
431 | 431 | |
432 | 432 | if ( (linelen >= 22+6) && (line[22] != ' ') ) |
433 | 433 | { |
434 | 434 | read_uint16(&val, 22, line, linelen); |
435 | main | |
435 | main.write_word(address, val, 0xffff); | |
436 | 436 | address += 2; |
437 | 437 | } |
438 | 438 | |
439 | 439 | if ( (linelen >= 29+6) && (line[29] != ' ') ) |
440 | 440 | { |
441 | 441 | read_uint16(&val, 29, line, linelen); |
442 | main | |
442 | main.write_word(address, val, 0xffff); | |
443 | 443 | address += 2; |
444 | 444 | } |
445 | 445 | |
r18027 | r18028 | |
449 | 449 | if ( (linelen >= 18+3) && (line[18] != ' ') ) |
450 | 450 | { |
451 | 451 | read_uint8(&val8, 18, line, linelen); |
452 | main | |
452 | main.write_byte(address, val8); | |
453 | 453 | address += 1; |
454 | 454 | } |
455 | 455 | } |
r18027 | r18028 | |
458 | 458 | } |
459 | 459 | |
460 | 460 | // set startup code |
461 | main->write_word(0, 012700); /* MOV #0, R0 */ | |
462 | main->write_word(2, 0); | |
463 | main->write_word(4, 0x8d00); /* MTPS R0 */ | |
464 | main->write_word(6, 000167); /* JMP 0500*/ | |
465 | main->write_word(8, 000500 - 10); | |
461 | main.write_word(0, 012700); /* MOV #0, R0 */ | |
462 | main.write_word(2, 0); | |
463 | main.write_word(4, 0x8d00); /* MTPS R0 */ | |
464 | main.write_word(6, 000167); /* JMP 0500*/ | |
465 | main.write_word(8, 000500 - 10); | |
466 | 466 | } |
467 | 467 | |
468 | 468 | GAME(1971, galgame, 0, galaxygame, galaxygame, galaxygame_state, galaxygame, ROT270, "Computer Recreations, Inc", "Galaxy Game", GAME_NO_SOUND_HW ) |
r18027 | r18028 | |
---|---|---|
10698 | 10698 | |
10699 | 10699 | /* Forgotten Worlds has a NEC uPD4701AC on the B-board handling dial inputs from the CN-MOWS connector. */ |
10700 | 10700 | /* The memory mapping is handled by PAL LWIO */ |
10701 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x800040, 0x800041, write16_delegate(FUNC(cps_state::forgottn_dial_0_reset_w),this)); | |
10702 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x800048, 0x800049, write16_delegate(FUNC(cps_state::forgottn_dial_1_reset_w),this)); | |
10703 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x800052, 0x800055, read16_delegate(FUNC(cps_state::forgottn_dial_0_r),this)); | |
10704 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x80005a, 0x80005d, read16_delegate(FUNC(cps_state::forgottn_dial_1_r),this)); | |
10701 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x800040, 0x800041, write16_delegate(FUNC(cps_state::forgottn_dial_0_reset_w),this)); | |
10702 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x800048, 0x800049, write16_delegate(FUNC(cps_state::forgottn_dial_1_reset_w),this)); | |
10703 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x800052, 0x800055, read16_delegate(FUNC(cps_state::forgottn_dial_0_r),this)); | |
10704 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x80005a, 0x80005d, read16_delegate(FUNC(cps_state::forgottn_dial_1_r),this)); | |
10705 | 10705 | |
10706 | 10706 | save_item(NAME(m_dial)); |
10707 | 10707 | |
r18027 | r18028 | |
10715 | 10715 | { |
10716 | 10716 | /* This specific revision of SF2 has the CPS-B custom mapped at a different address. */ |
10717 | 10717 | /* The mapping is handled by the PAL IOB2 on the B-board */ |
10718 | machine().device("maincpu")->memory().space(AS_PROGRAM)->unmap_readwrite(0x800140, 0x80017f); | |
10719 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x8001c0, 0x8001ff, read16_delegate(FUNC(cps_state::cps1_cps_b_r),this), write16_delegate(FUNC(cps_state::cps1_cps_b_w),this)); | |
10718 | machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_readwrite(0x800140, 0x80017f); | |
10719 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x8001c0, 0x8001ff, read16_delegate(FUNC(cps_state::cps1_cps_b_r),this), write16_delegate(FUNC(cps_state::cps1_cps_b_w),this)); | |
10720 | 10720 | |
10721 | 10721 | DRIVER_INIT_CALL(cps1); |
10722 | 10722 | } |
r18027 | r18028 | |
10724 | 10724 | DRIVER_INIT_MEMBER(cps_state,sf2thndr) |
10725 | 10725 | { |
10726 | 10726 | /* This particular hack uses a modified B-board PAL which mirrors the CPS-B registers at an alternate address */ |
10727 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
10727 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x8001c0, 0x8001ff, read16_delegate(FUNC(cps_state::cps1_cps_b_r),this), write16_delegate(FUNC(cps_state::cps1_cps_b_w),this)); | |
10728 | 10728 | |
10729 | 10729 | DRIVER_INIT_CALL(cps1); |
10730 | 10730 | } |
r18027 | r18028 | |
10732 | 10732 | DRIVER_INIT_MEMBER(cps_state,sf2hack) |
10733 | 10733 | { |
10734 | 10734 | /* some SF2 hacks have some inputs wired to the LSB instead of MSB */ |
10735 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
10735 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x800018, 0x80001f, read16_delegate(FUNC(cps_state::cps1_hack_dsw_r),this)); | |
10736 | 10736 | |
10737 | 10737 | DRIVER_INIT_CALL(cps1); |
10738 | 10738 | } |
r18027 | r18028 | |
10765 | 10765 | { |
10766 | 10766 | /* Pang 3 is the only non-QSound game to have an EEPROM. */ |
10767 | 10767 | /* It is mapped in the CPS-B address range so probably is on the C-board. */ |
10768 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
10768 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_port(0x80017a, 0x80017b, "EEPROMIN", "EEPROMOUT"); | |
10769 | 10769 | |
10770 | 10770 | DRIVER_INIT_CALL(cps1); |
10771 | 10771 | } |
r18027 | r18028 | |
10815 | 10815 | rom[i + 3] = rom[i + 6]; |
10816 | 10816 | rom[i + 6] = tmp; |
10817 | 10817 | } |
10818 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x70c01a, 0x70c01b, read16_delegate(FUNC(cps_state::sf2mdt_r),this)); | |
10819 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x70c01c, 0x70c01d, read16_delegate(FUNC(cps_state::sf2mdt_r),this)); | |
10820 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x70c01e, 0x70c01f, read16_delegate(FUNC(cps_state::sf2mdt_r),this)); | |
10821 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x70c010, 0x70c011, read16_delegate(FUNC(cps_state::sf2mdt_r),this)); | |
10822 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x70c018, 0x70c019, read16_delegate(FUNC(cps_state::sf2mdt_r),this)); | |
10818 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x70c01a, 0x70c01b, read16_delegate(FUNC(cps_state::sf2mdt_r),this)); | |
10819 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x70c01c, 0x70c01d, read16_delegate(FUNC(cps_state::sf2mdt_r),this)); | |
10820 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x70c01e, 0x70c01f, read16_delegate(FUNC(cps_state::sf2mdt_r),this)); | |
10821 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x70c010, 0x70c011, read16_delegate(FUNC(cps_state::sf2mdt_r),this)); | |
10822 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x70c018, 0x70c019, read16_delegate(FUNC(cps_state::sf2mdt_r),this)); | |
10823 | 10823 | |
10824 | 10824 | DRIVER_INIT_CALL(cps1); |
10825 | 10825 | } |
r18027 | r18028 | |
10827 | 10827 | DRIVER_INIT_MEMBER(cps_state,dinohunt) |
10828 | 10828 | { |
10829 | 10829 | // is this shared with the new sound hw? |
10830 | UINT8* ram = (UINT8*)machine().device("maincpu")->memory().space(AS_PROGRAM) | |
10830 | UINT8* ram = (UINT8*)machine().device("maincpu")->memory().space(AS_PROGRAM).install_ram(0xf18000, 0xf19fff); | |
10831 | 10831 | memset(ram,0xff,0x2000); |
10832 | 10832 | DRIVER_INIT_CALL(cps1); |
10833 | 10833 | } |
r18027 | r18028 | |
---|---|---|
156 | 156 | DRIVER_INIT_MEMBER(yunsun16_state,magicbub) |
157 | 157 | { |
158 | 158 | // remove_mem_write16_handler (0, 0x800180, 0x800181 ); |
159 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
159 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x800188, 0x800189, write16_delegate(FUNC(yunsun16_state::magicbub_sound_command_w),this)); | |
160 | 160 | } |
161 | 161 | |
162 | 162 | /*************************************************************************** |
r18027 | r18028 | |
---|---|---|
1057 | 1057 | { 5,3,7, 0x80 }, |
1058 | 1058 | { 5,7,3, 0x28 } |
1059 | 1059 | }; |
1060 | address_space &space = | |
1060 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1061 | 1061 | UINT8 *rom = machine().root_device().memregion("maincpu")->base(); |
1062 | 1062 | int size = machine().root_device().memregion("maincpu")->bytes(); |
1063 | 1063 | UINT8 *decrypt = auto_alloc_array(machine(), UINT8, size); |
r18027 | r18028 | |
1094 | 1094 | |
1095 | 1095 | DRIVER_INIT_MEMBER(wiz_state,scion) |
1096 | 1096 | { |
1097 | machine().device("audiocpu")->memory().space(AS_PROGRAM) | |
1097 | machine().device("audiocpu")->memory().space(AS_PROGRAM).nop_write(0x4000, 0x4001); | |
1098 | 1098 | } |
1099 | 1099 | |
1100 | 1100 | |
1101 | 1101 | DRIVER_INIT_MEMBER(wiz_state,wiz) |
1102 | 1102 | { |
1103 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1103 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xd400, 0xd400, read8_delegate(FUNC(wiz_state::wiz_protection_r),this)); | |
1104 | 1104 | } |
1105 | 1105 | |
1106 | 1106 |
r18027 | r18028 | |
---|---|---|
554 | 554 | |
555 | 555 | DRIVER_INIT_MEMBER(calorie_state,calorieb) |
556 | 556 | { |
557 | address_space &space = | |
557 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
558 | 558 | space.set_decrypted_region(0x0000, 0x7fff, machine().root_device().memregion("maincpu")->base() + 0x10000); |
559 | 559 | } |
560 | 560 |
r18027 | r18028 | |
---|---|---|
879 | 879 | if (C76_SPEEDUP) |
880 | 880 | { |
881 | 881 | state->save_item( NAME(state->m_su_83) ); |
882 | machine.device("c76")->memory().space(AS_PROGRAM) | |
882 | machine.device("c76")->memory().space(AS_PROGRAM).install_readwrite_handler(0x82, 0x83, read16_delegate(FUNC(namcos11_state::c76_speedup_r),state), write16_delegate(FUNC(namcos11_state::c76_speedup_w),state)); | |
883 | 883 | } |
884 | 884 | |
885 | 885 | if (!n_daughterboard) |
886 | 886 | { |
887 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
887 | machine.device("maincpu")->memory().space(AS_PROGRAM).nop_write(0x1fa10020, 0x1fa1002f); | |
888 | 888 | return; |
889 | 889 | } |
890 | 890 | |
r18027 | r18028 | |
893 | 893 | UINT32 len = machine.root_device().memregion( "user2" )->bytes(); |
894 | 894 | UINT8 *rgn = machine.root_device().memregion( "user2" )->base(); |
895 | 895 | |
896 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f000000, 0x1f0fffff, "bank1" ); | |
897 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f100000, 0x1f1fffff, "bank2" ); | |
898 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f200000, 0x1f2fffff, "bank3" ); | |
899 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f300000, 0x1f3fffff, "bank4" ); | |
900 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f400000, 0x1f4fffff, "bank5" ); | |
901 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f500000, 0x1f5fffff, "bank6" ); | |
902 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f600000, 0x1f6fffff, "bank7" ); | |
903 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f700000, 0x1f7fffff, "bank8" ); | |
896 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x1f000000, 0x1f0fffff, "bank1" ); | |
897 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x1f100000, 0x1f1fffff, "bank2" ); | |
898 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x1f200000, 0x1f2fffff, "bank3" ); | |
899 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x1f300000, 0x1f3fffff, "bank4" ); | |
900 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x1f400000, 0x1f4fffff, "bank5" ); | |
901 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x1f500000, 0x1f5fffff, "bank6" ); | |
902 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x1f600000, 0x1f6fffff, "bank7" ); | |
903 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x1f700000, 0x1f7fffff, "bank8" ); | |
904 | 904 | |
905 | 905 | for (bank = 0; bank < 8; bank++) |
906 | 906 | { |
r18027 | r18028 | |
910 | 910 | |
911 | 911 | if (n_daughterboard == 32) |
912 | 912 | { |
913 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
913 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x1fa10020, 0x1fa1002f, write32_delegate(FUNC(namcos11_state::bankswitch_rom32_w),state)); | |
914 | 914 | } |
915 | 915 | if (n_daughterboard == 64) |
916 | 916 | { |
917 | 917 | state->m_n_bankoffset = 0; |
918 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x1f080000, 0x1f080003, write32_delegate(FUNC(namcos11_state::bankswitch_rom64_upper_w),state)); | |
919 | machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0x1fa10020, 0x1fa1002f); | |
920 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x1fa10020, 0x1fa1002f, write32_delegate(FUNC(namcos11_state::bankswitch_rom64_w),state)); | |
918 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x1f080000, 0x1f080003, write32_delegate(FUNC(namcos11_state::bankswitch_rom64_upper_w),state)); | |
919 | machine.device("maincpu")->memory().space(AS_PROGRAM).nop_read(0x1fa10020, 0x1fa1002f); | |
920 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x1fa10020, 0x1fa1002f, write32_delegate(FUNC(namcos11_state::bankswitch_rom64_w),state)); | |
921 | 921 | state->save_item( NAME(state->m_n_bankoffset) ); |
922 | 922 | } |
923 | 923 | } |
r18027 | r18028 | |
929 | 929 | |
930 | 930 | DRIVER_INIT_MEMBER(namcos11_state,tekken2) |
931 | 931 | { |
932 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
932 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler( 0x1fa20000, 0x1fa2ffff, read32_delegate(FUNC(namcos11_state::keycus_c406_r),this)); | |
933 | 933 | namcos11_init_common(machine(), 32); |
934 | 934 | } |
935 | 935 | |
936 | 936 | DRIVER_INIT_MEMBER(namcos11_state,souledge) |
937 | 937 | { |
938 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
938 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler( 0x1fa20000, 0x1fa2ffff, read32_delegate(FUNC(namcos11_state::keycus_c409_r),this)); | |
939 | 939 | namcos11_init_common(machine(), 32); |
940 | 940 | } |
941 | 941 | |
942 | 942 | DRIVER_INIT_MEMBER(namcos11_state,dunkmnia) |
943 | 943 | { |
944 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
944 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler( 0x1fa20000, 0x1fa2ffff, read32_delegate(FUNC(namcos11_state::keycus_c410_r),this)); | |
945 | 945 | namcos11_init_common(machine(), 32); |
946 | 946 | } |
947 | 947 | |
948 | 948 | DRIVER_INIT_MEMBER(namcos11_state,primglex) |
949 | 949 | { |
950 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
950 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler( 0x1fa20000, 0x1fa2ffff, read32_delegate(FUNC(namcos11_state::keycus_c411_r),this)); | |
951 | 951 | namcos11_init_common(machine(), 32); |
952 | 952 | } |
953 | 953 | |
954 | 954 | DRIVER_INIT_MEMBER(namcos11_state,xevi3dg) |
955 | 955 | { |
956 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
956 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler( 0x1fa20000, 0x1fa2ffff, read32_delegate(FUNC(namcos11_state::keycus_c430_r),this)); | |
957 | 957 | namcos11_init_common(machine(), 32); |
958 | 958 | } |
959 | 959 | |
960 | 960 | DRIVER_INIT_MEMBER(namcos11_state,danceyes) |
961 | 961 | { |
962 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
962 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler( 0x1fa20000, 0x1fa2ffff, read32_delegate(FUNC(namcos11_state::keycus_c431_r),this)); | |
963 | 963 | namcos11_init_common(machine(), 32); |
964 | 964 | } |
965 | 965 | |
966 | 966 | DRIVER_INIT_MEMBER(namcos11_state,pocketrc) |
967 | 967 | { |
968 | machine().device("c76")->memory().space(AS_IO)->install_read_handler(M37710_ADC0_L, M37710_ADC0_L, read8_delegate(FUNC(namcos11_state::pocketrc_steer_r),this)); | |
969 | machine().device("c76")->memory().space(AS_IO)->install_read_handler(M37710_ADC1_L, M37710_ADC1_L, read8_delegate(FUNC(namcos11_state::pocketrc_gas_r),this)); | |
968 | machine().device("c76")->memory().space(AS_IO).install_read_handler(M37710_ADC0_L, M37710_ADC0_L, read8_delegate(FUNC(namcos11_state::pocketrc_steer_r),this)); | |
969 | machine().device("c76")->memory().space(AS_IO).install_read_handler(M37710_ADC1_L, M37710_ADC1_L, read8_delegate(FUNC(namcos11_state::pocketrc_gas_r),this)); | |
970 | 970 | |
971 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
971 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler( 0x1fa20000, 0x1fa2ffff, read32_delegate(FUNC(namcos11_state::keycus_c432_r),this)); | |
972 | 972 | namcos11_init_common(machine(), 32); |
973 | 973 | } |
974 | 974 | |
975 | 975 | DRIVER_INIT_MEMBER(namcos11_state,starswep) |
976 | 976 | { |
977 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
977 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler( 0x1fa20000, 0x1fa2ffff, read32_delegate(FUNC(namcos11_state::keycus_c442_r),this)); | |
978 | 978 | namcos11_init_common(machine(), 0); |
979 | 979 | } |
980 | 980 | |
981 | 981 | DRIVER_INIT_MEMBER(namcos11_state,myangel3) |
982 | 982 | { |
983 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
983 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler( 0x1fa20000, 0x1fa2ffff, read32_delegate(FUNC(namcos11_state::keycus_c443_r),this)); | |
984 | 984 | namcos11_init_common(machine(), 64); |
985 | 985 | } |
986 | 986 | |
987 | 987 | DRIVER_INIT_MEMBER(namcos11_state,ptblank2ua) |
988 | 988 | { |
989 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
989 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler( 0x1fa20000, 0x1fa2ffff, read32_delegate(FUNC(namcos11_state::keycus_c443_r),this)); | |
990 | 990 | namcos11_init_common(machine(), 64); |
991 | 991 | |
992 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x1f788000, 0x1f788003, write32_delegate(FUNC(namcos11_state::lightgun_w),this)); | |
993 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler (0x1f780000, 0x1f78000f, read32_delegate(FUNC(namcos11_state::lightgun_r),this)); | |
992 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x1f788000, 0x1f788003, write32_delegate(FUNC(namcos11_state::lightgun_w),this)); | |
993 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler (0x1f780000, 0x1f78000f, read32_delegate(FUNC(namcos11_state::lightgun_r),this)); | |
994 | 994 | } |
995 | 995 | |
996 | 996 | MACHINE_RESET_MEMBER(namcos11_state,namcos11) |
r18027 | r18028 | |
---|---|---|
895 | 895 | |
896 | 896 | DRIVER_INIT_MEMBER(lethalj_state,ripribit) |
897 | 897 | { |
898 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
898 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x04100010, 0x0410001f, write16_delegate(FUNC(lethalj_state::ripribit_control_w),this)); | |
899 | 899 | } |
900 | 900 | |
901 | 901 | |
902 | 902 | DRIVER_INIT_MEMBER(lethalj_state,cfarm) |
903 | 903 | { |
904 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
904 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x04100010, 0x0410001f, write16_delegate(FUNC(lethalj_state::cfarm_control_w),this)); | |
905 | 905 | } |
906 | 906 | |
907 | 907 | |
908 | 908 | DRIVER_INIT_MEMBER(lethalj_state,cclownz) |
909 | 909 | { |
910 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
910 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x04100010, 0x0410001f, write16_delegate(FUNC(lethalj_state::cclownz_control_w),this)); | |
911 | 911 | } |
912 | 912 | |
913 | 913 |
r18027 | r18028 | |
---|---|---|
767 | 767 | /* bit 6 controls the diagnostic sound LED */ |
768 | 768 | /* bit 7 controls the ticket dispenser */ |
769 | 769 | m_pia_portb_data = data; |
770 | machine().device<ticket_dispenser_device>("ticket")->write( | |
770 | machine().device<ticket_dispenser_device>("ticket")->write(machine().driver_data()->generic_space(), 0, data & 0x80); | |
771 | 771 | coin_counter_w(machine(), 0, (data & 0x20) >> 5); |
772 | 772 | } |
773 | 773 | |
r18027 | r18028 | |
2630 | 2630 | |
2631 | 2631 | DRIVER_INIT_MEMBER(itech8_state,grmatch) |
2632 | 2632 | { |
2633 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x0160, 0x0160, write8_delegate(FUNC(itech8_state::grmatch_palette_w),this)); | |
2634 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x0180, 0x0180, write8_delegate(FUNC(itech8_state::grmatch_xscroll_w),this)); | |
2635 | machine().device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x01e0, 0x01ff); | |
2633 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x0160, 0x0160, write8_delegate(FUNC(itech8_state::grmatch_palette_w),this)); | |
2634 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x0180, 0x0180, write8_delegate(FUNC(itech8_state::grmatch_xscroll_w),this)); | |
2635 | machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x01e0, 0x01ff); | |
2636 | 2636 | } |
2637 | 2637 | |
2638 | 2638 | |
2639 | 2639 | DRIVER_INIT_MEMBER(itech8_state,slikshot) |
2640 | 2640 | { |
2641 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x0180, 0x0180, FUNC(slikshot_z80_r)); | |
2642 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x01cf, 0x01cf, FUNC(slikshot_z80_control_r)); | |
2643 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01cf, 0x01cf, FUNC(slikshot_z80_control_w)); | |
2641 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler (0x0180, 0x0180, FUNC(slikshot_z80_r)); | |
2642 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler (0x01cf, 0x01cf, FUNC(slikshot_z80_control_r)); | |
2643 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x01cf, 0x01cf, FUNC(slikshot_z80_control_w)); | |
2644 | 2644 | } |
2645 | 2645 | |
2646 | 2646 | |
2647 | 2647 | DRIVER_INIT_MEMBER(itech8_state,sstrike) |
2648 | 2648 | { |
2649 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x1180, 0x1180, FUNC(slikshot_z80_r)); | |
2650 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x11cf, 0x11cf, FUNC(slikshot_z80_control_r)); | |
2651 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x11cf, 0x11cf, FUNC(slikshot_z80_control_w)); | |
2649 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler (0x1180, 0x1180, FUNC(slikshot_z80_r)); | |
2650 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler (0x11cf, 0x11cf, FUNC(slikshot_z80_control_r)); | |
2651 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x11cf, 0x11cf, FUNC(slikshot_z80_control_w)); | |
2652 | 2652 | } |
2653 | 2653 | |
2654 | 2654 | |
r18027 | r18028 | |
2679 | 2679 | DRIVER_INIT_MEMBER(itech8_state,rimrockn) |
2680 | 2680 | { |
2681 | 2681 | /* additional input ports */ |
2682 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0161, 0x0161, "161"); | |
2683 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0162, 0x0162, "162"); | |
2684 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0163, 0x0163, "163"); | |
2685 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0164, 0x0164, "164"); | |
2686 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0165, 0x0165, "165"); | |
2682 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port (0x0161, 0x0161, "161"); | |
2683 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port (0x0162, 0x0162, "162"); | |
2684 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port (0x0163, 0x0163, "163"); | |
2685 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port (0x0164, 0x0164, "164"); | |
2686 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port (0x0165, 0x0165, "165"); | |
2687 | 2687 | |
2688 | 2688 | /* different banking mechanism (disable the old one) */ |
2689 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x01a0, 0x01a0, write8_delegate(FUNC(itech8_state::rimrockn_bank_w),this)); | |
2690 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x01c0, 0x01df, write8_delegate(FUNC(itech8_state::itech8_blitter_w),this)); | |
2689 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x01a0, 0x01a0, write8_delegate(FUNC(itech8_state::rimrockn_bank_w),this)); | |
2690 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x01c0, 0x01df, write8_delegate(FUNC(itech8_state::itech8_blitter_w),this)); | |
2691 | 2691 | } |
2692 | 2692 | |
2693 | 2693 |
r18027 | r18028 | |
---|---|---|
755 | 755 | READ8_MEMBER(galaxian_state::explorer_sound_latch_r) |
756 | 756 | { |
757 | 757 | machine().device("audiocpu")->execute().set_input_line(0, CLEAR_LINE); |
758 | return soundlatch_byte_r( | |
758 | return soundlatch_byte_r(machine().device("audiocpu")->memory().space(AS_PROGRAM), 0); | |
759 | 759 | } |
760 | 760 | |
761 | 761 | |
r18027 | r18028 | |
1064 | 1064 | |
1065 | 1065 | INPUT_CHANGED_MEMBER(galaxian_state::gmgalax_game_changed) |
1066 | 1066 | { |
1067 | address_space &space = | |
1067 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1068 | 1068 | |
1069 | 1069 | /* new value is the selected game */ |
1070 | 1070 | m_gmgalax_selected_game = newval; |
r18027 | r18028 | |
2740 | 2740 | |
2741 | 2741 | static void unmap_galaxian_sound(running_machine &machine, offs_t base) |
2742 | 2742 | { |
2743 | address_space &space = | |
2743 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
2744 | 2744 | |
2745 | 2745 | space.unmap_write(base + 0x0004, base + 0x0007, 0, 0x07f8); |
2746 | 2746 | space.unmap_write(base + 0x0800, base + 0x0807, 0, 0x07f8); |
r18027 | r18028 | |
2763 | 2763 | |
2764 | 2764 | DRIVER_INIT_MEMBER(galaxian_state,nolock) |
2765 | 2765 | { |
2766 | address_space &space = | |
2766 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2767 | 2767 | |
2768 | 2768 | /* same as galaxian... */ |
2769 | 2769 | DRIVER_INIT_CALL(galaxian); |
r18027 | r18028 | |
2775 | 2775 | |
2776 | 2776 | DRIVER_INIT_MEMBER(galaxian_state,azurian) |
2777 | 2777 | { |
2778 | address_space &space = | |
2778 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2779 | 2779 | |
2780 | 2780 | /* yellow bullets instead of white ones */ |
2781 | 2781 | common_init(machine(), scramble_draw_bullet, galaxian_draw_background, NULL, NULL); |
r18027 | r18028 | |
2787 | 2787 | |
2788 | 2788 | DRIVER_INIT_MEMBER(galaxian_state,gmgalax) |
2789 | 2789 | { |
2790 | address_space &space = | |
2790 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2791 | 2791 | |
2792 | 2792 | /* video extensions */ |
2793 | 2793 | common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, gmgalax_extend_tile_info, gmgalax_extend_sprite_info); |
r18027 | r18028 | |
2804 | 2804 | |
2805 | 2805 | DRIVER_INIT_MEMBER(galaxian_state,pisces) |
2806 | 2806 | { |
2807 | address_space &space = | |
2807 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2808 | 2808 | |
2809 | 2809 | /* video extensions */ |
2810 | 2810 | common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, pisces_extend_tile_info, pisces_extend_sprite_info); |
r18027 | r18028 | |
2816 | 2816 | |
2817 | 2817 | DRIVER_INIT_MEMBER(galaxian_state,batman2) |
2818 | 2818 | { |
2819 | address_space &space = | |
2819 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2820 | 2820 | |
2821 | 2821 | /* video extensions */ |
2822 | 2822 | common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, batman2_extend_tile_info, upper_extend_sprite_info); |
r18027 | r18028 | |
2828 | 2828 | |
2829 | 2829 | DRIVER_INIT_MEMBER(galaxian_state,frogg) |
2830 | 2830 | { |
2831 | address_space &space = | |
2831 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2832 | 2832 | |
2833 | 2833 | /* same as galaxian... */ |
2834 | 2834 | common_init(machine(), galaxian_draw_bullet, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info); |
r18027 | r18028 | |
2864 | 2864 | |
2865 | 2865 | DRIVER_INIT_MEMBER(galaxian_state,mooncrgx) |
2866 | 2866 | { |
2867 | address_space &space = | |
2867 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2868 | 2868 | |
2869 | 2869 | /* video extensions */ |
2870 | 2870 | common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info); |
r18027 | r18028 | |
2876 | 2876 | |
2877 | 2877 | DRIVER_INIT_MEMBER(galaxian_state,moonqsr) |
2878 | 2878 | { |
2879 | address_space &space = | |
2879 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2880 | 2880 | UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0x8000); |
2881 | 2881 | |
2882 | 2882 | /* video extensions */ |
r18027 | r18028 | |
2894 | 2894 | |
2895 | 2895 | DRIVER_INIT_MEMBER(galaxian_state,pacmanbl) |
2896 | 2896 | { |
2897 | address_space &space = | |
2897 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2898 | 2898 | |
2899 | 2899 | /* same as galaxian... */ |
2900 | 2900 | DRIVER_INIT_CALL(galaxian); |
r18027 | r18028 | |
2954 | 2954 | |
2955 | 2955 | DRIVER_INIT_MEMBER(galaxian_state,tenspot) |
2956 | 2956 | { |
2957 | address_space &space = | |
2957 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2958 | 2958 | |
2959 | 2959 | /* these are needed for batman part 2 to work properly, this banking is probably a property of the artic board, |
2960 | 2960 | which tenspot appears to have copied */ |
r18027 | r18028 | |
2991 | 2991 | |
2992 | 2992 | DRIVER_INIT_MEMBER(galaxian_state,zigzag) |
2993 | 2993 | { |
2994 | address_space &space = | |
2994 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2995 | 2995 | |
2996 | 2996 | /* video extensions */ |
2997 | 2997 | common_init(machine(), NULL, galaxian_draw_background, NULL, NULL); |
r18027 | r18028 | |
3035 | 3035 | |
3036 | 3036 | DRIVER_INIT_MEMBER(galaxian_state,checkman) |
3037 | 3037 | { |
3038 | address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM); | |
3039 | address_space *iospace = machine().device("maincpu")->memory().space(AS_IO); | |
3038 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
3039 | address_space &iospace = machine().device("maincpu")->memory().space(AS_IO); | |
3040 | 3040 | |
3041 | 3041 | /* video extensions */ |
3042 | 3042 | common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info); |
r18027 | r18028 | |
3046 | 3046 | space.install_write_handler(0xb001, 0xb001, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::irq_enable_w),this)); |
3047 | 3047 | |
3048 | 3048 | /* attach the sound command handler */ |
3049 | iospace | |
3049 | iospace.install_write_handler(0x00, 0x00, 0, 0xffff, write8_delegate(FUNC(galaxian_state::checkman_sound_command_w),this)); | |
3050 | 3050 | |
3051 | 3051 | /* decrypt program code */ |
3052 | 3052 | decode_checkman(machine()); |
r18027 | r18028 | |
3055 | 3055 | |
3056 | 3056 | DRIVER_INIT_MEMBER(galaxian_state,checkmaj) |
3057 | 3057 | { |
3058 | address_space &space = | |
3058 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
3059 | 3059 | |
3060 | 3060 | /* video extensions */ |
3061 | 3061 | common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, NULL, NULL); |
r18027 | r18028 | |
3070 | 3070 | |
3071 | 3071 | DRIVER_INIT_MEMBER(galaxian_state,dingo) |
3072 | 3072 | { |
3073 | address_space &space = | |
3073 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
3074 | 3074 | |
3075 | 3075 | /* video extensions */ |
3076 | 3076 | common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, NULL, NULL); |
r18027 | r18028 | |
3085 | 3085 | |
3086 | 3086 | DRIVER_INIT_MEMBER(galaxian_state,dingoe) |
3087 | 3087 | { |
3088 | address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM); | |
3089 | address_space *iospace = machine().device("maincpu")->memory().space(AS_IO); | |
3088 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
3089 | address_space &iospace = machine().device("maincpu")->memory().space(AS_IO); | |
3090 | 3090 | |
3091 | 3091 | /* video extensions */ |
3092 | 3092 | common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info); |
r18027 | r18028 | |
3096 | 3096 | space.install_write_handler(0xb001, 0xb001, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::irq_enable_w),this)); |
3097 | 3097 | |
3098 | 3098 | /* attach the sound command handler */ |
3099 | iospace | |
3099 | iospace.install_write_handler(0x00, 0x00, 0, 0xffff, write8_delegate(FUNC(galaxian_state::checkman_sound_command_w),this)); | |
3100 | 3100 | |
3101 | 3101 | space.install_read_handler(0x3001, 0x3001, read8_delegate(FUNC(galaxian_state::dingoe_3001_r),this)); /* Protection check */ |
3102 | 3102 | |
r18027 | r18028 | |
3107 | 3107 | |
3108 | 3108 | DRIVER_INIT_MEMBER(galaxian_state,skybase) |
3109 | 3109 | { |
3110 | address_space &space = | |
3110 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
3111 | 3111 | |
3112 | 3112 | /* video extensions */ |
3113 | 3113 | common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, pisces_extend_tile_info, pisces_extend_sprite_info); |
r18027 | r18028 | |
3125 | 3125 | |
3126 | 3126 | DRIVER_INIT_MEMBER(galaxian_state,kong) |
3127 | 3127 | { |
3128 | address_space &space = | |
3128 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
3129 | 3129 | |
3130 | 3130 | /* video extensions */ |
3131 | 3131 | common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, NULL, upper_extend_sprite_info); |
r18027 | r18028 | |
3140 | 3140 | |
3141 | 3141 | static void mshuttle_decode(running_machine &machine, const UINT8 convtable[8][16]) |
3142 | 3142 | { |
3143 | address_space &space = | |
3143 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
3144 | 3144 | UINT8 *rom = machine.root_device().memregion("maincpu")->base(); |
3145 | 3145 | UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x10000); |
3146 | 3146 | int A; |
r18027 | r18028 | |
3252 | 3252 | |
3253 | 3253 | DRIVER_INIT_MEMBER(galaxian_state,kingball) |
3254 | 3254 | { |
3255 | address_space &space = | |
3255 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
3256 | 3256 | |
3257 | 3257 | /* video extensions */ |
3258 | 3258 | common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, NULL, NULL); |
r18027 | r18028 | |
3272 | 3272 | |
3273 | 3273 | DRIVER_INIT_MEMBER(galaxian_state,scorpnmc) |
3274 | 3274 | { |
3275 | address_space &space = | |
3275 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
3276 | 3276 | |
3277 | 3277 | /* video extensions */ |
3278 | 3278 | common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, batman2_extend_tile_info, upper_extend_sprite_info); |
r18027 | r18028 | |
3293 | 3293 | |
3294 | 3294 | DRIVER_INIT_MEMBER(galaxian_state,thepitm) |
3295 | 3295 | { |
3296 | address_space &space = | |
3296 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
3297 | 3297 | |
3298 | 3298 | /* video extensions */ |
3299 | 3299 | common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info); |
r18027 | r18028 | |
3317 | 3317 | |
3318 | 3318 | DRIVER_INIT_MEMBER(galaxian_state,theend) |
3319 | 3319 | { |
3320 | address_space &space = | |
3320 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
3321 | 3321 | |
3322 | 3322 | /* video extensions */ |
3323 | 3323 | common_init(machine(), theend_draw_bullet, galaxian_draw_background, NULL, NULL); |
r18027 | r18028 | |
3336 | 3336 | |
3337 | 3337 | DRIVER_INIT_MEMBER(galaxian_state,explorer) |
3338 | 3338 | { |
3339 | address_space &space = | |
3339 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
3340 | 3340 | |
3341 | 3341 | /* video extensions */ |
3342 | 3342 | common_init(machine(), scramble_draw_bullet, scramble_draw_background, NULL, NULL); |
r18027 | r18028 | |
3362 | 3362 | m_sfx_tilemap = TRUE; |
3363 | 3363 | |
3364 | 3364 | /* sound board has space for extra ROM */ |
3365 | machine().device("audiocpu")->memory().space(AS_PROGRAM) | |
3365 | machine().device("audiocpu")->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x3fff, "bank1"); | |
3366 | 3366 | membank("bank1")->set_base(memregion("audiocpu")->base()); |
3367 | 3367 | } |
3368 | 3368 | |
3369 | 3369 | |
3370 | 3370 | DRIVER_INIT_MEMBER(galaxian_state,atlantis) |
3371 | 3371 | { |
3372 | address_space &space = | |
3372 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
3373 | 3373 | |
3374 | 3374 | /* video extensions */ |
3375 | 3375 | common_init(machine(), scramble_draw_bullet, scramble_draw_background, NULL, NULL); |
r18027 | r18028 | |
3411 | 3411 | |
3412 | 3412 | DRIVER_INIT_MEMBER(galaxian_state,froggrmc) |
3413 | 3413 | { |
3414 | address_space &space = | |
3414 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
3415 | 3415 | |
3416 | 3416 | /* video extensions */ |
3417 | 3417 | common_init(machine(), NULL, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info); |
r18027 | r18028 | |
3456 | 3456 | |
3457 | 3457 | DRIVER_INIT_MEMBER(galaxian_state,scorpion) |
3458 | 3458 | { |
3459 | address_space &space = | |
3459 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
3460 | 3460 | |
3461 | 3461 | common_init(machine(), scramble_draw_bullet, scramble_draw_background, batman2_extend_tile_info, upper_extend_sprite_info); |
3462 | 3462 | |
3463 | 3463 | /* hook up AY8910 */ |
3464 | machine().device("audiocpu")->memory().space(AS_IO) | |
3464 | machine().device("audiocpu")->memory().space(AS_IO).install_readwrite_handler(0x00, 0xff, read8_delegate(FUNC(galaxian_state::scorpion_ay8910_r),this), write8_delegate(FUNC(galaxian_state::scorpion_ay8910_w),this)); | |
3465 | 3465 | |
3466 | 3466 | /* extra ROM */ |
3467 | 3467 | space.install_read_bank(0x5800, 0x67ff, "bank1"); |
r18027 | r18028 | |
3470 | 3470 | /* no background related */ |
3471 | 3471 | // space.nop_write(0x6803, 0x6803); |
3472 | 3472 | |
3473 | machine().device("audiocpu")->memory().space(AS_PROGRAM) | |
3473 | machine().device("audiocpu")->memory().space(AS_PROGRAM).install_read_handler(0x3000, 0x3000, read8_delegate(FUNC(galaxian_state::scorpion_digitalker_intr_r),this)); | |
3474 | 3474 | /* |
3475 | 3475 | { |
3476 | 3476 | const UINT8 *rom = memregion("speech")->base(); |
r18027 | r18028 | |
---|---|---|
803 | 803 | m_int_num = 0x02; |
804 | 804 | |
805 | 805 | /* cpu synchronization (severe timings) */ |
806 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xc0040e, 0xc00411, write16_delegate(FUNC(hyprduel_state::hyprduel_cpusync_trigger1_w),this)); | |
807 | machine().device("sub")->memory().space(AS_PROGRAM)->install_read_handler(0xc00408, 0xc00409, read16_delegate(FUNC(hyprduel_state::hyprduel_cpusync_trigger1_r),this)); | |
808 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xc00408, 0xc00409, write16_delegate(FUNC(hyprduel_state::hyprduel_cpusync_trigger2_w),this)); | |
809 | machine().device("sub")->memory().space(AS_PROGRAM)->install_read_handler(0xfff34c, 0xfff34d, read16_delegate(FUNC(hyprduel_state::hyprduel_cpusync_trigger2_r),this)); | |
806 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xc0040e, 0xc00411, write16_delegate(FUNC(hyprduel_state::hyprduel_cpusync_trigger1_w),this)); | |
807 | machine().device("sub")->memory().space(AS_PROGRAM).install_read_handler(0xc00408, 0xc00409, read16_delegate(FUNC(hyprduel_state::hyprduel_cpusync_trigger1_r),this)); | |
808 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xc00408, 0xc00409, write16_delegate(FUNC(hyprduel_state::hyprduel_cpusync_trigger2_w),this)); | |
809 | machine().device("sub")->memory().space(AS_PROGRAM).install_read_handler(0xfff34c, 0xfff34d, read16_delegate(FUNC(hyprduel_state::hyprduel_cpusync_trigger2_r),this)); | |
810 | 810 | } |
811 | 811 | |
812 | 812 | DRIVER_INIT_MEMBER(hyprduel_state,magerror) |
r18027 | r18028 | |
---|---|---|
119 | 119 | |
120 | 120 | CUSTOM_INPUT_MEMBER(flstory_state::victnine_mcu_status_bit01_r) |
121 | 121 | { |
122 | address_space &space = | |
122 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
123 | 123 | |
124 | 124 | return (victnine_mcu_status_r(space, 0) & 3); |
125 | 125 | } |
r18027 | r18028 | |
---|---|---|
584 | 584 | rom[BYTE4_XOR_BE(0x3aa933)] = 0; |
585 | 585 | |
586 | 586 | // protection related ? |
587 | // machine().device("maincpu")->memory().space(AS_PROGRAM) | |
587 | // machine().device("maincpu")->memory().space(AS_PROGRAM).nop_read(0xf0c8b440, 0xf0c8b447); | |
588 | 588 | |
589 | 589 | m_flash_roms = 2; |
590 | 590 | } |
r18027 | r18028 | |
604 | 604 | rom[BYTE4_XOR_BE(0x3a45c9)] = 0; |
605 | 605 | |
606 | 606 | // protection related ? |
607 | // machine().device("maincpu")->memory().space(AS_PROGRAM) | |
607 | // machine().device("maincpu")->memory().space(AS_PROGRAM).nop_read(0x12341234, 0x12341243); | |
608 | 608 | |
609 | 609 | m_flash_roms = 4; |
610 | 610 | } |
r18027 | r18028 | |
---|---|---|
80 | 80 | switch(slot_select) |
81 | 81 | { |
82 | 82 | case 0: |
83 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1"); | |
84 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0x0000, 0x3fff, "bank5"); | |
83 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x3fff, "bank1"); | |
84 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(0x0000, 0x3fff, "bank5"); | |
85 | 85 | state->membank("bank1")->set_base(state->m_ram); |
86 | 86 | state->membank("bank5")->set_base(state->m_ram); |
87 | 87 | break; |
88 | 88 | case 2: |
89 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1"); | |
90 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x0000, 0x3fff); | |
89 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x3fff, "bank1"); | |
90 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x0000, 0x3fff); | |
91 | 91 | state->membank("bank1")->set_base(state->memregion("user1")->base()+ 0x10000); |
92 | 92 | break; |
93 | 93 | case 1: |
94 | 94 | case 3: |
95 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0x0000, 0x3fff); | |
96 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x0000, 0x3fff); | |
95 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_read(0x0000, 0x3fff); | |
96 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x0000, 0x3fff); | |
97 | 97 | break; |
98 | 98 | } |
99 | 99 | |
r18027 | r18028 | |
102 | 102 | switch(slot_select) |
103 | 103 | { |
104 | 104 | case 0: |
105 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x7fff, "bank2"); | |
106 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0x4000, 0x7fff, "bank6"); | |
105 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x4000, 0x7fff, "bank2"); | |
106 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(0x4000, 0x7fff, "bank6"); | |
107 | 107 | state->membank("bank2")->set_base(state->m_ram + 0x4000); |
108 | 108 | state->membank("bank6")->set_base(state->m_ram + 0x4000); |
109 | 109 | break; |
110 | 110 | case 2: |
111 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x7fff, "bank2"); | |
112 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x4000, 0x7fff); | |
111 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x4000, 0x7fff, "bank2"); | |
112 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x4000, 0x7fff); | |
113 | 113 | state->membank("bank2")->set_base(machine.root_device().memregion("user1")->base()+ 0x18000); |
114 | 114 | break; |
115 | 115 | case 3: |
116 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x7fff, "bank2"); | |
117 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x4000, 0x7fff); | |
116 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x4000, 0x7fff, "bank2"); | |
117 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x4000, 0x7fff); | |
118 | 118 | state->membank("bank2")->set_base(machine.root_device().memregion("user1")->base()+ 0x20000 + (state->m_pzlestar_rom_bank*0x8000) + 0x4000); |
119 | 119 | break; |
120 | 120 | case 1: |
121 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0x4000, 0x7fff); | |
122 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x4000, 0x7fff); | |
121 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_read(0x4000, 0x7fff); | |
122 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x4000, 0x7fff); | |
123 | 123 | break; |
124 | 124 | } |
125 | 125 | |
r18027 | r18028 | |
128 | 128 | switch(slot_select) |
129 | 129 | { |
130 | 130 | case 0: |
131 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0xbfff, "bank3"); | |
132 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0x8000, 0xbfff, "bank7"); | |
131 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x8000, 0xbfff, "bank3"); | |
132 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(0x8000, 0xbfff, "bank7"); | |
133 | 133 | state->membank("bank3")->set_base(state->m_ram + 0x8000); |
134 | 134 | state->membank("bank7")->set_base(state->m_ram + 0x8000); |
135 | 135 | break; |
136 | 136 | case 3: |
137 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0xbfff, "bank3"); | |
138 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x8000, 0xbfff); | |
137 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x8000, 0xbfff, "bank3"); | |
138 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x8000, 0xbfff); | |
139 | 139 | state->membank("bank3")->set_base(machine.root_device().memregion("user1")->base()+ 0x20000 + (state->m_pzlestar_rom_bank*0x8000)); |
140 | 140 | break; |
141 | 141 | case 1: |
142 | 142 | case 2: |
143 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0x8000, 0xbfff); | |
144 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x8000, 0xbfff); | |
143 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_read(0x8000, 0xbfff); | |
144 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x8000, 0xbfff); | |
145 | 145 | break; |
146 | 146 | } |
147 | 147 | |
r18027 | r18028 | |
150 | 150 | switch(slot_select) |
151 | 151 | { |
152 | 152 | case 0: |
153 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xc000, 0xffff, "bank4"); | |
154 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0xc000, 0xffff, "bank8"); | |
153 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xc000, 0xffff, "bank4"); | |
154 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(0xc000, 0xffff, "bank8"); | |
155 | 155 | state->membank("bank4")->set_base(state->m_ram + 0xc000); |
156 | 156 | state->membank("bank8")->set_base(state->m_ram + 0xc000); |
157 | 157 | break; |
158 | 158 | case 1: |
159 | 159 | case 2: |
160 | 160 | case 3: |
161 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0xc000, 0xffff); | |
162 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0xc000, 0xffff); | |
161 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_read(0xc000, 0xffff); | |
162 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xc000, 0xffff); | |
163 | 163 | break; |
164 | 164 | } |
165 | 165 | |
r18027 | r18028 | |
201 | 201 | { |
202 | 202 | // ram |
203 | 203 | state->membank(read_bank_name)->set_base(&state->m_ram[(banknum & 0x7f) * 0x4000]); |
204 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
204 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(bank*0x4000, (bank+1)*0x4000 - 1, write_bank_name ); | |
205 | 205 | state->membank(write_bank_name)->set_base(&state->m_ram[(banknum & 0x7f) * 0x4000]); |
206 | 206 | } |
207 | 207 | else |
208 | 208 | { |
209 | 209 | // rom 0 |
210 | 210 | state->membank(read_bank_name)->set_base(machine.root_device().memregion("user1")->base()+0x4000*banknum); |
211 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
211 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(bank*0x4000, (bank+1)*0x4000 - 1); | |
212 | 212 | } |
213 | 213 | } |
214 | 214 | else if (banktype == 0x82) |
215 | 215 | { |
216 | 216 | state->membank(read_bank_name)->set_base(machine.root_device().memregion("user1")->base()+0x20000+banknum*0x4000); |
217 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
217 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(bank*0x4000, (bank+1)*0x4000 - 1); | |
218 | 218 | } |
219 | 219 | else if (banktype == 0x80) |
220 | 220 | { |
221 | 221 | state->membank(read_bank_name)->set_base(machine.root_device().memregion("user1")->base()+0x120000+banknum*0x4000); |
222 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
222 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(bank*0x4000, (bank+1)*0x4000 - 1); | |
223 | 223 | } |
224 | 224 | else |
225 | 225 | { |
r18027 | r18028 | |
---|---|---|
326 | 326 | /* I wish I had found a better way to handle cocktail inputs, but I can't find a way to access internal RAM */ |
327 | 327 | /* (bit 5 of 0xf0aa : 0 = player 1 and 1 = player 2 - bit 6 of 0xf0aa : 0 = upright and 1 = cocktail). */ |
328 | 328 | /* All I found is that in main RAM, 0xe00f.b determines the player : 0x00 = player 1 and 0x01 = player 2. */ |
329 | address_space | |
329 | address_space &ramspace = device.memory().space(AS_PROGRAM); | |
330 | 330 | UINT8 player = 0; |
331 | 331 | |
332 | if ((ramspace | |
332 | if ((ramspace.read_byte(0xe00f) == 0x01) && ((ioport("DSW1")->read() & 0x08) == 0x00)) | |
333 | 333 | player = 1; |
334 | 334 | |
335 | 335 | int current_power=ioport(inname[player])->read() & 0x3f; |
r18027 | r18028 | |
---|---|---|
510 | 510 | |
511 | 511 | void kyugo_state::machine_reset() |
512 | 512 | { |
513 | address_space &space = | |
513 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
514 | 514 | // must start with interrupts and sub CPU disabled |
515 | 515 | m_nmi_mask = 0; |
516 | 516 | kyugo_sub_cpu_control_w(space, 0, 0); |
r18027 | r18028 | |
1368 | 1368 | DRIVER_INIT_MEMBER(kyugo_state,gyrodine) |
1369 | 1369 | { |
1370 | 1370 | /* add watchdog */ |
1371 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1371 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xe000, 0xe000, write8_delegate(FUNC(kyugo_state::watchdog_reset_w),this)); | |
1372 | 1372 | } |
1373 | 1373 | |
1374 | 1374 | |
r18027 | r18028 | |
1376 | 1376 | { |
1377 | 1377 | |
1378 | 1378 | /* shared RAM is mapped at 0xe000 as well */ |
1379 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1379 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_ram(0xe000, 0xe7ff, m_shared_ram); | |
1380 | 1380 | |
1381 | 1381 | /* extra RAM on sub CPU */ |
1382 | machine().device("sub")->memory().space(AS_PROGRAM) | |
1382 | machine().device("sub")->memory().space(AS_PROGRAM).install_ram(0x8800, 0x8fff); | |
1383 | 1383 | } |
1384 | 1384 | |
1385 | 1385 |
r18027 | r18028 | |
---|---|---|
1982 | 1982 | { |
1983 | 1983 | leland_state *state = machine.driver_data<leland_state>(); |
1984 | 1984 | /* set up the master CPU VRAM I/O */ |
1985 | machine.device("master")->memory().space(AS_IO) | |
1985 | machine.device("master")->memory().space(AS_IO).install_readwrite_handler(mvram_base, mvram_base + 0x1f, read8_delegate(FUNC(leland_state::leland_mvram_port_r),state), write8_delegate(FUNC(leland_state::leland_mvram_port_w),state)); | |
1986 | 1986 | |
1987 | 1987 | /* set up the master CPU I/O ports */ |
1988 | machine.device("master")->memory().space(AS_IO)->install_read_handler(io_base, io_base + 0x1f, read8_delegate(FUNC(leland_state::leland_master_input_r),state)); | |
1989 | machine.device("master")->memory().space(AS_IO)->install_write_handler(io_base, io_base + 0x0f, write8_delegate(FUNC(leland_state::leland_master_output_w),state)); | |
1988 | machine.device("master")->memory().space(AS_IO).install_read_handler(io_base, io_base + 0x1f, read8_delegate(FUNC(leland_state::leland_master_input_r),state)); | |
1989 | machine.device("master")->memory().space(AS_IO).install_write_handler(io_base, io_base + 0x0f, write8_delegate(FUNC(leland_state::leland_master_output_w),state)); | |
1990 | 1990 | } |
1991 | 1991 | |
1992 | 1992 | |
r18027 | r18028 | |
2002 | 2002 | init_master_ports(machine(), 0x40, 0x80); |
2003 | 2003 | |
2004 | 2004 | /* set up additional input ports */ |
2005 | machine().device("master")->memory().space(AS_IO)->install_read_handler(0x80, 0x80, read8_delegate(FUNC(leland_state::cerberus_dial_1_r),this)); | |
2006 | machine().device("master")->memory().space(AS_IO)->install_read_handler(0x90, 0x90, read8_delegate(FUNC(leland_state::cerberus_dial_2_r),this)); | |
2005 | machine().device("master")->memory().space(AS_IO).install_read_handler(0x80, 0x80, read8_delegate(FUNC(leland_state::cerberus_dial_1_r),this)); | |
2006 | machine().device("master")->memory().space(AS_IO).install_read_handler(0x90, 0x90, read8_delegate(FUNC(leland_state::cerberus_dial_2_r),this)); | |
2007 | 2007 | } |
2008 | 2008 | |
2009 | 2009 | |
r18027 | r18028 | |
2048 | 2048 | /* kludge warning: the game uses location E0CA to determine if the joysticks are available */ |
2049 | 2049 | /* it gets cleared by the code, but there is no obvious way for the value to be set to a */ |
2050 | 2050 | /* non-zero value. If the value is zero, the joystick is never read. */ |
2051 | m_alleymas_kludge_mem = machine().device("master")->memory().space(AS_PROGRAM) | |
2051 | m_alleymas_kludge_mem = machine().device("master")->memory().space(AS_PROGRAM).install_write_handler(0xe0ca, 0xe0ca, write8_delegate(FUNC(leland_state::alleymas_joystick_kludge),this)); | |
2052 | 2052 | } |
2053 | 2053 | |
2054 | 2054 | |
r18027 | r18028 | |
2071 | 2071 | init_master_ports(machine(), 0x40, 0x80); |
2072 | 2072 | |
2073 | 2073 | /* set up additional input ports */ |
2074 | machine().device("master")->memory().space(AS_IO)->install_read_handler(0xf4, 0xf4, read8_delegate(FUNC(leland_state::dangerz_input_upper_r),this)); | |
2075 | machine().device("master")->memory().space(AS_IO)->install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(leland_state::dangerz_input_y_r),this)); | |
2076 | machine().device("master")->memory().space(AS_IO)->install_read_handler(0xfc, 0xfc, read8_delegate(FUNC(leland_state::dangerz_input_x_r),this)); | |
2074 | machine().device("master")->memory().space(AS_IO).install_read_handler(0xf4, 0xf4, read8_delegate(FUNC(leland_state::dangerz_input_upper_r),this)); | |
2075 | machine().device("master")->memory().space(AS_IO).install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(leland_state::dangerz_input_y_r),this)); | |
2076 | machine().device("master")->memory().space(AS_IO).install_read_handler(0xfc, 0xfc, read8_delegate(FUNC(leland_state::dangerz_input_x_r),this)); | |
2077 | 2077 | } |
2078 | 2078 | |
2079 | 2079 | |
r18027 | r18028 | |
2118 | 2118 | init_master_ports(machine(), 0x00, 0xc0); |
2119 | 2119 | |
2120 | 2120 | /* set up additional input ports */ |
2121 | machine().device("master")->memory().space(AS_IO)->install_read_handler(0xc0, 0xc0, read8_delegate(FUNC(leland_state::redline_pedal_1_r),this)); | |
2122 | machine().device("master")->memory().space(AS_IO)->install_read_handler(0xd0, 0xd0, read8_delegate(FUNC(leland_state::redline_pedal_2_r),this)); | |
2123 | machine().device("master")->memory().space(AS_IO)->install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(leland_state::redline_wheel_2_r),this)); | |
2124 | machine().device("master")->memory().space(AS_IO)->install_read_handler(0xfb, 0xfb, read8_delegate(FUNC(leland_state::redline_wheel_1_r),this)); | |
2121 | machine().device("master")->memory().space(AS_IO).install_read_handler(0xc0, 0xc0, read8_delegate(FUNC(leland_state::redline_pedal_1_r),this)); | |
2122 | machine().device("master")->memory().space(AS_IO).install_read_handler(0xd0, 0xd0, read8_delegate(FUNC(leland_state::redline_pedal_2_r),this)); | |
2123 | machine().device("master")->memory().space(AS_IO).install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(leland_state::redline_wheel_2_r),this)); | |
2124 | machine().device("master")->memory().space(AS_IO).install_read_handler(0xfb, 0xfb, read8_delegate(FUNC(leland_state::redline_wheel_1_r),this)); | |
2125 | 2125 | } |
2126 | 2126 | |
2127 | 2127 | |
r18027 | r18028 | |
2150 | 2150 | init_master_ports(machine(), 0x00, 0xc0); |
2151 | 2151 | |
2152 | 2152 | /* set up additional input ports */ |
2153 | machine().device("master")->memory().space(AS_IO)->install_read_handler(0xa4, 0xa4, read8_delegate(FUNC(leland_state::dangerz_input_upper_r),this)); | |
2154 | machine().device("master")->memory().space(AS_IO)->install_read_handler(0xb8, 0xb8, read8_delegate(FUNC(leland_state::dangerz_input_y_r),this)); | |
2155 | machine().device("master")->memory().space(AS_IO)->install_read_handler(0xbc, 0xbc, read8_delegate(FUNC(leland_state::dangerz_input_x_r),this)); | |
2153 | machine().device("master")->memory().space(AS_IO).install_read_handler(0xa4, 0xa4, read8_delegate(FUNC(leland_state::dangerz_input_upper_r),this)); | |
2154 | machine().device("master")->memory().space(AS_IO).install_read_handler(0xb8, 0xb8, read8_delegate(FUNC(leland_state::dangerz_input_y_r),this)); | |
2155 | machine().device("master")->memory().space(AS_IO).install_read_handler(0xbc, 0xbc, read8_delegate(FUNC(leland_state::dangerz_input_x_r),this)); | |
2156 | 2156 | } |
2157 | 2157 | |
2158 | 2158 | |
r18027 | r18028 | |
2169 | 2169 | init_master_ports(machine(), 0x40, 0x80); |
2170 | 2170 | |
2171 | 2171 | /* set up additional input ports */ |
2172 | machine().device("master")->memory().space(AS_IO)->install_read_port(0x7c, 0x7c, "IN4"); | |
2173 | machine().device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN5"); | |
2172 | machine().device("master")->memory().space(AS_IO).install_read_port(0x7c, 0x7c, "IN4"); | |
2173 | machine().device("master")->memory().space(AS_IO).install_read_port(0x7f, 0x7f, "IN5"); | |
2174 | 2174 | } |
2175 | 2175 | |
2176 | 2176 | |
r18027 | r18028 | |
2187 | 2187 | init_master_ports(machine(), 0x00, 0xc0); |
2188 | 2188 | |
2189 | 2189 | /* set up additional input ports */ |
2190 | machine().device("master")->memory().space(AS_IO)->install_read_port(0x7c, 0x7c, "IN4"); | |
2191 | machine().device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN5"); | |
2190 | machine().device("master")->memory().space(AS_IO).install_read_port(0x7c, 0x7c, "IN4"); | |
2191 | machine().device("master")->memory().space(AS_IO).install_read_port(0x7f, 0x7f, "IN5"); | |
2192 | 2192 | } |
2193 | 2193 | |
2194 | 2194 | |
r18027 | r18028 | |
2205 | 2205 | init_master_ports(machine(), 0x80, 0x40); |
2206 | 2206 | |
2207 | 2207 | /* set up additional input ports */ |
2208 | machine().device("master")->memory().space(AS_IO)->install_read_port(0x7c, 0x7c, "IN4"); | |
2209 | machine().device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN5"); | |
2208 | machine().device("master")->memory().space(AS_IO).install_read_port(0x7c, 0x7c, "IN4"); | |
2209 | machine().device("master")->memory().space(AS_IO).install_read_port(0x7f, 0x7f, "IN5"); | |
2210 | 2210 | } |
2211 | 2211 | |
2212 | 2212 | |
r18027 | r18028 | |
2223 | 2223 | init_master_ports(machine(), 0x00, 0x40); |
2224 | 2224 | |
2225 | 2225 | /* set up additional input ports */ |
2226 | machine().device("master")->memory().space(AS_IO)->install_read_port(0x7c, 0x7c, "IN4"); | |
2227 | machine().device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN5"); | |
2226 | machine().device("master")->memory().space(AS_IO).install_read_port(0x7c, 0x7c, "IN4"); | |
2227 | machine().device("master")->memory().space(AS_IO).install_read_port(0x7f, 0x7f, "IN5"); | |
2228 | 2228 | } |
2229 | 2229 | |
2230 | 2230 | |
r18027 | r18028 | |
2242 | 2242 | init_master_ports(machine(), 0x40, 0x80); /* yes, this is intentional */ |
2243 | 2243 | |
2244 | 2244 | /* set up additional input ports */ |
2245 | machine().device("master")->memory().space(AS_IO)->install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(leland_state::offroad_wheel_3_r),this)); | |
2246 | machine().device("master")->memory().space(AS_IO)->install_read_handler(0xf9, 0xf9, read8_delegate(FUNC(leland_state::offroad_wheel_1_r),this)); | |
2247 | machine().device("master")->memory().space(AS_IO)->install_read_handler(0xfb, 0xfb, read8_delegate(FUNC(leland_state::offroad_wheel_2_r),this)); | |
2245 | machine().device("master")->memory().space(AS_IO).install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(leland_state::offroad_wheel_3_r),this)); | |
2246 | machine().device("master")->memory().space(AS_IO).install_read_handler(0xf9, 0xf9, read8_delegate(FUNC(leland_state::offroad_wheel_1_r),this)); | |
2247 | machine().device("master")->memory().space(AS_IO).install_read_handler(0xfb, 0xfb, read8_delegate(FUNC(leland_state::offroad_wheel_2_r),this)); | |
2248 | 2248 | } |
2249 | 2249 | |
2250 | 2250 | |
r18027 | r18028 | |
2261 | 2261 | init_master_ports(machine(), 0x80, 0x40); |
2262 | 2262 | |
2263 | 2263 | /* set up additional input ports */ |
2264 | machine().device("master")->memory().space(AS_IO)->install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(leland_state::offroad_wheel_3_r),this)); | |
2265 | machine().device("master")->memory().space(AS_IO)->install_read_handler(0xf9, 0xf9, read8_delegate(FUNC(leland_state::offroad_wheel_1_r),this)); | |
2266 | machine().device("master")->memory().space(AS_IO)->install_read_handler(0xfb, 0xfb, read8_delegate(FUNC(leland_state::offroad_wheel_2_r),this)); | |
2264 | machine().device("master")->memory().space(AS_IO).install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(leland_state::offroad_wheel_3_r),this)); | |
2265 | machine().device("master")->memory().space(AS_IO).install_read_handler(0xf9, 0xf9, read8_delegate(FUNC(leland_state::offroad_wheel_1_r),this)); | |
2266 | machine().device("master")->memory().space(AS_IO).install_read_handler(0xfb, 0xfb, read8_delegate(FUNC(leland_state::offroad_wheel_2_r),this)); | |
2267 | 2267 | } |
2268 | 2268 | |
2269 | 2269 | |
r18027 | r18028 | |
2280 | 2280 | init_master_ports(machine(), 0x00, 0x40); |
2281 | 2281 | |
2282 | 2282 | /* set up additional input ports */ |
2283 | machine().device("master")->memory().space(AS_IO) | |
2283 | machine().device("master")->memory().space(AS_IO).install_read_port(0x7f, 0x7f, "IN4"); | |
2284 | 2284 | } |
2285 | 2285 | |
2286 | 2286 |
r18027 | r18028 | |
---|---|---|
427 | 427 | machine().device<nvram_device>("nvram")->set_base(m_banked_nvram, 0x2000); |
428 | 428 | |
429 | 429 | pc_vga_init(machine(), vga_setting, NULL); |
430 | pc_vga_io_init(machine(), | |
430 | pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); | |
431 | 431 | } |
432 | 432 | |
433 | 433 | GAME( 1993, bonanza, 0, pcat_nit, pcat_nit, pcat_nit_state, pcat_nit, ROT0, "New Image Technologies", "Bonanza (Revision 3)", GAME_NOT_WORKING|GAME_NO_SOUND ) |
r18027 | r18028 | |
---|---|---|
120 | 120 | |
121 | 121 | void tiamc1_state::machine_reset() |
122 | 122 | { |
123 | address_space &space = | |
123 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
124 | 124 | tiamc1_bankswitch_w(space, 0, 0); |
125 | 125 | } |
126 | 126 |
r18027 | r18028 | |
---|---|---|
188 | 188 | WRITE8_MEMBER(segag80r_state::monsterb_vidram_w){ monsterb_videoram_w(space, decrypt_offset(space, offset), data); } |
189 | 189 | WRITE8_MEMBER(segag80r_state::pignewt_vidram_w){ pignewt_videoram_w(space, decrypt_offset(space, offset), data); } |
190 | 190 | WRITE8_MEMBER(segag80r_state::sindbadm_vidram_w){ sindbadm_videoram_w(space, decrypt_offset(space, offset), data); } |
191 | WRITE8_MEMBER(segag80r_state::usb_ram_w){ device_t *device = machine().device("usbsnd"); sega_usb_ram_w(device, space, decrypt_offset( | |
191 | WRITE8_MEMBER(segag80r_state::usb_ram_w){ device_t *device = machine().device("usbsnd"); sega_usb_ram_w(device, space, decrypt_offset(machine().device("maincpu")->memory().space(AS_PROGRAM), offset), data); } | |
192 | 192 | |
193 | 193 | |
194 | 194 | |
r18027 | r18028 | |
1446 | 1446 | DRIVER_INIT_MEMBER(segag80r_state,astrob) |
1447 | 1447 | { |
1448 | 1448 | device_t *speech = machine().device("segaspeech"); |
1449 | address_space | |
1449 | address_space &iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1450 | 1450 | |
1451 | 1451 | /* configure the 315-0062 security chip */ |
1452 | 1452 | m_decrypt = segag80_security(62); |
r18027 | r18028 | |
1455 | 1455 | m_background_pcb = G80_BACKGROUND_NONE; |
1456 | 1456 | |
1457 | 1457 | /* install speech board */ |
1458 | iospace->install_legacy_write_handler(*speech, 0x38, 0x38, FUNC(sega_speech_data_w)); | |
1459 | iospace->install_legacy_write_handler(*speech, 0x3b, 0x3b, FUNC(sega_speech_control_w)); | |
1458 | iospace.install_legacy_write_handler(*speech, 0x38, 0x38, FUNC(sega_speech_data_w)); | |
1459 | iospace.install_legacy_write_handler(*speech, 0x3b, 0x3b, FUNC(sega_speech_control_w)); | |
1460 | 1460 | |
1461 | 1461 | /* install Astro Blaster sound board */ |
1462 | iospace | |
1462 | iospace.install_write_handler(0x3e, 0x3f, write8_delegate(FUNC(segag80r_state::astrob_sound_w),this)); | |
1463 | 1463 | } |
1464 | 1464 | |
1465 | 1465 | |
r18027 | r18028 | |
1476 | 1476 | |
1477 | 1477 | DRIVER_INIT_MEMBER(segag80r_state,spaceod) |
1478 | 1478 | { |
1479 | address_space | |
1479 | address_space &iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1480 | 1480 | |
1481 | 1481 | /* configure the 315-0063 security chip */ |
1482 | 1482 | m_decrypt = segag80_security(63); |
r18027 | r18028 | |
1485 | 1485 | m_background_pcb = G80_BACKGROUND_SPACEOD; |
1486 | 1486 | |
1487 | 1487 | /* configure ports for the background board */ |
1488 | iospace | |
1488 | iospace.install_readwrite_handler(0x08, 0x0f, read8_delegate(FUNC(segag80r_state::spaceod_back_port_r),this), write8_delegate(FUNC(segag80r_state::spaceod_back_port_w),this)); | |
1489 | 1489 | |
1490 | 1490 | /* install Space Odyssey sound board */ |
1491 | iospace | |
1491 | iospace.install_write_handler(0x0e, 0x0f, write8_delegate(FUNC(segag80r_state::spaceod_sound_w),this)); | |
1492 | 1492 | |
1493 | 1493 | /* install our wacky mangled ports */ |
1494 | iospace->install_read_handler(0xf8, 0xfb, read8_delegate(FUNC(segag80r_state::spaceod_mangled_ports_r),this)); | |
1495 | iospace->install_read_handler(0xfc, 0xfc, read8_delegate(FUNC(segag80r_state::spaceod_port_fc_r),this)); | |
1494 | iospace.install_read_handler(0xf8, 0xfb, read8_delegate(FUNC(segag80r_state::spaceod_mangled_ports_r),this)); | |
1495 | iospace.install_read_handler(0xfc, 0xfc, read8_delegate(FUNC(segag80r_state::spaceod_port_fc_r),this)); | |
1496 | 1496 | } |
1497 | 1497 | |
1498 | 1498 | |
1499 | 1499 | DRIVER_INIT_MEMBER(segag80r_state,monsterb) |
1500 | 1500 | { |
1501 | address_space *iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1502 | address_space *pgmspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1501 | address_space &iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1502 | address_space &pgmspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1503 | 1503 | |
1504 | 1504 | /* configure the 315-0082 security chip */ |
1505 | 1505 | m_decrypt = segag80_security(82); |
r18027 | r18028 | |
1509 | 1509 | monsterb_expand_gfx(machine(), "gfx1"); |
1510 | 1510 | |
1511 | 1511 | /* install background board handlers */ |
1512 | iospace->install_write_handler(0xb8, 0xbd, write8_delegate(FUNC(segag80r_state::monsterb_back_port_w),this)); | |
1513 | pgmspace->install_write_handler(0xe000, 0xffff, write8_delegate(FUNC(segag80r_state::monsterb_vidram_w),this)); | |
1512 | iospace.install_write_handler(0xb8, 0xbd, write8_delegate(FUNC(segag80r_state::monsterb_back_port_w),this)); | |
1513 | pgmspace.install_write_handler(0xe000, 0xffff, write8_delegate(FUNC(segag80r_state::monsterb_vidram_w),this)); | |
1514 | 1514 | } |
1515 | 1515 | |
1516 | 1516 | |
1517 | 1517 | DRIVER_INIT_MEMBER(segag80r_state,monster2) |
1518 | 1518 | { |
1519 | address_space *iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1520 | address_space *pgmspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1519 | address_space &iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1520 | address_space &pgmspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1521 | 1521 | |
1522 | 1522 | /* configure the 315-5006 security chip */ |
1523 | 1523 | spatter_decode(machine(), "maincpu"); |
r18027 | r18028 | |
1528 | 1528 | monsterb_expand_gfx(machine(), "gfx1"); |
1529 | 1529 | |
1530 | 1530 | /* install background board handlers */ |
1531 | iospace->install_write_handler(0xb4, 0xb5, write8_delegate(FUNC(segag80r_state::pignewt_back_color_w),this)); | |
1532 | iospace->install_write_handler(0xb8, 0xbd, write8_delegate(FUNC(segag80r_state::pignewt_back_port_w),this)); | |
1533 | pgmspace->install_write_handler(0xe000, 0xffff, write8_delegate(FUNC(segag80r_state::pignewt_vidram_w),this)); | |
1531 | iospace.install_write_handler(0xb4, 0xb5, write8_delegate(FUNC(segag80r_state::pignewt_back_color_w),this)); | |
1532 | iospace.install_write_handler(0xb8, 0xbd, write8_delegate(FUNC(segag80r_state::pignewt_back_port_w),this)); | |
1533 | pgmspace.install_write_handler(0xe000, 0xffff, write8_delegate(FUNC(segag80r_state::pignewt_vidram_w),this)); | |
1534 | 1534 | } |
1535 | 1535 | |
1536 | 1536 | |
1537 | 1537 | DRIVER_INIT_MEMBER(segag80r_state,pignewt) |
1538 | 1538 | { |
1539 | 1539 | device_t *usbsnd = machine().device("usbsnd"); |
1540 | address_space *iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1541 | address_space *pgmspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1540 | address_space &iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1541 | address_space &pgmspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1542 | 1542 | |
1543 | 1543 | /* configure the 315-0063? security chip */ |
1544 | 1544 | m_decrypt = segag80_security(63); |
r18027 | r18028 | |
1548 | 1548 | monsterb_expand_gfx(machine(), "gfx1"); |
1549 | 1549 | |
1550 | 1550 | /* install background board handlers */ |
1551 | iospace->install_write_handler(0xb4, 0xb5, write8_delegate(FUNC(segag80r_state::pignewt_back_color_w),this)); | |
1552 | iospace->install_write_handler(0xb8, 0xbd, write8_delegate(FUNC(segag80r_state::pignewt_back_port_w),this)); | |
1553 | pgmspace->install_write_handler(0xe000, 0xffff, write8_delegate(FUNC(segag80r_state::pignewt_vidram_w),this)); | |
1551 | iospace.install_write_handler(0xb4, 0xb5, write8_delegate(FUNC(segag80r_state::pignewt_back_color_w),this)); | |
1552 | iospace.install_write_handler(0xb8, 0xbd, write8_delegate(FUNC(segag80r_state::pignewt_back_port_w),this)); | |
1553 | pgmspace.install_write_handler(0xe000, 0xffff, write8_delegate(FUNC(segag80r_state::pignewt_vidram_w),this)); | |
1554 | 1554 | |
1555 | 1555 | /* install Universal sound board */ |
1556 | iospace->install_legacy_readwrite_handler(*usbsnd, 0x3f, 0x3f, FUNC(sega_usb_status_r), FUNC(sega_usb_data_w)); | |
1557 | pgmspace->install_legacy_read_handler(*usbsnd, 0xd000, 0xdfff, FUNC(sega_usb_ram_r)); | |
1558 | pgmspace->install_write_handler(0xd000, 0xdfff, write8_delegate(FUNC(segag80r_state::usb_ram_w),this)); | |
1556 | iospace.install_legacy_readwrite_handler(*usbsnd, 0x3f, 0x3f, FUNC(sega_usb_status_r), FUNC(sega_usb_data_w)); | |
1557 | pgmspace.install_legacy_read_handler(*usbsnd, 0xd000, 0xdfff, FUNC(sega_usb_ram_r)); | |
1558 | pgmspace.install_write_handler(0xd000, 0xdfff, write8_delegate(FUNC(segag80r_state::usb_ram_w),this)); | |
1559 | 1559 | } |
1560 | 1560 | |
1561 | 1561 | |
1562 | 1562 | DRIVER_INIT_MEMBER(segag80r_state,sindbadm) |
1563 | 1563 | { |
1564 | address_space *iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1565 | address_space *pgmspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1564 | address_space &iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1565 | address_space &pgmspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1566 | 1566 | |
1567 | 1567 | /* configure the encrypted Z80 */ |
1568 | 1568 | sindbadm_decode(machine(), "maincpu"); |
r18027 | r18028 | |
1572 | 1572 | m_background_pcb = G80_BACKGROUND_SINDBADM; |
1573 | 1573 | |
1574 | 1574 | /* install background board handlers */ |
1575 | iospace->install_write_handler(0x40, 0x41, write8_delegate(FUNC(segag80r_state::sindbadm_back_port_w),this)); | |
1576 | pgmspace->install_write_handler(0xe000, 0xffff, write8_delegate(FUNC(segag80r_state::sindbadm_vidram_w),this)); | |
1575 | iospace.install_write_handler(0x40, 0x41, write8_delegate(FUNC(segag80r_state::sindbadm_back_port_w),this)); | |
1576 | pgmspace.install_write_handler(0xe000, 0xffff, write8_delegate(FUNC(segag80r_state::sindbadm_vidram_w),this)); | |
1577 | 1577 | } |
1578 | 1578 | |
1579 | 1579 |
r18027 | r18028 | |
---|---|---|
1325 | 1325 | |
1326 | 1326 | m_has_dsp_hack = 1; |
1327 | 1327 | |
1328 | machine().device("dsp")->memory().space(AS_DATA) | |
1328 | machine().device("dsp")->memory().space(AS_DATA).install_readwrite_handler(0x7ff0, 0x7ff0, read16_delegate(FUNC(taitojc_state::taitojc_dsp_idle_skip_r),this), write16_delegate(FUNC(taitojc_state::dsp_idle_skip_w),this)); | |
1329 | 1329 | } |
1330 | 1330 | |
1331 | 1331 | DRIVER_INIT_MEMBER(taitojc_state,dendego2) |
r18027 | r18028 | |
1333 | 1333 | |
1334 | 1334 | DRIVER_INIT_CALL(taitojc); |
1335 | 1335 | |
1336 | machine().device("dsp")->memory().space(AS_DATA) | |
1336 | machine().device("dsp")->memory().space(AS_DATA).install_readwrite_handler(0x7ff0, 0x7ff0, read16_delegate(FUNC(taitojc_state::dendego2_dsp_idle_skip_r),this), write16_delegate(FUNC(taitojc_state::dsp_idle_skip_w),this)); | |
1337 | 1337 | } |
1338 | 1338 | |
1339 | 1339 | DRIVER_INIT_MEMBER(taitojc_state,dangcurv) |
r18027 | r18028 | |
---|---|---|
677 | 677 | |
678 | 678 | DRIVER_INIT_MEMBER(ddealer_state,ddealer) |
679 | 679 | { |
680 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
680 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xfe01c, 0xfe01d, read16_delegate(FUNC(ddealer_state::ddealer_mcu_r), this)); | |
681 | 681 | } |
682 | 682 | |
683 | 683 | ROM_START( ddealer ) |
r18027 | r18028 | |
---|---|---|
582 | 582 | |
583 | 583 | static SOUND_RESET(berzerk) |
584 | 584 | { |
585 | address_space &space = | |
585 | address_space &space = machine.device("maincpu")->memory().space(AS_IO); | |
586 | 586 | berzerk_state *state = machine.driver_data<berzerk_state>(); |
587 | 587 | /* clears the flip-flop controlling the volume and freq on the speech chip */ |
588 | 588 | state->berzerk_audio_w(space, 4, 0x40); |
r18027 | r18028 | |
1234 | 1234 | |
1235 | 1235 | DRIVER_INIT_MEMBER(berzerk_state,moonwarp) |
1236 | 1236 | { |
1237 | address_space *io = machine().device("maincpu")->memory().space(AS_IO); | |
1238 | io->install_read_handler (0x48, 0x48, read8_delegate(FUNC(berzerk_state::moonwarp_p1_r), this)); | |
1239 | io->install_read_handler (0x4a, 0x4a, read8_delegate(FUNC(berzerk_state::moonwarp_p2_r), this)); | |
1237 | address_space &io = machine().device("maincpu")->memory().space(AS_IO); | |
1238 | io.install_read_handler (0x48, 0x48, read8_delegate(FUNC(berzerk_state::moonwarp_p1_r), this)); | |
1239 | io.install_read_handler (0x4a, 0x4a, read8_delegate(FUNC(berzerk_state::moonwarp_p2_r), this)); | |
1240 | 1240 | } |
1241 | 1241 | |
1242 | 1242 | /************************************* |
r18027 | r18028 | |
---|---|---|
249 | 249 | DRIVER_INIT_MEMBER(magtouch_state,magtouch) |
250 | 250 | { |
251 | 251 | pc_vga_init(machine(), vga_setting, NULL); |
252 | pc_vga_io_init(machine(), | |
252 | pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); | |
253 | 253 | } |
254 | 254 | |
255 | 255 | GAME( 1995, magtouch, 0, magtouch, magtouch, magtouch_state, magtouch, ROT0, "Micro Manufacturing", "Magical Touch", GAME_NOT_WORKING | GAME_NO_SOUND ) |
r18027 | r18028 | |
---|---|---|
1813 | 1813 | } |
1814 | 1814 | |
1815 | 1815 | /* input ports */ |
1816 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1816 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xc00000, 0xc0000b, read32_delegate(FUNC(psikyo_state::sngkace_input_r),this)); | |
1817 | 1817 | |
1818 | 1818 | /* sound latch */ |
1819 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1819 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xc00010, 0xc00013, write32_delegate(FUNC(psikyo_state::psikyo_soundlatch_w),this)); | |
1820 | 1820 | |
1821 | 1821 | m_ka302c_banking = 0; // SH201B doesn't have any gfx banking |
1822 | 1822 | |
r18027 | r18028 | |
1865 | 1865 | { |
1866 | 1866 | |
1867 | 1867 | /* input ports */ |
1868 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1868 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xc00000, 0xc0000b, read32_delegate(FUNC(psikyo_state::s1945_input_r),this)); | |
1869 | 1869 | |
1870 | 1870 | /* sound latch */ |
1871 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1871 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xc00010, 0xc00013, write32_delegate(FUNC(psikyo_state::s1945_soundlatch_w),this)); | |
1872 | 1872 | |
1873 | 1873 | /* protection */ |
1874 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1874 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xc00004, 0xc0000b, write32_delegate(FUNC(psikyo_state::s1945_mcu_w),this)); | |
1875 | 1875 | |
1876 | 1876 | s1945_mcu_init(machine()); |
1877 | 1877 | m_s1945_mcu_table = 0; |
r18027 | r18028 | |
1887 | 1887 | { |
1888 | 1888 | |
1889 | 1889 | /* input ports */ |
1890 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1890 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xc00000, 0xc0000b, read32_delegate(FUNC(psikyo_state::gunbird_input_r),this)); | |
1891 | 1891 | |
1892 | 1892 | /* sound latch */ |
1893 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1893 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xc00010, 0xc00013, write32_delegate(FUNC(psikyo_state::psikyo_soundlatch_w),this)); | |
1894 | 1894 | |
1895 | 1895 | m_ka302c_banking = 1; |
1896 | 1896 | |
r18027 | r18028 | |
1904 | 1904 | { |
1905 | 1905 | |
1906 | 1906 | /* input ports */ |
1907 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1907 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xc00000, 0xc0000b, read32_delegate(FUNC(psikyo_state::s1945_input_r),this)); | |
1908 | 1908 | |
1909 | 1909 | /* sound latch */ |
1910 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1910 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xc00010, 0xc00013, write32_delegate(FUNC(psikyo_state::s1945_soundlatch_w),this)); | |
1911 | 1911 | |
1912 | 1912 | /* protection and tile bank switching */ |
1913 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1913 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xc00004, 0xc0000b, write32_delegate(FUNC(psikyo_state::s1945_mcu_w),this)); | |
1914 | 1914 | |
1915 | 1915 | s1945_mcu_init(machine()); |
1916 | 1916 | m_s1945_mcu_table = s1945_table; |
r18027 | r18028 | |
1926 | 1926 | { |
1927 | 1927 | |
1928 | 1928 | /* input ports */ |
1929 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1929 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xc00000, 0xc0000b, read32_delegate(FUNC(psikyo_state::s1945_input_r),this)); | |
1930 | 1930 | |
1931 | 1931 | /* sound latch */ |
1932 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1932 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xc00010, 0xc00013, write32_delegate(FUNC(psikyo_state::s1945_soundlatch_w),this)); | |
1933 | 1933 | |
1934 | 1934 | /* protection and tile bank switching */ |
1935 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1935 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xc00004, 0xc0000b, write32_delegate(FUNC(psikyo_state::s1945_mcu_w),this)); | |
1936 | 1936 | |
1937 | 1937 | s1945_mcu_init(machine()); |
1938 | 1938 | m_s1945_mcu_table = s1945a_table; |
r18027 | r18028 | |
1948 | 1948 | { |
1949 | 1949 | |
1950 | 1950 | /* input ports*/ |
1951 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1951 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xc00000, 0xc0000b, read32_delegate(FUNC(psikyo_state::s1945_input_r),this)); | |
1952 | 1952 | |
1953 | 1953 | /* sound latch */ |
1954 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1954 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xc00010, 0xc00013, write32_delegate(FUNC(psikyo_state::s1945_soundlatch_w),this)); | |
1955 | 1955 | |
1956 | 1956 | /* protection and tile bank switching */ |
1957 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1957 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xc00004, 0xc0000b, write32_delegate(FUNC(psikyo_state::s1945_mcu_w),this)); | |
1958 | 1958 | |
1959 | 1959 | s1945_mcu_init(machine()); |
1960 | 1960 | m_s1945_mcu_table = s1945j_table; |
r18027 | r18028 | |
1970 | 1970 | { |
1971 | 1971 | |
1972 | 1972 | /* input ports */ |
1973 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1973 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xc00000, 0xc0000b, read32_delegate(FUNC(psikyo_state::gunbird_input_r),this)); | |
1974 | 1974 | |
1975 | 1975 | /* sound latch */ |
1976 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1976 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xc00010, 0xc00013, write32_delegate(FUNC(psikyo_state::s1945_soundlatch_w),this)); | |
1977 | 1977 | |
1978 | 1978 | m_ka302c_banking = 1; |
1979 | 1979 | |
r18027 | r18028 | |
1986 | 1986 | { |
1987 | 1987 | |
1988 | 1988 | /* input ports */ |
1989 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1989 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xc00000, 0xc0000b, read32_delegate(FUNC(psikyo_state::gunbird_input_r),this)); | |
1990 | 1990 | |
1991 | 1991 | /* sound latch */ |
1992 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1992 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xc00010, 0xc00013, write32_delegate(FUNC(psikyo_state::s1945_soundlatch_w),this)); | |
1993 | 1993 | |
1994 | 1994 | m_ka302c_banking = 1; |
1995 | 1995 |
r18027 | r18028 | |
---|---|---|
1059 | 1059 | |
1060 | 1060 | static UINT32 scsi_fetch(running_machine &machine, UINT32 dsp) |
1061 | 1061 | { |
1062 | address_space &space = | |
1062 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1063 | 1063 | UINT32 result; |
1064 | 1064 | result = space.read_dword(dsp); |
1065 | 1065 | return FLIPENDIAN_INT32(result); |
r18027 | r18028 | |
1159 | 1159 | |
1160 | 1160 | static void real3d_dma_callback(running_machine &machine, UINT32 src, UINT32 dst, int length, int byteswap) |
1161 | 1161 | { |
1162 | address_space &space = | |
1162 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1163 | 1163 | switch(dst >> 24) |
1164 | 1164 | { |
1165 | 1165 | case 0x88: /* Display List End Trigger */ |
r18027 | r18028 | |
5483 | 5483 | { |
5484 | 5484 | interleave_vroms(machine()); |
5485 | 5485 | |
5486 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5486 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xc0000000, 0xc00000ff, read64_delegate(FUNC(model3_state::scsi_r),this), write64_delegate(FUNC(model3_state::scsi_w),this)); | |
5487 | 5487 | |
5488 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5488 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xff000000, 0xff7fffff, "bank1" ); | |
5489 | 5489 | |
5490 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0800cf8, 0xf0800cff, read64_delegate(FUNC(model3_state::mpc105_addr_r),this), write64_delegate(FUNC(model3_state::mpc105_addr_w),this)); | |
5491 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0c00cf8, 0xf0c00cff, read64_delegate(FUNC(model3_state::mpc105_data_r),this), write64_delegate(FUNC(model3_state::mpc105_data_w),this)); | |
5492 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf8fff000, 0xf8fff0ff, read64_delegate(FUNC(model3_state::mpc105_reg_r),this), write64_delegate(FUNC(model3_state::mpc105_reg_w),this)); | |
5490 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf0800cf8, 0xf0800cff, read64_delegate(FUNC(model3_state::mpc105_addr_r),this), write64_delegate(FUNC(model3_state::mpc105_addr_w),this)); | |
5491 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf0c00cf8, 0xf0c00cff, read64_delegate(FUNC(model3_state::mpc105_data_r),this), write64_delegate(FUNC(model3_state::mpc105_data_w),this)); | |
5492 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf8fff000, 0xf8fff0ff, read64_delegate(FUNC(model3_state::mpc105_reg_r),this), write64_delegate(FUNC(model3_state::mpc105_reg_w),this)); | |
5493 | 5493 | } |
5494 | 5494 | |
5495 | 5495 | DRIVER_INIT_MEMBER(model3_state,model3_15) |
5496 | 5496 | { |
5497 | 5497 | interleave_vroms(machine()); |
5498 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5498 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xff000000, 0xff7fffff, "bank1" ); | |
5499 | 5499 | |
5500 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0800cf8, 0xf0800cff, read64_delegate(FUNC(model3_state::mpc105_addr_r),this), write64_delegate(FUNC(model3_state::mpc105_addr_w),this)); | |
5501 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0c00cf8, 0xf0c00cff, read64_delegate(FUNC(model3_state::mpc105_data_r),this), write64_delegate(FUNC(model3_state::mpc105_data_w),this)); | |
5502 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf8fff000, 0xf8fff0ff, read64_delegate(FUNC(model3_state::mpc105_reg_r),this), write64_delegate(FUNC(model3_state::mpc105_reg_w),this)); | |
5500 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf0800cf8, 0xf0800cff, read64_delegate(FUNC(model3_state::mpc105_addr_r),this), write64_delegate(FUNC(model3_state::mpc105_addr_w),this)); | |
5501 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf0c00cf8, 0xf0c00cff, read64_delegate(FUNC(model3_state::mpc105_data_r),this), write64_delegate(FUNC(model3_state::mpc105_data_w),this)); | |
5502 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf8fff000, 0xf8fff0ff, read64_delegate(FUNC(model3_state::mpc105_reg_r),this), write64_delegate(FUNC(model3_state::mpc105_reg_w),this)); | |
5503 | 5503 | } |
5504 | 5504 | |
5505 | 5505 | DRIVER_INIT_MEMBER(model3_state,model3_20) |
5506 | 5506 | { |
5507 | 5507 | interleave_vroms(machine()); |
5508 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5508 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xff000000, 0xff7fffff, "bank1" ); | |
5509 | 5509 | |
5510 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5510 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xc2000000, 0xc20000ff, read64_delegate(FUNC(model3_state::real3d_dma_r),this), write64_delegate(FUNC(model3_state::real3d_dma_w),this)); | |
5511 | 5511 | |
5512 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xfec00000, 0xfedfffff, read64_delegate(FUNC(model3_state::mpc106_addr_r),this), write64_delegate(FUNC(model3_state::mpc106_addr_w),this)); | |
5513 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xfee00000, 0xfeffffff, read64_delegate(FUNC(model3_state::mpc106_data_r),this), write64_delegate(FUNC(model3_state::mpc106_data_w),this)); | |
5514 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf8fff000, 0xf8fff0ff, read64_delegate(FUNC(model3_state::mpc106_reg_r),this), write64_delegate(FUNC(model3_state::mpc106_reg_w),this)); | |
5512 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xfec00000, 0xfedfffff, read64_delegate(FUNC(model3_state::mpc106_addr_r),this), write64_delegate(FUNC(model3_state::mpc106_addr_w),this)); | |
5513 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xfee00000, 0xfeffffff, read64_delegate(FUNC(model3_state::mpc106_data_r),this), write64_delegate(FUNC(model3_state::mpc106_data_w),this)); | |
5514 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf8fff000, 0xf8fff0ff, read64_delegate(FUNC(model3_state::mpc106_reg_r),this), write64_delegate(FUNC(model3_state::mpc106_reg_w),this)); | |
5515 | 5515 | } |
5516 | 5516 | |
5517 | 5517 | DRIVER_INIT_MEMBER(model3_state,lostwsga) |
r18027 | r18028 | |
5520 | 5520 | |
5521 | 5521 | DRIVER_INIT_CALL(model3_15); |
5522 | 5522 | /* TODO: there's an M68K device at 0xC0000000 - FF, maybe lightgun controls ? */ |
5523 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5523 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xc1000000, 0xc10000ff, read64_delegate(FUNC(model3_state::scsi_r),this), write64_delegate(FUNC(model3_state::scsi_w),this)); | |
5524 | 5524 | |
5525 | 5525 | rom[0x7374f0/4] = 0x38840004; /* This seems to be an actual bug in the original code */ |
5526 | 5526 | } |
r18027 | r18028 | |
5531 | 5531 | |
5532 | 5532 | DRIVER_INIT_CALL(model3_15); |
5533 | 5533 | /* TODO: network device at 0xC0000000 - FF */ |
5534 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5534 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf9000000, 0xf90000ff, read64_delegate(FUNC(model3_state::scsi_r),this), write64_delegate(FUNC(model3_state::scsi_w),this)); | |
5535 | 5535 | |
5536 | 5536 | rom[(0x71275c^4)/4] = 0x60000000; |
5537 | 5537 | rom[(0x71277c^4)/4] = 0x60000000; |
r18027 | r18028 | |
5543 | 5543 | |
5544 | 5544 | DRIVER_INIT_CALL(model3_15); |
5545 | 5545 | /* TODO: network device at 0xC0000000 - FF */ |
5546 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5546 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xc1000000, 0xc10000ff, read64_delegate(FUNC(model3_state::scsi_r),this), write64_delegate(FUNC(model3_state::scsi_w),this)); | |
5547 | 5547 | |
5548 | 5548 | rom[(0x713724^4)/4] = 0x60000000; |
5549 | 5549 | rom[(0x713744^4)/4] = 0x60000000; |
r18027 | r18028 | |
5560 | 5560 | |
5561 | 5561 | DRIVER_INIT_CALL(model3_15); |
5562 | 5562 | /* TODO: network device at 0xC0000000 - FF */ |
5563 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5563 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xc1000000, 0xc10000ff, read64_delegate(FUNC(model3_state::scsi_r),this), write64_delegate(FUNC(model3_state::scsi_w),this)); | |
5564 | 5564 | |
5565 | 5565 | //rom[(0x713724^4)/4] = 0x60000000; // Fix ME!!!! Needs to corrected for the non REV A version!!!! |
5566 | 5566 | //rom[(0x713744^4)/4] = 0x60000000; |
r18027 | r18028 | |
5576 | 5576 | UINT32 *rom = (UINT32*)memregion("user1")->base(); |
5577 | 5577 | DRIVER_INIT_CALL(model3_15); |
5578 | 5578 | |
5579 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5579 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xc1000000, 0xc10000ff, read64_delegate(FUNC(model3_state::scsi_r),this), write64_delegate(FUNC(model3_state::scsi_w),this)); | |
5580 | 5580 | |
5581 | 5581 | rom[(0x73fe38^4)/4] = 0x38840004; /* This seems to be an actual bug in the original code */ |
5582 | 5582 | |
r18027 | r18028 | |
5607 | 5607 | rom[(0x70e710^4)/4] = 0x60000000; |
5608 | 5608 | |
5609 | 5609 | interleave_vroms(machine()); |
5610 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5610 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xff000000, 0xff7fffff, "bank1" ); | |
5611 | 5611 | |
5612 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5612 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf9000000, 0xf90000ff, read64_delegate(FUNC(model3_state::scsi_r),this), write64_delegate(FUNC(model3_state::scsi_w),this)); | |
5613 | 5613 | |
5614 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0800cf8, 0xf0800cff, read64_delegate(FUNC(model3_state::mpc106_addr_r),this), write64_delegate(FUNC(model3_state::mpc106_addr_w),this)); | |
5615 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xfec00000, 0xfedfffff, read64_delegate(FUNC(model3_state::mpc106_addr_r),this), write64_delegate(FUNC(model3_state::mpc106_addr_w),this)); | |
5616 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0c00cf8, 0xf0c00cff, read64_delegate(FUNC(model3_state::mpc106_data_r),this), write64_delegate(FUNC(model3_state::mpc106_data_w),this)); | |
5617 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xfee00000, 0xfeffffff, read64_delegate(FUNC(model3_state::mpc106_data_r),this), write64_delegate(FUNC(model3_state::mpc106_data_w),this)); | |
5618 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf8fff000, 0xf8fff0ff, read64_delegate(FUNC(model3_state::mpc106_reg_r),this), write64_delegate(FUNC(model3_state::mpc106_reg_w),this)); | |
5614 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf0800cf8, 0xf0800cff, read64_delegate(FUNC(model3_state::mpc106_addr_r),this), write64_delegate(FUNC(model3_state::mpc106_addr_w),this)); | |
5615 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xfec00000, 0xfedfffff, read64_delegate(FUNC(model3_state::mpc106_addr_r),this), write64_delegate(FUNC(model3_state::mpc106_addr_w),this)); | |
5616 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf0c00cf8, 0xf0c00cff, read64_delegate(FUNC(model3_state::mpc106_data_r),this), write64_delegate(FUNC(model3_state::mpc106_data_w),this)); | |
5617 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xfee00000, 0xfeffffff, read64_delegate(FUNC(model3_state::mpc106_data_r),this), write64_delegate(FUNC(model3_state::mpc106_data_w),this)); | |
5618 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf8fff000, 0xf8fff0ff, read64_delegate(FUNC(model3_state::mpc106_reg_r),this), write64_delegate(FUNC(model3_state::mpc106_reg_w),this)); | |
5619 | 5619 | } |
5620 | 5620 | |
5621 | 5621 | DRIVER_INIT_MEMBER(model3_state,vs29815) |
r18027 | r18028 | |
5626 | 5626 | rom[(0x60290c^4)/4] = 0x60000000; |
5627 | 5627 | |
5628 | 5628 | interleave_vroms(machine()); |
5629 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5629 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xff000000, 0xff7fffff, "bank1" ); | |
5630 | 5630 | |
5631 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5631 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf9000000, 0xf90000ff, read64_delegate(FUNC(model3_state::scsi_r),this), write64_delegate(FUNC(model3_state::scsi_w),this)); | |
5632 | 5632 | |
5633 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0800cf8, 0xf0800cff, read64_delegate(FUNC(model3_state::mpc106_addr_r),this), write64_delegate(FUNC(model3_state::mpc106_addr_w),this)); | |
5634 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xfec00000, 0xfedfffff, read64_delegate(FUNC(model3_state::mpc106_addr_r),this), write64_delegate(FUNC(model3_state::mpc106_addr_w),this)); | |
5635 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0c00cf8, 0xf0c00cff, read64_delegate(FUNC(model3_state::mpc106_data_r),this), write64_delegate(FUNC(model3_state::mpc106_data_w),this)); | |
5636 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xfee00000, 0xfeffffff, read64_delegate(FUNC(model3_state::mpc106_data_r),this), write64_delegate(FUNC(model3_state::mpc106_data_w),this)); | |
5637 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf8fff000, 0xf8fff0ff, read64_delegate(FUNC(model3_state::mpc106_reg_r),this), write64_delegate(FUNC(model3_state::mpc106_reg_w),this)); | |
5633 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf0800cf8, 0xf0800cff, read64_delegate(FUNC(model3_state::mpc106_addr_r),this), write64_delegate(FUNC(model3_state::mpc106_addr_w),this)); | |
5634 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xfec00000, 0xfedfffff, read64_delegate(FUNC(model3_state::mpc106_addr_r),this), write64_delegate(FUNC(model3_state::mpc106_addr_w),this)); | |
5635 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf0c00cf8, 0xf0c00cff, read64_delegate(FUNC(model3_state::mpc106_data_r),this), write64_delegate(FUNC(model3_state::mpc106_data_w),this)); | |
5636 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xfee00000, 0xfeffffff, read64_delegate(FUNC(model3_state::mpc106_data_r),this), write64_delegate(FUNC(model3_state::mpc106_data_w),this)); | |
5637 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf8fff000, 0xf8fff0ff, read64_delegate(FUNC(model3_state::mpc106_reg_r),this), write64_delegate(FUNC(model3_state::mpc106_reg_w),this)); | |
5638 | 5638 | } |
5639 | 5639 | |
5640 | 5640 | DRIVER_INIT_MEMBER(model3_state,bass) |
r18027 | r18028 | |
5645 | 5645 | rom[(0x7999c8^4)/4] = 0x60000000; |
5646 | 5646 | |
5647 | 5647 | interleave_vroms(machine()); |
5648 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5648 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xff000000, 0xff7fffff, "bank1" ); | |
5649 | 5649 | |
5650 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5650 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf9000000, 0xf90000ff, read64_delegate(FUNC(model3_state::scsi_r),this), write64_delegate(FUNC(model3_state::scsi_w),this)); | |
5651 | 5651 | |
5652 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0800cf8, 0xf0800cff, read64_delegate(FUNC(model3_state::mpc106_addr_r),this), write64_delegate(FUNC(model3_state::mpc106_addr_w),this)); | |
5653 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xfec00000, 0xfedfffff, read64_delegate(FUNC(model3_state::mpc106_addr_r),this), write64_delegate(FUNC(model3_state::mpc106_addr_w),this)); | |
5654 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0c00cf8, 0xf0c00cff, read64_delegate(FUNC(model3_state::mpc106_data_r),this), write64_delegate(FUNC(model3_state::mpc106_data_w),this)); | |
5655 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xfee00000, 0xfeffffff, read64_delegate(FUNC(model3_state::mpc106_data_r),this), write64_delegate(FUNC(model3_state::mpc106_data_w),this)); | |
5656 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf8fff000, 0xf8fff0ff, read64_delegate(FUNC(model3_state::mpc106_reg_r),this), write64_delegate(FUNC(model3_state::mpc106_reg_w),this)); | |
5652 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf0800cf8, 0xf0800cff, read64_delegate(FUNC(model3_state::mpc106_addr_r),this), write64_delegate(FUNC(model3_state::mpc106_addr_w),this)); | |
5653 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xfec00000, 0xfedfffff, read64_delegate(FUNC(model3_state::mpc106_addr_r),this), write64_delegate(FUNC(model3_state::mpc106_addr_w),this)); | |
5654 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf0c00cf8, 0xf0c00cff, read64_delegate(FUNC(model3_state::mpc106_data_r),this), write64_delegate(FUNC(model3_state::mpc106_data_w),this)); | |
5655 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xfee00000, 0xfeffffff, read64_delegate(FUNC(model3_state::mpc106_data_r),this), write64_delegate(FUNC(model3_state::mpc106_data_w),this)); | |
5656 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf8fff000, 0xf8fff0ff, read64_delegate(FUNC(model3_state::mpc106_reg_r),this), write64_delegate(FUNC(model3_state::mpc106_reg_w),this)); | |
5657 | 5657 | } |
5658 | 5658 | |
5659 | 5659 | DRIVER_INIT_MEMBER(model3_state,getbass) |
5660 | 5660 | { |
5661 | 5661 | interleave_vroms(machine()); |
5662 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5662 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xff000000, 0xff7fffff, "bank1" ); | |
5663 | 5663 | |
5664 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5664 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf9000000, 0xf90000ff, read64_delegate(FUNC(model3_state::scsi_r),this), write64_delegate(FUNC(model3_state::scsi_w),this)); | |
5665 | 5665 | |
5666 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0800cf8, 0xf0800cff, read64_delegate(FUNC(model3_state::mpc105_addr_r),this), write64_delegate(FUNC(model3_state::mpc105_addr_w),this)); | |
5667 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0c00cf8, 0xf0c00cff, read64_delegate(FUNC(model3_state::mpc105_data_r),this), write64_delegate(FUNC(model3_state::mpc105_data_w),this)); | |
5668 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf8fff000, 0xf8fff0ff, read64_delegate(FUNC(model3_state::mpc105_reg_r),this), write64_delegate(FUNC(model3_state::mpc105_reg_w),this)); | |
5666 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf0800cf8, 0xf0800cff, read64_delegate(FUNC(model3_state::mpc105_addr_r),this), write64_delegate(FUNC(model3_state::mpc105_addr_w),this)); | |
5667 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf0c00cf8, 0xf0c00cff, read64_delegate(FUNC(model3_state::mpc105_data_r),this), write64_delegate(FUNC(model3_state::mpc105_data_w),this)); | |
5668 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xf8fff000, 0xf8fff0ff, read64_delegate(FUNC(model3_state::mpc105_reg_r),this), write64_delegate(FUNC(model3_state::mpc105_reg_w),this)); | |
5669 | 5669 | } |
5670 | 5670 | |
5671 | 5671 | DRIVER_INIT_MEMBER(model3_state,vs2) |
r18027 | r18028 | |
5735 | 5735 | DRIVER_INIT_CALL(model3_20); |
5736 | 5736 | |
5737 | 5737 | m_network_ram = auto_alloc_array_clear(machine(), UINT64, 0x10000); |
5738 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5738 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xc0000000, 0xc00fffff, read64_delegate(FUNC(model3_state::network_r),this), write64_delegate(FUNC(model3_state::network_w),this)); | |
5739 | 5739 | |
5740 | 5740 | rom[(0x50ecb4^4)/4] = 0x60000000; |
5741 | 5741 | rom[(0x50ecd4^4)/4] = 0x60000000; |
r18027 | r18028 | |
5750 | 5750 | DRIVER_INIT_CALL(model3_20); |
5751 | 5751 | |
5752 | 5752 | m_network_ram = auto_alloc_array_clear(machine(), UINT64, 0x10000); |
5753 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
5753 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xc0000000, 0xc00fffff, read64_delegate(FUNC(model3_state::network_r),this), write64_delegate(FUNC(model3_state::network_w),this)); | |
5754 | 5754 | |
5755 | 5755 | rom[(0x50e8d4^4)/4] = 0x60000000; |
5756 | 5756 | rom[(0x50e8f4^4)/4] = 0x60000000; |
r18027 | r18028 | |
5819 | 5819 | UINT32 *rom = (UINT32*)memregion("user1")->base(); |
5820 | 5820 | DRIVER_INIT_CALL(model3_20); |
5821 | 5821 | |
5822 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xc3800000, 0xc3800007, write64_delegate(FUNC(model3_state::daytona2_rombank_w),this)); | |
5823 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xc3000000, 0xc37fffff, "bank2" ); | |
5822 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xc3800000, 0xc3800007, write64_delegate(FUNC(model3_state::daytona2_rombank_w),this)); | |
5823 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xc3000000, 0xc37fffff, "bank2" ); | |
5824 | 5824 | |
5825 | 5825 | //rom[(0x68468c^4)/4] = 0x60000000; |
5826 | 5826 | rom[(0x6063c4^4)/4] = 0x60000000; |
r18027 | r18028 | |
5833 | 5833 | UINT32 *rom = (UINT32*)memregion("user1")->base(); |
5834 | 5834 | DRIVER_INIT_CALL(model3_20); |
5835 | 5835 | |
5836 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xc3800000, 0xc3800007, write64_delegate(FUNC(model3_state::daytona2_rombank_w),this)); | |
5837 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xc3000000, 0xc37fffff, "bank2" ); | |
5836 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xc3800000, 0xc3800007, write64_delegate(FUNC(model3_state::daytona2_rombank_w),this)); | |
5837 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xc3000000, 0xc37fffff, "bank2" ); | |
5838 | 5838 | |
5839 | 5839 | rom[(0x606784^4)/4] = 0x60000000; |
5840 | 5840 | rom[(0x69a3fc^4)/4] = 0x60000000; // jump to encrypted code |
r18027 | r18028 | |
---|---|---|
443 | 443 | m_generic_paletteram2_8.set_target(rom + 0x12800, 0x800); |
444 | 444 | m_fgvideoram = rom + 0x16800; |
445 | 445 | m_bgvideoram = rom + 0x17000; |
446 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
446 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xfe26, 0xfe26, write8_delegate(FUNC(iqblock_state::iqblock_prot_w),this)); | |
447 | 447 | m_video_type=1; |
448 | 448 | } |
449 | 449 | |
r18027 | r18028 | |
465 | 465 | m_generic_paletteram2_8.set_target(rom + 0x12800, 0x800); |
466 | 466 | m_fgvideoram = rom + 0x16800; |
467 | 467 | m_bgvideoram = rom + 0x17000; |
468 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
468 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xfe39, 0xfe39, write8_delegate(FUNC(iqblock_state::grndtour_prot_w),this)); | |
469 | 469 | m_video_type=0; |
470 | 470 | } |
471 | 471 |
r18027 | r18028 | |
---|---|---|
436 | 436 | READ8_MEMBER(ironhors_state::farwest_soundlatch_r) |
437 | 437 | { |
438 | 438 | |
439 | return soundlatch_byte_r( | |
439 | return soundlatch_byte_r(m_soundcpu->space(AS_PROGRAM), 0); | |
440 | 440 | } |
441 | 441 | |
442 | 442 | static const ym2203_interface farwest_ym2203_config = |
r18027 | r18028 | |
---|---|---|
723 | 723 | |
724 | 724 | state->m_0xc0000000_ram_decrypted = auto_alloc_array(machine, UINT32, 0x400/4); |
725 | 725 | |
726 | address_space *main = machine.device<sh2_device>("maincpu")->space(AS_PROGRAM); | |
727 | main->set_direct_update_handler(direct_update_delegate(FUNC(cps3_state::cps3_direct_handler), state)); | |
726 | address_space &main = machine.device<sh2_device>("maincpu")->space(AS_PROGRAM); | |
727 | main.set_direct_update_handler(direct_update_delegate(FUNC(cps3_state::cps3_direct_handler), state)); | |
728 | 728 | |
729 | 729 | // flash roms |
730 | 730 | astring tempstr; |
r18027 | r18028 | |
---|---|---|
412 | 412 | glass_ROM16_split_gfx(machine(), "gfx2", "gfx1", 0x0200000, 0x0200000, 0x0200000, 0x0300000); |
413 | 413 | |
414 | 414 | /* install custom handler over RAM for protection */ |
415 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
415 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xfec000, 0xfeffff, read16_delegate(FUNC(glass_state::glass_mainram_r), this), write16_delegate(FUNC(glass_state::glass_mainram_w),this)); | |
416 | 416 | |
417 | 417 | } |
418 | 418 |
r18027 | r18028 | |
---|---|---|
722 | 722 | |
723 | 723 | DRIVER_INIT_MEMBER( jchan_state, jchan ) |
724 | 724 | { |
725 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x403ffe, 0x403fff, write16_delegate(FUNC(jchan_state::main2sub_cmd_w),this)); | |
726 | machine().device("sub")->memory().space(AS_PROGRAM)->install_write_handler(0x400000, 0x400001, write16_delegate(FUNC(jchan_state::sub2main_cmd_w),this)); | |
725 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x403ffe, 0x403fff, write16_delegate(FUNC(jchan_state::main2sub_cmd_w),this)); | |
726 | machine().device("sub")->memory().space(AS_PROGRAM).install_write_handler(0x400000, 0x400001, write16_delegate(FUNC(jchan_state::sub2main_cmd_w),this)); | |
727 | 727 | } |
728 | 728 | |
729 | 729 |
r18027 | r18028 | |
---|---|---|
1403 | 1403 | for (which = 0; which < 4; which++) |
1404 | 1404 | if (state->m_galileo.dma_stalled_on_voodoo[which]) |
1405 | 1405 | { |
1406 | address_space &space = | |
1406 | address_space &space = device->machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1407 | 1407 | if (LOG_DMA) logerror("Resuming DMA%d on voodoo\n", which); |
1408 | 1408 | |
1409 | 1409 | /* mark this DMA as no longer stalled */ |
r18027 | r18028 | |
1420 | 1420 | /* if the CPU had a pending write, do it now */ |
1421 | 1421 | if (state->m_cpu_stalled_on_voodoo) |
1422 | 1422 | { |
1423 | address_space &space = | |
1423 | address_space &space = device->machine().firstcpu->space(AS_PROGRAM); | |
1424 | 1424 | voodoo_w(device, space, state->m_cpu_stalled_offset, state->m_cpu_stalled_data, state->m_cpu_stalled_mem_mask); |
1425 | 1425 | } |
1426 | 1426 | state->m_cpu_stalled_on_voodoo = FALSE; |
r18027 | r18028 | |
1588 | 1588 | break; |
1589 | 1589 | |
1590 | 1590 | case WREG_ANALOG: |
1591 | result = analog_port_r( | |
1591 | result = analog_port_r(machine().device("maincpu")->memory().space(AS_PROGRAM), 0, mem_mask); | |
1592 | 1592 | break; |
1593 | 1593 | |
1594 | 1594 | case WREG_ETHER_DATA: |
r18027 | r18028 | |
1620 | 1620 | break; |
1621 | 1621 | |
1622 | 1622 | case WREG_ANALOG: |
1623 | analog_port_w( | |
1623 | analog_port_w(machine().device("maincpu")->memory().space(AS_PROGRAM), 0, data, mem_mask); | |
1624 | 1624 | break; |
1625 | 1625 | |
1626 | 1626 | case WREG_ETHER_DATA: |
r18027 | r18028 | |
2873 | 2873 | { |
2874 | 2874 | case PHOENIX_CONFIG: |
2875 | 2875 | /* original Phoenix board only has 4MB of RAM */ |
2876 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
2876 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_readwrite(0x00400000, 0x007fffff); | |
2877 | 2877 | break; |
2878 | 2878 | |
2879 | 2879 | case SEATTLE_WIDGET_CONFIG: |
2880 | 2880 | /* set up the widget board */ |
2881 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
2881 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x16c00000, 0x16c0001f, read32_delegate(FUNC(seattle_state::widget_r),state), write32_delegate(FUNC(seattle_state::widget_w),state)); | |
2882 | 2882 | break; |
2883 | 2883 | |
2884 | 2884 | case FLAGSTAFF_CONFIG: |
2885 | 2885 | /* set up the analog inputs */ |
2886 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
2886 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x14000000, 0x14000003, read32_delegate(FUNC(seattle_state::analog_port_r),state), write32_delegate(FUNC(seattle_state::analog_port_w),state)); | |
2887 | 2887 | |
2888 | 2888 | /* set up the ethernet controller */ |
2889 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
2889 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x16c00000, 0x16c0003f, read32_delegate(FUNC(seattle_state::ethernet_r),state), write32_delegate(FUNC(seattle_state::ethernet_w),state)); | |
2890 | 2890 | break; |
2891 | 2891 | } |
2892 | 2892 | } |
r18027 | r18028 | |
3014 | 3014 | init_common(machine(), MIDWAY_IOASIC_CARNEVIL, 469/* 469 or 486 or 528 */, 80, SEATTLE_CONFIG); |
3015 | 3015 | |
3016 | 3016 | /* set up the gun */ |
3017 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
3017 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x16800000, 0x1680001f, read32_delegate(FUNC(seattle_state::carnevil_gun_r),this), write32_delegate(FUNC(seattle_state::carnevil_gun_w),this)); | |
3018 | 3018 | |
3019 | 3019 | /* speedups */ |
3020 | 3020 | mips3drc_add_hotspot(machine().device("maincpu"), 0x8015176C, 0x3C03801A, 250); /* confirmed */ |
r18027 | r18028 | |
---|---|---|
3151 | 3151 | |
3152 | 3152 | DRIVER_INIT_MEMBER(alpha68k_state,jongbou) |
3153 | 3153 | { |
3154 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
3154 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0c0000, 0x0c0001, read16_delegate(FUNC(alpha68k_state::jongbou_inputs_r),this)); | |
3155 | 3155 | m_invert_controls = 0; |
3156 | 3156 | m_microcontroller_id = 0x00ff; |
3157 | 3157 | m_coin_id = 0x23 | (0x24 << 8); |
r18027 | r18028 | |
---|---|---|
225 | 225 | tmaster_state *state = device->machine().driver_data<tmaster_state>(); |
226 | 226 | if ( channel == 0 ) |
227 | 227 | { |
228 | state->m_microtouch->rx( | |
228 | state->m_microtouch->rx(device->machine().driver_data()->generic_space(), 0, data); | |
229 | 229 | } |
230 | 230 | }; |
231 | 231 |
r18027 | r18028 | |
---|---|---|
190 | 190 | { |
191 | 191 | /* only the first part is decrypted (and verified)*/ |
192 | 192 | |
193 | address_space &space = | |
193 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
194 | 194 | UINT8 *dest = machine().root_device().memregion("maincpu")->base(); |
195 | 195 | int len = machine().root_device().memregion("maincpu")->bytes(); |
196 | 196 | UINT8 *src = auto_alloc_array(machine(), UINT8, len); |
r18027 | r18028 | |
---|---|---|
5444 | 5444 | { |
5445 | 5445 | namcos22_state *state = machine.driver_data<namcos22_state>(); |
5446 | 5446 | if (MCU_SPEEDUP) |
5447 | state->m_mcu->space(AS_PROGRAM) | |
5447 | state->m_mcu->space(AS_PROGRAM).install_readwrite_handler(0x80, 0x81, read16_delegate(FUNC(namcos22_state::mcuc74_speedup_r),state), write16_delegate(FUNC(namcos22_state::mcu_speedup_w),state)); | |
5448 | 5448 | } |
5449 | 5449 | |
5450 | 5450 | static void install_130_speedup(running_machine &machine) |
r18027 | r18028 | |
5452 | 5452 | namcos22_state *state = machine.driver_data<namcos22_state>(); |
5453 | 5453 | // install speedup cheat for 1.30 MCU BIOS |
5454 | 5454 | if (MCU_SPEEDUP) |
5455 | state->m_mcu->space(AS_PROGRAM) | |
5455 | state->m_mcu->space(AS_PROGRAM).install_readwrite_handler(0x82, 0x83, read16_delegate(FUNC(namcos22_state::mcu130_speedup_r),state), write16_delegate(FUNC(namcos22_state::mcu_speedup_w),state)); | |
5456 | 5456 | } |
5457 | 5457 | |
5458 | 5458 | static void install_141_speedup(running_machine &machine) |
r18027 | r18028 | |
5460 | 5460 | namcos22_state *state = machine.driver_data<namcos22_state>(); |
5461 | 5461 | // install speedup cheat for 1.41 MCU BIOS |
5462 | 5462 | if (MCU_SPEEDUP) |
5463 | state->m_mcu->space(AS_PROGRAM) | |
5463 | state->m_mcu->space(AS_PROGRAM).install_readwrite_handler(0x82, 0x83, read16_delegate(FUNC(namcos22_state::mcu141_speedup_r),state), write16_delegate(FUNC(namcos22_state::mcu_speedup_w),state)); | |
5464 | 5464 | } |
5465 | 5465 | |
5466 | 5466 | static void namcos22_init( running_machine &machine, int game_type ) |
r18027 | r18028 | |
5483 | 5483 | namcos22_state *state = machine.driver_data<namcos22_state>(); |
5484 | 5484 | namcos22_init(machine, game_type); |
5485 | 5485 | |
5486 | state->m_mcu->space(AS_IO)->install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::alpineracer_mcu_adc_r),state)); | |
5487 | state->m_mcu->space(AS_IO)->install_write_handler(M37710_PORT5, M37710_PORT5, write8_delegate(FUNC(namcos22_state::alpine_mcu_port5_w),state)); | |
5486 | state->m_mcu->space(AS_IO).install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::alpineracer_mcu_adc_r),state)); | |
5487 | state->m_mcu->space(AS_IO).install_write_handler(M37710_PORT5, M37710_PORT5, write8_delegate(FUNC(namcos22_state::alpine_mcu_port5_w),state)); | |
5488 | 5488 | |
5489 | 5489 | state->m_motor_timer = machine.scheduler().timer_alloc(FUNC(alpine_steplock_callback)); |
5490 | 5490 | state->m_motor_timer->reset(); |
r18027 | r18028 | |
5513 | 5513 | { |
5514 | 5514 | alpine_init_common(machine(), NAMCOS22_ALPINE_SURFER); |
5515 | 5515 | |
5516 | m_maincpu->space(AS_PROGRAM)->install_read_handler (0x200000, 0x200003, read32_delegate(FUNC(namcos22_state::alpinesa_prot_r),this)); | |
5517 | m_maincpu->space(AS_PROGRAM)->install_write_handler(0x300000, 0x300003, write32_delegate(FUNC(namcos22_state::alpinesa_prot_w),this)); | |
5516 | m_maincpu->space(AS_PROGRAM).install_read_handler (0x200000, 0x200003, read32_delegate(FUNC(namcos22_state::alpinesa_prot_r),this)); | |
5517 | m_maincpu->space(AS_PROGRAM).install_write_handler(0x300000, 0x300003, write32_delegate(FUNC(namcos22_state::alpinesa_prot_w),this)); | |
5518 | 5518 | install_141_speedup(machine()); |
5519 | 5519 | |
5520 | 5520 | m_keycus_id = 0x01a9; |
r18027 | r18028 | |
5525 | 5525 | namcos22_init(machine(), NAMCOS22_AIR_COMBAT22); |
5526 | 5526 | |
5527 | 5527 | // S22-BIOS ver1.20 namco all rights reserved 94/12/21 |
5528 | m_mcu->space(AS_IO) | |
5528 | m_mcu->space(AS_IO).install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::airco22_mcu_adc_r),this)); | |
5529 | 5529 | } |
5530 | 5530 | |
5531 | 5531 | DRIVER_INIT_MEMBER(namcos22_state,propcycl) |
r18027 | r18028 | |
5548 | 5548 | // pROM[0x22296/4] |= 0x00004e75; |
5549 | 5549 | |
5550 | 5550 | namcos22_init(machine(), NAMCOS22_PROP_CYCLE); |
5551 | m_mcu->space(AS_IO)->install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::propcycle_mcu_adc_r),this)); | |
5552 | m_mcu->space(AS_IO)->install_write_handler(M37710_PORT5, M37710_PORT5, write8_delegate(FUNC(namcos22_state::propcycle_mcu_port5_w),this)); | |
5551 | m_mcu->space(AS_IO).install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::propcycle_mcu_adc_r),this)); | |
5552 | m_mcu->space(AS_IO).install_write_handler(M37710_PORT5, M37710_PORT5, write8_delegate(FUNC(namcos22_state::propcycle_mcu_port5_w),this)); | |
5553 | 5553 | install_141_speedup(machine()); |
5554 | 5554 | } |
5555 | 5555 | |
r18027 | r18028 | |
5609 | 5609 | { |
5610 | 5610 | namcos22_init(machine(), NAMCOS22_CYBER_CYCLES); |
5611 | 5611 | |
5612 | m_mcu->space(AS_IO) | |
5612 | m_mcu->space(AS_IO).install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::cybrcycc_mcu_adc_r),this)); | |
5613 | 5613 | install_130_speedup(machine()); |
5614 | 5614 | |
5615 | 5615 | m_keycus_id = 0x0387; |
r18027 | r18028 | |
5626 | 5626 | { |
5627 | 5627 | namcos22_init(machine(), NAMCOS22_TOKYO_WARS); |
5628 | 5628 | |
5629 | m_mcu->space(AS_IO) | |
5629 | m_mcu->space(AS_IO).install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::tokyowar_mcu_adc_r),this)); | |
5630 | 5630 | install_141_speedup(machine()); |
5631 | 5631 | |
5632 | 5632 | m_keycus_id = 0x01a8; |
r18027 | r18028 | |
5635 | 5635 | DRIVER_INIT_MEMBER(namcos22_state,aquajet) |
5636 | 5636 | { |
5637 | 5637 | namcos22_init(machine(), NAMCOS22_AQUA_JET); |
5638 | m_mcu->space(AS_IO) | |
5638 | m_mcu->space(AS_IO).install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::aquajet_mcu_adc_r),this)); | |
5639 | 5639 | install_141_speedup(machine()); |
5640 | 5640 | } |
5641 | 5641 | |
r18027 | r18028 | |
5643 | 5643 | { |
5644 | 5644 | namcos22_init(machine(), NAMCOS22_DIRT_DASH); |
5645 | 5645 | |
5646 | m_mcu->space(AS_IO) | |
5646 | m_mcu->space(AS_IO).install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::cybrcycc_mcu_adc_r),this)); | |
5647 | 5647 | install_141_speedup(machine()); |
5648 | 5648 | |
5649 | 5649 | m_keycus_id = 0x01a2; |
r18027 | r18028 | |
---|---|---|
479 | 479 | |
480 | 480 | void pturn_state::machine_reset() |
481 | 481 | { |
482 | address_space &space = | |
482 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
483 | 483 | soundlatch_clear_byte_w(space,0,0); |
484 | 484 | } |
485 | 485 | |
r18027 | r18028 | |
555 | 555 | DRIVER_INIT_MEMBER(pturn_state,pturn) |
556 | 556 | { |
557 | 557 | /* |
558 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc0dd, 0xc0dd, FUNC(pturn_protection_r)); | |
559 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc0db, 0xc0db, FUNC(pturn_protection2_r)); | |
558 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xc0dd, 0xc0dd, FUNC(pturn_protection_r)); | |
559 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xc0db, 0xc0db, FUNC(pturn_protection2_r)); | |
560 | 560 | */ |
561 | 561 | } |
562 | 562 |
r18027 | r18028 | |
---|---|---|
422 | 422 | void slyspy_set_protection_map(running_machine& machine, int type) |
423 | 423 | { |
424 | 424 | dec0_state *state = machine.driver_data<dec0_state>(); |
425 | address_space& space = | |
425 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
426 | 426 | |
427 | 427 | deco_bac06_device *tilegen1 = (deco_bac06_device*)state->m_tilegen1; |
428 | 428 | deco_bac06_device *tilegen2 = (deco_bac06_device*)state->m_tilegen2; |
r18027 | r18028 | |
3043 | 3043 | |
3044 | 3044 | DRIVER_INIT_MEMBER(dec0_state,midresb) |
3045 | 3045 | { |
3046 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x00180000, 0x0018000f, read16_delegate(FUNC(dec0_state::dec0_controls_r),this)); | |
3047 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x001a0000, 0x001a000f, read16_delegate(FUNC(dec0_state::dec0_rotary_r),this)); | |
3046 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00180000, 0x0018000f, read16_delegate(FUNC(dec0_state::dec0_controls_r),this)); | |
3047 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x001a0000, 0x001a000f, read16_delegate(FUNC(dec0_state::dec0_rotary_r),this)); | |
3048 | 3048 | |
3049 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
3049 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x00180014, 0x00180015, write16_delegate(FUNC(dec0_state::midres_sound_w),this)); | |
3050 | 3050 | } |
3051 | 3051 | |
3052 | 3052 | /******************************************************************************/ |
r18027 | r18028 | |
---|---|---|
786 | 786 | |
787 | 787 | m_playfield_base = 0x400; |
788 | 788 | |
789 | address_space *main = machine().device<m68000_device>("maincpu")->space(AS_PROGRAM); | |
790 | m_sloop_base = main->install_readwrite_handler(0x000000, 0x07ffff, read16_delegate(FUNC(atarig42_state::roadriot_sloop_data_r),this), write16_delegate(FUNC(atarig42_state::roadriot_sloop_data_w),this)); | |
791 | main->set_direct_update_handler(direct_update_delegate(FUNC(atarig42_state::atarig42_sloop_direct_handler), this)); | |
789 | address_space &main = machine().device<m68000_device>("maincpu")->space(AS_PROGRAM); | |
790 | m_sloop_base = main.install_readwrite_handler(0x000000, 0x07ffff, read16_delegate(FUNC(atarig42_state::roadriot_sloop_data_r),this), write16_delegate(FUNC(atarig42_state::roadriot_sloop_data_w),this)); | |
791 | main.set_direct_update_handler(direct_update_delegate(FUNC(atarig42_state::atarig42_sloop_direct_handler), this)); | |
792 | 792 | |
793 | 793 | asic65_config(machine(), ASIC65_ROMBASED); |
794 | 794 | /* |
r18027 | r18028 | |
824 | 824 | /* put an RTS there so we don't die */ |
825 | 825 | *(UINT16 *)&memregion("maincpu")->base()[0x80000] = 0x4E75; |
826 | 826 | |
827 | address_space *main = machine().device<m68000_device>("maincpu")->space(AS_PROGRAM); | |
828 | m_sloop_base = main->install_readwrite_handler(0x000000, 0x07ffff, read16_delegate(FUNC(atarig42_state::guardians_sloop_data_r),this), write16_delegate(FUNC(atarig42_state::guardians_sloop_data_w),this)); | |
829 | main->set_direct_update_handler(direct_update_delegate(FUNC(atarig42_state::atarig42_sloop_direct_handler), this)); | |
827 | address_space &main = machine().device<m68000_device>("maincpu")->space(AS_PROGRAM); | |
828 | m_sloop_base = main.install_readwrite_handler(0x000000, 0x07ffff, read16_delegate(FUNC(atarig42_state::guardians_sloop_data_r),this), write16_delegate(FUNC(atarig42_state::guardians_sloop_data_w),this)); | |
829 | main.set_direct_update_handler(direct_update_delegate(FUNC(atarig42_state::atarig42_sloop_direct_handler), this)); | |
830 | 830 | |
831 | 831 | asic65_config(machine(), ASIC65_GUARDIANS); |
832 | 832 | /* |
r18027 | r18028 | |
---|---|---|
1725 | 1725 | m_adc_shift = 24; |
1726 | 1726 | |
1727 | 1727 | /* speedups */ |
1728 | m_generic_speedup = machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1728 | m_generic_speedup = machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(speedup, speedup + 1, read32_delegate(FUNC(midvunit_state::generic_speedup_r),this)); | |
1729 | 1729 | } |
1730 | 1730 | DRIVER_INIT_MEMBER(midvunit_state,crusnusa) { init_crusnusa_common(0xc93e); } |
1731 | 1731 | DRIVER_INIT_MEMBER(midvunit_state,crusnu40) { init_crusnusa_common(0xc957); } |
r18027 | r18028 | |
1738 | 1738 | m_adc_shift = 16; |
1739 | 1739 | |
1740 | 1740 | /* control register is different */ |
1741 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1741 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x994000, 0x994000, write32_delegate(FUNC(midvunit_state::crusnwld_control_w),this)); | |
1742 | 1742 | |
1743 | 1743 | /* valid values are 450 or 460 */ |
1744 | 1744 | midway_serial_pic_init(machine(), 450); |
1745 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x991030, 0x991030, read32_delegate(FUNC(midvunit_state::offroadc_serial_status_r),this)); | |
1746 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x996000, 0x996000, read32_delegate(FUNC(midvunit_state::offroadc_serial_data_r),this)); | |
1747 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x996000, 0x996000, write32_delegate(FUNC(midvunit_state::offroadc_serial_data_w),this)); | |
1745 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x991030, 0x991030, read32_delegate(FUNC(midvunit_state::offroadc_serial_status_r),this)); | |
1746 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x996000, 0x996000, read32_delegate(FUNC(midvunit_state::offroadc_serial_data_r),this)); | |
1747 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x996000, 0x996000, write32_delegate(FUNC(midvunit_state::offroadc_serial_data_w),this)); | |
1748 | 1748 | |
1749 | 1749 | /* install strange protection device */ |
1750 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x9d0000, 0x9d1fff, read32_delegate(FUNC(midvunit_state::bit_data_r),this)); | |
1751 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x9d0000, 0x9d0000, write32_delegate(FUNC(midvunit_state::bit_reset_w),this)); | |
1750 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x9d0000, 0x9d1fff, read32_delegate(FUNC(midvunit_state::bit_data_r),this)); | |
1751 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x9d0000, 0x9d0000, write32_delegate(FUNC(midvunit_state::bit_reset_w),this)); | |
1752 | 1752 | |
1753 | 1753 | /* speedups */ |
1754 | 1754 | if (speedup) |
1755 | m_generic_speedup = machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1755 | m_generic_speedup = machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(speedup, speedup + 1, read32_delegate(FUNC(midvunit_state::generic_speedup_r),this)); | |
1756 | 1756 | } |
1757 | 1757 | DRIVER_INIT_MEMBER(midvunit_state,crusnwld) { init_crusnwld_common(0xd4c0); } |
1758 | 1758 | #if 0 |
r18027 | r18028 | |
1766 | 1766 | m_adc_shift = 16; |
1767 | 1767 | |
1768 | 1768 | /* control register is different */ |
1769 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1769 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x994000, 0x994000, write32_delegate(FUNC(midvunit_state::crusnwld_control_w),this)); | |
1770 | 1770 | |
1771 | 1771 | /* valid values are 230 or 234 */ |
1772 | 1772 | midway_serial_pic2_init(machine(), 230, 94); |
1773 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x991030, 0x991030, read32_delegate(FUNC(midvunit_state::offroadc_serial_status_r),this)); | |
1774 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x996000, 0x996000, read32_delegate(FUNC(midvunit_state::offroadc_serial_data_r),this), write32_delegate(FUNC(midvunit_state::offroadc_serial_data_w),this)); | |
1773 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x991030, 0x991030, read32_delegate(FUNC(midvunit_state::offroadc_serial_status_r),this)); | |
1774 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x996000, 0x996000, read32_delegate(FUNC(midvunit_state::offroadc_serial_data_r),this), write32_delegate(FUNC(midvunit_state::offroadc_serial_data_w),this)); | |
1775 | 1775 | |
1776 | 1776 | /* speedups */ |
1777 | m_generic_speedup = machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1777 | m_generic_speedup = machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x195aa, 0x195aa, read32_delegate(FUNC(midvunit_state::generic_speedup_r),this)); | |
1778 | 1778 | } |
1779 | 1779 | |
1780 | 1780 | |
r18027 | r18028 | |
1799 | 1799 | midway_serial_pic2_set_default_nvram(default_nvram); |
1800 | 1800 | |
1801 | 1801 | /* speedups */ |
1802 | m_generic_speedup = machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1802 | m_generic_speedup = machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x2f4c, 0x2f4c, read32_delegate(FUNC(midvunit_state::generic_speedup_r),this)); | |
1803 | 1803 | } |
1804 | 1804 | |
1805 | 1805 |
r18027 | r18028 | |
---|---|---|
244 | 244 | DRIVER_INIT_MEMBER(pangofun_state,pangofun) |
245 | 245 | { |
246 | 246 | pc_vga_init(machine(), vga_setting, NULL); |
247 | pc_vga_io_init(machine(), | |
247 | pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); | |
248 | 248 | } |
249 | 249 | |
250 | 250 | GAME( 1995, pangofun, 0, pangofun, pangofun, pangofun_state, pangofun, ROT0, "InfoCube", "Pango Fun (Italy)", GAME_NOT_WORKING|GAME_NO_SOUND ) |
r18027 | r18028 | |
---|---|---|
361 | 361 | |
362 | 362 | MACHINE_RESET_MEMBER(suna16_state,uballoon) |
363 | 363 | { |
364 | address_space &space = | |
364 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
365 | 365 | uballoon_pcm_1_bankswitch_w(space, 0, 0); |
366 | 366 | } |
367 | 367 |
r18027 | r18028 | |
---|---|---|
2220 | 2220 | if(!out2) out2 = lamp_output2_w, out2name = "lamp_output2_w"; |
2221 | 2221 | if(!out3) out3 = lamp_output3_w, out3name = "lamp_output3_w"; |
2222 | 2222 | |
2223 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x7d000804, 0x7d000807, out1, out1name); | |
2224 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x7d000320, 0x7d000323, out2, out2name); | |
2225 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x7d000324, 0x7d000327, out3, out3name); | |
2223 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x7d000804, 0x7d000807, out1, out1name); | |
2224 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x7d000320, 0x7d000323, out2, out2name); | |
2225 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x7d000324, 0x7d000327, out3, out3name); | |
2226 | 2226 | } |
2227 | 2227 | |
2228 | 2228 | static void init_firebeat(running_machine &machine) |
r18027 | r18028 | |
---|---|---|
932 | 932 | |
933 | 933 | /* Unmap video enable register, not available on earlier hardware revision(s) |
934 | 934 | Bagman is supposed to have glitches during screen transitions */ |
935 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
935 | machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xa003, 0xa003); | |
936 | 936 | *m_video_enable = 1; |
937 | 937 | } |
938 | 938 |
r18027 | r18028 | |
---|---|---|
581 | 581 | |
582 | 582 | void ghosteo_state::machine_reset() |
583 | 583 | { |
584 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
584 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x4d000010, 0x4d000013,read32_delegate(FUNC(ghosteo_state::bballoon_speedup_r), this)); | |
585 | 585 | s3c2410 = machine().device("s3c2410"); |
586 | 586 | } |
587 | 587 |
r18027 | r18028 | |
---|---|---|
567 | 567 | static TIMER_CALLBACK( delayed_i8255_w ) |
568 | 568 | { |
569 | 569 | turbo_state *state = machine.driver_data<turbo_state>(); |
570 | state->m_i8255_0->write( | |
570 | state->m_i8255_0->write(state->m_maincpu->space(AS_PROGRAM), param >> 8, param & 0xff); | |
571 | 571 | } |
572 | 572 | |
573 | 573 |
r18027 | r18028 | |
---|---|---|
738 | 738 | memset(m_dsp56k_bank04_ram, 0, sizeof(m_dsp56k_bank04_ram)); |
739 | 739 | |
740 | 740 | /* The dsp56k occasionally executes out of mapped memory */ |
741 | address_space &space = | |
741 | address_space &space = machine().device<dsp56k_device>("dsp")->space(AS_PROGRAM); | |
742 | 742 | m_dsp56k_update_handler = space.set_direct_update_handler(direct_update_delegate(FUNC(polygonet_state::plygonet_dsp56k_direct_handler), this)); |
743 | 743 | |
744 | 744 | /* save states */ |
r18027 | r18028 | |
---|---|---|
503 | 503 | DRIVER_INIT_MEMBER(progolf_state,progolf) |
504 | 504 | { |
505 | 505 | int A; |
506 | address_space &space = | |
506 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
507 | 507 | UINT8 *rom = machine().root_device().memregion("maincpu")->base(); |
508 | 508 | UINT8* decrypted = auto_alloc_array(machine(), UINT8, 0x10000); |
509 | 509 | |
r18027 | r18028 | |
517 | 517 | DRIVER_INIT_MEMBER(progolf_state,progolfa) |
518 | 518 | { |
519 | 519 | int A; |
520 | address_space &space = | |
520 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
521 | 521 | UINT8 *rom = machine().root_device().memregion("maincpu")->base(); |
522 | 522 | UINT8* decrypted = auto_alloc_array(machine(), UINT8, 0x10000); |
523 | 523 |
r18027 | r18028 | |
---|---|---|
202 | 202 | m_mainram[decrypt_offset(space, offset)] = data; |
203 | 203 | } |
204 | 204 | |
205 | WRITE8_MEMBER(segag80v_state::usb_ram_w){ sega_usb_ram_w(m_usb, space, decrypt_offset( | |
205 | WRITE8_MEMBER(segag80v_state::usb_ram_w){ sega_usb_ram_w(m_usb, space, decrypt_offset(machine().device("maincpu")->memory().space(AS_PROGRAM), offset), data); } | |
206 | 206 | WRITE8_MEMBER(segag80v_state::vectorram_w) |
207 | 207 | { |
208 | 208 | m_vectorram[decrypt_offset(space, offset)] = data; |
r18027 | r18028 | |
1287 | 1287 | |
1288 | 1288 | DRIVER_INIT_MEMBER(segag80v_state,elim2) |
1289 | 1289 | { |
1290 | address_space | |
1290 | address_space &iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1291 | 1291 | |
1292 | 1292 | /* configure security */ |
1293 | 1293 | m_decrypt = segag80_security(70); |
1294 | 1294 | |
1295 | 1295 | /* configure sound */ |
1296 | 1296 | m_usb = NULL; |
1297 | iospace->install_write_handler(0x3e, 0x3e, write8_delegate(FUNC(segag80v_state::elim1_sh_w),this)); | |
1298 | iospace->install_write_handler(0x3f, 0x3f, write8_delegate(FUNC(segag80v_state::elim2_sh_w),this)); | |
1297 | iospace.install_write_handler(0x3e, 0x3e, write8_delegate(FUNC(segag80v_state::elim1_sh_w),this)); | |
1298 | iospace.install_write_handler(0x3f, 0x3f, write8_delegate(FUNC(segag80v_state::elim2_sh_w),this)); | |
1299 | 1299 | } |
1300 | 1300 | |
1301 | 1301 | |
1302 | 1302 | DRIVER_INIT_MEMBER(segag80v_state,elim4) |
1303 | 1303 | { |
1304 | address_space | |
1304 | address_space &iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1305 | 1305 | |
1306 | 1306 | /* configure security */ |
1307 | 1307 | m_decrypt = segag80_security(76); |
1308 | 1308 | |
1309 | 1309 | /* configure sound */ |
1310 | 1310 | m_usb = NULL; |
1311 | iospace->install_write_handler(0x3e, 0x3e, write8_delegate(FUNC(segag80v_state::elim1_sh_w),this)); | |
1312 | iospace->install_write_handler(0x3f, 0x3f, write8_delegate(FUNC(segag80v_state::elim2_sh_w),this)); | |
1311 | iospace.install_write_handler(0x3e, 0x3e, write8_delegate(FUNC(segag80v_state::elim1_sh_w),this)); | |
1312 | iospace.install_write_handler(0x3f, 0x3f, write8_delegate(FUNC(segag80v_state::elim2_sh_w),this)); | |
1313 | 1313 | |
1314 | 1314 | /* configure inputs */ |
1315 | iospace->install_write_handler(0xf8, 0xf8, write8_delegate(FUNC(segag80v_state::spinner_select_w),this)); | |
1316 | iospace->install_read_handler(0xfc, 0xfc, read8_delegate(FUNC(segag80v_state::elim4_input_r),this)); | |
1315 | iospace.install_write_handler(0xf8, 0xf8, write8_delegate(FUNC(segag80v_state::spinner_select_w),this)); | |
1316 | iospace.install_read_handler(0xfc, 0xfc, read8_delegate(FUNC(segag80v_state::elim4_input_r),this)); | |
1317 | 1317 | } |
1318 | 1318 | |
1319 | 1319 | |
1320 | 1320 | DRIVER_INIT_MEMBER(segag80v_state,spacfury) |
1321 | 1321 | { |
1322 | address_space | |
1322 | address_space &iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1323 | 1323 | |
1324 | 1324 | /* configure security */ |
1325 | 1325 | m_decrypt = segag80_security(64); |
1326 | 1326 | |
1327 | 1327 | /* configure sound */ |
1328 | 1328 | m_usb = NULL; |
1329 | iospace->install_legacy_write_handler(*machine().device("segaspeech"), 0x38, 0x38, FUNC(sega_speech_data_w)); | |
1330 | iospace->install_legacy_write_handler(*machine().device("segaspeech"), 0x3b, 0x3b, FUNC(sega_speech_control_w)); | |
1331 | iospace->install_write_handler(0x3e, 0x3e, write8_delegate(FUNC(segag80v_state::spacfury1_sh_w),this)); | |
1332 | iospace->install_write_handler(0x3f, 0x3f, write8_delegate(FUNC(segag80v_state::spacfury2_sh_w),this)); | |
1329 | iospace.install_legacy_write_handler(*machine().device("segaspeech"), 0x38, 0x38, FUNC(sega_speech_data_w)); | |
1330 | iospace.install_legacy_write_handler(*machine().device("segaspeech"), 0x3b, 0x3b, FUNC(sega_speech_control_w)); | |
1331 | iospace.install_write_handler(0x3e, 0x3e, write8_delegate(FUNC(segag80v_state::spacfury1_sh_w),this)); | |
1332 | iospace.install_write_handler(0x3f, 0x3f, write8_delegate(FUNC(segag80v_state::spacfury2_sh_w),this)); | |
1333 | 1333 | } |
1334 | 1334 | |
1335 | 1335 | |
1336 | 1336 | DRIVER_INIT_MEMBER(segag80v_state,zektor) |
1337 | 1337 | { |
1338 | address_space | |
1338 | address_space &iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1339 | 1339 | device_t *ay = machine().device("aysnd"); |
1340 | 1340 | |
1341 | 1341 | /* configure security */ |
r18027 | r18028 | |
1343 | 1343 | |
1344 | 1344 | /* configure sound */ |
1345 | 1345 | m_usb = NULL; |
1346 | iospace->install_legacy_write_handler(*machine().device("segaspeech"), 0x38, 0x38, FUNC(sega_speech_data_w)); | |
1347 | iospace->install_legacy_write_handler(*machine().device("segaspeech"), 0x3b, 0x3b, FUNC(sega_speech_control_w)); | |
1348 | iospace->install_legacy_write_handler(*ay, 0x3c, 0x3d, FUNC(ay8910_address_data_w)); | |
1349 | iospace->install_write_handler(0x3e, 0x3e, write8_delegate(FUNC(segag80v_state::zektor1_sh_w),this)); | |
1350 | iospace->install_write_handler(0x3f, 0x3f, write8_delegate(FUNC(segag80v_state::zektor2_sh_w),this)); | |
1346 | iospace.install_legacy_write_handler(*machine().device("segaspeech"), 0x38, 0x38, FUNC(sega_speech_data_w)); | |
1347 | iospace.install_legacy_write_handler(*machine().device("segaspeech"), 0x3b, 0x3b, FUNC(sega_speech_control_w)); | |
1348 | iospace.install_legacy_write_handler(*ay, 0x3c, 0x3d, FUNC(ay8910_address_data_w)); | |
1349 | iospace.install_write_handler(0x3e, 0x3e, write8_delegate(FUNC(segag80v_state::zektor1_sh_w),this)); | |
1350 | iospace.install_write_handler(0x3f, 0x3f, write8_delegate(FUNC(segag80v_state::zektor2_sh_w),this)); | |
1351 | 1351 | |
1352 | 1352 | /* configure inputs */ |
1353 | iospace->install_write_handler(0xf8, 0xf8, write8_delegate(FUNC(segag80v_state::spinner_select_w),this)); | |
1354 | iospace->install_read_handler(0xfc, 0xfc, read8_delegate(FUNC(segag80v_state::spinner_input_r),this)); | |
1353 | iospace.install_write_handler(0xf8, 0xf8, write8_delegate(FUNC(segag80v_state::spinner_select_w),this)); | |
1354 | iospace.install_read_handler(0xfc, 0xfc, read8_delegate(FUNC(segag80v_state::spinner_input_r),this)); | |
1355 | 1355 | } |
1356 | 1356 | |
1357 | 1357 | |
1358 | 1358 | DRIVER_INIT_MEMBER(segag80v_state,tacscan) |
1359 | 1359 | { |
1360 | address_space *pgmspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1361 | address_space *iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1360 | address_space &pgmspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1361 | address_space &iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1362 | 1362 | |
1363 | 1363 | /* configure security */ |
1364 | 1364 | m_decrypt = segag80_security(76); |
1365 | 1365 | |
1366 | 1366 | /* configure sound */ |
1367 | 1367 | m_usb = machine().device("usbsnd"); |
1368 | iospace->install_legacy_readwrite_handler(*m_usb, 0x3f, 0x3f, FUNC(sega_usb_status_r), FUNC(sega_usb_data_w)); | |
1369 | pgmspace->install_legacy_read_handler(*m_usb, 0xd000, 0xdfff, FUNC(sega_usb_ram_r)); | |
1370 | pgmspace->install_write_handler(0xd000, 0xdfff, write8_delegate(FUNC(segag80v_state::usb_ram_w),this)); | |
1368 | iospace.install_legacy_readwrite_handler(*m_usb, 0x3f, 0x3f, FUNC(sega_usb_status_r), FUNC(sega_usb_data_w)); | |
1369 | pgmspace.install_legacy_read_handler(*m_usb, 0xd000, 0xdfff, FUNC(sega_usb_ram_r)); | |
1370 | pgmspace.install_write_handler(0xd000, 0xdfff, write8_delegate(FUNC(segag80v_state::usb_ram_w),this)); | |
1371 | 1371 | |
1372 | 1372 | /* configure inputs */ |
1373 | iospace->install_write_handler(0xf8, 0xf8, write8_delegate(FUNC(segag80v_state::spinner_select_w),this)); | |
1374 | iospace->install_read_handler(0xfc, 0xfc, read8_delegate(FUNC(segag80v_state::spinner_input_r),this)); | |
1373 | iospace.install_write_handler(0xf8, 0xf8, write8_delegate(FUNC(segag80v_state::spinner_select_w),this)); | |
1374 | iospace.install_read_handler(0xfc, 0xfc, read8_delegate(FUNC(segag80v_state::spinner_input_r),this)); | |
1375 | 1375 | } |
1376 | 1376 | |
1377 | 1377 | |
1378 | 1378 | DRIVER_INIT_MEMBER(segag80v_state,startrek) |
1379 | 1379 | { |
1380 | address_space *pgmspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1381 | address_space *iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1380 | address_space &pgmspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1381 | address_space &iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1382 | 1382 | |
1383 | 1383 | /* configure security */ |
1384 | 1384 | m_decrypt = segag80_security(64); |
1385 | 1385 | |
1386 | 1386 | /* configure sound */ |
1387 | 1387 | m_usb = machine().device("usbsnd"); |
1388 | iospace->install_legacy_write_handler(*machine().device("segaspeech"), 0x38, 0x38, FUNC(sega_speech_data_w)); | |
1389 | iospace->install_legacy_write_handler(*machine().device("segaspeech"), 0x3b, 0x3b, FUNC(sega_speech_control_w)); | |
1388 | iospace.install_legacy_write_handler(*machine().device("segaspeech"), 0x38, 0x38, FUNC(sega_speech_data_w)); | |
1389 | iospace.install_legacy_write_handler(*machine().device("segaspeech"), 0x3b, 0x3b, FUNC(sega_speech_control_w)); | |
1390 | 1390 | |
1391 | iospace->install_legacy_readwrite_handler(*m_usb, 0x3f, 0x3f, FUNC(sega_usb_status_r), FUNC(sega_usb_data_w)); | |
1392 | pgmspace->install_legacy_read_handler(*m_usb, 0xd000, 0xdfff, FUNC(sega_usb_ram_r)); | |
1393 | pgmspace->install_write_handler(0xd000, 0xdfff, write8_delegate(FUNC(segag80v_state::usb_ram_w),this)); | |
1391 | iospace.install_legacy_readwrite_handler(*m_usb, 0x3f, 0x3f, FUNC(sega_usb_status_r), FUNC(sega_usb_data_w)); | |
1392 | pgmspace.install_legacy_read_handler(*m_usb, 0xd000, 0xdfff, FUNC(sega_usb_ram_r)); | |
1393 | pgmspace.install_write_handler(0xd000, 0xdfff, write8_delegate(FUNC(segag80v_state::usb_ram_w),this)); | |
1394 | 1394 | |
1395 | 1395 | /* configure inputs */ |
1396 | iospace->install_write_handler(0xf8, 0xf8, write8_delegate(FUNC(segag80v_state::spinner_select_w),this)); | |
1397 | iospace->install_read_handler(0xfc, 0xfc, read8_delegate(FUNC(segag80v_state::spinner_input_r),this)); | |
1396 | iospace.install_write_handler(0xf8, 0xf8, write8_delegate(FUNC(segag80v_state::spinner_select_w),this)); | |
1397 | iospace.install_read_handler(0xfc, 0xfc, read8_delegate(FUNC(segag80v_state::spinner_input_r),this)); | |
1398 | 1398 | } |
1399 | 1399 | |
1400 | 1400 |
r18027 | r18028 | |
---|---|---|
421 | 421 | int bank = (data >> 5) & 3; |
422 | 422 | |
423 | 423 | /* this is accessed from I/O &space but modifies program &space, so we normalize here */ |
424 | address_space | |
424 | address_space &prog_space = space.device().memory().space(AS_PROGRAM); | |
425 | 425 | |
426 | 426 | /* remember the banking bits for save state support */ |
427 | 427 | m_profpac_bank = data; |
428 | 428 | |
429 | 429 | /* set the main banking */ |
430 | prog_space | |
430 | prog_space.install_read_bank(0x4000, 0xbfff, "bank1"); | |
431 | 431 | membank("bank1")->set_base(machine().root_device().memregion("user1")->base() + 0x8000 * bank); |
432 | 432 | |
433 | 433 | /* bank 0 reads video RAM in the 4000-7FFF range */ |
434 | 434 | if (bank == 0) |
435 | prog_space | |
435 | prog_space.install_read_handler(0x4000, 0x7fff, read8_delegate(FUNC(astrocde_state::profpac_videoram_r),this)); | |
436 | 436 | |
437 | 437 | /* if we have a 640k EPROM board, map that on top of the 4000-7FFF range if specified */ |
438 | 438 | if ((data & 0x80) && memregion("user2")->base() != NULL) |
r18027 | r18028 | |
443 | 443 | /* if the bank is in range, map the appropriate bank */ |
444 | 444 | if (bank < 0x28) |
445 | 445 | { |
446 | prog_space | |
446 | prog_space.install_read_bank(0x4000, 0x7fff, "bank2"); | |
447 | 447 | membank("bank2")->set_base(machine().root_device().memregion("user2")->base() + 0x4000 * bank); |
448 | 448 | } |
449 | 449 | else |
450 | prog_space | |
450 | prog_space.unmap_read(0x4000, 0x7fff); | |
451 | 451 | } |
452 | 452 | } |
453 | 453 | |
r18027 | r18028 | |
455 | 455 | static void profbank_banksw_restore(running_machine &machine) |
456 | 456 | { |
457 | 457 | astrocde_state *state = machine.driver_data<astrocde_state>(); |
458 | address_space &space = | |
458 | address_space &space = machine.device("maincpu")->memory().space(AS_IO); | |
459 | 459 | |
460 | 460 | state->profpac_banksw_w(space, 0, state->m_profpac_bank); |
461 | 461 | } |
r18027 | r18028 | |
1734 | 1734 | DRIVER_INIT_MEMBER(astrocde_state,seawolf2) |
1735 | 1735 | { |
1736 | 1736 | m_video_config = 0x00; |
1737 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x40, 0x40, 0, 0xff18, write8_delegate(FUNC(astrocde_state::seawolf2_sound_1_w),this)); | |
1738 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x41, 0x41, 0, 0xff18, write8_delegate(FUNC(astrocde_state::seawolf2_sound_2_w),this)); | |
1739 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x42, 0x43, 0, 0xff18, write8_delegate(FUNC(astrocde_state::seawolf2_lamps_w),this)); | |
1737 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x40, 0x40, 0, 0xff18, write8_delegate(FUNC(astrocde_state::seawolf2_sound_1_w),this)); | |
1738 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x41, 0x41, 0, 0xff18, write8_delegate(FUNC(astrocde_state::seawolf2_sound_2_w),this)); | |
1739 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x42, 0x43, 0, 0xff18, write8_delegate(FUNC(astrocde_state::seawolf2_lamps_w),this)); | |
1740 | 1740 | } |
1741 | 1741 | |
1742 | 1742 | |
1743 | 1743 | DRIVER_INIT_MEMBER(astrocde_state,ebases) |
1744 | 1744 | { |
1745 | 1745 | m_video_config = AC_SOUND_PRESENT; |
1746 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x20, 0x20, 0, 0xff07, write8_delegate(FUNC(astrocde_state::ebases_coin_w),this)); | |
1747 | machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x28, 0x28, 0, 0xff07, write8_delegate(FUNC(astrocde_state::ebases_trackball_select_w),this)); | |
1746 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x20, 0x20, 0, 0xff07, write8_delegate(FUNC(astrocde_state::ebases_coin_w),this)); | |
1747 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x28, 0x28, 0, 0xff07, write8_delegate(FUNC(astrocde_state::ebases_trackball_select_w),this)); | |
1748 | 1748 | } |
1749 | 1749 | |
1750 | 1750 | |
1751 | 1751 | DRIVER_INIT_MEMBER(astrocde_state,spacezap) |
1752 | 1752 | { |
1753 | 1753 | m_video_config = AC_SOUND_PRESENT | AC_MONITOR_BW; |
1754 | machine().device("maincpu")->memory().space(AS_IO) | |
1754 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x13, 0x13, 0x03ff, 0xff00, read8_delegate(FUNC(astrocde_state::spacezap_io_r),this)); | |
1755 | 1755 | } |
1756 | 1756 | |
1757 | 1757 | |
1758 | 1758 | DRIVER_INIT_MEMBER(astrocde_state,wow) |
1759 | 1759 | { |
1760 | 1760 | m_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS | AC_STARS; |
1761 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x15, 0x15, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::wow_io_r),this)); | |
1762 | machine().device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x17, 0x17, 0xffff, 0xff00, FUNC(wow_speech_r)); | |
1761 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x15, 0x15, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::wow_io_r),this)); | |
1762 | machine().device("maincpu")->memory().space(AS_IO).install_legacy_read_handler(0x17, 0x17, 0xffff, 0xff00, FUNC(wow_speech_r)); | |
1763 | 1763 | } |
1764 | 1764 | |
1765 | 1765 | |
1766 | 1766 | DRIVER_INIT_MEMBER(astrocde_state,gorf) |
1767 | 1767 | { |
1768 | 1768 | m_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS | AC_STARS; |
1769 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x15, 0x15, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::gorf_io_1_r),this)); | |
1770 | machine().device("maincpu")->memory().space(AS_IO)->install_read_handler(0x16, 0x16, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::gorf_io_2_r),this)); | |
1771 | machine().device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x17, 0x17, 0xffff, 0xff00, FUNC(gorf_speech_r)); | |
1769 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x15, 0x15, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::gorf_io_1_r),this)); | |
1770 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x16, 0x16, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::gorf_io_2_r),this)); | |
1771 | machine().device("maincpu")->memory().space(AS_IO).install_legacy_read_handler(0x17, 0x17, 0xffff, 0xff00, FUNC(gorf_speech_r)); | |
1772 | 1772 | } |
1773 | 1773 | |
1774 | 1774 | |
1775 | 1775 | DRIVER_INIT_MEMBER(astrocde_state,robby) |
1776 | 1776 | { |
1777 | 1777 | m_video_config = AC_SOUND_PRESENT; |
1778 | machine().device("maincpu")->memory().space(AS_IO) | |
1778 | machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x15, 0x15, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::robby_io_r),this)); | |
1779 | 1779 | } |
1780 | 1780 | |
1781 | 1781 | |
1782 | 1782 | DRIVER_INIT_MEMBER(astrocde_state,profpac) |
1783 | 1783 | { |
1784 | address_space | |
1784 | address_space &iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1785 | 1785 | |
1786 | 1786 | m_video_config = AC_SOUND_PRESENT; |
1787 | iospace->install_read_handler(0x14, 0x14, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::profpac_io_1_r),this)); | |
1788 | iospace->install_read_handler(0x15, 0x15, 0x77ff, 0xff00, read8_delegate(FUNC(astrocde_state::profpac_io_2_r),this)); | |
1787 | iospace.install_read_handler(0x14, 0x14, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::profpac_io_1_r),this)); | |
1788 | iospace.install_read_handler(0x15, 0x15, 0x77ff, 0xff00, read8_delegate(FUNC(astrocde_state::profpac_io_2_r),this)); | |
1789 | 1789 | |
1790 | 1790 | /* reset banking */ |
1791 | profpac_banksw_w( | |
1791 | profpac_banksw_w(iospace, 0, 0); | |
1792 | 1792 | machine().save().register_postload(save_prepost_delegate(FUNC(profbank_banksw_restore), &machine())); |
1793 | 1793 | } |
1794 | 1794 | |
1795 | 1795 | |
1796 | 1796 | DRIVER_INIT_MEMBER(astrocde_state,demndrgn) |
1797 | 1797 | { |
1798 | address_space | |
1798 | address_space &iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1799 | 1799 | |
1800 | 1800 | m_video_config = 0x00; |
1801 | iospace->install_read_handler(0x14, 0x14, 0x1fff, 0xff00, read8_delegate(FUNC(astrocde_state::demndrgn_io_r),this)); | |
1802 | iospace->install_read_port(0x1c, 0x1c, 0x0000, 0xff00, "FIREX"); | |
1803 | iospace->install_read_port(0x1d, 0x1d, 0x0000, 0xff00, "FIREY"); | |
1804 | iospace->install_write_handler(0x97, 0x97, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::demndrgn_sound_w),this)); | |
1801 | iospace.install_read_handler(0x14, 0x14, 0x1fff, 0xff00, read8_delegate(FUNC(astrocde_state::demndrgn_io_r),this)); | |
1802 | iospace.install_read_port(0x1c, 0x1c, 0x0000, 0xff00, "FIREX"); | |
1803 | iospace.install_read_port(0x1d, 0x1d, 0x0000, 0xff00, "FIREY"); | |
1804 | iospace.install_write_handler(0x97, 0x97, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::demndrgn_sound_w),this)); | |
1805 | 1805 | |
1806 | 1806 | /* reset banking */ |
1807 | profpac_banksw_w( | |
1807 | profpac_banksw_w(iospace, 0, 0); | |
1808 | 1808 | machine().save().register_postload(save_prepost_delegate(FUNC(profbank_banksw_restore), &machine())); |
1809 | 1809 | } |
1810 | 1810 | |
1811 | 1811 | |
1812 | 1812 | DRIVER_INIT_MEMBER(astrocde_state,tenpindx) |
1813 | 1813 | { |
1814 | address_space | |
1814 | address_space &iospace = machine().device("maincpu")->memory().space(AS_IO); | |
1815 | 1815 | |
1816 | 1816 | m_video_config = 0x00; |
1817 | iospace->install_read_port(0x60, 0x60, 0x0000, 0xff00, "P60"); | |
1818 | iospace->install_read_port(0x61, 0x61, 0x0000, 0xff00, "P61"); | |
1819 | iospace->install_read_port(0x62, 0x62, 0x0000, 0xff00, "P62"); | |
1820 | iospace->install_read_port(0x63, 0x63, 0x0000, 0xff00, "P63"); | |
1821 | iospace->install_read_port(0x64, 0x64, 0x0000, 0xff00, "P64"); | |
1822 | iospace->install_write_handler(0x65, 0x66, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_lamp_w),this)); | |
1823 | iospace->install_write_handler(0x67, 0x67, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_counter_w),this)); | |
1824 | iospace->install_write_handler(0x68, 0x68, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_lights_w),this)); | |
1825 | iospace->install_write_handler(0x97, 0x97, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_sound_w),this)); | |
1817 | iospace.install_read_port(0x60, 0x60, 0x0000, 0xff00, "P60"); | |
1818 | iospace.install_read_port(0x61, 0x61, 0x0000, 0xff00, "P61"); | |
1819 | iospace.install_read_port(0x62, 0x62, 0x0000, 0xff00, "P62"); | |
1820 | iospace.install_read_port(0x63, 0x63, 0x0000, 0xff00, "P63"); | |
1821 | iospace.install_read_port(0x64, 0x64, 0x0000, 0xff00, "P64"); | |
1822 | iospace.install_write_handler(0x65, 0x66, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_lamp_w),this)); | |
1823 | iospace.install_write_handler(0x67, 0x67, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_counter_w),this)); | |
1824 | iospace.install_write_handler(0x68, 0x68, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_lights_w),this)); | |
1825 | iospace.install_write_handler(0x97, 0x97, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_sound_w),this)); | |
1826 | 1826 | |
1827 | 1827 | /* reset banking */ |
1828 | profpac_banksw_w( | |
1828 | profpac_banksw_w(iospace, 0, 0); | |
1829 | 1829 | machine().save().register_postload(save_prepost_delegate(FUNC(profbank_banksw_restore), &machine())); |
1830 | 1830 | } |
1831 | 1831 |
r18027 | r18028 | |
---|---|---|
889 | 889 | static void bosco_latch_reset(running_machine &machine) |
890 | 890 | { |
891 | 891 | galaga_state *state = machine.driver_data<galaga_state>(); |
892 | address_space &space = | |
892 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
893 | 893 | int i; |
894 | 894 | |
895 | 895 | /* Reset all latches */ |
r18027 | r18028 | |
3312 | 3312 | DRIVER_INIT_CALL(galaga); |
3313 | 3313 | |
3314 | 3314 | /* Gatsbee has a larger character ROM, we need a handler for banking */ |
3315 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
3315 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x1000, 0x1000, write8_delegate(FUNC(galaga_state::gatsbee_bank_w),this)); | |
3316 | 3316 | } |
3317 | 3317 | |
3318 | 3318 | |
r18027 | r18028 | |
3353 | 3353 | DRIVER_INIT_MEMBER(xevious_state,battles) |
3354 | 3354 | { |
3355 | 3355 | /* replace the Namco I/O handlers with interface to the 4th CPU */ |
3356 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x7000, 0x700f, FUNC(battles_customio_data0_r), FUNC(battles_customio_data0_w) ); | |
3357 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x7100, 0x7100, FUNC(battles_customio0_r), FUNC(battles_customio0_w) ); | |
3356 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x7000, 0x700f, FUNC(battles_customio_data0_r), FUNC(battles_customio_data0_w) ); | |
3357 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x7100, 0x7100, FUNC(battles_customio0_r), FUNC(battles_customio0_w) ); | |
3358 | 3358 | |
3359 | 3359 | DRIVER_INIT_CALL(xevious); |
3360 | 3360 | } |
r18027 | r18028 | |
---|---|---|
2532 | 2532 | MACHINE_RESET_MEMBER(_8080bw_state,invmulti) |
2533 | 2533 | { |
2534 | 2534 | |
2535 | invmulti_bank_w( | |
2535 | invmulti_bank_w(m_maincpu->space(AS_PROGRAM), 0, 0); | |
2536 | 2536 | |
2537 | 2537 | MACHINE_RESET_CALL_MEMBER(mw8080bw); |
2538 | 2538 | } |
r18027 | r18028 | |
---|---|---|
650 | 650 | DRIVER_INIT_CALL(1943); |
651 | 651 | //it expects 0x00 to be returned from the protection reads because the protection has been patched out. |
652 | 652 | //AM_RANGE(0xc007, 0xc007) AM_READ(c1943_protection_r) |
653 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
653 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xc007, 0xc007, read8_delegate(FUNC(_1943_state::_1943b_c007_r),this)); | |
654 | 654 | |
655 | 655 | } |
656 | 656 |
r18027 | r18028 | |
---|---|---|
960 | 960 | set_hotgmck_pcm_bank(machine, 0); |
961 | 961 | set_hotgmck_pcm_bank(machine, 1); |
962 | 962 | |
963 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
963 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x5800008, 0x580000b, write32_delegate(FUNC(psikyo4_state::hotgmck_pcm_bank_w),state)); | |
964 | 964 | machine.save().register_postload(save_prepost_delegate(FUNC(hotgmck_pcm_bank_postload), &machine)); |
965 | 965 | } |
966 | 966 |
r18027 | r18028 | |
---|---|---|
1269 | 1269 | |
1270 | 1270 | DRIVER_INIT_MEMBER(taitox_state,kyustrkr) |
1271 | 1271 | { |
1272 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1272 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x900000, 0x90000f, write16_delegate(FUNC(taitox_state::kyustrkr_input_w),this)); | |
1273 | 1273 | } |
1274 | 1274 | |
1275 | 1275 |
r18027 | r18028 | |
---|---|---|
730 | 730 | static void daireika_palette_dma(running_machine &machine, UINT16 val) |
731 | 731 | { |
732 | 732 | //jalmah_state *state = machine.driver_data<jalmah_state>(); |
733 | address_space &space = | |
733 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
734 | 734 | UINT32 index_1, index_2, src_addr, tmp_addr; |
735 | 735 | /*a0=301c0+jm_shared_ram[0x540/2] & 0xf00 */ |
736 | 736 | /*a1=88000*/ |
r18027 | r18028 | |
2421 | 2421 | |
2422 | 2422 | DRIVER_INIT_MEMBER(jalmah_state,urashima) |
2423 | 2423 | { |
2424 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x80004, 0x80005, read16_delegate(FUNC(jalmah_state::urashima_mcu_r), this)); | |
2425 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x80012, 0x80013, write16_delegate(FUNC(jalmah_state::urashima_mcu_w), this)); | |
2424 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x80004, 0x80005, read16_delegate(FUNC(jalmah_state::urashima_mcu_r), this)); | |
2425 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x80012, 0x80013, write16_delegate(FUNC(jalmah_state::urashima_mcu_w), this)); | |
2426 | 2426 | |
2427 | 2427 | m_mcu_prg = 0x12; |
2428 | 2428 | } |
2429 | 2429 | |
2430 | 2430 | DRIVER_INIT_MEMBER(jalmah_state,daireika) |
2431 | 2431 | { |
2432 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x80004, 0x80005, read16_delegate(FUNC(jalmah_state::daireika_mcu_r), this)); | |
2433 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x80012, 0x80013, write16_delegate(FUNC(jalmah_state::daireika_mcu_w), this)); | |
2432 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x80004, 0x80005, read16_delegate(FUNC(jalmah_state::daireika_mcu_r), this)); | |
2433 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x80012, 0x80013, write16_delegate(FUNC(jalmah_state::daireika_mcu_w), this)); | |
2434 | 2434 | |
2435 | 2435 | m_mcu_prg = 0x11; |
2436 | 2436 | } |
2437 | 2437 | |
2438 | 2438 | DRIVER_INIT_MEMBER(jalmah_state,mjzoomin) |
2439 | 2439 | { |
2440 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x80004, 0x80005, read16_delegate(FUNC(jalmah_state::mjzoomin_mcu_r), this)); | |
2441 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x80012, 0x80013, write16_delegate(FUNC(jalmah_state::mjzoomin_mcu_w), this)); | |
2440 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x80004, 0x80005, read16_delegate(FUNC(jalmah_state::mjzoomin_mcu_r), this)); | |
2441 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x80012, 0x80013, write16_delegate(FUNC(jalmah_state::mjzoomin_mcu_w), this)); | |
2442 | 2442 | |
2443 | 2443 | m_mcu_prg = 0x13; |
2444 | 2444 | } |
2445 | 2445 | |
2446 | 2446 | DRIVER_INIT_MEMBER(jalmah_state,kakumei) |
2447 | 2447 | { |
2448 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2448 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x80004, 0x80005, read16_delegate(FUNC(jalmah_state::kakumei_mcu_r), this)); | |
2449 | 2449 | m_mcu_prg = 0x21; |
2450 | 2450 | } |
2451 | 2451 | |
2452 | 2452 | DRIVER_INIT_MEMBER(jalmah_state,kakumei2) |
2453 | 2453 | { |
2454 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2454 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x80004, 0x80005, read16_delegate(FUNC(jalmah_state::kakumei_mcu_r), this)); | |
2455 | 2455 | |
2456 | 2456 | m_mcu_prg = 0x22; |
2457 | 2457 | } |
2458 | 2458 | |
2459 | 2459 | DRIVER_INIT_MEMBER(jalmah_state,suchipi) |
2460 | 2460 | { |
2461 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2461 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x80004, 0x80005, read16_delegate(FUNC(jalmah_state::suchipi_mcu_r), this)); | |
2462 | 2462 | |
2463 | 2463 | m_mcu_prg = 0x23; |
2464 | 2464 | } |
r18027 | r18028 | |
---|---|---|
88 | 88 | |
89 | 89 | READ16_MEMBER(tx1_state::z80_shared_r) |
90 | 90 | { |
91 | address_space *cpu2space = machine().device("audio_cpu")->memory().space(AS_PROGRAM); | |
92 | return cpu2space->read_byte(offset); | |
91 | address_space &cpu2space = machine().device("audio_cpu")->memory().space(AS_PROGRAM); | |
92 | return cpu2space.read_byte(offset); | |
93 | 93 | } |
94 | 94 | |
95 | 95 | WRITE16_MEMBER(tx1_state::z80_shared_w) |
96 | 96 | { |
97 | address_space *cpu2space = machine().device("audio_cpu")->memory().space(AS_PROGRAM); | |
98 | cpu2space->write_byte(offset, data & 0xff); | |
97 | address_space &cpu2space = machine().device("audio_cpu")->memory().space(AS_PROGRAM); | |
98 | cpu2space.write_byte(offset, data & 0xff); | |
99 | 99 | } |
100 | 100 | |
101 | 101 |
r18027 | r18028 | |
---|---|---|
598 | 598 | ROM[i] = BITSWAP8(ROM[i],0,1,2,3,4,5,6,7); |
599 | 599 | |
600 | 600 | /* questions banking handlers */ |
601 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x4000, 0x4000, write8_delegate(FUNC(pingpong_state::cashquiz_question_bank_high_w),this)); | |
602 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x4001, 0x4001, write8_delegate(FUNC(pingpong_state::cashquiz_question_bank_low_w),this)); | |
601 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x4000, 0x4000, write8_delegate(FUNC(pingpong_state::cashquiz_question_bank_high_w),this)); | |
602 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x4001, 0x4001, write8_delegate(FUNC(pingpong_state::cashquiz_question_bank_low_w),this)); | |
603 | 603 | |
604 | 604 | // 8 independents banks for questions |
605 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5000, 0x50ff, "bank1"); | |
606 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5100, 0x51ff, "bank2"); | |
607 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5200, 0x52ff, "bank3"); | |
608 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5300, 0x53ff, "bank4"); | |
609 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5400, 0x54ff, "bank5"); | |
610 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5500, 0x55ff, "bank6"); | |
611 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5600, 0x56ff, "bank7"); | |
612 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5700, 0x57ff, "bank8"); | |
605 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x5000, 0x50ff, "bank1"); | |
606 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x5100, 0x51ff, "bank2"); | |
607 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x5200, 0x52ff, "bank3"); | |
608 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x5300, 0x53ff, "bank4"); | |
609 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x5400, 0x54ff, "bank5"); | |
610 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x5500, 0x55ff, "bank6"); | |
611 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x5600, 0x56ff, "bank7"); | |
612 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x5700, 0x57ff, "bank8"); | |
613 | 613 | |
614 | 614 | // setup default banks |
615 | 615 | membank("bank1")->set_base(memregion("user1")->base() + 0x100*0 ); |
r18027 | r18028 | |
---|---|---|
3999 | 3999 | /* install handlers for the compact driving games' inputs */ |
4000 | 4000 | if (compact_inputs) |
4001 | 4001 | { |
4002 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400001, FUNC(hdc68k_wheel_r)); | |
4003 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x408000, 0x408001, FUNC(hdc68k_wheel_edge_reset_w)); | |
4004 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0xa80000, 0xafffff, FUNC(hdc68k_port1_r)); | |
4002 | state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x400000, 0x400001, FUNC(hdc68k_wheel_r)); | |
4003 | state->m_maincpu->space(AS_PROGRAM).install_legacy_write_handler(0x408000, 0x408001, FUNC(hdc68k_wheel_edge_reset_w)); | |
4004 | state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0xa80000, 0xafffff, FUNC(hdc68k_port1_r)); | |
4005 | 4005 | } |
4006 | 4006 | } |
4007 | 4007 | |
r18027 | r18028 | |
4012 | 4012 | harddriv_state *state = machine.driver_data<harddriv_state>(); |
4013 | 4013 | |
4014 | 4014 | /* install ADSP program RAM */ |
4015 | state->m_maincpu->space(AS_PROGRAM) | |
4015 | state->m_maincpu->space(AS_PROGRAM).install_legacy_readwrite_handler(0x800000, 0x807fff, FUNC(hd68k_adsp_program_r), FUNC(hd68k_adsp_program_w)); | |
4016 | 4016 | |
4017 | 4017 | /* install ADSP data RAM */ |
4018 | state->m_maincpu->space(AS_PROGRAM) | |
4018 | state->m_maincpu->space(AS_PROGRAM).install_legacy_readwrite_handler(0x808000, 0x80bfff, FUNC(hd68k_adsp_data_r), FUNC(hd68k_adsp_data_w)); | |
4019 | 4019 | |
4020 | 4020 | /* install ADSP serial buffer RAM */ |
4021 | state->m_maincpu->space(AS_PROGRAM) | |
4021 | state->m_maincpu->space(AS_PROGRAM).install_legacy_readwrite_handler(0x810000, 0x813fff, FUNC(hd68k_adsp_buffer_r), FUNC(hd68k_adsp_buffer_w)); | |
4022 | 4022 | |
4023 | 4023 | /* install ADSP control locations */ |
4024 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x818000, 0x81801f, FUNC(hd68k_adsp_control_w)); | |
4025 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x818060, 0x81807f, FUNC(hd68k_adsp_irq_clear_w)); | |
4026 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x838000, 0x83ffff, FUNC(hd68k_adsp_irq_state_r)); | |
4024 | state->m_maincpu->space(AS_PROGRAM).install_legacy_write_handler(0x818000, 0x81801f, FUNC(hd68k_adsp_control_w)); | |
4025 | state->m_maincpu->space(AS_PROGRAM).install_legacy_write_handler(0x818060, 0x81807f, FUNC(hd68k_adsp_irq_clear_w)); | |
4026 | state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x838000, 0x83ffff, FUNC(hd68k_adsp_irq_state_r)); | |
4027 | 4027 | } |
4028 | 4028 | |
4029 | 4029 | |
r18027 | r18028 | |
4033 | 4033 | harddriv_state *state = machine.driver_data<harddriv_state>(); |
4034 | 4034 | |
4035 | 4035 | /* install ADSP program RAM */ |
4036 | state->m_maincpu->space(AS_PROGRAM) | |
4036 | state->m_maincpu->space(AS_PROGRAM).install_legacy_readwrite_handler(0x800000, 0x807fff, FUNC(hd68k_ds3_program_r), FUNC(hd68k_ds3_program_w)); | |
4037 | 4037 | |
4038 | 4038 | /* install ADSP data RAM */ |
4039 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_readwrite_handler(0x808000, 0x80bfff, FUNC(hd68k_adsp_data_r), FUNC(hd68k_adsp_data_w)); | |
4040 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_readwrite_handler(0x80c000, 0x80dfff, FUNC(hdds3_special_r), FUNC(hdds3_special_w)); | |
4039 | state->m_maincpu->space(AS_PROGRAM).install_legacy_readwrite_handler(0x808000, 0x80bfff, FUNC(hd68k_adsp_data_r), FUNC(hd68k_adsp_data_w)); | |
4040 | state->m_maincpu->space(AS_PROGRAM).install_legacy_readwrite_handler(0x80c000, 0x80dfff, FUNC(hdds3_special_r), FUNC(hdds3_special_w)); | |
4041 | 4041 | |
4042 | 4042 | /* install ADSP control locations */ |
4043 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x820000, 0x8207ff, FUNC(hd68k_ds3_gdata_r)); | |
4044 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x820800, 0x820fff, FUNC(hd68k_ds3_girq_state_r)); | |
4045 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x820000, 0x8207ff, FUNC(hd68k_ds3_gdata_w)); | |
4046 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x821000, 0x8217ff, FUNC(hd68k_adsp_irq_clear_w)); | |
4047 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x822000, 0x8227ff, FUNC(hd68k_ds3_sdata_r)); | |
4048 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x822800, 0x822fff, FUNC(hd68k_ds3_sirq_state_r)); | |
4049 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x822000, 0x8227ff, FUNC(hd68k_ds3_sdata_w)); | |
4050 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x823800, 0x823fff, FUNC(hd68k_ds3_control_w)); | |
4043 | state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x820000, 0x8207ff, FUNC(hd68k_ds3_gdata_r)); | |
4044 | state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x820800, 0x820fff, FUNC(hd68k_ds3_girq_state_r)); | |
4045 | state->m_maincpu->space(AS_PROGRAM).install_legacy_write_handler(0x820000, 0x8207ff, FUNC(hd68k_ds3_gdata_w)); | |
4046 | state->m_maincpu->space(AS_PROGRAM).install_legacy_write_handler(0x821000, 0x8217ff, FUNC(hd68k_adsp_irq_clear_w)); | |
4047 | state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x822000, 0x8227ff, FUNC(hd68k_ds3_sdata_r)); | |
4048 | state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x822800, 0x822fff, FUNC(hd68k_ds3_sirq_state_r)); | |
4049 | state->m_maincpu->space(AS_PROGRAM).install_legacy_write_handler(0x822000, 0x8227ff, FUNC(hd68k_ds3_sdata_w)); | |
4050 | state->m_maincpu->space(AS_PROGRAM).install_legacy_write_handler(0x823800, 0x823fff, FUNC(hd68k_ds3_control_w)); | |
4051 | 4051 | |
4052 | 4052 | /* if we have a sound DSP, boot it */ |
4053 | 4053 | if (state->m_ds4cpu1 != NULL) |
r18027 | r18028 | |
4132 | 4132 | UINT8 *usr3 = state->memregion("user3")->base(); |
4133 | 4133 | |
4134 | 4134 | /* install ASIC61 */ |
4135 | state->m_maincpu->space(AS_PROGRAM) | |
4135 | state->m_maincpu->space(AS_PROGRAM).install_legacy_readwrite_handler(0x85c000, 0x85c7ff, FUNC(hd68k_dsk_dsp32_r), FUNC(hd68k_dsk_dsp32_w)); | |
4136 | 4136 | |
4137 | 4137 | /* install control registers */ |
4138 | state->m_maincpu->space(AS_PROGRAM) | |
4138 | state->m_maincpu->space(AS_PROGRAM).install_legacy_write_handler(0x85c800, 0x85c81f, FUNC(hd68k_dsk_control_w)); | |
4139 | 4139 | |
4140 | 4140 | /* install extra RAM */ |
4141 | state->m_maincpu->space(AS_PROGRAM) | |
4141 | state->m_maincpu->space(AS_PROGRAM).install_legacy_readwrite_handler(0x900000, 0x90ffff, FUNC(hd68k_dsk_ram_r), FUNC(hd68k_dsk_ram_w)); | |
4142 | 4142 | state->m_dsk_ram = (UINT16 *)(usr3 + 0x40000); |
4143 | 4143 | |
4144 | 4144 | /* install extra ZRAM */ |
4145 | state->m_maincpu->space(AS_PROGRAM) | |
4145 | state->m_maincpu->space(AS_PROGRAM).install_legacy_readwrite_handler(0x910000, 0x910fff, FUNC(hd68k_dsk_zram_r), FUNC(hd68k_dsk_zram_w)); | |
4146 | 4146 | state->m_dsk_zram = (UINT16 *)(usr3 + 0x50000); |
4147 | 4147 | |
4148 | 4148 | /* install ASIC65 */ |
4149 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x914000, 0x917fff, FUNC(asic65_data_w)); | |
4150 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x914000, 0x917fff, FUNC(asic65_r)); | |
4151 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x918000, 0x91bfff, FUNC(asic65_io_r)); | |
4149 | state->m_maincpu->space(AS_PROGRAM).install_legacy_write_handler(0x914000, 0x917fff, FUNC(asic65_data_w)); | |
4150 | state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x914000, 0x917fff, FUNC(asic65_r)); | |
4151 | state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x918000, 0x91bfff, FUNC(asic65_io_r)); | |
4152 | 4152 | |
4153 | 4153 | /* install extra ROM */ |
4154 | state->m_maincpu->space(AS_PROGRAM) | |
4154 | state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x940000, 0x9fffff, FUNC(hd68k_dsk_small_rom_r)); | |
4155 | 4155 | state->m_dsk_rom = (UINT16 *)(usr3 + 0x00000); |
4156 | 4156 | |
4157 | 4157 | /* set up the ASIC65 */ |
r18027 | r18028 | |
4166 | 4166 | UINT8 *usr3 = state->memregion("user3")->base(); |
4167 | 4167 | |
4168 | 4168 | /* install ASIC65 */ |
4169 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x824000, 0x824003, FUNC(asic65_data_w)); | |
4170 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x824000, 0x824003, FUNC(asic65_r)); | |
4171 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x825000, 0x825001, FUNC(asic65_io_r)); | |
4169 | state->m_maincpu->space(AS_PROGRAM).install_legacy_write_handler(0x824000, 0x824003, FUNC(asic65_data_w)); | |
4170 | state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x824000, 0x824003, FUNC(asic65_r)); | |
4171 | state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x825000, 0x825001, FUNC(asic65_io_r)); | |
4172 | 4172 | |
4173 | 4173 | /* install ASIC61 */ |
4174 | state->m_maincpu->space(AS_PROGRAM) | |
4174 | state->m_maincpu->space(AS_PROGRAM).install_legacy_readwrite_handler(0x827000, 0x8277ff, FUNC(hd68k_dsk_dsp32_r), FUNC(hd68k_dsk_dsp32_w)); | |
4175 | 4175 | |
4176 | 4176 | /* install control registers */ |
4177 | state->m_maincpu->space(AS_PROGRAM) | |
4177 | state->m_maincpu->space(AS_PROGRAM).install_legacy_write_handler(0x827800, 0x82781f, FUNC(hd68k_dsk_control_w)); | |
4178 | 4178 | |
4179 | 4179 | /* install extra RAM */ |
4180 | state->m_maincpu->space(AS_PROGRAM) | |
4180 | state->m_maincpu->space(AS_PROGRAM).install_legacy_readwrite_handler(0x880000, 0x8bffff, FUNC(hd68k_dsk_ram_r), FUNC(hd68k_dsk_ram_w)); | |
4181 | 4181 | state->m_dsk_ram = (UINT16 *)(usr3 + 0x100000); |
4182 | 4182 | |
4183 | 4183 | /* install extra ROM */ |
4184 | state->m_maincpu->space(AS_PROGRAM) | |
4184 | state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x900000, 0x9fffff, FUNC(hd68k_dsk_rom_r)); | |
4185 | 4185 | state->m_dsk_rom = (UINT16 *)(usr3 + 0x000000); |
4186 | 4186 | |
4187 | 4187 | /* set up the ASIC65 */ |
r18027 | r18028 | |
4195 | 4195 | harddriv_state *state = machine.driver_data<harddriv_state>(); |
4196 | 4196 | |
4197 | 4197 | /* install ASIC65 */ |
4198 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x900000, 0x900003, FUNC(asic65_data_w)); | |
4199 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x900000, 0x900003, FUNC(asic65_r)); | |
4200 | state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x901000, 0x910001, FUNC(asic65_io_r)); | |
4198 | state->m_maincpu->space(AS_PROGRAM).install_legacy_write_handler(0x900000, 0x900003, FUNC(asic65_data_w)); | |
4199 | state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x900000, 0x900003, FUNC(asic65_r)); | |
4200 | state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x901000, 0x910001, FUNC(asic65_io_r)); | |
4201 | 4201 | |
4202 | 4202 | /* set up the ASIC65 */ |
4203 | 4203 | asic65_config(machine, ASIC65_STEELTAL); |
4204 | 4204 | |
4205 | 4205 | /* install DSPCOM control */ |
4206 | state->m_maincpu->space(AS_PROGRAM) | |
4206 | state->m_maincpu->space(AS_PROGRAM).install_legacy_write_handler(0x904000, 0x90401f, FUNC(hddspcom_control_w)); | |
4207 | 4207 | } |
4208 | 4208 | |
4209 | 4209 | |
r18027 | r18028 | |
4215 | 4215 | hdsnd_init(machine); |
4216 | 4216 | |
4217 | 4217 | /* install sound handlers */ |
4218 | state->m_maincpu->space(AS_PROGRAM)->install_readwrite_handler(0x840000, 0x840001, read16_delegate(FUNC(harddriv_state::hd68k_snd_data_r),state), write16_delegate(FUNC(harddriv_state::hd68k_snd_data_w),state)); | |
4219 | state->m_maincpu->space(AS_PROGRAM)->install_read_handler(0x844000, 0x844001, read16_delegate(FUNC(harddriv_state::hd68k_snd_status_r),state)); | |
4220 | state->m_maincpu->space(AS_PROGRAM)->install_write_handler(0x84c000, 0x84c001, write16_delegate(FUNC(harddriv_state::hd68k_snd_reset_w),state)); | |
4218 | state->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x840000, 0x840001, read16_delegate(FUNC(harddriv_state::hd68k_snd_data_r),state), write16_delegate(FUNC(harddriv_state::hd68k_snd_data_w),state)); | |
4219 | state->m_maincpu->space(AS_PROGRAM).install_read_handler(0x844000, 0x844001, read16_delegate(FUNC(harddriv_state::hd68k_snd_status_r),state)); | |
4220 | state->m_maincpu->space(AS_PROGRAM).install_write_handler(0x84c000, 0x84c001, write16_delegate(FUNC(harddriv_state::hd68k_snd_reset_w),state)); | |
4221 | 4221 | } |
4222 | 4222 | |
4223 | 4223 | |
r18027 | r18028 | |
4238 | 4238 | init_driver_sound(machine()); |
4239 | 4239 | |
4240 | 4240 | /* set up gsp speedup handler */ |
4241 | m_gsp_speedup_addr[0] = m_gsp->space(AS_PROGRAM)->install_legacy_write_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup1_w)); | |
4242 | m_gsp_speedup_addr[1] = m_gsp->space(AS_PROGRAM)->install_legacy_write_handler(0xfffcfc00, 0xfffcfc0f, FUNC(hdgsp_speedup2_w)); | |
4243 | m_gsp->space(AS_PROGRAM)->install_legacy_read_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup_r)); | |
4241 | m_gsp_speedup_addr[0] = m_gsp->space(AS_PROGRAM).install_legacy_write_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup1_w)); | |
4242 | m_gsp_speedup_addr[1] = m_gsp->space(AS_PROGRAM).install_legacy_write_handler(0xfffcfc00, 0xfffcfc0f, FUNC(hdgsp_speedup2_w)); | |
4243 | m_gsp->space(AS_PROGRAM).install_legacy_read_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup_r)); | |
4244 | 4244 | m_gsp_speedup_pc = 0xffc00f10; |
4245 | 4245 | |
4246 | 4246 | /* set up msp speedup handler */ |
4247 | m_msp_speedup_addr = m_msp->space(AS_PROGRAM)->install_legacy_write_handler(0x00751b00, 0x00751b0f, FUNC(hdmsp_speedup_w)); | |
4248 | m_msp->space(AS_PROGRAM)->install_legacy_read_handler(0x00751b00, 0x00751b0f, FUNC(hdmsp_speedup_r)); | |
4247 | m_msp_speedup_addr = m_msp->space(AS_PROGRAM).install_legacy_write_handler(0x00751b00, 0x00751b0f, FUNC(hdmsp_speedup_w)); | |
4248 | m_msp->space(AS_PROGRAM).install_legacy_read_handler(0x00751b00, 0x00751b0f, FUNC(hdmsp_speedup_r)); | |
4249 | 4249 | m_msp_speedup_pc = 0x00723b00; |
4250 | 4250 | |
4251 | 4251 | /* set up adsp speedup handlers */ |
4252 | m_adsp->space(AS_DATA) | |
4252 | m_adsp->space(AS_DATA).install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r)); | |
4253 | 4253 | } |
4254 | 4254 | |
4255 | 4255 | |
r18027 | r18028 | |
4262 | 4262 | init_driver_sound(machine()); |
4263 | 4263 | |
4264 | 4264 | /* set up gsp speedup handler */ |
4265 | m_gsp_speedup_addr[0] = m_gsp->space(AS_PROGRAM)->install_legacy_write_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup1_w)); | |
4266 | m_gsp_speedup_addr[1] = m_gsp->space(AS_PROGRAM)->install_legacy_write_handler(0xfffcfc00, 0xfffcfc0f, FUNC(hdgsp_speedup2_w)); | |
4267 | m_gsp->space(AS_PROGRAM)->install_legacy_read_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup_r)); | |
4265 | m_gsp_speedup_addr[0] = m_gsp->space(AS_PROGRAM).install_legacy_write_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup1_w)); | |
4266 | m_gsp_speedup_addr[1] = m_gsp->space(AS_PROGRAM).install_legacy_write_handler(0xfffcfc00, 0xfffcfc0f, FUNC(hdgsp_speedup2_w)); | |
4267 | m_gsp->space(AS_PROGRAM).install_legacy_read_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup_r)); | |
4268 | 4268 | m_gsp_speedup_pc = 0xfff40ff0; |
4269 | 4269 | |
4270 | 4270 | /* set up msp speedup handler */ |
4271 | m_msp_speedup_addr = m_msp->space(AS_PROGRAM)->install_legacy_write_handler(0x00751b00, 0x00751b0f, FUNC(hdmsp_speedup_w)); | |
4272 | m_msp->space(AS_PROGRAM)->install_legacy_read_handler(0x00751b00, 0x00751b0f, FUNC(hdmsp_speedup_r)); | |
4271 | m_msp_speedup_addr = m_msp->space(AS_PROGRAM).install_legacy_write_handler(0x00751b00, 0x00751b0f, FUNC(hdmsp_speedup_w)); | |
4272 | m_msp->space(AS_PROGRAM).install_legacy_read_handler(0x00751b00, 0x00751b0f, FUNC(hdmsp_speedup_r)); | |
4273 | 4273 | m_msp_speedup_pc = 0x00723b00; |
4274 | 4274 | |
4275 | 4275 | /* set up adsp speedup handlers */ |
4276 | m_adsp->space(AS_DATA) | |
4276 | m_adsp->space(AS_DATA).install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r)); | |
4277 | 4277 | } |
4278 | 4278 | |
4279 | 4279 | |
r18027 | r18028 | |
4286 | 4286 | atarijsa_init(machine(), "IN0", 0x0020); |
4287 | 4287 | |
4288 | 4288 | /* set up gsp speedup handler */ |
4289 | m_gsp_speedup_addr[0] = m_gsp->space(AS_PROGRAM)->install_legacy_write_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup1_w)); | |
4290 | m_gsp_speedup_addr[1] = m_gsp->space(AS_PROGRAM)->install_legacy_write_handler(0xfffcfc00, 0xfffcfc0f, FUNC(hdgsp_speedup2_w)); | |
4291 | m_gsp->space(AS_PROGRAM)->install_legacy_read_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup_r)); | |
4289 | m_gsp_speedup_addr[0] = m_gsp->space(AS_PROGRAM).install_legacy_write_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup1_w)); | |
4290 | m_gsp_speedup_addr[1] = m_gsp->space(AS_PROGRAM).install_legacy_write_handler(0xfffcfc00, 0xfffcfc0f, FUNC(hdgsp_speedup2_w)); | |
4291 | m_gsp->space(AS_PROGRAM).install_legacy_read_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup_r)); | |
4292 | 4292 | m_gsp_speedup_pc = 0xfff41070; |
4293 | 4293 | |
4294 | 4294 | /* set up adsp speedup handlers */ |
4295 | m_adsp->space(AS_DATA) | |
4295 | m_adsp->space(AS_DATA).install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r)); | |
4296 | 4296 | } |
4297 | 4297 | |
4298 | 4298 | |
r18027 | r18028 | |
4307 | 4307 | |
4308 | 4308 | /* set up the slapstic */ |
4309 | 4309 | slapstic_init(machine(), 117); |
4310 | m_m68k_slapstic_base = m_maincpu->space(AS_PROGRAM) | |
4310 | m_m68k_slapstic_base = m_maincpu->space(AS_PROGRAM).install_legacy_readwrite_handler(0xe0000, 0xfffff, FUNC(rd68k_slapstic_r), FUNC(rd68k_slapstic_w)); | |
4311 | 4311 | |
4312 | 4312 | /* synchronization */ |
4313 | m_rddsp32_sync[0] = m_dsp32->space(AS_PROGRAM)->install_legacy_write_handler(0x613c00, 0x613c03, FUNC(rddsp32_sync0_w)); | |
4314 | m_rddsp32_sync[1] = m_dsp32->space(AS_PROGRAM)->install_legacy_write_handler(0x613e00, 0x613e03, FUNC(rddsp32_sync1_w)); | |
4313 | m_rddsp32_sync[0] = m_dsp32->space(AS_PROGRAM).install_legacy_write_handler(0x613c00, 0x613c03, FUNC(rddsp32_sync0_w)); | |
4314 | m_rddsp32_sync[1] = m_dsp32->space(AS_PROGRAM).install_legacy_write_handler(0x613e00, 0x613e03, FUNC(rddsp32_sync1_w)); | |
4315 | 4315 | |
4316 | 4316 | /* set up adsp speedup handlers */ |
4317 | m_adsp->space(AS_DATA) | |
4317 | m_adsp->space(AS_DATA).install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r)); | |
4318 | 4318 | } |
4319 | 4319 | |
4320 | 4320 | |
r18027 | r18028 | |
4330 | 4330 | |
4331 | 4331 | /* set up the slapstic */ |
4332 | 4332 | slapstic_init(machine, 117); |
4333 | state->m_m68k_slapstic_base = state->m_maincpu->space(AS_PROGRAM) | |
4333 | state->m_m68k_slapstic_base = state->m_maincpu->space(AS_PROGRAM).install_legacy_readwrite_handler(0xe0000, 0xfffff, FUNC(rd68k_slapstic_r), FUNC(rd68k_slapstic_w)); | |
4334 | 4334 | |
4335 | 4335 | /* synchronization */ |
4336 | state->m_rddsp32_sync[0] = state->m_dsp32->space(AS_PROGRAM)->install_legacy_write_handler(0x613c00, 0x613c03, FUNC(rddsp32_sync0_w)); | |
4337 | state->m_rddsp32_sync[1] = state->m_dsp32->space(AS_PROGRAM)->install_legacy_write_handler(0x613e00, 0x613e03, FUNC(rddsp32_sync1_w)); | |
4336 | state->m_rddsp32_sync[0] = state->m_dsp32->space(AS_PROGRAM).install_legacy_write_handler(0x613c00, 0x613c03, FUNC(rddsp32_sync0_w)); | |
4337 | state->m_rddsp32_sync[1] = state->m_dsp32->space(AS_PROGRAM).install_legacy_write_handler(0x613e00, 0x613e03, FUNC(rddsp32_sync1_w)); | |
4338 | 4338 | |
4339 | 4339 | /* set up protection hacks */ |
4340 | state->m_gsp_protection = state->m_gsp->space(AS_PROGRAM) | |
4340 | state->m_gsp_protection = state->m_gsp->space(AS_PROGRAM).install_legacy_write_handler(gsp_protection, gsp_protection + 0x0f, FUNC(hdgsp_protection_w)); | |
4341 | 4341 | |
4342 | 4342 | /* set up gsp speedup handler */ |
4343 | state->m_gsp_speedup_addr[0] = state->m_gsp->space(AS_PROGRAM)->install_legacy_write_handler(0xfff76f60, 0xfff76f6f, FUNC(rdgsp_speedup1_w)); | |
4344 | state->m_gsp->space(AS_PROGRAM)->install_legacy_read_handler(0xfff76f60, 0xfff76f6f, FUNC(rdgsp_speedup1_r)); | |
4343 | state->m_gsp_speedup_addr[0] = state->m_gsp->space(AS_PROGRAM).install_legacy_write_handler(0xfff76f60, 0xfff76f6f, FUNC(rdgsp_speedup1_w)); | |
4344 | state->m_gsp->space(AS_PROGRAM).install_legacy_read_handler(0xfff76f60, 0xfff76f6f, FUNC(rdgsp_speedup1_r)); | |
4345 | 4345 | state->m_gsp_speedup_pc = 0xfff43a00; |
4346 | 4346 | |
4347 | 4347 | /* set up adsp speedup handlers */ |
4348 | state->m_adsp->space(AS_DATA) | |
4348 | state->m_adsp->space(AS_DATA).install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r)); | |
4349 | 4349 | } |
4350 | 4350 | |
4351 | 4351 | DRIVER_INIT_MEMBER(harddriv_state,racedrivc) { racedrivc_init_common(machine(), 0xfff95cd0); } |
r18027 | r18028 | |
4357 | 4357 | /* this unpleasantness prevents racedrivb1 and racedrivg1 from crashing MAME during boot */ |
4358 | 4358 | /* both clear the DSP32C's RAM and then release it from reset, causing it to run through */ |
4359 | 4359 | /* its address space recursively executing instructions */ |
4360 | m_dsp32->space(AS_PROGRAM)->install_read_handler(0x002000, 0x5fffff, read32_delegate(FUNC(harddriv_state::rddsp_unmap_r),this)); | |
4361 | m_dsp32->space(AS_PROGRAM)->install_read_handler(0x640000, 0xfff7ff, read32_delegate(FUNC(harddriv_state::rddsp_unmap_r),this)); | |
4360 | m_dsp32->space(AS_PROGRAM).install_read_handler(0x002000, 0x5fffff, read32_delegate(FUNC(harddriv_state::rddsp_unmap_r),this)); | |
4361 | m_dsp32->space(AS_PROGRAM).install_read_handler(0x640000, 0xfff7ff, read32_delegate(FUNC(harddriv_state::rddsp_unmap_r),this)); | |
4362 | 4362 | |
4363 | 4363 | DRIVER_INIT_CALL(racedriv); |
4364 | 4364 | } |
r18027 | r18028 | |
4385 | 4385 | init_dspcom(machine); |
4386 | 4386 | atarijsa_init(machine, "IN0", 0x0020); |
4387 | 4387 | |
4388 | state->m_maincpu->space(AS_PROGRAM) | |
4388 | state->m_maincpu->space(AS_PROGRAM).install_read_handler(0x908000, 0x908001, read16_delegate(FUNC(harddriv_state::steeltal_dummy_r),state)); | |
4389 | 4389 | |
4390 | 4390 | /* set up the SLOOP */ |
4391 | 4391 | if (!proto_sloop) |
4392 | 4392 | { |
4393 | state->m_m68k_slapstic_base = state->m_maincpu->space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe0000, 0xfffff, FUNC(st68k_sloop_r), FUNC(st68k_sloop_w)); | |
4394 | state->m_m68k_sloop_alt_base = state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x4e000, 0x4ffff, FUNC(st68k_sloop_alt_r)); | |
4393 | state->m_m68k_slapstic_base = state->m_maincpu->space(AS_PROGRAM).install_legacy_readwrite_handler(0xe0000, 0xfffff, FUNC(st68k_sloop_r), FUNC(st68k_sloop_w)); | |
4394 | state->m_m68k_sloop_alt_base = state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x4e000, 0x4ffff, FUNC(st68k_sloop_alt_r)); | |
4395 | 4395 | } |
4396 | 4396 | else |
4397 | state->m_m68k_slapstic_base = state->m_maincpu->space(AS_PROGRAM) | |
4397 | state->m_m68k_slapstic_base = state->m_maincpu->space(AS_PROGRAM).install_legacy_readwrite_handler(0xe0000, 0xfffff, FUNC(st68k_protosloop_r), FUNC(st68k_protosloop_w)); | |
4398 | 4398 | |
4399 | 4399 | /* set up protection hacks */ |
4400 | state->m_gsp_protection = state->m_gsp->space(AS_PROGRAM) | |
4400 | state->m_gsp_protection = state->m_gsp->space(AS_PROGRAM).install_legacy_write_handler(0xfff965d0, 0xfff965df, FUNC(hdgsp_protection_w)); | |
4401 | 4401 | |
4402 | 4402 | /* set up adsp speedup handlers */ |
4403 | state->m_adsp->space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r)); | |
4404 | state->m_adsp->space(AS_DATA)->install_legacy_read_handler(0x1f99, 0x1f99, FUNC(hdds3_speedup_r)); | |
4403 | state->m_adsp->space(AS_DATA).install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r)); | |
4404 | state->m_adsp->space(AS_DATA).install_legacy_read_handler(0x1f99, 0x1f99, FUNC(hdds3_speedup_r)); | |
4405 | 4405 | state->m_ds3_speedup_addr = &state->m_adsp_data_memory[0x1f99]; |
4406 | 4406 | state->m_ds3_speedup_pc = 0xff; |
4407 | 4407 | state->m_ds3_transfer_pc = ds3_transfer_pc; |
r18027 | r18028 | |
4423 | 4423 | |
4424 | 4424 | /* set up the slapstic */ |
4425 | 4425 | slapstic_init(machine(), 117); |
4426 | m_m68k_slapstic_base = m_maincpu->space(AS_PROGRAM) | |
4426 | m_m68k_slapstic_base = m_maincpu->space(AS_PROGRAM).install_legacy_readwrite_handler(0xe0000, 0xfffff, FUNC(rd68k_slapstic_r), FUNC(rd68k_slapstic_w)); | |
4427 | 4427 | |
4428 | m_maincpu->space(AS_PROGRAM) | |
4428 | m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0xa80000, 0xafffff, FUNC(hda68k_port1_r)); | |
4429 | 4429 | |
4430 | 4430 | /* synchronization */ |
4431 | m_rddsp32_sync[0] = m_dsp32->space(AS_PROGRAM)->install_legacy_write_handler(0x613c00, 0x613c03, FUNC(rddsp32_sync0_w)); | |
4432 | m_rddsp32_sync[1] = m_dsp32->space(AS_PROGRAM)->install_legacy_write_handler(0x613e00, 0x613e03, FUNC(rddsp32_sync1_w)); | |
4431 | m_rddsp32_sync[0] = m_dsp32->space(AS_PROGRAM).install_legacy_write_handler(0x613c00, 0x613c03, FUNC(rddsp32_sync0_w)); | |
4432 | m_rddsp32_sync[1] = m_dsp32->space(AS_PROGRAM).install_legacy_write_handler(0x613e00, 0x613e03, FUNC(rddsp32_sync1_w)); | |
4433 | 4433 | |
4434 | 4434 | /* set up protection hacks */ |
4435 | m_gsp_protection = m_gsp->space(AS_PROGRAM) | |
4435 | m_gsp_protection = m_gsp->space(AS_PROGRAM).install_legacy_write_handler(0xfff960a0, 0xfff960af, FUNC(hdgsp_protection_w)); | |
4436 | 4436 | |
4437 | 4437 | /* set up adsp speedup handlers */ |
4438 | m_adsp->space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r)); | |
4439 | m_adsp->space(AS_DATA)->install_legacy_read_handler(0x1f99, 0x1f99, FUNC(hdds3_speedup_r)); | |
4438 | m_adsp->space(AS_DATA).install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r)); | |
4439 | m_adsp->space(AS_DATA).install_legacy_read_handler(0x1f99, 0x1f99, FUNC(hdds3_speedup_r)); | |
4440 | 4440 | m_ds3_speedup_addr = &m_adsp_data_memory[0x1f99]; |
4441 | 4441 | m_ds3_speedup_pc = 0xff; |
4442 | 4442 | m_ds3_transfer_pc = 0x43672; |
r18027 | r18028 | |
4451 | 4451 | init_ds3(machine()); |
4452 | 4452 | init_dsk2(machine()); |
4453 | 4453 | |
4454 | m_maincpu->space(AS_PROGRAM) | |
4454 | m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0xa80000, 0xafffff, FUNC(hda68k_port1_r)); | |
4455 | 4455 | |
4456 | 4456 | /* synchronization */ |
4457 | m_rddsp32_sync[0] = m_dsp32->space(AS_PROGRAM)->install_legacy_write_handler(0x21fe00, 0x21fe03, FUNC(rddsp32_sync0_w)); | |
4458 | m_rddsp32_sync[1] = m_dsp32->space(AS_PROGRAM)->install_legacy_write_handler(0x21ff00, 0x21ff03, FUNC(rddsp32_sync1_w)); | |
4457 | m_rddsp32_sync[0] = m_dsp32->space(AS_PROGRAM).install_legacy_write_handler(0x21fe00, 0x21fe03, FUNC(rddsp32_sync0_w)); | |
4458 | m_rddsp32_sync[1] = m_dsp32->space(AS_PROGRAM).install_legacy_write_handler(0x21ff00, 0x21ff03, FUNC(rddsp32_sync1_w)); | |
4459 | 4459 | |
4460 | 4460 | /* set up protection hacks */ |
4461 | m_gsp_protection = m_gsp->space(AS_PROGRAM) | |
4461 | m_gsp_protection = m_gsp->space(AS_PROGRAM).install_legacy_write_handler(0xfff943f0, 0xfff943ff, FUNC(hdgsp_protection_w)); | |
4462 | 4462 | |
4463 | 4463 | /* set up adsp speedup handlers */ |
4464 | m_adsp->space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r)); | |
4465 | m_adsp->space(AS_DATA)->install_legacy_read_handler(0x1f99, 0x1f99, FUNC(hdds3_speedup_r)); | |
4464 | m_adsp->space(AS_DATA).install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r)); | |
4465 | m_adsp->space(AS_DATA).install_legacy_read_handler(0x1f99, 0x1f99, FUNC(hdds3_speedup_r)); | |
4466 | 4466 | m_ds3_speedup_addr = &m_adsp_data_memory[0x1f99]; |
4467 | 4467 | m_ds3_speedup_pc = 0x2da; |
4468 | 4468 | m_ds3_transfer_pc = 0x407b8; |
r18027 | r18028 | |
4477 | 4477 | init_ds3(machine()); |
4478 | 4478 | init_dsk2(machine()); |
4479 | 4479 | |
4480 | m_maincpu->space(AS_PROGRAM) | |
4480 | m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0xa80000, 0xafffff, FUNC(hda68k_port1_r)); | |
4481 | 4481 | |
4482 | 4482 | /* synchronization */ |
4483 | m_rddsp32_sync[0] = m_dsp32->space(AS_PROGRAM)->install_legacy_write_handler(0x21fe00, 0x21fe03, FUNC(rddsp32_sync0_w)); | |
4484 | m_rddsp32_sync[1] = m_dsp32->space(AS_PROGRAM)->install_legacy_write_handler(0x21ff00, 0x21ff03, FUNC(rddsp32_sync1_w)); | |
4483 | m_rddsp32_sync[0] = m_dsp32->space(AS_PROGRAM).install_legacy_write_handler(0x21fe00, 0x21fe03, FUNC(rddsp32_sync0_w)); | |
4484 | m_rddsp32_sync[1] = m_dsp32->space(AS_PROGRAM).install_legacy_write_handler(0x21ff00, 0x21ff03, FUNC(rddsp32_sync1_w)); | |
4485 | 4485 | |
4486 | 4486 | /* set up protection hacks */ |
4487 | m_gsp_protection = m_gsp->space(AS_PROGRAM) | |
4487 | m_gsp_protection = m_gsp->space(AS_PROGRAM).install_legacy_write_handler(0xfff916c0, 0xfff916cf, FUNC(hdgsp_protection_w)); | |
4488 | 4488 | |
4489 | 4489 | /* set up adsp speedup handlers */ |
4490 | m_adsp->space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r)); | |
4491 | m_adsp->space(AS_DATA)->install_legacy_read_handler(0x1f9a, 0x1f9a, FUNC(hdds3_speedup_r)); | |
4490 | m_adsp->space(AS_DATA).install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r)); | |
4491 | m_adsp->space(AS_DATA).install_legacy_read_handler(0x1f9a, 0x1f9a, FUNC(hdds3_speedup_r)); | |
4492 | 4492 | m_ds3_speedup_addr = &m_adsp_data_memory[0x1f9a]; |
4493 | 4493 | m_ds3_speedup_pc = 0x2d9; |
4494 | 4494 | m_ds3_transfer_pc = 0X407da; |
r18027 | r18028 | |
---|---|---|
528 | 528 | m_flash8[2] = machine().device<fujitsu_29f016a_device>("flash2"); |
529 | 529 | m_flash8[3] = machine().device<fujitsu_29f016a_device>("flash3"); |
530 | 530 | |
531 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler( 0x1f680080, 0x1f68008f, read32_delegate(FUNC(konamigv_state::flash_r),this), write32_delegate(FUNC(konamigv_state::flash_w),this) ); | |
532 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1f6800c0, 0x1f6800c7, read32_delegate(FUNC(konamigv_state::trackball_r),this)); | |
533 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1f6800c8, 0x1f6800cb, read32_delegate(FUNC(konamigv_state::unknown_r),this)); /* ?? */ | |
531 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler( 0x1f680080, 0x1f68008f, read32_delegate(FUNC(konamigv_state::flash_r),this), write32_delegate(FUNC(konamigv_state::flash_w),this) ); | |
532 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler ( 0x1f6800c0, 0x1f6800c7, read32_delegate(FUNC(konamigv_state::trackball_r),this)); | |
533 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler ( 0x1f6800c8, 0x1f6800cb, read32_delegate(FUNC(konamigv_state::unknown_r),this)); /* ?? */ | |
534 | 534 | |
535 | 535 | DRIVER_INIT_CALL(konamigv); |
536 | 536 | } |
r18027 | r18028 | |
617 | 617 | |
618 | 618 | m_flash16[0] = machine().device<sharp_lh28f400_device>("flash"); |
619 | 619 | |
620 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler( 0x1f680080, 0x1f68008f, read32_delegate(FUNC(konamigv_state::btc_trackball_r),this), write32_delegate(FUNC(konamigv_state::btc_trackball_w),this)); | |
621 | machine().device("maincpu")->memory().space(AS_PROGRAM)->nop_write ( 0x1f6800e0, 0x1f6800e3); | |
622 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler( 0x1f380000, 0x1f3fffff, read32_delegate(FUNC(konamigv_state::btcflash_r),this), write32_delegate(FUNC(konamigv_state::btcflash_w),this) ); | |
620 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler( 0x1f680080, 0x1f68008f, read32_delegate(FUNC(konamigv_state::btc_trackball_r),this), write32_delegate(FUNC(konamigv_state::btc_trackball_w),this)); | |
621 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write ( 0x1f6800e0, 0x1f6800e3); | |
622 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler( 0x1f380000, 0x1f3fffff, read32_delegate(FUNC(konamigv_state::btcflash_r),this), write32_delegate(FUNC(konamigv_state::btcflash_w),this) ); | |
623 | 623 | |
624 | 624 | DRIVER_INIT_CALL(konamigv); |
625 | 625 | } |
r18027 | r18028 | |
672 | 672 | |
673 | 673 | DRIVER_INIT_MEMBER(konamigv_state,tokimosh) |
674 | 674 | { |
675 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1f680080, 0x1f680083, read32_delegate(FUNC(konamigv_state::tokimeki_serial_r),this)); | |
676 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1f680090, 0x1f680093, write32_delegate(FUNC(konamigv_state::tokimeki_serial_w),this)); | |
675 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler ( 0x1f680080, 0x1f680083, read32_delegate(FUNC(konamigv_state::tokimeki_serial_r),this)); | |
676 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler( 0x1f680090, 0x1f680093, write32_delegate(FUNC(konamigv_state::tokimeki_serial_w),this)); | |
677 | 677 | |
678 | 678 | DRIVER_INIT_CALL(konamigv); |
679 | 679 | } |
r18027 | r18028 | |
697 | 697 | |
698 | 698 | m_flash16[0] = machine().device<sharp_lh28f400_device>("flash"); |
699 | 699 | |
700 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f680080, 0x1f680083, "GUNX1" ); | |
701 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f680090, 0x1f680093, "GUNY1" ); | |
702 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f6800a0, 0x1f6800a3, "GUNX2" ); | |
703 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f6800b0, 0x1f6800b3, "GUNY2" ); | |
704 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f6800c0, 0x1f6800c3, "BUTTONS" ); | |
705 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler ( 0x1f6800e0, 0x1f6800e3, write32_delegate(FUNC(konamigv_state::kdeadeye_0_w),this) ); | |
706 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler( 0x1f380000, 0x1f3fffff, read32_delegate(FUNC(konamigv_state::btcflash_r),this), write32_delegate(FUNC(konamigv_state::btcflash_w),this)); | |
700 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port ( 0x1f680080, 0x1f680083, "GUNX1" ); | |
701 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port ( 0x1f680090, 0x1f680093, "GUNY1" ); | |
702 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port ( 0x1f6800a0, 0x1f6800a3, "GUNX2" ); | |
703 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port ( 0x1f6800b0, 0x1f6800b3, "GUNY2" ); | |
704 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port ( 0x1f6800c0, 0x1f6800c3, "BUTTONS" ); | |
705 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler ( 0x1f6800e0, 0x1f6800e3, write32_delegate(FUNC(konamigv_state::kdeadeye_0_w),this) ); | |
706 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler( 0x1f380000, 0x1f3fffff, read32_delegate(FUNC(konamigv_state::btcflash_r),this), write32_delegate(FUNC(konamigv_state::btcflash_w),this)); | |
707 | 707 | |
708 | 708 | DRIVER_INIT_CALL(konamigv); |
709 | 709 | } |
r18027 | r18028 | |
---|---|---|
1555 | 1555 | DRIVER_INIT_MEMBER(ksys573_state,ge765pwbba) |
1556 | 1556 | { |
1557 | 1557 | DRIVER_INIT_CALL(konami573); |
1558 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1558 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler( 0x1f640000, 0x1f6400ff, read32_delegate(FUNC(ksys573_state::ge765pwbba_r),this), write32_delegate(FUNC(ksys573_state::ge765pwbba_w),this)); | |
1559 | 1559 | } |
1560 | 1560 | |
1561 | 1561 | /* |
r18027 | r18028 | |
1667 | 1667 | |
1668 | 1668 | state->m_gx700pwfbf_output_callback = output_callback_func; |
1669 | 1669 | |
1670 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1670 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler( 0x1f640000, 0x1f6400ff, read32_delegate(FUNC(ksys573_state::gx700pwbf_io_r),state), write32_delegate(FUNC(ksys573_state::gx700pwbf_io_w),state)); | |
1671 | 1671 | |
1672 | 1672 | state->save_item( NAME(state->m_gx700pwbf_output_data) ); |
1673 | 1673 | } |
r18027 | r18028 | |
1905 | 1905 | DRIVER_INIT_MEMBER(ksys573_state,gtrfrks) |
1906 | 1906 | { |
1907 | 1907 | DRIVER_INIT_CALL(konami573); |
1908 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1908 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler( 0x1f600000, 0x1f6000ff, read32_delegate(FUNC(ksys573_state::gtrfrks_io_r),this), write32_delegate(FUNC(ksys573_state::gtrfrks_io_w),this)); | |
1909 | 1909 | } |
1910 | 1910 | |
1911 | 1911 | /* GX894 digital i/o */ |
r18027 | r18028 | |
2218 | 2218 | |
2219 | 2219 | state->m_gx894pwbba_output_callback = output_callback_func; |
2220 | 2220 | |
2221 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
2221 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler( 0x1f640000, 0x1f6400ff, read32_delegate(FUNC(ksys573_state::gx894pwbba_r),state), write32_delegate(FUNC(ksys573_state::gx894pwbba_w),state)); | |
2222 | 2222 | |
2223 | 2223 | state->m_gx894_ram_write_offset = 0; |
2224 | 2224 | state->m_gx894_ram_read_offset = 0; |
r18027 | r18028 | |
2244 | 2244 | DRIVER_INIT_CALL(konami573); |
2245 | 2245 | |
2246 | 2246 | gx894pwbba_init( machine(), NULL ); |
2247 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2247 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler( 0x1f600000, 0x1f6000ff, read32_delegate(FUNC(ksys573_state::gtrfrks_io_r),this), write32_delegate(FUNC(ksys573_state::gtrfrks_io_w),this) ); | |
2248 | 2248 | } |
2249 | 2249 | |
2250 | 2250 | /* ddr solo */ |
r18027 | r18028 | |
2536 | 2536 | DRIVER_INIT_CALL(konami573); |
2537 | 2537 | |
2538 | 2538 | gx894pwbba_init( machine(), dmx_output_callback ); |
2539 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2539 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x1f600000, 0x1f6000ff, write32_delegate(FUNC(ksys573_state::dmx_io_w),this) ); | |
2540 | 2540 | } |
2541 | 2541 | |
2542 | 2542 | /* salary man champ */ |
r18027 | r18028 | |
2693 | 2693 | DRIVER_INIT_CALL(konami573); |
2694 | 2694 | |
2695 | 2695 | gx894pwbba_init( machine(), mamboagg_output_callback ); |
2696 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2696 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x1f600000, 0x1f6000ff, write32_delegate(FUNC(ksys573_state::mamboagg_io_w),this)); | |
2697 | 2697 | } |
2698 | 2698 | |
2699 | 2699 | |
r18027 | r18028 | |
3011 | 3011 | DRIVER_INIT_MEMBER(ksys573_state,gunmania) |
3012 | 3012 | { |
3013 | 3013 | DRIVER_INIT_CALL(konami573); |
3014 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
3014 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler( 0x1f640000, 0x1f6400ff, read32_delegate(FUNC(ksys573_state::gunmania_r),this), write32_delegate(FUNC(ksys573_state::gunmania_w),this)); | |
3015 | 3015 | } |
3016 | 3016 | |
3017 | 3017 | /* ADC0834 Interface */ |
r18027 | r18028 | |
---|---|---|
45 | 45 | |
46 | 46 | void srumbler_state::machine_start() |
47 | 47 | { |
48 | address_space &space = | |
48 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
49 | 49 | /* initialize banked ROM pointers */ |
50 | 50 | srumbler_bankswitch_w(space,0,0); |
51 | 51 | } |
r18027 | r18028 | |
---|---|---|
1571 | 1571 | m_timing_factor = attotime::from_hz(machine().device("maincpu")->unscaled_clock() / 10) * (256 + 16); |
1572 | 1572 | |
1573 | 1573 | /* install control port handler */ |
1574 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1574 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x0c0000, 0x0cffff, write16_delegate(FUNC(mcr68_state::xenophobe_control_w),this)); | |
1575 | 1575 | } |
1576 | 1576 | |
1577 | 1577 | |
r18027 | r18028 | |
1583 | 1583 | m_timing_factor = attotime::from_hz(machine().device("maincpu")->unscaled_clock() / 10) * (256 + 16); |
1584 | 1584 | |
1585 | 1585 | /* analog port handling is a bit tricky */ |
1586 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x0c0000, 0x0cffff, write16_delegate(FUNC(mcr68_state::spyhunt2_control_w),this)); | |
1587 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x0d0000, 0x0dffff, read16_delegate(FUNC(mcr68_state::spyhunt2_port_0_r),this)); | |
1588 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x0e0000, 0x0effff, read16_delegate(FUNC(mcr68_state::spyhunt2_port_1_r),this)); | |
1586 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x0c0000, 0x0cffff, write16_delegate(FUNC(mcr68_state::spyhunt2_control_w),this)); | |
1587 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0d0000, 0x0dffff, read16_delegate(FUNC(mcr68_state::spyhunt2_port_0_r),this)); | |
1588 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0e0000, 0x0effff, read16_delegate(FUNC(mcr68_state::spyhunt2_port_1_r),this)); | |
1589 | 1589 | } |
1590 | 1590 | |
1591 | 1591 | |
r18027 | r18028 | |
1599 | 1599 | m_timing_factor = attotime::from_hz(machine().device("maincpu")->unscaled_clock() / 10) * (256 + 16); |
1600 | 1600 | |
1601 | 1601 | /* handle control writes */ |
1602 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1602 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x0c0000, 0x0cffff, write16_delegate(FUNC(mcr68_state::blasted_control_w),this)); | |
1603 | 1603 | |
1604 | 1604 | /* 6840 is mapped to the lower 8 bits */ |
1605 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1605 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x0a0000, 0x0a000f, read16_delegate(FUNC(mcr68_state::mcr68_6840_lower_r),this), write16_delegate(FUNC(mcr68_state::mcr68_6840_lower_w),this)); | |
1606 | 1606 | } |
1607 | 1607 | |
1608 | 1608 | DRIVER_INIT_MEMBER(mcr68_state,intlaser) |
r18027 | r18028 | |
1613 | 1613 | m_timing_factor = attotime::from_hz(machine().device("maincpu")->unscaled_clock() / 10) * (256 + 16); |
1614 | 1614 | |
1615 | 1615 | /* handle control writes */ |
1616 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1616 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x0c0000, 0x0cffff, write16_delegate(FUNC(mcr68_state::blasted_control_w),this)); | |
1617 | 1617 | |
1618 | 1618 | } |
1619 | 1619 | |
r18027 | r18028 | |
1627 | 1627 | m_timing_factor = attotime::from_hz(machine().device("maincpu")->unscaled_clock() / 10) * (256 + 16); |
1628 | 1628 | |
1629 | 1629 | /* handle control writes */ |
1630 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1630 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x0c0000, 0x0cffff, write16_delegate(FUNC(mcr68_state::archrivl_control_w),this)); | |
1631 | 1631 | |
1632 | 1632 | /* 49-way joystick handling is a bit tricky */ |
1633 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1633 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0e0000, 0x0effff, read16_delegate(FUNC(mcr68_state::archrivl_port_1_r),this)); | |
1634 | 1634 | |
1635 | 1635 | /* 6840 is mapped to the lower 8 bits */ |
1636 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1636 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x0a0000, 0x0a000f, read16_delegate(FUNC(mcr68_state::mcr68_6840_lower_r),this), write16_delegate(FUNC(mcr68_state::mcr68_6840_lower_w),this)); | |
1637 | 1637 | } |
1638 | 1638 | |
1639 | 1639 |
r18027 | r18028 | |
---|---|---|
487 | 487 | pbaction_decode(machine(), "maincpu"); |
488 | 488 | |
489 | 489 | /* install a protection (?) workaround */ |
490 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
490 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xc000, 0xc000, read8_delegate(FUNC(pbaction_state::pbactio3_prot_kludge_r),this) ); | |
491 | 491 | } |
492 | 492 | |
493 | 493 | DRIVER_INIT_MEMBER(pbaction_state,pbactio4) |
r18027 | r18028 | |
---|---|---|
4535 | 4535 | ******************************************************/ |
4536 | 4536 | { |
4537 | 4537 | UINT8 *ROM = machine().root_device().memregion("maincpu")->base(); |
4538 | address_space &space = | |
4538 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
4539 | 4539 | |
4540 | 4540 | int x; |
4541 | 4541 | |
r18027 | r18028 | |
4568 | 4568 | ******************************************************/ |
4569 | 4569 | |
4570 | 4570 | UINT8 *ROM = machine().root_device().memregion("maincpu")->base(); |
4571 | address_space &space = | |
4571 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
4572 | 4572 | |
4573 | 4573 | int x; |
4574 | 4574 |
r18027 | r18028 | |
---|---|---|
905 | 905 | #endif |
906 | 906 | #if 1 |
907 | 907 | /* hack for sound protection or time out function */ |
908 | machine().device("sub")->memory().space(AS_PROGRAM) | |
908 | machine().device("sub")->memory().space(AS_PROGRAM).install_read_handler(0x4004, 0x4005, read8_delegate(FUNC(gsword_state::gsword_hack_r),this)); | |
909 | 909 | #endif |
910 | 910 | } |
911 | 911 | |
r18027 | r18028 | |
920 | 920 | #endif |
921 | 921 | #if 1 |
922 | 922 | /* hack for sound protection or time out function */ |
923 | machine().device("sub")->memory().space(AS_PROGRAM) | |
923 | machine().device("sub")->memory().space(AS_PROGRAM).install_read_handler(0x4004, 0x4005, read8_delegate(FUNC(gsword_state::gsword_hack_r),this)); | |
924 | 924 | #endif |
925 | 925 | } |
926 | 926 |
r18027 | r18028 | |
---|---|---|
805 | 805 | |
806 | 806 | DRIVER_INIT_MEMBER(exprraid_state,wexpressb2) |
807 | 807 | { |
808 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
808 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x3800, 0x3800, read8_delegate(FUNC(exprraid_state::vblank_r),this)); | |
809 | 809 | exprraid_gfx_expand(machine()); |
810 | 810 | } |
811 | 811 | |
812 | 812 | DRIVER_INIT_MEMBER(exprraid_state,wexpressb3) |
813 | 813 | { |
814 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
814 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xFFC0, 0xFFC0, read8_delegate(FUNC(exprraid_state::vblank_r),this)); | |
815 | 815 | exprraid_gfx_expand(machine()); |
816 | 816 | } |
817 | 817 |
r18027 | r18028 | |
---|---|---|
832 | 832 | DRIVER_INIT_MEMBER(naughtyb_state,popflame) |
833 | 833 | { |
834 | 834 | /* install a handler to catch protection checks */ |
835 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x9000, 0x9000, read8_delegate(FUNC(naughtyb_state::popflame_protection_r),this)); | |
836 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x9090, 0x9090, read8_delegate(FUNC(naughtyb_state::popflame_protection_r),this)); | |
835 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x9000, 0x9000, read8_delegate(FUNC(naughtyb_state::popflame_protection_r),this)); | |
836 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x9090, 0x9090, read8_delegate(FUNC(naughtyb_state::popflame_protection_r),this)); | |
837 | 837 | |
838 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
838 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xb000, 0xb0ff, write8_delegate(FUNC(naughtyb_state::popflame_protection_w),this)); | |
839 | 839 | } |
840 | 840 | |
841 | 841 | |
r18027 | r18028 | |
863 | 863 | DRIVER_INIT_MEMBER(naughtyb_state,trvmstr) |
864 | 864 | { |
865 | 865 | /* install questions' handlers */ |
866 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
866 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xc000, 0xc002, read8_delegate(FUNC(naughtyb_state::trvmstr_questions_r),this), write8_delegate(FUNC(naughtyb_state::trvmstr_questions_w),this)); | |
867 | 867 | } |
868 | 868 | |
869 | 869 |
r18027 | r18028 | |
---|---|---|
710 | 710 | kbdc8042_init(machine(), &at8042); |
711 | 711 | #if ENABLE_VGA |
712 | 712 | pc_vga_init(machine(), vga_setting, NULL); |
713 | pc_vga_io_init(machine(), | |
713 | pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); | |
714 | 714 | #endif |
715 | 715 | } |
716 | 716 |
r18027 | r18028 | |
---|---|---|
136 | 136 | |
137 | 137 | UINT8 dfruit_state::ram_bank_r(UINT16 offset, UINT8 bank_num) |
138 | 138 | { |
139 | address_space *vdp_space = machine().device<tc0091lvc_device>("tc0091lvc")->space(); | |
140 | return vdp_space->read_byte(offset + (m_ram_bank[bank_num]) * 0x1000);; | |
139 | address_space &vdp_space = machine().device<tc0091lvc_device>("tc0091lvc")->space(); | |
140 | return vdp_space.read_byte(offset + (m_ram_bank[bank_num]) * 0x1000);; | |
141 | 141 | } |
142 | 142 | |
143 | 143 | void dfruit_state::ram_bank_w(UINT16 offset, UINT8 data, UINT8 bank_num) |
144 | 144 | { |
145 | address_space *vdp_space = machine().device<tc0091lvc_device>("tc0091lvc")->space(); | |
146 | vdp_space->write_byte(offset + (m_ram_bank[bank_num]) * 0x1000,data);; | |
145 | address_space &vdp_space = machine().device<tc0091lvc_device>("tc0091lvc")->space(); | |
146 | vdp_space.write_byte(offset + (m_ram_bank[bank_num]) * 0x1000,data);; | |
147 | 147 | } |
148 | 148 | |
149 | 149 | READ8_MEMBER(dfruit_state::dfruit_ram_0_r) { return ram_bank_r(offset, 0); } |
r18027 | r18028 | |
---|---|---|
572 | 572 | static void install_handlers(running_machine &machine, int mode) |
573 | 573 | { |
574 | 574 | taitogn_state *state = machine.driver_data<taitogn_state>(); |
575 | address_space | |
575 | address_space &a = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
576 | 576 | if(mode == 0) { |
577 | 577 | // Mode 0 has access to the subbios, the mn102 flash and the rf5c296 mem zone |
578 | a->install_readwrite_handler(0x1f000000, 0x1f1fffff, read32_delegate(FUNC(taitogn_state::flash_subbios_r),state), write32_delegate(FUNC(taitogn_state::flash_subbios_w),state)); | |
579 | a->install_readwrite_handler(0x1f200000, 0x1f2fffff, read32_delegate(FUNC(taitogn_state::rf5c296_mem_r),state), write32_delegate(FUNC(taitogn_state::rf5c296_mem_w),state)); | |
580 | a->install_readwrite_handler(0x1f300000, 0x1f37ffff, read32_delegate(FUNC(taitogn_state::flash_mn102_r),state), write32_delegate(FUNC(taitogn_state::flash_mn102_w),state)); | |
581 | a->nop_readwrite(0x1f380000, 0x1f5fffff); | |
578 | a.install_readwrite_handler(0x1f000000, 0x1f1fffff, read32_delegate(FUNC(taitogn_state::flash_subbios_r),state), write32_delegate(FUNC(taitogn_state::flash_subbios_w),state)); | |
579 | a.install_readwrite_handler(0x1f200000, 0x1f2fffff, read32_delegate(FUNC(taitogn_state::rf5c296_mem_r),state), write32_delegate(FUNC(taitogn_state::rf5c296_mem_w),state)); | |
580 | a.install_readwrite_handler(0x1f300000, 0x1f37ffff, read32_delegate(FUNC(taitogn_state::flash_mn102_r),state), write32_delegate(FUNC(taitogn_state::flash_mn102_w),state)); | |
581 | a.nop_readwrite(0x1f380000, 0x1f5fffff); | |
582 | 582 | |
583 | 583 | } else { |
584 | 584 | // Mode 1 has access to the 3 samples flashes |
585 | a->install_readwrite_handler(0x1f000000, 0x1f1fffff, read32_delegate(FUNC(taitogn_state::flash_s1_r),state), write32_delegate(FUNC(taitogn_state::flash_s1_w),state)); | |
586 | a->install_readwrite_handler(0x1f200000, 0x1f3fffff, read32_delegate(FUNC(taitogn_state::flash_s2_r),state), write32_delegate(FUNC(taitogn_state::flash_s2_w),state)); | |
587 | a->install_readwrite_handler(0x1f400000, 0x1f5fffff, read32_delegate(FUNC(taitogn_state::flash_s3_r),state), write32_delegate(FUNC(taitogn_state::flash_s3_w),state)); | |
585 | a.install_readwrite_handler(0x1f000000, 0x1f1fffff, read32_delegate(FUNC(taitogn_state::flash_s1_r),state), write32_delegate(FUNC(taitogn_state::flash_s1_w),state)); | |
586 | a.install_readwrite_handler(0x1f200000, 0x1f3fffff, read32_delegate(FUNC(taitogn_state::flash_s2_r),state), write32_delegate(FUNC(taitogn_state::flash_s2_w),state)); | |
587 | a.install_readwrite_handler(0x1f400000, 0x1f5fffff, read32_delegate(FUNC(taitogn_state::flash_s3_r),state), write32_delegate(FUNC(taitogn_state::flash_s3_w),state)); | |
588 | 588 | } |
589 | 589 | } |
590 | 590 | |
r18027 | r18028 | |
879 | 879 | DRIVER_INIT_MEMBER(taitogn_state,coh3002t_mp) |
880 | 880 | { |
881 | 881 | DRIVER_INIT_CALL(coh3002t); |
882 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
882 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x1fa10100, 0x1fa10103, read32_delegate(FUNC(taitogn_state::gnet_mahjong_panel_r),this)); | |
883 | 883 | } |
884 | 884 | |
885 | 885 | MACHINE_RESET_MEMBER(taitogn_state,coh3002t) |
r18027 | r18028 | |
---|---|---|
442 | 442 | DRIVER_INIT_MEMBER(gunbustr_state,gunbustr) |
443 | 443 | { |
444 | 444 | /* Speedup handler */ |
445 | m_maincpu->space(AS_PROGRAM) | |
445 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x203acc, 0x203acf, read32_delegate(FUNC(gunbustr_state::main_cycle_r),this)); | |
446 | 446 | } |
447 | 447 | |
448 | 448 | DRIVER_INIT_MEMBER(gunbustr_state,gunbustrj) |
r18027 | r18028 | |
---|---|---|
717 | 717 | |
718 | 718 | MACHINE_RESET_MEMBER(mappy_state,superpac) |
719 | 719 | { |
720 | address_space &space = | |
720 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
721 | 721 | int i; |
722 | 722 | |
723 | 723 | /* Reset all latches */ |
r18027 | r18028 | |
727 | 727 | |
728 | 728 | MACHINE_RESET_MEMBER(mappy_state,phozon) |
729 | 729 | { |
730 | address_space &space = | |
730 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
731 | 731 | int i; |
732 | 732 | |
733 | 733 | /* Reset all latches */ |
r18027 | r18028 | |
737 | 737 | |
738 | 738 | MACHINE_RESET_MEMBER(mappy_state,mappy) |
739 | 739 | { |
740 | address_space &space = | |
740 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
741 | 741 | int i; |
742 | 742 | |
743 | 743 | /* Reset all latches */ |
r18027 | r18028 | |
2258 | 2258 | However, removing the 15XX from the board causes sound to disappear completely, so |
2259 | 2259 | the DAC might be built-in after all. |
2260 | 2260 | */ |
2261 | machine().device("sub")->memory().space(AS_PROGRAM) | |
2261 | machine().device("sub")->memory().space(AS_PROGRAM).install_write_handler(0x0002, 0x0002, write8_delegate(FUNC(mappy_state::grobda_DAC_w),this)); | |
2262 | 2262 | } |
2263 | 2263 | |
2264 | 2264 | DRIVER_INIT_MEMBER(mappy_state,digdug2) |
2265 | 2265 | { |
2266 | 2266 | /* appears to not use the watchdog */ |
2267 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2267 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write(0x8000, 0x8000); | |
2268 | 2268 | } |
2269 | 2269 | |
2270 | 2270 |
r18027 | r18028 | |
---|---|---|
155 | 155 | TILE_GET_INFO_MEMBER(safarir_state::get_bg_tile_info) |
156 | 156 | { |
157 | 157 | int color; |
158 | address_space &space = | |
158 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
159 | 159 | UINT8 code = ram_r(space,tile_index | 0x400); |
160 | 160 | |
161 | 161 | if (code & 0x80) |
r18027 | r18028 | |
177 | 177 | TILE_GET_INFO_MEMBER(safarir_state::get_fg_tile_info) |
178 | 178 | { |
179 | 179 | int color, flags; |
180 | address_space &space = | |
180 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
181 | 181 | UINT8 code = ram_r(space,tile_index); |
182 | 182 | |
183 | 183 | if (code & 0x80) |
r18027 | r18028 | |
---|---|---|
385 | 385 | // rom[0x2696/2] = 0x4e71; |
386 | 386 | // rom[0x26a0/2] = 0x4e71; |
387 | 387 | pc_vga_init(machine(), vga_setting, NULL); |
388 | pc_vga_io_init(machine(), | |
388 | pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0x3a0000, machine().device("maincpu")->memory().space(AS_PROGRAM), 0x3c0000); | |
389 | 389 | |
390 | 390 | } |
391 | 391 |
r18027 | r18028 | |
---|---|---|
443 | 443 | |
444 | 444 | WRITE32_MEMBER(metalmx_state::host_gsp_w) |
445 | 445 | { |
446 | address_space | |
446 | address_space &gsp_space = machine().device("gsp")->memory().space(AS_PROGRAM); | |
447 | 447 | |
448 | gsp_space->write_word((0xc0000000 + (offset << 5) + 0x10) / 8, data); | |
449 | gsp_space->write_word((0xc0000000 + (offset << 5))/ 8 , data >> 16); | |
448 | gsp_space.write_word((0xc0000000 + (offset << 5) + 0x10) / 8, data); | |
449 | gsp_space.write_word((0xc0000000 + (offset << 5))/ 8 , data >> 16); | |
450 | 450 | } |
451 | 451 | |
452 | 452 | READ32_MEMBER(metalmx_state::host_gsp_r) |
453 | 453 | { |
454 | address_space | |
454 | address_space &gsp_space = machine().device("gsp")->memory().space(AS_PROGRAM); | |
455 | 455 | UINT32 val; |
456 | 456 | |
457 | val = gsp_space->read_word((0xc0000000 + (offset << 5) + 0x10) / 8); | |
458 | val |= gsp_space->read_word((0xc0000000 + (offset << 5)) / 8) << 16; | |
457 | val = gsp_space.read_word((0xc0000000 + (offset << 5) + 0x10) / 8); | |
458 | val |= gsp_space.read_word((0xc0000000 + (offset << 5)) / 8) << 16; | |
459 | 459 | return val; |
460 | 460 | } |
461 | 461 |
r18027 | r18028 | |
---|---|---|
98 | 98 | /* swap the write handlers between ROM and bank 1 based on the bit */ |
99 | 99 | if ((data & 1) == 0) |
100 | 100 | /* overlay disabled, map RAM on 0x000000 */ |
101 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
101 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(0x000000, 0x07ffff, "bank1"); | |
102 | 102 | |
103 | 103 | else |
104 | 104 | /* overlay enabled, map Amiga system ROM on 0x000000 */ |
105 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
105 | machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x000000, 0x07ffff); | |
106 | 106 | } |
107 | 107 | |
108 | 108 |
r18027 | r18028 | |
---|---|---|
1896 | 1896 | unpack_region(machine(), "gfx3"); |
1897 | 1897 | |
1898 | 1898 | // install special handlers for unknown device (protection?) |
1899 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x580000, 0x580001, write16_delegate(FUNC(equites_state::gekisou_unknown_0_w),this)); | |
1900 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x5a0000, 0x5a0001, write16_delegate(FUNC(equites_state::gekisou_unknown_1_w),this)); | |
1899 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x580000, 0x580001, write16_delegate(FUNC(equites_state::gekisou_unknown_0_w),this)); | |
1900 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x5a0000, 0x5a0001, write16_delegate(FUNC(equites_state::gekisou_unknown_1_w),this)); | |
1901 | 1901 | } |
1902 | 1902 | |
1903 | 1903 | DRIVER_INIT_MEMBER(equites_state,splndrbt) |
r18027 | r18028 | |
1910 | 1910 | unpack_region(machine(), "gfx3"); |
1911 | 1911 | |
1912 | 1912 | #if HVOLTAGE_DEBUG |
1913 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1913 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x000038, 0x000039, read16_delegate(FUNC(equites_state::hvoltage_debug_r),this)); | |
1914 | 1914 | #endif |
1915 | 1915 | } |
1916 | 1916 |
r18027 | r18028 | |
---|---|---|
246 | 246 | |
247 | 247 | void omegrace_state::machine_reset() |
248 | 248 | { |
249 | address_space &space = | |
249 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
250 | 250 | /* Omega Race expects the vector processor to be ready. */ |
251 | 251 | avgdvg_reset_w(space, 0, 0); |
252 | 252 | } |
r18027 | r18028 | |
---|---|---|
1600 | 1600 | |
1601 | 1601 | DRIVER_INIT_MEMBER(decocass_state,decocass) |
1602 | 1602 | { |
1603 | address_space &space = | |
1603 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1604 | 1604 | UINT8 *rom = memregion("maincpu")->base(); |
1605 | 1605 | int A; |
1606 | 1606 | |
r18027 | r18028 | |
1638 | 1638 | m_decrypted2[i] = swap_bits_5_6(rom[i]); |
1639 | 1639 | |
1640 | 1640 | /* convert charram to a banked ROM */ |
1641 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x6000, 0xafff, "bank1"); | |
1642 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x6000, 0xafff, FUNC(decocass_de0091_w)); | |
1641 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x6000, 0xafff, "bank1"); | |
1642 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x6000, 0xafff, FUNC(decocass_de0091_w)); | |
1643 | 1643 | membank("bank1")->configure_entry(0, m_charram); |
1644 | 1644 | membank("bank1")->configure_entry(1, memregion("user3")->base()); |
1645 | 1645 | membank("bank1")->configure_decrypted_entry(0, &m_decrypted[0x6000]); |
r18027 | r18028 | |
1647 | 1647 | membank("bank1")->set_entry(0); |
1648 | 1648 | |
1649 | 1649 | /* install the bank selector */ |
1650 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1650 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xe900, 0xe900, FUNC(decocass_e900_w)); | |
1651 | 1651 | |
1652 | 1652 | save_pointer(NAME(m_decrypted2), romlength); |
1653 | 1653 | } |
r18027 | r18028 | |
1685 | 1685 | DRIVER_INIT_CALL(decocass); |
1686 | 1686 | |
1687 | 1687 | /* install custom mahjong panel */ |
1688 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe413, 0xe413, FUNC(cdsteljn_mux_w)); | |
1689 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xe600, 0xe6ff, FUNC(cdsteljn_input_r)); | |
1688 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xe413, 0xe413, FUNC(cdsteljn_mux_w)); | |
1689 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xe600, 0xe6ff, FUNC(cdsteljn_input_r)); | |
1690 | 1690 | } |
1691 | 1691 | |
1692 | 1692 | /* -- */ GAME( 1981, decocass, 0, decocass, decocass, decocass_state, decocass, ROT270, "Data East Corporation", "DECO Cassette System", GAME_IS_BIOS_ROOT ) |
r18027 | r18028 | |
---|---|---|
3743 | 3743 | switch (gameDefs[i].special) |
3744 | 3744 | { |
3745 | 3745 | case 1: // LE2 guns |
3746 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xd44000, 0xd44003, read32_delegate(FUNC(konamigx_state::le2_gun_H_r),this)); | |
3747 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xd44004, 0xd44007, read32_delegate(FUNC(konamigx_state::le2_gun_V_r),this)); | |
3746 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xd44000, 0xd44003, read32_delegate(FUNC(konamigx_state::le2_gun_H_r),this)); | |
3747 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xd44004, 0xd44007, read32_delegate(FUNC(konamigx_state::le2_gun_V_r),this)); | |
3748 | 3748 | break; |
3749 | 3749 | |
3750 | 3750 | case 2: // tkmmpzdm hack |
r18027 | r18028 | |
3780 | 3780 | break; |
3781 | 3781 | |
3782 | 3782 | case 7: // install type 4 Xilinx protection for non-type 3/4 games |
3783 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
3783 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xcc0000, 0xcc0007, write32_delegate(FUNC(konamigx_state::type4_prot_w),this)); | |
3784 | 3784 | break; |
3785 | 3785 | |
3786 | 3786 | case 8: // tbyahhoo |
r18027 | r18028 | |
3800 | 3800 | switch (readback) |
3801 | 3801 | { |
3802 | 3802 | case BPP5: |
3803 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
3803 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xd4a000, 0xd4a00f, read32_delegate(FUNC(konamigx_state::gx5bppspr_r),this)); | |
3804 | 3804 | break; |
3805 | 3805 | |
3806 | 3806 | case BPP66: |
3807 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
3807 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xd00000, 0xd01fff, FUNC(K056832_6bpp_rom_long_r)); | |
3808 | 3808 | |
3809 | 3809 | case BPP6: |
3810 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
3810 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xd4a000, 0xd4a00f, read32_delegate(FUNC(konamigx_state::gx6bppspr_r),this)); | |
3811 | 3811 | break; |
3812 | 3812 | } |
3813 | 3813 |
r18027 | r18028 | |
---|---|---|
707 | 707 | |
708 | 708 | void combatsc_state::machine_reset() |
709 | 709 | { |
710 | address_space &space = | |
710 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
711 | 711 | int i; |
712 | 712 | |
713 | 713 | memset(m_io_ram, 0x00, 0x4000); |
r18027 | r18028 | |
991 | 991 | DRIVER_INIT_MEMBER(combatsc_state,combatsc) |
992 | 992 | { |
993 | 993 | /* joystick instead of trackball */ |
994 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
994 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x0404, 0x0404, "IN1"); | |
995 | 995 | } |
996 | 996 | |
997 | 997 |
r18027 | r18028 | |
---|---|---|
1860 | 1860 | genvdp_use_cram = 0; |
1861 | 1861 | |
1862 | 1862 | if (upd != NULL) |
1863 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1863 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(*upd, 0x880000, 0x880001, 0, 0x13fefe, FUNC(segac2_upd7759_w)); | |
1864 | 1864 | } |
1865 | 1865 | |
1866 | 1866 | |
r18027 | r18028 | |
2117 | 2117 | { |
2118 | 2118 | /* disable the palette bank switching from the protection chip */ |
2119 | 2119 | segac2_common_init(machine(), NULL); |
2120 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2120 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write(0x800000, 0x800001); | |
2121 | 2121 | } |
2122 | 2122 | |
2123 | 2123 | DRIVER_INIT_MEMBER(segac2_state,borench) |
r18027 | r18028 | |
2204 | 2204 | { |
2205 | 2205 | segac2_common_init(machine(), prot_func_pclub); |
2206 | 2206 | |
2207 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880120, 0x880121, FUNC(printer_r) );/*Print Club Vol.1*/ | |
2208 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880124, 0x880125, FUNC(printer_r) );/*Print Club Vol.2*/ | |
2209 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x880124, 0x880125, FUNC(print_club_camera_w)); | |
2207 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x880120, 0x880121, FUNC(printer_r) );/*Print Club Vol.1*/ | |
2208 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x880124, 0x880125, FUNC(printer_r) );/*Print Club Vol.2*/ | |
2209 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x880124, 0x880125, FUNC(print_club_camera_w)); | |
2210 | 2210 | } |
2211 | 2211 | |
2212 | 2212 | DRIVER_INIT_MEMBER(segac2_state,pclubjv2) |
2213 | 2213 | { |
2214 | 2214 | segac2_common_init(machine(), prot_func_pclubjv2); |
2215 | 2215 | |
2216 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880120, 0x880121, FUNC(printer_r) );/*Print Club Vol.1*/ | |
2217 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880124, 0x880125, FUNC(printer_r) );/*Print Club Vol.2*/ | |
2218 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x880124, 0x880125, FUNC(print_club_camera_w)); | |
2216 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x880120, 0x880121, FUNC(printer_r) );/*Print Club Vol.1*/ | |
2217 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x880124, 0x880125, FUNC(printer_r) );/*Print Club Vol.2*/ | |
2218 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x880124, 0x880125, FUNC(print_club_camera_w)); | |
2219 | 2219 | } |
2220 | 2220 | |
2221 | 2221 | DRIVER_INIT_MEMBER(segac2_state,pclubjv4) |
2222 | 2222 | { |
2223 | 2223 | segac2_common_init(machine(), prot_func_pclubjv4); |
2224 | 2224 | |
2225 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880120, 0x880121, FUNC(printer_r) );/*Print Club Vol.1*/ | |
2226 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880124, 0x880125, FUNC(printer_r) );/*Print Club Vol.2*/ | |
2227 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x880124, 0x880125, FUNC(print_club_camera_w)); | |
2225 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x880120, 0x880121, FUNC(printer_r) );/*Print Club Vol.1*/ | |
2226 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x880124, 0x880125, FUNC(printer_r) );/*Print Club Vol.2*/ | |
2227 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x880124, 0x880125, FUNC(print_club_camera_w)); | |
2228 | 2228 | } |
2229 | 2229 | |
2230 | 2230 | DRIVER_INIT_MEMBER(segac2_state,pclubjv5) |
2231 | 2231 | { |
2232 | 2232 | segac2_common_init(machine(), prot_func_pclubjv5); |
2233 | 2233 | |
2234 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880120, 0x880121, FUNC(printer_r) );/*Print Club Vol.1*/ | |
2235 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880124, 0x880125, FUNC(printer_r) );/*Print Club Vol.2*/ | |
2236 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x880124, 0x880125, FUNC(print_club_camera_w)); | |
2234 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x880120, 0x880121, FUNC(printer_r) );/*Print Club Vol.1*/ | |
2235 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x880124, 0x880125, FUNC(printer_r) );/*Print Club Vol.2*/ | |
2236 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x880124, 0x880125, FUNC(print_club_camera_w)); | |
2237 | 2237 | } |
2238 | 2238 | |
2239 | 2239 |
r18027 | r18028 | |
---|---|---|
1211 | 1211 | |
1212 | 1212 | MACHINE_RESET_MEMBER(homedata_state,pteacher) |
1213 | 1213 | { |
1214 | address_space &space = | |
1214 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1215 | 1215 | |
1216 | 1216 | /* on reset, ports are set as input (high impedance), therefore 0xff output */ |
1217 | 1217 | pteacher_upd7807_portc_w(space, 0, 0xff); |
r18027 | r18028 | |
1227 | 1227 | |
1228 | 1228 | MACHINE_RESET_MEMBER(homedata_state,reikaids) |
1229 | 1229 | { |
1230 | address_space &space = | |
1230 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1231 | 1231 | |
1232 | 1232 | /* on reset, ports are set as input (high impedance), therefore 0xff output */ |
1233 | 1233 | reikaids_upd7807_portc_w(space, 0, 0xff); |
r18027 | r18028 | |
2016 | 2016 | /* it seems that Mahjong Jogakuen runs on the same board as the others, |
2017 | 2017 | but with just these two addresses swapped. Instead of creating a new |
2018 | 2018 | MachineDriver, I just fix them here. */ |
2019 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x8007, 0x8007, write8_delegate(FUNC(homedata_state::pteacher_blitter_bank_w),this)); | |
2020 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x8005, 0x8005, write8_delegate(FUNC(homedata_state::pteacher_gfx_bank_w),this)); | |
2019 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x8007, 0x8007, write8_delegate(FUNC(homedata_state::pteacher_blitter_bank_w),this)); | |
2020 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x8005, 0x8005, write8_delegate(FUNC(homedata_state::pteacher_gfx_bank_w),this)); | |
2021 | 2021 | } |
2022 | 2022 | |
2023 | 2023 | DRIVER_INIT_MEMBER(homedata_state,mjikaga) |
2024 | 2024 | { |
2025 | 2025 | /* Mahjong Ikagadesuka is different as well. */ |
2026 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x7802, 0x7802, read8_delegate(FUNC(homedata_state::pteacher_snd_r),this)); | |
2027 | machine().device("audiocpu")->memory().space(AS_PROGRAM)->install_write_handler(0x0123, 0x0123, write8_delegate(FUNC(homedata_state::pteacher_snd_answer_w),this)); | |
2026 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x7802, 0x7802, read8_delegate(FUNC(homedata_state::pteacher_snd_r),this)); | |
2027 | machine().device("audiocpu")->memory().space(AS_PROGRAM).install_write_handler(0x0123, 0x0123, write8_delegate(FUNC(homedata_state::pteacher_snd_answer_w),this)); | |
2028 | 2028 | } |
2029 | 2029 | |
2030 | 2030 | DRIVER_INIT_MEMBER(homedata_state,reikaids) |
r18027 | r18028 | |
---|---|---|
1462 | 1462 | m_color_latch[0] = 0x09; |
1463 | 1463 | |
1464 | 1464 | /* the ROM is actually mapped high */ |
1465 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1465 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xf800, 0xffff, "bank1"); | |
1466 | 1466 | membank("bank1")->set_base(memregion("maincpu")->base() + 0xf800); |
1467 | 1467 | } |
1468 | 1468 | |
r18027 | r18028 | |
1493 | 1493 | |
1494 | 1494 | DRIVER_INIT_MEMBER(exidy_state,fax) |
1495 | 1495 | { |
1496 | address_space &space = | |
1496 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1497 | 1497 | |
1498 | 1498 | exidy_video_config(machine(), 0x04, 0x04, TRUE); |
1499 | 1499 |
r18027 | r18028 | |
---|---|---|
411 | 411 | DRIVER_INIT_MEMBER(pcktgal_state,deco222) |
412 | 412 | { |
413 | 413 | int A; |
414 | address_space &space = | |
414 | address_space &space = machine().device("audiocpu")->memory().space(AS_PROGRAM); | |
415 | 415 | UINT8 *decrypted = auto_alloc_array(machine(), UINT8, 0x10000); |
416 | 416 | UINT8 *rom = machine().root_device().memregion("audiocpu")->base(); |
417 | 417 |
r18027 | r18028 | |
---|---|---|
1806 | 1806 | |
1807 | 1807 | KL5C80_virtual_mem_sync(this); |
1808 | 1808 | |
1809 | address_space &space = | |
1809 | address_space &space = machine().device<z80_device>("comm")->space(AS_PROGRAM); | |
1810 | 1810 | space.set_direct_update_handler(direct_update_delegate(FUNC(hng64_state::KL5C80_direct_handler), this)); |
1811 | 1811 | |
1812 | 1812 | machine().device("comm")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE); // reset the CPU and let 'er rip |
r18027 | r18028 | |
---|---|---|
779 | 779 | |
780 | 780 | DRIVER_INIT_MEMBER(macrossp_state,macrossp) |
781 | 781 | { |
782 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
782 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xf10158, 0xf1015b, write32_delegate(FUNC(macrossp_state::macrossp_speedup_w),this)); | |
783 | 783 | } |
784 | 784 | |
785 | 785 | DRIVER_INIT_MEMBER(macrossp_state,quizmoon) |
786 | 786 | { |
787 | 787 | #ifdef UNUSED_FUNCTION |
788 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
788 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xf00020, 0xf00023, write32_delegate(FUNC(macrossp_state::quizmoon_speedup_w),this)); | |
789 | 789 | #endif |
790 | 790 | } |
791 | 791 |
r18027 | r18028 | |
---|---|---|
1022 | 1022 | rom[i+2*j*0x2000] = rom[i+j*0x2000]; |
1023 | 1023 | } |
1024 | 1024 | } |
1025 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1025 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xf6a3,0xf6a3,read8_delegate(FUNC(gladiatr_state::f6a3_r),this)); | |
1026 | 1026 | } |
1027 | 1027 | |
1028 | 1028 |
r18027 | r18028 | |
---|---|---|
747 | 747 | |
748 | 748 | DRIVER_INIT_MEMBER(umipoker_state,umipoker) |
749 | 749 | { |
750 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
750 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xe00010, 0xe00011, write16_delegate(FUNC(umipoker_state::umi_counters_w), this)); | |
751 | 751 | } |
752 | 752 | |
753 | 753 | DRIVER_INIT_MEMBER(umipoker_state,saiyukip) |
754 | 754 | { |
755 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xe00010, 0xe00011, write16_delegate(FUNC(umipoker_state::saiyu_counters_w), this)); | |
756 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xe0000c, 0xe0000d, write16_delegate(FUNC(umipoker_state::lamps_w), this)); | |
755 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xe00010, 0xe00011, write16_delegate(FUNC(umipoker_state::saiyu_counters_w), this)); | |
756 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xe0000c, 0xe0000d, write16_delegate(FUNC(umipoker_state::lamps_w), this)); | |
757 | 757 | } |
758 | 758 | |
759 | 759 |
r18027 | r18028 | |
---|---|---|
181 | 181 | MACHINE_START_MEMBER(kangaroo_state,kangaroo_mcu) |
182 | 182 | { |
183 | 183 | kangaroo_state::machine_start(); |
184 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
184 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xef00, 0xefff, read8_delegate(FUNC(kangaroo_state::mcu_sim_r),this), write8_delegate(FUNC(kangaroo_state::mcu_sim_w),this)); | |
185 | 185 | save_item(NAME(m_mcu_clock)); |
186 | 186 | } |
187 | 187 |
r18027 | r18028 | |
---|---|---|
848 | 848 | |
849 | 849 | static void seibu_sound_bootleg(running_machine &machine,const char *cpu,int length) |
850 | 850 | { |
851 | address_space &space = | |
851 | address_space &space = machine.device(cpu)->memory().space(AS_PROGRAM); | |
852 | 852 | UINT8 *decrypt = auto_alloc_array(machine, UINT8, length); |
853 | 853 | UINT8 *rom = machine.root_device().memregion(cpu)->base(); |
854 | 854 |
r18027 | r18028 | |
---|---|---|
164 | 164 | static void vendetta_video_banking( running_machine &machine, int select ) |
165 | 165 | { |
166 | 166 | vendetta_state *state = machine.driver_data<vendetta_state>(); |
167 | address_space &space = | |
167 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
168 | 168 | |
169 | 169 | if (select & 1) |
170 | 170 | { |
r18027 | r18028 | |
---|---|---|
1369 | 1369 | m_maincpu->set_input_line(4, HOLD_LINE); |
1370 | 1370 | |
1371 | 1371 | // set tile banks |
1372 | address_space &space = | |
1372 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
1373 | 1373 | rom_5704_bank_w(space, 1, m_workram[0x3094/2] & 0x00ff, 0x00ff); |
1374 | 1374 | |
1375 | 1375 | // process any new sound data |
r18027 | r18028 | |
1414 | 1414 | UINT16 temp = m_workram[0x0bd0/2]; |
1415 | 1415 | if ((temp & 0xff00) != 0x0000) |
1416 | 1416 | { |
1417 | address_space &space = | |
1417 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
1418 | 1418 | m_mapper->write(space, 0x03, temp >> 8); |
1419 | 1419 | m_workram[0x0bd0/2] = temp & 0x00ff; |
1420 | 1420 | } |
r18027 | r18028 | |
1444 | 1444 | UINT16 temp = m_workram[0x2cfc/2]; |
1445 | 1445 | if ((temp & 0xff00) != 0x0000) |
1446 | 1446 | { |
1447 | address_space &space = | |
1447 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
1448 | 1448 | m_mapper->write(space, 0x03, temp >> 8); |
1449 | 1449 | m_workram[0x2cfc/2] = temp & 0x00ff; |
1450 | 1450 | } |
r18027 | r18028 | |
1471 | 1471 | temp = m_workram[0x01d0/2]; |
1472 | 1472 | if ((temp & 0xff00) != 0x0000) |
1473 | 1473 | { |
1474 | address_space &space = | |
1474 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
1475 | 1475 | m_mapper->write(space, 0x03, temp); |
1476 | 1476 | m_workram[0x01d0/2] = temp & 0x00ff; |
1477 | 1477 | } |
r18027 | r18028 | |
1497 | 1497 | UINT16 temp = m_workram[0x0008/2]; |
1498 | 1498 | if ((temp & 0x00ff) != 0x0000) |
1499 | 1499 | { |
1500 | address_space &space = | |
1500 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
1501 | 1501 | m_mapper->write(space, 0x03, temp >> 8); |
1502 | 1502 | m_workram[0x0008/2] = temp & 0xff00; |
1503 | 1503 | } |
r18027 | r18028 | |
---|---|---|
239 | 239 | static void scu_do_transfer(running_machine &machine,UINT8 event) |
240 | 240 | { |
241 | 241 | saturn_state *state = machine.driver_data<saturn_state>(); |
242 | address_space &space = | |
242 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
243 | 243 | int i; |
244 | 244 | |
245 | 245 | for(i=0;i<3;i++) |
r18027 | r18028 | |
2054 | 2054 | |
2055 | 2055 | m_cart_type = ioport("CART_AREA")->read() & 7; |
2056 | 2056 | |
2057 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x02400000, 0x027fffff, FUNC(saturn_null_ram_r), FUNC(saturn_null_ram_w)); | |
2058 | machine().device("slave")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x02400000, 0x027fffff, FUNC(saturn_null_ram_r), FUNC(saturn_null_ram_w)); | |
2057 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x02400000, 0x027fffff, FUNC(saturn_null_ram_r), FUNC(saturn_null_ram_w)); | |
2058 | machine().device("slave")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x02400000, 0x027fffff, FUNC(saturn_null_ram_r), FUNC(saturn_null_ram_w)); | |
2059 | 2059 | |
2060 | 2060 | if(m_cart_type == 5) |
2061 | 2061 | { |
2062 | 2062 | // AM_RANGE(0x02400000, 0x027fffff) AM_RAM //cart RAM area, dynamically allocated |
2063 | machine().device("maincpu")->memory().space(AS_PROGRAM)->nop_readwrite(0x02400000, 0x027fffff); | |
2064 | machine().device("slave")->memory().space(AS_PROGRAM)->nop_readwrite(0x02400000, 0x027fffff); | |
2063 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_readwrite(0x02400000, 0x027fffff); | |
2064 | machine().device("slave")->memory().space(AS_PROGRAM).nop_readwrite(0x02400000, 0x027fffff); | |
2065 | 2065 | |
2066 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x02400000, 0x0247ffff, FUNC(saturn_cart_dram0_r), FUNC(saturn_cart_dram0_w)); | |
2067 | machine().device("slave")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x02400000, 0x0247ffff, FUNC(saturn_cart_dram0_r), FUNC(saturn_cart_dram0_w)); | |
2068 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x02600000, 0x0267ffff, FUNC(saturn_cart_dram1_r), FUNC(saturn_cart_dram1_w)); | |
2069 | machine().device("slave")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x02600000, 0x0267ffff, FUNC(saturn_cart_dram1_r), FUNC(saturn_cart_dram1_w)); | |
2066 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x02400000, 0x0247ffff, FUNC(saturn_cart_dram0_r), FUNC(saturn_cart_dram0_w)); | |
2067 | machine().device("slave")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x02400000, 0x0247ffff, FUNC(saturn_cart_dram0_r), FUNC(saturn_cart_dram0_w)); | |
2068 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x02600000, 0x0267ffff, FUNC(saturn_cart_dram1_r), FUNC(saturn_cart_dram1_w)); | |
2069 | machine().device("slave")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x02600000, 0x0267ffff, FUNC(saturn_cart_dram1_r), FUNC(saturn_cart_dram1_w)); | |
2070 | 2070 | } |
2071 | 2071 | |
2072 | 2072 | if(m_cart_type == 6) |
2073 | 2073 | { |
2074 | 2074 | // AM_RANGE(0x02400000, 0x027fffff) AM_RAM //cart RAM area, dynamically allocated |
2075 | machine().device("maincpu")->memory().space(AS_PROGRAM)->nop_readwrite(0x02400000, 0x027fffff); | |
2076 | machine().device("slave")->memory().space(AS_PROGRAM)->nop_readwrite(0x02400000, 0x027fffff); | |
2075 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_readwrite(0x02400000, 0x027fffff); | |
2076 | machine().device("slave")->memory().space(AS_PROGRAM).nop_readwrite(0x02400000, 0x027fffff); | |
2077 | 2077 | |
2078 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x02400000, 0x025fffff, FUNC(saturn_cart_dram0_r), FUNC(saturn_cart_dram0_w)); | |
2079 | machine().device("slave")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x02400000, 0x025fffff, FUNC(saturn_cart_dram0_r), FUNC(saturn_cart_dram0_w)); | |
2080 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x02600000, 0x027fffff, FUNC(saturn_cart_dram1_r), FUNC(saturn_cart_dram1_w)); | |
2081 | machine().device("slave")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x02600000, 0x027fffff, FUNC(saturn_cart_dram1_r), FUNC(saturn_cart_dram1_w)); | |
2078 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x02400000, 0x025fffff, FUNC(saturn_cart_dram0_r), FUNC(saturn_cart_dram0_w)); | |
2079 | machine().device("slave")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x02400000, 0x025fffff, FUNC(saturn_cart_dram0_r), FUNC(saturn_cart_dram0_w)); | |
2080 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x02600000, 0x027fffff, FUNC(saturn_cart_dram1_r), FUNC(saturn_cart_dram1_w)); | |
2081 | machine().device("slave")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x02600000, 0x027fffff, FUNC(saturn_cart_dram1_r), FUNC(saturn_cart_dram1_w)); | |
2082 | 2082 | } |
2083 | 2083 | |
2084 | machine().device("maincpu")->memory().space(AS_PROGRAM)->nop_readwrite(0x04000000, 0x047fffff); | |
2085 | machine().device("slave")->memory().space(AS_PROGRAM)->nop_readwrite(0x04000000, 0x047fffff); | |
2084 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_readwrite(0x04000000, 0x047fffff); | |
2085 | machine().device("slave")->memory().space(AS_PROGRAM).nop_readwrite(0x04000000, 0x047fffff); | |
2086 | 2086 | |
2087 | 2087 | if(m_cart_type > 0 && m_cart_type < 5) |
2088 | 2088 | { |
r18027 | r18028 | |
2093 | 2093 | //mask = 0x7fffff >> 4-3 = 0x3fffff 16mbit |
2094 | 2094 | //mask = 0x7fffff >> 4-2 = 0x1fffff 8mbit |
2095 | 2095 | //mask = 0x7fffff >> 4-1 = 0x0fffff 4mbit |
2096 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x04000000, 0x04000000 | mask, FUNC(saturn_cs1_r), FUNC(saturn_cs1_w)); | |
2097 | machine().device("slave")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x04000000, 0x04000000 | mask, FUNC(saturn_cs1_r), FUNC(saturn_cs1_w)); | |
2096 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x04000000, 0x04000000 | mask, FUNC(saturn_cs1_r), FUNC(saturn_cs1_w)); | |
2097 | machine().device("slave")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x04000000, 0x04000000 | mask, FUNC(saturn_cs1_r), FUNC(saturn_cs1_w)); | |
2098 | 2098 | } |
2099 | 2099 | |
2100 | 2100 |
r18027 | r18028 | |
---|---|---|
2236 | 2236 | |
2237 | 2237 | m_playfield_base = 0x000; |
2238 | 2238 | |
2239 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2239 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xca0fc0, 0xca0fc3, read32_delegate(FUNC(atarigx2_state::rrreveng_prot_r),this)); | |
2240 | 2240 | } |
2241 | 2241 | |
2242 | 2242 |
r18027 | r18028 | |
---|---|---|
3885 | 3885 | } |
3886 | 3886 | } |
3887 | 3887 | |
3888 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x4a001c, 0x4a001f, read32_delegate(FUNC(taito_f3_state::bubsympb_oki_r),this)); | |
3889 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x4a001c, 0x4a001f, write32_delegate(FUNC(taito_f3_state::bubsympb_oki_w),this)); | |
3888 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x4a001c, 0x4a001f, read32_delegate(FUNC(taito_f3_state::bubsympb_oki_r),this)); | |
3889 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x4a001c, 0x4a001f, write32_delegate(FUNC(taito_f3_state::bubsympb_oki_w),this)); | |
3890 | 3890 | } |
3891 | 3891 | |
3892 | 3892 |
r18027 | r18028 | |
---|---|---|
974 | 974 | UINT8 *ROM = memregion("maincpu")->base(); |
975 | 975 | |
976 | 976 | membank("bank1")->configure_entries(0, 4, &ROM[0x80000], 0x20000); |
977 | machine().device("maincpu")->memory().space(AS_IO) | |
977 | machine().device("maincpu")->memory().space(AS_IO).install_write_handler(0x06, 0x07, write16_delegate(FUNC(m107_state::m107_bankswitch_w),this)); | |
978 | 978 | |
979 | 979 | m_irq_vectorbase = 0x80; |
980 | 980 | m_spritesystem = 0; |
r18027 | r18028 | |
---|---|---|
1572 | 1572 | static void arkanoid_bootleg_init( running_machine &machine ) |
1573 | 1573 | { |
1574 | 1574 | arkanoid_state *state = machine.driver_data<arkanoid_state>(); |
1575 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xf000, 0xf000, read8_delegate(FUNC(arkanoid_state::arkanoid_bootleg_f000_r),state) ); | |
1576 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xf002, 0xf002, read8_delegate(FUNC(arkanoid_state::arkanoid_bootleg_f002_r),state) ); | |
1577 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xd018, 0xd018, write8_delegate(FUNC(arkanoid_state::arkanoid_bootleg_d018_w),state) ); | |
1578 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xd008, 0xd008, read8_delegate(FUNC(arkanoid_state::arkanoid_bootleg_d008_r),state) ); | |
1575 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xf000, 0xf000, read8_delegate(FUNC(arkanoid_state::arkanoid_bootleg_f000_r),state) ); | |
1576 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xf002, 0xf002, read8_delegate(FUNC(arkanoid_state::arkanoid_bootleg_f002_r),state) ); | |
1577 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xd018, 0xd018, write8_delegate(FUNC(arkanoid_state::arkanoid_bootleg_d018_w),state) ); | |
1578 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xd008, 0xd008, read8_delegate(FUNC(arkanoid_state::arkanoid_bootleg_d008_r),state) ); | |
1579 | 1579 | } |
1580 | 1580 | |
1581 | 1581 | DRIVER_INIT_MEMBER(arkanoid_state,arkangc) |
r18027 | r18028 | |
1660 | 1660 | ROM[x] = ROM[x] ^ 0x94; |
1661 | 1661 | } |
1662 | 1662 | |
1663 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1663 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xd008, 0xd008, write8_delegate(FUNC(arkanoid_state::tetrsark_d008_w),this)); | |
1664 | 1664 | } |
1665 | 1665 | |
1666 | 1666 |
r18027 | r18028 | |
---|---|---|
3730 | 3730 | DRIVER_INIT_MEMBER(megasys1_state,astyanax) |
3731 | 3731 | { |
3732 | 3732 | astyanax_rom_decode(machine(), "maincpu"); |
3733 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x00000, 0x3ffff, read16_delegate(FUNC(megasys1_state::megasys1A_mcu_hs_r),this)); | |
3734 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x20000, 0x20009, write16_delegate(FUNC(megasys1_state::megasys1A_mcu_hs_w),this)); | |
3733 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00000, 0x3ffff, read16_delegate(FUNC(megasys1_state::megasys1A_mcu_hs_r),this)); | |
3734 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x20000, 0x20009, write16_delegate(FUNC(megasys1_state::megasys1A_mcu_hs_w),this)); | |
3735 | 3735 | } |
3736 | 3736 | |
3737 | 3737 | DRIVER_INIT_MEMBER(megasys1_state,avspirit) |
r18027 | r18028 | |
3743 | 3743 | m_ip_select_values[4] = 0x34; |
3744 | 3744 | |
3745 | 3745 | // has twice less RAM |
3746 | machine().device("maincpu")->memory().space(AS_PROGRAM)->unmap_readwrite(0x060000, 0x06ffff); | |
3747 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0x070000, 0x07ffff, m_ram); | |
3746 | machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_readwrite(0x060000, 0x06ffff); | |
3747 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_ram(0x070000, 0x07ffff, m_ram); | |
3748 | 3748 | } |
3749 | 3749 | |
3750 | 3750 | DRIVER_INIT_MEMBER(megasys1_state,bigstrik) |
r18027 | r18028 | |
3806 | 3806 | DRIVER_INIT_MEMBER(megasys1_state,edfbl) |
3807 | 3807 | { |
3808 | 3808 | //device_t *oki1 = machine().device("oki1"); |
3809 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xe0000, 0xe000f, read16_delegate(FUNC(megasys1_state::edfbl_input_r),this)); | |
3810 | //machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*oki1, 0xe000e, 0xe000f, FUNC(soundlatch_byte_w)); | |
3809 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xe0000, 0xe000f, read16_delegate(FUNC(megasys1_state::edfbl_input_r),this)); | |
3810 | //machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(*oki1, 0xe000e, 0xe000f, FUNC(soundlatch_byte_w)); | |
3811 | 3811 | } |
3812 | 3812 | |
3813 | 3813 | DRIVER_INIT_MEMBER(megasys1_state,hayaosi1) |
r18027 | r18028 | |
3861 | 3861 | phantasm_rom_decode(machine(), "maincpu"); |
3862 | 3862 | |
3863 | 3863 | //ROM = (UINT16 *) machine().root_device().memregion("maincpu")->base(); |
3864 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x00000, 0x3ffff, read16_delegate(FUNC(megasys1_state::iganinju_mcu_hs_r),this)); | |
3865 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x2f000, 0x2f009, write16_delegate(FUNC(megasys1_state::iganinju_mcu_hs_w),this)); | |
3864 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00000, 0x3ffff, read16_delegate(FUNC(megasys1_state::iganinju_mcu_hs_r),this)); | |
3865 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x2f000, 0x2f009, write16_delegate(FUNC(megasys1_state::iganinju_mcu_hs_w),this)); | |
3866 | 3866 | |
3867 | 3867 | //ROM[0x00006e/2] = 0x0420; // the only game that does |
3868 | 3868 | // not like lev 3 interrupts |
r18027 | r18028 | |
3889 | 3889 | |
3890 | 3890 | jitsupro_gfx_unmangle(machine(), "gfx1"); // Gfx |
3891 | 3891 | jitsupro_gfx_unmangle(machine(), "gfx4"); |
3892 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x00000, 0x3ffff, read16_delegate(FUNC(megasys1_state::megasys1A_mcu_hs_r),this)); | |
3893 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x20000, 0x20009, write16_delegate(FUNC(megasys1_state::megasys1A_mcu_hs_w),this)); | |
3892 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00000, 0x3ffff, read16_delegate(FUNC(megasys1_state::megasys1A_mcu_hs_r),this)); | |
3893 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x20000, 0x20009, write16_delegate(FUNC(megasys1_state::megasys1A_mcu_hs_w),this)); | |
3894 | 3894 | |
3895 | 3895 | /* the sound code writes oki commands to both the lsb and msb */ |
3896 | machine().device("soundcpu")->memory().space(AS_PROGRAM)->install_write_handler(0xa0000, 0xa0003, write16_delegate(FUNC(megasys1_state::okim6295_both_1_w),this)); | |
3897 | machine().device("soundcpu")->memory().space(AS_PROGRAM)->install_write_handler(0xc0000, 0xc0003, write16_delegate(FUNC(megasys1_state::okim6295_both_2_w),this)); | |
3896 | machine().device("soundcpu")->memory().space(AS_PROGRAM).install_write_handler(0xa0000, 0xa0003, write16_delegate(FUNC(megasys1_state::okim6295_both_1_w),this)); | |
3897 | machine().device("soundcpu")->memory().space(AS_PROGRAM).install_write_handler(0xc0000, 0xc0003, write16_delegate(FUNC(megasys1_state::okim6295_both_2_w),this)); | |
3898 | 3898 | } |
3899 | 3899 | |
3900 | 3900 | DRIVER_INIT_MEMBER(megasys1_state,peekaboo) |
3901 | 3901 | { |
3902 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
3902 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x100000, 0x100001, read16_delegate(FUNC(megasys1_state::protection_peekaboo_r),this), write16_delegate(FUNC(megasys1_state::protection_peekaboo_w),this)); | |
3903 | 3903 | } |
3904 | 3904 | |
3905 | 3905 | DRIVER_INIT_MEMBER(megasys1_state,phantasm) |
r18027 | r18028 | |
3934 | 3934 | { |
3935 | 3935 | astyanax_rom_decode(machine(), "maincpu"); |
3936 | 3936 | /* Sprite RAM is mirrored */ |
3937 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
3937 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x8c000, 0x8cfff, read16_delegate(FUNC(megasys1_state::soldamj_spriteram16_r),this), write16_delegate(FUNC(megasys1_state::soldamj_spriteram16_w),this)); | |
3938 | 3938 | } |
3939 | 3939 | |
3940 | 3940 | DRIVER_INIT_MEMBER(megasys1_state,soldam) |
3941 | 3941 | { |
3942 | 3942 | phantasm_rom_decode(machine(), "maincpu"); |
3943 | 3943 | /* Sprite RAM is mirrored */ |
3944 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
3944 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x8c000, 0x8cfff, read16_delegate(FUNC(megasys1_state::soldamj_spriteram16_r),this), write16_delegate(FUNC(megasys1_state::soldamj_spriteram16_w),this)); | |
3945 | 3945 | } |
3946 | 3946 | |
3947 | 3947 | |
r18027 | r18028 | |
3978 | 3978 | DRIVER_INIT_MEMBER(megasys1_state,stdragon) |
3979 | 3979 | { |
3980 | 3980 | phantasm_rom_decode(machine(), "maincpu"); |
3981 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x00000, 0x3ffff, read16_delegate(FUNC(megasys1_state::stdragon_mcu_hs_r),this)); | |
3982 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x23ff0, 0x23ff9, write16_delegate(FUNC(megasys1_state::stdragon_mcu_hs_w),this)); | |
3981 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00000, 0x3ffff, read16_delegate(FUNC(megasys1_state::stdragon_mcu_hs_r),this)); | |
3982 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x23ff0, 0x23ff9, write16_delegate(FUNC(megasys1_state::stdragon_mcu_hs_w),this)); | |
3983 | 3983 | } |
3984 | 3984 | |
3985 | 3985 | DRIVER_INIT_MEMBER(megasys1_state,stdragona) |
r18027 | r18028 | |
3988 | 3988 | |
3989 | 3989 | stdragona_gfx_unmangle(machine(), "gfx1"); |
3990 | 3990 | stdragona_gfx_unmangle(machine(), "gfx4"); |
3991 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x00000, 0x3ffff, read16_delegate(FUNC(megasys1_state::stdragon_mcu_hs_r),this)); | |
3992 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x23ff0, 0x23ff9, write16_delegate(FUNC(megasys1_state::stdragon_mcu_hs_w),this)); | |
3991 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00000, 0x3ffff, read16_delegate(FUNC(megasys1_state::stdragon_mcu_hs_r),this)); | |
3992 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x23ff0, 0x23ff9, write16_delegate(FUNC(megasys1_state::stdragon_mcu_hs_w),this)); | |
3993 | 3993 | } |
3994 | 3994 | |
3995 | 3995 | READ16_MEMBER(megasys1_state::monkelf_input_r) |
r18027 | r18028 | |
4018 | 4018 | UINT16 *ROM = (UINT16*)memregion("maincpu")->base(); |
4019 | 4019 | ROM[0x00744/2] = 0x4e71; // weird check, 0xe000e R is a port-based trap? |
4020 | 4020 | |
4021 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
4021 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xe0000, 0xe000f, read16_delegate(FUNC(megasys1_state::monkelf_input_r),this)); | |
4022 | 4022 | } |
4023 | 4023 | |
4024 | 4024 | /************************************* |
r18027 | r18028 | |
---|---|---|
783 | 783 | |
784 | 784 | DRIVER_INIT_MEMBER(airbustr_state,airbustr) |
785 | 785 | { |
786 | machine().device("master")->memory().space(AS_PROGRAM) | |
786 | machine().device("master")->memory().space(AS_PROGRAM).install_read_handler(0xe000, 0xefff, read8_delegate(FUNC(airbustr_state::devram_r),this)); // protection device lives here | |
787 | 787 | } |
788 | 788 | |
789 | 789 |
r18027 | r18028 | |
---|---|---|
388 | 388 | |
389 | 389 | MACHINE_RESET_MEMBER(pacman_state,superabc) |
390 | 390 | { |
391 | superabc_bank_w( | |
391 | superabc_bank_w(m_maincpu->space(AS_PROGRAM), 0, 0); | |
392 | 392 | } |
393 | 393 | |
394 | 394 | |
r18027 | r18028 | |
5742 | 5742 | static void maketrax_rom_decode(running_machine &machine) |
5743 | 5743 | { |
5744 | 5744 | pacman_state *state = machine.driver_data<pacman_state>(); |
5745 | address_space &space = | |
5745 | address_space &space = state->m_maincpu->space(AS_PROGRAM); | |
5746 | 5746 | UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x4000); |
5747 | 5747 | UINT8 *rom = machine.root_device().memregion("maincpu")->base(); |
5748 | 5748 | |
r18027 | r18028 | |
5766 | 5766 | DRIVER_INIT_MEMBER(pacman_state,maketrax) |
5767 | 5767 | { |
5768 | 5768 | /* set up protection handlers */ |
5769 | m_maincpu->space(AS_PROGRAM)->install_read_handler(0x5080, 0x50bf, read8_delegate(FUNC(pacman_state::maketrax_special_port2_r),this)); | |
5770 | m_maincpu->space(AS_PROGRAM)->install_read_handler(0x50c0, 0x50ff, read8_delegate(FUNC(pacman_state::maketrax_special_port3_r),this)); | |
5769 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x5080, 0x50bf, read8_delegate(FUNC(pacman_state::maketrax_special_port2_r),this)); | |
5770 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x50c0, 0x50ff, read8_delegate(FUNC(pacman_state::maketrax_special_port3_r),this)); | |
5771 | 5771 | |
5772 | 5772 | maketrax_rom_decode(machine()); |
5773 | 5773 | } |
r18027 | r18028 | |
5775 | 5775 | static void korosuke_rom_decode(running_machine &machine) |
5776 | 5776 | { |
5777 | 5777 | pacman_state *state = machine.driver_data<pacman_state>(); |
5778 | address_space &space = | |
5778 | address_space &space = state->m_maincpu->space(AS_PROGRAM); | |
5779 | 5779 | UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x4000); |
5780 | 5780 | UINT8 *rom = machine.root_device().memregion("maincpu")->base(); |
5781 | 5781 | |
r18027 | r18028 | |
5799 | 5799 | DRIVER_INIT_MEMBER(pacman_state,korosuke) |
5800 | 5800 | { |
5801 | 5801 | /* set up protection handlers */ |
5802 | m_maincpu->space(AS_PROGRAM)->install_read_handler(0x5080, 0x5080, read8_delegate(FUNC(pacman_state::korosuke_special_port2_r),this)); | |
5803 | m_maincpu->space(AS_PROGRAM)->install_read_handler(0x50c0, 0x50ff, read8_delegate(FUNC(pacman_state::korosuke_special_port3_r),this)); | |
5802 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x5080, 0x5080, read8_delegate(FUNC(pacman_state::korosuke_special_port2_r),this)); | |
5803 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x50c0, 0x50ff, read8_delegate(FUNC(pacman_state::korosuke_special_port3_r),this)); | |
5804 | 5804 | |
5805 | 5805 | korosuke_rom_decode(machine()); |
5806 | 5806 | } |
r18027 | r18028 | |
6102 | 6102 | DRIVER_INIT_MEMBER(pacman_state,mspacii) |
6103 | 6103 | { |
6104 | 6104 | // protection |
6105 | m_maincpu->space(AS_PROGRAM) | |
6105 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x504d, 0x506f, read8_delegate(FUNC(pacman_state::mspacii_protection_r), this)); | |
6106 | 6106 | } |
6107 | 6107 | |
6108 | 6108 | DRIVER_INIT_MEMBER(pacman_state,superabc) |
r18027 | r18028 | |
6163 | 6163 | { |
6164 | 6164 | |
6165 | 6165 | /* extra memory */ |
6166 | m_maincpu->space(AS_PROGRAM) | |
6166 | m_maincpu->space(AS_PROGRAM).install_ram(0x4800, 0x4bff); | |
6167 | 6167 | |
6168 | 6168 | /* protection? */ |
6169 | m_maincpu->space(AS_PROGRAM) | |
6169 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x3000, 0x3fff, read8_delegate(FUNC(pacman_state::cannonbp_protection_r),this)); | |
6170 | 6170 | } |
6171 | 6171 | |
6172 | 6172 |
r18027 | r18028 | |
---|---|---|
1036 | 1036 | |
1037 | 1037 | // m_prot2 = 0x00; |
1038 | 1038 | |
1039 | address_space | |
1039 | address_space &sp = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1040 | 1040 | UINT8 *rom = memregion("maincpu")->base(); |
1041 | 1041 | |
1042 | 1042 | // Plug previous address range with ROM access |
1043 | sp | |
1043 | sp.install_rom(m_prot1_addr + 0, m_prot1_addr + 9, rom + m_prot1_addr); | |
1044 | 1044 | |
1045 | 1045 | m_prot1_addr = (data << 4) ^ 0x8340; |
1046 | 1046 | |
1047 | 1047 | // Add protection memory range |
1048 | sp->install_write_handler(m_prot1_addr + 0, m_prot1_addr + 7, write16_delegate(FUNC(igs011_state::igs011_prot1_w), this)); | |
1049 | sp->install_read_handler (m_prot1_addr + 8, m_prot1_addr + 9, read16_delegate(FUNC(igs011_state::igs011_prot1_r), this)); | |
1048 | sp.install_write_handler(m_prot1_addr + 0, m_prot1_addr + 7, write16_delegate(FUNC(igs011_state::igs011_prot1_w), this)); | |
1049 | sp.install_read_handler (m_prot1_addr + 8, m_prot1_addr + 9, read16_delegate(FUNC(igs011_state::igs011_prot1_r), this)); | |
1050 | 1050 | } |
1051 | 1051 | /* |
1052 | 1052 | READ16_MEMBER(igs011_state::igs011_prot_fake_r) |
r18027 | r18028 | |
1835 | 1835 | |
1836 | 1836 | drgnwrld_type2_decrypt(machine()); |
1837 | 1837 | drgnwrld_gfx_decrypt(machine()); |
1838 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1838 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xd4c0, 0xd4ff, read16_delegate(FUNC(igs011_state::drgnwrldv21_igs011_prot2_r), this)); | |
1839 | 1839 | /* |
1840 | 1840 | // PROTECTION CHECKS |
1841 | 1841 | // bp 32ee; bp 11ca8; bp 23d5e; bp 23fd0; bp 24170; bp 24348; bp 2454e; bp 246cc; bp 24922; bp 24b66; bp 24de2; bp 2502a; bp 25556; bp 269de; bp 2766a; bp 2a830 |
r18027 | r18028 | |
1975 | 1975 | |
1976 | 1976 | dbc_decrypt(machine()); |
1977 | 1977 | |
1978 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1978 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x10600, 0x107ff, read16_delegate(FUNC(igs011_state::dbc_igs011_prot2_r), this)); | |
1979 | 1979 | /* |
1980 | 1980 | // PROTECTION CHECKS |
1981 | 1981 | rom[0x04c42/2] = 0x602e; // 004C42: 6604 bne 4c48 (rom test error otherwise) |
r18027 | r18028 | |
2005 | 2005 | |
2006 | 2006 | ryukobou_decrypt(machine()); |
2007 | 2007 | |
2008 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2008 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x10600, 0x107ff, read16_delegate(FUNC(igs011_state::ryukobou_igs011_prot2_r), this)); | |
2009 | 2009 | |
2010 | 2010 | // PROTECTION CHECKS |
2011 | 2011 | // rom[0x2df68/2] = 0x4e75; // 02DF68: 4E56 FE00 link A6, #-$200 (fills palette with pink otherwise) |
r18027 | r18028 | |
---|---|---|
2744 | 2744 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_NONE, 0x0000); |
2745 | 2745 | |
2746 | 2746 | /* install a handler to catch protection checks */ |
2747 | m_mayday_protection = machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2747 | m_mayday_protection = machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xa190, 0xa191, read8_delegate(FUNC(williams_state::mayday_protection_r),this)); | |
2748 | 2748 | } |
2749 | 2749 | |
2750 | 2750 | |
r18027 | r18028 | |
2778 | 2778 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000); |
2779 | 2779 | |
2780 | 2780 | /* bubbles has a full 8-bit-wide CMOS */ |
2781 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2781 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xcc00, 0xcfff, write8_delegate(FUNC(williams_state::bubbles_cmos_w),this)); | |
2782 | 2782 | } |
2783 | 2783 | |
2784 | 2784 | |
r18027 | r18028 | |
2813 | 2813 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000); |
2814 | 2814 | |
2815 | 2815 | /* add a third PIA */ |
2816 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2816 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xc808, 0xc80b, read8_delegate(FUNC(pia6821_device::read), pia_3), write8_delegate(FUNC(pia6821_device::write), pia_3)); | |
2817 | 2817 | |
2818 | 2818 | /* install extra input handlers */ |
2819 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xc800, 0xc800, "AN0"); | |
2820 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xc801, 0xc801, "AN1"); | |
2821 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xc802, 0xc802, "AN2"); | |
2822 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xc803, 0xc803, "AN3"); | |
2819 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0xc800, 0xc800, "AN0"); | |
2820 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0xc801, 0xc801, "AN1"); | |
2821 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0xc802, 0xc802, "AN2"); | |
2822 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0xc803, 0xc803, "AN3"); | |
2823 | 2823 | } |
2824 | 2824 | |
2825 | 2825 | |
2826 | 2826 | DRIVER_INIT_MEMBER(williams_state,alienar) |
2827 | 2827 | { |
2828 | 2828 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000); |
2829 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2829 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write(0xcbff, 0xcbff); | |
2830 | 2830 | } |
2831 | 2831 | |
2832 | 2832 | |
2833 | 2833 | DRIVER_INIT_MEMBER(williams_state,alienaru) |
2834 | 2834 | { |
2835 | 2835 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000); |
2836 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2836 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write(0xcbff, 0xcbff); | |
2837 | 2837 | } |
2838 | 2838 | |
2839 | 2839 |
r18027 | r18028 | |
---|---|---|
71 | 71 | // rising edge |
72 | 72 | if (state) |
73 | 73 | { |
74 | address_space &space = | |
74 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
75 | 75 | dec8_mxc06_karn_buffer_spriteram_w(space, 0, 0); |
76 | 76 | } |
77 | 77 | } |
r18027 | r18028 | |
3524 | 3524 | /* Ghostbusters, Darwin, Oscar use a "Deco 222" custom 6502 for sound. */ |
3525 | 3525 | DRIVER_INIT_MEMBER(dec8_state,deco222) |
3526 | 3526 | { |
3527 | address_space &space = | |
3527 | address_space &space = machine().device("audiocpu")->memory().space(AS_PROGRAM); | |
3528 | 3528 | int A; |
3529 | 3529 | UINT8 *decrypt; |
3530 | 3530 | UINT8 *rom; |
r18027 | r18028 | |
---|---|---|
80 | 80 | |
81 | 81 | static void cage_irq_callback(running_machine &machine, int reason) |
82 | 82 | { |
83 | address_space &space = | |
83 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
84 | 84 | |
85 | 85 | if (reason) |
86 | 86 | atarigen_sound_int_gen(machine.device("maincpu")); |
r18027 | r18028 | |
1274 | 1274 | m_protection_w = tmek_protection_w; |
1275 | 1275 | |
1276 | 1276 | /* temp hack */ |
1277 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1277 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xd72000, 0xd75fff, write32_delegate(FUNC(atarigt_state::tmek_pf_w),this)); | |
1278 | 1278 | } |
1279 | 1279 | |
1280 | 1280 |
r18027 | r18028 | |
---|---|---|
407 | 407 | /* bit 5 = select work RAM or palette */ |
408 | 408 | if (lines & 0x20) |
409 | 409 | { |
410 | device->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x03ff, "bank3"); | |
411 | device->memory().space(AS_PROGRAM)->install_write_handler(0x0000, 0x03ff, write8_delegate(FUNC(crimfght_state::paletteram_xBBBBBGGGGGRRRRR_byte_be_w), state)); | |
410 | device->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x03ff, "bank3"); | |
411 | device->memory().space(AS_PROGRAM).install_write_handler(0x0000, 0x03ff, write8_delegate(FUNC(crimfght_state::paletteram_xBBBBBGGGGGRRRRR_byte_be_w), state)); | |
412 | 412 | state->membank("bank3")->set_base(state->m_generic_paletteram_8); |
413 | 413 | } |
414 | 414 | else |
415 | device->memory().space(AS_PROGRAM) | |
415 | device->memory().space(AS_PROGRAM).install_readwrite_bank(0x0000, 0x03ff, "bank1"); /* RAM */ | |
416 | 416 | |
417 | 417 | /* bit 6 = enable char ROM reading through the video RAM */ |
418 | 418 | k052109_set_rmrd_line(state->m_k052109, (lines & 0x40) ? ASSERT_LINE : CLEAR_LINE); |
r18027 | r18028 | |
---|---|---|
459 | 459 | |
460 | 460 | /* If this value is increased then something has gone wrong and the protection failed */ |
461 | 461 | /* Write-protect it for now */ |
462 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
462 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x109e98, 0x109e9b, read16_delegate(FUNC(pirates_state::genix_prot_r),this)); | |
463 | 463 | } |
464 | 464 | |
465 | 465 |
r18027 | r18028 | |
---|---|---|
400 | 400 | |
401 | 401 | DRIVER_INIT_MEMBER(darkmist_state,darkmist) |
402 | 402 | { |
403 | address_space &space = | |
403 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
404 | 404 | int i, len; |
405 | 405 | UINT8 *ROM = machine().root_device().memregion("maincpu")->base(); |
406 | 406 | UINT8 *buffer = auto_alloc_array(machine(), UINT8, 0x10000); |
r18027 | r18028 | |
---|---|---|
40 | 40 | /* swap the write handlers between ROM and bank 1 based on the bit */ |
41 | 41 | if ((data & 1) == 0) |
42 | 42 | /* overlay disabled, map RAM on 0x000000 */ |
43 | device->machine().device("maincpu")->memory().space(AS_PROGRAM) | |
43 | device->machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(0x000000, 0x07ffff, "bank1"); | |
44 | 44 | |
45 | 45 | else |
46 | 46 | /* overlay enabled, map Amiga system ROM on 0x000000 */ |
47 | device->machine().device("maincpu")->memory().space(AS_PROGRAM) | |
47 | device->machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x000000, 0x07ffff); | |
48 | 48 | } |
49 | 49 | |
50 | 50 |
r18027 | r18028 | |
---|---|---|
4573 | 4573 | READ16_MEMBER(nmk16_state::vandykeb_r){ return 0x0000; } |
4574 | 4574 | DRIVER_INIT_MEMBER(nmk16_state,vandykeb) |
4575 | 4575 | { |
4576 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x08000e, 0x08000f, read16_delegate(FUNC(nmk16_state::vandykeb_r),this)); | |
4577 | machine().device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x08001e, 0x08001f); | |
4576 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x08000e, 0x08000f, read16_delegate(FUNC(nmk16_state::vandykeb_r),this)); | |
4577 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write(0x08001e, 0x08001f); | |
4578 | 4578 | } |
4579 | 4579 | |
4580 | 4580 |
r18027 | r18028 | |
---|---|---|
1155 | 1155 | running_machine &machine = *(running_machine *)param; |
1156 | 1156 | UINT64 result = ~(UINT64)0 >> (64 - 8*size); |
1157 | 1157 | device_t *device = NULL; |
1158 | address_space *space; | |
1159 | 1158 | |
1160 | 1159 | switch (spacenum) |
1161 | 1160 | { |
r18027 | r18028 | |
1167 | 1166 | device = expression_get_device(machine, name); |
1168 | 1167 | if (device == NULL) |
1169 | 1168 | device = debug_cpu_get_visible_cpu(machine); |
1170 | space = device->memory().space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_LOGICAL)); | |
1171 | if (space != NULL) | |
1172 | result = debug_read_memory(*space, space->address_to_byte(address), size, true); | |
1169 | if (device->memory().has_space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_LOGICAL))) | |
1170 | { | |
1171 | address_space &space = device->memory().space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_LOGICAL)); | |
1172 | result = debug_read_memory(space, space.address_to_byte(address), size, true); | |
1173 | } | |
1173 | 1174 | break; |
1174 | 1175 | |
1175 | 1176 | case EXPSPACE_PROGRAM_PHYSICAL: |
r18027 | r18028 | |
1180 | 1181 | device = expression_get_device(machine, name); |
1181 | 1182 | if (device == NULL) |
1182 | 1183 | device = debug_cpu_get_visible_cpu(machine); |
1183 | space = device->memory().space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_PHYSICAL)); | |
1184 | if (space != NULL) | |
1185 | result = debug_read_memory(*space, space->address_to_byte(address), size, false); | |
1184 | if (device->memory().has_space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_LOGICAL))) | |
1185 | { | |
1186 | address_space &space = device->memory().space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_LOGICAL)); | |
1187 | result = debug_read_memory(space, space.address_to_byte(address), size, false); | |
1188 | } | |
1186 | 1189 | break; |
1187 | 1190 | |
1188 | 1191 | case EXPSPACE_OPCODE: |
r18027 | r18028 | |
1191 | 1194 | device = expression_get_device(machine, name); |
1192 | 1195 | if (device == NULL) |
1193 | 1196 | device = debug_cpu_get_visible_cpu(machine); |
1194 | result = expression_read_program_direct( | |
1197 | result = expression_read_program_direct(device->memory().space(AS_PROGRAM), (spacenum == EXPSPACE_OPCODE), address, size); | |
1195 | 1198 | break; |
1196 | 1199 | |
1197 | 1200 | case EXPSPACE_REGION: |
r18027 | r18028 | |
1321 | 1324 | { |
1322 | 1325 | running_machine &machine = *(running_machine *)param; |
1323 | 1326 | device_t *device = NULL; |
1324 | address_space *space; | |
1325 | 1327 | |
1326 | 1328 | switch (spacenum) |
1327 | 1329 | { |
r18027 | r18028 | |
1333 | 1335 | device = expression_get_device(machine, name); |
1334 | 1336 | if (device == NULL) |
1335 | 1337 | device = debug_cpu_get_visible_cpu(machine); |
1336 | space = device->memory().space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_LOGICAL)); | |
1337 | if (space != NULL) | |
1338 | debug_write_memory(*space, space->address_to_byte(address), data, size, true); | |
1338 | if (device->memory().has_space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_LOGICAL))) | |
1339 | { | |
1340 | address_space &space = device->memory().space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_LOGICAL)); | |
1341 | debug_write_memory(space, space.address_to_byte(address), data, size, true); | |
1342 | } | |
1339 | 1343 | break; |
1340 | 1344 | |
1341 | 1345 | case EXPSPACE_PROGRAM_PHYSICAL: |
r18027 | r18028 | |
1346 | 1350 | device = expression_get_device(machine, name); |
1347 | 1351 | if (device == NULL) |
1348 | 1352 | device = debug_cpu_get_visible_cpu(machine); |
1349 | space = device->memory().space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_PHYSICAL)); | |
1350 | if (space != NULL) | |
1351 | debug_write_memory(*space, space->address_to_byte(address), data, size, false); | |
1353 | if (device->memory().has_space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_LOGICAL))) | |
1354 | { | |
1355 | address_space &space = device->memory().space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_LOGICAL)); | |
1356 | debug_write_memory(space, space.address_to_byte(address), data, size, false); | |
1357 | } | |
1352 | 1358 | break; |
1353 | 1359 | |
1354 | 1360 | case EXPSPACE_OPCODE: |
r18027 | r18028 | |
1357 | 1363 | device = expression_get_device(machine, name); |
1358 | 1364 | if (device == NULL) |
1359 | 1365 | device = debug_cpu_get_visible_cpu(machine); |
1360 | expression_write_program_direct( | |
1366 | expression_write_program_direct(device->memory().space(AS_PROGRAM), (spacenum == EXPSPACE_OPCODE), address, size, data); | |
1361 | 1367 | break; |
1362 | 1368 | |
1363 | 1369 | case EXPSPACE_REGION: |
r18027 | r18028 | |
1515 | 1521 | } |
1516 | 1522 | if (device == NULL) |
1517 | 1523 | device = debug_cpu_get_visible_cpu(machine); |
1518 | if (device->memory().space(AS_PROGRAM + (space - EXPSPACE_PROGRAM_LOGICAL)) | |
1524 | if (!device->memory().has_space(AS_PROGRAM + (space - EXPSPACE_PROGRAM_LOGICAL))) | |
1519 | 1525 | return expression_error::NO_SUCH_MEMORY_SPACE; |
1520 | 1526 | break; |
1521 | 1527 | |
r18027 | r18028 | |
1531 | 1537 | } |
1532 | 1538 | if (device == NULL) |
1533 | 1539 | device = debug_cpu_get_visible_cpu(machine); |
1534 | if (device->memory().space(AS_PROGRAM + (space - EXPSPACE_PROGRAM_PHYSICAL)) | |
1540 | if (!device->memory().has_space(AS_PROGRAM + (space - EXPSPACE_PROGRAM_PHYSICAL))) | |
1535 | 1541 | return expression_error::NO_SUCH_MEMORY_SPACE; |
1536 | 1542 | break; |
1537 | 1543 | |
r18027 | r18028 | |
1545 | 1551 | } |
1546 | 1552 | if (device == NULL) |
1547 | 1553 | device = debug_cpu_get_visible_cpu(machine); |
1548 | if (device->memory().space(AS_PROGRAM) | |
1554 | if (!device->memory().has_space(AS_PROGRAM)) | |
1549 | 1555 | return expression_error::NO_SUCH_MEMORY_SPACE; |
1550 | 1556 | break; |
1551 | 1557 | |
r18027 | r18028 | |
1674 | 1680 | // add entries to enable/disable unmap reporting for each space |
1675 | 1681 | if (m_memory != NULL) |
1676 | 1682 | { |
1677 | if (m_memory->space(AS_PROGRAM) != NULL) | |
1678 | m_symtable.add("logunmap", (void *)m_memory->space(AS_PROGRAM), get_logunmap, set_logunmap); | |
1679 | if (m_memory->space(AS_DATA) != NULL) | |
1680 | m_symtable.add("logunmapd", (void *)m_memory->space(AS_DATA), get_logunmap, set_logunmap); | |
1681 | if (m_memory->space(AS_IO) != NULL) | |
1682 | m_symtable.add("logunmapi", (void *)m_memory->space(AS_IO), get_logunmap, set_logunmap); | |
1683 | if (m_memory->has_space(AS_PROGRAM)) | |
1684 | m_symtable.add("logunmap", (void *)&m_memory->space(AS_PROGRAM), get_logunmap, set_logunmap); | |
1685 | if (m_memory->has_space(AS_DATA)) | |
1686 | m_symtable.add("logunmapd", (void *)&m_memory->space(AS_DATA), get_logunmap, set_logunmap); | |
1687 | if (m_memory->has_space(AS_IO)) | |
1688 | m_symtable.add("logunmapi", (void *)&m_memory->space(AS_IO), get_logunmap, set_logunmap); | |
1683 | 1689 | } |
1684 | 1690 | |
1685 | 1691 | // add all registers into it |
r18027 | r18028 | |
2039 | 2045 | #ifdef MAME_DEBUG |
2040 | 2046 | if (m_memory != NULL && m_disasm != NULL) |
2041 | 2047 | { |
2042 | address_space &space = | |
2048 | address_space &space = m_memory->space(AS_PROGRAM); | |
2043 | 2049 | int bytes = space.address_to_byte(result & DASMFLAG_LENGTHMASK); |
2044 | 2050 | assert(bytes >= m_disasm->min_opcode_bytes()); |
2045 | 2051 | assert(bytes <= m_disasm->max_opcode_bytes()); |
r18027 | r18028 | |
2467 | 2473 | } |
2468 | 2474 | |
2469 | 2475 | // update the watchpoint flags to include us |
2470 | if (m_memory != NULL && m_memory->space(AS_PROGRAM) != NULL) | |
2471 | watchpoint_update_flags(*m_memory->space(AS_PROGRAM)); | |
2476 | if (m_memory != NULL && m_memory->has_space(AS_PROGRAM)) | |
2477 | watchpoint_update_flags(m_memory->space(AS_PROGRAM)); | |
2472 | 2478 | } |
2473 | 2479 | |
2474 | 2480 | |
r18027 | r18028 | |
2666 | 2672 | return 0; |
2667 | 2673 | |
2668 | 2674 | // no program interface, just fail |
2669 | address_space &space = | |
2675 | address_space &space = m_memory->space(AS_PROGRAM); | |
2670 | 2676 | |
2671 | 2677 | // zero out the buffers |
2672 | 2678 | UINT8 opbuf[64], argbuf[64]; |
r18027 | r18028 | |
3016 | 3022 | assert(m_memory != NULL && m_disasm != NULL); |
3017 | 3023 | |
3018 | 3024 | // determine the adjusted PC |
3019 | address_space &space = | |
3025 | address_space &space = m_memory->space(AS_PROGRAM); | |
3020 | 3026 | offs_t pcbyte = space.address_to_byte(pc) & space.bytemask(); |
3021 | 3027 | |
3022 | 3028 | // fetch the bytes up to the maximum |
r18027 | r18028 | |
---|---|---|
154 | 154 | // first add all the devices' address spaces |
155 | 155 | memory_interface_iterator iter(machine().root_device()); |
156 | 156 | for (device_memory_interface *memintf = iter.first(); memintf != NULL; memintf = iter.next()) |
157 | for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++) | |
158 | { | |
159 | address_space *space = memintf->space(spacenum); | |
160 | if (space != NULL) | |
161 | { | |
162 | name.printf("%s '%s' %s space memory", memintf->device().name(), memintf->device().tag(), space->name()); | |
163 | m_source_list.append(*auto_alloc(machine(), debug_view_memory_source(name, *space))); | |
164 | } | |
165 | } | |
157 | if (&memintf->device() != &machine().root_device()) | |
158 | for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++) | |
159 | if (memintf->has_space(spacenum)) | |
160 | { | |
161 | address_space &space = memintf->space(spacenum); | |
162 | name.printf("%s '%s' %s space memory", memintf->device().name(), memintf->device().tag(), space.name()); | |
163 | m_source_list.append(*auto_alloc(machine(), debug_view_memory_source(name, space))); | |
164 | } | |
166 | 165 | |
167 | 166 | // then add all the memory regions |
168 | 167 | for (memory_region *region = machine().memory().first_region(); region != NULL; region = region->next()) |
r18027 | r18028 | |
---|---|---|
146 | 146 | |
147 | 147 | // commonly-used pass-throughs |
148 | 148 | offs_t pc() const { return (m_state != NULL) ? m_state->pc() : 0; } |
149 | int logaddrchars(address_spacenum spacenum = AS_0) const { return (m_memory != NULL && m_memory->space(spacenum) | |
149 | int logaddrchars(address_spacenum spacenum = AS_0) const { return (m_memory != NULL && m_memory->has_space(spacenum)) ? m_memory->space(spacenum).logaddrchars() : 8; } | |
150 | 150 | int min_opcode_bytes() const { return (m_disasm != NULL) ? m_disasm->max_opcode_bytes() : 1; } |
151 | 151 | int max_opcode_bytes() const { return (m_disasm != NULL) ? m_disasm->max_opcode_bytes() : 1; } |
152 | 152 |
r18027 | r18028 | |
---|---|---|
56 | 56 | : debug_view_source(name, &device), |
57 | 57 | m_device(device), |
58 | 58 | m_disasmintf(dynamic_cast<device_disasm_interface *>(&device)), |
59 | m_space(d | |
59 | m_space(device.memory().space(AS_PROGRAM)) | |
60 | 60 | { |
61 | 61 | } |
62 | 62 | |
r18027 | r18028 | |
202 | 202 | case DCH_HOME: // set the active column to the PC |
203 | 203 | { |
204 | 204 | const debug_view_disasm_source &source = downcast<const debug_view_disasm_source &>(*m_source); |
205 | offs_t pc = source.m_space | |
205 | offs_t pc = source.m_space.address_to_byte(source.m_device.safe_pc()) & source.m_space.logbytemask(); | |
206 | 206 | |
207 | 207 | // figure out which row the pc is on |
208 | 208 | for (int curline = 0; curline < m_allocated.y; curline++) |
r18027 | r18028 | |
241 | 241 | const debug_view_disasm_source &source = downcast<const debug_view_disasm_source &>(*m_source); |
242 | 242 | |
243 | 243 | // compute the increment |
244 | int minlen = source.m_space | |
244 | int minlen = source.m_space.byte_to_address(source.m_disasmintf->min_opcode_bytes()); | |
245 | 245 | if (minlen == 0) minlen = 1; |
246 | int maxlen = source.m_space | |
246 | int maxlen = source.m_space.byte_to_address(source.m_disasmintf->max_opcode_bytes()); | |
247 | 247 | if (maxlen == 0) maxlen = 1; |
248 | 248 | |
249 | 249 | // start off numinstrs back |
r18027 | r18028 | |
252 | 252 | curpc = 0; |
253 | 253 | |
254 | 254 | /* loop until we find what we are looking for */ |
255 | offs_t targetpcbyte = source.m_space | |
255 | offs_t targetpcbyte = source.m_space.address_to_byte(targetpc) & source.m_space.logbytemask(); | |
256 | 256 | offs_t fillpcbyte = targetpcbyte; |
257 | 257 | offs_t lastgoodpc = targetpc; |
258 | 258 | while (1) |
259 | 259 | { |
260 | 260 | // fill the buffer up to the target |
261 | offs_t curpcbyte = source.m_space | |
261 | offs_t curpcbyte = source.m_space.address_to_byte(curpc) & source.m_space.logbytemask(); | |
262 | 262 | UINT8 opbuf[1024], argbuf[1024]; |
263 | 263 | while (curpcbyte < fillpcbyte) |
264 | 264 | { |
265 | 265 | fillpcbyte--; |
266 | opbuf[1000 + fillpcbyte - targetpcbyte] = debug_read_opcode(*source.m_space, fillpcbyte, 1, FALSE); | |
267 | argbuf[1000 + fillpcbyte - targetpcbyte] = debug_read_opcode(*source.m_space, fillpcbyte, 1, TRUE); | |
266 | opbuf[1000 + fillpcbyte - targetpcbyte] = debug_read_opcode(source.m_space, fillpcbyte, 1, FALSE); | |
267 | argbuf[1000 + fillpcbyte - targetpcbyte] = debug_read_opcode(source.m_space, fillpcbyte, 1, TRUE); | |
268 | 268 | } |
269 | 269 | |
270 | 270 | // loop until we get past the target instruction |
r18027 | r18028 | |
273 | 273 | offs_t scanpc; |
274 | 274 | for (scanpc = curpc; scanpc < targetpc; scanpc += instlen) |
275 | 275 | { |
276 | offs_t scanpcbyte = source.m_space | |
276 | offs_t scanpcbyte = source.m_space.address_to_byte(scanpc) & source.m_space.logbytemask(); | |
277 | 277 | offs_t physpcbyte = scanpcbyte; |
278 | 278 | |
279 | 279 | // get the disassembly, but only if mapped |
280 | 280 | instlen = 1; |
281 | if (debug_cpu_translate( | |
281 | if (debug_cpu_translate(source.m_space, TRANSLATE_FETCH, &physpcbyte)) | |
282 | 282 | { |
283 | 283 | char dasmbuffer[100]; |
284 | 284 | instlen = source.m_device.debug()->disassemble(dasmbuffer, scanpc, &opbuf[1000 + scanpcbyte - targetpcbyte], &argbuf[1000 + scanpcbyte - targetpcbyte]) & DASMFLAG_LENGTHMASK; |
r18027 | r18028 | |
322 | 322 | // output the first value |
323 | 323 | int offset = 0; |
324 | 324 | if (maxchars >= char_num * minbytes) |
325 | offset = sprintf(string, "%s", core_i64_format(debug_read_opcode( | |
325 | offset = sprintf(string, "%s", core_i64_format(debug_read_opcode(source.m_space, pcbyte, minbytes, FALSE), minbytes * char_num, source.is_octal())); | |
326 | 326 | |
327 | 327 | // output subsequent values |
328 | 328 | int byte; |
329 | 329 | for (byte = minbytes; byte < numbytes && offset + 1 + char_num * minbytes < maxchars; byte += minbytes) |
330 | offset += sprintf(&string[offset], " %s", core_i64_format(debug_read_opcode( | |
330 | offset += sprintf(&string[offset], " %s", core_i64_format(debug_read_opcode(source.m_space, pcbyte + byte, minbytes, encrypted), minbytes * char_num, source.is_octal())); | |
331 | 331 | |
332 | 332 | // if we ran out of room, indicate more |
333 | 333 | string[maxchars - 1] = 0; |
r18027 | r18028 | |
348 | 348 | int char_num = source.is_octal() ? 3 : 2; |
349 | 349 | |
350 | 350 | // determine how many characters we need for an address and set the divider |
351 | m_divider1 = 1 + (source.m_space | |
351 | m_divider1 = 1 + (source.m_space.logaddrchars()/2*char_num) + 1; | |
352 | 352 | |
353 | 353 | // assume a fixed number of characters for the disassembly |
354 | 354 | m_divider2 = m_divider1 + 1 + m_dasm_width + 1; |
r18027 | r18028 | |
358 | 358 | int maxbytes = source.m_disasmintf->max_opcode_bytes(); |
359 | 359 | |
360 | 360 | // ensure that the PC is aligned to the minimum opcode size |
361 | pc &= ~source.m_space | |
361 | pc &= ~source.m_space.byte_to_address_end(minbytes - 1); | |
362 | 362 | |
363 | 363 | // set the width of the third column according to display mode |
364 | 364 | if (m_right_column == DASM_RIGHTCOL_RAW || m_right_column == DASM_RIGHTCOL_ENCRYPTED) |
r18027 | r18028 | |
390 | 390 | for (int line = 0; line < lines; line++) |
391 | 391 | { |
392 | 392 | // convert PC to a byte offset |
393 | offs_t pcbyte = source.m_space | |
393 | offs_t pcbyte = source.m_space.address_to_byte(pc) & source.m_space.logbytemask(); | |
394 | 394 | |
395 | 395 | // save a copy of the previous line as a backup if we're only doing one line |
396 | 396 | int instr = startline + line; |
r18027 | r18028 | |
401 | 401 | |
402 | 402 | // convert back and set the address of this instruction |
403 | 403 | m_byteaddress[instr] = pcbyte; |
404 | sprintf(&destbuf[0], " %s ", core_i64_format(source.m_space | |
404 | sprintf(&destbuf[0], " %s ", core_i64_format(source.m_space.byte_to_address(pcbyte), source.m_space.logaddrchars()/2*char_num, source.is_octal())); | |
405 | 405 | |
406 | 406 | // make sure we can translate the address, and then disassemble the result |
407 | 407 | char buffer[100]; |
408 | 408 | int numbytes = 0; |
409 | 409 | offs_t physpcbyte = pcbyte; |
410 | if (debug_cpu_translate( | |
410 | if (debug_cpu_translate(source.m_space, TRANSLATE_FETCH_DEBUG, &physpcbyte)) | |
411 | 411 | { |
412 | 412 | UINT8 opbuf[64], argbuf[64]; |
413 | 413 | |
414 | 414 | // fetch the bytes up to the maximum |
415 | 415 | for (numbytes = 0; numbytes < maxbytes; numbytes++) |
416 | 416 | { |
417 | opbuf[numbytes] = debug_read_opcode(*source.m_space, pcbyte + numbytes, 1, FALSE); | |
418 | argbuf[numbytes] = debug_read_opcode(*source.m_space, pcbyte + numbytes, 1, TRUE); | |
417 | opbuf[numbytes] = debug_read_opcode(source.m_space, pcbyte + numbytes, 1, FALSE); | |
418 | argbuf[numbytes] = debug_read_opcode(source.m_space, pcbyte + numbytes, 1, TRUE); | |
419 | 419 | } |
420 | 420 | |
421 | 421 | // disassemble the result |
422 | pc += numbytes = source.m_device.debug()->disassemble(buffer, pc & source.m_space | |
422 | pc += numbytes = source.m_device.debug()->disassemble(buffer, pc & source.m_space.logaddrmask(), opbuf, argbuf) & DASMFLAG_LENGTHMASK; | |
423 | 423 | } |
424 | 424 | else |
425 | 425 | strcpy(buffer, "<unmapped>"); |
r18027 | r18028 | |
431 | 431 | if (m_right_column == DASM_RIGHTCOL_RAW || m_right_column == DASM_RIGHTCOL_ENCRYPTED) |
432 | 432 | { |
433 | 433 | // get the bytes |
434 | numbytes = source.m_space | |
434 | numbytes = source.m_space.address_to_byte(numbytes) & source.m_space.logbytemask(); | |
435 | 435 | generate_bytes(pcbyte, numbytes, minbytes, &destbuf[m_divider2], m_allocated.x - m_divider2, m_right_column == DASM_RIGHTCOL_ENCRYPTED); |
436 | 436 | } |
437 | 437 | else if (m_right_column == DASM_RIGHTCOL_COMMENTS) |
438 | 438 | { |
439 | 439 | // get and add the comment, if present |
440 | offs_t comment_address = source.m_space | |
440 | offs_t comment_address = source.m_space.byte_to_address(m_byteaddress[instr]); | |
441 | 441 | const char *text = source.m_device.debug()->comment_text(comment_address); |
442 | 442 | if (text != NULL) |
443 | 443 | sprintf(&destbuf[m_divider2], "// %.*s", m_allocated.x - m_divider2 - 1, text); |
r18027 | r18028 | |
449 | 449 | } |
450 | 450 | |
451 | 451 | // update opcode base information |
452 | m_last_direct_decrypted = source.m_space->direct().decrypted(); | |
453 | m_last_direct_raw = source.m_space->direct().raw(); | |
452 | m_last_direct_decrypted = source.m_space.direct().decrypted(); | |
453 | m_last_direct_raw = source.m_space.direct().raw(); | |
454 | 454 | m_last_change_count = source.m_device.debug()->comment_change_count(); |
455 | 455 | |
456 | 456 | // now longer need to recompute |
r18027 | r18028 | |
469 | 469 | const debug_view_disasm_source &source = downcast<const debug_view_disasm_source &>(*m_source); |
470 | 470 | |
471 | 471 | offs_t pc = source.m_device.safe_pc(); |
472 | offs_t pcbyte = source.m_space | |
472 | offs_t pcbyte = source.m_space.address_to_byte(pc) & source.m_space.logbytemask(); | |
473 | 473 | |
474 | 474 | // update our context; if the expression is dirty, recompute |
475 | 475 | if (m_expression.dirty()) |
r18027 | r18028 | |
480 | 480 | UINT64 result = m_expression.value(); |
481 | 481 | if (result != previous) |
482 | 482 | { |
483 | offs_t resultbyte = source.m_space | |
483 | offs_t resultbyte = source.m_space.address_to_byte(result) & source.m_space.logbytemask(); | |
484 | 484 | |
485 | 485 | // see if the new result is an address we already have |
486 | 486 | UINT32 row; |
r18027 | r18028 | |
498 | 498 | } |
499 | 499 | |
500 | 500 | // if the opcode base has changed, rework things |
501 | if (source.m_space | |
501 | if (source.m_space.direct().decrypted() != m_last_direct_decrypted || source.m_space.direct().raw() != m_last_direct_raw) | |
502 | 502 | m_recompute = true; |
503 | 503 | |
504 | 504 | // if the comments have changed, redo it |
r18027 | r18028 | |
517 | 517 | m_topleft.x = 0; |
518 | 518 | |
519 | 519 | // recompute from where we last recomputed! |
520 | recompute(source.m_space | |
520 | recompute(source.m_space.byte_to_address(m_byteaddress[0]), 0, m_total.y); | |
521 | 521 | } |
522 | 522 | else |
523 | 523 | { |
r18027 | r18028 | |
579 | 579 | else |
580 | 580 | { |
581 | 581 | for (device_debug::breakpoint *bp = source.m_device.debug()->breakpoint_first(); bp != NULL; bp = bp->next()) |
582 | if (m_byteaddress[effrow] == (source.m_space | |
582 | if (m_byteaddress[effrow] == (source.m_space.address_to_byte(bp->address()) & source.m_space.logbytemask())) | |
583 | 583 | attrib = DCA_CHANGED; |
584 | 584 | } |
585 | 585 | |
r18027 | r18028 | |
627 | 627 | offs_t debug_view_disasm::selected_address() |
628 | 628 | { |
629 | 629 | flush_updates(); |
630 | return downcast<const debug_view_disasm_source &>(*m_source).m_space | |
630 | return downcast<const debug_view_disasm_source &>(*m_source).m_space.byte_to_address(m_byteaddress[m_cursor.y]); | |
631 | 631 | } |
632 | 632 | |
633 | 633 | |
r18027 | r18028 | |
695 | 695 | void debug_view_disasm::set_selected_address(offs_t address) |
696 | 696 | { |
697 | 697 | const debug_view_disasm_source &source = downcast<const debug_view_disasm_source &>(*m_source); |
698 | offs_t byteaddress = source.m_space | |
698 | offs_t byteaddress = source.m_space.address_to_byte(address) & source.m_space.logbytemask(); | |
699 | 699 | for (int line = 0; line < m_total.y; line++) |
700 | 700 | if (m_byteaddress[line] == byteaddress) |
701 | 701 | { |
r18027 | r18028 | |
---|---|---|
566 | 566 | return FALSE; |
567 | 567 | |
568 | 568 | /* fetch the space pointer */ |
569 | result = cpu->memory().space(spacenum); | |
570 | if (result == NULL) | |
569 | if (!cpu->memory().has_space(spacenum)) | |
571 | 570 | { |
572 | 571 | debug_console_printf(machine, "No matching memory space found for CPU '%s'\n", cpu->tag()); |
573 | 572 | return FALSE; |
574 | 573 | } |
574 | result = &cpu->memory().space(spacenum); | |
575 | 575 | return TRUE; |
576 | 576 | } |
577 | 577 |
r18027 | r18028 | |
---|---|---|
73 | 73 | public: |
74 | 74 | // getters |
75 | 75 | device_t &device() const { return m_device; } |
76 | address_space | |
76 | address_space &space() const { return m_space; } | |
77 | 77 | |
78 | 78 | private: |
79 | 79 | // internal state |
80 | 80 | device_t & m_device; // underlying device |
81 | 81 | device_disasm_interface *m_disasmintf; // disassembly interface |
82 | address_space | |
82 | address_space & m_space; // address space to display | |
83 | 83 | }; |
84 | 84 | |
85 | 85 |
r18027 | r18028 | |
---|---|---|
479 | 479 | state_register(cpustate, "m6805", device); |
480 | 480 | cpustate->irq_callback = irqcallback; |
481 | 481 | cpustate->device = device; |
482 | cpustate->program = device->space(AS_PROGRAM); | |
482 | cpustate->program = &device->space(AS_PROGRAM); | |
483 | 483 | cpustate->direct = &cpustate->program->direct(); |
484 | 484 | } |
485 | 485 | |
r18027 | r18028 | |
493 | 493 | cpustate->iCount=50000; /* Used to be global */ |
494 | 494 | cpustate->irq_callback = save_irqcallback; |
495 | 495 | cpustate->device = device; |
496 | cpustate->program = device->space(AS_PROGRAM); | |
496 | cpustate->program = &device->space(AS_PROGRAM); | |
497 | 497 | cpustate->direct = &cpustate->program->direct(); |
498 | 498 | |
499 | 499 | /* Force CPU sub-type and relevant masks */ |
r18027 | r18028 | |
---|---|---|
130 | 130 | void v30mz_cpu_device::device_start() |
131 | 131 | { |
132 | 132 | m_irq_callback = static_standard_irq_callback; |
133 | m_program = space(AS_PROGRAM); | |
133 | m_program = &space(AS_PROGRAM); | |
134 | 134 | m_direct = &m_program->direct(); |
135 | m_io = space(AS_IO); | |
135 | m_io = &space(AS_IO); | |
136 | 136 | |
137 | 137 | save_item(NAME(m_regs.w)); |
138 | 138 | save_item(NAME(m_sregs)); |
r18027 | r18028 | |
---|---|---|
117 | 117 | memset(cpustate, 0, sizeof(*cpustate)); |
118 | 118 | cpustate->config = (const lh5801_cpu_core *) device->static_config(); |
119 | 119 | cpustate->device = device; |
120 | cpustate->program = device->space(AS_PROGRAM); | |
121 | cpustate->io = device->space(AS_IO); | |
120 | cpustate->program = &device->space(AS_PROGRAM); | |
121 | cpustate->io = &device->space(AS_IO); | |
122 | 122 | cpustate->direct = &cpustate->program->direct(); |
123 | 123 | } |
124 | 124 |
r18027 | r18028 | |
---|---|---|
377 | 377 | m68_state->irq_callback = irqcallback; |
378 | 378 | m68_state->device = device; |
379 | 379 | |
380 | m68_state->program = device->space(AS_PROGRAM); | |
380 | m68_state->program = &device->space(AS_PROGRAM); | |
381 | 381 | m68_state->direct = &m68_state->program->direct(); |
382 | 382 | |
383 | 383 | /* setup regtable */ |
r18027 | r18028 | |
---|---|---|
217 | 217 | |
218 | 218 | h8->mode_8bit = 0; |
219 | 219 | |
220 | h8->program = device->space(AS_PROGRAM); | |
220 | h8->program = &device->space(AS_PROGRAM); | |
221 | 221 | h8->direct = &h8->program->direct(); |
222 | h8->io = device->space(AS_IO); | |
222 | h8->io = &device->space(AS_IO); | |
223 | 223 | |
224 | 224 | device->save_item(NAME(h8->h8err)); |
225 | 225 | device->save_item(NAME(h8->regs)); |
r18027 | r18028 | |
---|---|---|
234 | 234 | |
235 | 235 | h8->mode_8bit = 1; |
236 | 236 | |
237 | h8->program = device->space(AS_PROGRAM); | |
237 | h8->program = &device->space(AS_PROGRAM); | |
238 | 238 | h8->direct = &h8->program->direct(); |
239 | h8->io = device->space(AS_IO); | |
239 | h8->io = &device->space(AS_IO); | |
240 | 240 | |
241 | 241 | h8->timer[0] = h8->device->machine().scheduler().timer_alloc(FUNC(h8_timer_0_cb), h8); |
242 | 242 | h8->timer[1] = h8->device->machine().scheduler().timer_alloc(FUNC(h8_timer_1_cb), h8); |
r18027 | r18028 | |
---|---|---|
503 | 503 | cpustate->pc_size = pc_size; |
504 | 504 | cpustate->byte_size = byte_size; |
505 | 505 | |
506 | cpustate->program = device->space( AS_PROGRAM ); | |
507 | cpustate->data = device->space( AS_PROGRAM ); | |
506 | cpustate->program = &device->space( AS_PROGRAM ); | |
507 | cpustate->data = &device->space( AS_PROGRAM ); | |
508 | 508 | |
509 | 509 | device->save_item( NAME(cpustate->prev_pc) ); |
510 | 510 | device->save_item( NAME(cpustate->prev_pa) ); |
r18027 | r18028 | |
---|---|---|
834 | 834 | pic16c62x_state *cpustate = get_safe_token(device); |
835 | 835 | |
836 | 836 | cpustate->device = device; |
837 | cpustate->program = device->space(AS_PROGRAM); | |
837 | cpustate->program = &device->space(AS_PROGRAM); | |
838 | 838 | cpustate->direct = &cpustate->program->direct(); |
839 | cpustate->data = device->space(AS_DATA); | |
840 | cpustate->io = device->space(AS_IO); | |
839 | cpustate->data = &device->space(AS_DATA); | |
840 | cpustate->io = &device->space(AS_IO); | |
841 | 841 | |
842 | 842 | cpustate->CONFIG = 0x3fff; |
843 | 843 |
r18027 | r18028 | |
---|---|---|
114 | 114 | memset(unsp->r, 0, sizeof(UINT16) * UNSP_GPR_COUNT); |
115 | 115 | |
116 | 116 | unsp->device = device; |
117 | unsp->program = device->space(AS_PROGRAM); | |
117 | unsp->program = &device->space(AS_PROGRAM); | |
118 | 118 | } |
119 | 119 | |
120 | 120 | static CPU_RESET( unsp ) |
r18027 | r18028 | |
---|---|---|
154 | 154 | { |
155 | 155 | am29000_state *am29000 = get_safe_token(device); |
156 | 156 | |
157 | am29000->program = device->space(AS_PROGRAM); | |
157 | am29000->program = &device->space(AS_PROGRAM); | |
158 | 158 | am29000->direct = &am29000->program->direct(); |
159 | am29000->data = device->space(AS_DATA); | |
159 | am29000->data = &device->space(AS_DATA); | |
160 | 160 | am29000->datadirect = &am29000->data->direct(); |
161 | am29000->io = device->space(AS_IO); | |
161 | am29000->io = &device->space(AS_IO); | |
162 | 162 | am29000->cfg = (PRL_AM29000 | PRL_REV_D) << CFG_PRL_SHIFT; |
163 | 163 | |
164 | 164 | /* Register state for saving */ |
r18027 | r18028 | |
---|---|---|
898 | 898 | m68ki_cpu_core *m68k = m68k_get_safe_token(device); |
899 | 899 | |
900 | 900 | m68k->device = device; |
901 | m68k->program = device->space(AS_PROGRAM); | |
901 | m68k->program = &device->space(AS_PROGRAM); | |
902 | 902 | m68k->int_ack_callback = irqcallback; |
903 | 903 | |
904 | 904 | /* disable all MMUs */ |
r18027 | r18028 | |
2065 | 2065 | m68k->m68307SERIAL->reset(); |
2066 | 2066 | m68k->m68307TIMER->reset(); |
2067 | 2067 | |
2068 | m68k->internal = device->space(AS_PROGRAM); | |
2068 | m68k->internal = &device->space(AS_PROGRAM); | |
2069 | 2069 | m68k->m68307_base = 0xbfff; |
2070 | 2070 | m68k->m68307_scrhigh = 0x0007; |
2071 | 2071 | m68k->m68307_scrlow = 0xf010; |
r18027 | r18028 | |
2862 | 2862 | |
2863 | 2863 | m68k->m68340_base = 0x00000000; |
2864 | 2864 | |
2865 | m68k->internal = device->space(AS_PROGRAM); | |
2865 | m68k->internal = &device->space(AS_PROGRAM); | |
2866 | 2866 | |
2867 | 2867 | define_state(device); |
2868 | 2868 | } |
r18027 | r18028 | |
---|---|---|
130 | 130 | cpustate->external_input = configdata->external_input ? configdata->external_input : read_jmi; |
131 | 131 | cpustate->vector_callback = configdata->vector_callback; |
132 | 132 | cpustate->device = device; |
133 | cpustate->program = device->space(AS_PROGRAM); | |
133 | cpustate->program = &device->space(AS_PROGRAM); | |
134 | 134 | cpustate->direct = &cpustate->program->direct(); |
135 | cpustate->data = device->space(AS_DATA); | |
136 | cpustate->io = device->space(AS_IO); | |
135 | cpustate->data = &device->space(AS_DATA); | |
136 | cpustate->io = &device->space(AS_IO); | |
137 | 137 | |
138 | 138 | device->save_item(NAME(cpustate->PC)); |
139 | 139 | device->save_item(NAME(cpustate->A)); |
r18027 | r18028 | |
---|---|---|
626 | 626 | tms->config = configdata; |
627 | 627 | tms->irq_callback = irqcallback; |
628 | 628 | tms->device = device; |
629 | tms->program = device->space(AS_PROGRAM); | |
629 | tms->program = &device->space(AS_PROGRAM); | |
630 | 630 | tms->direct = &tms->program->direct(); |
631 | 631 | tms->screen = downcast<screen_device *>(device->machine().device(configdata->screen_tag)); |
632 | 632 | |
r18027 | r18028 | |
688 | 688 | tms->irq_callback = save_irqcallback; |
689 | 689 | tms->scantimer = save_scantimer; |
690 | 690 | tms->device = device; |
691 | tms->program = device->space(AS_PROGRAM); | |
691 | tms->program = &device->space(AS_PROGRAM); | |
692 | 692 | tms->direct = &tms->program->direct(); |
693 | 693 | |
694 | 694 | /* fetch the initial PC and reset the state */ |
r18027 | r18028 | |
699 | 699 | /* the first time we are run */ |
700 | 700 | tms->reset_deferred = tms->config->halt_on_reset; |
701 | 701 | if (tms->config->halt_on_reset) |
702 | tms34010_io_register_w( | |
702 | tms34010_io_register_w(device->space(AS_PROGRAM), REG_HSTCTLH, 0x8000, 0xffff); | |
703 | 703 | } |
704 | 704 | |
705 | 705 | |
r18027 | r18028 | |
1630 | 1630 | case TMS34010_HOST_CONTROL: |
1631 | 1631 | { |
1632 | 1632 | tms->external_host_access = TRUE; |
1633 | address_space &space = | |
1633 | address_space &space = tms->device->space(AS_PROGRAM); | |
1634 | 1634 | tms34010_io_register_w(space, REG_HSTCTLH, data & 0xff00, 0xffff); |
1635 | 1635 | tms34010_io_register_w(space, REG_HSTCTLL, data & 0x00ff, 0xffff); |
1636 | 1636 | tms->external_host_access = FALSE; |
r18027 | r18028 | |
---|---|---|
368 | 368 | void tms3203x_device::device_start() |
369 | 369 | { |
370 | 370 | // find address spaces |
371 | m_program = space(AS_PROGRAM); | |
371 | m_program = &space(AS_PROGRAM); | |
372 | 372 | m_direct = &m_program->direct(); |
373 | 373 | |
374 | 374 | // save state |
r18027 | r18028 | |
---|---|---|
751 | 751 | superfx_update_speed(cpustate); |
752 | 752 | |
753 | 753 | cpustate->device = device; |
754 | cpustate->program = device->space(AS_PROGRAM); | |
754 | cpustate->program = &device->space(AS_PROGRAM); | |
755 | 755 | |
756 | 756 | if (device->static_config() != NULL) |
757 | 757 | { |
r18027 | r18028 | |
---|---|---|
978 | 978 | |
979 | 979 | INT_ACK = irqcallback; |
980 | 980 | cpustate->device = device; |
981 | cpustate->program = device->space(AS_PROGRAM); | |
982 | cpustate->io = device->space(AS_IO); | |
981 | cpustate->program = &device->space(AS_PROGRAM); | |
982 | cpustate->io = &device->space(AS_IO); | |
983 | 983 | |
984 | 984 | cpustate->ICount = 0; |
985 | 985 |
r18027 | r18028 | |
---|---|---|
858 | 858 | cpustate->int_rom_size = romsize; |
859 | 859 | cpustate->feature_mask = feature_mask; |
860 | 860 | |
861 | cpustate->program = device->space(AS_PROGRAM); | |
861 | cpustate->program = &device->space(AS_PROGRAM); | |
862 | 862 | cpustate->direct = &cpustate->program->direct(); |
863 | cpustate->data = device->space(AS_DATA); | |
864 | cpustate->io = device->space(AS_IO); | |
863 | cpustate->data = &device->space(AS_DATA); | |
864 | cpustate->io = &device->space(AS_IO); | |
865 | 865 | |
866 | 866 | /* set up the state table */ |
867 | 867 | { |
r18027 | r18028 | |
---|---|---|
425 | 425 | |
426 | 426 | cpustate->irq_callback = irqcallback; |
427 | 427 | cpustate->device = device; |
428 | cpustate->program = device->space(AS_PROGRAM); | |
429 | cpustate->data = device->space(AS_DATA); | |
428 | cpustate->program = &device->space(AS_PROGRAM); | |
429 | cpustate->data = &device->space(AS_DATA); | |
430 | 430 | |
431 | 431 | build_opcode_table(); |
432 | 432 |
r18027 | r18028 | |
---|---|---|
787 | 787 | void tms57002_device::device_start() |
788 | 788 | { |
789 | 789 | sti = S_IDLE; |
790 | program = space(AS_PROGRAM); | |
791 | data = space(AS_DATA); | |
790 | program = &space(AS_PROGRAM); | |
791 | data = &space(AS_DATA); | |
792 | 792 | |
793 | 793 | state_add(STATE_GENPC,"GENPC", pc).noshow(); |
794 | 794 |
r18027 | r18028 | |
---|---|---|
2212 | 2212 | cpustate->irq_state[2] = CLEAR_LINE; |
2213 | 2213 | cpustate->after_EI = 0; |
2214 | 2214 | cpustate->ea = 0; |
2215 | cpustate->program = device->space(AS_PROGRAM); | |
2215 | cpustate->program = &device->space(AS_PROGRAM); | |
2216 | 2216 | cpustate->direct = &cpustate->program->direct(); |
2217 | cpustate->iospace = device->space(AS_IO); | |
2217 | cpustate->iospace = &device->space(AS_IO); | |
2218 | 2218 | cpustate->device = device; |
2219 | 2219 | |
2220 | 2220 | memcpy(cpustate->cc, (UINT8 *)cc_default, sizeof(cpustate->cc)); |
r18027 | r18028 | |
---|---|---|
165 | 165 | |
166 | 166 | cpustate->irq_callback = irqcallback; |
167 | 167 | cpustate->device = device; |
168 | cpustate->program = device->space(AS_PROGRAM); | |
168 | cpustate->program = &device->space(AS_PROGRAM); | |
169 | 169 | cpustate->direct = &cpustate->program->direct(); |
170 | cpustate->io = device->space(AS_IO); | |
170 | cpustate->io = &device->space(AS_IO); | |
171 | 171 | |
172 | 172 | /* set up the state table */ |
173 | 173 | { |
r18027 | r18028 | |
236 | 236 | memset(cpustate, 0, sizeof(*cpustate)); |
237 | 237 | cpustate->irq_callback = save_irqcallback; |
238 | 238 | cpustate->device = device; |
239 | cpustate->program = device->space(AS_PROGRAM); | |
239 | cpustate->program = &device->space(AS_PROGRAM); | |
240 | 240 | cpustate->direct = &cpustate->program->direct(); |
241 | cpustate->io = device->space(AS_IO); | |
241 | cpustate->io = &device->space(AS_IO); | |
242 | 242 | |
243 | 243 | cpustate->sregs[CS] = 0xffff; |
244 | 244 | cpustate->base[CS] = SegBase(CS); |
r18027 | r18028 | |
---|---|---|
310 | 310 | |
311 | 311 | cpustate->irq_callback = irqcallback; |
312 | 312 | cpustate->device = device; |
313 | cpustate->program = device->space(AS_PROGRAM); | |
314 | cpustate->io = device->space(AS_IO); | |
313 | cpustate->program = &device->space(AS_PROGRAM); | |
314 | cpustate->io = &device->space(AS_IO); | |
315 | 315 | cpustate->direct = &cpustate->program->direct(); |
316 | 316 | |
317 | 317 | /* If a reset parameter is given, take it as pointer to an address mask */ |
r18027 | r18028 | |
---|---|---|
121 | 121 | device_memory_interface *memory; |
122 | 122 | if (device.interface(memory)) |
123 | 123 | for (address_spacenum spacenum = AS_0; spacenum < ARRAY_LENGTH(m_space); spacenum++) |
124 | { | |
125 | m_space[spacenum] = memory->space(spacenum); | |
126 | if (m_space[spacenum] != NULL) | |
124 | if (memory->has_space(spacenum)) | |
125 | { | |
126 | m_space[spacenum] = &memory->space(spacenum); | |
127 | 127 | m_space[spacenum]->accessors(m_accessors[spacenum]); |
128 | } | |
128 | } | |
129 | 129 | } |
130 | 130 | |
131 | 131 |
r18027 | r18028 | |
---|---|---|
282 | 282 | cpustate->sound_data = (UINT16*)device->machine().root_device().memregion(_config->sound_data_region)->base(); |
283 | 283 | |
284 | 284 | cpustate->device = device; |
285 | cpustate->program = device->space(AS_PROGRAM); | |
285 | cpustate->program = &device->space(AS_PROGRAM); | |
286 | 286 | cpustate->direct = &cpustate->program->direct(); |
287 | 287 | |
288 | 288 | /* Allocate RAM shared with 68000 */ |
r18027 | r18028 | |
350 | 350 | |
351 | 351 | cpustate->device = device; |
352 | 352 | cpustate->lindevice = device->machine().device<legacy_cpu_device>(rotconfig->lin_cpu_tag); |
353 | cpustate->program = device->space(AS_PROGRAM); | |
353 | cpustate->program = &device->space(AS_PROGRAM); | |
354 | 354 | cpustate->direct = &cpustate->program->direct(); |
355 | 355 | |
356 | 356 | cquestrot_state_register(device); |
r18027 | r18028 | |
429 | 429 | |
430 | 430 | cpustate->device = device; |
431 | 431 | cpustate->rotdevice = device->machine().device<legacy_cpu_device>(linconfig->rot_cpu_tag); |
432 | cpustate->program = device->space(AS_PROGRAM); | |
432 | cpustate->program = &device->space(AS_PROGRAM); | |
433 | 433 | cpustate->direct = &cpustate->program->direct(); |
434 | 434 | |
435 | 435 | cquestlin_state_register(device); |
r18027 | r18028 | |
---|---|---|
1702 | 1702 | cpustate->config = *(const UPD7810_CONFIG*) device->static_config(); |
1703 | 1703 | cpustate->irq_callback = irqcallback; |
1704 | 1704 | cpustate->device = device; |
1705 | cpustate->program = device->space(AS_PROGRAM); | |
1705 | cpustate->program = &device->space(AS_PROGRAM); | |
1706 | 1706 | cpustate->direct = &cpustate->program->direct(); |
1707 | cpustate->io = device->space(AS_IO); | |
1707 | cpustate->io = &device->space(AS_IO); | |
1708 | 1708 | |
1709 | 1709 | device->save_item(NAME(cpustate->ppc.w.l)); |
1710 | 1710 | device->save_item(NAME(cpustate->pc.w.l)); |
r18027 | r18028 | |
1787 | 1787 | cpustate->config = save_config; |
1788 | 1788 | cpustate->irq_callback = save_irqcallback; |
1789 | 1789 | cpustate->device = device; |
1790 | cpustate->program = device->space(AS_PROGRAM); | |
1790 | cpustate->program = &device->space(AS_PROGRAM); | |
1791 | 1791 | cpustate->direct = &cpustate->program->direct(); |
1792 | cpustate->io = device->space(AS_IO); | |
1792 | cpustate->io = &device->space(AS_IO); | |
1793 | 1793 | |
1794 | 1794 | cpustate->opXX = opXX_7810; |
1795 | 1795 | cpustate->op48 = op48; |
r18027 | r18028 | |
---|---|---|
180 | 180 | |
181 | 181 | // CPU parameters |
182 | 182 | cpu_device & m_cpudevice; // CPU device object |
183 | address_space | |
183 | address_space & m_program; // program address space for this CPU | |
184 | 184 | offs_t m_pageshift; // shift to convert address to a page index |
185 | 185 | |
186 | 186 | // opcode descriptor arrays |
r18027 | r18028 | |
---|---|---|
105 | 105 | cpustate->config = (sc61860_cpu_core *) device->static_config(); |
106 | 106 | device->machine().scheduler().timer_pulse(attotime::from_hz(500), FUNC(sc61860_2ms_tick), 0, cpustate); |
107 | 107 | cpustate->device = device; |
108 | cpustate->program = device->space(AS_PROGRAM); | |
108 | cpustate->program = &device->space(AS_PROGRAM); | |
109 | 109 | cpustate->direct = &cpustate->program->direct(); |
110 | 110 | } |
111 | 111 |
r18027 | r18028 | |
---|---|---|
353 | 353 | cpustate->fetch_xor = BYTE_XOR_LE(0); |
354 | 354 | cpustate->start_pc = 0xfffff0; |
355 | 355 | cpustate->device = device; |
356 | cpustate->program = device->space(AS_PROGRAM); | |
356 | cpustate->program = &device->space(AS_PROGRAM); | |
357 | 357 | cpustate->direct = &cpustate->program->direct(); |
358 | cpustate->io = device->space(AS_IO); | |
358 | cpustate->io = &device->space(AS_IO); | |
359 | 359 | } |
360 | 360 | |
361 | 361 | static CPU_INIT( v70 ) |
r18027 | r18028 | |
369 | 369 | cpustate->fetch_xor = BYTE4_XOR_LE(0); |
370 | 370 | cpustate->start_pc = 0xfffffff0; |
371 | 371 | cpustate->device = device; |
372 | cpustate->program = device->space(AS_PROGRAM); | |
372 | cpustate->program = &device->space(AS_PROGRAM); | |
373 | 373 | cpustate->direct = &cpustate->program->direct(); |
374 | cpustate->io = device->space(AS_IO); | |
374 | cpustate->io = &device->space(AS_IO); | |
375 | 375 | } |
376 | 376 | |
377 | 377 | static CPU_RESET( v60 ) |
r18027 | r18028 | |
---|---|---|
119 | 119 | minx_state *minx = get_safe_token(device); |
120 | 120 | minx->irq_callback = irqcallback; |
121 | 121 | minx->device = device; |
122 | minx->program = device->space(AS_PROGRAM); | |
122 | minx->program = &device->space(AS_PROGRAM); | |
123 | 123 | if ( device->static_config() != NULL ) |
124 | 124 | { |
125 | 125 | } |
r18027 | r18028 | |
---|---|---|
232 | 232 | //cpustate->config = device->static_config(); |
233 | 233 | //cpustate->irq_callback = irqcallback; |
234 | 234 | cpustate->device = device; |
235 | cpustate->program = device->space(AS_PROGRAM); | |
235 | cpustate->program = &device->space(AS_PROGRAM); | |
236 | 236 | cpustate->direct = &cpustate->program->direct(); |
237 | cpustate->data = device->space(AS_DATA); | |
237 | cpustate->data = &device->space(AS_DATA); | |
238 | 238 | |
239 | 239 | /* Setup the direct memory handler for this CPU */ |
240 | 240 | /* NOTE: Be sure to grab this guy and call him if you ever install another direct_update_hander in a driver! */ |
r18027 | r18028 | |
---|---|---|
1286 | 1286 | |
1287 | 1287 | INT_ACK = irqcallback; |
1288 | 1288 | cpustate->device = device; |
1289 | cpustate->program = device->space(AS_PROGRAM); | |
1289 | cpustate->program = &device->space(AS_PROGRAM); | |
1290 | 1290 | } |
1291 | 1291 | |
1292 | 1292 |
r18027 | r18028 | |
---|---|---|
528 | 528 | memset(ssp1601_state, 0, sizeof(ssp1601_state_t)); |
529 | 529 | ssp1601_state->gr[0].w.h = 0xffff; // constant reg |
530 | 530 | ssp1601_state->device = device; |
531 | ssp1601_state->program = device->space(AS_PROGRAM); | |
531 | ssp1601_state->program = &device->space(AS_PROGRAM); | |
532 | 532 | ssp1601_state->direct = &ssp1601_state->program->direct(); |
533 | ssp1601_state->io = device->space(AS_IO); | |
533 | ssp1601_state->io = &device->space(AS_IO); | |
534 | 534 | |
535 | 535 | } |
536 | 536 |
r18027 | r18028 | |
---|---|---|
518 | 518 | m68_state->irq_callback = irqcallback; |
519 | 519 | m68_state->device = device; |
520 | 520 | |
521 | m68_state->program = device->space(AS_PROGRAM); | |
521 | m68_state->program = &device->space(AS_PROGRAM); | |
522 | 522 | m68_state->direct = &m68_state->program->direct(); |
523 | 523 | |
524 | 524 | /* setup regtable */ |
r18027 | r18028 | |
---|---|---|
2713 | 2713 | memset(cpustate, 0, sizeof(t90_Regs)); |
2714 | 2714 | cpustate->irq_callback = irqcallback; |
2715 | 2715 | cpustate->device = device; |
2716 | cpustate->program = device->space(AS_PROGRAM); | |
2717 | cpustate->io = device->space(AS_IO); | |
2716 | cpustate->program = &device->space(AS_PROGRAM); | |
2717 | cpustate->io = &device->space(AS_IO); | |
2718 | 2718 | |
2719 | 2719 | cpustate->timer_period = attotime::from_hz(device->unscaled_clock()) * 8; |
2720 | 2720 |
r18027 | r18028 | |
---|---|---|
795 | 795 | |
796 | 796 | s2650c->irq_callback = irqcallback; |
797 | 797 | s2650c->device = device; |
798 | s2650c->program = device->space(AS_PROGRAM); | |
798 | s2650c->program = &device->space(AS_PROGRAM); | |
799 | 799 | s2650c->direct = &s2650c->program->direct(); |
800 | s2650c->io = device->space(AS_IO); | |
800 | s2650c->io = &device->space(AS_IO); | |
801 | 801 | |
802 | 802 | device->save_item(NAME(s2650c->ppc)); |
803 | 803 | device->save_item(NAME(s2650c->page)); |
r18027 | r18028 | |
828 | 828 | memset(s2650c->ras, 0, sizeof(s2650c->ras)); |
829 | 829 | |
830 | 830 | s2650c->device = device; |
831 | s2650c->program = device->space(AS_PROGRAM); | |
831 | s2650c->program = &device->space(AS_PROGRAM); | |
832 | 832 | s2650c->direct = &s2650c->program->direct(); |
833 | s2650c->io = device->space(AS_IO); | |
833 | s2650c->io = &device->space(AS_IO); | |
834 | 834 | s2650c->psl = COM | WC; |
835 | 835 | /* force write */ |
836 | 836 | s2650c->psu = 0xff; |
r18027 | r18028 | |
---|---|---|
188 | 188 | cpustate->pc = 0; |
189 | 189 | |
190 | 190 | cpustate->device = device; |
191 | cpustate->program = device->space(AS_PROGRAM); | |
192 | cpustate->io = device->space(AS_IO); | |
191 | cpustate->program = &device->space(AS_PROGRAM); | |
192 | cpustate->io = &device->space(AS_IO); | |
193 | 193 | |
194 | 194 | WRITE_IO_8(cpustate, AVR8_IO_SREG, 0); |
195 | 195 |
r18027 | r18028 | |
---|---|---|
1717 | 1717 | memset(se3208_state,0,sizeof(se3208_state_t)); |
1718 | 1718 | se3208_state->irq_callback = save_irqcallback; |
1719 | 1719 | se3208_state->device = device; |
1720 | se3208_state->program = device->space(AS_PROGRAM); | |
1720 | se3208_state->program = &device->space(AS_PROGRAM); | |
1721 | 1721 | se3208_state->direct = &se3208_state->program->direct(); |
1722 | 1722 | se3208_state->PC=SE3208_Read32(se3208_state, 0); |
1723 | 1723 | se3208_state->SR=0; |
r18027 | r18028 | |
1788 | 1788 | |
1789 | 1789 | se3208_state->irq_callback = irqcallback; |
1790 | 1790 | se3208_state->device = device; |
1791 | se3208_state->program = device->space(AS_PROGRAM); | |
1791 | se3208_state->program = &device->space(AS_PROGRAM); | |
1792 | 1792 | se3208_state->direct = &se3208_state->program->direct(); |
1793 | 1793 | } |
1794 | 1794 |
r18027 | r18028 | |
---|---|---|
1542 | 1542 | |
1543 | 1543 | cpustate->irq_callback = irqcallback; |
1544 | 1544 | cpustate->device = device; |
1545 | cpustate->program = device->space(AS_PROGRAM); | |
1545 | cpustate->program = &device->space(AS_PROGRAM); | |
1546 | 1546 | cpustate->direct = &cpustate->program->direct(); |
1547 | cpustate->io = device->space(AS_IO); | |
1547 | cpustate->io = &device->space(AS_IO); | |
1548 | 1548 | cpustate->timer = device->machine().scheduler().timer_alloc(FUNC(e132xs_timer_callback), (void *)device); |
1549 | 1549 | cpustate->clock_scale_mask = scale_mask; |
1550 | 1550 | } |
r18027 | r18028 | |
1650 | 1650 | cpustate->irq_callback = save_irqcallback; |
1651 | 1651 | cpustate->opcodexor = save_opcodexor; |
1652 | 1652 | cpustate->device = device; |
1653 | cpustate->program = device->space(AS_PROGRAM); | |
1653 | cpustate->program = &device->space(AS_PROGRAM); | |
1654 | 1654 | cpustate->direct = &cpustate->program->direct(); |
1655 | cpustate->io = device->space(AS_IO); | |
1655 | cpustate->io = &device->space(AS_IO); | |
1656 | 1656 | cpustate->timer = save_timer; |
1657 | 1657 | |
1658 | 1658 | cpustate->tr_clocks_per_tick = 2; |
r18027 | r18028 | |
---|---|---|
30 | 30 | { |
31 | 31 | i860_state_t *cpustate = get_safe_token(device); |
32 | 32 | cpustate->device = device; |
33 | cpustate->program = device->space(AS_PROGRAM); | |
33 | cpustate->program = &device->space(AS_PROGRAM); | |
34 | 34 | reset_i860(cpustate); |
35 | 35 | i860_set_pin(device, DEC_PIN_BUS_HOLD, 0); |
36 | 36 | i860_set_pin(device, DEC_PIN_RESET, 0); |
r18027 | r18028 | |
---|---|---|
2075 | 2075 | mcs51_state->irq_callback = irqcallback; |
2076 | 2076 | mcs51_state->device = device; |
2077 | 2077 | |
2078 | mcs51_state->program = device->space(AS_PROGRAM); | |
2078 | mcs51_state->program = &device->space(AS_PROGRAM); | |
2079 | 2079 | mcs51_state->direct = &mcs51_state->program->direct(); |
2080 | mcs51_state->data = device->space(AS_DATA); | |
2081 | mcs51_state->io = device->space(AS_IO); | |
2080 | mcs51_state->data = &device->space(AS_DATA); | |
2081 | mcs51_state->io = &device->space(AS_IO); | |
2082 | 2082 | |
2083 | 2083 | mcs51_state->features = FEATURE_NONE; |
2084 | 2084 | mcs51_state->ram_mask = 0x7F; /* 128 bytes of ram */ |
r18027 | r18028 | |
---|---|---|
2882 | 2882 | |
2883 | 2883 | cpustate->irq_callback = irqcallback; |
2884 | 2884 | cpustate->device = device; |
2885 | cpustate->program = device->space(AS_PROGRAM); | |
2885 | cpustate->program = &device->space(AS_PROGRAM); | |
2886 | 2886 | cpustate->direct = &cpustate->program->direct(); |
2887 | cpustate->io = device->space(AS_IO); | |
2887 | cpustate->io = &device->space(AS_IO); | |
2888 | 2888 | |
2889 | 2889 | device->save_item(NAME( cpustate->reg.d)); |
2890 | 2890 | device->save_item(NAME(cpustate->sreg[ES].selector)); |
r18027 | r18028 | |
3006 | 3006 | memset( cpustate, 0, sizeof(*cpustate) ); |
3007 | 3007 | cpustate->irq_callback = save_irqcallback; |
3008 | 3008 | cpustate->device = device; |
3009 | cpustate->program = device->space(AS_PROGRAM); | |
3009 | cpustate->program = &device->space(AS_PROGRAM); | |
3010 | 3010 | cpustate->direct = &cpustate->program->direct(); |
3011 | cpustate->io = device->space(AS_IO); | |
3011 | cpustate->io = &device->space(AS_IO); | |
3012 | 3012 | |
3013 | 3013 | cpustate->sreg[CS].selector = 0xf000; |
3014 | 3014 | cpustate->sreg[CS].base = 0xffff0000; |
r18027 | r18028 | |
3497 | 3497 | memset( cpustate, 0, sizeof(*cpustate) ); |
3498 | 3498 | cpustate->irq_callback = save_irqcallback; |
3499 | 3499 | cpustate->device = device; |
3500 | cpustate->program = device->space(AS_PROGRAM); | |
3500 | cpustate->program = &device->space(AS_PROGRAM); | |
3501 | 3501 | cpustate->direct = &cpustate->program->direct(); |
3502 | cpustate->io = device->space(AS_IO); | |
3502 | cpustate->io = &device->space(AS_IO); | |
3503 | 3503 | |
3504 | 3504 | cpustate->sreg[CS].selector = 0xf000; |
3505 | 3505 | cpustate->sreg[CS].base = 0xffff0000; |
r18027 | r18028 | |
3604 | 3604 | memset( cpustate, 0, sizeof(*cpustate) ); |
3605 | 3605 | cpustate->irq_callback = save_irqcallback; |
3606 | 3606 | cpustate->device = device; |
3607 | cpustate->program = device->space(AS_PROGRAM); | |
3607 | cpustate->program = &device->space(AS_PROGRAM); | |
3608 | 3608 | cpustate->direct = &cpustate->program->direct(); |
3609 | cpustate->io = device->space(AS_IO); | |
3609 | cpustate->io = &device->space(AS_IO); | |
3610 | 3610 | |
3611 | 3611 | cpustate->sreg[CS].selector = 0xf000; |
3612 | 3612 | cpustate->sreg[CS].base = 0xffff0000; |
r18027 | r18028 | |
3727 | 3727 | memset( cpustate, 0, sizeof(*cpustate) ); |
3728 | 3728 | cpustate->irq_callback = save_irqcallback; |
3729 | 3729 | cpustate->device = device; |
3730 | cpustate->program = device->space(AS_PROGRAM); | |
3730 | cpustate->program = &device->space(AS_PROGRAM); | |
3731 | 3731 | cpustate->direct = &cpustate->program->direct(); |
3732 | cpustate->io = device->space(AS_IO); | |
3732 | cpustate->io = &device->space(AS_IO); | |
3733 | 3733 | |
3734 | 3734 | cpustate->sreg[CS].selector = 0xf000; |
3735 | 3735 | cpustate->sreg[CS].base = 0xffff0000; |
r18027 | r18028 | |
3842 | 3842 | memset( cpustate, 0, sizeof(*cpustate) ); |
3843 | 3843 | cpustate->irq_callback = save_irqcallback; |
3844 | 3844 | cpustate->device = device; |
3845 | cpustate->program = device->space(AS_PROGRAM); | |
3845 | cpustate->program = &device->space(AS_PROGRAM); | |
3846 | 3846 | cpustate->direct = &cpustate->program->direct(); |
3847 | cpustate->io = device->space(AS_IO); | |
3847 | cpustate->io = &device->space(AS_IO); | |
3848 | 3848 | |
3849 | 3849 | cpustate->sreg[CS].selector = 0xf000; |
3850 | 3850 | cpustate->sreg[CS].base = 0xffff0000; |
r18027 | r18028 | |
3938 | 3938 | memset( cpustate, 0, sizeof(*cpustate) ); |
3939 | 3939 | cpustate->irq_callback = save_irqcallback; |
3940 | 3940 | cpustate->device = device; |
3941 | cpustate->program = device->space(AS_PROGRAM); | |
3941 | cpustate->program = &device->space(AS_PROGRAM); | |
3942 | 3942 | cpustate->direct = &cpustate->program->direct(); |
3943 | cpustate->io = device->space(AS_IO); | |
3943 | cpustate->io = &device->space(AS_IO); | |
3944 | 3944 | |
3945 | 3945 | cpustate->sreg[CS].selector = 0xf000; |
3946 | 3946 | cpustate->sreg[CS].base = 0xffff0000; |
r18027 | r18028 | |
4034 | 4034 | memset( cpustate, 0, sizeof(*cpustate) ); |
4035 | 4035 | cpustate->irq_callback = save_irqcallback; |
4036 | 4036 | cpustate->device = device; |
4037 | cpustate->program = device->space(AS_PROGRAM); | |
4037 | cpustate->program = &device->space(AS_PROGRAM); | |
4038 | 4038 | cpustate->direct = &cpustate->program->direct(); |
4039 | cpustate->io = device->space(AS_IO); | |
4039 | cpustate->io = &device->space(AS_IO); | |
4040 | 4040 | |
4041 | 4041 | cpustate->sreg[CS].selector = 0xf000; |
4042 | 4042 | cpustate->sreg[CS].base = 0xffff0000; |
r18027 | r18028 | |
4130 | 4130 | memset( cpustate, 0, sizeof(*cpustate) ); |
4131 | 4131 | cpustate->irq_callback = save_irqcallback; |
4132 | 4132 | cpustate->device = device; |
4133 | cpustate->program = device->space(AS_PROGRAM); | |
4133 | cpustate->program = &device->space(AS_PROGRAM); | |
4134 | 4134 | cpustate->direct = &cpustate->program->direct(); |
4135 | cpustate->io = device->space(AS_IO); | |
4135 | cpustate->io = &device->space(AS_IO); | |
4136 | 4136 | |
4137 | 4137 | cpustate->sreg[CS].selector = 0xf000; |
4138 | 4138 | cpustate->sreg[CS].base = 0xffff0000; |
r18027 | r18028 | |
4226 | 4226 | memset( cpustate, 0, sizeof(*cpustate) ); |
4227 | 4227 | cpustate->irq_callback = save_irqcallback; |
4228 | 4228 | cpustate->device = device; |
4229 | cpustate->program = device->space(AS_PROGRAM); | |
4229 | cpustate->program = &device->space(AS_PROGRAM); | |
4230 | 4230 | cpustate->direct = &cpustate->program->direct(); |
4231 | cpustate->io = device->space(AS_IO); | |
4231 | cpustate->io = &device->space(AS_IO); | |
4232 | 4232 | |
4233 | 4233 | cpustate->sreg[CS].selector = 0xf000; |
4234 | 4234 | cpustate->sreg[CS].base = 0xffff0000; |
r18027 | r18028 | |
---|---|---|
446 | 446 | |
447 | 447 | cpustate->irq_callback = irqcallback; |
448 | 448 | cpustate->device = device; |
449 | cpustate->program = device->space(AS_PROGRAM); | |
449 | cpustate->program = &device->space(AS_PROGRAM); | |
450 | 450 | cpustate->direct = &cpustate->program->direct(); |
451 | cpustate->io = device->space(AS_IO); | |
451 | cpustate->io = &device->space(AS_IO); | |
452 | 452 | |
453 | 453 | device->save_item(NAME(cpustate->pc)); |
454 | 454 | device->save_item(NAME(cpustate->ix)); |
r18027 | r18028 | |
---|---|---|
316 | 316 | |
317 | 317 | cpustate->irq_callback = irqcallback; |
318 | 318 | cpustate->device = device; |
319 | cpustate->program = device->space(AS_PROGRAM); | |
320 | cpustate->io = device->space(AS_IO); | |
319 | cpustate->program = &device->space(AS_PROGRAM); | |
320 | cpustate->io = &device->space(AS_IO); | |
321 | 321 | } |
322 | 322 | |
323 | 323 |
r18027 | r18028 | |
---|---|---|
445 | 445 | void adsp21xx_device::device_start() |
446 | 446 | { |
447 | 447 | // get our address spaces |
448 | m_program = space(AS_PROGRAM); | |
448 | m_program = &space(AS_PROGRAM); | |
449 | 449 | m_direct = &m_program->direct(); |
450 | m_data = space(AS_DATA); | |
451 | m_io = space(AS_IO); | |
450 | m_data = &space(AS_DATA); | |
451 | m_io = has_space(AS_IO) ? &space(AS_IO) : NULL; | |
452 | 452 | |
453 | 453 | // "core" |
454 | 454 | save_item(NAME(m_core.ax0.u)); |
r18027 | r18028 | |
---|---|---|
231 | 231 | void dsp32c_device::device_start() |
232 | 232 | { |
233 | 233 | // get our address spaces |
234 | m_program = space(AS_PROGRAM); | |
234 | m_program = &space(AS_PROGRAM); | |
235 | 235 | m_direct = &m_program->direct(); |
236 | 236 | |
237 | 237 | // register our state for the debugger |
r18027 | r18028 | |
---|---|---|
222 | 222 | cpustate->intf = (const tlcs900_interface *)device->static_config(); |
223 | 223 | cpustate->irqcallback = irqcallback; |
224 | 224 | cpustate->device = device; |
225 | cpustate->program = device->space( AS_PROGRAM ); | |
225 | cpustate->program = &device->space( AS_PROGRAM ); | |
226 | 226 | |
227 | 227 | cpustate->to1.resolve(cpustate->intf->to1, *device ); |
228 | 228 | cpustate->to3.resolve(cpustate->intf->to3, *device ); |
r18027 | r18028 | |
---|---|---|
462 | 462 | |
463 | 463 | cpustate->device = device; |
464 | 464 | |
465 | cpustate->program = device->space(AS_PROGRAM); | |
465 | cpustate->program = &device->space(AS_PROGRAM); | |
466 | 466 | cpustate->direct = &cpustate->program->direct(); |
467 | cpustate->data = device->space(AS_DATA); | |
468 | cpustate->io = device->space(AS_IO); | |
467 | cpustate->data = &device->space(AS_DATA); | |
468 | cpustate->io = &device->space(AS_IO); | |
469 | 469 | |
470 | 470 | device->save_item(NAME(cpustate->PC)); |
471 | 471 | device->save_item(NAME(cpustate->A)); |
r18027 | r18028 | |
---|---|---|
513 | 513 | |
514 | 514 | cpustate->device = device; |
515 | 515 | |
516 | cpustate->program = device->space(AS_PROGRAM); | |
516 | cpustate->program = &device->space(AS_PROGRAM); | |
517 | 517 | cpustate->direct = &cpustate->program->direct(); |
518 | 518 | |
519 | 519 | /* resolve callbacks */ |
r18027 | r18028 | |
---|---|---|
281 | 281 | |
282 | 282 | rsp->irq_callback = irqcallback; |
283 | 283 | rsp->device = device; |
284 | rsp->program = device->space(AS_PROGRAM); | |
284 | rsp->program = &device->space(AS_PROGRAM); | |
285 | 285 | rsp->direct = &rsp->program->direct(); |
286 | 286 | |
287 | 287 | #if 1 |
r18027 | r18028 | |
---|---|---|
588 | 588 | rsp->config = (const rsp_config *)device->static_config(); |
589 | 589 | rsp->irq_callback = irqcallback; |
590 | 590 | rsp->device = device; |
591 | rsp->program = device->space(AS_PROGRAM); | |
591 | rsp->program = &device->space(AS_PROGRAM); | |
592 | 592 | rsp->direct = &rsp->program->direct(); |
593 | 593 | |
594 | 594 | #if 1 |
r18027 | r18028 | |
---|---|---|
872 | 872 | |
873 | 873 | /* find address spaces */ |
874 | 874 | |
875 | cpustate->program = device->space(AS_PROGRAM); | |
875 | cpustate->program = &device->space(AS_PROGRAM); | |
876 | 876 | cpustate->direct = &cpustate->program->direct(); |
877 | cpustate->data = device->space(AS_DATA); | |
878 | cpustate->io = device->space(AS_IO); | |
877 | cpustate->data = &device->space(AS_DATA); | |
878 | cpustate->io = &device->space(AS_IO); | |
879 | 879 | |
880 | 880 | /* set output pin masks */ |
881 | 881 |
r18027 | r18028 | |
---|---|---|
149 | 149 | cpustate->halt = 0; |
150 | 150 | |
151 | 151 | cpustate->device = device; |
152 | cpustate->program = device->space(AS_PROGRAM); | |
152 | cpustate->program = &device->space(AS_PROGRAM); | |
153 | 153 | } |
154 | 154 | |
155 | 155 | static CPU_EXIT( ssem ) |
r18027 | r18028 | |
---|---|---|
51 | 51 | void i8008_device::device_start() |
52 | 52 | { |
53 | 53 | // find address spaces |
54 | m_program = space(AS_PROGRAM); | |
54 | m_program = &space(AS_PROGRAM); | |
55 | 55 | m_direct = &m_program->direct(); |
56 | m_io = space(AS_IO); | |
56 | m_io = &space(AS_IO); | |
57 | 57 | |
58 | 58 | // save state |
59 | 59 | save_item(NAME(m_PC)); |
r18027 | r18028 | |
---|---|---|
191 | 191 | cpustate->interrupt_inhibit = 0; |
192 | 192 | cpustate->irq_callback = irqcallback; |
193 | 193 | cpustate->device = device; |
194 | cpustate->space = device->space(AS_PROGRAM); | |
194 | cpustate->space = &device->space(AS_PROGRAM); | |
195 | 195 | cpustate->direct = &cpustate->space->direct(); |
196 | 196 | |
197 | 197 | if ( intf ) |
r18027 | r18028 | |
---|---|---|
136 | 136 | |
137 | 137 | cpustate->irq_callback = irqcallback; |
138 | 138 | cpustate->device = device; |
139 | cpustate->space = device->space(AS_PROGRAM); | |
139 | cpustate->space = &device->space(AS_PROGRAM); | |
140 | 140 | cpustate->direct = &cpustate->space->direct(); |
141 | 141 | cpustate->subtype = subtype; |
142 | 142 | cpustate->insn = insn; |
r18027 | r18028 | |
548 | 548 | { |
549 | 549 | m6502_Regs *cpustate = get_safe_token(device); |
550 | 550 | m6502_common_init(device, irqcallback, SUBTYPE_DECO16, insndeco16, "deco16"); |
551 | cpustate->io = device->space(AS_IO); | |
551 | cpustate->io = &device->space(AS_IO); | |
552 | 552 | } |
553 | 553 | |
554 | 554 |
r18027 | r18028 | |
---|---|---|
141 | 141 | |
142 | 142 | cpustate->irq_callback = irqcallback; |
143 | 143 | cpustate->device = device; |
144 | cpustate->space = device->space(AS_PROGRAM); | |
144 | cpustate->space = &device->space(AS_PROGRAM); | |
145 | 145 | cpustate->direct = &cpustate->space->direct(); |
146 | 146 | |
147 | 147 | if ( intf ) |
r18027 | r18028 | |
---|---|---|
101 | 101 | |
102 | 102 | cpustate->irq_callback = irqcallback; |
103 | 103 | cpustate->device = device; |
104 | cpustate->space = device->space(AS_PROGRAM); | |
104 | cpustate->space = &device->space(AS_PROGRAM); | |
105 | 105 | cpustate->direct = &cpustate->space->direct(); |
106 | 106 | |
107 | 107 | if ( intf ) |
r18027 | r18028 | |
---|---|---|
417 | 417 | |
418 | 418 | jaguar->irq_callback = irqcallback; |
419 | 419 | jaguar->device = device; |
420 | jaguar->program = device->space(AS_PROGRAM); | |
420 | jaguar->program = &device->space(AS_PROGRAM); | |
421 | 421 | jaguar->direct = &jaguar->program->direct(); |
422 | 422 | if (configdata != NULL) |
423 | 423 | jaguar->cpu_interrupt = configdata->cpu_int_callback; |
r18027 | r18028 | |
---|---|---|
1629 | 1629 | void psxcpu_device::device_start() |
1630 | 1630 | { |
1631 | 1631 | // get our address spaces |
1632 | m_program = space(AS_PROGRAM); | |
1632 | m_program = &space(AS_PROGRAM); | |
1633 | 1633 | m_direct = &m_program->direct(); |
1634 | 1634 | |
1635 | 1635 | save_item( NAME(m_op) ); |
r18027 | r18028 | |
---|---|---|
1006 | 1006 | cpustate->irq_callback = irqcallback; |
1007 | 1007 | cpustate->device = device; |
1008 | 1008 | |
1009 | cpustate->program = device->space(AS_PROGRAM); | |
1009 | cpustate->program = &device->space(AS_PROGRAM); | |
1010 | 1010 | cpustate->direct = &cpustate->program->direct(); |
1011 | cpustate->io = device->space(AS_IO); | |
1011 | cpustate->io = &device->space(AS_IO); | |
1012 | 1012 | |
1013 | 1013 | /* resolve callbacks */ |
1014 | 1014 | cpustate->out_status_func.resolve(cpustate->config.out_status_func, *device); |
r18027 | r18028 | |
---|---|---|
345 | 345 | cpustate->irq_callback = save_irqcallback; |
346 | 346 | cpustate->endian = save_endian; |
347 | 347 | cpustate->device = device; |
348 | cpustate->program = device->space(AS_PROGRAM); | |
348 | cpustate->program = &device->space(AS_PROGRAM); | |
349 | 349 | cpustate->direct = &cpustate->program->direct(); |
350 | 350 | |
351 | 351 | /* start up in SVC mode with interrupts disabled. */ |
r18027 | r18028 | |
528 | 528 | |
529 | 529 | cpustate->irq_callback = irqcallback; |
530 | 530 | cpustate->device = device; |
531 | cpustate->program = device->space(AS_PROGRAM); | |
531 | cpustate->program = &device->space(AS_PROGRAM); | |
532 | 532 | cpustate->endian = ENDIANNESS_LITTLE; |
533 | 533 | |
534 | 534 | device->save_item(NAME(cpustate->sArmRegister)); |
r18027 | r18028 | |
544 | 544 | |
545 | 545 | cpustate->irq_callback = irqcallback; |
546 | 546 | cpustate->device = device; |
547 | cpustate->program = device->space(AS_PROGRAM); | |
547 | cpustate->program = &device->space(AS_PROGRAM); | |
548 | 548 | cpustate->endian = ENDIANNESS_BIG; |
549 | 549 | |
550 | 550 | device->save_item(NAME(cpustate->sArmRegister)); |
r18027 | r18028 | |
---|---|---|
317 | 317 | ppc->cpu_clock = device->clock(); |
318 | 318 | ppc->irq_callback = irqcallback; |
319 | 319 | ppc->device = device; |
320 | ppc->program = device->space(AS_PROGRAM); | |
320 | ppc->program = &device->space(AS_PROGRAM); | |
321 | 321 | ppc->direct = &ppc->program->direct(); |
322 | 322 | ppc->system_clock = (config != NULL) ? config->bus_frequency : device->clock(); |
323 | 323 | ppc->dcr_read_func = (config != NULL) ? config->dcr_read_func : NULL; |
r18027 | r18028 | |
---|---|---|
963 | 963 | |
964 | 964 | ppc.irq_callback = irqcallback; |
965 | 965 | ppc.device = device; |
966 | ppc.program = device->space(AS_PROGRAM); | |
966 | ppc.program = &device->space(AS_PROGRAM); | |
967 | 967 | |
968 | 968 | ppc.pvr = configdata->pvr; |
969 | 969 | } |
r18027 | r18028 | |
1009 | 1009 | |
1010 | 1010 | ppc.irq_callback = irqcallback; |
1011 | 1011 | ppc.device = device; |
1012 | ppc.program = device->space(AS_PROGRAM); | |
1012 | ppc.program = &device->space(AS_PROGRAM); | |
1013 | 1013 | |
1014 | 1014 | ppc.pvr = configdata->pvr; |
1015 | 1015 | } |
r18027 | r18028 | |
1134 | 1134 | |
1135 | 1135 | ppc.irq_callback = irqcallback; |
1136 | 1136 | ppc.device = device; |
1137 | ppc.program = device->space(AS_PROGRAM); | |
1137 | ppc.program = &device->space(AS_PROGRAM); | |
1138 | 1138 | |
1139 | 1139 | ppc.pvr = configdata->pvr; |
1140 | 1140 | |
r18027 | r18028 | |
1282 | 1282 | |
1283 | 1283 | ppc.irq_callback = irqcallback; |
1284 | 1284 | ppc.device = device; |
1285 | ppc.program = device->space(AS_PROGRAM); | |
1285 | ppc.program = &device->space(AS_PROGRAM); | |
1286 | 1286 | |
1287 | 1287 | ppc.pvr = configdata->pvr; |
1288 | 1288 | |
r18027 | r18028 | |
1423 | 1423 | |
1424 | 1424 | ppc.irq_callback = irqcallback; |
1425 | 1425 | ppc.device = device; |
1426 | ppc.program = device->space(AS_PROGRAM); | |
1426 | ppc.program = &device->space(AS_PROGRAM); | |
1427 | 1427 | |
1428 | 1428 | ppc.pvr = configdata->pvr; |
1429 | 1429 | |
r18027 | r18028 | |
1549 | 1549 | |
1550 | 1550 | ppc.irq_callback = irqcallback; |
1551 | 1551 | ppc.device = device; |
1552 | ppc.program = device->space(AS_PROGRAM); | |
1552 | ppc.program = &device->space(AS_PROGRAM); | |
1553 | 1553 | |
1554 | 1554 | ppc.pvr = configdata->pvr; |
1555 | 1555 | |
r18027 | r18028 | |
1679 | 1679 | |
1680 | 1680 | ppc.irq_callback = irqcallback; |
1681 | 1681 | ppc.device = device; |
1682 | ppc.program = device->space(AS_PROGRAM); | |
1682 | ppc.program = &device->space(AS_PROGRAM); | |
1683 | 1683 | |
1684 | 1684 | ppc.pvr = configdata->pvr; |
1685 | 1685 |
r18027 | r18028 | |
---|---|---|
117 | 117 | void lr35902_cpu_device::device_start() |
118 | 118 | { |
119 | 119 | m_device = this; |
120 | m_program = | |
120 | m_program = &space(AS_PROGRAM); | |
121 | 121 | |
122 | 122 | save_item(NAME(m_A)); |
123 | 123 | save_item(NAME(m_F)); |
r18027 | r18028 | |
---|---|---|
478 | 478 | |
479 | 479 | cpustate->irq_callback = irqcallback; |
480 | 480 | cpustate->device = device; |
481 | cpustate->program = device->space(AS_PROGRAM); | |
481 | cpustate->program = &device->space(AS_PROGRAM); | |
482 | 482 | cpustate->direct = &cpustate->program->direct(); |
483 | cpustate->io = device->space(AS_IO); | |
483 | cpustate->io = &device->space(AS_IO); | |
484 | 484 | |
485 | 485 | /* already initialized? */ |
486 | 486 | if(z8000_exec == NULL) |
r18027 | r18028 | |
493 | 493 | |
494 | 494 | cpustate->irq_callback = irqcallback; |
495 | 495 | cpustate->device = device; |
496 | cpustate->program = device->space(AS_PROGRAM); | |
496 | cpustate->program = &device->space(AS_PROGRAM); | |
497 | 497 | cpustate->direct = &cpustate->program->direct(); |
498 | cpustate->io = device->space(AS_IO); | |
498 | cpustate->io = &device->space(AS_IO); | |
499 | 499 | |
500 | 500 | /* already initialized? */ |
501 | 501 | if(z8000_exec == NULL) |
r18027 | r18028 | |
510 | 510 | memset(cpustate, 0, sizeof(*cpustate)); |
511 | 511 | cpustate->irq_callback = save_irqcallback; |
512 | 512 | cpustate->device = device; |
513 | cpustate->program = device->space(AS_PROGRAM); | |
513 | cpustate->program = &device->space(AS_PROGRAM); | |
514 | 514 | cpustate->direct = &cpustate->program->direct(); |
515 | cpustate->io = device->space(AS_IO); | |
515 | cpustate->io = &device->space(AS_IO); | |
516 | 516 | cpustate->fcw = RDMEM_W(cpustate, 2); /* get reset cpustate->fcw */ |
517 | 517 | if(cpustate->fcw & F_SEG) |
518 | 518 | { |
r18027 | r18028 | |
532 | 532 | memset(cpustate, 0, sizeof(*cpustate)); |
533 | 533 | cpustate->irq_callback = save_irqcallback; |
534 | 534 | cpustate->device = device; |
535 | cpustate->program = device->space(AS_PROGRAM); | |
535 | cpustate->program = &device->space(AS_PROGRAM); | |
536 | 536 | cpustate->direct = &cpustate->program->direct(); |
537 | cpustate->io = device->space(AS_IO); | |
537 | cpustate->io = &device->space(AS_IO); | |
538 | 538 | cpustate->fcw = RDMEM_W(cpustate, 2); /* get reset cpustate->fcw */ |
539 | 539 | cpustate->pc = RDMEM_W(cpustate, 4); /* get reset cpustate->pc */ |
540 | 540 | } |
r18027 | r18028 | |
---|---|---|
826 | 826 | device->save_item(NAME(cpustate->addr_mask)); |
827 | 827 | |
828 | 828 | cpustate->device = device; |
829 | cpustate->program = device->space(AS_PROGRAM); | |
829 | cpustate->program = &device->space(AS_PROGRAM); | |
830 | 830 | cpustate->direct = &cpustate->program->direct(); |
831 | cpustate->data = device->space(AS_DATA); | |
832 | cpustate->io = device->space(AS_IO); | |
831 | cpustate->data = &device->space(AS_DATA); | |
832 | cpustate->io = &device->space(AS_IO); | |
833 | 833 | } |
834 | 834 | |
835 | 835 |
r18027 | r18028 | |
---|---|---|
124 | 124 | |
125 | 125 | cpustate->irq_callback = irqcallback; |
126 | 126 | cpustate->device = device; |
127 | cpustate->program = device->space(AS_PROGRAM); | |
127 | cpustate->program = &device->space(AS_PROGRAM); | |
128 | 128 | if ( device->static_config() != NULL ) { |
129 | 129 | cpustate->config.handle_dma = ((SM8500_CONFIG *)device->static_config())->handle_dma; |
130 | 130 | cpustate->config.handle_timers = ((SM8500_CONFIG *)device->static_config())->handle_timers; |
r18027 | r18028 | |
---|---|---|
961 | 961 | } |
962 | 962 | sh2->irq_callback = irqcallback; |
963 | 963 | sh2->device = device; |
964 | sh2->program = device->space(AS_PROGRAM); | |
964 | sh2->program = &device->space(AS_PROGRAM); | |
965 | 965 | sh2->direct = &sh2->program->direct(); |
966 | sh2->internal = device->space(AS_PROGRAM); | |
966 | sh2->internal = &device->space(AS_PROGRAM); | |
967 | 967 | |
968 | 968 | device->save_item(NAME(sh2->pc)); |
969 | 969 | device->save_item(NAME(sh2->sr)); |
r18027 | r18028 | |
---|---|---|
274 | 274 | memset(cpustate, 0, sizeof(mn102_info)); |
275 | 275 | |
276 | 276 | cpustate->device = device; |
277 | cpustate->program = device->space(AS_PROGRAM); | |
278 | cpustate->io = device->space(AS_IO); | |
277 | cpustate->program = &device->space(AS_PROGRAM); | |
278 | cpustate->io = &device->space(AS_IO); | |
279 | 279 | |
280 | 280 | device->save_item(NAME(cpustate->pc)); |
281 | 281 | device->save_item(NAME(cpustate->d)); |
r18027 | r18028 | |
---|---|---|
223 | 223 | tms32051_state *cpustate = get_safe_token(device); |
224 | 224 | |
225 | 225 | cpustate->device = device; |
226 | cpustate->program = device->space(AS_PROGRAM); | |
226 | cpustate->program = &device->space(AS_PROGRAM); | |
227 | 227 | cpustate->direct = &cpustate->program->direct(); |
228 | cpustate->data = device->space(AS_DATA); | |
228 | cpustate->data = &device->space(AS_DATA); | |
229 | 229 | |
230 | 230 | cpustate->pcstack_ptr = 0; |
231 | 231 | } |
r18027 | r18028 | |
---|---|---|
143 | 143 | |
144 | 144 | cpustate->irqcallback = irqcallback; |
145 | 145 | cpustate->device = device; |
146 | cpustate->program = device->space(AS_PROGRAM); | |
146 | cpustate->program = &device->space(AS_PROGRAM); | |
147 | 147 | cpustate->direct = &cpustate->program->direct(); |
148 | cpustate->data = device->space(AS_DATA); | |
149 | cpustate->io = device->space(AS_IO); | |
148 | cpustate->data = &device->space(AS_DATA); | |
149 | cpustate->io = &device->space(AS_IO); | |
150 | 150 | |
151 | 151 | cpustate->serial = device->machine().scheduler().timer_alloc(FUNC(serial_timer), (void *)device); |
152 | 152 |
r18027 | r18028 | |
---|---|---|
2868 | 2868 | sh4->ftcsr_read_callback = f; |
2869 | 2869 | sh4->irq_callback = save_irqcallback; |
2870 | 2870 | sh4->device = device; |
2871 | sh4->internal = device->space(AS_PROGRAM); | |
2872 | sh4->program = device->space(AS_PROGRAM); | |
2871 | sh4->internal = &device->space(AS_PROGRAM); | |
2872 | sh4->program = &device->space(AS_PROGRAM); | |
2873 | 2873 | sh4->direct = &sh4->program->direct(); |
2874 | sh4->io = device->space(AS_IO); | |
2874 | sh4->io = &device->space(AS_IO); | |
2875 | 2875 | |
2876 | 2876 | sh4->dma_timer[0] = tsaved[0]; |
2877 | 2877 | sh4->dma_timer[1] = tsaved[1]; |
r18027 | r18028 | |
3216 | 3216 | |
3217 | 3217 | sh4->irq_callback = irqcallback; |
3218 | 3218 | sh4->device = device; |
3219 | sh4->internal = device->space(AS_PROGRAM); | |
3220 | sh4->program = device->space(AS_PROGRAM); | |
3221 | sh4->io = device->space(AS_IO); | |
3219 | sh4->internal = &device->space(AS_PROGRAM); | |
3220 | sh4->program = &device->space(AS_PROGRAM); | |
3221 | sh4->io = &device->space(AS_IO); | |
3222 | 3222 | sh4_default_exception_priorities(sh4); |
3223 | 3223 | sh4->irln = 15; |
3224 | 3224 | sh4->test_irq = 0; |
r18027 | r18028 | |
---|---|---|
668 | 668 | alpha8201_state *cpustate = get_safe_token(device); |
669 | 669 | |
670 | 670 | cpustate->device = device; |
671 | cpustate->program = device->space(AS_PROGRAM); | |
671 | cpustate->program = &device->space(AS_PROGRAM); | |
672 | 672 | cpustate->direct = &cpustate->program->direct(); |
673 | 673 | |
674 | 674 | device->save_item(NAME(cpustate->RAM)); |
r18027 | r18028 | |
---|---|---|
338 | 338 | |
339 | 339 | g65816_set_irq_callback(cpustate, irqcallback); |
340 | 340 | cpustate->device = device; |
341 | cpustate->program = device->space(AS_PROGRAM); | |
341 | cpustate->program = &device->space(AS_PROGRAM); | |
342 | 342 | cpustate->cpu_type = CPU_TYPE_G65816; |
343 | 343 | |
344 | 344 | device->save_item(NAME(cpustate->a)); |
r18027 | r18028 | |
---|---|---|
800 | 800 | apexc_state *cpustate = get_safe_token(device); |
801 | 801 | |
802 | 802 | cpustate->device = device; |
803 | cpustate->program = device->space(AS_PROGRAM); | |
804 | cpustate->io = device->space(AS_IO); | |
803 | cpustate->program = &device->space(AS_PROGRAM); | |
804 | cpustate->io = &device->space(AS_IO); | |
805 | 805 | |
806 | 806 | device->save_item(NAME(cpustate->a)); |
807 | 807 | device->save_item(NAME(cpustate->r)); |
r18027 | r18028 | |
---|---|---|
367 | 367 | |
368 | 368 | nec_state->irq_callback = irqcallback; |
369 | 369 | nec_state->device = device; |
370 | nec_state->program = device->space(AS_PROGRAM); | |
370 | nec_state->program = &device->space(AS_PROGRAM); | |
371 | 371 | nec_state->direct = &nec_state->program->direct(); |
372 | nec_state->io = device->space(AS_IO); | |
372 | nec_state->io = &device->space(AS_IO); | |
373 | 373 | } |
374 | 374 | |
375 | 375 |
r18027 | r18028 | |
---|---|---|
486 | 486 | |
487 | 487 | nec_state->irq_callback = irqcallback; |
488 | 488 | nec_state->device = device; |
489 | nec_state->program = device->space(AS_PROGRAM); | |
489 | nec_state->program = &device->space(AS_PROGRAM); | |
490 | 490 | nec_state->direct = &nec_state->program->direct(); |
491 | nec_state->io = device->space(AS_IO); | |
491 | nec_state->io = &device->space(AS_IO); | |
492 | 492 | } |
493 | 493 | |
494 | 494 |
r18027 | r18028 | |
---|---|---|
231 | 231 | void cosmac_device::device_start() |
232 | 232 | { |
233 | 233 | // get our address spaces |
234 | m_program = space(AS_PROGRAM); | |
234 | m_program = &space(AS_PROGRAM); | |
235 | 235 | m_direct = &m_program->direct(); |
236 | m_io = space(AS_IO); | |
236 | m_io = &space(AS_IO); | |
237 | 237 | |
238 | 238 | // register our state for the debugger |
239 | 239 | state_add(STATE_GENPC, "GENPC", m_pc).callimport().callexport().noshow(); |
r18027 | r18028 | |
---|---|---|
311 | 311 | |
312 | 312 | r3000->irq_callback = irqcallback; |
313 | 313 | r3000->device = device; |
314 | r3000->program = device->space(AS_PROGRAM); | |
314 | r3000->program = &device->space(AS_PROGRAM); | |
315 | 315 | r3000->direct = &r3000->program->direct(); |
316 | 316 | } |
317 | 317 |
r18027 | r18028 | |
---|---|---|
81 | 81 | mips->cpu_clock = device->clock(); |
82 | 82 | mips->irq_callback = irqcallback; |
83 | 83 | mips->device = device; |
84 | mips->program = device->space(AS_PROGRAM); | |
84 | mips->program = &device->space(AS_PROGRAM); | |
85 | 85 | mips->direct = &mips->program->direct(); |
86 | 86 | mips->icache_size = config->icache; |
87 | 87 | mips->dcache_size = config->dcache; |
r18027 | r18028 | |
---|---|---|
165 | 165 | |
166 | 166 | cpustate->irq_callback = irqcallback; |
167 | 167 | cpustate->device = device; |
168 | cpustate->program = device->space(AS_PROGRAM); | |
168 | cpustate->program = &device->space(AS_PROGRAM); | |
169 | 169 | cpustate->direct = &cpustate->program->direct(); |
170 | cpustate->io = device->space(AS_IO); | |
170 | cpustate->io = &device->space(AS_IO); | |
171 | 171 | |
172 | 172 | memset(cpustate->pf, 0, 0x100); |
173 | 173 | memset(cpustate->rf, 0, 0x80); |
r18027 | r18028 | |
---|---|---|
1619 | 1619 | memset(cpustate, 0, sizeof(f8_Regs)); |
1620 | 1620 | cpustate->irq_callback = save_callback; |
1621 | 1621 | cpustate->device = device; |
1622 | cpustate->program = device->space(AS_PROGRAM); | |
1622 | cpustate->program = &device->space(AS_PROGRAM); | |
1623 | 1623 | cpustate->direct = &cpustate->program->direct(); |
1624 | cpustate->iospace = device->space(AS_IO); | |
1624 | cpustate->iospace = &device->space(AS_IO); | |
1625 | 1625 | cpustate->w&=~I; |
1626 | 1626 | |
1627 | 1627 | /* save PC0 to PC1 and reset PC0 */ |
r18027 | r18028 | |
1967 | 1967 | f8_Regs *cpustate = get_safe_token(device); |
1968 | 1968 | cpustate->irq_callback = irqcallback; |
1969 | 1969 | cpustate->device = device; |
1970 | cpustate->program = device->space(AS_PROGRAM); | |
1970 | cpustate->program = &device->space(AS_PROGRAM); | |
1971 | 1971 | cpustate->direct = &cpustate->program->direct(); |
1972 | cpustate->iospace = device->space(AS_IO); | |
1972 | cpustate->iospace = &device->space(AS_IO); | |
1973 | 1973 | |
1974 | 1974 | device->save_item(NAME(cpustate->pc0)); |
1975 | 1975 | device->save_item(NAME(cpustate->pc1)); |
r18027 | r18028 | |
---|---|---|
3477 | 3477 | z80->daisy.init(device, (const z80_daisy_config *)device->static_config()); |
3478 | 3478 | z80->irq_callback = irqcallback; |
3479 | 3479 | z80->device = device; |
3480 | z80->program = device->space(AS_PROGRAM); | |
3480 | z80->program = &device->space(AS_PROGRAM); | |
3481 | 3481 | z80->direct = &z80->program->direct(); |
3482 | z80->io = device->space(AS_IO); | |
3482 | z80->io = &device->space(AS_IO); | |
3483 | 3483 | z80->IX = z80->IY = 0xffff; /* IX and IY are FFFF after a reset! */ |
3484 | 3484 | z80->F = ZF; /* Zero flag is set */ |
3485 | 3485 |
r18027 | r18028 | |
---|---|---|
264 | 264 | cpustate->ipt_ram = auto_alloc_array(device->machine(), UINT16, IPT_RAM_SIZE/2); |
265 | 265 | |
266 | 266 | cpustate->device = device; |
267 | cpustate->program = device->space(AS_PROGRAM); | |
267 | cpustate->program = &device->space(AS_PROGRAM); | |
268 | 268 | cpustate->direct = &cpustate->program->direct(); |
269 | 269 | |
270 | 270 | /* Create the instruction decode lookup table */ |
r18027 | r18028 | |
---|---|---|
211 | 211 | void asap_device::device_start() |
212 | 212 | { |
213 | 213 | // get our address spaces |
214 | m_program = space(AS_PROGRAM); | |
214 | m_program = &space(AS_PROGRAM); | |
215 | 215 | m_direct = &m_program->direct(); |
216 | 216 | |
217 | 217 | // register our state for the debugger |
r18027 | r18028 | |
---|---|---|
1294 | 1294 | cpustate->irq_level = 16; |
1295 | 1295 | cpustate->irq_callback = irqcallback; |
1296 | 1296 | cpustate->device = device; |
1297 | cpustate->program = device->space(AS_PROGRAM); | |
1298 | cpustate->io = device->space(AS_IO); | |
1297 | cpustate->program = &device->space(AS_PROGRAM); | |
1298 | cpustate->io = &device->space(AS_IO); | |
1299 | 1299 | |
1300 | 1300 | #if (TMS99XX_MODEL == TMS9995_ID) |
1301 | 1301 | cpustate->timer = device->machine().scheduler().timer_alloc(FUNC(decrementer_callback), cpustate); |
r18027 | r18028 | |
---|---|---|
148 | 148 | |
149 | 149 | // TODO: Restore save state suport |
150 | 150 | |
151 | m_prgspace = space(AS_PROGRAM); // dimemory.h | |
152 | m_cru = space(AS_IO); | |
151 | m_prgspace = &space(AS_PROGRAM); // dimemory.h | |
152 | m_cru = &space(AS_IO); | |
153 | 153 | |
154 | 154 | // Resolve our external connections |
155 | 155 | m_external_operation.resolve(conf->external_callback, *this); |
r18027 | r18028 | |
---|---|---|
167 | 167 | |
168 | 168 | // TODO: Restore state save feature |
169 | 169 | |
170 | m_prgspace = space(AS_PROGRAM); // dimemory.h | |
171 | m_cru = space(AS_IO); | |
170 | m_prgspace = &space(AS_PROGRAM); // dimemory.h | |
171 | m_cru = &space(AS_IO); | |
172 | 172 | |
173 | 173 | // Resolve our external connections |
174 | 174 | m_external_operation.resolve(conf->external_callback, *this); |
r18027 | r18028 | |
---|---|---|
337 | 337 | |
338 | 338 | cpustate->device = device; |
339 | 339 | |
340 | cpustate->program = device->space(AS_PROGRAM); | |
340 | cpustate->program = &device->space(AS_PROGRAM); | |
341 | 341 | cpustate->direct = &cpustate->program->direct(); |
342 | cpustate->data = device->space(AS_DATA); | |
343 | cpustate->io = device->space(AS_IO); | |
342 | cpustate->data = &device->space(AS_DATA); | |
343 | cpustate->io = &device->space(AS_IO); | |
344 | 344 | |
345 | 345 | device->save_item(NAME(cpustate->A)); |
346 | 346 | device->save_item(NAME(cpustate->X)); |
r18027 | r18028 | |
---|---|---|
2067 | 2067 | |
2068 | 2068 | i960->irq_cb = irqcallback; |
2069 | 2069 | i960->device = device; |
2070 | i960->program = device->space(AS_PROGRAM); | |
2070 | i960->program = &device->space(AS_PROGRAM); | |
2071 | 2071 | i960->direct = &i960->program->direct(); |
2072 | 2072 | |
2073 | 2073 | device->save_item(NAME(i960->PIP)); |
r18027 | r18028 | |
---|---|---|
124 | 124 | |
125 | 125 | void hd61700_cpu_device::device_start() |
126 | 126 | { |
127 | m_program = | |
127 | m_program = &space(AS_PROGRAM); | |
128 | 128 | |
129 | 129 | m_sec_timer = timer_alloc(SEC_TIMER); |
130 | 130 | m_sec_timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1)); |
r18027 | r18028 | |
---|---|---|
42 | 42 | void dsp16_device::device_start() |
43 | 43 | { |
44 | 44 | // get our address spaces |
45 | m_program = space(AS_PROGRAM); | |
45 | m_program = &space(AS_PROGRAM); | |
46 | 46 | m_direct = &m_program->direct(); |
47 | 47 | |
48 | 48 | save_item(NAME(m_pc)); |
r18027 | r18028 | |
---|---|---|
1254 | 1254 | cpustate->nmi_line = CLEAR_LINE; |
1255 | 1255 | cpustate->irq_callback = irqcallback; |
1256 | 1256 | cpustate->device = device; |
1257 | cpustate->program = device->space(AS_PROGRAM); | |
1257 | cpustate->program = &device->space(AS_PROGRAM); | |
1258 | 1258 | cpustate->direct = &cpustate->program->direct(); |
1259 | cpustate->io = device->space(AS_IO); | |
1259 | cpustate->io = &device->space(AS_IO); | |
1260 | 1260 | |
1261 | 1261 | device->save_item(NAME(cpustate->reg)); |
1262 | 1262 | device->save_item(NAME(cpustate->irq_line)); |
r18027 | r18028 | |
---|---|---|
1676 | 1676 | cpustate->intRAM = auto_alloc_array(device->machine(), UINT16, 0x800); |
1677 | 1677 | cpustate->irq_callback = irqcallback; |
1678 | 1678 | cpustate->device = device; |
1679 | cpustate->program = device->space(AS_PROGRAM); | |
1679 | cpustate->program = &device->space(AS_PROGRAM); | |
1680 | 1680 | cpustate->direct = &cpustate->program->direct(); |
1681 | cpustate->data = device->space(AS_DATA); | |
1682 | cpustate->io = device->space(AS_IO); | |
1681 | cpustate->data = &device->space(AS_DATA); | |
1682 | cpustate->io = &device->space(AS_IO); | |
1683 | 1683 | |
1684 | 1684 | device->save_item(NAME(cpustate->PC)); |
1685 | 1685 | device->save_item(NAME(cpustate->STR0)); |
r18027 | r18028 | |
---|---|---|
661 | 661 | cpustate->clock = device->clock(); |
662 | 662 | |
663 | 663 | /* find address spaces */ |
664 | cpustate->program = device->space(AS_PROGRAM); | |
664 | cpustate->program = &device->space(AS_PROGRAM); | |
665 | 665 | cpustate->direct = &cpustate->program->direct(); |
666 | cpustate->data = device->space(AS_DATA); | |
667 | cpustate->io = device->space(AS_IO); | |
666 | cpustate->data = &device->space(AS_DATA); | |
667 | cpustate->io = &device->space(AS_IO); | |
668 | 668 | |
669 | 669 | /* allocate timers */ |
670 | 670 | cpustate->t0_timer = device->machine().scheduler().timer_alloc(FUNC(t0_tick), cpustate); |
r18027 | r18028 | |
---|---|---|
727 | 727 | pic16c5x_state *cpustate = get_safe_token(device); |
728 | 728 | |
729 | 729 | cpustate->device = device; |
730 | cpustate->program = device->space(AS_PROGRAM); | |
730 | cpustate->program = &device->space(AS_PROGRAM); | |
731 | 731 | cpustate->direct = &cpustate->program->direct(); |
732 | cpustate->data = device->space(AS_DATA); | |
733 | cpustate->io = device->space(AS_IO); | |
732 | cpustate->data = &device->space(AS_DATA); | |
733 | cpustate->io = &device->space(AS_IO); | |
734 | 734 | |
735 | 735 | /* ensure the internal ram pointers are set before get_info is called */ |
736 | 736 | update_internalram_ptr(cpustate); |
r18027 | r18028 | |
---|---|---|
543 | 543 | /* clean-up */ |
544 | 544 | memset (cpustate, 0, sizeof (*cpustate)); |
545 | 545 | cpustate->device = device; |
546 | cpustate->program = device->space(AS_PROGRAM); | |
546 | cpustate->program = &device->space(AS_PROGRAM); | |
547 | 547 | |
548 | 548 | /* set up params and callbacks */ |
549 | 549 | for (i=0; i<64; i++) |
r18027 | r18028 | |
---|---|---|
135 | 135 | cpustate->ir_mask = is_64kw ? 03 : 037; |
136 | 136 | |
137 | 137 | cpustate->device = device; |
138 | cpustate->program = device->space(AS_PROGRAM); | |
138 | cpustate->program = &device->space(AS_PROGRAM); | |
139 | 139 | } |
140 | 140 | |
141 | 141 | static CPU_INIT( tx0_64kw ) |
r18027 | r18028 | |
---|---|---|
111 | 111 | |
112 | 112 | memset(cpustate, 0, sizeof( *cpustate ) ); |
113 | 113 | cpustate->device = device; |
114 | cpustate->program = device->space(AS_PROGRAM); | |
114 | cpustate->program = &device->space(AS_PROGRAM); | |
115 | 115 | cpustate->direct = &cpustate->program->direct(); |
116 | 116 | |
117 | 117 | if ( _config ) |
r18027 | r18028 | |
---|---|---|
264 | 264 | cpustate->initial_pc = initial_pc[setup->mode >> 13]; |
265 | 265 | cpustate->irq_callback = irqcallback; |
266 | 266 | cpustate->device = device; |
267 | cpustate->program = device->space(AS_PROGRAM); | |
267 | cpustate->program = &device->space(AS_PROGRAM); | |
268 | 268 | cpustate->direct = &cpustate->program->direct(); |
269 | 269 | |
270 | 270 | device->save_item(NAME(cpustate->ppc.w.l)); |
r18027 | r18028 | |
---|---|---|
140 | 140 | memset(cpustate, 0, sizeof(arm_state)); |
141 | 141 | cpustate->irq_callback = save_irqcallback; |
142 | 142 | cpustate->device = device; |
143 | cpustate->program = device->space(AS_PROGRAM); | |
143 | cpustate->program = &device->space(AS_PROGRAM); | |
144 | 144 | cpustate->endian = ENDIANNESS_LITTLE; |
145 | 145 | cpustate->direct = &cpustate->program->direct(); |
146 | 146 |
r18027 | r18028 | |
---|---|---|
427 | 427 | |
428 | 428 | cpustate->irq_callback = irqcallback; |
429 | 429 | cpustate->device = device; |
430 | cpustate->program = device->space(AS_PROGRAM); | |
430 | cpustate->program = &device->space(AS_PROGRAM); | |
431 | 431 | cpustate->direct = &cpustate->program->direct(); |
432 | 432 | |
433 | 433 | // setup co-proc callbacks |
r18027 | r18028 | |
---|---|---|
161 | 161 | |
162 | 162 | cpustate->irq_callback = irqcallback; |
163 | 163 | cpustate->device = device; |
164 | cpustate->program = device->space(AS_PROGRAM); | |
164 | cpustate->program = &device->space(AS_PROGRAM); | |
165 | 165 | cpustate->direct = &cpustate->program->direct(); |
166 | cpustate->io = device->space(AS_IO); | |
166 | cpustate->io = &device->space(AS_IO); | |
167 | 167 | } |
168 | 168 | |
169 | 169 | static CPU_RESET( h6280 ) |
r18027 | r18028 | |
178 | 178 | memset(cpustate, 0, sizeof(h6280_Regs)); |
179 | 179 | cpustate->irq_callback = save_irqcallback; |
180 | 180 | cpustate->device = device; |
181 | cpustate->program = device->space(AS_PROGRAM); | |
181 | cpustate->program = &device->space(AS_PROGRAM); | |
182 | 182 | cpustate->direct = &cpustate->program->direct(); |
183 | cpustate->io = device->space(AS_IO); | |
183 | cpustate->io = &device->space(AS_IO); | |
184 | 184 | |
185 | 185 | /* set I and B flags */ |
186 | 186 | P = _fI | _fB; |
r18027 | r18028 | |
---|---|---|
1046 | 1046 | { |
1047 | 1047 | m6800_state *cpustate = get_safe_token(device); |
1048 | 1048 | |
1049 | cpustate->program = device->space(AS_PROGRAM); | |
1049 | cpustate->program = &device->space(AS_PROGRAM); | |
1050 | 1050 | cpustate->direct = &cpustate->program->direct(); |
1051 | cpustate->data = device->space(AS_DATA); | |
1052 | cpustate->io = device->space(AS_IO); | |
1051 | cpustate->data = &device->space(AS_DATA); | |
1052 | cpustate->io = &device->space(AS_IO); | |
1053 | 1053 | |
1054 | 1054 | // cpustate->subtype = SUBTYPE_M6800; |
1055 | 1055 | cpustate->insn = m6800_insn; |
r18027 | r18028 | |
1199 | 1199 | cpustate->irq_callback = irqcallback; |
1200 | 1200 | cpustate->device = device; |
1201 | 1201 | |
1202 | cpustate->program = device->space(AS_PROGRAM); | |
1202 | cpustate->program = &device->space(AS_PROGRAM); | |
1203 | 1203 | cpustate->direct = &cpustate->program->direct(); |
1204 | cpustate->data = device->space(AS_DATA); | |
1205 | cpustate->io = device->space(AS_IO); | |
1204 | cpustate->data = &device->space(AS_DATA); | |
1205 | cpustate->io = &device->space(AS_IO); | |
1206 | 1206 | |
1207 | 1207 | cpustate->clock = device->clock() / 4; |
1208 | 1208 | cpustate->sci_timer = device->machine().scheduler().timer_alloc(FUNC(sci_tick), cpustate); |
r18027 | r18028 | |
1234 | 1234 | cpustate->irq_callback = irqcallback; |
1235 | 1235 | cpustate->device = device; |
1236 | 1236 | |
1237 | cpustate->program = device->space(AS_PROGRAM); | |
1237 | cpustate->program = &device->space(AS_PROGRAM); | |
1238 | 1238 | cpustate->direct = &cpustate->program->direct(); |
1239 | cpustate->data = device->space(AS_DATA); | |
1240 | cpustate->io = device->space(AS_IO); | |
1239 | cpustate->data = &device->space(AS_DATA); | |
1240 | cpustate->io = &device->space(AS_IO); | |
1241 | 1241 | |
1242 | 1242 | state_register(cpustate, "m6802"); |
1243 | 1243 | } |
r18027 | r18028 | |
1254 | 1254 | cpustate->irq_callback = irqcallback; |
1255 | 1255 | cpustate->device = device; |
1256 | 1256 | |
1257 | cpustate->program = device->space(AS_PROGRAM); | |
1257 | cpustate->program = &device->space(AS_PROGRAM); | |
1258 | 1258 | cpustate->direct = &cpustate->program->direct(); |
1259 | cpustate->data = device->space(AS_DATA); | |
1260 | cpustate->io = device->space(AS_IO); | |
1259 | cpustate->data = &device->space(AS_DATA); | |
1260 | cpustate->io = &device->space(AS_IO); | |
1261 | 1261 | |
1262 | 1262 | cpustate->clock = device->clock() / 4; |
1263 | 1263 | cpustate->sci_timer = device->machine().scheduler().timer_alloc(FUNC(sci_tick), cpustate); |
r18027 | r18028 | |
1296 | 1296 | cpustate->irq_callback = irqcallback; |
1297 | 1297 | cpustate->device = device; |
1298 | 1298 | |
1299 | cpustate->program = device->space(AS_PROGRAM); | |
1299 | cpustate->program = &device->space(AS_PROGRAM); | |
1300 | 1300 | cpustate->direct = &cpustate->program->direct(); |
1301 | cpustate->data = device->space(AS_DATA); | |
1302 | cpustate->io = device->space(AS_IO); | |
1301 | cpustate->data = &device->space(AS_DATA); | |
1302 | cpustate->io = &device->space(AS_IO); | |
1303 | 1303 | |
1304 | 1304 | state_register(cpustate, "m6808"); |
1305 | 1305 | } |
r18027 | r18028 | |
1317 | 1317 | cpustate->irq_callback = irqcallback; |
1318 | 1318 | cpustate->device = device; |
1319 | 1319 | |
1320 | cpustate->program = device->space(AS_PROGRAM); | |
1320 | cpustate->program = &device->space(AS_PROGRAM); | |
1321 | 1321 | cpustate->direct = &cpustate->program->direct(); |
1322 | cpustate->data = device->space(AS_DATA); | |
1323 | cpustate->io = device->space(AS_IO); | |
1322 | cpustate->data = &device->space(AS_DATA); | |
1323 | cpustate->io = &device->space(AS_IO); | |
1324 | 1324 | |
1325 | 1325 | cpustate->clock = device->clock() / 4; |
1326 | 1326 | cpustate->sci_timer = device->machine().scheduler().timer_alloc(FUNC(sci_tick), cpustate); |
r18027 | r18028 | |
1342 | 1342 | cpustate->irq_callback = irqcallback; |
1343 | 1343 | cpustate->device = device; |
1344 | 1344 | |
1345 | cpustate->program = device->space(AS_PROGRAM); | |
1345 | cpustate->program = &device->space(AS_PROGRAM); | |
1346 | 1346 | cpustate->direct = &cpustate->program->direct(); |
1347 | cpustate->data = device->space(AS_DATA); | |
1348 | cpustate->io = device->space(AS_IO); | |
1347 | cpustate->data = &device->space(AS_DATA); | |
1348 | cpustate->io = &device->space(AS_IO); | |
1349 | 1349 | |
1350 | 1350 | cpustate->clock = device->clock() / 4; |
1351 | 1351 | cpustate->sci_timer = device->machine().scheduler().timer_alloc(FUNC(sci_tick), cpustate); |
r18027 | r18028 | |
1377 | 1377 | // cpustate->subtype = SUBTYPE_NSC8105; |
1378 | 1378 | cpustate->device = device; |
1379 | 1379 | |
1380 | cpustate->program = device->space(AS_PROGRAM); | |
1380 | cpustate->program = &device->space(AS_PROGRAM); | |
1381 | 1381 | cpustate->direct = &cpustate->program->direct(); |
1382 | cpustate->data = device->space(AS_DATA); | |
1383 | cpustate->io = device->space(AS_IO); | |
1382 | cpustate->data = &device->space(AS_DATA); | |
1383 | cpustate->io = &device->space(AS_IO); | |
1384 | 1384 | |
1385 | 1385 | cpustate->insn = nsc8105_insn; |
1386 | 1386 | cpustate->cycles = cycles_nsc8105; |
r18027 | r18028 | |
---|---|---|
3388 | 3388 | cpustate->intrm_pending = 0; |
3389 | 3389 | cpustate->irq_callback = irqcallback; |
3390 | 3390 | cpustate->device = device; |
3391 | cpustate->program = device->space(AS_PROGRAM); | |
3391 | cpustate->program = &device->space(AS_PROGRAM); | |
3392 | 3392 | |
3393 | 3393 | device->save_item(NAME(cpustate->r)); |
3394 | 3394 | device->save_item(NAME(cpustate->flags)); |
r18027 | r18028 | |
---|---|---|
114 | 114 | cpustate->config = (saturn_cpu_core *) device->static_config(); |
115 | 115 | cpustate->irq_callback = irqcallback; |
116 | 116 | cpustate->device = device; |
117 | cpustate->program = device->space(AS_PROGRAM); | |
117 | cpustate->program = &device->space(AS_PROGRAM); | |
118 | 118 | cpustate->direct = &cpustate->program->direct(); |
119 | 119 | |
120 | 120 | device->save_item(NAME(cpustate->reg[R0])); |
r18027 | r18028 | |
---|---|---|
80 | 80 | void necdsp_device::device_start() |
81 | 81 | { |
82 | 82 | // get our address spaces |
83 | m_program = space(AS_PROGRAM); | |
84 | m_data = space(AS_DATA); | |
83 | m_program = &space(AS_PROGRAM); | |
84 | m_data = &space(AS_DATA); | |
85 | 85 | m_direct = &m_program->direct(); |
86 | 86 | |
87 | 87 | // register our state for the debugger |
r18027 | r18028 | |
---|---|---|
403 | 403 | |
404 | 404 | cpustate->irq_callback = irqcallback; |
405 | 405 | cpustate->device = device; |
406 | cpustate->program = device->space(AS_PROGRAM); | |
406 | cpustate->program = &device->space(AS_PROGRAM); | |
407 | 407 | cpustate->direct = &cpustate->program->direct(); |
408 | 408 | |
409 | 409 | device->save_item(NAME(PC)); |
r18027 | r18028 | |
---|---|---|
144 | 144 | throw emu_fatalerror("Device '%s' (requested by %s '%s') has no memory interface", tag, current.name(), current.tag()); |
145 | 145 | |
146 | 146 | // set the real target and function, then prime a delegate |
147 | address_space *result = memory->space(index); | |
148 | if (result == NULL) | |
147 | if (!memory->has_space(index)) | |
149 | 148 | throw emu_fatalerror("Unable to find device '%s' space %d (requested by %s '%s')", tag, index, current.name(), current.tag()); |
150 | ||
151 | return *result; | |
149 | return memory->space(index); | |
152 | 150 | } |
153 | 151 | |
154 | 152 |
r18027 | r18028 | |
---|---|---|
231 | 231 | |
232 | 232 | inline UINT8 crt9007_device::readbyte(offs_t address) |
233 | 233 | { |
234 | return space() | |
234 | return space().read_byte(address); | |
235 | 235 | } |
236 | 236 | |
237 | 237 |
r18027 | r18028 | |
---|---|---|
418 | 418 | |
419 | 419 | inline UINT8 mos8563_device::read_videoram(offs_t offset) |
420 | 420 | { |
421 | return space(AS_0) | |
421 | return space(AS_0).read_byte(offset); | |
422 | 422 | } |
423 | 423 | |
424 | 424 | inline void mos8563_device::write_videoram(offs_t offset, UINT8 data) |
425 | 425 | { |
426 | space(AS_0) | |
426 | space(AS_0).write_byte(offset, data); | |
427 | 427 | } |
428 | 428 | |
429 | 429 |
r18027 | r18028 | |
---|---|---|
365 | 365 | |
366 | 366 | inline UINT8 h63484_device::readbyte(offs_t address) |
367 | 367 | { |
368 | return space() | |
368 | return space().read_byte(address); | |
369 | 369 | } |
370 | 370 | |
371 | 371 | |
r18027 | r18028 | |
375 | 375 | |
376 | 376 | inline void h63484_device::writebyte(offs_t address, UINT8 data) |
377 | 377 | { |
378 | space() | |
378 | space().write_byte(address, data); | |
379 | 379 | } |
380 | 380 | |
381 | 381 |
r18027 | r18028 | |
---|---|---|
619 | 619 | m_irq_changed.resolve( m_out_int_line, *this ); |
620 | 620 | |
621 | 621 | // Video RAM is allocated as an own address space |
622 | m_vram_space = space(AS_DATA); | |
622 | m_vram_space = &space(AS_DATA); | |
623 | 623 | |
624 | 624 | /* back bitmap */ |
625 | 625 | m_tmpbmp.allocate(TMS9928A_TOTAL_HORZ, TMS9928A_TOTAL_VERT_PAL); |
r18027 | r18028 | |
---|---|---|
63 | 63 | |
64 | 64 | inline UINT16 mb90082_device::read_word(offs_t address) |
65 | 65 | { |
66 | return space() | |
66 | return space().read_word(address << 1); | |
67 | 67 | } |
68 | 68 | |
69 | 69 | //------------------------------------------------- |
r18027 | r18028 | |
72 | 72 | |
73 | 73 | inline void mb90082_device::write_word(offs_t address, UINT16 data) |
74 | 74 | { |
75 | space() | |
75 | space().write_word(address << 1, data); | |
76 | 76 | } |
77 | 77 | |
78 | 78 | //************************************************************************** |
r18027 | r18028 | |
---|---|---|
329 | 329 | static VIDEO_START( pc_cga ) |
330 | 330 | { |
331 | 331 | int buswidth; |
332 | address_space &space = *machine.firstcpu->space(AS_PROGRAM); | |
333 | address_space *spaceio = machine.firstcpu->space(AS_IO); | |
332 | address_space &space = machine.firstcpu->space(AS_PROGRAM); | |
333 | address_space &spaceio = machine.firstcpu->space(AS_IO); | |
334 | 334 | |
335 | 335 | space.install_readwrite_bank(0xb8000, 0xbbfff, 0, 0x04000, "bank11" ); |
336 | 336 | buswidth = machine.firstcpu->space_config(AS_PROGRAM)->m_databus_width; |
r18027 | r18028 | |
357 | 357 | fatalerror("CGA: Bus width %d not supported\n", buswidth); |
358 | 358 | break; |
359 | 359 | } |
360 | spaceio | |
360 | spaceio.install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc_cga8_r), FUNC(pc_cga8_w), mask ); | |
361 | 361 | internal_pc_cga_video_start(machine); |
362 | 362 | cga.videoram_size = 0x4000; |
363 | 363 | cga.videoram = auto_alloc_array(machine, UINT8, 0x4000); |
r18027 | r18028 | |
370 | 370 | static VIDEO_START( pc_cga32k ) |
371 | 371 | { |
372 | 372 | int buswidth; |
373 | address_space &space = *machine.firstcpu->space(AS_PROGRAM); | |
374 | address_space *spaceio = machine.firstcpu->space(AS_IO); | |
373 | address_space &space = machine.firstcpu->space(AS_PROGRAM); | |
374 | address_space &spaceio = machine.firstcpu->space(AS_IO); | |
375 | 375 | |
376 | 376 | |
377 | 377 | space.install_readwrite_bank(0xb8000, 0xbffff, "bank11" ); |
r18027 | r18028 | |
399 | 399 | fatalerror("CGA: Bus width %d not supported\n", buswidth); |
400 | 400 | break; |
401 | 401 | } |
402 | spaceio | |
402 | spaceio.install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc_cga8_r), FUNC(pc_cga8_w), mask ); | |
403 | 403 | |
404 | 404 | internal_pc_cga_video_start(machine); |
405 | 405 | |
r18027 | r18028 | |
1202 | 1202 | // Not sure if some all CGA cards have ability to upload char definition |
1203 | 1203 | // The original CGA card had a char rom |
1204 | 1204 | UINT8 buswidth = space.machine().firstcpu->space_config(AS_PROGRAM)->m_databus_width; |
1205 | address_space | |
1205 | address_space &space_prg = space.machine().firstcpu->space(AS_PROGRAM); | |
1206 | 1206 | cga.p3df = data; |
1207 | 1207 | if (data & 1) { |
1208 | 1208 | UINT64 mask = 0; |
r18027 | r18028 | |
1228 | 1228 | fatalerror("CGA: Bus width %d not supported\n", buswidth); |
1229 | 1229 | break; |
1230 | 1230 | } |
1231 | space_prg | |
1231 | space_prg.install_legacy_readwrite_handler(0xb8000, 0xb9fff, FUNC(char_ram_r),FUNC(char_ram_w), mask ); | |
1232 | 1232 | } else { |
1233 | 1233 | if (cga.videoram_size== 0x4000) { |
1234 | space_prg | |
1234 | space_prg.install_readwrite_bank(0xb8000, 0xbbfff, 0, 0x04000, "bank11" ); | |
1235 | 1235 | } else { |
1236 | space_prg | |
1236 | space_prg.install_readwrite_bank(0xb8000, 0xbffff, "bank11" ); | |
1237 | 1237 | } |
1238 | 1238 | } |
1239 | 1239 | break; |
r18027 | r18028 | |
1635 | 1635 | cga.videoram_size = 0x10000; |
1636 | 1636 | cga.videoram = auto_alloc_array(machine, UINT8, 0x10000 ); |
1637 | 1637 | |
1638 | address_space &space = *machine.firstcpu->space( AS_PROGRAM ); | |
1639 | address_space *io_space = machine.firstcpu->space( AS_IO ); | |
1638 | address_space &space = machine.firstcpu->space( AS_PROGRAM ); | |
1639 | address_space &io_space = machine.firstcpu->space( AS_IO ); | |
1640 | 1640 | |
1641 | 1641 | space.install_read_bank( 0xb8000, 0xbbfff, 0, 0x0C000, "bank1" ); |
1642 | 1642 | machine.root_device().membank("bank1")->set_base(cga.videoram + videoram_offset[0]); |
1643 | 1643 | space.install_legacy_write_handler( 0xb8000, 0xbbfff, 0, 0x0C000, FUNC(pc1512_videoram_w), 0xffff); |
1644 | 1644 | |
1645 | io_space | |
1645 | io_space.install_legacy_readwrite_handler( 0x3d0, 0x3df, FUNC(pc1512_r), FUNC(pc1512_w), 0xffff); | |
1646 | 1646 | |
1647 | 1647 | } |
1648 | 1648 |
r18027 | r18028 | |
---|---|---|
96 | 96 | { |
97 | 97 | g_profiler.start( PROFILER_VIDEO ); |
98 | 98 | /* Get next pixel information */ |
99 | m_pixel_data = m_huc6270_b->next_pixel( | |
99 | m_pixel_data = m_huc6270_b->next_pixel( machine().driver_data()->generic_space(), 0, 0xffff ); | |
100 | 100 | g_profiler.stop(); |
101 | 101 | } |
102 | 102 |
r18027 | r18028 | |
---|---|---|
148 | 148 | |
149 | 149 | inline UINT16 m50458_device::read_word(offs_t address) |
150 | 150 | { |
151 | return space() | |
151 | return space().read_word(address << 1); | |
152 | 152 | } |
153 | 153 | |
154 | 154 | //------------------------------------------------- |
r18027 | r18028 | |
157 | 157 | |
158 | 158 | inline void m50458_device::write_word(offs_t address, UINT16 data) |
159 | 159 | { |
160 | space() | |
160 | space().write_word(address << 1, data); | |
161 | 161 | } |
162 | 162 | |
163 | 163 |
r18027 | r18028 | |
---|---|---|
82 | 82 | |
83 | 83 | inline UINT8 hd61830_device::readbyte(offs_t address) |
84 | 84 | { |
85 | return space() | |
85 | return space().read_byte(address); | |
86 | 86 | } |
87 | 87 | |
88 | 88 | |
r18027 | r18028 | |
92 | 92 | |
93 | 93 | inline void hd61830_device::writebyte(offs_t address, UINT8 data) |
94 | 94 | { |
95 | space() | |
95 | space().write_byte(address, data); | |
96 | 96 | } |
97 | 97 | |
98 | 98 |
r18027 | r18028 | |
---|---|---|
42 | 42 | |
43 | 43 | inline UINT32 huc6272_device::read_dword(offs_t address) |
44 | 44 | { |
45 | return space() | |
45 | return space().read_dword(address << 2); | |
46 | 46 | } |
47 | 47 | |
48 | 48 | |
r18027 | r18028 | |
52 | 52 | |
53 | 53 | inline void huc6272_device::write_dword(offs_t address, UINT32 data) |
54 | 54 | { |
55 | space() | |
55 | space().write_dword(address << 2, data); | |
56 | 56 | } |
57 | 57 | |
58 | 58 | //************************************************************************** |
r18027 | r18028 | |
---|---|---|
614 | 614 | m_size_old = -1; |
615 | 615 | |
616 | 616 | // Video RAM is allocated as an own address space |
617 | m_vram_space = space(AS_DATA); | |
617 | m_vram_space = &space(AS_DATA); | |
618 | 618 | |
619 | 619 | // allocate VRAM |
620 | 620 | assert(m_vram_size > 0); |
r18027 | r18028 | |
---|---|---|
89 | 89 | |
90 | 90 | inline UINT8 sed1330_device::readbyte(offs_t address) |
91 | 91 | { |
92 | return space() | |
92 | return space().read_byte(address); | |
93 | 93 | } |
94 | 94 | |
95 | 95 | |
r18027 | r18028 | |
99 | 99 | |
100 | 100 | inline void sed1330_device::writebyte(offs_t address, UINT8 data) |
101 | 101 | { |
102 | space() | |
102 | space().write_byte(address, data); | |
103 | 103 | } |
104 | 104 | |
105 | 105 |
r18027 | r18028 | |
---|---|---|
496 | 496 | if ( !space.debugger_access() ) |
497 | 497 | { |
498 | 498 | /* Load read buffer */ |
499 | m_buffer = this->space() | |
499 | m_buffer = this->space().read_byte(m_addr & 0x3fff); | |
500 | 500 | |
501 | 501 | /* Bump internal addthis->ress register */ |
502 | 502 | m_addr += 1; |
r18027 | r18028 | |
543 | 543 | case 0x00: |
544 | 544 | case 0x01: |
545 | 545 | case 0x02: |
546 | this->space() | |
546 | this->space().write_byte(m_addr & 0x3fff, data); | |
547 | 547 | break; |
548 | 548 | |
549 | 549 | case 0x03: |
r18027 | r18028 | |
582 | 582 | switch (m_addrmode) |
583 | 583 | { |
584 | 584 | case 0: /* VRAM reading mode */ |
585 | m_buffer = this->space() | |
585 | m_buffer = this->space().read_byte(m_addr & 0x3fff); | |
586 | 586 | m_addr += 1; |
587 | 587 | break; |
588 | 588 | |
r18027 | r18028 | |
691 | 691 | y_scroll = ((m_reg[0x00] & 0x80) && (tile_column > 23)) ? 0 : m_reg9copy; |
692 | 692 | |
693 | 693 | tile_line = ((tile_column + x_scroll_start_column) & 0x1f) * 2; |
694 | tile_data = space() | |
694 | tile_data = space().read_word(name_table_address + ((((line + y_scroll) % scroll_mod) >> 3) << 6) + tile_line); | |
695 | 695 | |
696 | 696 | tile_selected = (tile_data & 0x01ff); |
697 | 697 | priority_select = tile_data & PRIORITY_BIT; |
r18027 | r18028 | |
703 | 703 | if (vert_selected) |
704 | 704 | tile_line = 0x07 - tile_line; |
705 | 705 | |
706 | bit_plane_0 = space()->read_byte(((tile_selected << 5) + ((tile_line & 0x07) << 2)) + 0x00); | |
707 | bit_plane_1 = space()->read_byte(((tile_selected << 5) + ((tile_line & 0x07) << 2)) + 0x01); | |
708 | bit_plane_2 = space()->read_byte(((tile_selected << 5) + ((tile_line & 0x07) << 2)) + 0x02); | |
709 | bit_plane_3 = space()->read_byte(((tile_selected << 5) + ((tile_line & 0x07) << 2)) + 0x03); | |
706 | bit_plane_0 = space().read_byte(((tile_selected << 5) + ((tile_line & 0x07) << 2)) + 0x00); | |
707 | bit_plane_1 = space().read_byte(((tile_selected << 5) + ((tile_line & 0x07) << 2)) + 0x01); | |
708 | bit_plane_2 = space().read_byte(((tile_selected << 5) + ((tile_line & 0x07) << 2)) + 0x02); | |
709 | bit_plane_3 = space().read_byte(((tile_selected << 5) + ((tile_line & 0x07) << 2)) + 0x03); | |
710 | 710 | |
711 | 711 | for (pixel_x = 0; pixel_x < 8 ; pixel_x++) |
712 | 712 | { |
r18027 | r18028 | |
765 | 765 | if (m_reg[0x01] & 0x01) /* Check if MAG is set */ |
766 | 766 | m_sprite_height = m_sprite_height * 2; |
767 | 767 | |
768 | for (sprite_index = 0; (sprite_index < 32 * 4) && (space() | |
768 | for (sprite_index = 0; (sprite_index < 32 * 4) && (space().read_byte( m_sprite_base + sprite_index ) != 0xd0) && (m_sprite_count < max_sprites + 1); sprite_index += 4) | |
769 | 769 | { |
770 | int sprite_y = space() | |
770 | int sprite_y = space().read_byte( m_sprite_base + sprite_index ) + 1; | |
771 | 771 | |
772 | 772 | if (sprite_y > 240) |
773 | 773 | { |
r18027 | r18028 | |
794 | 794 | m_sprite_height = (m_reg[0x01] & 0x02) ? 16 : 8; |
795 | 795 | m_sprite_zoom = (m_reg[0x01] & 0x01) ? 2 : 1; |
796 | 796 | |
797 | for (sprite_index = 0; (sprite_index < 64) && (space() | |
797 | for (sprite_index = 0; (sprite_index < 64) && (space().read_byte(m_sprite_base + sprite_index ) != 0xd0 || m_y_pixels != 192) && (m_sprite_count < max_sprites + 1); sprite_index++) | |
798 | 798 | { |
799 | int sprite_y = space() | |
799 | int sprite_y = space().read_byte( m_sprite_base + sprite_index ) + 1; /* sprite y position starts at line 1 */ | |
800 | 800 | |
801 | 801 | if (sprite_y > 240) |
802 | 802 | { |
r18027 | r18028 | |
844 | 844 | for (int sprite_buffer_index = m_sprite_count - 1; sprite_buffer_index >= 0; sprite_buffer_index--) |
845 | 845 | { |
846 | 846 | int sprite_index = m_selected_sprite[sprite_buffer_index]; |
847 | int sprite_y = space()->read_byte( m_sprite_base + sprite_index ) + 1; /* sprite y position starts at line 1 */ | |
848 | int sprite_x = space()->read_byte( m_sprite_base + 0x80 + (sprite_index << 1) ); | |
849 | int sprite_tile_selected = space()->read_byte( m_sprite_base + 0x81 + (sprite_index << 1) ); | |
847 | int sprite_y = space().read_byte( m_sprite_base + sprite_index ) + 1; /* sprite y position starts at line 1 */ | |
848 | int sprite_x = space().read_byte( m_sprite_base + 0x80 + (sprite_index << 1) ); | |
849 | int sprite_tile_selected = space().read_byte( m_sprite_base + 0x81 + (sprite_index << 1) ); | |
850 | 850 | |
851 | 851 | if (sprite_y > 240) |
852 | 852 | { |
r18027 | r18028 | |
875 | 875 | sprite_tile_selected += 1; |
876 | 876 | } |
877 | 877 | |
878 | UINT8 bit_plane_0 = space()->read_byte(((sprite_tile_selected << 5) + ((sprite_line & 0x07) << 2)) + 0x00); | |
879 | UINT8 bit_plane_1 = space()->read_byte(((sprite_tile_selected << 5) + ((sprite_line & 0x07) << 2)) + 0x01); | |
880 | UINT8 bit_plane_2 = space()->read_byte(((sprite_tile_selected << 5) + ((sprite_line & 0x07) << 2)) + 0x02); | |
881 | UINT8 bit_plane_3 = space()->read_byte(((sprite_tile_selected << 5) + ((sprite_line & 0x07) << 2)) + 0x03); | |
878 | UINT8 bit_plane_0 = space().read_byte(((sprite_tile_selected << 5) + ((sprite_line & 0x07) << 2)) + 0x00); | |
879 | UINT8 bit_plane_1 = space().read_byte(((sprite_tile_selected << 5) + ((sprite_line & 0x07) << 2)) + 0x01); | |
880 | UINT8 bit_plane_2 = space().read_byte(((sprite_tile_selected << 5) + ((sprite_line & 0x07) << 2)) + 0x02); | |
881 | UINT8 bit_plane_3 = space().read_byte(((sprite_tile_selected << 5) + ((sprite_line & 0x07) << 2)) + 0x03); | |
882 | 882 | |
883 | 883 | for (int pixel_x = 0; pixel_x < 8 ; pixel_x++) |
884 | 884 | { |
r18027 | r18028 | |
1002 | 1002 | for (int sprite_buffer_index = m_sprite_count - 1; sprite_buffer_index >= 0; sprite_buffer_index--) |
1003 | 1003 | { |
1004 | 1004 | int sprite_index = m_selected_sprite[sprite_buffer_index]; |
1005 | int sprite_y = space()->read_byte( m_sprite_base + sprite_index ) + 1; | |
1006 | int sprite_x = space()->read_byte( m_sprite_base + sprite_index + 1 ); | |
1007 | UINT8 flags = space()->read_byte( m_sprite_base + sprite_index + 3 ); | |
1005 | int sprite_y = space().read_byte( m_sprite_base + sprite_index ) + 1; | |
1006 | int sprite_x = space().read_byte( m_sprite_base + sprite_index + 1 ); | |
1007 | UINT8 flags = space().read_byte( m_sprite_base + sprite_index + 3 ); | |
1008 | 1008 | int pen_selected = m_palette_offset + ( flags & 0x0f ); |
1009 | 1009 | |
1010 | 1010 | if (sprite_y > 240) |
r18027 | r18028 | |
1013 | 1013 | if (flags & 0x80) |
1014 | 1014 | sprite_x -= 32; |
1015 | 1015 | |
1016 | int sprite_tile_selected = space() | |
1016 | int sprite_tile_selected = space().read_byte( m_sprite_base + sprite_index + 2 ); | |
1017 | 1017 | int sprite_line = line - sprite_y; |
1018 | 1018 | |
1019 | 1019 | if (m_reg[0x01] & 0x01) |
r18027 | r18028 | |
1030 | 1030 | } |
1031 | 1031 | } |
1032 | 1032 | |
1033 | UINT8 pattern = space() | |
1033 | UINT8 pattern = space().read_byte( sprite_pattern_base + sprite_tile_selected * 8 + sprite_line ); | |
1034 | 1034 | |
1035 | 1035 | for (int pixel_x = 0; pixel_x < 8; pixel_x++) |
1036 | 1036 | { |
r18027 | r18028 | |
1099 | 1099 | if (m_reg[0x01] & 0x02) |
1100 | 1100 | { |
1101 | 1101 | sprite_tile_selected += 2; |
1102 | pattern = space() | |
1102 | pattern = space().read_byte( sprite_pattern_base + sprite_tile_selected * 8 + sprite_line ); | |
1103 | 1103 | sprite_x += (m_reg[0x01] & 0x01 ? 16 : 8); |
1104 | 1104 | |
1105 | 1105 | for (int pixel_x = 0; pixel_x < 8; pixel_x++) |
r18027 | r18028 | |
1191 | 1191 | |
1192 | 1192 | for (tile_column = 0; tile_column < 32; tile_column++) |
1193 | 1193 | { |
1194 | UINT8 name = space() | |
1194 | UINT8 name = space().read_byte( name_table_base + tile_column ); | |
1195 | 1195 | UINT8 pattern; |
1196 | 1196 | UINT8 colors; |
1197 | 1197 | |
1198 | pattern = space()->read_byte(pattern_base + (((pattern_offset + name) & pattern_mask) * 8) + (line & 0x07) ); | |
1199 | colors = space()->read_byte(color_base + (((pattern_offset + name) & color_mask) * 8) + (line & 0x07) ); | |
1198 | pattern = space().read_byte(pattern_base + (((pattern_offset + name) & pattern_mask) * 8) + (line & 0x07) ); | |
1199 | colors = space().read_byte(color_base + (((pattern_offset + name) & color_mask) * 8) + (line & 0x07) ); | |
1200 | 1200 | |
1201 | 1201 | for (pixel_x = 0; pixel_x < 8; pixel_x++) |
1202 | 1202 | { |
r18027 | r18028 | |
1237 | 1237 | |
1238 | 1238 | for (tile_column = 0; tile_column < 32; tile_column++) |
1239 | 1239 | { |
1240 | UINT8 name = space() | |
1240 | UINT8 name = space().read_byte( name_base + tile_column ); | |
1241 | 1241 | UINT8 pattern; |
1242 | 1242 | UINT8 colors; |
1243 | 1243 | |
1244 | pattern = space()->read_byte( pattern_base + (name * 8) + (line & 0x07) ); | |
1245 | colors = space()->read_byte( color_base + ( name >> 3 ) ); | |
1244 | pattern = space().read_byte( pattern_base + (name * 8) + (line & 0x07) ); | |
1245 | colors = space().read_byte( color_base + ( name >> 3 ) ); | |
1246 | 1246 | |
1247 | 1247 | for (pixel_x = 0; pixel_x < 8; pixel_x++) |
1248 | 1248 | { |
r18027 | r18028 | |
---|---|---|
61 | 61 | |
62 | 62 | inline UINT8 ramdac_device::readbyte(offs_t address) |
63 | 63 | { |
64 | return space() | |
64 | return space().read_byte(address); | |
65 | 65 | } |
66 | 66 | |
67 | 67 | |
r18027 | r18028 | |
71 | 71 | |
72 | 72 | inline void ramdac_device::writebyte(offs_t address, UINT8 data) |
73 | 73 | { |
74 | space() | |
74 | space().write_byte(address, data); | |
75 | 75 | } |
76 | 76 | |
77 | 77 | //------------------------------------------------- |
r18027 | r18028 | |
---|---|---|
224 | 224 | { |
225 | 225 | cpu_device *cpu = downcast<cpu_device *>(&executing->device()); |
226 | 226 | if (cpu != NULL) |
227 | m_context.printf("'%s' (%s)", cpu->tag(), core_i64_format(cpu->pc(), cpu->space(AS_PROGRAM) | |
227 | m_context.printf("'%s' (%s)", cpu->tag(), core_i64_format(cpu->pc(), cpu->space(AS_PROGRAM).logaddrchars(), cpu->is_octal())); | |
228 | 228 | } |
229 | 229 | else |
230 | 230 | m_context.cpy("(no context)"); |
r18027 | r18028 | |
---|---|---|
87 | 87 | |
88 | 88 | inline UINT8 cdp1869_device::read_page_ram_byte(offs_t pma) |
89 | 89 | { |
90 | return space() | |
90 | return space().read_byte(pma); | |
91 | 91 | } |
92 | 92 | |
93 | 93 | |
r18027 | r18028 | |
98 | 98 | |
99 | 99 | inline void cdp1869_device::write_page_ram_byte(offs_t pma, UINT8 data) |
100 | 100 | { |
101 | space() | |
101 | space().write_byte(pma, data); | |
102 | 102 | } |
103 | 103 | |
104 | 104 |
r18027 | r18028 | |
---|---|---|
461 | 461 | double u = 10.0; |
462 | 462 | |
463 | 463 | // find our direct access |
464 | m_direct = &space() | |
464 | m_direct = &space().direct(); | |
465 | 465 | |
466 | 466 | m_sample_rate_base = clock() / 288; |
467 | 467 |
r18027 | r18028 | |
---|---|---|
23 | 23 | READ8_DEVICE_HANDLER(discrete_sound_r) |
24 | 24 | { |
25 | 25 | discrete_device *disc_device = downcast<discrete_device *>(device); |
26 | return disc_device->read( | |
26 | return disc_device->read( disc_device->machine().firstcpu->space(), offset, 0xff); | |
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | 30 | WRITE8_DEVICE_HANDLER(discrete_sound_w) |
31 | 31 | { |
32 | 32 | discrete_device *disc_device = downcast<discrete_device *>(device); |
33 | disc_device->write( | |
33 | disc_device->write(disc_device->machine().firstcpu->space(), offset, data, 0xff); | |
34 | 34 | } |
35 | 35 | |
36 | 36 | /************************************************************************ |
r18027 | r18028 | |
---|---|---|
155 | 155 | |
156 | 156 | inline UINT8 mos6560_device::read_videoram(offs_t offset) |
157 | 157 | { |
158 | m_last_data = space(AS_0) | |
158 | m_last_data = space(AS_0).read_byte(offset & 0x3fff); | |
159 | 159 | |
160 | 160 | return m_last_data; |
161 | 161 | } |
162 | 162 | |
163 | 163 | inline UINT8 mos6560_device::read_colorram(offs_t offset) |
164 | 164 | { |
165 | return space(AS_1) | |
165 | return space(AS_1).read_byte(offset & 0x3ff); | |
166 | 166 | } |
167 | 167 | |
168 | 168 | /*------------------------------------------------- |
r18027 | r18028 | |
---|---|---|
96 | 96 | void okim9810_device::device_start() |
97 | 97 | { |
98 | 98 | // find our direct access |
99 | m_direct = &space() | |
99 | m_direct = &space().direct(); | |
100 | 100 | |
101 | 101 | // create the stream |
102 | 102 | //int divisor = m_pin7 ? 132 : 165; |
r18027 | r18028 | |
---|---|---|
171 | 171 | m_cpu = subdevice<tms32015_device>("bsmt2000"); |
172 | 172 | |
173 | 173 | // find our direct access |
174 | m_direct = &space() | |
174 | m_direct = &space().direct(); | |
175 | 175 | |
176 | 176 | // create the stream; BSMT typically runs at 24MHz and writes to a DAC, so |
177 | 177 | // in theory we should generate a 24MHz stream, but that's certainly overkill |
r18027 | r18028 | |
---|---|---|
222 | 222 | void qs1000_device::device_start() |
223 | 223 | { |
224 | 224 | // Find our direct access |
225 | m_direct = &space() | |
225 | m_direct = &space().direct(); | |
226 | 226 | |
227 | 227 | // The QS1000 operates at 24MHz. Creating a stream at that rate |
228 | 228 | // would be overkill so we opt for a fraction of that rate which |
r18027 | r18028 | |
---|---|---|
118 | 118 | void okim6295_device::device_start() |
119 | 119 | { |
120 | 120 | // find our direct access |
121 | m_direct = &space() | |
121 | m_direct = &space().direct(); | |
122 | 122 | |
123 | 123 | // create the stream |
124 | 124 | int divisor = m_pin7_state ? 132 : 165; |
r18027 | r18028 | |
220 | 220 | if (!m_bank_installed && base != 0) |
221 | 221 | { |
222 | 222 | // override our memory map with a bank |
223 | space() | |
223 | space().install_read_bank(0x00000, 0x3ffff, tag()); | |
224 | 224 | m_bank_installed = true; |
225 | 225 | } |
226 | 226 |
r18027 | r18028 | |
---|---|---|
248 | 248 | int osc; |
249 | 249 | |
250 | 250 | // find our direct access |
251 | m_direct = &space() | |
251 | m_direct = &space().direct(); | |
252 | 252 | |
253 | 253 | rege0 = 0xff; |
254 | 254 |
r18027 | r18028 | |
---|---|---|
703 | 703 | info->buffer_size+=info->samps_per_sync; |
704 | 704 | |
705 | 705 | /* Initialize individual chips */ |
706 | (info->APU.dpcm).memory = device->machine().device(intf->cpu_tag)->memory().space(AS_PROGRAM); | |
706 | (info->APU.dpcm).memory = &device->machine().device(intf->cpu_tag)->memory().space(AS_PROGRAM); | |
707 | 707 | |
708 | 708 | info->stream = device->machine().sound().stream_alloc(*device, 0, 1, rate, info, nes_psg_update_sound); |
709 | 709 |
r18027 | r18028 | |
---|---|---|
123 | 123 | virtual void machine_start() |
124 | 124 | { |
125 | 125 | // find the CPU's address space |
126 | m_space = m_cpu->space(AS_PROGRAM); | |
126 | m_space = &m_cpu->space(AS_PROGRAM); | |
127 | 127 | |
128 | 128 | // configure DRC in the most compatible mode |
129 | 129 | ppcdrc_set_options(m_cpu, PPCDRC_COMPATIBLE_OPTIONS); |
r18027 | r18028 | |
---|---|---|
984 | 984 | // leading caret implies the owner, just skip it |
985 | 985 | if (tag[0] == '^') tag++; |
986 | 986 | |
987 | // query relative to the parent | |
988 | return (m_owner != NULL) ? m_owner->subdevice(tag) : NULL; | |
987 | // query relative to the parent, if we have one | |
988 | if (m_owner != NULL) | |
989 | return m_owner->subdevice(tag); | |
990 | ||
991 | // otherwise, it's NULL unless the tag is absolute | |
992 | return (tag[0] == ':') ? subdevice(tag) : NULL; | |
989 | 993 | } |
990 | 994 | |
991 | 995 |
r18027 | r18028 | |
---|---|---|
96 | 96 | void amiga_fdc::dma_done() |
97 | 97 | { |
98 | 98 | dma_state = DMA_IDLE; |
99 | address_space &space = | |
99 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
100 | 100 | amiga_custom_w(space, REG_INTREQ, 0x8000 | INTENA_DSKBLK, 0xffff); |
101 | 101 | } |
102 | 102 | |
r18027 | r18028 | |
233 | 233 | cur_live.bit_counter = 0; |
234 | 234 | } |
235 | 235 | dskbyt |= 0x1000; |
236 | address_space &space = | |
236 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
237 | 237 | amiga_custom_w(space, REG_INTREQ, 0x8000 | INTENA_DSKSYN, 0xffff); |
238 | 238 | } else |
239 | 239 | dskbyt &= ~0x1000; |
r18027 | r18028 | |
---|---|---|
38 | 38 | |
39 | 39 | DEVICE_START( s3c2440 ) |
40 | 40 | { |
41 | address_space &space = | |
41 | address_space &space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM); | |
42 | 42 | space.install_legacy_readwrite_handler( *device, 0x48000000, 0x4800003b, FUNC(s3c24xx_memcon_r), FUNC(s3c24xx_memcon_w)); |
43 | 43 | space.install_legacy_readwrite_handler( *device, 0x49000000, 0x4900005b, FUNC(s3c24xx_usb_host_r), FUNC(s3c24xx_usb_host_w)); |
44 | 44 | space.install_legacy_readwrite_handler( *device, 0x4a000000, 0x4a00001f, FUNC(s3c24xx_irq_r), FUNC(s3c24xx_irq_w)); |
r18027 | r18028 | |
---|---|---|
301 | 301 | static UINT32 s3c24xx_lcd_dma_read( device_t *device) |
302 | 302 | { |
303 | 303 | s3c24xx_t *s3c24xx = get_token( device); |
304 | address_space& space = | |
304 | address_space& space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM); | |
305 | 305 | UINT8 *vram, data[4]; |
306 | 306 | vram = (UINT8 *)space.get_read_ptr( s3c24xx->lcd.vramaddr_cur); |
307 | 307 | for (int i = 0; i < 2; i++) |
r18027 | r18028 | |
345 | 345 | static UINT32 s3c24xx_lcd_dma_read( device_t *device) |
346 | 346 | { |
347 | 347 | s3c24xx_t *s3c24xx = get_token( device); |
348 | address_space& space = | |
348 | address_space& space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM); | |
349 | 349 | UINT8 *vram, data[4]; |
350 | 350 | vram = (UINT8 *)space.get_read_ptr( s3c24xx->lcd.vramaddr_cur); |
351 | 351 | for (int i = 0; i < 2; i++) |
r18027 | r18028 | |
1611 | 1611 | s3c24xx_t *s3c24xx = get_token( device); |
1612 | 1612 | s3c24xx_dma_regs_t *regs = &s3c24xx->dma[ch].regs; |
1613 | 1613 | UINT32 curr_tc, curr_src, curr_dst; |
1614 | address_space &space = | |
1614 | address_space &space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM); | |
1615 | 1615 | int dsz, inc_src, inc_dst, servmode, tsz; |
1616 | 1616 | const UINT32 ch_int[] = { S3C24XX_INT_DMA0, S3C24XX_INT_DMA1, S3C24XX_INT_DMA2, S3C24XX_INT_DMA3}; |
1617 | 1617 | verboselog( device->machine(), 5, "DMA %d trigger\n", ch); |
r18027 | r18028 | |
3701 | 3701 | int om1 = iface_core_pin_r( device, S3C24XX_CORE_PIN_OM1); |
3702 | 3702 | if ((om0 == 0) && (om1 == 0)) |
3703 | 3703 | { |
3704 | address_space &space = | |
3704 | address_space &space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM); | |
3705 | 3705 | space.install_ram( 0x00000000, 0x00000fff, s3c24xx->steppingstone); |
3706 | 3706 | space.install_ram( 0x40000000, 0x40000fff, s3c24xx->steppingstone); |
3707 | 3707 | } |
r18027 | r18028 | |
---|---|---|
538 | 538 | |
539 | 539 | READ8_MEMBER( i8155_device::memory_r ) |
540 | 540 | { |
541 | return this->space() | |
541 | return this->space().read_byte(offset); | |
542 | 542 | } |
543 | 543 | |
544 | 544 | |
r18027 | r18028 | |
548 | 548 | |
549 | 549 | WRITE8_MEMBER( i8155_device::memory_w ) |
550 | 550 | { |
551 | this->space() | |
551 | this->space().write_byte(offset, data); | |
552 | 552 | } |
553 | 553 | |
554 | 554 |
r18027 | r18028 | |
---|---|---|
1859 | 1859 | device_memory_interface *memory; |
1860 | 1860 | if (!bmtarget->interface(memory)) |
1861 | 1861 | throw emu_fatalerror("IDE controller '%s' bus master target '%s' has no memory!", device->tag(), config->bmcpu); |
1862 | ide->dma_space = memory->space(config->bmspace); | |
1863 | if (ide->dma_space == NULL) | |
1864 | throw emu_fatalerror("IDE controller '%s' bus master target '%s' does not have specified space %d!", device->tag(), config->bmcpu, config->bmspace); | |
1862 | ide->dma_space = &memory->space(config->bmspace); | |
1865 | 1863 | ide->dma_address_xor = (ide->dma_space->endianness() == ENDIANNESS_LITTLE) ? 0 : 3; |
1866 | 1864 | } |
1867 | 1865 |
r18027 | r18028 | |
---|---|---|
94 | 94 | void set_port_a_z_mask(UINT8 data) { m_port_a_z_mask = data; }// see second note in .c |
95 | 95 | |
96 | 96 | DECLARE_READ8_MEMBER( porta_r ); |
97 | UINT8 porta_r() { return porta_r( | |
97 | UINT8 porta_r() { return porta_r(machine().driver_data()->generic_space(), 0); } | |
98 | 98 | DECLARE_WRITE8_MEMBER( porta_w ); |
99 | void porta_w(UINT8 data) { porta_w( | |
99 | void porta_w(UINT8 data) { porta_w(machine().driver_data()->generic_space(), 0, data); } | |
100 | 100 | void set_a_input(UINT8 data, UINT8 z_mask); |
101 | 101 | UINT8 a_output(); |
102 | 102 | |
r18027 | r18028 | |
109 | 109 | int ca2_output_z(); |
110 | 110 | |
111 | 111 | DECLARE_READ8_MEMBER( portb_r ); |
112 | UINT8 portb_r() { return portb_r( | |
112 | UINT8 portb_r() { return portb_r(machine().driver_data()->generic_space(), 0); } | |
113 | 113 | DECLARE_WRITE8_MEMBER( portb_w ); |
114 | void portb_w(UINT8 data) { portb_w( | |
114 | void portb_w(UINT8 data) { portb_w(machine().driver_data()->generic_space(), 0, data); } | |
115 | 115 | UINT8 b_output(); |
116 | 116 | |
117 | 117 | DECLARE_READ_LINE_MEMBER( cb1_r ); |
r18027 | r18028 | |
---|---|---|
61 | 61 | int ext_clock(int counter) const { return m_external_clock[counter]; } // get clock frequency |
62 | 62 | |
63 | 63 | DECLARE_WRITE8_MEMBER( write ); |
64 | void write(offs_t offset, UINT8 data) { write( | |
64 | void write(offs_t offset, UINT8 data) { write(machine().driver_data()->generic_space(), offset, data); } | |
65 | 65 | DECLARE_READ8_MEMBER( read ); |
66 | UINT8 read(offs_t offset) { return read( | |
66 | UINT8 read(offs_t offset) { return read(machine().driver_data()->generic_space(), offset); } | |
67 | 67 | |
68 | 68 | void set_gate(int idx, int state); |
69 | 69 | DECLARE_WRITE_LINE_MEMBER( set_g1 ); |
r18027 | r18028 | |
---|---|---|
38 | 38 | |
39 | 39 | DEVICE_START( s3c2400 ) |
40 | 40 | { |
41 | address_space &space = | |
41 | address_space &space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM); | |
42 | 42 | DEVICE_START_CALL(s3c24xx); |
43 | 43 | space.install_legacy_readwrite_handler( *device, 0x14000000, 0x1400003b, FUNC(s3c24xx_memcon_r), FUNC(s3c24xx_memcon_w)); |
44 | 44 | space.install_legacy_readwrite_handler( *device, 0x14200000, 0x1420005b, FUNC(s3c24xx_usb_host_r), FUNC(s3c24xx_usb_host_w)); |
r18027 | r18028 | |
---|---|---|
38 | 38 | |
39 | 39 | DEVICE_START( s3c2410 ) |
40 | 40 | { |
41 | address_space &space = | |
41 | address_space &space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM); | |
42 | 42 | DEVICE_START_CALL(s3c24xx); |
43 | 43 | space.install_legacy_readwrite_handler( *device, 0x48000000, 0x4800003b, FUNC(s3c24xx_memcon_r), FUNC(s3c24xx_memcon_w)); |
44 | 44 | space.install_legacy_readwrite_handler( *device, 0x49000000, 0x4900005b, FUNC(s3c24xx_usb_host_r), FUNC(s3c24xx_usb_host_w)); |
r18027 | r18028 | |
---|---|---|
343 | 343 | void microtouch_serial_device::rcv_complete() |
344 | 344 | { |
345 | 345 | receive_register_extract(); |
346 | microtouch_device::rx( | |
346 | microtouch_device::rx(machine().driver_data()->generic_space(), 0, get_received_char()); | |
347 | 347 | } |
r18027 | r18028 | |
---|---|---|
227 | 227 | |
228 | 228 | READ8_MEMBER( i8355_device::memory_r ) |
229 | 229 | { |
230 | return this->space() | |
230 | return this->space().read_byte(offset); | |
231 | 231 | } |
r18027 | r18028 | |
---|---|---|
42 | 42 | |
43 | 43 | |
44 | 44 | //************************************************************************** |
45 | // ADDRESS_MAPS | |
46 | //************************************************************************** | |
47 | ||
48 | // default address map | |
49 | static ADDRESS_MAP_START( generic, AS_0, 8, driver_device ) | |
50 | AM_RANGE(0x00000000, 0xffffffff) AM_DEVREADWRITE(":", driver_device, fatal_generic_read, fatal_generic_write) | |
51 | ADDRESS_MAP_END | |
52 | ||
53 | ||
54 | ||
55 | //************************************************************************** | |
45 | 56 | // DRIVER DEVICE |
46 | 57 | //************************************************************************** |
47 | 58 | |
r18027 | r18028 | |
51 | 62 | |
52 | 63 | driver_device::driver_device(const machine_config &mconfig, device_type type, const char *tag) |
53 | 64 | : device_t(mconfig, type, "Driver Device", tag, NULL, 0), |
65 | device_memory_interface(mconfig, *this), | |
54 | 66 | m_generic_paletteram_8(*this, "paletteram"), |
55 | 67 | m_generic_paletteram2_8(*this, "paletteram2"), |
56 | 68 | m_generic_paletteram_16(*this, "paletteram"), |
57 | 69 | m_generic_paletteram2_16(*this, "paletteram2"), |
58 | 70 | m_generic_paletteram_32(*this, "paletteram"), |
59 | 71 | m_generic_paletteram2_32(*this, "paletteram2"), |
72 | m_space_config("generic", ENDIANNESS_LITTLE, 8, 32, 0, NULL, *ADDRESS_MAP_NAME(generic)), | |
60 | 73 | m_system(NULL), |
61 | 74 | m_latch_clear_value(0), |
62 | 75 | m_flip_screen_x(0), |
r18027 | r18028 | |
313 | 326 | } |
314 | 327 | |
315 | 328 | |
329 | //------------------------------------------------- | |
330 | // memory_space_config - return a description of | |
331 | // any address spaces owned by this device | |
332 | //------------------------------------------------- | |
333 | ||
334 | const address_space_config *driver_device::memory_space_config(address_spacenum spacenum) const | |
335 | { | |
336 | return (spacenum == 0) ? &m_space_config : NULL; | |
337 | } | |
338 | ||
339 | ||
340 | ||
316 | 341 | //************************************************************************** |
317 | 342 | // INTERRUPT ENABLE AND VECTOR HELPERS |
318 | 343 | //************************************************************************** |
r18027 | r18028 | |
737 | 762 | // 8-8-8 RGB palette write handlers |
738 | 763 | WRITE16_MEMBER( driver_device::paletteram_xrgb_word_be_w ) { palette_32bit_word_be_w<8,8,8, 16,8,0>(space, offset, data, mem_mask); } |
739 | 764 | WRITE16_MEMBER( driver_device::paletteram_xbgr_word_be_w ) { palette_32bit_word_be_w<8,8,8, 0,8,16>(space, offset, data, mem_mask); } |
765 | ||
766 | ||
767 | ||
768 | //************************************************************************** | |
769 | // MISC READ/WRITE HANDLERS | |
770 | //************************************************************************** | |
771 | ||
772 | //------------------------------------------------- | |
773 | // generic space fatal error handlers | |
774 | //------------------------------------------------- | |
775 | ||
776 | READ8_MEMBER( driver_device::fatal_generic_read ) | |
777 | { | |
778 | throw emu_fatalerror("Attempted to read from generic address space (offs %X)\n", offset); | |
779 | } | |
780 | ||
781 | WRITE8_MEMBER( driver_device::fatal_generic_write ) | |
782 | { | |
783 | throw emu_fatalerror("Attempted to write to generic address space (offs %X = %02X)\n", offset, data); | |
784 | } | |
785 | ||
786 |
r18027 | r18028 | |
---|---|---|
166 | 166 | // ======================> driver_device |
167 | 167 | |
168 | 168 | // base class for machine driver-specific devices |
169 | class driver_device : public device_t | |
169 | class driver_device : public device_t, | |
170 | public device_memory_interface | |
170 | 171 | { |
171 | 172 | public: |
172 | 173 | // construction/destruction |
r18027 | r18028 | |
205 | 206 | void init_0() { } |
206 | 207 | |
207 | 208 | // memory helpers |
208 | address_space &generic_space() const { return | |
209 | address_space &generic_space() const { return space(AS_PROGRAM); } | |
209 | 210 | |
210 | 211 | // generic interrupt generators |
211 | 212 | void generic_pulse_irq_line(device_execute_interface &exec, int irqline, int cycles); |
r18027 | r18028 | |
380 | 381 | DECLARE_WRITE16_MEMBER( paletteram_xbgr_word_be_w ); |
381 | 382 | |
382 | 383 | // generic input port helpers |
383 | // custom handler | |
384 | 384 | DECLARE_CUSTOM_INPUT_MEMBER( custom_port_read ); |
385 | 385 | |
386 | // general fatal error handlers | |
387 | DECLARE_READ8_MEMBER( fatal_generic_read ); | |
388 | DECLARE_WRITE8_MEMBER( fatal_generic_write ); | |
389 | ||
386 | 390 | protected: |
387 | 391 | // helpers called at startup |
388 | 392 | virtual void driver_start(); |
r18027 | r18028 | |
403 | 407 | virtual void device_start(); |
404 | 408 | virtual void device_reset_after_children(); |
405 | 409 | |
410 | // device_memory_interface overrides | |
411 | virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const; | |
412 | ||
406 | 413 | // internal helpers |
407 | 414 | inline UINT16 paletteram16_le(offs_t offset) const { return m_generic_paletteram_8[offset & ~1] | (m_generic_paletteram_8[offset | 1] << 8); } |
408 | 415 | inline UINT16 paletteram16_be(offs_t offset) const { return m_generic_paletteram_8[offset | 1] | (m_generic_paletteram_8[offset & ~1] << 8); } |
r18027 | r18028 | |
424 | 431 | void soundlatch_sync_callback(void *ptr, INT32 param); |
425 | 432 | void updateflip(); |
426 | 433 | |
434 | // configuration state | |
435 | const address_space_config m_space_config; | |
436 | ||
427 | 437 | // internal state |
428 | 438 | const game_driver * m_system; // pointer to the game driver |
429 | 439 | driver_callback_delegate m_callbacks[CB_COUNT]; // start/reset callbacks |
r18027 | r18028 | |
---|---|---|
109 | 109 | static void static_set_addrmap(device_t &device, address_spacenum spacenum, address_map_constructor map); |
110 | 110 | |
111 | 111 | // basic information getters |
112 | address_space *space(int index = 0) const { return m_addrspace[index]; } | |
113 | address_space *space(address_spacenum index) const { return m_addrspace[static_cast<int>(index)]; } | |
112 | bool has_space(int index = 0) const { return (m_addrspace[index] != NULL); } | |
113 | bool has_space(address_spacenum index) const { return (m_addrspace[int(index)] != NULL); } | |
114 | address_space &space(int index = 0) const { assert(m_addrspace[index] != NULL); return *m_addrspace[index]; } | |
115 | address_space &space(address_spacenum index) const { assert(m_addrspace[int(index)] != NULL); return *m_addrspace[int(index)]; } | |
114 | 116 | |
115 | 117 | // address space accessors |
116 | 118 | void set_address_space(address_spacenum spacenum, address_space &space); |
r18027 | r18028 | |
---|---|---|
237 | 237 | int rom = m_rom; |
238 | 238 | m_rom = 0; |
239 | 239 | |
240 | m_last_data = space(AS_0) | |
240 | m_last_data = space(AS_0).read_byte(offset); | |
241 | 241 | |
242 | 242 | m_rom = rom; |
243 | 243 | |
r18027 | r18028 | |
249 | 249 | int rom = m_rom; |
250 | 250 | m_rom = 1; |
251 | 251 | |
252 | m_last_data = space(AS_0) | |
252 | m_last_data = space(AS_0).read_byte(offset); | |
253 | 253 | |
254 | 254 | m_rom = rom; |
255 | 255 |
r18027 | r18028 | |
---|---|---|
261 | 261 | } |
262 | 262 | else |
263 | 263 | { |
264 | sample = device->machine().device("maincpu")->memory().space(AS_PROGRAM) | |
264 | sample = device->machine().device("maincpu")->memory().space(AS_PROGRAM).read_byte(addr); | |
265 | 265 | } |
266 | 266 | if (((unsigned)state->dma.pos) & 1) |
267 | 267 | s = (sample & 0xf); |
r18027 | r18028 | |
---|---|---|
256 | 256 | static void UpdateBanks(running_machine &machine, int first, int last) |
257 | 257 | { |
258 | 258 | dgn_beta_state *state = machine.driver_data<dgn_beta_state>(); |
259 | address_space *space_0 = machine.device(MAINCPU_TAG)->memory().space(AS_PROGRAM); | |
260 | address_space *space_1 = machine.device(DMACPU_TAG)->memory().space(AS_PROGRAM); | |
259 | address_space &space_0 = machine.device(MAINCPU_TAG)->memory().space(AS_PROGRAM); | |
260 | address_space &space_1 = machine.device(DMACPU_TAG)->memory().space(AS_PROGRAM); | |
261 | 261 | int Page; |
262 | 262 | UINT8 *readbank; |
263 | 263 | int bank_start; |
r18027 | r18028 | |
265 | 265 | int MapPage; |
266 | 266 | char page_num[10]; |
267 | 267 | |
268 | LOG_BANK_UPDATE(("\n\nUpdating banks %d to %d at PC=$%X\n",first,last,space_0 | |
268 | LOG_BANK_UPDATE(("\n\nUpdating banks %d to %d at PC=$%X\n",first,last,space_0.device().safe_pc())); | |
269 | 269 | for(Page=first;Page<=last;Page++) |
270 | 270 | { |
271 | 271 | sprintf(page_num,"bank%d",Page+1); |
r18027 | r18028 | |
295 | 295 | readbank = &machine.device<ram_device>(RAM_TAG)->pointer()[(MapPage*RamPageSize)-256]; |
296 | 296 | logerror("Error RAM in Last page !\n"); |
297 | 297 | } |
298 | space_0->install_legacy_write_handler(bank_start, bank_end,bank_info[Page].func,bank_info[Page].name); | |
299 | space_1->install_legacy_write_handler(bank_start, bank_end,bank_info[Page].func,bank_info[Page].name); | |
298 | space_0.install_legacy_write_handler(bank_start, bank_end,bank_info[Page].func,bank_info[Page].name); | |
299 | space_1.install_legacy_write_handler(bank_start, bank_end,bank_info[Page].func,bank_info[Page].name); | |
300 | 300 | } |
301 | 301 | else // Block is rom, or undefined |
302 | 302 | { |
r18027 | r18028 | |
310 | 310 | else |
311 | 311 | readbank=state->m_system_rom; |
312 | 312 | |
313 | space_0->unmap_write(bank_start, bank_end); | |
314 | space_1->unmap_write(bank_start, bank_end); | |
313 | space_0.unmap_write(bank_start, bank_end); | |
314 | space_1.unmap_write(bank_start, bank_end); | |
315 | 315 | } |
316 | 316 | |
317 | 317 | state->m_PageRegs[state->m_TaskReg][Page].memory=readbank; |
r18027 | r18028 | |
---|---|---|
42 | 42 | offs_t ram_top; |
43 | 43 | // take care of 0x0000-0x7fff: RAM or NOP |
44 | 44 | ram_top = MIN(machine.device<ram_device>(RAM_TAG)->size(), 0x8000) - 1; |
45 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
45 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank(0x0000, ram_top, "0000"); | |
46 | 46 | machine.root_device().membank("0000")->set_base(machine.device<ram_device>(RAM_TAG)->pointer()); |
47 | 47 | |
48 | 48 | // take care of 0x8000-0x9fff: A800 -> either right slot or RAM or NOP, others -> RAM or NOP |
49 | 49 | // is there anything in the right slot? |
50 | 50 | if (cart_mounted & RIGHT_CARTSLOT_MOUNTED) |
51 | 51 | { |
52 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
52 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x8000, 0x9fff, "8000"); | |
53 | 53 | machine.root_device().membank("8000")->set_base(machine.root_device().memregion("rslot")->base()); |
54 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
54 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x8000, 0x9fff); | |
55 | 55 | } |
56 | 56 | else if (a800_cart_type != BBSB) |
57 | 57 | { |
58 | 58 | ram_top = MIN(machine.device<ram_device>(RAM_TAG)->size(), 0xa000) - 1; |
59 | 59 | if (ram_top > 0x8000) |
60 | 60 | { |
61 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
61 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank(0x8000, ram_top, "8000"); | |
62 | 62 | machine.root_device().membank("8000")->set_base(machine.device<ram_device>(RAM_TAG)->pointer() + 0x8000); |
63 | 63 | } |
64 | 64 | } |
r18027 | r18028 | |
71 | 71 | { |
72 | 72 | if (a800_cart_type == A800_16K) |
73 | 73 | { |
74 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
74 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x8000, 0x9fff, "8000"); | |
75 | 75 | machine.root_device().membank("8000")->set_base(machine.root_device().memregion("lslot")->base()); |
76 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
76 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x8000, 0x9fff); | |
77 | 77 | |
78 | 78 | memcpy(machine.root_device().memregion("maincpu")->base() + 0x10000, machine.root_device().memregion("lslot")->base() + 0x2000, 0x2000); |
79 | 79 | } |
r18027 | r18028 | |
86 | 86 | { |
87 | 87 | machine.root_device().membank("8000")->set_base(machine.root_device().memregion("lslot")->base()); |
88 | 88 | machine.root_device().membank("a000")->set_base(machine.root_device().memregion("lslot")->base() + 0x2000); |
89 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
89 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x8000, 0xbfff); | |
90 | 90 | } |
91 | 91 | else if (a800_cart_type == BBSB) |
92 | 92 | { |
93 | 93 | // this requires separate banking in 0x8000 & 0x9000! |
94 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0x8fff, "8000"); | |
95 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x9000, 0x9fff, "9000"); | |
94 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x8000, 0x8fff, "8000"); | |
95 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x9000, 0x9fff, "9000"); | |
96 | 96 | machine.root_device().membank("8000")->set_base(machine.root_device().memregion("lslot")->base() + 0x0000); |
97 | 97 | machine.root_device().membank("9000")->set_base(machine.root_device().memregion("lslot")->base() + 0x4000); |
98 | 98 | machine.root_device().membank("a000")->set_base(machine.root_device().memregion("lslot")->base() + 0x8000); |
99 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
99 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xa000, 0xbfff); | |
100 | 100 | } |
101 | 101 | else if (a800_cart_type == OSS_034M) |
102 | 102 | { |
103 | 103 | // this requires separate banking in 0xa000 & 0xb000! |
104 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xa000, 0xafff, "a000"); | |
105 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xb000, 0xbfff, "b000"); | |
104 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xa000, 0xafff, "a000"); | |
105 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xb000, 0xbfff, "b000"); | |
106 | 106 | machine.root_device().membank("b000")->set_base(machine.root_device().memregion("lslot")->base() + 0x3000); |
107 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
107 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xa000, 0xbfff); | |
108 | 108 | } |
109 | 109 | else if (a800_cart_type == OSS_M091) |
110 | 110 | { |
111 | 111 | // this requires separate banking in 0xa000 & 0xb000! |
112 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xa000, 0xafff, "a000"); | |
113 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xb000, 0xbfff, "b000"); | |
112 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xa000, 0xafff, "a000"); | |
113 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xb000, 0xbfff, "b000"); | |
114 | 114 | machine.root_device().membank("b000")->set_base(machine.root_device().memregion("lslot")->base()); |
115 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
115 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xa000, 0xbfff); | |
116 | 116 | } |
117 | 117 | else if (a800_cart_type == XEGS_32K) |
118 | 118 | { |
119 | 119 | machine.root_device().membank("8000")->set_base(machine.root_device().memregion("lslot")->base()); |
120 | 120 | machine.root_device().membank("a000")->set_base(machine.root_device().memregion("lslot")->base() + 0x6000); |
121 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
121 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x8000, 0xbfff); | |
122 | 122 | } |
123 | 123 | else |
124 | 124 | { |
125 | 125 | machine.root_device().membank("a000")->set_base(machine.root_device().memregion("lslot")->base()); |
126 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
126 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xa000, 0xbfff); | |
127 | 127 | } |
128 | 128 | } |
129 | 129 | } |
r18027 | r18028 | |
352 | 352 | case PHOENIX_8K: // as normal 8k cart, but it can be disabled by writing to 0xd500-0xdfff |
353 | 353 | break; |
354 | 354 | case XEGS_32K: |
355 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
355 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd500, 0xd5ff, FUNC(x32_bank_w)); | |
356 | 356 | break; |
357 | 357 | case OSS_034M: |
358 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
358 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd500, 0xd5ff, FUNC(oss_034m_w)); | |
359 | 359 | break; |
360 | 360 | case OSS_M091: |
361 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
361 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd500, 0xd5ff, FUNC(oss_m091_w)); | |
362 | 362 | break; |
363 | 363 | case BBSB: |
364 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0x8fff, FUNC(bbsb_bankl_w)); | |
365 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x9000, 0x9fff, FUNC(bbsb_bankh_w)); | |
364 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x8000, 0x8fff, FUNC(bbsb_bankl_w)); | |
365 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x9000, 0x9fff, FUNC(bbsb_bankh_w)); | |
366 | 366 | break; |
367 | 367 | case WILLIAMS_64K: |
368 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
368 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd500, 0xd50f, FUNC(w64_bank_w)); | |
369 | 369 | break; |
370 | 370 | case DIAMOND_64K: |
371 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
371 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd5d0, 0xd5df, FUNC(ex64_bank_w)); | |
372 | 372 | break; |
373 | 373 | case EXPRESS_64: |
374 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
374 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd570, 0xd57f, FUNC(ex64_bank_w)); | |
375 | 375 | break; |
376 | 376 | case SPARTADOS_X: |
377 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
377 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd5e0, 0xd5ef, FUNC(ex64_bank_w)); | |
378 | 378 | break; |
379 | 379 | default: |
380 | 380 | break; |
r18027 | r18028 | |
665 | 665 | |
666 | 666 | MACHINE_START( xegs ) |
667 | 667 | { |
668 | address_space &space = | |
668 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
669 | 669 | UINT8 *cart = space.machine().root_device().memregion("user1")->base(); |
670 | 670 | UINT8 *cpu = space.machine().root_device().memregion("maincpu")->base(); |
671 | 671 |
r18027 | r18028 | |
---|---|---|
415 | 415 | break; |
416 | 416 | |
417 | 417 | case 1: |
418 | data = m_ace1->ins8250_r( | |
418 | data = m_ace1->ins8250_r(machine().driver_data()->generic_space(), offset & 0x07); | |
419 | 419 | break; |
420 | 420 | |
421 | 421 | case 2: |
422 | data = m_ace2->ins8250_r( | |
422 | data = m_ace2->ins8250_r(machine().driver_data()->generic_space(), offset & 0x07); | |
423 | 423 | break; |
424 | 424 | |
425 | 425 | case 3: |
426 | data = m_ace3->ins8250_r( | |
426 | data = m_ace3->ins8250_r(machine().driver_data()->generic_space(), offset & 0x07); | |
427 | 427 | break; |
428 | 428 | } |
429 | 429 | } |
r18027 | r18028 | |
538 | 538 | break; |
539 | 539 | |
540 | 540 | case 1: |
541 | m_ace1->ins8250_w( | |
541 | m_ace1->ins8250_w(machine().driver_data()->generic_space(), offset & 0x07, data); | |
542 | 542 | break; |
543 | 543 | |
544 | 544 | case 2: |
545 | m_ace2->ins8250_w( | |
545 | m_ace2->ins8250_w(machine().driver_data()->generic_space(), offset & 0x07, data); | |
546 | 546 | break; |
547 | 547 | |
548 | 548 | case 3: |
549 | m_ace3->ins8250_w( | |
549 | m_ace3->ins8250_w(machine().driver_data()->generic_space(), offset & 0x07, data); | |
550 | 550 | break; |
551 | 551 | } |
552 | 552 | } |
r18027 | r18028 | |
---|---|---|
327 | 327 | apple3_state *state = machine.driver_data<apple3_state>(); |
328 | 328 | UINT16 bank; |
329 | 329 | UINT8 page; |
330 | address_space& space = | |
330 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
331 | 331 | |
332 | 332 | if (LOG_MEMORY) |
333 | 333 | { |
r18027 | r18028 | |
734 | 734 | m_via_1_irq = 0; |
735 | 735 | apple3_update_memory(machine()); |
736 | 736 | |
737 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
737 | machine().device("maincpu")->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(apple3_state::apple3_opbase), this)); | |
738 | 738 | } |
r18027 | r18028 | |
---|---|---|
31 | 31 | static void msx_cpu_setbank (running_machine &machine, int page, UINT8 *mem) |
32 | 32 | { |
33 | 33 | msx_state *state = machine.driver_data<msx_state>(); |
34 | address_space &space = | |
34 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
35 | 35 | switch (page) |
36 | 36 | { |
37 | 37 | case 1: |
r18027 | r18028 | |
379 | 379 | msx_cpu_setbank (machine, 5, state->m_mem + state->m_banks[2] * 0x2000); |
380 | 380 | msx_cpu_setbank (machine, 6, state->m_mem + state->m_banks[3] * 0x2000); |
381 | 381 | if (state->m_cart.scc.active ) { |
382 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
382 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x9800, 0x9fff, FUNC(konami_scc_bank5)); | |
383 | 383 | } else { |
384 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
384 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x9800, 0x9fff,"bank7"); | |
385 | 385 | } |
386 | 386 | break; |
387 | 387 | case 3: |
r18027 | r18028 | |
393 | 393 | MSX_SLOT_WRITE(konami_scc) |
394 | 394 | { |
395 | 395 | msx_state *drvstate = machine.driver_data<msx_state>(); |
396 | address_space &space = | |
396 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
397 | 397 | if (addr >= 0x5000 && addr < 0x5800) |
398 | 398 | { |
399 | 399 | state->m_banks[0] = val & state->m_bank_mask; |
r18027 | r18028 | |
1279 | 1279 | MSX_SLOT_MAP(diskrom) |
1280 | 1280 | { |
1281 | 1281 | msx_state *drvstate = machine.driver_data<msx_state>(); |
1282 | address_space &space = | |
1282 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1283 | 1283 | switch (page) |
1284 | 1284 | { |
1285 | 1285 | case 0: |
r18027 | r18028 | |
1306 | 1306 | MSX_SLOT_WRITE(diskrom) |
1307 | 1307 | { |
1308 | 1308 | device_t *fdc = machine.device("wd179x"); |
1309 | address_space &space = | |
1309 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1310 | 1310 | if (addr >= 0xa000 && addr < 0xc000) |
1311 | 1311 | { |
1312 | 1312 | addr -= 0x4000; |
r18027 | r18028 | |
1408 | 1408 | MSX_SLOT_MAP(diskrom2) |
1409 | 1409 | { |
1410 | 1410 | msx_state *drvstate = machine.driver_data<msx_state>(); |
1411 | address_space &space = | |
1411 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1412 | 1412 | switch (page) |
1413 | 1413 | { |
1414 | 1414 | case 0: |
r18027 | r18028 | |
1434 | 1434 | MSX_SLOT_WRITE(diskrom2) |
1435 | 1435 | { |
1436 | 1436 | device_t *fdc = machine.device("wd179x"); |
1437 | address_space &space = | |
1437 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1438 | 1438 | if (addr >= 0xa000 && addr < 0xc000) |
1439 | 1439 | { |
1440 | 1440 | addr -= 0x4000; |
r18027 | r18028 | |
1685 | 1685 | MSX_SLOT_WRITE(fmpac) |
1686 | 1686 | { |
1687 | 1687 | msx_state *drvstate = machine.driver_data<msx_state>(); |
1688 | address_space &space = | |
1688 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1689 | 1689 | int i, data; |
1690 | 1690 | |
1691 | 1691 | if (addr >= 0x4000 && addr < 0x6000 && state->m_cart.fmpac.sram_support) |
r18027 | r18028 | |
2244 | 2244 | |
2245 | 2245 | MSX_SLOT_MAP(soundcartridge) |
2246 | 2246 | { |
2247 | address_space &space = | |
2247 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
2248 | 2248 | switch (page) |
2249 | 2249 | { |
2250 | 2250 | case 0: |
r18027 | r18028 | |
2279 | 2279 | MSX_SLOT_WRITE(soundcartridge) |
2280 | 2280 | { |
2281 | 2281 | msx_state *drvstate = machine.driver_data<msx_state>(); |
2282 | address_space &space = | |
2282 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
2283 | 2283 | int i; |
2284 | 2284 | |
2285 | 2285 | if (addr < 0x4000) |
r18027 | r18028 | |
---|---|---|
222 | 222 | |
223 | 223 | WRITE8_MEMBER( mbee_state::mbee_04_w ) // address |
224 | 224 | { |
225 | address_space *mem = m_maincpu->space(AS_IO); | |
226 | machine().device<mc146818_device>("rtc")->write(*mem, 0, data); | |
225 | address_space &mem = m_maincpu->space(AS_IO); | |
226 | machine().device<mc146818_device>("rtc")->write(mem, 0, data); | |
227 | 227 | } |
228 | 228 | |
229 | 229 | WRITE8_MEMBER( mbee_state::mbee_06_w ) // write |
230 | 230 | { |
231 | address_space *mem = m_maincpu->space(AS_IO); | |
232 | machine().device<mc146818_device>("rtc")->write(*mem, 1, data); | |
231 | address_space &mem = m_maincpu->space(AS_IO); | |
232 | machine().device<mc146818_device>("rtc")->write(mem, 1, data); | |
233 | 233 | } |
234 | 234 | |
235 | 235 | READ8_MEMBER( mbee_state::mbee_07_r ) // read |
236 | 236 | { |
237 | address_space *mem = m_maincpu->space(AS_IO); | |
238 | return machine().device<mc146818_device>("rtc")->read(*mem, 1); | |
237 | address_space &mem = m_maincpu->space(AS_IO); | |
238 | return machine().device<mc146818_device>("rtc")->read(mem, 1); | |
239 | 239 | } |
240 | 240 | |
241 | 241 | static TIMER_CALLBACK( mbee_rtc_irq ) |
242 | 242 | { |
243 | 243 | mbee_state *state = machine.driver_data<mbee_state>(); |
244 | address_space *mem = machine.device("maincpu")->memory().space(AS_IO); | |
245 | UINT8 data = machine.device<mc146818_device>("rtc")->read(*mem, 12); | |
244 | address_space &mem = machine.device("maincpu")->memory().space(AS_IO); | |
245 | UINT8 data = machine.device<mc146818_device>("rtc")->read(mem, 12); | |
246 | 246 | if (data) state->m_clock_pulse = 0x80; |
247 | 247 | } |
248 | 248 | |
r18027 | r18028 | |
263 | 263 | |
264 | 264 | WRITE8_MEMBER( mbee_state::mbee256_50_w ) |
265 | 265 | { |
266 | address_space | |
266 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
267 | 267 | |
268 | 268 | // primary low banks |
269 | 269 | membank("boot")->set_entry((data & 3) | ((data & 0x20) >> 3)); |
r18027 | r18028 | |
273 | 273 | membank("bank9")->set_entry((data & 4) ? 1 : 0); |
274 | 274 | |
275 | 275 | // 8000-8FFF, F000-FFFF |
276 | mem->unmap_readwrite (0x8000, 0x87ff); | |
277 | mem->unmap_readwrite (0x8800, 0x8fff); | |
278 | mem->unmap_readwrite (0xf000, 0xf7ff); | |
279 | mem->unmap_readwrite (0xf800, 0xffff); | |
276 | mem.unmap_readwrite (0x8000, 0x87ff); | |
277 | mem.unmap_readwrite (0x8800, 0x8fff); | |
278 | mem.unmap_readwrite (0xf000, 0xf7ff); | |
279 | mem.unmap_readwrite (0xf800, 0xffff); | |
280 | 280 | |
281 | 281 | switch (data & 0x1c) |
282 | 282 | { |
283 | 283 | case 0x00: |
284 | mem->install_read_bank (0x8000, 0x87ff, "bank8l"); | |
285 | mem->install_read_bank (0x8800, 0x8fff, "bank8h"); | |
286 | mem->install_readwrite_handler (0xf000, 0xf7ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_low_w), this)); | |
287 | mem->install_readwrite_handler (0xf800, 0xffff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_high_w), this)); | |
284 | mem.install_read_bank (0x8000, 0x87ff, "bank8l"); | |
285 | mem.install_read_bank (0x8800, 0x8fff, "bank8h"); | |
286 | mem.install_readwrite_handler (0xf000, 0xf7ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_low_w), this)); | |
287 | mem.install_readwrite_handler (0xf800, 0xffff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_high_w), this)); | |
288 | 288 | membank("bank8l")->set_entry(0); // rom |
289 | 289 | membank("bank8h")->set_entry(0); // rom |
290 | 290 | break; |
291 | 291 | case 0x04: |
292 | mem->install_read_bank (0x8000, 0x87ff, "bank8l"); | |
293 | mem->install_read_bank (0x8800, 0x8fff, "bank8h"); | |
294 | mem->install_readwrite_handler (0xf000, 0xf7ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_low_w), this)); | |
295 | mem->install_readwrite_handler (0xf800, 0xffff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_high_w), this)); | |
292 | mem.install_read_bank (0x8000, 0x87ff, "bank8l"); | |
293 | mem.install_read_bank (0x8800, 0x8fff, "bank8h"); | |
294 | mem.install_readwrite_handler (0xf000, 0xf7ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_low_w), this)); | |
295 | mem.install_readwrite_handler (0xf800, 0xffff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_high_w), this)); | |
296 | 296 | membank("bank8l")->set_entry(1); // ram |
297 | 297 | membank("bank8h")->set_entry(1); // ram |
298 | 298 | break; |
299 | 299 | case 0x08: |
300 | 300 | case 0x18: |
301 | mem->install_read_bank (0x8000, 0x87ff, "bank8l"); | |
302 | mem->install_read_bank (0x8800, 0x8fff, "bank8h"); | |
303 | mem->install_read_bank (0xf000, 0xf7ff, "bankfl"); | |
304 | mem->install_read_bank (0xf800, 0xffff, "bankfh"); | |
301 | mem.install_read_bank (0x8000, 0x87ff, "bank8l"); | |
302 | mem.install_read_bank (0x8800, 0x8fff, "bank8h"); | |
303 | mem.install_read_bank (0xf000, 0xf7ff, "bankfl"); | |
304 | mem.install_read_bank (0xf800, 0xffff, "bankfh"); | |
305 | 305 | membank("bank8l")->set_entry(0); // rom |
306 | 306 | membank("bank8h")->set_entry(0); // rom |
307 | 307 | membank("bankfl")->set_entry(0); // ram |
r18027 | r18028 | |
309 | 309 | break; |
310 | 310 | case 0x0c: |
311 | 311 | case 0x1c: |
312 | mem->install_read_bank (0x8000, 0x87ff, "bank8l"); | |
313 | mem->install_read_bank (0x8800, 0x8fff, "bank8h"); | |
314 | mem->install_read_bank (0xf000, 0xf7ff, "bankfl"); | |
315 | mem->install_read_bank (0xf800, 0xffff, "bankfh"); | |
312 | mem.install_read_bank (0x8000, 0x87ff, "bank8l"); | |
313 | mem.install_read_bank (0x8800, 0x8fff, "bank8h"); | |
314 | mem.install_read_bank (0xf000, 0xf7ff, "bankfl"); | |
315 | mem.install_read_bank (0xf800, 0xffff, "bankfh"); | |
316 | 316 | membank("bank8l")->set_entry(1); // ram |
317 | 317 | membank("bank8h")->set_entry(1); // ram |
318 | 318 | membank("bankfl")->set_entry(0); // ram |
r18027 | r18028 | |
320 | 320 | break; |
321 | 321 | case 0x10: |
322 | 322 | case 0x14: |
323 | mem->install_readwrite_handler (0x8000, 0x87ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_low_w), this)); | |
324 | mem->install_readwrite_handler (0x8800, 0x8fff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_high_w), this)); | |
325 | mem->install_read_bank (0xf000, 0xf7ff, "bankfl"); | |
326 | mem->install_read_bank (0xf800, 0xffff, "bankfh"); | |
323 | mem.install_readwrite_handler (0x8000, 0x87ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_low_w), this)); | |
324 | mem.install_readwrite_handler (0x8800, 0x8fff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_high_w), this)); | |
325 | mem.install_read_bank (0xf000, 0xf7ff, "bankfl"); | |
326 | mem.install_read_bank (0xf800, 0xffff, "bankfh"); | |
327 | 327 | membank("bankfl")->set_entry(0); // ram |
328 | 328 | membank("bankfh")->set_entry(0); // ram |
329 | 329 | break; |
r18027 | r18028 | |
345 | 345 | |
346 | 346 | WRITE8_MEMBER( mbee_state::mbee128_50_w ) |
347 | 347 | { |
348 | address_space | |
348 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
349 | 349 | |
350 | 350 | // primary low banks |
351 | 351 | membank("boot")->set_entry((data & 3)); |
r18027 | r18028 | |
355 | 355 | membank("bank9")->set_entry((data & 4) ? 1 : 0); |
356 | 356 | |
357 | 357 | // 8000-8FFF, F000-FFFF |
358 | mem->unmap_readwrite (0x8000, 0x87ff); | |
359 | mem->unmap_readwrite (0x8800, 0x8fff); | |
360 | mem->unmap_readwrite (0xf000, 0xf7ff); | |
361 | mem->unmap_readwrite (0xf800, 0xffff); | |
358 | mem.unmap_readwrite (0x8000, 0x87ff); | |
359 | mem.unmap_readwrite (0x8800, 0x8fff); | |
360 | mem.unmap_readwrite (0xf000, 0xf7ff); | |
361 | mem.unmap_readwrite (0xf800, 0xffff); | |
362 | 362 | |
363 | 363 | switch (data & 0x1c) |
364 | 364 | { |
365 | 365 | case 0x00: |
366 | mem->install_read_bank (0x8000, 0x87ff, "bank8l"); | |
367 | mem->install_read_bank (0x8800, 0x8fff, "bank8h"); | |
368 | mem->install_readwrite_handler (0xf000, 0xf7ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r),this), write8_delegate(FUNC(mbee_state::mbeeppc_low_w),this)); | |
369 | mem->install_readwrite_handler (0xf800, 0xffff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r),this), write8_delegate(FUNC(mbee_state::mbeeppc_high_w),this)); | |
366 | mem.install_read_bank (0x8000, 0x87ff, "bank8l"); | |
367 | mem.install_read_bank (0x8800, 0x8fff, "bank8h"); | |
368 | mem.install_readwrite_handler (0xf000, 0xf7ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r),this), write8_delegate(FUNC(mbee_state::mbeeppc_low_w),this)); | |
369 | mem.install_readwrite_handler (0xf800, 0xffff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r),this), write8_delegate(FUNC(mbee_state::mbeeppc_high_w),this)); | |
370 | 370 | membank("bank8l")->set_entry(0); // rom |
371 | 371 | membank("bank8h")->set_entry(0); // rom |
372 | 372 | break; |
373 | 373 | case 0x04: |
374 | mem->install_read_bank (0x8000, 0x87ff, "bank8l"); | |
375 | mem->install_read_bank (0x8800, 0x8fff, "bank8h"); | |
376 | mem->install_readwrite_handler (0xf000, 0xf7ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r),this), write8_delegate(FUNC(mbee_state::mbeeppc_low_w),this)); | |
377 | mem->install_readwrite_handler (0xf800, 0xffff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r),this), write8_delegate(FUNC(mbee_state::mbeeppc_high_w),this)); | |
374 | mem.install_read_bank (0x8000, 0x87ff, "bank8l"); | |
375 | mem.install_read_bank (0x8800, 0x8fff, "bank8h"); | |
376 | mem.install_readwrite_handler (0xf000, 0xf7ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r),this), write8_delegate(FUNC(mbee_state::mbeeppc_low_w),this)); | |
377 | mem.install_readwrite_handler (0xf800, 0xffff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r),this), write8_delegate(FUNC(mbee_state::mbeeppc_high_w),this)); | |
378 | 378 | membank("bank8l")->set_entry(1); // ram |
379 | 379 | membank("bank8h")->set_entry(1); // ram |
380 | 380 | break; |
381 | 381 | case 0x08: |
382 | 382 | case 0x18: |
383 | mem->install_read_bank (0x8000, 0x87ff, "bank8l"); | |
384 | mem->install_read_bank (0x8800, 0x8fff, "bank8h"); | |
385 | mem->install_read_bank (0xf000, 0xf7ff, "bankfl"); | |
386 | mem->install_read_bank (0xf800, 0xffff, "bankfh"); | |
383 | mem.install_read_bank (0x8000, 0x87ff, "bank8l"); | |
384 | mem.install_read_bank (0x8800, 0x8fff, "bank8h"); | |
385 | mem.install_read_bank (0xf000, 0xf7ff, "bankfl"); | |
386 | mem.install_read_bank (0xf800, 0xffff, "bankfh"); | |
387 | 387 | membank("bank8l")->set_entry(0); // rom |
388 | 388 | membank("bank8h")->set_entry(0); // rom |
389 | 389 | membank("bankfl")->set_entry(0); // ram |
r18027 | r18028 | |
391 | 391 | break; |
392 | 392 | case 0x0c: |
393 | 393 | case 0x1c: |
394 | mem->install_read_bank (0x8000, 0x87ff, "bank8l"); | |
395 | mem->install_read_bank (0x8800, 0x8fff, "bank8h"); | |
396 | mem->install_read_bank (0xf000, 0xf7ff, "bankfl"); | |
397 | mem->install_read_bank (0xf800, 0xffff, "bankfh"); | |
394 | mem.install_read_bank (0x8000, 0x87ff, "bank8l"); | |
395 | mem.install_read_bank (0x8800, 0x8fff, "bank8h"); | |
396 | mem.install_read_bank (0xf000, 0xf7ff, "bankfl"); | |
397 | mem.install_read_bank (0xf800, 0xffff, "bankfh"); | |
398 | 398 | membank("bank8l")->set_entry(1); // ram |
399 | 399 | membank("bank8h")->set_entry(1); // ram |
400 | 400 | membank("bankfl")->set_entry(0); // ram |
r18027 | r18028 | |
402 | 402 | break; |
403 | 403 | case 0x10: |
404 | 404 | case 0x14: |
405 | mem->install_readwrite_handler (0x8000, 0x87ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r),this), write8_delegate(FUNC(mbee_state::mbeeppc_low_w),this)); | |
406 | mem->install_readwrite_handler (0x8800, 0x8fff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r),this), write8_delegate(FUNC(mbee_state::mbeeppc_high_w),this)); | |
407 | mem->install_read_bank (0xf000, 0xf7ff, "bankfl"); | |
408 | mem->install_read_bank (0xf800, 0xffff, "bankfh"); | |
405 | mem.install_readwrite_handler (0x8000, 0x87ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r),this), write8_delegate(FUNC(mbee_state::mbeeppc_low_w),this)); | |
406 | mem.install_readwrite_handler (0x8800, 0x8fff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r),this), write8_delegate(FUNC(mbee_state::mbeeppc_high_w),this)); | |
407 | mem.install_read_bank (0xf000, 0xf7ff, "bankfl"); | |
408 | mem.install_read_bank (0xf800, 0xffff, "bankfh"); | |
409 | 409 | membank("bankfl")->set_entry(0); // ram |
410 | 410 | membank("bankfh")->set_entry(0); // ram |
411 | 411 | break; |
r18027 | r18028 | |
532 | 532 | |
533 | 533 | MACHINE_RESET_MEMBER(mbee_state,mbee128) |
534 | 534 | { |
535 | address_space | |
535 | address_space &mem = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
536 | 536 | machine_reset_common_disk(machine()); |
537 | mbee128_50_w( | |
537 | mbee128_50_w(mem,0,0); // set banks to default | |
538 | 538 | membank("boot")->set_entry(4); // boot time |
539 | 539 | } |
540 | 540 | |
541 | 541 | MACHINE_RESET_MEMBER(mbee_state,mbee256) |
542 | 542 | { |
543 | 543 | UINT8 i; |
544 | address_space | |
544 | address_space &mem = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
545 | 545 | machine_reset_common_disk(machine()); |
546 | 546 | for (i = 0; i < 15; i++) m_mbee256_was_pressed[i] = 0; |
547 | 547 | m_mbee256_q_pos = 0; |
548 | mbee256_50_w( | |
548 | mbee256_50_w(mem,0,0); // set banks to default | |
549 | 549 | membank("boot")->set_entry(8); // boot time |
550 | 550 | machine().scheduler().timer_set(attotime::from_usec(4), FUNC(mbee_reset)); |
551 | 551 | } |
r18027 | r18028 | |
564 | 564 | // Due to the uncertainly and hackage here, this is commented out for now - Robbbert - 05-Oct-2010 |
565 | 565 | #if 0 |
566 | 566 | |
567 | //address_space &space = | |
567 | //address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
568 | 568 | /* The printer status connects to the pio ASTB pin, and the printer changing to not |
569 | 569 | busy should signal an interrupt routine at B61C, (next line) but this doesn't work. |
570 | 570 | The line below does what the interrupt should be doing. */ |
r18027 | r18028 | |
753 | 753 | { |
754 | 754 | mbee_state *state = image.device().machine().driver_data<mbee_state>(); |
755 | 755 | device_t *cpu = image.device().machine().device("maincpu"); |
756 | address_space &space = | |
756 | address_space &space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM); | |
757 | 757 | UINT16 i, j; |
758 | 758 | UINT8 data, sw = image.device().machine().root_device().ioport("CONFIG")->read() & 1; /* reading the dipswitch: 1 = autorun */ |
759 | 759 |
r18027 | r18028 | |
---|---|---|
1416 | 1416 | static TIMER_CALLBACK( pokemini_prc_counter_callback ) |
1417 | 1417 | { |
1418 | 1418 | pokemini_state *state = machine.driver_data<pokemini_state>(); |
1419 | address_space &space = | |
1419 | address_space &space = machine.device( "maincpu")->memory().space( AS_PROGRAM ); | |
1420 | 1420 | state->m_prc.count++; |
1421 | 1421 | |
1422 | 1422 | /* Check for overflow */ |
r18027 | r18028 | |
---|---|---|
99 | 99 | MACHINE_START( pc1350 ) |
100 | 100 | { |
101 | 101 | pc1350_state *state = machine.driver_data<pc1350_state>(); |
102 | address_space &space = | |
102 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
103 | 103 | |
104 | 104 | state->m_power = 1; |
105 | 105 | machine.scheduler().timer_set(attotime::from_seconds(1), FUNC(pc1350_power_up)); |
r18027 | r18028 | |
---|---|---|
106 | 106 | { |
107 | 107 | m_status = VHDSTATUS_NO_VHD_ATTACHED; |
108 | 108 | m_cpu = machine().device<cpu_device>(MAINCPU_TAG); |
109 | m_cpu_space = m_cpu->space(AS_PROGRAM); | |
109 | m_cpu_space = &m_cpu->space(AS_PROGRAM); | |
110 | 110 | } |
111 | 111 | |
112 | 112 |
r18027 | r18028 | |
---|---|---|
24 | 24 | |
25 | 25 | void northbridge_device::device_start() |
26 | 26 | { |
27 | address_space& space = | |
27 | address_space& space = machine().device(":maincpu")->memory().space(AS_PROGRAM); | |
28 | 28 | |
29 | 29 | machine().root_device().membank("bank10")->set_base(m_ram->pointer()); |
30 | 30 |
r18027 | r18028 | |
---|---|---|
28 | 28 | static void pmd851_update_memory(running_machine &machine) |
29 | 29 | { |
30 | 30 | pmd85_state *state = machine.driver_data<pmd85_state>(); |
31 | address_space& space = | |
31 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
32 | 32 | UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer(); |
33 | 33 | |
34 | 34 | if (state->m_startup_mem_map) |
r18027 | r18028 | |
73 | 73 | static void pmd852a_update_memory(running_machine &machine) |
74 | 74 | { |
75 | 75 | pmd85_state *state = machine.driver_data<pmd85_state>(); |
76 | address_space& space = | |
76 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
77 | 77 | UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer(); |
78 | 78 | |
79 | 79 | if (state->m_startup_mem_map) |
r18027 | r18028 | |
149 | 149 | static void alfa_update_memory(running_machine &machine) |
150 | 150 | { |
151 | 151 | pmd85_state *state = machine.driver_data<pmd85_state>(); |
152 | address_space& space = | |
152 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
153 | 153 | UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer(); |
154 | 154 | |
155 | 155 | if (state->m_startup_mem_map) |
r18027 | r18028 | |
183 | 183 | static void mato_update_memory(running_machine &machine) |
184 | 184 | { |
185 | 185 | pmd85_state *state = machine.driver_data<pmd85_state>(); |
186 | address_space& space = | |
186 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
187 | 187 | UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer(); |
188 | 188 | |
189 | 189 | if (state->m_startup_mem_map) |
r18027 | r18028 | |
209 | 209 | static void c2717_update_memory(running_machine &machine) |
210 | 210 | { |
211 | 211 | pmd85_state *state = machine.driver_data<pmd85_state>(); |
212 | address_space& space = | |
212 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
213 | 213 | UINT8 *mem = state->memregion("maincpu")->base(); |
214 | 214 | UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer(); |
215 | 215 | |
r18027 | r18028 | |
960 | 960 | |
961 | 961 | machine().scheduler().timer_set(attotime::zero, FUNC(setup_machine_state)); |
962 | 962 | |
963 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
963 | machine().device("maincpu")->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(pmd85_state::pmd85_opbaseoverride), this)); | |
964 | 964 | } |
r18027 | r18028 | |
---|---|---|
123 | 123 | // single byte or word transfer |
124 | 124 | device_t* device = (device_t*)ptr; |
125 | 125 | upd71071_t* dmac = get_safe_token(device); |
126 | address_space& space = | |
126 | address_space& space = device->machine().device(dmac->intf->cputag)->memory().space(AS_PROGRAM); | |
127 | 127 | int channel = param; |
128 | 128 | UINT16 data = 0; // data to transfer |
129 | 129 |
r18027 | r18028 | |
---|---|---|
316 | 316 | static void init_at_common(running_machine &machine) |
317 | 317 | { |
318 | 318 | at_state *state = machine.driver_data<at_state>(); |
319 | address_space& space = | |
319 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
320 | 320 | |
321 | 321 | // The CS4031 chipset does this itself |
322 | 322 | if (machine.device("cs4031") == NULL) |
r18027 | r18028 | |
---|---|---|
337 | 337 | state->m_ula.screen_size = 0x8000 - 0x3000; |
338 | 338 | state->m_ula.screen_addr = 0; |
339 | 339 | state->m_ula.tape_running = 0; |
340 | state->m_ula.vram = (UINT8 *)machine.device("maincpu")->memory().space(AS_PROGRAM) | |
340 | state->m_ula.vram = (UINT8 *)machine.device("maincpu")->memory().space(AS_PROGRAM).get_read_ptr(state->m_ula.screen_base); | |
341 | 341 | } |
342 | 342 | |
343 | 343 | void electron_state::machine_start() |
r18027 | r18028 | |
---|---|---|
268 | 268 | orion_state *state = machine.driver_data<orion_state>(); |
269 | 269 | UINT8 bank_select; |
270 | 270 | UINT8 segment_select; |
271 | address_space &space = | |
271 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
272 | 272 | |
273 | 273 | bank_select = (state->m_orionz80_dispatcher & 0x0c) >> 2; |
274 | 274 | segment_select = state->m_orionz80_dispatcher & 0x03; |
r18027 | r18028 | |
328 | 328 | |
329 | 329 | MACHINE_RESET_MEMBER(orion_state,orionz80) |
330 | 330 | { |
331 | address_space &space = | |
331 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
332 | 332 | |
333 | 333 | space.unmap_write(0x0000, 0x3fff); |
334 | 334 | space.install_write_bank(0x4000, 0xefff, "bank2"); |
r18027 | r18028 | |
412 | 412 | static void orionpro_bank_switch(running_machine &machine) |
413 | 413 | { |
414 | 414 | orion_state *state = machine.driver_data<orion_state>(); |
415 | address_space &space = | |
415 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
416 | 416 | int page = state->m_orionpro_page & 7; // we have only 8 pages |
417 | 417 | int is128 = (state->m_orionpro_dispatcher & 0x80) ? 1 : 0; |
418 | 418 | UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer(); |
r18027 | r18028 | |
---|---|---|
187 | 187 | void cpc_ssa1_device::device_start() |
188 | 188 | { |
189 | 189 | device_t* cpu = machine().device("maincpu"); |
190 | address_space& space = | |
190 | address_space& space = cpu->memory().space(AS_IO); | |
191 | 191 | m_slot = dynamic_cast<cpc_expansion_slot_device *>(owner()); |
192 | 192 | |
193 | 193 | m_rom = memregion("sp0256")->base(); |
r18027 | r18028 | |
201 | 201 | void cpc_dkspeech_device::device_start() |
202 | 202 | { |
203 | 203 | device_t* cpu = machine().device("maincpu"); |
204 | address_space& space = | |
204 | address_space& space = cpu->memory().space(AS_IO); | |
205 | 205 | m_slot = dynamic_cast<cpc_expansion_slot_device *>(owner()); |
206 | 206 | |
207 | 207 | m_rom = memregion("sp0256")->base(); |
r18027 | r18028 | |
---|---|---|
72 | 72 | static void a7800_driver_init(running_machine &machine, int ispal, int lines) |
73 | 73 | { |
74 | 74 | a7800_state *state = machine.driver_data<a7800_state>(); |
75 | address_space& space = | |
75 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
76 | 76 | state->m_ROM = state->memregion("maincpu")->base(); |
77 | 77 | state->m_ispal = ispal; |
78 | 78 | state->m_lines = lines; |
r18027 | r18028 | |
107 | 107 | void a7800_state::machine_reset() |
108 | 108 | { |
109 | 109 | UINT8 *memory; |
110 | address_space& space = | |
110 | address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
111 | 111 | |
112 | 112 | m_ctrl_lock = 0; |
113 | 113 | m_ctrl_reg = 0; |
r18027 | r18028 | |
---|---|---|
222 | 222 | if (sscanf((char *)line, "%x %x %x %x %x %x %x %x %x %x\010\010\n", |
223 | 223 | &addr, &b0, &b1, &b2, &b3, &b4, &b5, &b6, &b7, &dummy) == 10) |
224 | 224 | { |
225 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->write_byte(addr++, b0); | |
226 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->write_byte(addr++, b1); | |
227 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->write_byte(addr++, b2); | |
228 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->write_byte(addr++, b3); | |
229 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->write_byte(addr++, b4); | |
230 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->write_byte(addr++, b5); | |
231 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->write_byte(addr++, b6); | |
232 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->write_byte(addr++, b7); | |
225 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).write_byte(addr++, b0); | |
226 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).write_byte(addr++, b1); | |
227 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).write_byte(addr++, b2); | |
228 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).write_byte(addr++, b3); | |
229 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).write_byte(addr++, b4); | |
230 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).write_byte(addr++, b5); | |
231 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).write_byte(addr++, b6); | |
232 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).write_byte(addr++, b7); | |
233 | 233 | } |
234 | 234 | } |
235 | 235 | |
r18027 | r18028 | |
265 | 265 | switch (machine().device<ram_device>(RAM_TAG)->size()) |
266 | 266 | { |
267 | 267 | case 1 * 1024: |
268 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
268 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_readwrite( | |
269 | 269 | 0x1400, 0x9000); |
270 | 270 | break; |
271 | 271 | |
272 | 272 | case 16 * 1024: |
273 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
273 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank( | |
274 | 274 | 0x1400, 0x4fff, "bank1"); |
275 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
275 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_readwrite( | |
276 | 276 | 0x5000, 0xafff); |
277 | 277 | membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer()); |
278 | 278 | break; |
279 | 279 | |
280 | 280 | case 32 * 1024: |
281 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
281 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank( | |
282 | 282 | 0x1400, 0x8fff, "bank1"); |
283 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
283 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_readwrite( | |
284 | 284 | 0x9000, 0xafff); |
285 | 285 | membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer()); |
286 | 286 | break; |
287 | 287 | |
288 | 288 | case 40 * 1024: |
289 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
289 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank( | |
290 | 290 | 0x1400, 0xafff, "bank1"); |
291 | 291 | membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer()); |
292 | 292 | break; |
r18027 | r18028 | |
---|---|---|
514 | 514 | { |
515 | 515 | UINT8 *dst = memregion("gfx2")->base(); |
516 | 516 | int i; |
517 | address_space &space = | |
517 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
518 | 518 | |
519 | 519 | for (i = 0; i < 256; i++) |
520 | 520 | { |
r18027 | r18028 | |
---|---|---|
126 | 126 | throw device_missing_dependencies(); |
127 | 127 | |
128 | 128 | device_t *cpu = machine().device(m_cputag); |
129 | m_space = cpu->memory().space(AS_PROGRAM); | |
129 | m_space = &cpu->memory().space(AS_PROGRAM); | |
130 | 130 | m_isa = machine().root_device().memregion(m_isatag)->base(); |
131 | 131 | m_bios = machine().root_device().memregion(m_biostag)->base(); |
132 | 132 |
r18027 | r18028 | |
---|---|---|
257 | 257 | |
258 | 258 | SNAPSHOT_LOAD( poly88 ) |
259 | 259 | { |
260 | address_space &space = | |
260 | address_space &space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM); | |
261 | 261 | UINT8* data= auto_alloc_array(image.device().machine(), UINT8, snapshot_size); |
262 | 262 | UINT16 recordNum; |
263 | 263 | UINT16 recordLen; |
r18027 | r18028 | |
---|---|---|
139 | 139 | |
140 | 140 | WRITE8_MEMBER(samcoupe_state::samcoupe_ext_mem_w) |
141 | 141 | { |
142 | address_space &space_program = | |
142 | address_space &space_program = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
143 | 143 | |
144 | 144 | if (offset & 1) |
145 | 145 | m_hext = data; |
r18027 | r18028 | |
160 | 160 | |
161 | 161 | static READ8_DEVICE_HANDLER( samcoupe_rtc_r ) |
162 | 162 | { |
163 | address_space &spaceio = | |
163 | address_space &spaceio = device->machine().device("maincpu")->memory().space(AS_IO); | |
164 | 164 | msm6242_device *rtc = dynamic_cast<msm6242_device*>(device); |
165 | 165 | return rtc->read(spaceio,offset >> 12); |
166 | 166 | } |
r18027 | r18028 | |
168 | 168 | |
169 | 169 | static WRITE8_DEVICE_HANDLER( samcoupe_rtc_w ) |
170 | 170 | { |
171 | address_space &spaceio = | |
171 | address_space &spaceio = device->machine().device("maincpu")->memory().space(AS_IO); | |
172 | 172 | msm6242_device *rtc = dynamic_cast<msm6242_device*>(device); |
173 | 173 | rtc->write(spaceio,offset >> 12, data); |
174 | 174 | } |
r18027 | r18028 | |
244 | 244 | |
245 | 245 | void samcoupe_state::machine_reset() |
246 | 246 | { |
247 | address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM); | |
248 | address_space &spaceio = *machine().device("maincpu")->memory().space(AS_IO); | |
247 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
248 | address_space &spaceio = machine().device("maincpu")->memory().space(AS_IO); | |
249 | 249 | |
250 | 250 | /* initialize state */ |
251 | 251 | m_lmpr = 0x0f; /* ROM0 paged in, ROM1 paged out RAM Banks */ |
r18027 | r18028 | |
---|---|---|
216 | 216 | d0 Select bit 0 */ |
217 | 217 | |
218 | 218 | /* get address space instead of io space */ |
219 | address_space | |
219 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
220 | 220 | UINT8 *base = memregion("maincpu")->base(); |
221 | 221 | |
222 | 222 | m_mode = (m_mode & 0x73) | (data & 0x8c); |
r18027 | r18028 | |
255 | 255 | membank("bank17")->set_base(base + 0x14000); |
256 | 256 | membank("bank18")->set_base(base + 0x1f400); |
257 | 257 | membank("bank19")->set_base(base + 0x1f800); |
258 | mem->install_readwrite_handler (0x37e8, 0x37e9, read8_delegate(FUNC(trs80_state::trs80_printer_r), this), write8_delegate(FUNC(trs80_state::trs80_printer_w), this)); /* 3 & 13 */ | |
259 | mem->install_read_handler (0x3800, 0x3bff, read8_delegate(FUNC(trs80_state::trs80_keyboard_r), this)); /* 5 */ | |
260 | mem->install_readwrite_handler (0x3c00, 0x3fff, read8_delegate(FUNC(trs80_state::trs80_videoram_r), this), write8_delegate(FUNC(trs80_state::trs80_videoram_w), this)); /* 6 & 16 */ | |
258 | mem.install_readwrite_handler (0x37e8, 0x37e9, read8_delegate(FUNC(trs80_state::trs80_printer_r), this), write8_delegate(FUNC(trs80_state::trs80_printer_w), this)); /* 3 & 13 */ | |
259 | mem.install_read_handler (0x3800, 0x3bff, read8_delegate(FUNC(trs80_state::trs80_keyboard_r), this)); /* 5 */ | |
260 | mem.install_readwrite_handler (0x3c00, 0x3fff, read8_delegate(FUNC(trs80_state::trs80_videoram_r), this), write8_delegate(FUNC(trs80_state::trs80_videoram_w), this)); /* 6 & 16 */ | |
261 | 261 | break; |
262 | 262 | |
263 | 263 | case 1: /* write-only ram backs up the rom */ |
r18027 | r18028 | |
292 | 292 | membank("bank17")->set_base(base + 0x14000); |
293 | 293 | membank("bank18")->set_base(base + 0x1f400); |
294 | 294 | membank("bank19")->set_base(base + 0x1f800); |
295 | mem->install_read_handler (0x3800, 0x3bff, read8_delegate(FUNC(trs80_state::trs80_keyboard_r), this)); /* 5 */ | |
296 | mem->install_readwrite_handler (0x3c00, 0x3fff, read8_delegate(FUNC(trs80_state::trs80_videoram_r), this), write8_delegate(FUNC(trs80_state::trs80_videoram_w), this)); /* 6 & 16 */ | |
295 | mem.install_read_handler (0x3800, 0x3bff, read8_delegate(FUNC(trs80_state::trs80_keyboard_r), this)); /* 5 */ | |
296 | mem.install_readwrite_handler (0x3c00, 0x3fff, read8_delegate(FUNC(trs80_state::trs80_videoram_r), this), write8_delegate(FUNC(trs80_state::trs80_videoram_w), this)); /* 6 & 16 */ | |
297 | 297 | break; |
298 | 298 | |
299 | 299 | case 2: /* keyboard and video are moved to high memory, and the rest is ram */ |
r18027 | r18028 | |
312 | 312 | membank("bank16")->set_base(base + 0x13c00); |
313 | 313 | membank("bank17")->set_base(base + 0x14000); |
314 | 314 | membank("bank18")->set_base(base + 0x0a000); |
315 | mem->install_read_handler (0xf400, 0xf7ff, read8_delegate(FUNC(trs80_state::trs80_keyboard_r), this)); /* 8 */ | |
316 | mem->install_readwrite_handler (0xf800, 0xffff, read8_delegate(FUNC(trs80_state::trs80_videoram_r), this), write8_delegate(FUNC(trs80_state::trs80_videoram_w), this)); /* 9 & 19 */ | |
315 | mem.install_read_handler (0xf400, 0xf7ff, read8_delegate(FUNC(trs80_state::trs80_keyboard_r), this)); /* 8 */ | |
316 | mem.install_readwrite_handler (0xf800, 0xffff, read8_delegate(FUNC(trs80_state::trs80_videoram_r), this), write8_delegate(FUNC(trs80_state::trs80_videoram_w), this)); /* 9 & 19 */ | |
317 | 317 | m_model4++; |
318 | 318 | break; |
319 | 319 | |
r18027 | r18028 | |
561 | 561 | d0 inverse video (entire screen) */ |
562 | 562 | |
563 | 563 | /* get address space instead of io space */ |
564 | address_space | |
564 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
565 | 565 | |
566 | 566 | m_mode = (m_mode & 0x87) | ((data & 0x0f) << 3); |
567 | 567 | |
568 | 568 | if (data & 8) |
569 | 569 | { |
570 | mem->unmap_readwrite (0x0000, 0x3fff); | |
571 | mem->install_readwrite_handler (0x0000, 0x3fff, read8_delegate(FUNC(trs80_state::trs80_gfxram_r), this), write8_delegate(FUNC(trs80_state::trs80_gfxram_w), this)); | |
570 | mem.unmap_readwrite (0x0000, 0x3fff); | |
571 | mem.install_readwrite_handler (0x0000, 0x3fff, read8_delegate(FUNC(trs80_state::trs80_gfxram_r), this), write8_delegate(FUNC(trs80_state::trs80_gfxram_w), this)); | |
572 | 572 | } |
573 | 573 | else |
574 | 574 | { |
575 | mem->unmap_readwrite (0x0000, 0x3fff); | |
576 | mem->install_read_bank (0x0000, 0x2fff, "bank1"); | |
575 | mem.unmap_readwrite (0x0000, 0x3fff); | |
576 | mem.install_read_bank (0x0000, 0x2fff, "bank1"); | |
577 | 577 | membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base()); |
578 | mem->install_readwrite_handler (0x37e0, 0x37e3, read8_delegate(FUNC(trs80_state::trs80_irq_status_r), this), write8_delegate(FUNC(trs80_state::trs80_motor_w), this)); | |
579 | mem->install_readwrite_handler (0x37e8, 0x37eb, read8_delegate(FUNC(trs80_state::trs80_printer_r), this), write8_delegate(FUNC(trs80_state::trs80_printer_w), this)); | |
580 | mem->install_read_handler (0x37ec, 0x37ec, read8_delegate(FUNC(trs80_state::trs80_wd179x_r), this)); | |
581 | mem->install_legacy_write_handler (*m_fdc, 0x37ec, 0x37ec, FUNC(wd17xx_command_w)); | |
582 | mem->install_legacy_readwrite_handler (*m_fdc, 0x37ed, 0x37ed, FUNC(wd17xx_track_r), FUNC(wd17xx_track_w)); | |
583 | mem->install_legacy_readwrite_handler (*m_fdc, 0x37ee, 0x37ee, FUNC(wd17xx_sector_r), FUNC(wd17xx_sector_w)); | |
584 | mem->install_legacy_readwrite_handler (*m_fdc, 0x37ef, 0x37ef, FUNC(wd17xx_data_r), FUNC(wd17xx_data_w)); | |
585 | mem->install_read_handler (0x3800, 0x38ff, 0, 0x0300, read8_delegate(FUNC(trs80_state::trs80_keyboard_r), this)); | |
586 | mem->install_readwrite_handler (0x3c00, 0x3fff, read8_delegate(FUNC(trs80_state::trs80_videoram_r), this), write8_delegate(FUNC(trs80_state::trs80_videoram_w), this)); | |
578 | mem.install_readwrite_handler (0x37e0, 0x37e3, read8_delegate(FUNC(trs80_state::trs80_irq_status_r), this), write8_delegate(FUNC(trs80_state::trs80_motor_w), this)); | |
579 | mem.install_readwrite_handler (0x37e8, 0x37eb, read8_delegate(FUNC(trs80_state::trs80_printer_r), this), write8_delegate(FUNC(trs80_state::trs80_printer_w), this)); | |
580 | mem.install_read_handler (0x37ec, 0x37ec, read8_delegate(FUNC(trs80_state::trs80_wd179x_r), this)); | |
581 | mem.install_legacy_write_handler (*m_fdc, 0x37ec, 0x37ec, FUNC(wd17xx_command_w)); | |
582 | mem.install_legacy_readwrite_handler (*m_fdc, 0x37ed, 0x37ed, FUNC(wd17xx_track_r), FUNC(wd17xx_track_w)); | |
583 | mem.install_legacy_readwrite_handler (*m_fdc, 0x37ee, 0x37ee, FUNC(wd17xx_sector_r), FUNC(wd17xx_sector_w)); | |
584 | mem.install_legacy_readwrite_handler (*m_fdc, 0x37ef, 0x37ef, FUNC(wd17xx_data_r), FUNC(wd17xx_data_w)); | |
585 | mem.install_read_handler (0x3800, 0x38ff, 0, 0x0300, read8_delegate(FUNC(trs80_state::trs80_keyboard_r), this)); | |
586 | mem.install_readwrite_handler (0x3c00, 0x3fff, read8_delegate(FUNC(trs80_state::trs80_videoram_r), this), write8_delegate(FUNC(trs80_state::trs80_videoram_w), this)); | |
587 | 587 | } |
588 | 588 | } |
589 | 589 | |
r18027 | r18028 | |
863 | 863 | |
864 | 864 | MACHINE_RESET_MEMBER(trs80_state,trs80m4) |
865 | 865 | { |
866 | address_space | |
866 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
867 | 867 | m_cassette_data = 0; |
868 | 868 | |
869 | mem->install_read_bank (0x0000, 0x0fff, "bank1"); | |
870 | mem->install_read_bank (0x1000, 0x37e7, "bank2"); | |
871 | mem->install_read_bank (0x37e8, 0x37e9, "bank3"); | |
872 | mem->install_read_bank (0x37ea, 0x37ff, "bank4"); | |
873 | mem->install_read_bank (0x3800, 0x3bff, "bank5"); | |
874 | mem->install_read_bank (0x3c00, 0x3fff, "bank6"); | |
875 | mem->install_read_bank (0x4000, 0xf3ff, "bank7"); | |
876 | mem->install_read_bank (0xf400, 0xf7ff, "bank8"); | |
877 | mem->install_read_bank (0xf800, 0xffff, "bank9"); | |
869 | mem.install_read_bank (0x0000, 0x0fff, "bank1"); | |
870 | mem.install_read_bank (0x1000, 0x37e7, "bank2"); | |
871 | mem.install_read_bank (0x37e8, 0x37e9, "bank3"); | |
872 | mem.install_read_bank (0x37ea, 0x37ff, "bank4"); | |
873 | mem.install_read_bank (0x3800, 0x3bff, "bank5"); | |
874 | mem.install_read_bank (0x3c00, 0x3fff, "bank6"); | |
875 | mem.install_read_bank (0x4000, 0xf3ff, "bank7"); | |
876 | mem.install_read_bank (0xf400, 0xf7ff, "bank8"); | |
877 | mem.install_read_bank (0xf800, 0xffff, "bank9"); | |
878 | 878 | |
879 | mem->install_write_bank (0x0000, 0x0fff, "bank11"); | |
880 | mem->install_write_bank (0x1000, 0x37e7, "bank12"); | |
881 | mem->install_write_bank (0x37e8, 0x37e9, "bank13"); | |
882 | mem->install_write_bank (0x37ea, 0x37ff, "bank14"); | |
883 | mem->install_write_bank (0x3800, 0x3bff, "bank15"); | |
884 | mem->install_write_bank (0x3c00, 0x3fff, "bank16"); | |
885 | mem->install_write_bank (0x4000, 0xf3ff, "bank17"); | |
886 | mem->install_write_bank (0xf400, 0xf7ff, "bank18"); | |
887 | mem->install_write_bank (0xf800, 0xffff, "bank19"); | |
888 | trs80m4p_9c_w(*mem, 0, 1); /* Enable the ROM */ | |
889 | trs80m4_84_w(*mem, 0, 0); /* switch in devices at power-on */ | |
879 | mem.install_write_bank (0x0000, 0x0fff, "bank11"); | |
880 | mem.install_write_bank (0x1000, 0x37e7, "bank12"); | |
881 | mem.install_write_bank (0x37e8, 0x37e9, "bank13"); | |
882 | mem.install_write_bank (0x37ea, 0x37ff, "bank14"); | |
883 | mem.install_write_bank (0x3800, 0x3bff, "bank15"); | |
884 | mem.install_write_bank (0x3c00, 0x3fff, "bank16"); | |
885 | mem.install_write_bank (0x4000, 0xf3ff, "bank17"); | |
886 | mem.install_write_bank (0xf400, 0xf7ff, "bank18"); | |
887 | mem.install_write_bank (0xf800, 0xffff, "bank19"); | |
888 | trs80m4p_9c_w(mem, 0, 1); /* Enable the ROM */ | |
889 | trs80m4_84_w(mem, 0, 0); /* switch in devices at power-on */ | |
890 | 890 | } |
891 | 891 | |
892 | 892 | MACHINE_RESET_MEMBER(trs80_state,lnw80) |
893 | 893 | { |
894 | address_space &space = | |
894 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
895 | 895 | m_cassette_data = 0; |
896 | 896 | m_reg_load = 1; |
897 | 897 | lnw80_fe_w(space, 0, 0); |
r18027 | r18028 | |
---|---|---|
47 | 47 | device_t* cpu = machine().device("maincpu"); |
48 | 48 | char mac[7]; |
49 | 49 | UINT32 num = rand(); |
50 | address_space& space = | |
50 | address_space& space = cpu->memory().space(AS_PROGRAM); | |
51 | 51 | m_slot = dynamic_cast<x68k_expansion_slot_device *>(owner()); |
52 | 52 | memset(m_prom, 0x57, 16); |
53 | 53 | sprintf(mac+2, "\x1b%c%c%c", (num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff); |
r18027 | r18028 | |
---|---|---|
46 | 46 | static void primo_update_memory(running_machine &machine) |
47 | 47 | { |
48 | 48 | primo_state *state = machine.driver_data<primo_state>(); |
49 | address_space& space = | |
49 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
50 | 50 | switch (state->m_port_FD & 0x03) |
51 | 51 | { |
52 | 52 | case 0x00: /* Original ROM */ |
r18027 | r18028 | |
300 | 300 | /* memory */ |
301 | 301 | |
302 | 302 | for (i=0; i<0xc000; i++) |
303 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
303 | machine.device("maincpu")->memory().space(AS_PROGRAM).write_byte( i+0x4000, snapshot_data[i+38]); | |
304 | 304 | } |
305 | 305 | |
306 | 306 | SNAPSHOT_LOAD( primo ) |
r18027 | r18028 | |
346 | 346 | start_addr = quickload_data[2] + quickload_data[3]*256; |
347 | 347 | |
348 | 348 | for (i=4; i<quickload_size; i++) |
349 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
349 | machine.device("maincpu")->memory().space(AS_PROGRAM).write_byte(start_addr+i-4, quickload_data[i]); | |
350 | 350 | |
351 | 351 | machine.device("maincpu")->state().set_state_int(Z80_PC, start_addr); |
352 | 352 |
r18027 | r18028 | |
---|---|---|
70 | 70 | m_slot->romen_w(0); |
71 | 71 | |
72 | 72 | /* clear op base override */ |
73 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
73 | machine().device("maincpu")->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(cpc_multiface2_device::amstrad_default),this)); | |
74 | 74 | } |
75 | 75 | |
76 | 76 | return pc; |
r18027 | r18028 | |
163 | 163 | m_slot->nmi_w(0); |
164 | 164 | |
165 | 165 | /* initialise 0065 override to monitor calls to 0065 */ |
166 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
166 | machine().device("maincpu")->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(cpc_multiface2_device::amstrad_multiface_directoverride),this)); | |
167 | 167 | } |
168 | 168 | } |
169 | 169 |
r18027 | r18028 | |
---|---|---|
223 | 223 | |
224 | 224 | void wswan_state::machine_reset() |
225 | 225 | { |
226 | address_space &space = | |
226 | address_space &space = machine().device( "maincpu")->memory().space( AS_PROGRAM ); | |
227 | 227 | |
228 | 228 | /* Intialize ports */ |
229 | 229 | memcpy( m_ws_portram, ws_portram_init, 256 ); |
r18027 | r18028 | |
354 | 354 | |
355 | 355 | WRITE8_MEMBER( wswan_state::wswan_port_w ) |
356 | 356 | { |
357 | address_space | |
357 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
358 | 358 | wswan_state *state = machine().driver_data<wswan_state>(); |
359 | 359 | UINT8 input; |
360 | logerror( "PC=%X: port write %02X <- %02X\n", mem | |
360 | logerror( "PC=%X: port write %02X <- %02X\n", mem.device().safe_pc(), offset, data ); | |
361 | 361 | switch( offset ) |
362 | 362 | { |
363 | 363 | case 0x00: /* Display control |
r18027 | r18028 | |
676 | 676 | length = m_ws_portram[0x46] + (m_ws_portram[0x47] << 8); |
677 | 677 | for( ; length > 0; length-- ) |
678 | 678 | { |
679 | mem | |
679 | mem.write_byte(dst, mem.read_byte(src ) ); | |
680 | 680 | src++; |
681 | 681 | dst++; |
682 | 682 | } |
r18027 | r18028 | |
1251 | 1251 | m_ws_portram[0xcb] = m_rtc.year; |
1252 | 1252 | break; |
1253 | 1253 | default: |
1254 | logerror( "%X: Unknown RTC command (%X) requested\n", mem | |
1254 | logerror( "%X: Unknown RTC command (%X) requested\n", mem.device().safe_pc(), data ); | |
1255 | 1255 | } |
1256 | 1256 | break; |
1257 | 1257 | case 0xcb: /* RTC Data */ |
r18027 | r18028 | |
1350 | 1350 | else |
1351 | 1351 | size = image.get_software_region_length("rom"); |
1352 | 1352 | |
1353 | state->m_ws_ram = (UINT8*) image.device().machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1353 | state->m_ws_ram = (UINT8*) image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).get_read_ptr(0); | |
1354 | 1354 | memset(state->m_ws_ram, 0, 0xffff); |
1355 | 1355 | state->m_ROMBanks = size / 65536; |
1356 | 1356 | |
r18027 | r18028 | |
1459 | 1459 | /* Handle Sound DMA */ |
1460 | 1460 | if ( ( state->m_sound_dma.enable & 0x88 ) == 0x80 ) |
1461 | 1461 | { |
1462 | address_space &space = | |
1462 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM ); | |
1463 | 1463 | /* TODO: Output sound DMA byte */ |
1464 | 1464 | state->wswan_port_w( space, 0x89, space.read_byte(state->m_sound_dma.source ) ); |
1465 | 1465 | state->m_sound_dma.size--; |
r18027 | r18028 | |
---|---|---|
172 | 172 | |
173 | 173 | if (!m_nmi_delay_counter) |
174 | 174 | { |
175 | machine().device("z80ne")->memory().space(AS_PROGRAM) | |
175 | machine().device("z80ne")->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(z80ne_state::z80ne_default), this)); | |
176 | 176 | machine().device("z80ne")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
177 | 177 | } |
178 | 178 | return address; |
r18027 | r18028 | |
184 | 184 | */ |
185 | 185 | DIRECT_UPDATE_MEMBER(z80ne_state::z80ne_reset_delay_count) |
186 | 186 | { |
187 | address_space &space = | |
187 | address_space &space = machine().device("z80ne")->memory().space(AS_PROGRAM); | |
188 | 188 | /* |
189 | 189 | * TODO: when debugger is active, his memory access causes this callback |
190 | 190 | * |
r18027 | r18028 | |
195 | 195 | if (!m_reset_delay_counter) |
196 | 196 | { |
197 | 197 | /* remove this callback */ |
198 | machine().device("z80ne")->memory().space(AS_PROGRAM) | |
198 | machine().device("z80ne")->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(z80ne_state::z80ne_default), this)); | |
199 | 199 | /* and switch to RAM bank at address 0x0000 */ |
200 | 200 | membank( "bank1" )->set_entry( 0 ); /* RAM at 0x0000 (bank 1) */ |
201 | 201 | } |
r18027 | r18028 | |
213 | 213 | static void reset_lx382_banking(running_machine &machine) |
214 | 214 | { |
215 | 215 | z80ne_state *state = machine.driver_data<z80ne_state>(); |
216 | address_space &space = | |
216 | address_space &space = machine.device("z80ne")->memory().space(AS_PROGRAM); | |
217 | 217 | |
218 | 218 | /* switch to ROM bank at address 0x0000 */ |
219 | 219 | state->membank("bank1")->set_entry(1); |
r18027 | r18028 | |
227 | 227 | static void reset_lx390_banking(running_machine &machine) |
228 | 228 | { |
229 | 229 | z80ne_state *state = machine.driver_data<z80ne_state>(); |
230 | address_space &space = | |
230 | address_space &space = machine.device("z80ne")->memory().space(AS_PROGRAM); | |
231 | 231 | state->m_reset_delay_counter = 0; |
232 | 232 | |
233 | 233 | switch (machine.root_device().ioport("CONFIG")->read() & 0x07) { |
r18027 | r18028 | |
249 | 249 | state->membank("bank2")->set_entry(1); /* ep548 at 0x0400-0x3FFF */ |
250 | 250 | state->membank("bank3")->set_entry(0); /* RAM at 0x8000 */ |
251 | 251 | state->membank("bank4")->set_entry(0); /* RAM at 0xF000 */ |
252 | machine.device("z80ne")->memory().space(AS_PROGRAM) | |
252 | machine.device("z80ne")->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(z80ne_state::z80ne_default), state)); | |
253 | 253 | break; |
254 | 254 | case 0x03: /* EP390 Boot Loader for 5.5k floppy BASIC */ |
255 | 255 | if (VERBOSE) |
r18027 | r18028 | |
258 | 258 | state->membank("bank2")->set_entry(0); /* RAM at 0x0400-0x3FFF */ |
259 | 259 | state->membank("bank3")->set_entry(0); /* RAM at 0x8000 */ |
260 | 260 | state->membank("bank4")->set_entry(1); /* ep390 at 0xF000 */ |
261 | machine.device("z80ne")->memory().space(AS_PROGRAM) | |
261 | machine.device("z80ne")->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(z80ne_state::z80ne_default), state)); | |
262 | 262 | break; |
263 | 263 | case 0x04: /* EP1390 Boot Loader for NE DOS 1.0/1.5 */ |
264 | 264 | if (VERBOSE) |
r18027 | r18028 | |
267 | 267 | state->membank("bank2")->set_entry(0); /* RAM at 0x0400-0x3FFF */ |
268 | 268 | state->membank("bank3")->set_entry(0); /* RAM at 0x8000 */ |
269 | 269 | state->membank("bank4")->set_entry(2); /* ep1390 at 0xF000 */ |
270 | machine.device("z80ne")->memory().space(AS_PROGRAM) | |
270 | machine.device("z80ne")->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(z80ne_state::z80ne_default), state)); | |
271 | 271 | break; |
272 | 272 | case 0x05: /* EP2390 Boot Loader for NE DOS G.1 */ |
273 | 273 | if (VERBOSE) |
r18027 | r18028 | |
276 | 276 | state->membank("bank2")->set_entry(0); /* RAM at 0x0400-0x3FFF */ |
277 | 277 | state->membank("bank3")->set_entry(0); /* RAM at 0x8000 */ |
278 | 278 | state->membank("bank4")->set_entry(3); /* ep2390 at 0xF000 */ |
279 | machine.device("z80ne")->memory().space(AS_PROGRAM) | |
279 | machine.device("z80ne")->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(z80ne_state::z80ne_default), state)); | |
280 | 280 | break; |
281 | 281 | } |
282 | 282 | |
r18027 | r18028 | |
288 | 288 | MACHINE_RESET_MEMBER(z80ne_state,z80ne_base) |
289 | 289 | { |
290 | 290 | int i; |
291 | address_space &space = | |
291 | address_space &space = machine().device("z80ne")->memory().space(AS_PROGRAM); | |
292 | 292 | |
293 | 293 | LOG(("In MACHINE_RESET z80ne_base\n")); |
294 | 294 | |
r18027 | r18028 | |
480 | 480 | else |
481 | 481 | /* after writing to port 0xF8 and the first ~M1 cycles strike a NMI for single step execution */ |
482 | 482 | m_nmi_delay_counter = 1; |
483 | machine().device("z80ne")->memory().space(AS_PROGRAM) | |
483 | machine().device("z80ne")->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(z80ne_state::z80ne_nmi_delay_count), this)); | |
484 | 484 | } |
485 | 485 | |
486 | 486 |
r18027 | r18028 | |
---|---|---|
1554 | 1554 | } |
1555 | 1555 | else if ((address & 0x000F00) == 0x000000) // accessing C0xx? |
1556 | 1556 | { |
1557 | result = state->apple2gs_c0xx_r( | |
1557 | result = state->apple2gs_c0xx_r(machine.device("maincpu")->memory().space(AS_PROGRAM), address, 0); | |
1558 | 1558 | } |
1559 | 1559 | else |
1560 | 1560 | { |
r18027 | r18028 | |
1646 | 1646 | } |
1647 | 1647 | else if ((address & 0x000F00) == 0x000000) |
1648 | 1648 | { |
1649 | state->apple2gs_c0xx_w( | |
1649 | state->apple2gs_c0xx_w(machine.device("maincpu")->memory().space(AS_PROGRAM), address, data, 0); | |
1650 | 1650 | } |
1651 | 1651 | else |
1652 | 1652 | { |
r18027 | r18028 | |
1796 | 1796 | static void apple2gs_setup_memory(running_machine &machine) |
1797 | 1797 | { |
1798 | 1798 | apple2gs_state *state = machine.driver_data<apple2gs_state>(); |
1799 | address_space& space = | |
1799 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1800 | 1800 | offs_t begin, end; |
1801 | 1801 | apple2_memmap_config cfg; |
1802 | 1802 |
r18027 | r18028 | |
---|---|---|
94 | 94 | |
95 | 95 | if (m_bank_base > 0) |
96 | 96 | { |
97 | address_space &space = | |
97 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
98 | 98 | |
99 | 99 | /* first clear everything out */ |
100 | 100 | space.nop_read(0x00000000, 0x3FFFFFFF); |
r18027 | r18028 | |
---|---|---|
93 | 93 | |
94 | 94 | void iq151_staper_device::io_read(offs_t offset, UINT8 &data) |
95 | 95 | { |
96 | address_space& space = | |
96 | address_space& space = machine().device("maincpu")->memory().space(AS_IO); | |
97 | 97 | |
98 | 98 | if (offset >= 0xf8 && offset < 0xfc) |
99 | 99 | data = m_ppi->read(space, offset & 0x03); |
r18027 | r18028 | |
105 | 105 | |
106 | 106 | void iq151_staper_device::io_write(offs_t offset, UINT8 data) |
107 | 107 | { |
108 | address_space& space = | |
108 | address_space& space = machine().device("maincpu")->memory().space(AS_IO); | |
109 | 109 | |
110 | 110 | if (offset >= 0xf8 && offset < 0xfc) |
111 | 111 | m_ppi->write(space, offset & 0x03, data); |
r18027 | r18028 | |
---|---|---|
306 | 306 | /* DMA */ |
307 | 307 | for (i=0; i<bytes_read; i+=2) |
308 | 308 | { |
309 | device->machine().device("maincpu")->memory().space(AS_PROGRAM) | |
309 | device->machine().device("maincpu")->memory().space(AS_PROGRAM).write_word(dma_address, (((int) buffer[i]) << 8) | buffer[i+1]); | |
310 | 310 | dma_address = (dma_address + 2) & 0x1ffffe; |
311 | 311 | } |
312 | 312 |
r18027 | r18028 | |
---|---|---|
36 | 36 | static void init_nes_core( running_machine &machine ) |
37 | 37 | { |
38 | 38 | nes_state *state = machine.driver_data<nes_state>(); |
39 | address_space &space = | |
39 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
40 | 40 | static const char *const bank_names[] = { "bank1", "bank2", "bank3", "bank4" }; |
41 | 41 | int prg_banks = (state->m_prg_chunks == 1) ? (2 * 2) : (state->m_prg_chunks * 2); |
42 | 42 | int i; |
r18027 | r18028 | |
48 | 48 | /* Brutal hack put in as a consequence of the new memory system; we really need to fix the NES code */ |
49 | 49 | space.install_readwrite_bank(0x0000, 0x07ff, 0, 0x1800, "bank10"); |
50 | 50 | |
51 | machine.device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0, 0x1fff, FUNC(nes_chr_r), FUNC(nes_chr_w)); | |
52 | machine.device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(nes_nt_r), FUNC(nes_nt_w)); | |
51 | machine.device("ppu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0, 0x1fff, FUNC(nes_chr_r), FUNC(nes_chr_w)); | |
52 | machine.device("ppu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(nes_nt_r), FUNC(nes_nt_w)); | |
53 | 53 | |
54 | 54 | state->membank("bank10")->set_base(state->m_rom); |
55 | 55 | |
r18027 | r18028 | |
193 | 193 | } |
194 | 194 | |
195 | 195 | if (state->m_pcb_id == WAIXING_SH2) |
196 | machine.device("ppu")->memory().space(AS_PROGRAM) | |
196 | machine.device("ppu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0, 0x1fff, FUNC(waixing_sh2_chr_r)); | |
197 | 197 | } |
198 | 198 | |
199 | 199 | // to be probably removed (it does nothing since a long time) |
r18027 | r18028 | |
---|---|---|
826 | 826 | ***************************************************************************/ |
827 | 827 | |
828 | 828 | static DEVICE_RESET( apollo_rtc ) { |
829 | address_space &space = | |
829 | address_space &space = device->machine().device(MAINCPU)->memory().space(AS_PROGRAM); | |
830 | 830 | apollo_state *state = device->machine().driver_data<apollo_state>(); |
831 | 831 | UINT8 year = state->apollo_rtc_r(space, 9); |
832 | 832 | |
r18027 | r18028 | |
872 | 872 | static TIMER_CALLBACK( apollo_rtc_timer ) |
873 | 873 | { |
874 | 874 | apollo_state *state = machine.driver_data<apollo_state>(); |
875 | address_space &space = | |
875 | address_space &space = machine.device(MAINCPU)->memory().space(AS_PROGRAM); | |
876 | 876 | |
877 | 877 | // FIXME: reading register 0x0c will clear all interrupt flags |
878 | 878 | if ((state->apollo_rtc_r(space, 0x0c) & 0x80)) |
r18027 | r18028 | |
---|---|---|
197 | 197 | */ |
198 | 198 | static WRITE8_DEVICE_HANDLER( sym1_via2_a_w ) |
199 | 199 | { |
200 | address_space | |
200 | address_space &cpu0space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM ); | |
201 | 201 | |
202 | 202 | logerror("SYM1 VIA2 W 0x%02x\n", data); |
203 | 203 | |
204 | 204 | if ((device->machine().root_device().ioport("WP")->read() & 0x01) && !(data & 0x01)) { |
205 | cpu0space | |
205 | cpu0space.nop_write(0xa600, 0xa67f); | |
206 | 206 | } else { |
207 | cpu0space | |
207 | cpu0space.install_write_bank(0xa600, 0xa67f, "bank5"); | |
208 | 208 | } |
209 | 209 | if ((device->machine().root_device().ioport("WP")->read() & 0x02) && !(data & 0x02)) { |
210 | cpu0space | |
210 | cpu0space.nop_write(0x0400, 0x07ff); | |
211 | 211 | } else { |
212 | cpu0space | |
212 | cpu0space.install_write_bank(0x0400, 0x07ff, "bank2"); | |
213 | 213 | } |
214 | 214 | if ((device->machine().root_device().ioport("WP")->read() & 0x04) && !(data & 0x04)) { |
215 | cpu0space | |
215 | cpu0space.nop_write(0x0800, 0x0bff); | |
216 | 216 | } else { |
217 | cpu0space | |
217 | cpu0space.install_write_bank(0x0800, 0x0bff, "bank3"); | |
218 | 218 | } |
219 | 219 | if ((device->machine().root_device().ioport("WP")->read() & 0x08) && !(data & 0x08)) { |
220 | cpu0space | |
220 | cpu0space.nop_write(0x0c00, 0x0fff); | |
221 | 221 | } else { |
222 | cpu0space | |
222 | cpu0space.install_write_bank(0x0c00, 0x0fff, "bank4"); | |
223 | 223 | } |
224 | 224 | } |
225 | 225 | |
r18027 | r18028 | |
289 | 289 | /* wipe expansion memory banks that are not installed */ |
290 | 290 | if (machine().device<ram_device>(RAM_TAG)->size() < 4*1024) |
291 | 291 | { |
292 | machine().device( "maincpu")->memory().space( AS_PROGRAM ) | |
292 | machine().device( "maincpu")->memory().space( AS_PROGRAM ).nop_readwrite( | |
293 | 293 | machine().device<ram_device>(RAM_TAG)->size(), 0x0fff); |
294 | 294 | } |
295 | 295 | |
r18027 | r18028 | |
302 | 302 | { |
303 | 303 | /* make 0xf800 to 0xffff point to the last half of the monitor ROM |
304 | 304 | so that the CPU can find its reset vectors */ |
305 | machine().device( "maincpu")->memory().space( AS_PROGRAM )->install_read_bank(0xf800, 0xffff, "bank1"); | |
306 | machine().device( "maincpu")->memory().space( AS_PROGRAM )->nop_write(0xf800, 0xffff); | |
305 | machine().device( "maincpu")->memory().space( AS_PROGRAM ).install_read_bank(0xf800, 0xffff, "bank1"); | |
306 | machine().device( "maincpu")->memory().space( AS_PROGRAM ).nop_write(0xf800, 0xffff); | |
307 | 307 | membank("bank1")->set_base(m_monitor + 0x800); |
308 | 308 | machine().device("maincpu")->reset(); |
309 | 309 | } |
r18027 | r18028 | |
---|---|---|
42 | 42 | ondra_state *state = machine.driver_data<ondra_state>(); |
43 | 43 | UINT8 *mem = state->memregion("maincpu")->base(); |
44 | 44 | if (state->m_bank1_status==0) { |
45 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
45 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x0000, 0x3fff); | |
46 | 46 | state->membank("bank1")->set_base(mem + 0x010000); |
47 | 47 | } else { |
48 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
48 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(0x0000, 0x3fff, "bank1"); | |
49 | 49 | state->membank("bank1")->set_base(machine.device<ram_device>(RAM_TAG)->pointer() + 0x0000); |
50 | 50 | } |
51 | 51 | state->membank("bank2")->set_base(machine.device<ram_device>(RAM_TAG)->pointer() + 0x4000); |
52 | 52 | if (state->m_bank2_status==0) { |
53 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
53 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank(0xe000, 0xffff, "bank3"); | |
54 | 54 | state->membank("bank3")->set_base(machine.device<ram_device>(RAM_TAG)->pointer() + 0xe000); |
55 | 55 | } else { |
56 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0xe000, 0xffff); | |
57 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler (0xe000, 0xffff, read8_delegate(FUNC(ondra_state::ondra_keyboard_r),state)); | |
56 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xe000, 0xffff); | |
57 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler (0xe000, 0xffff, read8_delegate(FUNC(ondra_state::ondra_keyboard_r),state)); | |
58 | 58 | } |
59 | 59 | } |
60 | 60 |
r18027 | r18028 | |
---|---|---|
42 | 42 | d0 drive A */ |
43 | 43 | |
44 | 44 | /* get address space */ |
45 | address_space | |
45 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
46 | 46 | |
47 | 47 | if (data & 0x80) |
48 | 48 | { |
49 | mem->unmap_readwrite (0x0000, 0x3fff); | |
50 | mem->install_read_bank (0x0000, 0x0fff, "bank1"); | |
49 | mem.unmap_readwrite (0x0000, 0x3fff); | |
50 | mem.install_read_bank (0x0000, 0x0fff, "bank1"); | |
51 | 51 | membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base()); |
52 | mem | |
52 | mem.install_readwrite_handler (0x3000, 0x3fff, read8_delegate(FUNC(kaypro_state::kaypro_videoram_r), this), write8_delegate(FUNC(kaypro_state::kaypro_videoram_w), this)); | |
53 | 53 | } |
54 | 54 | else |
55 | 55 | { |
56 | mem->unmap_readwrite(0x0000, 0x3fff); | |
57 | mem->install_read_bank (0x0000, 0x3fff, "bank2"); | |
58 | mem->install_write_bank (0x0000, 0x3fff, "bank3"); | |
56 | mem.unmap_readwrite(0x0000, 0x3fff); | |
57 | mem.install_read_bank (0x0000, 0x3fff, "bank2"); | |
58 | mem.install_write_bank (0x0000, 0x3fff, "bank3"); | |
59 | 59 | membank("bank2")->set_base(machine().root_device().memregion("rambank")->base()); |
60 | 60 | membank("bank3")->set_base(machine().root_device().memregion("rambank")->base()); |
61 | 61 | } |
r18027 | r18028 | |
155 | 155 | d0 drive A */ |
156 | 156 | |
157 | 157 | /* get address space */ |
158 | address_space | |
158 | address_space &mem = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
159 | 159 | |
160 | 160 | if (BIT(data, 7)) |
161 | 161 | { |
162 | mem->unmap_readwrite (0x0000, 0x3fff); | |
163 | mem->install_read_bank (0x0000, 0x1fff, "bank1"); | |
164 | membank("bank1")->set_base(mem->machine().root_device().memregion("maincpu")->base()); | |
162 | mem.unmap_readwrite (0x0000, 0x3fff); | |
163 | mem.install_read_bank (0x0000, 0x1fff, "bank1"); | |
164 | membank("bank1")->set_base(mem.machine().root_device().memregion("maincpu")->base()); | |
165 | 165 | } |
166 | 166 | else |
167 | 167 | { |
168 | mem->unmap_readwrite (0x0000, 0x3fff); | |
169 | mem->install_read_bank (0x0000, 0x3fff, "bank2"); | |
170 | mem->install_write_bank (0x0000, 0x3fff, "bank3"); | |
171 | membank("bank2")->set_base(mem->machine().root_device().memregion("rambank")->base()); | |
172 | membank("bank3")->set_base(mem->machine().root_device().memregion("rambank")->base()); | |
168 | mem.unmap_readwrite (0x0000, 0x3fff); | |
169 | mem.install_read_bank (0x0000, 0x3fff, "bank2"); | |
170 | mem.install_write_bank (0x0000, 0x3fff, "bank3"); | |
171 | membank("bank2")->set_base(mem.machine().root_device().memregion("rambank")->base()); | |
172 | membank("bank3")->set_base(mem.machine().root_device().memregion("rambank")->base()); | |
173 | 173 | } |
174 | 174 | |
175 | 175 | wd17xx_dden_w(m_fdc, BIT(data, 5)); |
r18027 | r18028 | |
327 | 327 | |
328 | 328 | MACHINE_RESET_MEMBER(kaypro_state,kaypro2x) |
329 | 329 | { |
330 | address_space &space = | |
330 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
331 | 331 | kaypro2x_system_port_w(space, 0, 0x80); |
332 | 332 | MACHINE_RESET_CALL_MEMBER(kay_kbd); |
333 | 333 | } |
r18027 | r18028 | |
346 | 346 | QUICKLOAD_LOAD( kayproii ) |
347 | 347 | { |
348 | 348 | kaypro_state *state = image.device().machine().driver_data<kaypro_state>(); |
349 | address_space &space = | |
349 | address_space &space = state->m_maincpu->space(AS_PROGRAM); | |
350 | 350 | UINT8 *RAM = state->memregion("rambank")->base(); |
351 | 351 | UINT16 i; |
352 | 352 | UINT8 data; |
r18027 | r18028 | |
369 | 369 | QUICKLOAD_LOAD( kaypro2x ) |
370 | 370 | { |
371 | 371 | kaypro_state *state = image.device().machine().driver_data<kaypro_state>(); |
372 | address_space &space = | |
372 | address_space &space = state->m_maincpu->space(AS_PROGRAM); | |
373 | 373 | UINT8 *RAM = state->memregion("rambank")->base(); |
374 | 374 | UINT16 i; |
375 | 375 | UINT8 data; |
r18027 | r18028 | |
---|---|---|
137 | 137 | { |
138 | 138 | pc_lpt_state *lpt = get_safe_token(device); |
139 | 139 | // pull up mechanism for input lines, zeros are provided by pheripherial |
140 | return lpt->data & ~lpt->centronics->read( | |
140 | return lpt->data & ~lpt->centronics->read(device->machine().driver_data()->generic_space(), 0); | |
141 | 141 | } |
142 | 142 | |
143 | 143 | |
r18027 | r18028 | |
145 | 145 | { |
146 | 146 | pc_lpt_state *lpt = get_safe_token(device); |
147 | 147 | lpt->data = data; |
148 | lpt->centronics->write( | |
148 | lpt->centronics->write(device->machine().driver_data()->generic_space(), 0, data); | |
149 | 149 | } |
150 | 150 | |
151 | 151 |
r18027 | r18028 | |
---|---|---|
2001 | 2001 | DEVICE_START( s3c44b0 ) |
2002 | 2002 | { |
2003 | 2003 | running_machine &machine = device->machine(); |
2004 | address_space &space = | |
2004 | address_space &space = machine.device( "maincpu")->memory().space( AS_PROGRAM); | |
2005 | 2005 | s3c44b0_t *s3c44b0 = get_token( device); |
2006 | 2006 | s3c44b0->iface = (const s3c44b0_interface *)device->static_config(); |
2007 | 2007 | s3c44b0->space = &space; |
r18027 | r18028 | |
---|---|---|
153 | 153 | |
154 | 154 | // install $FF7F handler |
155 | 155 | write8_delegate wh = write8_delegate(FUNC(coco_multipak_device::ff7f_write), this); |
156 | machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM) | |
156 | machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM).install_write_handler(0xFF7F, 0xFF7F, wh); | |
157 | 157 | |
158 | 158 | // initial state |
159 | 159 | m_select = 0xFF; |
r18027 | r18028 | |
---|---|---|
125 | 125 | static void partner_iomap_bank(running_machine &machine,UINT8 *rom) |
126 | 126 | { |
127 | 127 | partner_state *state = machine.driver_data<partner_state>(); |
128 | address_space &space = | |
128 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
129 | 129 | switch(state->m_win_mem_page) { |
130 | 130 | case 2 : |
131 | 131 | // FDD |
r18027 | r18028 | |
143 | 143 | static void partner_bank_switch(running_machine &machine) |
144 | 144 | { |
145 | 145 | partner_state *state = machine.driver_data<partner_state>(); |
146 | address_space &space = | |
146 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
147 | 147 | UINT8 *rom = state->memregion("maincpu")->base(); |
148 | 148 | UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer(); |
149 | 149 |
r18027 | r18028 | |
---|---|---|
201 | 201 | result = state->m_crossproc_interrupts; |
202 | 202 | |
203 | 203 | /* return a different result depending on which CPU is accessing this handler */ |
204 | if (&space != space.machine().device("ppc1")->memory().space(AS_PROGRAM)) | |
204 | if (&space != &space.machine().device("ppc1")->memory().space(AS_PROGRAM)) | |
205 | 205 | result |= 0x02000000; |
206 | 206 | else |
207 | 207 | result &= ~0x02000000; |
r18027 | r18028 | |
955 | 955 | /* brutal ugly hack; at some point the PCI code should be handling this stuff */ |
956 | 956 | if (state->m_scsi53c810_data[5] != 0xFFFFFFF0) |
957 | 957 | { |
958 | address_space &space = | |
958 | address_space &space = device->machine().device("ppc1")->memory().space(AS_PROGRAM); | |
959 | 959 | |
960 | 960 | addr = (state->m_scsi53c810_data[5] | 0xC0000000) & ~0xFF; |
961 | 961 | space.install_legacy_read_handler(addr, addr + 0xFF, FUNC(scsi53c810_r)); |
r18027 | r18028 | |
995 | 995 | machine().device("ppc1")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE); |
996 | 996 | machine().device("ppc2")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); |
997 | 997 | |
998 | memcpy(machine().device<fujitsu_29f016a_device>("flash")->space() | |
998 | memcpy(machine().device<fujitsu_29f016a_device>("flash")->space().get_read_ptr(0),memregion("user1")->base(),0x200000); | |
999 | 999 | } |
1000 | 1000 | |
1001 | 1001 | void bebox_state::machine_start() |
r18027 | r18028 | |
1005 | 1005 | |
1006 | 1006 | DRIVER_INIT_MEMBER(bebox_state,bebox) |
1007 | 1007 | { |
1008 | address_space *space_0 = machine().device("ppc1")->memory().space(AS_PROGRAM); | |
1009 | address_space *space_1 = machine().device("ppc2")->memory().space(AS_PROGRAM); | |
1008 | address_space &space_0 = machine().device("ppc1")->memory().space(AS_PROGRAM); | |
1009 | address_space &space_1 = machine().device("ppc2")->memory().space(AS_PROGRAM); | |
1010 | 1010 | offs_t vram_begin; |
1011 | 1011 | offs_t vram_end; |
1012 | 1012 | |
r18027 | r18028 | |
1014 | 1014 | membank("bank2")->set_base(machine().root_device().memregion("user2")->base()); |
1015 | 1015 | |
1016 | 1016 | /* install MESS managed RAM */ |
1017 | space_0->install_readwrite_bank(0, machine().device<ram_device>(RAM_TAG)->size() - 1, 0, 0x02000000, "bank3"); | |
1018 | space_1->install_readwrite_bank(0, machine().device<ram_device>(RAM_TAG)->size() - 1, 0, 0x02000000, "bank3"); | |
1017 | space_0.install_readwrite_bank(0, machine().device<ram_device>(RAM_TAG)->size() - 1, 0, 0x02000000, "bank3"); | |
1018 | space_1.install_readwrite_bank(0, machine().device<ram_device>(RAM_TAG)->size() - 1, 0, 0x02000000, "bank3"); | |
1019 | 1019 | membank("bank3")->set_base(machine().device<ram_device>(RAM_TAG)->pointer()); |
1020 | 1020 | |
1021 | 1021 | kbdc8042_init(machine(), &bebox_8042_interface); |
r18027 | r18028 | |
1023 | 1023 | /* install VGA memory */ |
1024 | 1024 | vram_begin = 0xC1000000; |
1025 | 1025 | vram_end = vram_begin + pc_vga_memory_size() - 1; |
1026 | space_0->install_legacy_readwrite_handler(vram_begin, vram_end, FUNC(bebox_video_r), FUNC(bebox_video_w)); | |
1027 | space_1->install_legacy_readwrite_handler(vram_begin, vram_end, FUNC(bebox_video_r), FUNC(bebox_video_w)); | |
1026 | space_0.install_legacy_readwrite_handler(vram_begin, vram_end, FUNC(bebox_video_r), FUNC(bebox_video_w)); | |
1027 | space_1.install_legacy_readwrite_handler(vram_begin, vram_end, FUNC(bebox_video_r), FUNC(bebox_video_w)); | |
1028 | 1028 | |
1029 | 1029 | /* The following is a verrrry ugly hack put in to support NetBSD for |
1030 | 1030 | * NetBSD. When NetBSD/bebox it does most of its work on CPU #0 and then |
r18027 | r18028 | |
1044 | 1044 | /* bcctr 0x14, 0 */ |
1045 | 1045 | U64(0x4E80042000000000) |
1046 | 1046 | }; |
1047 | space_1 | |
1047 | space_1.install_read_bank(0x9421FFF0, 0x9421FFFF, "bank1"); | |
1048 | 1048 | membank("bank1")->set_base(ops); |
1049 | 1049 | } |
1050 | 1050 | } |
r18027 | r18028 | |
---|---|---|
410 | 410 | |
411 | 411 | UINT8 *memory = image.device().machine().root_device().memregion("maincpu")->base(); |
412 | 412 | intv_state *state = image.device().machine().driver_data<intv_state>(); |
413 | address_space | |
413 | address_space &program = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM); | |
414 | 414 | const char *filetype = image.filetype(); |
415 | 415 | |
416 | 416 | /* if it is in .rom format, we enter here */ |
r18027 | r18028 | |
504 | 504 | start = (( ram & 0xf0 ) >> 4) * 0x1000; |
505 | 505 | size = ( ram & 0x0f ) * 0x800; |
506 | 506 | |
507 | program | |
507 | program.install_readwrite_handler(start, start + size, | |
508 | 508 | read16_delegate( FUNC( intv_state::intv_cart_ram8_r ), state), |
509 | 509 | write16_delegate( FUNC( intv_state::intv_cart_ram8_w ), state)); |
510 | 510 | } |
r18027 | r18028 | |
556 | 556 | const char* region_name[] = {"4800", "5000", "6000", "7000", "9000", "A000", "C000", "D000", "F000"}; |
557 | 557 | UINT8 *memory = image.device().machine().root_device().memregion("maincpu")->base(); |
558 | 558 | intv_state *state = image.device().machine().driver_data<intv_state>(); |
559 | address_space | |
559 | address_space &program = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM); | |
560 | 560 | |
561 | 561 | UINT32 size=0; |
562 | 562 | UINT16 address = 0; |
r18027 | r18028 | |
593 | 593 | size = image.get_software_region_length("D000_RAM8"); |
594 | 594 | if (size) |
595 | 595 | { |
596 | program | |
596 | program.install_readwrite_handler(0xD000, 0xD000 + size, | |
597 | 597 | read16_delegate( FUNC( intv_state::intv_cart_ram8_r ), state), |
598 | 598 | write16_delegate( FUNC( intv_state::intv_cart_ram8_w ), state)); |
599 | 599 | } |
r18027 | r18028 | |
601 | 601 | size = image.get_software_region_length("8800_RAM8"); |
602 | 602 | if (size) |
603 | 603 | { |
604 | program | |
604 | program.install_readwrite_handler(0x8800, 0x8800 + size, | |
605 | 605 | read16_delegate( FUNC( intv_state::intv_cart_ram8_r ), state), |
606 | 606 | write16_delegate( FUNC( intv_state::intv_cart_ram8_w ), state)); |
607 | 607 | } |
r18027 | r18028 | |
---|---|---|
146 | 146 | switch(buswidth) |
147 | 147 | { |
148 | 148 | case 32: |
149 | m_maincpu->space(AS_PROGRAM) | |
149 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, mask); | |
150 | 150 | break; |
151 | 151 | case 64: |
152 | m_maincpu->space(AS_PROGRAM) | |
152 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, ((UINT64)mask<<32)|mask); | |
153 | 153 | break; |
154 | 154 | default: |
155 | 155 | fatalerror("NUBUS: Bus width %d not supported\n", buswidth); |
r18027 | r18028 | |
164 | 164 | switch(buswidth) |
165 | 165 | { |
166 | 166 | case 32: |
167 | m_maincpu->space(AS_PROGRAM) | |
167 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, mask); | |
168 | 168 | break; |
169 | 169 | case 64: |
170 | m_maincpu->space(AS_PROGRAM) | |
170 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, ((UINT64)mask<<32)|mask); | |
171 | 171 | break; |
172 | 172 | default: |
173 | 173 | fatalerror("NUBUS: Bus width %d not supported\n", buswidth); |
r18027 | r18028 | |
182 | 182 | switch(buswidth) |
183 | 183 | { |
184 | 184 | case 32: |
185 | m_maincpu->space(AS_PROGRAM) | |
185 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, mask); | |
186 | 186 | break; |
187 | 187 | case 64: |
188 | m_maincpu->space(AS_PROGRAM) | |
188 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, ((UINT64)mask<<32)|mask); | |
189 | 189 | break; |
190 | 190 | default: |
191 | 191 | fatalerror("NUBUS: Bus width %d not supported\n", buswidth); |
r18027 | r18028 | |
200 | 200 | switch(buswidth) |
201 | 201 | { |
202 | 202 | case 32: |
203 | m_maincpu->space(AS_PROGRAM) | |
203 | m_maincpu->space(AS_PROGRAM).install_read_handler(start, end, rhandler, mask); | |
204 | 204 | break; |
205 | 205 | case 64: |
206 | m_maincpu->space(AS_PROGRAM) | |
206 | m_maincpu->space(AS_PROGRAM).install_read_handler(start, end, rhandler, ((UINT64)mask<<32)|mask); | |
207 | 207 | break; |
208 | 208 | default: |
209 | 209 | fatalerror("NUBUS: Bus width %d not supported\n", buswidth); |
r18027 | r18028 | |
218 | 218 | switch(buswidth) |
219 | 219 | { |
220 | 220 | case 32: |
221 | m_maincpu->space(AS_PROGRAM) | |
221 | m_maincpu->space(AS_PROGRAM).install_write_handler(start, end, whandler, mask); | |
222 | 222 | break; |
223 | 223 | case 64: |
224 | m_maincpu->space(AS_PROGRAM) | |
224 | m_maincpu->space(AS_PROGRAM).install_write_handler(start, end, whandler, ((UINT64)mask<<32)|mask); | |
225 | 225 | break; |
226 | 226 | default: |
227 | 227 | fatalerror("NUBUS: Bus width %d not supported\n", buswidth); |
r18027 | r18028 | |
233 | 233 | { |
234 | 234 | // printf("install_bank: %s @ %x->%x mask %x mirror %x\n", tag, start, end, mask, mirror); |
235 | 235 | m_maincpu = machine().device<cpu_device>(m_cputag); |
236 | address_space &space = | |
236 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
237 | 237 | space.install_readwrite_bank(start, end, mask, mirror, tag ); |
238 | 238 | machine().root_device().membank(tag)->set_base(data); |
239 | 239 | } |
r18027 | r18028 | |
---|---|---|
72 | 72 | static READ8_HANDLER( tf20_rom_disable ) |
73 | 73 | { |
74 | 74 | tf20_state *tf20 = get_safe_token(space.device().owner()); |
75 | address_space | |
75 | address_space &prg = space.device().memory().space(AS_PROGRAM); | |
76 | 76 | |
77 | 77 | /* switch in ram */ |
78 | prg | |
78 | prg.install_ram(0x0000, 0x7fff, tf20->ram->pointer()); | |
79 | 79 | |
80 | 80 | return 0xff; |
81 | 81 | } |
r18027 | r18028 | |
327 | 327 | { |
328 | 328 | tf20_state *tf20 = get_safe_token(device); |
329 | 329 | device_t *cpu = device->subdevice("tf20"); |
330 | address_space | |
330 | address_space &prg = cpu->memory().space(AS_PROGRAM); | |
331 | 331 | |
332 | 332 | cpu->execute().set_irq_acknowledge_callback(tf20_irq_ack); |
333 | 333 | |
r18027 | r18028 | |
345 | 345 | tf20->floppy_1 = device->subdevice(FLOPPY_1); |
346 | 346 | |
347 | 347 | /* enable second half of ram */ |
348 | prg | |
348 | prg.install_ram(0x8000, 0xffff, tf20->ram->pointer() + 0x8000); | |
349 | 349 | } |
350 | 350 | |
351 | 351 | static DEVICE_RESET( tf20 ) |
352 | 352 | { |
353 | 353 | device_t *cpu = device->subdevice("tf20"); |
354 | address_space | |
354 | address_space &prg = cpu->memory().space(AS_PROGRAM); | |
355 | 355 | |
356 | 356 | /* enable rom */ |
357 | prg | |
357 | prg.install_rom(0x0000, 0x07ff, 0, 0x7800, cpu->region()->base()); | |
358 | 358 | } |
359 | 359 | |
360 | 360 | const device_type TF20 = &device_creator<tf20_device>; |
r18027 | r18028 | |
---|---|---|
504 | 504 | static int snes_find_addon_chip( running_machine &machine ) |
505 | 505 | { |
506 | 506 | snes_state *state = machine.driver_data<snes_state>(); |
507 | address_space &space = | |
507 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
508 | 508 | int supported_type = 1; |
509 | 509 | int dsp_prg_offset = 0; |
510 | 510 | |
r18027 | r18028 | |
686 | 686 | static void snes_cart_log_info( running_machine &machine, int total_blocks, int supported ) |
687 | 687 | { |
688 | 688 | snes_state *state = machine.driver_data<snes_state>(); |
689 | address_space &space = | |
689 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
690 | 690 | char title[21], rom_id[4], company_id[2]; |
691 | 691 | int i, company, has_ram = 0, has_sram = 0; |
692 | 692 | |
r18027 | r18028 | |
763 | 763 | int supported_type = 1; |
764 | 764 | running_machine &machine = image.device().machine(); |
765 | 765 | snes_state *state = machine.driver_data<snes_state>(); |
766 | address_space &space = | |
766 | address_space &space = machine.device( "maincpu")->memory().space( AS_PROGRAM ); | |
767 | 767 | int total_blocks, read_blocks, has_bsx_slot = 0, st_bios = 0; |
768 | 768 | UINT32 offset, int_header_offs; |
769 | 769 | UINT8 *ROM = state->memregion("cart")->base(); |
r18027 | r18028 | |
---|---|---|
465 | 465 | state->membank("bank1")->set_base(state->m_roml); |
466 | 466 | state->membank("bank3")->set_base(state->m_memory + 0xa000); |
467 | 467 | state->membank("bank4")->set_base(state->m_romh); |
468 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
468 | machine.device("maincpu")->memory().space(AS_PROGRAM).nop_write(0xe000, 0xffff); | |
469 | 469 | } |
470 | 470 | else |
471 | 471 | { |
r18027 | r18028 | |
589 | 589 | if (!state->m_ultimax) |
590 | 590 | c64_bankswitch(device->machine(), 0); |
591 | 591 | |
592 | state->m_memory[0x000] = device->memory().space(AS_PROGRAM)->read_byte(0); | |
593 | state->m_memory[0x001] = device->memory().space(AS_PROGRAM)->read_byte(1); | |
592 | state->m_memory[0x000] = device->memory().space(AS_PROGRAM).read_byte(0); | |
593 | state->m_memory[0x001] = device->memory().space(AS_PROGRAM).read_byte(1); | |
594 | 594 | |
595 | 595 | } |
596 | 596 | |
r18027 | r18028 | |
1260 | 1260 | ***************************************************************************/ |
1261 | 1261 | |
1262 | 1262 | #define install_write_handler(_start, _end, _handler) \ |
1263 | image.device().machine().firstcpu->space(AS_PROGRAM) | |
1263 | image.device().machine().firstcpu->space(AS_PROGRAM).install_legacy_write_handler(_start, _end, FUNC(_handler)); | |
1264 | 1264 | |
1265 | 1265 | #define install_io1_handler(_handler) \ |
1266 | image.device().machine().firstcpu->space(AS_PROGRAM) | |
1266 | image.device().machine().firstcpu->space(AS_PROGRAM).install_legacy_write_handler(0xde00, 0xde00, 0, 0xff, FUNC(_handler)); | |
1267 | 1267 | |
1268 | 1268 | #define install_io2_handler(_handler) \ |
1269 | image.device().machine().firstcpu->space(AS_PROGRAM) | |
1269 | image.device().machine().firstcpu->space(AS_PROGRAM).install_legacy_write_handler(0xdf00, 0xdf00, 0, 0xff, FUNC(_handler)); | |
1270 | 1270 | |
1271 | 1271 | #define allocate_cartridge_timer(_period, _func) \ |
1272 | 1272 | legacy_c64_state *state = image.device().machine().driver_data<legacy_c64_state>(); \ |
r18027 | r18028 | |
1577 | 1577 | |
1578 | 1578 | map_cartridge_roml(image.device().machine(), 0x0000); |
1579 | 1579 | |
1580 | address_space &space = | |
1580 | address_space &space = image.device().machine().firstcpu->space(AS_PROGRAM); | |
1581 | 1581 | space.install_legacy_read_handler(0xdf00, 0xdfff, FUNC(super_explode_r)); |
1582 | 1582 | |
1583 | 1583 | install_io2_handler(super_explode_bank_w); |
r18027 | r18028 | |
1959 | 1959 | static void setup_c64_custom_mappers(running_machine &machine) |
1960 | 1960 | { |
1961 | 1961 | legacy_c64_state *state = machine.driver_data<legacy_c64_state>(); |
1962 | address_space &space = | |
1962 | address_space &space = machine.device( "maincpu")->memory().space( AS_PROGRAM ); | |
1963 | 1963 | |
1964 | 1964 | switch (state->m_cart.mapper) |
1965 | 1965 | { |
r18027 | r18028 | |
---|---|---|
237 | 237 | |
238 | 238 | static void dma_transfer_start(device_t* device, int channel, int dir) |
239 | 239 | { |
240 | address_space &space = | |
240 | address_space &space = device->machine().firstcpu->space(AS_PROGRAM); | |
241 | 241 | hd63450_t* dmac = get_safe_token(device); |
242 | 242 | dmac->in_progress[channel] = 1; |
243 | 243 | dmac->reg[channel].csr &= ~0xe0; |
r18027 | r18028 | |
314 | 314 | |
315 | 315 | void hd63450_single_transfer(device_t* device, int x) |
316 | 316 | { |
317 | address_space &space = | |
317 | address_space &space = device->machine().firstcpu->space(AS_PROGRAM); | |
318 | 318 | int data; |
319 | 319 | int datasize = 1; |
320 | 320 | hd63450_t* dmac = get_safe_token(device); |
r18027 | r18028 | |
---|---|---|
98 | 98 | WRITE8_MEMBER(pc_state::ec1841_memboard_w) |
99 | 99 | { |
100 | 100 | pc_state *st = space.machine().driver_data<pc_state>(); |
101 | address_space | |
101 | address_space &program = space.machine().device("maincpu")->memory().space(AS_PROGRAM); | |
102 | 102 | running_machine &machine = space.machine(); |
103 | 103 | UINT8 current; |
104 | 104 | |
r18027 | r18028 | |
114 | 114 | |
115 | 115 | if (BIT(current, 2) && !BIT(data, 2)) { |
116 | 116 | // disable read access |
117 | program | |
117 | program.unmap_read(0, 0x7ffff); | |
118 | 118 | DBG_LOG(1,"ec1841_memboard_w",("unmap_read(%d)\n", offset)); |
119 | 119 | } |
120 | 120 | |
121 | 121 | if (BIT(current, 3) && !BIT(data, 3)) { |
122 | 122 | // disable write access |
123 | program | |
123 | program.unmap_write(0, 0x7ffff); | |
124 | 124 | DBG_LOG(1,"ec1841_memboard_w",("unmap_write(%d)\n", offset)); |
125 | 125 | } |
126 | 126 | |
127 | 127 | if (!BIT(current, 2) && BIT(data, 2)) { |
128 | 128 | // enable read access |
129 | program | |
129 | program.install_read_bank(0, 0x7ffff, "bank10"); | |
130 | 130 | DBG_LOG(1,"ec1841_memboard_w",("map_read(%d)\n", offset)); |
131 | 131 | } |
132 | 132 | |
133 | 133 | if (!BIT(current, 3) && BIT(data, 3)) { |
134 | 134 | // enable write access |
135 | program | |
135 | program.install_write_bank(0, 0x7ffff, "bank10"); | |
136 | 136 | DBG_LOG(1,"ec1841_memboard_w",("map_write(%d)\n", offset)); |
137 | 137 | } |
138 | 138 | |
r18027 | r18028 | |
1409 | 1409 | |
1410 | 1410 | DRIVER_INIT_MEMBER(pc_state,pc1640) |
1411 | 1411 | { |
1412 | address_space | |
1412 | address_space &io_space = machine().firstcpu->space( AS_IO ); | |
1413 | 1413 | |
1414 | io_space->install_legacy_read_handler(0x278, 0x27b, FUNC(pc1640_port278_r), 0xffff); | |
1415 | io_space->install_legacy_read_handler(0x4278, 0x427b, FUNC(pc1640_port4278_r), 0xffff); | |
1414 | io_space.install_legacy_read_handler(0x278, 0x27b, FUNC(pc1640_port278_r), 0xffff); | |
1415 | io_space.install_legacy_read_handler(0x4278, 0x427b, FUNC(pc1640_port4278_r), 0xffff); | |
1416 | 1416 | |
1417 | 1417 | mess_init_pc_common(machine(), PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line); |
1418 | 1418 | } |
r18027 | r18028 | |
1422 | 1422 | mess_init_pc_common(machine(), PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line); |
1423 | 1423 | |
1424 | 1424 | pc_vga_init(machine(), ::input_port_0_r, NULL); |
1425 | pc_vga_io_init(machine(), | |
1425 | pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); | |
1426 | 1426 | } |
1427 | 1427 | |
1428 | 1428 | static IRQ_CALLBACK(pc_irq_callback) |
r18027 | r18028 | |
---|---|---|
27 | 27 | void pecom_state::machine_reset() |
28 | 28 | { |
29 | 29 | UINT8 *rom = machine().root_device().memregion(CDP1802_TAG)->base(); |
30 | address_space &space = | |
30 | address_space &space = machine().device(CDP1802_TAG)->memory().space(AS_PROGRAM); | |
31 | 31 | |
32 | 32 | |
33 | 33 | space.unmap_write(0x0000, 0x3fff); |
r18027 | r18028 | |
68 | 68 | |
69 | 69 | WRITE8_MEMBER(pecom_state::pecom_bank_w) |
70 | 70 | { |
71 | address_space | |
71 | address_space &space2 = machine().device(CDP1802_TAG)->memory().space(AS_PROGRAM); | |
72 | 72 | UINT8 *rom = memregion(CDP1802_TAG)->base(); |
73 | machine().device(CDP1802_TAG)->memory().space(AS_PROGRAM) | |
73 | machine().device(CDP1802_TAG)->memory().space(AS_PROGRAM).install_write_bank(0x0000, 0x3fff, "bank1"); | |
74 | 74 | membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0x0000); |
75 | 75 | |
76 | 76 | if (data==2) |
77 | 77 | { |
78 | space2->install_read_handler (0xf000, 0xf7ff, read8_delegate(FUNC(pecom_state::pecom_cdp1869_charram_r),this)); | |
79 | space2->install_write_handler(0xf000, 0xf7ff, write8_delegate(FUNC(pecom_state::pecom_cdp1869_charram_w),this)); | |
80 | space2->install_read_handler (0xf800, 0xffff, read8_delegate(FUNC(pecom_state::pecom_cdp1869_pageram_r),this)); | |
81 | space2->install_write_handler(0xf800, 0xffff, write8_delegate(FUNC(pecom_state::pecom_cdp1869_pageram_w),this)); | |
78 | space2.install_read_handler (0xf000, 0xf7ff, read8_delegate(FUNC(pecom_state::pecom_cdp1869_charram_r),this)); | |
79 | space2.install_write_handler(0xf000, 0xf7ff, write8_delegate(FUNC(pecom_state::pecom_cdp1869_charram_w),this)); | |
80 | space2.install_read_handler (0xf800, 0xffff, read8_delegate(FUNC(pecom_state::pecom_cdp1869_pageram_r),this)); | |
81 | space2.install_write_handler(0xf800, 0xffff, write8_delegate(FUNC(pecom_state::pecom_cdp1869_pageram_w),this)); | |
82 | 82 | } |
83 | 83 | else |
84 | 84 | { |
85 | space2->unmap_write(0xf000, 0xf7ff); | |
86 | space2->unmap_write(0xf800, 0xffff); | |
87 | space2->install_read_bank (0xf000, 0xf7ff, "bank3"); | |
88 | space2->install_read_bank (0xf800, 0xffff, "bank4"); | |
85 | space2.unmap_write(0xf000, 0xf7ff); | |
86 | space2.unmap_write(0xf800, 0xffff); | |
87 | space2.install_read_bank (0xf000, 0xf7ff, "bank3"); | |
88 | space2.install_read_bank (0xf800, 0xffff, "bank4"); | |
89 | 89 | membank("bank3")->set_base(rom + 0xf000); |
90 | 90 | membank("bank4")->set_base(rom + 0xf800); |
91 | 91 | } |
r18027 | r18028 | |
---|---|---|
70 | 70 | |
71 | 71 | UINT8* z88_1024k_flash_device::get_cart_base() |
72 | 72 | { |
73 | return (UINT8*)m_flash->space() | |
73 | return (UINT8*)m_flash->space().get_read_ptr(0); | |
74 | 74 | } |
75 | 75 | |
76 | 76 | /*------------------------------------------------- |
r18027 | r18028 | |
---|---|---|
220 | 220 | /* Check for Street fighter 2 */ |
221 | 221 | if (size == PCE_ROM_MAXSIZE) |
222 | 222 | { |
223 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM) | |
223 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x01ff0, 0x01ff3, write8_delegate(FUNC(pce_state::pce_sf2_banking_w),state)); | |
224 | 224 | } |
225 | 225 | |
226 | 226 | /* Check for Populous */ |
r18027 | r18028 | |
228 | 228 | { |
229 | 229 | state->m_cartridge_ram = auto_alloc_array(image.device().machine(), UINT8, 0x8000); |
230 | 230 | state->membank("bank2")->set_base(state->m_cartridge_ram); |
231 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM) | |
231 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x080000, 0x087FFF, write8_delegate(FUNC(pce_state::pce_cartridge_ram_w),state)); | |
232 | 232 | } |
233 | 233 | |
234 | 234 | /* Check for CD system card */ |
r18027 | r18028 | |
243 | 243 | { |
244 | 244 | state->m_cartridge_ram = auto_alloc_array(image.device().machine(), UINT8, 0x30000); |
245 | 245 | state->membank("bank4")->set_base(state->m_cartridge_ram); |
246 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x0D0000, 0x0FFFFF, write8_delegate(FUNC(pce_state::pce_cartridge_ram_w),state)); | |
247 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x080000, 0x087FFF, read8_delegate(FUNC(pce_state::pce_cd_acard_wram_r),state),write8_delegate(FUNC(pce_state::pce_cd_acard_wram_w),state)); | |
246 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x0D0000, 0x0FFFFF, write8_delegate(FUNC(pce_state::pce_cartridge_ram_w),state)); | |
247 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x080000, 0x087FFF, read8_delegate(FUNC(pce_state::pce_cd_acard_wram_r),state),write8_delegate(FUNC(pce_state::pce_cd_acard_wram_w),state)); | |
248 | 248 | } |
249 | 249 | } |
250 | 250 | return 0; |
r18027 | r18028 | |
---|---|---|
2074 | 2074 | { |
2075 | 2075 | m_mc6850_clock = 0; |
2076 | 2076 | |
2077 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2077 | machine().device("maincpu")->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(bbc_state::bbcbp_direct_handler), this)); | |
2078 | 2078 | |
2079 | 2079 | /* bank 6 is the paged ROMs from b000 to bfff */ |
2080 | 2080 | membank("bank6")->configure_entries(0, 16, memregion("user1")->base() + 0x3000, 1<<14); |
r18027 | r18028 | |
2100 | 2100 | { |
2101 | 2101 | m_mc6850_clock = 0; |
2102 | 2102 | |
2103 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2103 | machine().device("maincpu")->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(bbc_state::bbcm_direct_handler), this)); | |
2104 | 2104 | |
2105 | 2105 | /* bank 5 is the paged ROMs from 9000 to bfff */ |
2106 | 2106 | membank("bank5")->configure_entries(0, 16, machine().root_device().memregion("user1")->base()+0x01000, 1<<14); |
2107 | 2107 | |
2108 | 2108 | /* Set ROM/IO bank to point to rom */ |
2109 | 2109 | membank( "bank8" )->set_base( memregion("user1")->base()+0x43c00); |
2110 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2110 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xFC00, 0xFEFF, "bank8"); | |
2111 | 2111 | } |
2112 | 2112 | |
2113 | 2113 | MACHINE_RESET_MEMBER(bbc_state,bbcm) |
r18027 | r18028 | |
---|---|---|
251 | 251 | |
252 | 252 | UINT8 comx_clm_device::comx_mrd_r(offs_t offset, int *extrom) |
253 | 253 | { |
254 | address_space &space = | |
254 | address_space &space = machine().firstcpu->space(AS_PROGRAM); | |
255 | 255 | |
256 | 256 | UINT8 data = 0xff; |
257 | 257 | |
r18027 | r18028 | |
278 | 278 | |
279 | 279 | void comx_clm_device::comx_mwr_w(offs_t offset, UINT8 data) |
280 | 280 | { |
281 | address_space &space = | |
281 | address_space &space = machine().firstcpu->space(AS_PROGRAM); | |
282 | 282 | |
283 | 283 | if (offset >= 0xd000 && offset < 0xd800) |
284 | 284 | { |
r18027 | r18028 | |
---|---|---|
709 | 709 | { |
710 | 710 | int i; |
711 | 711 | int nce2_enable = 1; |
712 | address_space& space = | |
712 | address_space& space = state->machine().device("maincpu")->memory().space(AS_PROGRAM); | |
713 | 713 | |
714 | 714 | state->m_io_addr = 0x100000; |
715 | 715 |
r18027 | r18028 | |
---|---|---|
270 | 270 | PAIR pair, src, dst, len; |
271 | 271 | UINT8 cmd, fill; |
272 | 272 | int i; |
273 | address_space &space = | |
273 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
274 | 274 | |
275 | 275 | switch (offset & 3) |
276 | 276 | { |
r18027 | r18028 | |
793 | 793 | { |
794 | 794 | state->membank("bank8")->set_base(state->m_colorram + 0x400); |
795 | 795 | state->membank("bank9")->set_base(state->m_colorram + 0x400); |
796 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0dc00, 0x0dfff, "bank8"); | |
797 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0x0dc00, 0x0dfff, "bank9"); | |
796 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x0dc00, 0x0dfff, "bank8"); | |
797 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(0x0dc00, 0x0dfff, "bank9"); | |
798 | 798 | } |
799 | 799 | else |
800 | 800 | { |
801 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0dc00, 0x0dfff, FUNC(c65_read_io_dc00)); | |
802 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0dc00, 0x0dfff, FUNC(c65_write_io_dc00)); | |
801 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x0dc00, 0x0dfff, FUNC(c65_read_io_dc00)); | |
802 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x0dc00, 0x0dfff, FUNC(c65_write_io_dc00)); | |
803 | 803 | } |
804 | 804 | } |
805 | 805 | |
r18027 | r18028 | |
869 | 869 | |
870 | 870 | if (state->m_io_dc00_on) |
871 | 871 | { |
872 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0dc00, 0x0dfff, FUNC(c65_read_io_dc00)); | |
873 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0dc00, 0x0dfff, FUNC(c65_write_io_dc00)); | |
872 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x0dc00, 0x0dfff, FUNC(c65_read_io_dc00)); | |
873 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x0dc00, 0x0dfff, FUNC(c65_write_io_dc00)); | |
874 | 874 | } |
875 | 875 | else |
876 | 876 | { |
877 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0dc00, 0x0dfff, "bank8"); | |
878 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0x0dc00, 0x0dfff, "bank9"); | |
877 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x0dc00, 0x0dfff, "bank8"); | |
878 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(0x0dc00, 0x0dfff, "bank9"); | |
879 | 879 | state->membank("bank8")->set_base(state->m_colorram + 0x400); |
880 | 880 | state->membank("bank9")->set_base(state->m_colorram + 0x400); |
881 | 881 | } |
882 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0d000, 0x0d7ff, FUNC(c65_read_io)); | |
883 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0d000, 0x0d7ff, FUNC(c65_write_io)); | |
882 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x0d000, 0x0d7ff, FUNC(c65_read_io)); | |
883 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x0d000, 0x0d7ff, FUNC(c65_write_io)); | |
884 | 884 | } |
885 | 885 | else |
886 | 886 | { |
r18027 | r18028 | |
900 | 900 | state->membank("bank6")->set_base(state->m_memory + 0xd800); |
901 | 901 | state->membank("bank8")->set_base(state->m_memory + 0xdc00); |
902 | 902 | } |
903 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0d000, 0x0d7ff, "bank4"); | |
904 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0x0d000, 0x0d7ff, "bank5"); | |
903 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x0d000, 0x0d7ff, "bank4"); | |
904 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(0x0d000, 0x0d7ff, "bank5"); | |
905 | 905 | } |
906 | 906 | |
907 | 907 | if (!state->m_game && state->m_exrom) |
r18027 | r18028 | |
---|---|---|
107 | 107 | |
108 | 108 | WRITE8_MEMBER( rm380z_state::port_write_1b00 ) |
109 | 109 | { |
110 | address_space *program = m_maincpu->space(AS_PROGRAM); | |
111 | port_write(*program,offset+0xfc,data); | |
110 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
111 | port_write(program,offset+0xfc,data); | |
112 | 112 | } |
113 | 113 | |
114 | 114 | READ8_MEMBER( rm380z_state::port_read_1b00 ) |
115 | 115 | { |
116 | address_space *program = m_maincpu->space(AS_PROGRAM); | |
117 | return port_read(*program,offset+0xfc); | |
116 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
117 | return port_read(program,offset+0xfc); | |
118 | 118 | } |
119 | 119 | |
120 | 120 | READ8_MEMBER( rm380z_state::hiram_read ) |
r18027 | r18028 | |
282 | 282 | |
283 | 283 | void rm380z_state::config_memory_map() |
284 | 284 | { |
285 | address_space | |
285 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
286 | 286 | UINT8 *rom = memregion(RM380Z_MAINCPU_TAG)->base(); |
287 | 287 | UINT8* m_ram_p = m_messram->pointer(); |
288 | 288 | |
289 | 289 | if ( RM380Z_PORTS_ENABLED_HIGH ) |
290 | 290 | { |
291 | program | |
291 | program.install_ram( 0x0000, 0xDFFF, m_ram_p ); | |
292 | 292 | } |
293 | 293 | else |
294 | 294 | { |
295 | program->install_rom( 0x0000, 0x0FFF, rom ); | |
296 | program->install_readwrite_handler(0x1BFC, 0x1BFF,read8_delegate(FUNC(rm380z_state::port_read_1b00), this),write8_delegate(FUNC(rm380z_state::port_write_1b00), this) ); | |
297 | program->install_rom( 0x1C00, 0x1DFF, rom + 0x1400 ); | |
298 | program->install_ram( 0x4000, 0xDFFF, m_ram_p ); | |
295 | program.install_rom( 0x0000, 0x0FFF, rom ); | |
296 | program.install_readwrite_handler(0x1BFC, 0x1BFF,read8_delegate(FUNC(rm380z_state::port_read_1b00), this),write8_delegate(FUNC(rm380z_state::port_write_1b00), this) ); | |
297 | program.install_rom( 0x1C00, 0x1DFF, rom + 0x1400 ); | |
298 | program.install_ram( 0x4000, 0xDFFF, m_ram_p ); | |
299 | 299 | } |
300 | 300 | } |
r18027 | r18028 | |
---|---|---|
136 | 136 | case 0: /* RTC RAM */ |
137 | 137 | if (addr & 0x80) |
138 | 138 | /* RTC RAM page register */ |
139 | reply = m_rtc->xram_r( | |
139 | reply = m_rtc->xram_r(machine().driver_data()->generic_space(),(addr & 0x1f) | 0x20); | |
140 | 140 | else |
141 | 141 | /* RTC RAM read */ |
142 | reply = m_rtc->xram_r( | |
142 | reply = m_rtc->xram_r(machine().driver_data()->generic_space(),addr); | |
143 | 143 | break; |
144 | 144 | case 1: /* RTC registers */ |
145 | 145 | if (addr & 0x10) |
146 | 146 | /* register data */ |
147 | reply = m_rtc->rtc_r( | |
147 | reply = m_rtc->rtc_r(machine().driver_data()->generic_space(),1); | |
148 | 148 | else |
149 | 149 | /* register select */ |
150 | reply = m_rtc->rtc_r( | |
150 | reply = m_rtc->rtc_r(machine().driver_data()->generic_space(),0); | |
151 | 151 | break; |
152 | 152 | case 2: /* IDE registers set 1 (CS1Fx) */ |
153 | 153 | if (m_tms9995_mode ? (!(addr & 1)) : (addr & 1)) |
r18027 | r18028 | |
205 | 205 | case 0: /* RTC RAM */ |
206 | 206 | if (addr & 0x80) |
207 | 207 | /* RTC RAM page register */ |
208 | m_rtc->xram_w( | |
208 | m_rtc->xram_w(machine().driver_data()->generic_space(),(addr & 0x1f) | 0x20, data); | |
209 | 209 | else |
210 | 210 | /* RTC RAM write */ |
211 | m_rtc->xram_w( | |
211 | m_rtc->xram_w(machine().driver_data()->generic_space(),addr, data); | |
212 | 212 | break; |
213 | 213 | case 1: /* RTC registers */ |
214 | 214 | if (addr & 0x10) |
215 | 215 | /* register data */ |
216 | m_rtc->rtc_w( | |
216 | m_rtc->rtc_w(machine().driver_data()->generic_space(),1, data); | |
217 | 217 | else |
218 | 218 | /* register select */ |
219 | m_rtc->rtc_w( | |
219 | m_rtc->rtc_w(machine().driver_data()->generic_space(),0, data); | |
220 | 220 | break; |
221 | 221 | case 2: /* IDE registers set 1 (CS1Fx) */ |
222 | 222 | /* |
r18027 | r18028 | |
---|---|---|
254 | 254 | m_ready.resolve(conf->ready, *this); |
255 | 255 | |
256 | 256 | m_cpu = machine().device("maincpu"); |
257 | m_space = m_cpu->memory().space(AS_PROGRAM); | |
257 | m_space = &m_cpu->memory().space(AS_PROGRAM); | |
258 | 258 | |
259 | 259 | m_devices.reset(); // clear the list |
260 | 260 | m_use32k = (ioport("RAM")->read()==1); |
r18027 | r18028 | |
---|---|---|
1059 | 1059 | m_select_value = 0x74000; |
1060 | 1060 | } |
1061 | 1061 | |
1062 | m_space = machine().device("maincpu")->memory().space(AS_IO); | |
1062 | m_space = &machine().device("maincpu")->memory().space(AS_IO); | |
1063 | 1063 | m_selected = false; |
1064 | 1064 | |
1065 | 1065 | m_cru_base = (ioport("CRURS232")->read()==0)? 0x1300 : 0x1500; |
r18027 | r18028 | |
---|---|---|
236 | 236 | UINT8 byte; |
237 | 237 | |
238 | 238 | // set up the ability to read address spaces |
239 | address_space | |
239 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
240 | 240 | |
241 | 241 | // get the previous and current PC |
242 | 242 | UINT16 prev_pc = m_maincpu->pcbase(); |
243 | 243 | UINT16 pc = m_maincpu->pc(); |
244 | 244 | |
245 | 245 | // get the byte; and skip over header bytes |
246 | byte = program | |
246 | byte = program.read_byte(prev_pc); | |
247 | 247 | if ((byte == 0x10) || (byte == 0x11)) |
248 | byte = program | |
248 | byte = program.read_byte(++prev_pc); | |
249 | 249 | |
250 | 250 | // check to see if the opcode specifies the indexed addressing mode, and the secondary byte |
251 | 251 | // specifies no-offset |
252 | 252 | bool is_nooffset_indexed = (((byte & 0xF0) == 0x60) || ((byte & 0xF0) == 0xA0) || ((byte & 0xF0) == 0xE0)) |
253 | && ((program | |
253 | && ((program.read_byte(prev_pc + 1) & 0xBF) == 0x84); | |
254 | 254 | |
255 | 255 | // finally read the byte |
256 | return program | |
256 | return program.read_byte(is_nooffset_indexed ? pc : 0xFFFF); | |
257 | 257 | } |
258 | 258 | |
259 | 259 |
r18027 | r18028 | |
---|---|---|
119 | 119 | state->SIODATA = 0x00; |
120 | 120 | state->SIOCONT = 0x7E; |
121 | 121 | |
122 | state->gb_io_w( *machine.device("maincpu")->memory().space(AS_PROGRAM ), 0x05, 0x00 ); /* TIMECNT */ | |
123 | state->gb_io_w( *machine.device("maincpu")->memory().space(AS_PROGRAM ), 0x06, 0x00 ); /* TIMEMOD */ | |
122 | state->gb_io_w( machine.device("maincpu")->memory().space(AS_PROGRAM ), 0x05, 0x00 ); /* TIMECNT */ | |
123 | state->gb_io_w( machine.device("maincpu")->memory().space(AS_PROGRAM ), 0x06, 0x00 ); /* TIMEMOD */ | |
124 | 124 | } |
125 | 125 | |
126 | 126 | static void gb_rom16_0000( running_machine &machine, UINT8 *addr ) |
r18027 | r18028 | |
154 | 154 | static void gb_init(running_machine &machine) |
155 | 155 | { |
156 | 156 | gb_state *state = machine.driver_data<gb_state>(); |
157 | address_space &space = | |
157 | address_space &space = machine.device( "maincpu")->memory().space( AS_PROGRAM ); | |
158 | 158 | |
159 | 159 | /* Initialize the memory banks */ |
160 | 160 | state->m_MBC1Mode = 0; |
r18027 | r18028 | |
---|---|---|
540 | 540 | if (! (hdc.w[1] & w1_transfer_inhibit)) |
541 | 541 | for (i=0; i<real_word_count; i++) |
542 | 542 | { |
543 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
543 | machine.device("maincpu")->memory().space(AS_PROGRAM).write_word(dma_address, buffer[i]); | |
544 | 544 | dma_address = (dma_address + 2) & 0x1ffffe; |
545 | 545 | } |
546 | 546 | |
r18027 | r18028 | |
695 | 695 | if (! (hdc.w[1] & w1_transfer_inhibit)) |
696 | 696 | for (i=0; i<bytes_read; i+=2) |
697 | 697 | { |
698 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
698 | machine.device("maincpu")->memory().space(AS_PROGRAM).write_word(dma_address, (((int) buffer[i]) << 8) | buffer[i+1]); | |
699 | 699 | dma_address = (dma_address + 2) & 0x1ffffe; |
700 | 700 | } |
701 | 701 | |
r18027 | r18028 | |
791 | 791 | /* DMA */ |
792 | 792 | for (i=0; (i<byte_count) && (i<hdc.d[dsk_sel].bytes_per_sector); i+=2) |
793 | 793 | { |
794 | word = machine.device("maincpu")->memory().space(AS_PROGRAM) | |
794 | word = machine.device("maincpu")->memory().space(AS_PROGRAM).read_word(dma_address); | |
795 | 795 | buffer[i] = word >> 8; |
796 | 796 | buffer[i+1] = word & 0xff; |
797 | 797 | |
r18027 | r18028 | |
898 | 898 | if (! (hdc.w[1] & w1_transfer_inhibit)) |
899 | 899 | for (i=0; i<real_word_count; i++) |
900 | 900 | { |
901 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
901 | machine.device("maincpu")->memory().space(AS_PROGRAM).write_word(dma_address, buffer[i]); | |
902 | 902 | dma_address = (dma_address + 2) & 0x1ffffe; |
903 | 903 | } |
904 | 904 |
r18027 | r18028 | |
---|---|---|
168 | 168 | |
169 | 169 | READ8_MEMBER(radio86_state::radio_io_r) |
170 | 170 | { |
171 | return machine().device("maincpu")->memory().space(AS_PROGRAM) | |
171 | return machine().device("maincpu")->memory().space(AS_PROGRAM).read_byte((offset << 8) + offset); | |
172 | 172 | } |
173 | 173 | |
174 | 174 | WRITE8_MEMBER(radio86_state::radio_io_w) |
175 | 175 | { |
176 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
176 | machine().device("maincpu")->memory().space(AS_PROGRAM).write_byte((offset << 8) + offset,data); | |
177 | 177 | } |
178 | 178 | |
179 | 179 | MACHINE_RESET_MEMBER(radio86_state,radio86) |
r18027 | r18028 | |
---|---|---|
30 | 30 | /* configure EA banking */ |
31 | 31 | membank("bank1")->configure_entry(0, memregion("bios")->base()); |
32 | 32 | membank("bank1")->configure_entry(1, memregion(I8048_TAG)->base()); |
33 | m_maincpu->space(AS_PROGRAM) | |
33 | m_maincpu->space(AS_PROGRAM).install_readwrite_bank(0x0000, 0x03ff, "bank1"); | |
34 | 34 | membank("bank1")->set_entry(0); |
35 | 35 | |
36 | 36 | /* allocate external RAM */ |
r18027 | r18028 | |
---|---|---|
44 | 44 | { |
45 | 45 | UINT8 *rom; |
46 | 46 | b2m_state *state = machine.driver_data<b2m_state>(); |
47 | address_space &space = | |
47 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
48 | 48 | UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer(); |
49 | 49 | |
50 | 50 | space.install_write_bank(0x0000, 0x27ff, "bank1"); |
r18027 | r18028 | |
---|---|---|
141 | 141 | void aim65_state::machine_start() |
142 | 142 | { |
143 | 143 | ram_device *ram = machine().device<ram_device>(RAM_TAG); |
144 | address_space &space = | |
144 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
145 | 145 | |
146 | 146 | /* Init RAM */ |
147 | 147 | space.install_ram(0x0000, ram->size() - 1, ram->pointer()); |
r18027 | r18028 | |
---|---|---|
447 | 447 | |
448 | 448 | static void to7_update_cart_bank(running_machine &machine) |
449 | 449 | { |
450 | address_space& space = | |
450 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
451 | 451 | int bank = 0; |
452 | 452 | if ( thom_cart_nb_banks ) |
453 | 453 | { |
r18027 | r18028 | |
772 | 772 | LOG_IO(( "$%04x %f to7_io_portb_out: CENTRONICS set data=$%02X\n", device->machine().device("maincpu")->safe_pcbase(), device->machine().time().as_double(), data )); |
773 | 773 | |
774 | 774 | /* set 8-bit data */ |
775 | printer->write( | |
775 | printer->write( device->machine().driver_data()->generic_space(), 0, data); | |
776 | 776 | } |
777 | 777 | |
778 | 778 | |
r18027 | r18028 | |
1487 | 1487 | |
1488 | 1488 | MACHINE_START ( to7 ) |
1489 | 1489 | { |
1490 | address_space& space = | |
1490 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1491 | 1491 | UINT8* mem = machine.root_device().memregion("maincpu")->base(); |
1492 | 1492 | UINT8* ram = machine.device<ram_device>(RAM_TAG)->pointer(); |
1493 | 1493 | |
r18027 | r18028 | |
1568 | 1568 | static void to770_update_ram_bank(running_machine &machine) |
1569 | 1569 | { |
1570 | 1570 | pia6821_device *sys_pia = machine.device<pia6821_device>(THOM_PIA_SYS ); |
1571 | address_space& space = | |
1571 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1572 | 1572 | UINT8 portb = sys_pia->port_b_z_mask(); |
1573 | 1573 | int bank; |
1574 | 1574 | |
r18027 | r18028 | |
1992 | 1992 | |
1993 | 1993 | static void mo5_update_cart_bank(running_machine &machine) |
1994 | 1994 | { |
1995 | address_space& space = | |
1995 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1996 | 1996 | int rom_is_ram = mo5_reg_cart & 4; |
1997 | 1997 | int bank = 0; |
1998 | 1998 | int bank_is_read_only = 0; |
r18027 | r18028 | |
2394 | 2394 | |
2395 | 2395 | static void to9_update_cart_bank(running_machine &machine) |
2396 | 2396 | { |
2397 | address_space& space = | |
2397 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
2398 | 2398 | int bank = 0; |
2399 | 2399 | int slot = ( mc6846_get_output_port(machine.device("mc6846")) >> 4 ) & 3; /* bits 4-5: ROM bank */ |
2400 | 2400 | |
r18027 | r18028 | |
2510 | 2510 | static void to9_update_ram_bank (running_machine &machine) |
2511 | 2511 | { |
2512 | 2512 | pia6821_device *sys_pia = machine.device<pia6821_device>(THOM_PIA_SYS ); |
2513 | address_space& space = | |
2513 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
2514 | 2514 | UINT8 port = mc6846_get_output_port(machine.device("mc6846")); |
2515 | 2515 | UINT8 portb = sys_pia->port_b_z_mask(); |
2516 | 2516 | UINT8 disk = ((port >> 2) & 1) | ((port >> 5) & 2); /* bits 6,2: RAM bank */ |
r18027 | r18028 | |
3049 | 3049 | static WRITE8_DEVICE_HANDLER ( to9_sys_porta_out ) |
3050 | 3050 | { |
3051 | 3051 | centronics_device *printer = device->machine().device<centronics_device>("centronics"); |
3052 | printer->write( | |
3052 | printer->write(device->machine().driver_data()->generic_space(), 0, data & 0xfe); | |
3053 | 3053 | } |
3054 | 3054 | |
3055 | 3055 | |
r18027 | r18028 | |
3573 | 3573 | static void to8_update_ram_bank (running_machine &machine) |
3574 | 3574 | { |
3575 | 3575 | pia6821_device *sys_pia = machine.device<pia6821_device>(THOM_PIA_SYS ); |
3576 | address_space& space = | |
3576 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
3577 | 3577 | UINT8 bank = 0; |
3578 | 3578 | |
3579 | 3579 | if ( to8_reg_sys1 & 0x10 ) |
r18027 | r18028 | |
3637 | 3637 | |
3638 | 3638 | static void to8_update_cart_bank (running_machine &machine) |
3639 | 3639 | { |
3640 | address_space& space = | |
3640 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
3641 | 3641 | int bank = 0; |
3642 | 3642 | int bank_is_read_only = 0; |
3643 | 3643 | |
r18027 | r18028 | |
4498 | 4498 | static void mo6_update_cart_bank (running_machine &machine) |
4499 | 4499 | { |
4500 | 4500 | pia6821_device *sys_pia = machine.device<pia6821_device>(THOM_PIA_SYS ); |
4501 | address_space& space = | |
4501 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
4502 | 4502 | int b = (sys_pia->a_output() >> 5) & 1; |
4503 | 4503 | int bank = 0; |
4504 | 4504 | int bank_is_read_only = 0; |
r18027 | r18028 | |
4760 | 4760 | LOG (( "$%04x %f mo6_game_porta_out: CENTRONICS set data=$%02X\n", device->machine().device("maincpu")->safe_pcbase(), device->machine().time().as_double(), data )); |
4761 | 4761 | |
4762 | 4762 | /* centronics data */ |
4763 | printer->write( | |
4763 | printer->write( device->machine().driver_data()->generic_space(), 0, data); | |
4764 | 4764 | } |
4765 | 4765 | |
4766 | 4766 |
r18027 | r18028 | |
---|---|---|
74 | 74 | |
75 | 75 | /* find the CPU */ |
76 | 76 | m_cpu = machine().device<cpu_device>(config->m_cpu_tag); |
77 | m_cpu_space = m_cpu->space(config->m_cpu_space); | |
77 | m_cpu_space = &m_cpu->space(config->m_cpu_space); | |
78 | 78 | |
79 | 79 | /* resolve callbacks */ |
80 | 80 | m_res_input_func.resolve(config->m_input_func, *this); |
r18027 | r18028 | |
---|---|---|
452 | 452 | |
453 | 453 | if ((!m_game && m_exrom) || (charen && (loram || hiram))) |
454 | 454 | { |
455 | m_subcpu->space(AS_PROGRAM) | |
455 | m_subcpu->space(AS_PROGRAM).install_read_handler(0xd000, 0xdfff, read8_delegate(FUNC(c128_state::read_io), this)); | |
456 | 456 | m_write_io = 1; |
457 | 457 | } |
458 | 458 | else |
459 | 459 | { |
460 | m_subcpu->space(AS_PROGRAM) | |
460 | m_subcpu->space(AS_PROGRAM).install_read_bank(0xd000, 0xdfff, "bank5"); | |
461 | 461 | m_write_io = 0; |
462 | 462 | if ((!charen && (loram || hiram))) |
463 | 463 | membank("bank13")->set_base(m_chargen); |
r18027 | r18028 | |
636 | 636 | else |
637 | 637 | m_ram_top = 0x10000; |
638 | 638 | |
639 | m_subcpu->space(AS_PROGRAM) | |
639 | m_subcpu->space(AS_PROGRAM).install_read_handler(0xff00, 0xff04, read8_delegate(FUNC(c128_state::mmu8722_ff00_r), this)); | |
640 | 640 | |
641 | 641 | if (MMU_IO_ON) |
642 | 642 | { |
643 | 643 | m_write_io = 1; |
644 | m_subcpu->space(AS_PROGRAM) | |
644 | m_subcpu->space(AS_PROGRAM).install_read_handler(0xd000, 0xdfff, read8_delegate(FUNC(c128_state::read_io), this)); | |
645 | 645 | } |
646 | 646 | else |
647 | 647 | { |
648 | 648 | m_write_io = 0; |
649 | m_subcpu->space(AS_PROGRAM) | |
649 | m_subcpu->space(AS_PROGRAM).install_read_bank(0xd000, 0xdfff, "bank13"); | |
650 | 650 | } |
651 | 651 | |
652 | 652 | |
r18027 | r18028 | |
1025 | 1025 | |
1026 | 1026 | bankswitch_64(0); |
1027 | 1027 | |
1028 | m_memory[0x000] = m_subcpu->space(AS_PROGRAM)->read_byte(0); | |
1029 | m_memory[0x001] = m_subcpu->space(AS_PROGRAM)->read_byte(1); | |
1028 | m_memory[0x000] = m_subcpu->space(AS_PROGRAM).read_byte(0); | |
1029 | m_memory[0x001] = m_subcpu->space(AS_PROGRAM).read_byte(1); | |
1030 | 1030 | } |
1031 | 1031 | |
1032 | 1032 | READ8_MEMBER( c128_state::cpu_r) |
r18027 | r18028 | |
---|---|---|
656 | 656 | state->m_superpet = 0; |
657 | 657 | state->m_cbm8096 = 0; |
658 | 658 | |
659 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
659 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank(0x0000, machine.device<ram_device>(RAM_TAG)->size() - 1, "bank10"); | |
660 | 660 | state->membank("bank10")->set_base(state->m_memory); |
661 | 661 | |
662 | 662 | if (machine.device<ram_device>(RAM_TAG)->size() < 0x8000) |
663 | 663 | { |
664 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
664 | machine.device("maincpu")->memory().space(AS_PROGRAM).nop_readwrite(machine.device<ram_device>(RAM_TAG)->size(), 0x7FFF); | |
665 | 665 | } |
666 | 666 | |
667 | 667 | /* 2114 poweron ? 64 x 0xff, 64x 0, and so on */ |
r18027 | r18028 | |
743 | 743 | { |
744 | 744 | if (machine().root_device().ioport("CFG")->read() & 0x08) |
745 | 745 | { |
746 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
746 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xfff0, 0xfff0, FUNC(cbm8096_w)); | |
747 | 747 | } |
748 | 748 | else |
749 | 749 | { |
750 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
750 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_write(0xfff0, 0xfff0); | |
751 | 751 | } |
752 | cbm8096_w( | |
752 | cbm8096_w(machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0); | |
753 | 753 | } |
754 | 754 | |
755 | 755 | //removed cbm_drive_0_config (machine().root_device().ioport("CFG")->read() & 2 ? IEEE : 0, 8); |
r18027 | r18028 | |
---|---|---|
221 | 221 | { |
222 | 222 | /* if psg not selected, write to printer */ |
223 | 223 | centronics_device *centronics = device->machine().device<centronics_device>("centronics"); |
224 | centronics->write( | |
224 | centronics->write(device->machine().driver_data()->generic_space(), 0, data); | |
225 | 225 | } |
226 | 226 | } |
227 | 227 | |
r18027 | r18028 | |
427 | 427 | { |
428 | 428 | oric_state *state = machine.driver_data<oric_state>(); |
429 | 429 | device_t *fdc = machine.device("fdc"); |
430 | address_space &space = | |
430 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
431 | 431 | |
432 | 432 | if (state->m_is_telestrat) |
433 | 433 | return; |
r18027 | r18028 | |
446 | 446 | { |
447 | 447 | oric_state *state = machine.driver_data<oric_state>(); |
448 | 448 | int i; |
449 | address_space &space = | |
449 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
450 | 450 | |
451 | 451 | if (state->m_is_telestrat) |
452 | 452 | return; |
r18027 | r18028 | |
551 | 551 | { |
552 | 552 | oric_state *state = machine.driver_data<oric_state>(); |
553 | 553 | device_t *fdc = machine.device("fdc"); |
554 | address_space &space = | |
554 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
555 | 555 | |
556 | 556 | space.install_read_handler(0x0300, 0x030f, read8_delegate(FUNC(oric_state::oric_IO_r),state)); |
557 | 557 | space.install_legacy_read_handler(*fdc, 0x0310, 0x031f, FUNC(applefdc_r)); |
r18027 | r18028 | |
755 | 755 | static void oric_install_jasmin_interface(running_machine &machine) |
756 | 756 | { |
757 | 757 | oric_state *state = machine.driver_data<oric_state>(); |
758 | address_space &space = | |
758 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
759 | 759 | /* romdis */ |
760 | 760 | state->m_port_3fb_w = 1; |
761 | 761 | oric_jasmin_set_mem_0x0c000(machine); |
r18027 | r18028 | |
978 | 978 | static void oric_install_microdisc_interface(running_machine &machine) |
979 | 979 | { |
980 | 980 | oric_state *state = machine.driver_data<oric_state>(); |
981 | address_space &space = | |
981 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
982 | 982 | |
983 | 983 | space.install_read_handler(0x0300, 0x030f, read8_delegate(FUNC(oric_state::oric_IO_r),state)); |
984 | 984 | space.install_read_handler(0x0310, 0x031f, read8_delegate(FUNC(oric_state::oric_microdisc_r),state)); |
r18027 | r18028 | |
1064 | 1064 | void oric_state::machine_reset() |
1065 | 1065 | { |
1066 | 1066 | int disc_interface_id = machine().root_device().ioport("FLOPPY")->read() & 0x07; |
1067 | address_space &space = | |
1067 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1068 | 1068 | if (m_is_telestrat) |
1069 | 1069 | return; |
1070 | 1070 | |
r18027 | r18028 | |
1246 | 1246 | static void telestrat_refresh_mem(running_machine &machine) |
1247 | 1247 | { |
1248 | 1248 | oric_state *state = machine.driver_data<oric_state>(); |
1249 | address_space &space = | |
1249 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1250 | 1250 | |
1251 | 1251 | telestrat_mem_block *mem_block = &state->m_telestrat_blocks[state->m_telestrat_bank_selection]; |
1252 | 1252 |
r18027 | r18028 | |
---|---|---|
71 | 71 | { |
72 | 72 | if(m_dma_channel == -1) |
73 | 73 | return 0xff; |
74 | address_space | |
74 | address_space &spaceio = m_maincpu->space(AS_PROGRAM); | |
75 | 75 | offs_t page_offset = (((offs_t) m_dma_offset[m_dma_channel]) << 16) & 0x0F0000; |
76 | return spaceio | |
76 | return spaceio.read_byte( page_offset + offset); | |
77 | 77 | } |
78 | 78 | |
79 | 79 | |
r18027 | r18028 | |
81 | 81 | { |
82 | 82 | if(m_dma_channel == -1) |
83 | 83 | return; |
84 | address_space | |
84 | address_space &spaceio = m_maincpu->space(AS_PROGRAM); | |
85 | 85 | offs_t page_offset = (((offs_t) m_dma_offset[m_dma_channel]) << 16) & 0x0F0000; |
86 | 86 | |
87 | spaceio | |
87 | spaceio.write_byte( page_offset + offset, data); | |
88 | 88 | } |
89 | 89 | |
90 | 90 | |
r18027 | r18028 | |
574 | 574 | switch(buswidth) |
575 | 575 | { |
576 | 576 | case 8: |
577 | m_maincpu->space(AS_IO) | |
577 | m_maincpu->space(AS_IO).install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name, 0); | |
578 | 578 | break; |
579 | 579 | case 16: |
580 | m_maincpu->space(AS_IO) | |
580 | m_maincpu->space(AS_IO).install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff); | |
581 | 581 | break; |
582 | 582 | default: |
583 | 583 | fatalerror("IBM5160_MOTHERBOARD: Bus width %d not supported\n", buswidth); |
r18027 | r18028 | |
591 | 591 | switch(buswidth) |
592 | 592 | { |
593 | 593 | case 8: |
594 | m_maincpu->space(AS_IO) | |
594 | m_maincpu->space(AS_IO).install_legacy_write_handler(*dev, start, end, mask, mirror, whandler, whandler_name,0); | |
595 | 595 | break; |
596 | 596 | case 16: |
597 | m_maincpu->space(AS_IO) | |
597 | m_maincpu->space(AS_IO).install_legacy_write_handler(*dev, start, end, mask, mirror, whandler, whandler_name, 0xffff); | |
598 | 598 | break; |
599 | 599 | default: |
600 | 600 | fatalerror("IBM5160_MOTHERBOARD: Bus width %d not supported\n", buswidth); |
r18027 | r18028 | |
608 | 608 | switch(buswidth) |
609 | 609 | { |
610 | 610 | case 8: |
611 | m_maincpu->space(AS_IO) | |
611 | m_maincpu->space(AS_IO).install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0); | |
612 | 612 | break; |
613 | 613 | case 16: |
614 | m_maincpu->space(AS_IO) | |
614 | m_maincpu->space(AS_IO).install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0xffff); | |
615 | 615 | break; |
616 | 616 | default: |
617 | 617 | fatalerror("IBM5160_MOTHERBOARD: Bus width %d not supported\n", buswidth); |
r18027 | r18028 | |
635 | 635 | switch(buswidth) |
636 | 636 | { |
637 | 637 | case 8: |
638 | m_maincpu->space(AS_IO) | |
638 | m_maincpu->space(AS_IO).install_readwrite_handler(0x0060, 0x0063, 0, 0, read8_delegate(FUNC(i8255_device::read), (i8255_device*)m_ppi8255), write8_delegate(FUNC(i8255_device::write), (i8255_device*)m_ppi8255), 0); | |
639 | 639 | break; |
640 | 640 | case 16: |
641 | m_maincpu->space(AS_IO) | |
641 | m_maincpu->space(AS_IO).install_readwrite_handler(0x0060, 0x0063, 0, 0, read8_delegate(FUNC(i8255_device::read), (i8255_device*)m_ppi8255), write8_delegate(FUNC(i8255_device::write), (i8255_device*)m_ppi8255), 0xffff); | |
642 | 642 | break; |
643 | 643 | default: |
644 | 644 | fatalerror("IBM5160_MOTHERBOARD: Bus width %d not supported\n", buswidth); |
r18027 | r18028 | |
---|---|---|
169 | 169 | |
170 | 170 | void vector06_state::machine_reset() |
171 | 171 | { |
172 | address_space &space = | |
172 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
173 | 173 | |
174 | 174 | machine().device("maincpu")->execute().set_irq_acknowledge_callback(vector06_irq_callback); |
175 | 175 | space.install_read_bank (0x0000, 0x7fff, "bank1"); |
r18027 | r18028 | |
---|---|---|
306 | 306 | { |
307 | 307 | device_t *cpu = image.device().machine().device("maincpu"); |
308 | 308 | UINT8 *RAM = image.device().machine().root_device().memregion(cpu->tag())->base(); |
309 | address_space &space = | |
309 | address_space &space = cpu->memory().space(AS_PROGRAM); | |
310 | 310 | UINT8 header[28]; |
311 | 311 | unsigned char s_byte; |
312 | 312 | |
r18027 | r18028 | |
360 | 360 | |
361 | 361 | UINT16 endmem = 0xbfff; |
362 | 362 | |
363 | address_space &space = | |
363 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
364 | 364 | /* configure RAM */ |
365 | 365 | switch (m_ram->size()) |
366 | 366 | { |
r18027 | r18028 | |
387 | 387 | |
388 | 388 | UINT16 endmem = 0xbbff; |
389 | 389 | |
390 | address_space &space = | |
390 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
391 | 391 | /* configure RAM */ |
392 | 392 | switch (m_ram->size()) |
393 | 393 | { |
r18027 | r18028 | |
407 | 407 | |
408 | 408 | void sorcerer_state::machine_reset() |
409 | 409 | { |
410 | address_space &space = | |
410 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
411 | 411 | |
412 | 412 | /* Initialize cassette interface */ |
413 | 413 | m_cass_data.output.length = 0; |
r18027 | r18028 | |
---|---|---|
68 | 68 | device_t* cpu = machine().device("maincpu"); |
69 | 69 | UINT8* ROM; |
70 | 70 | astring temp; |
71 | address_space& space = | |
71 | address_space& space = cpu->memory().space(AS_PROGRAM); | |
72 | 72 | m_slot = dynamic_cast<x68k_expansion_slot_device *>(owner()); |
73 | 73 | space.install_read_bank(0xea0020,0xea1fff,0,0,"scsi_ext"); |
74 | 74 | space.unmap_write(0xea0020,0xea1fff,0,0); |
r18027 | r18028 | |
---|---|---|
94 | 94 | { |
95 | 95 | amiga_state *state = machine.driver_data<amiga_state>(); |
96 | 96 | /* get the cart's built-in ram */ |
97 | UINT16 *ar_ram = (UINT16 *)machine.device("maincpu")->memory().space(AS_PROGRAM) | |
97 | UINT16 *ar_ram = (UINT16 *)machine.device("maincpu")->memory().space(AS_PROGRAM).get_write_ptr(0x9fc000); | |
98 | 98 | |
99 | 99 | if ( ar_ram != NULL ) |
100 | 100 | { |
r18027 | r18028 | |
133 | 133 | |
134 | 134 | static void amiga_ar1_check_overlay( running_machine &machine ) |
135 | 135 | { |
136 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
136 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x000000, 0x00007f, FUNC(amiga_ar1_chipmem_w)); | |
137 | 137 | } |
138 | 138 | |
139 | 139 | static void amiga_ar1_init( running_machine &machine ) |
r18027 | r18028 | |
153 | 153 | memset(ar_ram, 0, 0x4000); |
154 | 154 | |
155 | 155 | /* Install ROM */ |
156 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xf00000, 0xf7ffff, "bank2"); | |
157 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0xf00000, 0xf7ffff); | |
156 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xf00000, 0xf7ffff, "bank2"); | |
157 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xf00000, 0xf7ffff); | |
158 | 158 | |
159 | 159 | /* Install RAM */ |
160 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
160 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank(0x9fc000, 0x9fffff, "bank3"); | |
161 | 161 | |
162 | 162 | /* Configure Banks */ |
163 | 163 | state->membank("bank2")->set_base(machine.root_device().memregion("user2")->base()); |
r18027 | r18028 | |
269 | 269 | if ( ((pc >> 16) & 0xfe ) != 0x40 ) |
270 | 270 | { |
271 | 271 | /* get the cart's built-in ram */ |
272 | UINT16 *ar_ram = (UINT16 *)machine.device("maincpu")->memory().space(AS_PROGRAM) | |
272 | UINT16 *ar_ram = (UINT16 *)machine.device("maincpu")->memory().space(AS_PROGRAM).get_write_ptr(0x440000); | |
273 | 273 | |
274 | 274 | if ( ar_ram != NULL ) |
275 | 275 | { |
r18027 | r18028 | |
283 | 283 | state->membank("bank1")->set_entry(2); |
284 | 284 | |
285 | 285 | /* writes go to chipram */ |
286 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
286 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x000000, state->m_chip_ram.bytes() - 1, FUNC(amiga_ar23_chipmem_w)); | |
287 | 287 | |
288 | 288 | /* trigger NMI irq */ |
289 | 289 | machine.device("maincpu")->execute().set_input_line(7, PULSE_LINE); |
r18027 | r18028 | |
341 | 341 | static void amiga_ar23_check_overlay( running_machine &machine ) |
342 | 342 | { |
343 | 343 | amigacrt.ar23_mode = 3; |
344 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
344 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x000000, 0x00000f, FUNC(amiga_ar23_chipmem_w)); | |
345 | 345 | } |
346 | 346 | |
347 | 347 | static void amiga_ar23_init( running_machine &machine, int ar3 ) |
r18027 | r18028 | |
367 | 367 | } |
368 | 368 | |
369 | 369 | /* Install ROM */ |
370 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x400000, 0x400000+size, 0, mirror, "bank2"); | |
371 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x400000, 0x400000+size, 0, mirror); | |
370 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x400000, 0x400000+size, 0, mirror, "bank2"); | |
371 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x400000, 0x400000+size, 0, mirror); | |
372 | 372 | |
373 | 373 | /* Install RAM */ |
374 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x440000, 0x44ffff, "bank3"); | |
375 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0x440000, 0x44ffff, "bank3"); | |
374 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x440000, 0x44ffff, "bank3"); | |
375 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(0x440000, 0x44ffff, "bank3"); | |
376 | 376 | |
377 | 377 | /* Install Custom chip monitor */ |
378 | // machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xdff000, 0xdff1ff, FUNC(amiga_ar23_custom_r)); | |
379 | // machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xdff000, 0xdff1ff, FUNC(amiga_ar23_custom_w)); | |
378 | // machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xdff000, 0xdff1ff, FUNC(amiga_ar23_custom_r)); | |
379 | // machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xdff000, 0xdff1ff, FUNC(amiga_ar23_custom_w)); | |
380 | 380 | |
381 | 381 | /* Install status/mode handlers */ |
382 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400007, 0, mirror, FUNC(amiga_ar23_mode_r)); | |
383 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x400000, 0x400003, 0, mirror, FUNC(amiga_ar23_mode_w)); | |
382 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x400000, 0x400007, 0, mirror, FUNC(amiga_ar23_mode_r)); | |
383 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x400000, 0x400003, 0, mirror, FUNC(amiga_ar23_mode_w)); | |
384 | 384 | |
385 | 385 | /* Configure Banks */ |
386 | 386 | state->membank("bank2")->set_base(machine.root_device().memregion("user2")->base()); |
r18027 | r18028 | |
---|---|---|
426 | 426 | void osborne1_state::machine_reset() |
427 | 427 | { |
428 | 428 | int drive; |
429 | address_space& space = | |
429 | address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
430 | 430 | /* Initialize memory configuration */ |
431 | 431 | osborne1_bankswitch_w( space, 0x00, 0 ); |
432 | 432 | |
r18027 | r18028 | |
524 | 524 | osborne1_state *state = machine().driver_data<osborne1_state>(); |
525 | 525 | /* Enable ROM and I/O when IRQ is acknowledged */ |
526 | 526 | UINT8 old_bankswitch = state->m_bankswitch; |
527 | address_space& space = | |
527 | address_space& space = device().machine().device("maincpu")->memory().space(AS_PROGRAM); | |
528 | 528 | |
529 | 529 | state->osborne1_bankswitch_w( space, 0, 0 ); |
530 | 530 | state->m_bankswitch = old_bankswitch; |
r18027 | r18028 | |
---|---|---|
1195 | 1195 | } |
1196 | 1196 | else // CPC+/GX4000 |
1197 | 1197 | { |
1198 | //address_space &space = | |
1198 | //address_space &space = state->m_maincpu->space(AS_PROGRAM); | |
1199 | 1199 | |
1200 | 1200 | /* if ( state->m_asic.enabled && ( state->m_asic.rmr2 & 0x18 ) == 0x18 ) |
1201 | 1201 | { |
r18027 | r18028 | |
2174 | 2174 | static void amstrad_handle_snapshot(running_machine &machine, unsigned char *pSnapshot) |
2175 | 2175 | { |
2176 | 2176 | amstrad_state *state = machine.driver_data<amstrad_state>(); |
2177 | address_space &space = | |
2177 | address_space &space = state->m_maincpu->space(AS_PROGRAM); | |
2178 | 2178 | mc6845_device *mc6845 = state->m_crtc; |
2179 | 2179 | device_t *ay8910 = state->m_ay; |
2180 | 2180 | int RegData; |
r18027 | r18028 | |
2457 | 2457 | static void update_psg(running_machine &machine) |
2458 | 2458 | { |
2459 | 2459 | amstrad_state *state = machine.driver_data<amstrad_state>(); |
2460 | address_space &space = | |
2460 | address_space &space = state->m_maincpu->space(AS_PROGRAM); | |
2461 | 2461 | device_t *ay8910 = state->m_ay; |
2462 | 2462 | mc146818_device *rtc = state->m_rtc; |
2463 | 2463 | |
r18027 | r18028 | |
2831 | 2831 | static void amstrad_common_init(running_machine &machine) |
2832 | 2832 | { |
2833 | 2833 | amstrad_state *state = machine.driver_data<amstrad_state>(); |
2834 | address_space &space = | |
2834 | address_space &space = state->m_maincpu->space(AS_PROGRAM); | |
2835 | 2835 | device_t* romexp; |
2836 | 2836 | rom_image_device* romimage; |
2837 | 2837 | char str[20]; |
r18027 | r18028 | |
2976 | 2976 | |
2977 | 2977 | MACHINE_RESET_MEMBER(amstrad_state,plus) |
2978 | 2978 | { |
2979 | address_space &space = | |
2979 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
2980 | 2980 | int i; |
2981 | 2981 | UINT8 *rom = memregion("maincpu")->base(); |
2982 | 2982 | |
r18027 | r18028 | |
3026 | 3026 | |
3027 | 3027 | MACHINE_RESET_MEMBER(amstrad_state,gx4000) |
3028 | 3028 | { |
3029 | address_space &space = | |
3029 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
3030 | 3030 | int i; |
3031 | 3031 | UINT8 *rom = memregion("maincpu")->base(); |
3032 | 3032 |
r18027 | r18028 | |
---|---|---|
1940 | 1940 | m_main_scr = machine().device("screen"); |
1941 | 1941 | m_left_lcd = machine().device("left_lcd"); |
1942 | 1942 | m_right_lcd = machine().device("right_lcd"); |
1943 | m_space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1943 | m_space = &machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1944 | 1944 | |
1945 | 1945 | /* Check if lightgun has been chosen as input: if so, enable crosshair */ |
1946 | 1946 | machine().scheduler().timer_set(attotime::zero, FUNC(lightgun_tick)); |
r18027 | r18028 | |
1948 | 1948 | |
1949 | 1949 | MACHINE_RESET_MEMBER(sms_state,sms) |
1950 | 1950 | { |
1951 | address_space &space = | |
1951 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1952 | 1952 | |
1953 | 1953 | m_ctrl_reg = 0xff; |
1954 | 1954 | if (m_has_fm) |
r18027 | r18028 | |
---|---|---|
152 | 152 | |
153 | 153 | MACHINE_RESET_MEMBER(llc_state,llc2) |
154 | 154 | { |
155 | address_space &space = | |
155 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
156 | 156 | |
157 | 157 | space.unmap_write(0x0000, 0x3fff); |
158 | 158 | membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base()); |
r18027 | r18028 | |
170 | 170 | |
171 | 171 | WRITE8_MEMBER(llc_state::llc2_rom_disable_w) |
172 | 172 | { |
173 | address_space | |
173 | address_space &mem_space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
174 | 174 | UINT8 *ram = machine().device<ram_device>(RAM_TAG)->pointer(); |
175 | 175 | |
176 | mem_space | |
176 | mem_space.install_write_bank(0x0000, 0xbfff, "bank1"); | |
177 | 177 | membank("bank1")->set_base(ram); |
178 | 178 | |
179 | mem_space | |
179 | mem_space.install_write_bank(0x4000, 0x5fff, "bank2"); | |
180 | 180 | membank("bank2")->set_base(ram + 0x4000); |
181 | 181 | |
182 | mem_space | |
182 | mem_space.install_write_bank(0x6000, 0xbfff, "bank3"); | |
183 | 183 | membank("bank3")->set_base(ram + 0x6000); |
184 | 184 | |
185 | mem_space | |
185 | mem_space.install_write_bank(0xc000, 0xffff, "bank4"); | |
186 | 186 | membank("bank4")->set_base(ram + 0xc000); |
187 | 187 | |
188 | 188 | } |
189 | 189 | |
190 | 190 | WRITE8_MEMBER(llc_state::llc2_basic_enable_w) |
191 | 191 | { |
192 | address_space | |
192 | address_space &mem_space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
193 | 193 | if (data & 0x02) |
194 | 194 | { |
195 | mem_space | |
195 | mem_space.unmap_write(0x4000, 0x5fff); | |
196 | 196 | membank("bank2")->set_base(machine().root_device().memregion("maincpu")->base() + 0x10000); |
197 | 197 | } |
198 | 198 | else |
199 | 199 | { |
200 | mem_space | |
200 | mem_space.install_write_bank(0x4000, 0x5fff, "bank2"); | |
201 | 201 | membank("bank2")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0x4000); |
202 | 202 | } |
203 | 203 |
r18027 | r18028 | |
---|---|---|
336 | 336 | if (data & 0x02) |
337 | 337 | { |
338 | 338 | for (int i=0; i<0xfc00; i++) |
339 | m_cpu->space(AS_PROGRAM) | |
339 | m_cpu->space(AS_PROGRAM).write_byte(i, 0); | |
340 | 340 | |
341 | 341 | m_cpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); |
342 | 342 | } |
r18027 | r18028 | |
---|---|---|
60 | 60 | static void update_ti83p_memory (running_machine &machine) |
61 | 61 | { |
62 | 62 | ti85_state *state = machine.driver_data<ti85_state>(); |
63 | address_space &space = | |
63 | address_space &space = state->m_maincpu->space(AS_PROGRAM); | |
64 | 64 | |
65 | 65 | if (state->m_ti8x_memory_page_1 & 0x40) |
66 | 66 | { |
r18027 | r18028 | |
84 | 84 | static void update_ti86_memory (running_machine &machine) |
85 | 85 | { |
86 | 86 | ti85_state *state = machine.driver_data<ti85_state>(); |
87 | address_space &space = | |
87 | address_space &space = state->m_maincpu->space(AS_PROGRAM); | |
88 | 88 | |
89 | 89 | if (state->m_ti8x_memory_page_1 & 0x40) |
90 | 90 | { |
r18027 | r18028 | |
112 | 112 | |
113 | 113 | void ti85_state::machine_start() |
114 | 114 | { |
115 | address_space &space = | |
115 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
116 | 116 | m_bios = memregion("bios")->base(); |
117 | 117 | |
118 | 118 | m_timer_interrupt_mask = 0; |
r18027 | r18028 | |
149 | 149 | |
150 | 150 | MACHINE_START_MEMBER(ti85_state,ti83p) |
151 | 151 | { |
152 | address_space &space = | |
152 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
153 | 153 | m_bios = memregion("bios")->base(); |
154 | 154 | |
155 | 155 | m_timer_interrupt_mask = 0; |
r18027 | r18028 | |
187 | 187 | |
188 | 188 | MACHINE_START_MEMBER(ti85_state,ti86) |
189 | 189 | { |
190 | address_space &space = | |
190 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
191 | 191 | m_bios = memregion("bios")->base(); |
192 | 192 | |
193 | 193 | m_timer_interrupt_mask = 0; |
r18027 | r18028 | |
608 | 608 | static void ti85_setup_snapshot (running_machine &machine, UINT8 * data) |
609 | 609 | { |
610 | 610 | ti85_state *state = machine.driver_data<ti85_state>(); |
611 | address_space &space = | |
611 | address_space &space = state->m_maincpu->space(AS_PROGRAM); | |
612 | 612 | int i; |
613 | 613 | unsigned char lo,hi; |
614 | 614 | unsigned char * hdw = data + 0x8000 + 0x94; |
r18027 | r18028 | |
---|---|---|
155 | 155 | |
156 | 156 | DRIVER_INIT_MEMBER(galaxy_state,galaxy) |
157 | 157 | { |
158 | address_space &space = | |
158 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
159 | 159 | space.install_readwrite_bank( 0x2800, 0x2800 + machine().device<ram_device>(RAM_TAG)->size() - 1, "bank1"); |
160 | 160 | membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer()); |
161 | 161 | |
r18027 | r18028 | |
171 | 171 | |
172 | 172 | MACHINE_RESET_MEMBER(galaxy_state,galaxy) |
173 | 173 | { |
174 | address_space &space = | |
174 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
175 | 175 | |
176 | 176 | /* ROM 2 enable/disable */ |
177 | 177 | if (machine().root_device().ioport("ROM2")->read()) { |
r18027 | r18028 | |
196 | 196 | MACHINE_RESET_MEMBER(galaxy_state,galaxyp) |
197 | 197 | { |
198 | 198 | UINT8 *ROM = machine().root_device().memregion("maincpu")->base(); |
199 | address_space &space = | |
199 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
200 | 200 | |
201 | 201 | machine().device("maincpu")->execute().set_irq_acknowledge_callback(galaxy_irq_callback); |
202 | 202 |
r18027 | r18028 | |
---|---|---|
1053 | 1053 | |
1054 | 1054 | WRITE16_MEMBER( compis_state::compis_i186_internal_port_w ) |
1055 | 1055 | { |
1056 | address_space *mem = m_maincpu->space(AS_PROGRAM); | |
1057 | address_space *io = m_maincpu->space(AS_IO); | |
1056 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
1057 | address_space &io = m_maincpu->space(AS_IO); | |
1058 | 1058 | int temp, which, data16 = data; |
1059 | 1059 | |
1060 | 1060 | switch (offset) |
r18027 | r18028 | |
1275 | 1275 | temp = (data16 & 0x0fff) << 8; |
1276 | 1276 | if (data16 & 0x1000) |
1277 | 1277 | { |
1278 | mem->install_read_handler(temp, temp + 0xff, read16_delegate(FUNC(compis_state::compis_i186_internal_port_r), this)); | |
1279 | mem->install_write_handler(temp, temp + 0xff, write16_delegate(FUNC(compis_state::compis_i186_internal_port_w), this)); | |
1278 | mem.install_read_handler(temp, temp + 0xff, read16_delegate(FUNC(compis_state::compis_i186_internal_port_r), this)); | |
1279 | mem.install_write_handler(temp, temp + 0xff, write16_delegate(FUNC(compis_state::compis_i186_internal_port_w), this)); | |
1280 | 1280 | } |
1281 | 1281 | else |
1282 | 1282 | { |
1283 | 1283 | temp &= 0xffff; |
1284 | io->install_read_handler(temp, temp + 0xff, read16_delegate(FUNC(compis_state::compis_i186_internal_port_r), this)); | |
1285 | io->install_write_handler(temp, temp + 0xff, write16_delegate(FUNC(compis_state::compis_i186_internal_port_w), this)); | |
1284 | io.install_read_handler(temp, temp + 0xff, read16_delegate(FUNC(compis_state::compis_i186_internal_port_r), this)); | |
1285 | io.install_write_handler(temp, temp + 0xff, write16_delegate(FUNC(compis_state::compis_i186_internal_port_w), this)); | |
1286 | 1286 | } |
1287 | 1287 | /* popmessage("Sound CPU reset");*/ |
1288 | 1288 | break; |
r18027 | r18028 | |
---|---|---|
113 | 113 | logerror("laser_machine_init(): bank mask $%04X, video %d [$%05X]\n", state->m_laser_bank_mask, state->m_laser_video_bank, state->m_laser_video_bank * 0x04000); |
114 | 114 | |
115 | 115 | for (i = 0; i < ARRAY_LENGTH(state->m_laser_bank); i++) |
116 | state->laser_bank_select_w( | |
116 | state->laser_bank_select_w(machine.device("maincpu")->memory().space(AS_PROGRAM), i, 0); | |
117 | 117 | } |
118 | 118 | |
119 | 119 | void vtech2_state::machine_reset() |
r18027 | r18028 | |
155 | 155 | /* memory mapped I/O bank selected? */ |
156 | 156 | if (data == 2) |
157 | 157 | { |
158 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(offset * 0x4000, offset * 0x4000 + 0x3fff, mra_bank_soft[offset].func, mra_bank_soft[offset].name); | |
159 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(offset * 0x4000, offset * 0x4000 + 0x3fff, mwa_bank_soft[offset].func, mwa_bank_soft[offset].name); | |
158 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(offset * 0x4000, offset * 0x4000 + 0x3fff, mra_bank_soft[offset].func, mra_bank_soft[offset].name); | |
159 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(offset * 0x4000, offset * 0x4000 + 0x3fff, mwa_bank_soft[offset].func, mwa_bank_soft[offset].name); | |
160 | 160 | } |
161 | 161 | else |
162 | 162 | { |
r18027 | r18028 | |
169 | 169 | { |
170 | 170 | logerror("select bank #%d VIDEO!\n", offset+1); |
171 | 171 | } |
172 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(offset * 0x4000, offset * 0x4000 + 0x3fff, mra_bank_hard[offset]); | |
173 | machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(offset * 0x4000, offset * 0x4000 + 0x3fff, mwa_bank_hard[offset]); | |
172 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(offset * 0x4000, offset * 0x4000 + 0x3fff, mra_bank_hard[offset]); | |
173 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(offset * 0x4000, offset * 0x4000 + 0x3fff, mwa_bank_hard[offset]); | |
174 | 174 | |
175 | 175 | } |
176 | 176 | else |
177 | 177 | { |
178 | 178 | logerror("select bank #%d MASKED!\n", offset+1); |
179 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
179 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_readwrite(offset * 0x4000, offset * 0x4000 + 0x3fff); | |
180 | 180 | |
181 | 181 | } |
182 | 182 | } |
r18027 | r18028 | |
---|---|---|
44 | 44 | |
45 | 45 | DRIVER_INIT_MEMBER(zx_state,zx) |
46 | 46 | { |
47 | address_space &space = | |
47 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
48 | 48 | |
49 | 49 | space.install_read_bank(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 1, "bank1"); |
50 | 50 | space.install_write_handler(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 1, write8_delegate(FUNC(zx_state::zx_ram_w),this)); |
r18027 | r18028 | |
74 | 74 | |
75 | 75 | void zx_state::machine_reset() |
76 | 76 | { |
77 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
77 | machine().device("maincpu")->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(zx_state::zx_setdirect), this)); | |
78 | 78 | m_tape_bit = 0x80; |
79 | 79 | } |
80 | 80 | |
81 | 81 | MACHINE_RESET_MEMBER(zx_state,pow3000) |
82 | 82 | { |
83 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
83 | machine().device("maincpu")->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(zx_state::pow3000_setdirect), this)); | |
84 | 84 | m_tape_bit = 0x80; |
85 | 85 | } |
86 | 86 | |
87 | 87 | MACHINE_RESET_MEMBER(zx_state,pc8300) |
88 | 88 | { |
89 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
89 | machine().device("maincpu")->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(zx_state::pc8300_setdirect), this)); | |
90 | 90 | m_tape_bit = 0x80; |
91 | 91 | } |
92 | 92 | |
r18027 | r18028 | |
354 | 354 | |
355 | 355 | WRITE8_MEMBER( zx_state::zx81_io_w ) |
356 | 356 | { |
357 | address_space | |
357 | address_space &mem = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
358 | 358 | /* port F5 = unknown, pc8300/pow3000/lambda only |
359 | 359 | F6 = unknown, pc8300/pow3000/lambda only |
360 | 360 | FB = write data to printer, not emulated |
r18027 | r18028 | |
385 | 385 | zx_ula_bkgnd(1); |
386 | 386 | if (m_ula_frame_vsync == 2) |
387 | 387 | { |
388 | mem | |
388 | mem.device().execute().spin_until_time(machine().primary_screen->time_until_pos(height - 1, 0)); | |
389 | 389 | m_ula_scanline_count = height - 1; |
390 | 390 | logerror ("S: %d B: %d\n", machine().primary_screen->vpos(), machine().primary_screen->hpos()); |
391 | 391 | } |
r18027 | r18028 | |
---|---|---|
212 | 212 | offs_t memory_size, void *memory_data, int is_rom, const char *bank) |
213 | 213 | { |
214 | 214 | mac_state *state = machine.driver_data<mac_state>(); |
215 | address_space& space = | |
215 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
216 | 216 | offs_t memory_mask; |
217 | 217 | |
218 | 218 | memory_size = MIN(memory_size, (memory_end + 1 - memory_begin)); |
r18027 | r18028 | |
410 | 410 | } |
411 | 411 | else |
412 | 412 | { |
413 | address_space& space = | |
413 | address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
414 | 414 | UINT32 onboard_amt, simm_amt, simm_size; |
415 | 415 | static const UINT32 simm_sizes[4] = { 0, 2*1024*1024, 4*1024*1024, 8*1024*1024 }; |
416 | 416 | |
r18027 | r18028 | |
501 | 501 | } |
502 | 502 | else if ((m_model == MODEL_MAC_PORTABLE) || (m_model == MODEL_MAC_PB100) || (m_model == MODEL_MAC_IIVX) || (m_model == MODEL_MAC_IIFX)) |
503 | 503 | { |
504 | address_space& space = | |
504 | address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
505 | 505 | space.unmap_write(0x000000, 0x9fffff, 0x9fffff, 0); |
506 | 506 | mac_install_memory(machine(), 0x000000, memory_size-1, memory_size, memory_data, is_rom, "bank1"); |
507 | 507 | } |
508 | 508 | else if ((m_model == MODEL_MAC_PB140) || (m_model == MODEL_MAC_PB160) || ((m_model >= MODEL_MAC_PBDUO_210) && (m_model <= MODEL_MAC_PBDUO_270c))) |
509 | 509 | { |
510 | address_space& space = | |
510 | address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
511 | 511 | space.unmap_write(0x000000, 0xffffff, 0xffffff, 0); |
512 | 512 | mac_install_memory(machine(), 0x000000, memory_size-1, memory_size, memory_data, is_rom, "bank1"); |
513 | 513 | } |
r18027 | r18028 | |
1814 | 1814 | |
1815 | 1815 | if (m_model >= MODEL_MAC_POWERMAC_6100 && m_model <= MODEL_MAC_POWERMAC_8100) |
1816 | 1816 | { |
1817 | m_awacs->set_dma_base( | |
1817 | m_awacs->set_dma_base(m_maincpu->space(AS_PROGRAM), 0x10000, 0x12000); | |
1818 | 1818 | } |
1819 | 1819 | |
1820 | 1820 | // start 60.15 Hz timer for most systems |
r18027 | r18028 | |
2099 | 2099 | (model == MODEL_MAC_LC_II) || (model == MODEL_MAC_LC_III) || (model == MODEL_MAC_LC_III_PLUS) || ((mac->m_model >= MODEL_MAC_II) && (mac->m_model <= MODEL_MAC_SE30)) || |
2100 | 2100 | (model == MODEL_MAC_PORTABLE) || (model == MODEL_MAC_PB100) || (model == MODEL_MAC_PB140) || (model == MODEL_MAC_PB160) || (model == MODEL_MAC_PBDUO_210) || (model >= MODEL_MAC_QUADRA_700 && model <= MODEL_MAC_QUADRA_800)) |
2101 | 2101 | { |
2102 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
2102 | machine.device("maincpu")->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(mac_state::overlay_opbaseoverride), mac)); | |
2103 | 2103 | } |
2104 | 2104 | |
2105 | 2105 | /* setup keyboard */ |
r18027 | r18028 | |
---|---|---|
82 | 82 | return; |
83 | 83 | |
84 | 84 | /* otherwise, generate the IRQ */ |
85 | amiga_custom_w( | |
85 | amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_PORTS, 0xffff); | |
86 | 86 | } |
87 | 87 | |
88 | 88 | static TIMER_CALLBACK(dmac_dma_proc) |
r18027 | r18028 | |
389 | 389 | |
390 | 390 | static void dmac_install(running_machine &machine, offs_t base) |
391 | 391 | { |
392 | address_space &space = | |
392 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
393 | 393 | space.install_legacy_read_handler(base, base + 0xFFFF, FUNC(amiga_dmac_r)); |
394 | 394 | space.install_legacy_write_handler(base, base + 0xFFFF, FUNC(amiga_dmac_w)); |
395 | 395 | } |
396 | 396 | |
397 | 397 | static void dmac_uninstall(running_machine &machine, offs_t base) |
398 | 398 | { |
399 | address_space &space = | |
399 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
400 | 400 | space.unmap_readwrite(base, base + 0xFFFF); |
401 | 401 | } |
402 | 402 | |
r18027 | r18028 | |
457 | 457 | |
458 | 458 | if ( (CUSTOM_REG(REG_INTREQ) & INTENA_PORTS) == 0 ) |
459 | 459 | { |
460 | amiga_custom_w( | |
460 | amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_PORTS, 0xffff); | |
461 | 461 | } |
462 | 462 | else |
463 | 463 | { |
r18027 | r18028 | |
474 | 474 | { |
475 | 475 | if ( (CUSTOM_REG(REG_INTREQ) & INTENA_PORTS) == 0 ) |
476 | 476 | { |
477 | amiga_custom_w( | |
477 | amiga_custom_w(device->machine().device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_PORTS, 0xffff); | |
478 | 478 | } |
479 | 479 | else |
480 | 480 | { |
r18027 | r18028 | |
---|---|---|
634 | 634 | /* SIMPL emulation */ |
635 | 635 | device->machine().device<dac_device>("dac")->write_signed8(data); |
636 | 636 | else |
637 | device->machine().device<centronics_device>("centronics")->write( | |
637 | device->machine().device<centronics_device>("centronics")->write(device->machine().driver_data()->generic_space(), 0, data); | |
638 | 638 | } |
639 | 639 | |
640 | 640 | READ8_DEVICE_HANDLER( msx_printer_status_r ) |
r18027 | r18028 | |
---|---|---|
109 | 109 | m_ppi = machine().device<i8255_device>("ppi8255"); |
110 | 110 | |
111 | 111 | /* reset memory map to defaults */ |
112 | mz700_bank_4_w( | |
112 | mz700_bank_4_w(machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0); | |
113 | 113 | } |
114 | 114 | |
115 | 115 | |
r18027 | r18028 | |
143 | 143 | READ8_MEMBER(mz_state::mz800_bank_0_r) |
144 | 144 | { |
145 | 145 | UINT8 *videoram = m_videoram; |
146 | address_space | |
146 | address_space &spc = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
147 | 147 | |
148 | 148 | /* switch in cgrom */ |
149 | spc->install_read_bank(0x1000, 0x1fff, "bank2"); | |
150 | spc->nop_write(0x1000, 0x1fff); | |
149 | spc.install_read_bank(0x1000, 0x1fff, "bank2"); | |
150 | spc.nop_write(0x1000, 0x1fff); | |
151 | 151 | membank("bank2")->set_base(machine().root_device().memregion("monitor")->base() + 0x1000); |
152 | 152 | |
153 | 153 | if (m_mz700_mode) |
154 | 154 | { |
155 | 155 | /* cgram from 0xc000 to 0xcfff */ |
156 | spc->install_read_bank(0xc000, 0xcfff, "bank6"); | |
157 | spc->install_write_handler(0xc000, 0xcfff, write8_delegate(FUNC(mz_state::mz800_cgram_w),this)); | |
156 | spc.install_read_bank(0xc000, 0xcfff, "bank6"); | |
157 | spc.install_write_handler(0xc000, 0xcfff, write8_delegate(FUNC(mz_state::mz800_cgram_w),this)); | |
158 | 158 | membank("bank6")->set_base(m_cgram); |
159 | 159 | } |
160 | 160 | else |
r18027 | r18028 | |
162 | 162 | if (m_hires_mode) |
163 | 163 | { |
164 | 164 | /* vram from 0x8000 to 0xbfff */ |
165 | spc | |
165 | spc.install_readwrite_bank(0x8000, 0xbfff, "bank4"); | |
166 | 166 | membank("bank4")->set_base(videoram); |
167 | 167 | } |
168 | 168 | else |
169 | 169 | { |
170 | 170 | /* vram from 0x8000 to 0x9fff */ |
171 | spc | |
171 | spc.install_readwrite_bank(0x8000, 0x9fff, "bank4"); | |
172 | 172 | membank("bank4")->set_base(videoram); |
173 | 173 | |
174 | 174 | /* ram from 0xa000 to 0xbfff */ |
175 | spc | |
175 | spc.install_readwrite_bank(0xa000, 0xbfff, "bank5"); | |
176 | 176 | membank("bank5")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0xa000); |
177 | 177 | } |
178 | 178 | } |
r18027 | r18028 | |
182 | 182 | |
183 | 183 | WRITE8_MEMBER(mz_state::mz700_bank_0_w) |
184 | 184 | { |
185 | address_space | |
185 | address_space &spc = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
186 | 186 | |
187 | spc | |
187 | spc.install_readwrite_bank(0x0000, 0x0fff, "bank1"); | |
188 | 188 | membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer()); |
189 | 189 | } |
190 | 190 | |
191 | 191 | WRITE8_MEMBER(mz_state::mz800_bank_0_w) |
192 | 192 | { |
193 | address_space | |
193 | address_space &spc = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
194 | 194 | |
195 | spc | |
195 | spc.install_readwrite_bank(0x0000, 0x7fff, "bank1"); | |
196 | 196 | membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer()); |
197 | 197 | } |
198 | 198 | |
199 | 199 | READ8_MEMBER(mz_state::mz800_bank_1_r) |
200 | 200 | { |
201 | address_space | |
201 | address_space &spc = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
202 | 202 | |
203 | 203 | /* switch in ram from 0x1000 to 0x1fff */ |
204 | spc | |
204 | spc.install_readwrite_bank(0x1000, 0x1fff, "bank2"); | |
205 | 205 | membank("bank2")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0x1000); |
206 | 206 | |
207 | 207 | if (m_mz700_mode) |
208 | 208 | { |
209 | 209 | /* ram from 0xc000 to 0xcfff */ |
210 | spc | |
210 | spc.install_readwrite_bank(0xc000, 0xcfff, "bank6"); | |
211 | 211 | membank("bank6")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0xc000); |
212 | 212 | } |
213 | 213 | else |
214 | 214 | { |
215 | 215 | /* ram from 0x8000 to 0xbfff */ |
216 | spc | |
216 | spc.install_readwrite_bank(0x8000, 0xbfff, "bank4"); | |
217 | 217 | membank("bank4")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0x8000); |
218 | 218 | } |
219 | 219 | |
r18027 | r18028 | |
222 | 222 | |
223 | 223 | WRITE8_MEMBER(mz_state::mz700_bank_1_w) |
224 | 224 | { |
225 | address_space | |
225 | address_space &spc = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
226 | 226 | |
227 | 227 | if (m_mz700_mode) |
228 | 228 | { |
229 | 229 | /* switch in ram when not locked */ |
230 | 230 | if (!m_mz700_ram_lock) |
231 | 231 | { |
232 | spc | |
232 | spc.install_readwrite_bank(0xd000, 0xffff, "bank7"); | |
233 | 233 | membank("bank7")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0xd000); |
234 | 234 | m_mz700_ram_vram = FALSE; |
235 | 235 | } |
r18027 | r18028 | |
239 | 239 | /* switch in ram when not locked */ |
240 | 240 | if (!m_mz800_ram_lock) |
241 | 241 | { |
242 | spc | |
242 | spc.install_readwrite_bank(0xe000, 0xffff, "bank8"); | |
243 | 243 | membank("bank8")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0xe000); |
244 | 244 | m_mz800_ram_monitor = FALSE; |
245 | 245 | } |
r18027 | r18028 | |
248 | 248 | |
249 | 249 | WRITE8_MEMBER(mz_state::mz700_bank_2_w) |
250 | 250 | { |
251 | address_space | |
251 | address_space &spc = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
252 | 252 | |
253 | spc->install_read_bank(0x0000, 0x0fff, "bank1"); | |
254 | spc->nop_write(0x0000, 0x0fff); | |
253 | spc.install_read_bank(0x0000, 0x0fff, "bank1"); | |
254 | spc.nop_write(0x0000, 0x0fff); | |
255 | 255 | membank("bank1")->set_base(machine().root_device().memregion("monitor")->base()); |
256 | 256 | } |
257 | 257 | |
258 | 258 | WRITE8_MEMBER(mz_state::mz700_bank_3_w) |
259 | 259 | { |
260 | 260 | UINT8 *videoram = m_videoram; |
261 | address_space | |
261 | address_space &spc = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
262 | 262 | |
263 | 263 | if (m_mz700_mode) |
264 | 264 | { |
265 | 265 | if (!m_mz700_ram_lock) |
266 | 266 | { |
267 | 267 | /* switch in videoram */ |
268 | spc | |
268 | spc.install_readwrite_bank(0xd000, 0xd7ff, "bank7"); | |
269 | 269 | membank("bank7")->set_base(videoram); |
270 | 270 | |
271 | 271 | /* switch in colorram */ |
272 | spc | |
272 | spc.install_readwrite_bank(0xd800, 0xdfff, "bank9"); | |
273 | 273 | membank("bank9")->set_base(m_colorram); |
274 | 274 | |
275 | 275 | m_mz700_ram_vram = TRUE; |
r18027 | r18028 | |
277 | 277 | /* switch in memory mapped i/o devices */ |
278 | 278 | if (m_mz700) |
279 | 279 | { |
280 | spc->install_readwrite_handler(0xe000, 0xfff3, 0, 0x1ff0, read8_delegate(FUNC(i8255_device::read), (i8255_device*)m_ppi), write8_delegate(FUNC(i8255_device::write), (i8255_device*)m_ppi)); | |
281 | spc->install_legacy_readwrite_handler(*m_pit, 0xe004, 0xfff7, 0, 0x1ff0, FUNC(pit8253_r), FUNC(pit8253_w)); | |
282 | spc->install_readwrite_handler(0xe008, 0xfff8, 0, 0x1ff0, read8_delegate(FUNC(mz_state::mz700_e008_r),this), write8_delegate(FUNC(mz_state::mz700_e008_w),this)); | |
280 | spc.install_readwrite_handler(0xe000, 0xfff3, 0, 0x1ff0, read8_delegate(FUNC(i8255_device::read), (i8255_device*)m_ppi), write8_delegate(FUNC(i8255_device::write), (i8255_device*)m_ppi)); | |
281 | spc.install_legacy_readwrite_handler(*m_pit, 0xe004, 0xfff7, 0, 0x1ff0, FUNC(pit8253_r), FUNC(pit8253_w)); | |
282 | spc.install_readwrite_handler(0xe008, 0xfff8, 0, 0x1ff0, read8_delegate(FUNC(mz_state::mz700_e008_r),this), write8_delegate(FUNC(mz_state::mz700_e008_w),this)); | |
283 | 283 | } |
284 | 284 | else |
285 | 285 | { |
286 | spc->install_readwrite_handler(0xe000, 0xe003, read8_delegate(FUNC(i8255_device::read), (i8255_device*)m_ppi), write8_delegate(FUNC(i8255_device::write), (i8255_device*)m_ppi)); | |
287 | spc->install_legacy_readwrite_handler(*m_pit, 0xe004, 0xe007, FUNC(pit8253_r), FUNC(pit8253_w)); | |
288 | spc->install_readwrite_handler(0xe008, 0xe008, read8_delegate(FUNC(mz_state::mz700_e008_r),this), write8_delegate(FUNC(mz_state::mz700_e008_w),this)); | |
286 | spc.install_readwrite_handler(0xe000, 0xe003, read8_delegate(FUNC(i8255_device::read), (i8255_device*)m_ppi), write8_delegate(FUNC(i8255_device::write), (i8255_device*)m_ppi)); | |
287 | spc.install_legacy_readwrite_handler(*m_pit, 0xe004, 0xe007, FUNC(pit8253_r), FUNC(pit8253_w)); | |
288 | spc.install_readwrite_handler(0xe008, 0xe008, read8_delegate(FUNC(mz_state::mz700_e008_r),this), write8_delegate(FUNC(mz_state::mz700_e008_w),this)); | |
289 | 289 | } |
290 | 290 | } |
291 | 291 | } |
r18027 | r18028 | |
294 | 294 | if (!m_mz800_ram_lock) |
295 | 295 | { |
296 | 296 | /* switch in mz800 monitor rom if not locked */ |
297 | spc->install_read_bank(0xe000, 0xffff, "bank8"); | |
298 | spc->nop_write(0xe000, 0xffff); | |
297 | spc.install_read_bank(0xe000, 0xffff, "bank8"); | |
298 | spc.nop_write(0xe000, 0xffff); | |
299 | 299 | membank("bank8")->set_base(machine().root_device().memregion("monitor")->base() + 0x2000); |
300 | 300 | m_mz800_ram_monitor = TRUE; |
301 | 301 | } |
r18027 | r18028 | |
305 | 305 | WRITE8_MEMBER(mz_state::mz700_bank_4_w) |
306 | 306 | { |
307 | 307 | UINT8 *videoram = m_videoram; |
308 | address_space | |
308 | address_space &spc = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
309 | 309 | |
310 | 310 | if (m_mz700_mode) |
311 | 311 | { |
r18027 | r18028 | |
314 | 314 | mz700_bank_3_w(space, 0, 0); /* switch in videoram, colorram, and mmio */ |
315 | 315 | |
316 | 316 | /* rest is ram is always ram in mz700 mode */ |
317 | spc | |
317 | spc.install_readwrite_bank(0x1000, 0xcfff, "bank2"); | |
318 | 318 | membank("bank2")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0x1000); |
319 | 319 | } |
320 | 320 | else |
321 | 321 | { |
322 | 322 | /* monitor rom and cgrom */ |
323 | spc->install_read_bank(0x0000, 0x1fff, "bank1"); | |
324 | spc->nop_write(0x0000, 0x1fff); | |
323 | spc.install_read_bank(0x0000, 0x1fff, "bank1"); | |
324 | spc.nop_write(0x0000, 0x1fff); | |
325 | 325 | membank("bank1")->set_base(machine().root_device().memregion("monitor")->base()); |
326 | 326 | |
327 | 327 | /* ram from 0x2000 to 0x7fff */ |
328 | spc | |
328 | spc.install_readwrite_bank(0x2000, 0x7fff, "bank3"); | |
329 | 329 | membank("bank3")->set_base(machine().device<ram_device>(RAM_TAG)->pointer()); |
330 | 330 | |
331 | 331 | if (m_hires_mode) |
332 | 332 | { |
333 | 333 | /* vram from 0x8000 to 0xbfff */ |
334 | spc | |
334 | spc.install_readwrite_bank(0x8000, 0xbfff, "bank4"); | |
335 | 335 | membank("bank4")->set_base(videoram); |
336 | 336 | } |
337 | 337 | else |
338 | 338 | { |
339 | 339 | /* vram from 0x8000 to 0x9fff */ |
340 | spc | |
340 | spc.install_readwrite_bank(0x8000, 0x9fff, "bank4"); | |
341 | 341 | membank("bank4")->set_base(videoram); |
342 | 342 | |
343 | 343 | /* ram from 0xa000 to 0xbfff */ |
344 | spc | |
344 | spc.install_readwrite_bank(0xa000, 0xbfff, "bank5"); | |
345 | 345 | membank("bank5")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0xa000); |
346 | 346 | } |
347 | 347 | |
348 | 348 | /* ram from 0xc000 to 0xdfff */ |
349 | spc | |
349 | spc.install_readwrite_bank(0xc000, 0xdfff, "bank6"); | |
350 | 350 | membank("bank6")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0xc000); |
351 | 351 | |
352 | 352 | /* mz800 monitor rom from 0xe000 to 0xffff */ |
353 | spc->install_read_bank(0xe000, 0xffff, "bank8"); | |
354 | spc->nop_write(0xe000, 0xffff); | |
353 | spc.install_read_bank(0xe000, 0xffff, "bank8"); | |
354 | spc.nop_write(0xe000, 0xffff); | |
355 | 355 | membank("bank8")->set_base(machine().root_device().memregion("monitor")->base() + 0x2000); |
356 | 356 | m_mz800_ram_monitor = TRUE; |
357 | 357 | |
r18027 | r18028 | |
361 | 361 | |
362 | 362 | WRITE8_MEMBER(mz_state::mz700_bank_5_w) |
363 | 363 | { |
364 | address_space | |
364 | address_space &spc = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
365 | 365 | |
366 | 366 | if (m_mz700_mode) |
367 | 367 | { |
368 | 368 | /* prevent access from 0xd000 to 0xffff */ |
369 | 369 | m_mz700_ram_lock = TRUE; |
370 | spc | |
370 | spc.nop_readwrite(0xd000, 0xffff); | |
371 | 371 | } |
372 | 372 | else |
373 | 373 | { |
374 | 374 | /* prevent access from 0xe000 to 0xffff */ |
375 | 375 | m_mz800_ram_lock = TRUE; |
376 | spc | |
376 | spc.nop_readwrite(0xe000, 0xffff); | |
377 | 377 | } |
378 | 378 | } |
379 | 379 |
r18027 | r18028 | |
---|---|---|
237 | 237 | { |
238 | 238 | lisa_state *state = machine.driver_data<lisa_state>(); |
239 | 239 | via6522_device *via_0 = machine.device<via6522_device>("via6522_0"); |
240 | address_space &space = | |
240 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
241 | 241 | |
242 | 242 | if ((! state->m_hold_COPS_data) && state->m_fifo_size && (! state->m_COPS_Ready)) |
243 | 243 | { |
r18027 | r18028 | |
427 | 427 | lisa_state *state = machine.driver_data<lisa_state>(); |
428 | 428 | int command; |
429 | 429 | via6522_device *via_0 = machine.device<via6522_device>("via6522_0"); |
430 | address_space &space = | |
430 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
431 | 431 | |
432 | 432 | state->m_COPS_Ready = 0; |
433 | 433 | |
r18027 | r18028 | |
1043 | 1043 | m_rom_ptr = machine().root_device().memregion("maincpu")->base() + ROM_OFFSET; |
1044 | 1044 | m_videoROM_ptr = memregion("gfx1")->base(); |
1045 | 1045 | |
1046 | // machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1046 | // machine().device("maincpu")->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate_create_static(lisa_OPbaseoverride, *machine())); | |
1047 | 1047 | // m68k_set_reset_callback(machine().device("maincpu"), /*lisa_reset_instr_callback*/NULL); |
1048 | 1048 | |
1049 | 1049 | /* init MMU */ |
r18027 | r18028 | |
---|---|---|
47 | 47 | |
48 | 48 | void cgenie_state::machine_reset() |
49 | 49 | { |
50 | address_space &space = | |
50 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
51 | 51 | device_t *ay8910 = machine().device("ay8910"); |
52 | 52 | UINT8 *ROM = memregion("maincpu")->base(); |
53 | 53 | |
r18027 | r18028 | |
124 | 124 | |
125 | 125 | void cgenie_state::machine_start() |
126 | 126 | { |
127 | address_space &space = | |
127 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
128 | 128 | UINT8 *gfx = memregion("gfx2")->base(); |
129 | 129 | int i; |
130 | 130 | |
r18027 | r18028 | |
597 | 597 | m_tv_mode = ioport("DSW0")->read() & 0x10; |
598 | 598 | /* force setting of background color */ |
599 | 599 | m_port_ff ^= FF_BGD0; |
600 | cgenie_port_ff_w( | |
600 | cgenie_port_ff_w(machine().device("maincpu")->memory().space(AS_PROGRAM), 0, m_port_ff ^ FF_BGD0); | |
601 | 601 | } |
602 | 602 | } |
603 | 603 |
r18027 | r18028 | |
---|---|---|
703 | 703 | |
704 | 704 | int i; int colors; |
705 | 705 | |
706 | state->m_blitter.mem = (UINT8*)machine.device("maincpu")->memory().space(AS_PROGRAM) | |
706 | state->m_blitter.mem = (UINT8*)machine.device("maincpu")->memory().space(AS_PROGRAM).get_read_ptr(0x0000); | |
707 | 707 | |
708 | 708 | state->m_blitter.busy = 1; // blitter working |
709 | 709 | state->m_blitter.memory_accesses = 0; |
r18027 | r18028 | |
1927 | 1927 | static void lynx_reset(running_machine &machine) |
1928 | 1928 | { |
1929 | 1929 | lynx_state *state = machine.driver_data<lynx_state>(); |
1930 | state->lynx_memory_config_w( | |
1930 | state->lynx_memory_config_w(machine.device("maincpu")->memory().space(AS_PROGRAM), 0, 0); | |
1931 | 1931 | |
1932 | 1932 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); |
1933 | 1933 | machine.device("maincpu")->execute().set_input_line(M65SC02_IRQ_LINE, CLEAR_LINE); |
r18027 | r18028 | |
1959 | 1959 | |
1960 | 1960 | static void lynx_postload(lynx_state *state) |
1961 | 1961 | { |
1962 | state->lynx_memory_config_w( | |
1962 | state->lynx_memory_config_w( state->machine().device("maincpu")->memory().space(AS_PROGRAM), 0, state->m_memory_config); | |
1963 | 1963 | } |
1964 | 1964 | |
1965 | 1965 | void lynx_state::machine_start() |
r18027 | r18028 | |
---|---|---|
202 | 202 | void isa8_device::install_space(address_spacenum spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_space_func rhandler, const char* rhandler_name, write8_space_func whandler, const char *whandler_name) |
203 | 203 | { |
204 | 204 | int buswidth = m_maincpu->space_config(spacenum)->m_databus_width; |
205 | address_space &space = m_maincpu->space(spacenum); | |
205 | 206 | switch(buswidth) |
206 | 207 | { |
207 | 208 | case 8: |
208 | | |
209 | space.install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0); | |
209 | 210 | break; |
210 | 211 | case 16: |
211 | | |
212 | space.install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff); | |
212 | 213 | break; |
213 | 214 | case 32: |
214 | 215 | if ((start % 4) == 0) { |
215 | 216 | if ((end-start)==1) { |
216 | | |
217 | space.install_legacy_readwrite_handler(start, end+2, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0x0000ffff); | |
217 | 218 | } else { |
218 | | |
219 | space.install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffffffff); | |
219 | 220 | } |
220 | 221 | } else { |
221 | 222 | // we handle just misalligned by 2 |
222 | | |
223 | space.install_legacy_readwrite_handler(start-2, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff0000); | |
223 | 224 | } |
224 | 225 | break; |
225 | 226 | default: |
r18027 | r18028 | |
232 | 233 | void isa8_device::install_space(address_spacenum spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_delegate rhandler, write8_delegate whandler) |
233 | 234 | { |
234 | 235 | int buswidth = m_maincpu->space_config(spacenum)->m_databus_width; |
236 | address_space &space = m_maincpu->space(spacenum); | |
235 | 237 | switch(buswidth) |
236 | 238 | { |
237 | 239 | case 8: |
238 | | |
240 | space.install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0); | |
239 | 241 | break; |
240 | 242 | case 16: |
241 | | |
243 | space.install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0xffff); | |
242 | 244 | break; |
243 | 245 | case 32: |
244 | 246 | if ((start % 4) == 0) { |
245 | 247 | if ((end-start)==1) { |
246 | | |
248 | space.install_readwrite_handler(start, end+2, mask, mirror, rhandler, whandler, 0x0000ffff); | |
247 | 249 | } else { |
248 | | |
250 | space.install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0xffffffff); | |
249 | 251 | } |
250 | 252 | } else { |
251 | 253 | // we handle just misalligned by 2 |
252 | | |
254 | space.install_readwrite_handler(start-2, end, mask, mirror, rhandler, whandler, 0xffff0000); | |
253 | 255 | } |
254 | 256 | break; |
255 | 257 | default: |
r18027 | r18028 | |
262 | 264 | void isa8_device::install_space(address_spacenum spacenum, device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_device_func rhandler, const char* rhandler_name, write8_device_func whandler, const char *whandler_name) |
263 | 265 | { |
264 | 266 | int buswidth = m_maincpu->space_config(spacenum)->m_databus_width; |
267 | address_space &space = m_maincpu->space(spacenum); | |
265 | 268 | switch(buswidth) |
266 | 269 | { |
267 | 270 | case 8: |
268 | | |
271 | space.install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0); | |
269 | 272 | break; |
270 | 273 | case 16: |
271 | | |
274 | space.install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff); | |
272 | 275 | break; |
273 | 276 | case 32: |
274 | 277 | if ((start % 4) == 0) { |
275 | 278 | if ((end-start)==1) { |
276 | | |
279 | space.install_legacy_readwrite_handler(*dev, start, end+2, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0x0000ffff); | |
277 | 280 | } else { |
278 | | |
281 | space.install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffffffff); | |
279 | 282 | } |
280 | 283 | } else { |
281 | 284 | // we handle just misalligned by 2 |
282 | | |
285 | space.install_legacy_readwrite_handler(*dev, start-2, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff0000); | |
283 | 286 | } |
284 | 287 | break; |
285 | 288 | default: |
r18027 | r18028 | |
327 | 330 | |
328 | 331 | void isa8_device::install_bank(offs_t start, offs_t end, offs_t mask, offs_t mirror, const char *tag, UINT8 *data) |
329 | 332 | { |
330 | address_space &space = | |
333 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
331 | 334 | space.install_readwrite_bank(start, end, mask, mirror, tag ); |
332 | 335 | machine().root_device().membank(tag)->set_base(data); |
333 | 336 | } |
334 | 337 | |
335 | 338 | void isa8_device::unmap_bank(offs_t start, offs_t end, offs_t mask, offs_t mirror) |
336 | 339 | { |
337 | address_space &space = | |
340 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
338 | 341 | space.unmap_readwrite(start, end, mask, mirror); |
339 | 342 | } |
340 | 343 | |
r18027 | r18028 | |
346 | 349 | UINT8 *dest = machine().root_device().memregion("isa")->base() + start - 0xc0000; |
347 | 350 | memcpy(dest,src, end - start + 1); |
348 | 351 | } else { |
349 | address_space &space = | |
352 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
350 | 353 | space.install_read_bank(start, end, mask, mirror, tag); |
351 | 354 | space.unmap_write(start, end, mask, mirror); |
352 | 355 | machine().root_device().membank(tag)->set_base(machine().root_device().memregion(dev->subtag(tempstring, region))->base()); |
r18027 | r18028 | |
355 | 358 | |
356 | 359 | void isa8_device::unmap_rom(offs_t start, offs_t end, offs_t mask, offs_t mirror) |
357 | 360 | { |
358 | address_space &space = | |
361 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
359 | 362 | space.unmap_read(start, end, mask, mirror); |
360 | 363 | } |
361 | 364 | |
362 | 365 | bool isa8_device::is_option_rom_space_available(offs_t start, int size) |
363 | 366 | { |
364 | 367 | m_maincpu = machine().device<cpu_device>(m_cputag); |
365 | address_space &space = | |
368 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
366 | 369 | for(int i = 0; i < size; i += 4096) // 4KB granularity should be enough |
367 | 370 | if(space.get_read_ptr(start + i)) return false; |
368 | 371 | return true; |
r18027 | r18028 | |
548 | 551 | switch(buswidth) |
549 | 552 | { |
550 | 553 | case 16: |
551 | m_maincpu->space(AS_IO) | |
554 | m_maincpu->space(AS_IO).install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0); | |
552 | 555 | break; |
553 | 556 | case 32: |
554 | 557 | if ((start % 4) == 0) { |
555 | 558 | if ((end-start)==1) { |
556 | m_maincpu->space(AS_IO) | |
559 | m_maincpu->space(AS_IO).install_legacy_readwrite_handler(*dev, start, end+2, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0x0000ffff); | |
557 | 560 | } else { |
558 | m_maincpu->space(AS_IO) | |
561 | m_maincpu->space(AS_IO).install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffffffff); | |
559 | 562 | } |
560 | 563 | } else { |
561 | 564 | // we handle just misalligned by 2 |
562 | m_maincpu->space(AS_IO) | |
565 | m_maincpu->space(AS_IO).install_legacy_readwrite_handler(*dev, start-2, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff0000); | |
563 | 566 | } |
564 | 567 | |
565 | 568 | break; |
r18027 | r18028 | |
575 | 578 | switch(buswidth) |
576 | 579 | { |
577 | 580 | case 16: |
578 | m_maincpu->space(AS_IO) | |
581 | m_maincpu->space(AS_IO).install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0); | |
579 | 582 | break; |
580 | 583 | case 32: |
581 | m_maincpu->space(AS_IO) | |
584 | m_maincpu->space(AS_IO).install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0xffffffff); | |
582 | 585 | if ((start % 4) == 0) { |
583 | 586 | if ((end-start)==1) { |
584 | m_maincpu->space(AS_IO) | |
587 | m_maincpu->space(AS_IO).install_readwrite_handler(start, end+2, mask, mirror, rhandler, whandler, 0x0000ffff); | |
585 | 588 | } else { |
586 | m_maincpu->space(AS_IO) | |
589 | m_maincpu->space(AS_IO).install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0xffffffff); | |
587 | 590 | } |
588 | 591 | } else { |
589 | 592 | // we handle just misalligned by 2 |
590 | m_maincpu->space(AS_IO) | |
593 | m_maincpu->space(AS_IO).install_readwrite_handler(start-2, end, mask, mirror, rhandler, whandler, 0xffff0000); | |
591 | 594 | } |
592 | 595 | |
593 | 596 | break; |
r18027 | r18028 | |
603 | 606 | switch(buswidth) |
604 | 607 | { |
605 | 608 | case 16: |
606 | m_maincpu->space(AS_IO) | |
609 | m_maincpu->space(AS_IO).install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name, 0); | |
607 | 610 | break; |
608 | 611 | case 32: |
609 | m_maincpu->space(AS_IO) | |
612 | m_maincpu->space(AS_IO).install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name, 0xffffffff); | |
610 | 613 | if ((start % 4) == 0) { |
611 | 614 | if ((end-start)==1) { |
612 | m_maincpu->space(AS_IO) | |
615 | m_maincpu->space(AS_IO).install_legacy_readwrite_handler(start, end+2, mask, mirror, rhandler, rhandler_name, whandler, whandler_name, 0x0000ffff); | |
613 | 616 | } else { |
614 | m_maincpu->space(AS_IO) | |
617 | m_maincpu->space(AS_IO).install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name, 0xffffffff); | |
615 | 618 | } |
616 | 619 | } else { |
617 | 620 | // we handle just misalligned by 2 |
618 | m_maincpu->space(AS_IO) | |
621 | m_maincpu->space(AS_IO).install_legacy_readwrite_handler(start-2, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name, 0xffff0000); | |
619 | 622 | } |
620 | 623 | |
621 | 624 | break; |
r18027 | r18028 | |
---|---|---|
287 | 287 | device_t *cpu = machine().device(m_cputag); |
288 | 288 | assert(cpu != NULL); |
289 | 289 | |
290 | m_space = cpu->memory().space(AS_PROGRAM); | |
290 | m_space = &cpu->memory().space(AS_PROGRAM); | |
291 | 291 | |
292 | 292 | /* get rom region */ |
293 | 293 | m_rom = machine().root_device().memregion(m_rom_region)->base(); |
r18027 | r18028 | |
---|---|---|
172 | 172 | |
173 | 173 | WRITE8_MEMBER(lviv_state::lviv_io_w) |
174 | 174 | { |
175 | address_space | |
175 | address_space &cpuspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
176 | 176 | if (m_startup_mem_map) |
177 | 177 | { |
178 | 178 | UINT8 *ram = machine().device<ram_device>(RAM_TAG)->pointer(); |
179 | 179 | |
180 | 180 | m_startup_mem_map = 0; |
181 | 181 | |
182 | cpuspace->install_write_bank(0x0000, 0x3fff, "bank1"); | |
183 | cpuspace->install_write_bank(0x4000, 0x7fff, "bank2"); | |
184 | cpuspace->install_write_bank(0x8000, 0xbfff, "bank3"); | |
185 | cpuspace->unmap_write(0xC000, 0xffff); | |
182 | cpuspace.install_write_bank(0x0000, 0x3fff, "bank1"); | |
183 | cpuspace.install_write_bank(0x4000, 0x7fff, "bank2"); | |
184 | cpuspace.install_write_bank(0x8000, 0xbfff, "bank3"); | |
185 | cpuspace.unmap_write(0xC000, 0xffff); | |
186 | 186 | |
187 | 187 | membank("bank1")->set_base(ram); |
188 | 188 | membank("bank2")->set_base(ram + 0x4000); |
r18027 | r18028 | |
232 | 232 | |
233 | 233 | void lviv_state::machine_reset() |
234 | 234 | { |
235 | address_space &space = | |
235 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
236 | 236 | UINT8 *mem; |
237 | 237 | |
238 | 238 | space.set_direct_update_handler(direct_update_delegate(FUNC(lviv_state::lviv_directoverride), this)); |
r18027 | r18028 | |
---|---|---|
339 | 339 | static void set_ram_size(running_machine &machine) |
340 | 340 | { |
341 | 341 | mbc55x_state *state = machine.driver_data<mbc55x_state>(); |
342 | address_space &space = | |
342 | address_space &space = machine.device( MAINCPU_TAG)->memory().space( AS_PROGRAM ); | |
343 | 343 | int ramsize = state->m_ram->size(); |
344 | 344 | int nobanks = ramsize / RAM_BANK_SIZE; |
345 | 345 | char bank[10]; |
r18027 | r18028 | |
434 | 434 | static int instruction_hook(device_t &device, offs_t curpc) |
435 | 435 | { |
436 | 436 | mbc55x_state *state = device.machine().driver_data<mbc55x_state>(); |
437 | address_space &space = | |
437 | address_space &space = device.memory().space(AS_PROGRAM); | |
438 | 438 | UINT8 *addr_ptr; |
439 | 439 | |
440 | 440 | addr_ptr = (UINT8*)space.get_read_ptr(curpc); |
r18027 | r18028 | |
---|---|---|
194 | 194 | |
195 | 195 | void southbridge_device::device_start() |
196 | 196 | { |
197 | address_space | |
197 | address_space& spaceio = machine().device(":maincpu")->memory().space(AS_IO); | |
198 | 198 | |
199 | spaceio->install_legacy_readwrite_handler(*m_dma8237_1, 0x0000, 0x001f, FUNC(i8237_r), FUNC(i8237_w), 0xffffffff); | |
200 | spaceio->install_legacy_readwrite_handler(*m_pic8259_master, 0x0020, 0x003f, FUNC(pic8259_r), FUNC(pic8259_w), 0xffffffff); | |
201 | spaceio->install_legacy_readwrite_handler(*m_pit8254, 0x0040, 0x005f, FUNC(pit8253_r), FUNC(pit8253_w), 0xffffffff); | |
202 | spaceio->install_readwrite_handler(0x0060, 0x0063, read8_delegate(FUNC(southbridge_device::at_keybc_r),this), write8_delegate(FUNC(southbridge_device::at_keybc_w),this), 0xffffffff); | |
203 | spaceio->install_readwrite_handler(0x0064, 0x0067, read8_delegate(FUNC(at_keyboard_controller_device::status_r),&(*m_keybc)), write8_delegate(FUNC(at_keyboard_controller_device::command_w),&(*m_keybc)), 0xffffffff); | |
204 | spaceio->install_readwrite_handler(0x0070, 0x007f, read8_delegate(FUNC(mc146818_device::read),&(*m_mc146818)), write8_delegate(FUNC(mc146818_device::write),&(*m_mc146818)), 0xffffffff); | |
205 | spaceio->install_readwrite_handler(0x0080, 0x009f, read8_delegate(FUNC(southbridge_device::at_page8_r),this), write8_delegate(FUNC(southbridge_device::at_page8_w),this), 0xffffffff); | |
206 | spaceio->install_legacy_readwrite_handler(*m_pic8259_slave, 0x00a0, 0x00bf, FUNC(pic8259_r), FUNC(pic8259_w), 0xffffffff); | |
207 | spaceio->install_readwrite_handler(0x00c0, 0x00df, read8_delegate(FUNC(southbridge_device::at_dma8237_2_r),this), write8_delegate(FUNC(southbridge_device::at_dma8237_2_w),this), 0xffffffff); | |
208 | spaceio->nop_readwrite(0x00e0, 0x00ef); | |
199 | spaceio.install_legacy_readwrite_handler(*m_dma8237_1, 0x0000, 0x001f, FUNC(i8237_r), FUNC(i8237_w), 0xffffffff); | |
200 | spaceio.install_legacy_readwrite_handler(*m_pic8259_master, 0x0020, 0x003f, FUNC(pic8259_r), FUNC(pic8259_w), 0xffffffff); | |
201 | spaceio.install_legacy_readwrite_handler(*m_pit8254, 0x0040, 0x005f, FUNC(pit8253_r), FUNC(pit8253_w), 0xffffffff); | |
202 | spaceio.install_readwrite_handler(0x0060, 0x0063, read8_delegate(FUNC(southbridge_device::at_keybc_r),this), write8_delegate(FUNC(southbridge_device::at_keybc_w),this), 0xffffffff); | |
203 | spaceio.install_readwrite_handler(0x0064, 0x0067, read8_delegate(FUNC(at_keyboard_controller_device::status_r),&(*m_keybc)), write8_delegate(FUNC(at_keyboard_controller_device::command_w),&(*m_keybc)), 0xffffffff); | |
204 | spaceio.install_readwrite_handler(0x0070, 0x007f, read8_delegate(FUNC(mc146818_device::read),&(*m_mc146818)), write8_delegate(FUNC(mc146818_device::write),&(*m_mc146818)), 0xffffffff); | |
205 | spaceio.install_readwrite_handler(0x0080, 0x009f, read8_delegate(FUNC(southbridge_device::at_page8_r),this), write8_delegate(FUNC(southbridge_device::at_page8_w),this), 0xffffffff); | |
206 | spaceio.install_legacy_readwrite_handler(*m_pic8259_slave, 0x00a0, 0x00bf, FUNC(pic8259_r), FUNC(pic8259_w), 0xffffffff); | |
207 | spaceio.install_readwrite_handler(0x00c0, 0x00df, read8_delegate(FUNC(southbridge_device::at_dma8237_2_r),this), write8_delegate(FUNC(southbridge_device::at_dma8237_2_w),this), 0xffffffff); | |
208 | spaceio.nop_readwrite(0x00e0, 0x00ef); | |
209 | 209 | |
210 | 210 | |
211 | 211 | m_at_offset1 = 0xff; |
r18027 | r18028 | |
---|---|---|
143 | 143 | |
144 | 144 | DRIVER_INIT_MEMBER(apple1_state,apple1) |
145 | 145 | { |
146 | address_space& space = | |
146 | address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
147 | 147 | /* Set up the handlers for MESS's dynamically-sized RAM. */ |
148 | 148 | space.install_readwrite_bank(0x0000, machine().device<ram_device>(RAM_TAG)->size() - 1, "bank1"); |
149 | 149 | membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer()); |
r18027 | r18028 | |
255 | 255 | for (addr = start_addr, snapptr = snapbuf + SNAP_HEADER_LEN; |
256 | 256 | addr <= end_addr; |
257 | 257 | addr++, snapptr++) |
258 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM) | |
258 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).write_byte(addr, *snapptr); | |
259 | 259 | |
260 | 260 | |
261 | 261 | return IMAGE_INIT_PASS; |
r18027 | r18028 | |
---|---|---|
74 | 74 | |
75 | 75 | */ |
76 | 76 | mtx_state *state = machine.driver_data<mtx_state>(); |
77 | address_space | |
77 | address_space &program = machine.device(Z80_TAG)->memory().space(AS_PROGRAM); | |
78 | 78 | ram_device *messram = machine.device<ram_device>(RAM_TAG); |
79 | 79 | |
80 | 80 | // UINT8 cbm_mode = data >> 7 & 0x01; |
r18027 | r18028 | |
87 | 87 | /* set ram bank, for invalid pages a nop-handler will be installed */ |
88 | 88 | if (ram_page >= messram->size()/0x8000) |
89 | 89 | { |
90 | program->nop_readwrite(0x4000, 0x7fff); | |
91 | program->nop_readwrite(0x8000, 0xbfff); | |
90 | program.nop_readwrite(0x4000, 0x7fff); | |
91 | program.nop_readwrite(0x8000, 0xbfff); | |
92 | 92 | } |
93 | 93 | else if (ram_page + 1 == messram->size()/0x8000) |
94 | 94 | { |
95 | program->nop_readwrite(0x4000, 0x7fff); | |
96 | program->install_readwrite_bank(0x8000, 0xbfff, "bank4"); | |
95 | program.nop_readwrite(0x4000, 0x7fff); | |
96 | program.install_readwrite_bank(0x8000, 0xbfff, "bank4"); | |
97 | 97 | state->membank("bank4")->set_entry(ram_page); |
98 | 98 | } |
99 | 99 | else |
100 | 100 | { |
101 | program->install_readwrite_bank(0x4000, 0x7fff, "bank3"); | |
102 | program->install_readwrite_bank(0x8000, 0xbfff, "bank4"); | |
101 | program.install_readwrite_bank(0x4000, 0x7fff, "bank3"); | |
102 | program.install_readwrite_bank(0x8000, 0xbfff, "bank4"); | |
103 | 103 | state->membank("bank3")->set_entry(ram_page); |
104 | 104 | state->membank("bank4")->set_entry(ram_page); |
105 | 105 | } |
r18027 | r18028 | |
333 | 333 | |
334 | 334 | SNAPSHOT_LOAD( mtx ) |
335 | 335 | { |
336 | address_space | |
336 | address_space &program = image.device().machine().device(Z80_TAG)->memory().space(AS_PROGRAM); | |
337 | 337 | |
338 | 338 | UINT8 header[18]; |
339 | 339 | UINT16 addr; |
r18027 | r18028 | |
345 | 345 | { |
346 | 346 | /* long header */ |
347 | 347 | addr = pick_integer_le(header, 16, 2); |
348 | void *ptr = program | |
348 | void *ptr = program.get_write_ptr(addr); | |
349 | 349 | image.fread( ptr, 599); |
350 | ptr = program | |
350 | ptr = program.get_write_ptr(0xc000); | |
351 | 351 | image.fread( ptr, snapshot_size - 599 - 18); |
352 | 352 | } |
353 | 353 | else |
r18027 | r18028 | |
355 | 355 | /* short header */ |
356 | 356 | addr = pick_integer_le(header, 0, 2); |
357 | 357 | image.fseek(4, SEEK_SET); |
358 | void *ptr = program | |
358 | void *ptr = program.get_write_ptr(addr); | |
359 | 359 | image.fread( ptr, 599); |
360 | ptr = program | |
360 | ptr = program.get_write_ptr(0xc000); | |
361 | 361 | image.fread( ptr, snapshot_size - 599 - 4); |
362 | 362 | } |
363 | 363 |
r18027 | r18028 | |
---|---|---|
136 | 136 | |
137 | 137 | void special_state::specimx_set_bank(offs_t i, UINT8 data) |
138 | 138 | { |
139 | address_space &space = | |
139 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
140 | 140 | UINT8 *ram = m_ram->pointer(); |
141 | 141 | |
142 | 142 | space.install_write_bank(0xc000, 0xffbf, "bank3"); |
r18027 | r18028 | |
273 | 273 | UINT8 bank4 = (m_RR_register >> 6) & 3; |
274 | 274 | UINT8 *mem = memregion("maincpu")->base(); |
275 | 275 | UINT8 *ram = m_ram->pointer(); |
276 | address_space &space = | |
276 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
277 | 277 | |
278 | 278 | space.install_write_bank(0x0000, 0x3fff, "bank1"); |
279 | 279 | space.install_write_bank(0x4000, 0x8fff, "bank2"); |
r18027 | r18028 | |
---|---|---|
729 | 729 | { |
730 | 730 | rmnimbus_state *state = machine.driver_data<rmnimbus_state>(); |
731 | 731 | struct dma_state *dma = &state->m_i186.dma[which]; |
732 | address_space *memory_space = machine.device(MAINCPU_TAG)->memory().space(AS_PROGRAM); | |
733 | address_space *io_space = machine.device(MAINCPU_TAG)->memory().space(AS_IO); | |
732 | address_space &memory_space = machine.device(MAINCPU_TAG)->memory().space(AS_PROGRAM); | |
733 | address_space &io_space = machine.device(MAINCPU_TAG)->memory().space(AS_IO); | |
734 | 734 | |
735 | address_space *src_space; | |
736 | address_space *dest_space; | |
737 | ||
738 | 735 | UINT16 dma_word; |
739 | 736 | UINT8 dma_byte; |
740 | 737 | UINT8 incdec_size; |
r18027 | r18028 | |
750 | 747 | return; |
751 | 748 | } |
752 | 749 | |
753 | if(dma->control & DEST_MIO) | |
754 | dest_space=memory_space; | |
755 | else | |
756 | dest_space=io_space; | |
750 | address_space &dest_space = (dma->control & DEST_MIO) ? memory_space : io_space; | |
751 | address_space &src_space = (dma->control & SRC_MIO) ? memory_space : io_space; | |
757 | 752 | |
758 | if(dma->control & SRC_MIO) | |
759 | src_space=memory_space; | |
760 | else | |
761 | src_space=io_space; | |
762 | ||
763 | 753 | // Do the transfer |
764 | 754 | if(dma->control & BYTE_WORD) |
765 | 755 | { |
766 | dma_word=src_space->read_word(dma->source); | |
767 | dest_space->write_word(dma->dest,dma_word); | |
756 | dma_word=src_space.read_word(dma->source); | |
757 | dest_space.write_word(dma->dest,dma_word); | |
768 | 758 | incdec_size=2; |
769 | 759 | } |
770 | 760 | else |
771 | 761 | { |
772 | dma_byte=src_space->read_byte(dma->source); | |
773 | dest_space->write_byte(dma->dest,dma_byte); | |
762 | dma_byte=src_space.read_byte(dma->source); | |
763 | dest_space.write_byte(dma->dest,dma_byte); | |
774 | 764 | incdec_size=1; |
775 | 765 | } |
776 | 766 | |
r18027 | r18028 | |
1232 | 1222 | temp = (data16 & 0x0fff) << 8; |
1233 | 1223 | if (data16 & 0x1000) |
1234 | 1224 | { |
1235 | machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM)->install_read_handler(temp, temp + 0xff, read16_delegate(FUNC(rmnimbus_state::nimbus_i186_internal_port_r),this)); | |
1236 | machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM)->install_write_handler(temp, temp + 0xff, write16_delegate(FUNC(rmnimbus_state::nimbus_i186_internal_port_w),this)); | |
1225 | machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM).install_read_handler(temp, temp + 0xff, read16_delegate(FUNC(rmnimbus_state::nimbus_i186_internal_port_r),this)); | |
1226 | machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM).install_write_handler(temp, temp + 0xff, write16_delegate(FUNC(rmnimbus_state::nimbus_i186_internal_port_w),this)); | |
1237 | 1227 | } |
1238 | 1228 | else |
1239 | 1229 | { |
1240 | 1230 | temp &= 0xffff; |
1241 | machine().device(MAINCPU_TAG)->memory().space(AS_IO)->install_read_handler(temp, temp + 0xff, read16_delegate(FUNC(rmnimbus_state::nimbus_i186_internal_port_r),this)); | |
1242 | machine().device(MAINCPU_TAG)->memory().space(AS_IO)->install_write_handler(temp, temp + 0xff, write16_delegate(FUNC(rmnimbus_state::nimbus_i186_internal_port_w),this)); | |
1231 | machine().device(MAINCPU_TAG)->memory().space(AS_IO).install_read_handler(temp, temp + 0xff, read16_delegate(FUNC(rmnimbus_state::nimbus_i186_internal_port_r),this)); | |
1232 | machine().device(MAINCPU_TAG)->memory().space(AS_IO).install_write_handler(temp, temp + 0xff, write16_delegate(FUNC(rmnimbus_state::nimbus_i186_internal_port_w),this)); | |
1243 | 1233 | } |
1244 | 1234 | break; |
1245 | 1235 | |
r18027 | r18028 | |
1346 | 1336 | static int instruction_hook(device_t &device, offs_t curpc) |
1347 | 1337 | { |
1348 | 1338 | rmnimbus_state *state = device.machine().driver_data<rmnimbus_state>(); |
1349 | address_space &space = | |
1339 | address_space &space = device.memory().space(AS_PROGRAM); | |
1350 | 1340 | UINT8 *addr_ptr; |
1351 | 1341 | |
1352 | 1342 | addr_ptr = (UINT8*)space.get_read_ptr(curpc); |
r18027 | r18028 | |
1725 | 1715 | |
1726 | 1716 | static void decode_dssi_generic(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag) |
1727 | 1717 | { |
1728 | address_space &space = | |
1718 | address_space &space = device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM); | |
1729 | 1719 | UINT16 *params; |
1730 | 1720 | int count; |
1731 | 1721 | |
r18027 | r18028 | |
1743 | 1733 | |
1744 | 1734 | static void decode_dssi_f_fill_area(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag) |
1745 | 1735 | { |
1746 | address_space &space = | |
1736 | address_space &space = device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM); | |
1747 | 1737 | |
1748 | 1738 | UINT16 *addr_ptr; |
1749 | 1739 | t_area_params *area_params; |
r18027 | r18028 | |
1796 | 1786 | |
1797 | 1787 | static void decode_dssi_f_plot_character_string(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag) |
1798 | 1788 | { |
1799 | address_space &space = | |
1789 | address_space &space = device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM); | |
1800 | 1790 | |
1801 | 1791 | UINT8 *char_ptr; |
1802 | 1792 | t_plot_string_params *plot_string_params; |
r18027 | r18028 | |
1825 | 1815 | |
1826 | 1816 | static void decode_dssi_f_set_new_clt(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag) |
1827 | 1817 | { |
1828 | address_space &space = | |
1818 | address_space &space = device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM); | |
1829 | 1819 | UINT16 *new_colours; |
1830 | 1820 | int colour; |
1831 | 1821 | new_colours=(UINT16 *)get_dssi_ptr(space,ds,si); |
r18027 | r18028 | |
1842 | 1832 | |
1843 | 1833 | static void decode_dssi_f_plonk_char(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag) |
1844 | 1834 | { |
1845 | address_space &space = | |
1835 | address_space &space = device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM); | |
1846 | 1836 | UINT16 *params; |
1847 | 1837 | params=(UINT16 *)get_dssi_ptr(space,ds,si); |
1848 | 1838 | |
r18027 | r18028 | |
1856 | 1846 | |
1857 | 1847 | static void decode_dssi_f_rw_sectors(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag) |
1858 | 1848 | { |
1859 | address_space &space = | |
1849 | address_space &space = device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM); | |
1860 | 1850 | UINT16 *params; |
1861 | 1851 | int param_no; |
1862 | 1852 | |
r18027 | r18028 | |
1992 | 1982 | static void nimbus_bank_memory(running_machine &machine) |
1993 | 1983 | { |
1994 | 1984 | rmnimbus_state *state = machine.driver_data<rmnimbus_state>(); |
1995 | address_space &space = | |
1985 | address_space &space = machine.device( MAINCPU_TAG)->memory().space( AS_PROGRAM ); | |
1996 | 1986 | int ramsize = machine.device<ram_device>(RAM_TAG)->size(); |
1997 | 1987 | int ramblock = 0; |
1998 | 1988 | int blockno; |
r18027 | r18028 | |
---|---|---|
85 | 85 | { |
86 | 86 | pp01_state *state = machine.driver_data<pp01_state>(); |
87 | 87 | UINT8 *mem = state->memregion("maincpu")->base(); |
88 | address_space &space = | |
88 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
89 | 89 | UINT16 startaddr = block*0x1000; |
90 | 90 | UINT16 endaddr = ((block+1)*0x1000)-1; |
91 | 91 | UINT8 blocknum = block + 1; |
r18027 | r18028 | |
---|---|---|
40 | 40 | |
41 | 41 | static void init_ram_handler(running_machine &machine, offs_t start, offs_t size, offs_t mirror) |
42 | 42 | { |
43 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(start, start + size - 1, 0, mirror - size, "bank1"); | |
44 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(start, start + size - 1, 0, mirror - size, "bank1"); | |
43 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(start, start + size - 1, 0, mirror - size, "bank1"); | |
44 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(start, start + size - 1, 0, mirror - size, "bank1"); | |
45 | 45 | machine.root_device().membank( "bank1" )->set_base( machine.device<ram_device>(RAM_TAG)->pointer()); |
46 | 46 | } |
47 | 47 |
r18027 | r18028 | |
---|---|---|
59 | 59 | void apple2_update_memory(running_machine &machine) |
60 | 60 | { |
61 | 61 | apple2_state *state = machine.driver_data<apple2_state>(); |
62 | address_space& space = | |
62 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
63 | 63 | int i, bank; |
64 | 64 | char rbank[10], wbank[10]; |
65 | 65 | int full_update = 0; |
r18027 | r18028 | |
---|---|---|
231 | 231 | static void pk8020_set_bank(running_machine &machine,UINT8 data) |
232 | 232 | { |
233 | 233 | pk8020_state *state = machine.driver_data<pk8020_state>(); |
234 | address_space &space = | |
234 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
235 | 235 | UINT8 *mem = state->memregion("maincpu")->base(); |
236 | 236 | UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer(); |
237 | 237 |
r18027 | r18028 | |
---|---|---|
61 | 61 | datasize = image.length() - 128; |
62 | 62 | } |
63 | 63 | |
64 | address_space &space = | |
64 | address_space &space = state->m_maincpu->space( AS_PROGRAM ); | |
65 | 65 | |
66 | 66 | for (i=0; i<datasize; i++) |
67 | 67 | space.write_byte((addr+i) & 0xffff, data[i+128]); |
r18027 | r18028 | |
290 | 290 | /* update status of memory area 0x0000-0x03fff */ |
291 | 291 | void kc_state::update_0x00000() |
292 | 292 | { |
293 | address_space &space = | |
293 | address_space &space = m_maincpu->space( AS_PROGRAM ); | |
294 | 294 | |
295 | 295 | /* access ram? */ |
296 | 296 | if (m_pio_data[0] & (1<<1)) |
r18027 | r18028 | |
330 | 330 | /* update status of memory area 0x4000-0x07fff */ |
331 | 331 | void kc_state::update_0x04000() |
332 | 332 | { |
333 | address_space &space = | |
333 | address_space &space = m_maincpu->space( AS_PROGRAM ); | |
334 | 334 | |
335 | 335 | LOG(("Module at 0x4000\n")); |
336 | 336 | |
r18027 | r18028 | |
343 | 343 | /* update memory address 0x0c000-0x0e000 */ |
344 | 344 | void kc_state::update_0x0c000() |
345 | 345 | { |
346 | address_space &space = | |
346 | address_space &space = m_maincpu->space( AS_PROGRAM ); | |
347 | 347 | |
348 | 348 | if ((m_pio_data[0] & (1<<7)) && memregion("basic")->base() != NULL) |
349 | 349 | { |
r18027 | r18028 | |
366 | 366 | /* update memory address 0x0e000-0x0ffff */ |
367 | 367 | void kc_state::update_0x0e000() |
368 | 368 | { |
369 | address_space &space = | |
369 | address_space &space = m_maincpu->space( AS_PROGRAM ); | |
370 | 370 | |
371 | 371 | if (m_pio_data[0] & (1<<0)) |
372 | 372 | { |
r18027 | r18028 | |
390 | 390 | /* update status of memory area 0x08000-0x0ffff */ |
391 | 391 | void kc_state::update_0x08000() |
392 | 392 | { |
393 | address_space &space = | |
393 | address_space &space = m_maincpu->space( AS_PROGRAM ); | |
394 | 394 | |
395 | 395 | if (m_pio_data[0] & (1<<2)) |
396 | 396 | { |
r18027 | r18028 | |
413 | 413 | /* update status of memory area 0x4000-0x07fff */ |
414 | 414 | void kc85_4_state::update_0x04000() |
415 | 415 | { |
416 | address_space &space = | |
416 | address_space &space = m_maincpu->space( AS_PROGRAM ); | |
417 | 417 | |
418 | 418 | /* access ram? */ |
419 | 419 | if (m_port_86_data & (1<<0)) |
r18027 | r18028 | |
455 | 455 | /* update memory address 0x0c000-0x0e000 */ |
456 | 456 | void kc85_4_state::update_0x0c000() |
457 | 457 | { |
458 | address_space &space = | |
458 | address_space &space = m_maincpu->space( AS_PROGRAM ); | |
459 | 459 | |
460 | 460 | if (m_port_86_data & (1<<7)) |
461 | 461 | { |
r18027 | r18028 | |
491 | 491 | |
492 | 492 | void kc85_4_state::update_0x08000() |
493 | 493 | { |
494 | address_space &space = | |
494 | address_space &space = m_maincpu->space( AS_PROGRAM ); | |
495 | 495 | |
496 | 496 | if (m_pio_data[0] & (1<<2)) |
497 | 497 | { |
r18027 | r18028 | |
---|---|---|
130 | 130 | UINT32 hp48_state::screen_update_hp48(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
131 | 131 | { |
132 | 132 | hp48_state *state = machine().driver_data<hp48_state>(); |
133 | address_space &space = | |
133 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
134 | 134 | int x, y, xp, i, addr; |
135 | 135 | int display = HP48_IO_4(0) >> 3; /* 1=on, 0=off */ |
136 | 136 | int left_margin = HP48_IO_4(0) & 7; /* 0..7 pixels for main bitmap */ |
r18027 | r18028 | |
---|---|---|
40 | 40 | void apple3_write_charmem(running_machine &machine) |
41 | 41 | { |
42 | 42 | apple3_state *state = machine.driver_data<apple3_state>(); |
43 | address_space& space = | |
43 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
44 | 44 | static const UINT32 screen_hole_map[] = |
45 | 45 | { |
46 | 46 | 0x478, 0x4f8, 0x578, 0x5f8, 0x678, 0x6f8, 0x778, 0x7f8 |
r18027 | r18028 | |
---|---|---|
57 | 57 | |
58 | 58 | UINT32 dai_state::screen_update_dai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
59 | 59 | { |
60 | address_space &space = | |
60 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
61 | 61 | int i, j, k, l; |
62 | 62 | |
63 | 63 | UINT8* char_rom = memregion("gfx1")->base(); |
r18027 | r18028 | |
---|---|---|
29 | 29 | UINT32 ac1_state::screen_update_ac1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
30 | 30 | { |
31 | 31 | int x,y; |
32 | address_space &space = | |
32 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
33 | 33 | |
34 | 34 | for(y = 0; y < 16; y++ ) |
35 | 35 | { |
r18027 | r18028 | |
45 | 45 | UINT32 ac1_state::screen_update_ac1_32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
46 | 46 | { |
47 | 47 | int x,y; |
48 | address_space &space = | |
48 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
49 | 49 | |
50 | 50 | for(y = 0; y < 32; y++ ) |
51 | 51 | { |
r18027 | r18028 | |
---|---|---|
163 | 163 | void cirrus_device::device_start() |
164 | 164 | { |
165 | 165 | pc_vga_init(machine(), NULL, &cirrus_svga_interface); |
166 | pc_vga_io_init(machine(), | |
166 | pc_vga_io_init(machine(), machine().device("ppc1")->memory().space(AS_PROGRAM), 0xC00A0000, machine().device("ppc1")->memory().space(AS_PROGRAM), 0x80000000); | |
167 | 167 | } |
168 | 168 | |
169 | 169 | //------------------------------------------------- |
r18027 | r18028 | |
---|---|---|
1595 | 1595 | // TODO: This should be moved to card implementations that actually had this feature |
1596 | 1596 | m_p3df = data; |
1597 | 1597 | if (data & 1) { |
1598 | address_space | |
1598 | address_space &space_prg = machine().firstcpu->space(AS_PROGRAM); | |
1599 | 1599 | |
1600 | space_prg | |
1600 | space_prg.install_readwrite_handler(0xb8000, 0xb87ff, read8_delegate( FUNC(isa8_cga_device::char_ram_read), this), write8_delegate(FUNC(isa8_cga_device::char_ram_write), this) ); | |
1601 | 1601 | } else { |
1602 | 1602 | m_isa->install_bank(0xb8000, 0xb8000 + MIN(0x8000,m_vram_size) - 1, 0, m_vram_size & 0x4000, "bank_cga", m_vram); |
1603 | 1603 | } |
r18027 | r18028 | |
2013 | 2013 | m_isa->install_device(0x3d0, 0x3df, 0, 0, read8_delegate( FUNC(isa8_cga_pc1512_device::io_read), this ), write8_delegate( FUNC(isa8_cga_pc1512_device::io_write), this ) ); |
2014 | 2014 | m_isa->install_bank(0xb8000, 0xbbfff, 0, 0, "bank1", m_vram); |
2015 | 2015 | |
2016 | address_space &space = | |
2016 | address_space &space = machine().firstcpu->space( AS_PROGRAM ); | |
2017 | 2017 | |
2018 | 2018 | space.install_write_handler( 0xb8000, 0xbbfff, 0, 0x0C000, write8_delegate( FUNC(isa8_cga_pc1512_device::vram_w), this ) ); |
2019 | 2019 | } |
r18027 | r18028 | |
---|---|---|
1222 | 1222 | gb_state *state = machine.driver_data<gb_state>(); |
1223 | 1223 | int i; |
1224 | 1224 | int vram_size = 0x2000; |
1225 | address_space &space = | |
1225 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1226 | 1226 | emu_timer *old_timer = state->m_lcd.lcd_timer; |
1227 | 1227 | |
1228 | 1228 | memset( &state->m_lcd, 0, sizeof(state->m_lcd) ); |
r18027 | r18028 | |
1332 | 1332 | { |
1333 | 1333 | gb_state *state = machine.driver_data<gb_state>(); |
1334 | 1334 | UINT16 src, dst; |
1335 | address_space &space = | |
1335 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1336 | 1336 | |
1337 | 1337 | src = ((UINT16)HDMA1 << 8) | (HDMA2 & 0xF0); |
1338 | 1338 | dst = ((UINT16)(HDMA3 & 0x1F) << 8) | (HDMA4 & 0xF0); |
r18027 | r18028 | |
---|---|---|
30 | 30 | UINT32 kramermc_state::screen_update_kramermc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
31 | 31 | { |
32 | 32 | int x,y; |
33 | address_space &space = | |
33 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
34 | 34 | |
35 | 35 | for(y = 0; y < 16; y++ ) |
36 | 36 | { |
r18027 | r18028 | |
---|---|---|
180 | 180 | |
181 | 181 | inline void st_state::shifter_load() |
182 | 182 | { |
183 | address_space *program = m_maincpu->space(AS_PROGRAM); | |
184 | UINT16 data = program->read_word(m_shifter_ofs); | |
183 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
184 | UINT16 data = program.read_word(m_shifter_ofs); | |
185 | 185 | |
186 | 186 | m_shifter_ir[m_shifter_bitplane] = data; |
187 | 187 | m_shifter_bitplane++; |
r18027 | r18028 | |
619 | 619 | |
620 | 620 | void st_state::blitter_source() |
621 | 621 | { |
622 | address_space *program = m_maincpu->space(AS_PROGRAM); | |
623 | UINT16 data = program->read_word(m_blitter_src); | |
622 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
623 | UINT16 data = program.read_word(m_blitter_src); | |
624 | 624 | |
625 | 625 | if (m_blitter_src_inc_x < 0) |
626 | 626 | { |
r18027 | r18028 | |
669 | 669 | |
670 | 670 | void st_state::blitter_op(UINT16 s, UINT32 dstaddr, UINT16 mask) |
671 | 671 | { |
672 | address_space | |
672 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
673 | 673 | |
674 | UINT16 d = program | |
674 | UINT16 d = program.read_word(dstaddr); | |
675 | 675 | UINT16 result = 0; |
676 | 676 | |
677 | 677 | if (m_blitter_op & 0x08) result = (~s & ~d); |
r18027 | r18028 | |
679 | 679 | if (m_blitter_op & 0x02) result |= (s & ~d); |
680 | 680 | if (m_blitter_op & 0x01) result |= (s & d); |
681 | 681 | |
682 | program | |
682 | program.write_word(dstaddr, result); | |
683 | 683 | } |
684 | 684 | |
685 | 685 |
r18027 | r18028 | |
---|---|---|
68 | 68 | oric_state *state = machine.driver_data<oric_state>(); |
69 | 69 | /* attribute */ |
70 | 70 | UINT8 attribute = c & 0x03f; |
71 | address_space &space = | |
71 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
72 | 72 | |
73 | 73 | switch ((attribute>>3) & 0x03) |
74 | 74 | { |
r18027 | r18028 | |
213 | 213 | } |
214 | 214 | |
215 | 215 | /* fetch data */ |
216 | c = RAM ? RAM[read_addr] : machine().device("maincpu")->memory().space(AS_PROGRAM) | |
216 | c = RAM ? RAM[read_addr] : machine().device("maincpu")->memory().space(AS_PROGRAM).read_byte(read_addr); | |
217 | 217 | |
218 | 218 | /* if bits 6 and 5 are zero, the byte contains a serial attribute */ |
219 | 219 | if ((c & ((1 << 6) | (1 << 5))) == 0) |
r18027 | r18028 | |
---|---|---|
212 | 212 | |
213 | 213 | inline UINT8 upd7220_device::readbyte(offs_t address) |
214 | 214 | { |
215 | return space() | |
215 | return space().read_byte(address); | |
216 | 216 | } |
217 | 217 | |
218 | 218 | |
r18027 | r18028 | |
222 | 222 | |
223 | 223 | inline void upd7220_device::writebyte(offs_t address, UINT8 data) |
224 | 224 | { |
225 | space() | |
225 | space().write_byte(address, data); | |
226 | 226 | } |
227 | 227 | |
228 | 228 |
r18027 | r18028 | |
---|---|---|
103 | 103 | |
104 | 104 | inline UINT8 zx8301_device::readbyte(offs_t address) |
105 | 105 | { |
106 | return space() | |
106 | return space().read_byte(address); | |
107 | 107 | } |
108 | 108 | |
109 | 109 | |
r18027 | r18028 | |
113 | 113 | |
114 | 114 | inline void zx8301_device::writebyte(offs_t address, UINT8 data) |
115 | 115 | { |
116 | space() | |
116 | space().write_byte(address, data); | |
117 | 117 | } |
118 | 118 | |
119 | 119 |
r18027 | r18028 | |
---|---|---|
20 | 20 | UINT8 code1; //, code2; |
21 | 21 | UINT8 col; |
22 | 22 | int y, x, b; |
23 | address_space &space = | |
23 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
24 | 24 | |
25 | 25 | // draw image |
26 | 26 | for (y = 0; y < 200; y++) |
r18027 | r18028 | |
---|---|---|
922 | 922 | static VIDEO_START( pc_t1t ) |
923 | 923 | { |
924 | 924 | int buswidth; |
925 | address_space &space = *machine.firstcpu->space(AS_PROGRAM); | |
926 | address_space *spaceio = machine.firstcpu->space(AS_IO); | |
925 | address_space &space = machine.firstcpu->space(AS_PROGRAM); | |
926 | address_space &spaceio = machine.firstcpu->space(AS_IO); | |
927 | 927 | |
928 | 928 | pcjr.chr_gen = machine.root_device().memregion("gfx1")->base(); |
929 | 929 | pcjr.update_row = NULL; |
r18027 | r18028 | |
935 | 935 | { |
936 | 936 | case 8: |
937 | 937 | space.install_legacy_readwrite_handler(0xb8000, 0xbffff, FUNC(pc_t1t_videoram_r), FUNC(pc_t1t_videoram_w) ); |
938 | spaceio | |
938 | spaceio.install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc_T1T_r),FUNC(pc_T1T_w) ); | |
939 | 939 | break; |
940 | 940 | |
941 | 941 | case 16: |
942 | 942 | space.install_legacy_readwrite_handler(0xb8000, 0xbffff, FUNC(pc_t1t_videoram_r), FUNC(pc_t1t_videoram_w), 0xffff ); |
943 | spaceio | |
943 | spaceio.install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc_T1T_r),FUNC(pc_T1T_w), 0xffff ); | |
944 | 944 | break; |
945 | 945 | |
946 | 946 | default: |
r18027 | r18028 | |
953 | 953 | static VIDEO_START( pc_pcjr ) |
954 | 954 | { |
955 | 955 | int buswidth; |
956 | address_space | |
956 | address_space &spaceio = machine.firstcpu->space(AS_IO); | |
957 | 957 | |
958 | 958 | pcjr.chr_gen = machine.root_device().memregion("gfx1")->base(); |
959 | 959 | pcjr.update_row = NULL; |
r18027 | r18028 | |
965 | 965 | switch(buswidth) |
966 | 966 | { |
967 | 967 | case 8: |
968 | spaceio | |
968 | spaceio.install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc_T1T_r),FUNC(pc_pcjr_w) ); | |
969 | 969 | break; |
970 | 970 | |
971 | 971 | default: |
r18027 | r18028 | |
---|---|---|
86 | 86 | static void maria_draw_scanline(running_machine &machine) |
87 | 87 | { |
88 | 88 | a7800_state *state = machine.driver_data<a7800_state>(); |
89 | address_space& space = | |
89 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
90 | 90 | unsigned int graph_adr,data_addr; |
91 | 91 | int width,hpos,pal,mode,ind; |
92 | 92 | unsigned int dl; |
r18027 | r18028 | |
321 | 321 | a7800_state *state = timer.machine().driver_data<a7800_state>(); |
322 | 322 | int frame_scanline; |
323 | 323 | UINT8 *ROM = timer.machine().root_device().memregion("maincpu")->base(); |
324 | address_space& space = | |
324 | address_space& space = timer.machine().device("maincpu")->memory().space(AS_PROGRAM); | |
325 | 325 | |
326 | 326 | state->m_maria_scanline++; |
327 | 327 |
r18027 | r18028 | |
---|---|---|
15 | 15 | |
16 | 16 | void newbrain_state::screen_update(bitmap_rgb32 &bitmap, const rectangle &cliprect) |
17 | 17 | { |
18 | address_space | |
18 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
19 | 19 | |
20 | 20 | int y, sx; |
21 | 21 | int columns = (m_tvctl & NEWBRAIN_VIDEO_80L) ? 80 : 40; |
r18027 | r18028 | |
36 | 36 | { |
37 | 37 | int bit; |
38 | 38 | |
39 | UINT8 videoram_data = program | |
39 | UINT8 videoram_data = program.read_byte(videoram_addr + sx); | |
40 | 40 | UINT8 charrom_data; |
41 | 41 | |
42 | 42 | if (gr) |
r18027 | r18028 | |
---|---|---|
689 | 689 | |
690 | 690 | VIDEO_START( pc_aga ) |
691 | 691 | { |
692 | address_space &space = *machine.firstcpu->space(AS_PROGRAM); | |
693 | address_space *spaceio = machine.firstcpu->space(AS_IO); | |
692 | address_space &space = machine.firstcpu->space(AS_PROGRAM); | |
693 | address_space &spaceio = machine.firstcpu->space(AS_IO); | |
694 | 694 | int buswidth = machine.firstcpu->space_config(AS_PROGRAM)->m_databus_width; |
695 | 695 | switch(buswidth) |
696 | 696 | { |
697 | 697 | case 8: |
698 | 698 | space.install_legacy_readwrite_handler(0xb0000, 0xbffff, FUNC(pc200_videoram_r), FUNC(pc200_videoram_w) ); |
699 | spaceio->install_legacy_readwrite_handler(0x3b0, 0x3bf, FUNC(pc_aga_mda_r), FUNC(pc_aga_mda_w) ); | |
700 | spaceio->install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc_aga_cga_r), FUNC(pc_aga_cga_w) ); | |
699 | spaceio.install_legacy_readwrite_handler(0x3b0, 0x3bf, FUNC(pc_aga_mda_r), FUNC(pc_aga_mda_w) ); | |
700 | spaceio.install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc_aga_cga_r), FUNC(pc_aga_cga_w) ); | |
701 | 701 | break; |
702 | 702 | |
703 | 703 | case 16: |
704 | 704 | space.install_legacy_readwrite_handler(0xb0000, 0xbffff, FUNC(pc200_videoram_r), FUNC(pc200_videoram_w), 0xffff ); |
705 | spaceio->install_legacy_readwrite_handler(0x3b0, 0x3bf, FUNC(pc_aga_mda_r), FUNC(pc_aga_mda_w), 0xffff ); | |
706 | spaceio->install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc_aga_cga_r), FUNC(pc_aga_cga_w), 0xffff ); | |
705 | spaceio.install_legacy_readwrite_handler(0x3b0, 0x3bf, FUNC(pc_aga_mda_r), FUNC(pc_aga_mda_w), 0xffff ); | |
706 | spaceio.install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc_aga_cga_r), FUNC(pc_aga_cga_w), 0xffff ); | |
707 | 707 | break; |
708 | 708 | |
709 | 709 | default: |
r18027 | r18028 | |
720 | 720 | |
721 | 721 | VIDEO_START( pc200 ) |
722 | 722 | { |
723 | address_space &space = *machine.firstcpu->space(AS_PROGRAM); | |
724 | address_space *spaceio = machine.firstcpu->space(AS_IO); | |
723 | address_space &space = machine.firstcpu->space(AS_PROGRAM); | |
724 | address_space &spaceio = machine.firstcpu->space(AS_IO); | |
725 | 725 | int buswidth = machine.firstcpu->space_config(AS_PROGRAM)->m_databus_width; |
726 | 726 | switch(buswidth) |
727 | 727 | { |
728 | 728 | case 8: |
729 | 729 | space.install_legacy_readwrite_handler(0xb0000, 0xbffff, FUNC(pc_aga_videoram_r), FUNC(pc_aga_videoram_w) ); |
730 | spaceio->install_legacy_readwrite_handler(0x3b0, 0x3bf, FUNC(pc_aga_mda_r), FUNC(pc_aga_mda_w) ); | |
731 | spaceio->install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc200_cga_r), FUNC(pc200_cga_w) ); | |
730 | spaceio.install_legacy_readwrite_handler(0x3b0, 0x3bf, FUNC(pc_aga_mda_r), FUNC(pc_aga_mda_w) ); | |
731 | spaceio.install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc200_cga_r), FUNC(pc200_cga_w) ); | |
732 | 732 | break; |
733 | 733 | |
734 | 734 | case 16: |
735 | 735 | space.install_legacy_readwrite_handler(0xb0000, 0xbffff, FUNC(pc_aga_videoram_r), FUNC(pc_aga_videoram_w), 0xffff ); |
736 | spaceio->install_legacy_readwrite_handler(0x3b0, 0x3bf, FUNC(pc_aga_mda_r), FUNC(pc_aga_mda_w), 0xffff ); | |
737 | spaceio->install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc200_cga_r), FUNC(pc200_cga_w), 0xffff ); | |
736 | spaceio.install_legacy_readwrite_handler(0x3b0, 0x3bf, FUNC(pc_aga_mda_r), FUNC(pc_aga_mda_w), 0xffff ); | |
737 | spaceio.install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc200_cga_r), FUNC(pc200_cga_w), 0xffff ); | |
738 | 738 | break; |
739 | 739 | |
740 | 740 | default: |
r18027 | r18028 | |
---|---|---|
140 | 140 | m_busy_timer = timer_alloc(BUSY_TIMER); |
141 | 141 | m_blink_timer = timer_alloc(BLINKING_TIMER); |
142 | 142 | |
143 | m_videoram = space(0); | |
143 | m_videoram = &space(0); | |
144 | 144 | m_charset = region(); |
145 | 145 | |
146 | 146 | m_screen_out.allocate(496, m_screen->height()); |
r18027 | r18028 | |
---|---|---|
130 | 130 | { |
131 | 131 | if (offset >= 0xd0 && offset < 0xd4) |
132 | 132 | { |
133 | address_space& space = | |
133 | address_space& space = machine().device("maincpu")->memory().space(AS_IO); | |
134 | 134 | data = m_ppi8255->read(space, offset & 3); |
135 | 135 | } |
136 | 136 | else if (offset == 0xd4) |
r18027 | r18028 | |
150 | 150 | { |
151 | 151 | if (offset >= 0xd0 && offset < 0xd4) |
152 | 152 | { |
153 | address_space& space = | |
153 | address_space& space = machine().device("maincpu")->memory().space(AS_IO); | |
154 | 154 | m_ppi8255->write(space, offset & 3, data); |
155 | 155 | } |
156 | 156 | else if (offset == 0xd4) |
r18027 | r18028 | |
---|---|---|
280 | 280 | |
281 | 281 | inline UINT8 mos6566_device::read_videoram(offs_t offset) |
282 | 282 | { |
283 | m_last_data = space(AS_0) | |
283 | m_last_data = space(AS_0).read_byte(offset & 0x3fff); | |
284 | 284 | |
285 | 285 | return m_last_data; |
286 | 286 | } |
287 | 287 | |
288 | 288 | inline UINT8 mos6566_device::read_colorram(offs_t offset) |
289 | 289 | { |
290 | return space(AS_1) | |
290 | return space(AS_1).read_byte(offset & 0x3ff); | |
291 | 291 | } |
292 | 292 | |
293 | 293 | // Idle access |
r18027 | r18028 | |
---|---|---|
23 | 23 | UINT16 *scanline = &bitmap.pix16(primo_scanline); |
24 | 24 | |
25 | 25 | /* address of current line in Primo video memory */ |
26 | const UINT8* primo_video_ram_line = (const UINT8*)machine.device("maincpu")->memory().space(AS_PROGRAM) | |
26 | const UINT8* primo_video_ram_line = (const UINT8*)machine.device("maincpu")->memory().space(AS_PROGRAM).get_read_ptr(state->m_video_memory_base + 32 * primo_scanline); | |
27 | 27 | |
28 | 28 | for (x=0; x<256; x+=8) |
29 | 29 | { |
r18027 | r18028 | |
---|---|---|
54 | 54 | |
55 | 55 | inline UINT8 tms3556_device::readbyte(offs_t address) |
56 | 56 | { |
57 | return space() | |
57 | return space().read_byte(address); | |
58 | 58 | } |
59 | 59 | |
60 | 60 | |
r18027 | r18028 | |
64 | 64 | |
65 | 65 | inline void tms3556_device::writebyte(offs_t address, UINT8 data) |
66 | 66 | { |
67 | space() | |
67 | space().write_byte(address, data); | |
68 | 68 | } |
69 | 69 | |
70 | 70 |
r18027 | r18028 | |
---|---|---|
149 | 149 | |
150 | 150 | UINT32 ti85_state::screen_update_ti85(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
151 | 151 | { |
152 | address_space &space = | |
152 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
153 | 153 | int x,y,b; |
154 | 154 | int brightnes; |
155 | 155 | int lcdmem; |
r18027 | r18028 | |
---|---|---|
92 | 92 | |
93 | 93 | inline UINT8 hd66421_device::readbyte(offs_t address) |
94 | 94 | { |
95 | return space() | |
95 | return space().read_byte(address); | |
96 | 96 | } |
97 | 97 | |
98 | 98 | |
r18027 | r18028 | |
102 | 102 | |
103 | 103 | inline void hd66421_device::writebyte(offs_t address, UINT8 data) |
104 | 104 | { |
105 | space() | |
105 | space().write_byte(address, data); | |
106 | 106 | } |
107 | 107 | |
108 | 108 |
r18027 | r18028 | |
---|---|---|
16 | 16 | static TIMER_CALLBACK( gal_video ) |
17 | 17 | { |
18 | 18 | galaxy_state *state = machine.driver_data<galaxy_state>(); |
19 | address_space &space = | |
19 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
20 | 20 | int y, x; |
21 | 21 | if (state->m_interrupts_enabled == TRUE) |
22 | 22 | { |
r18027 | r18028 | |
---|---|---|
27 | 27 | { |
28 | 28 | cpu_device *cpu = image.device().machine().firstcpu; |
29 | 29 | UINT8 *RAM = image.device().machine().root_device().memregion(cpu->tag())->base(); |
30 | address_space &space = | |
30 | address_space &space = cpu->space(AS_PROGRAM); | |
31 | 31 | unsigned char ace_repeat, ace_byte, loop; |
32 | 32 | int done=0, ace_index=0x2000; |
33 | 33 |
r18027 | r18028 | |
---|---|---|
26 | 26 | |
27 | 27 | static void image_fread_memory(device_image_interface &image, UINT16 addr, UINT32 count) |
28 | 28 | { |
29 | void *ptr = image.device().machine().firstcpu->space(AS_PROGRAM) | |
29 | void *ptr = image.device().machine().firstcpu->space(AS_PROGRAM).get_write_ptr(addr); | |
30 | 30 | |
31 | 31 | image.fread( ptr, count); |
32 | 32 | } |
r18027 | r18028 | |
---|---|---|
219 | 219 | { |
220 | 220 | microtan_state *state = machine.driver_data<microtan_state>(); |
221 | 221 | UINT8 *RAM = state->memregion("maincpu")->base(); |
222 | address_space &space = | |
222 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
223 | 223 | via6522_device *via_0 = machine.device<via6522_device>("via6522_0"); |
224 | 224 | via6522_device *via_1 = machine.device<via6522_device>("via6522_1"); |
225 | 225 | device_t *ay8910 = machine.device("ay8910.1"); |
r18027 | r18028 | |
---|---|---|
47 | 47 | |
48 | 48 | QUICKLOAD_LOAD( comx35_comx ) |
49 | 49 | { |
50 | address_space | |
50 | address_space &program = image.device().machine().firstcpu->space(AS_PROGRAM); | |
51 | 51 | |
52 | 52 | UINT8 header[16] = {0}; |
53 | 53 | int size = image.length(); |
r18027 | r18028 | |
172 | 172 | image.fread(header, 2); |
173 | 173 | |
174 | 174 | array_length = pick_integer_be(header, 0, 2); |
175 | start_array = (program | |
175 | start_array = (program.read_byte(0x4295) << 8) | program.read_byte(0x4296); | |
176 | 176 | end_array = start_array + (size - 7); |
177 | 177 | |
178 | program->write_byte(0x4299, end_array >> 8); | |
179 | program->write_byte(0x429a, end_array & 0xff); | |
178 | program.write_byte(0x4299, end_array >> 8); | |
179 | program.write_byte(0x429a, end_array & 0xff); | |
180 | 180 | |
181 | 181 | start_string = start_array + array_length; |
182 | 182 | |
183 | program->write_byte(0x4292, start_string >> 8); | |
184 | program->write_byte(0x4293, start_string & 0xff); | |
183 | program.write_byte(0x4292, start_string >> 8); | |
184 | program.write_byte(0x4293, start_string & 0xff); | |
185 | 185 | |
186 | 186 | image_fread_memory(image, start_array, size); |
187 | 187 | } |
r18027 | r18028 | |
---|---|---|
68 | 68 | image->message("%s: Unexpected EOF while writing byte to %04X", pgmname, (unsigned) j); |
69 | 69 | return IMAGE_INIT_FAIL; |
70 | 70 | } |
71 | image->device().machine().device("maincpu")->memory().space(AS_PROGRAM) | |
71 | image->device().machine().device("maincpu")->memory().space(AS_PROGRAM).write_byte(j, data); | |
72 | 72 | } |
73 | 73 | |
74 | 74 | return IMAGE_INIT_PASS; |
r18027 | r18028 | |
122 | 122 | autorun = image.device().machine().root_device().ioport("CONFIG")->read_safe(0xFF) & 1; |
123 | 123 | |
124 | 124 | device_t *cpu = image.device().machine().device("maincpu"); |
125 | address_space &space = | |
125 | address_space &space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM); | |
126 | 126 | |
127 | 127 | space.write_word(0xa6, execute_address); /* fix the EXEC command */ |
128 | 128 | |
r18027 | r18028 | |
158 | 158 | /* check to see if autorun is on (I hate how this works) */ |
159 | 159 | autorun = image.device().machine().root_device().ioport("CONFIG")->read_safe(0xFF) & 1; |
160 | 160 | |
161 | address_space &space = | |
161 | address_space &space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM); | |
162 | 162 | |
163 | 163 | if ((execute_address >= 0xc000) && (execute_address <= 0xdfff) && (space.read_byte(0xdffa) != 0xc3)) |
164 | 164 | return IMAGE_INIT_FAIL; /* can't run a program if the cartridge isn't in */ |
r18027 | r18028 | |
---|---|---|
320 | 320 | UINT16 start, size, data, status; |
321 | 321 | spectrum_state *state = machine.driver_data<spectrum_state>(); |
322 | 322 | device_t *cpu = machine.device("maincpu"); |
323 | address_space &space = | |
323 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
324 | 324 | |
325 | 325 | if (snapsize == SP_NEW_SIZE_16K || snapsize == SP_NEW_SIZE_48K) |
326 | 326 | { |
r18027 | r18028 | |
520 | 520 | UINT16 data, addr; |
521 | 521 | spectrum_state *state = machine.driver_data<spectrum_state>(); |
522 | 522 | device_t *cpu = machine.device("maincpu"); |
523 | address_space &space = | |
523 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
524 | 524 | |
525 | 525 | if ((snapsize != SNA48_SIZE) && (state->m_port_7ffd_data == -1)) |
526 | 526 | { |
r18027 | r18028 | |
739 | 739 | UINT16 data; |
740 | 740 | spectrum_state *state = machine.driver_data<spectrum_state>(); |
741 | 741 | device_t *cpu = machine.device("maincpu"); |
742 | address_space &space = | |
742 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
743 | 743 | |
744 | 744 | data = (snapdata[ACH_OFFSET + 0] << 8) | snapdata[ACH_OFFSET + 4]; |
745 | 745 | LOAD_REG(cpu, Z80_AF, data); |
r18027 | r18028 | |
872 | 872 | UINT16 addr, data; |
873 | 873 | spectrum_state *state = machine.driver_data<spectrum_state>(); |
874 | 874 | device_t *cpu = machine.device("maincpu"); |
875 | address_space &space = | |
875 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
876 | 876 | |
877 | 877 | data = snapdata[PRG_OFFSET + 0]; |
878 | 878 | if (data != 0x05) |
r18027 | r18028 | |
1042 | 1042 | UINT16 addr = 0, data; |
1043 | 1043 | spectrum_state *state = machine.driver_data<spectrum_state>(); |
1044 | 1044 | device_t *cpu = machine.device("maincpu"); |
1045 | address_space &space = | |
1045 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1046 | 1046 | |
1047 | 1047 | data = (snapdata[PLUSD_OFFSET + 15] << 8) | snapdata[PLUSD_OFFSET + 14]; |
1048 | 1048 | LOAD_REG(cpu, Z80_BC, data); |
r18027 | r18028 | |
1210 | 1210 | UINT16 data; |
1211 | 1211 | spectrum_state *state = machine.driver_data<spectrum_state>(); |
1212 | 1212 | device_t *cpu = machine.device("maincpu"); |
1213 | address_space &space = | |
1213 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1214 | 1214 | |
1215 | 1215 | data = (snapdata[SEM_OFFSET + 1] << 8) | snapdata[SEM_OFFSET + 0]; |
1216 | 1216 | LOAD_REG(cpu, Z80_AF, data); |
r18027 | r18028 | |
1329 | 1329 | UINT16 data; |
1330 | 1330 | spectrum_state *state = machine.driver_data<spectrum_state>(); |
1331 | 1331 | device_t *cpu = machine.device("maincpu"); |
1332 | address_space &space = | |
1332 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1333 | 1333 | |
1334 | 1334 | data = (snapdata[SIT_OFFSET + 7] << 8) | snapdata[SIT_OFFSET + 6]; |
1335 | 1335 | LOAD_REG(cpu, Z80_AF, data); |
r18027 | r18028 | |
1459 | 1459 | UINT16 data, mode; |
1460 | 1460 | spectrum_state *state = machine.driver_data<spectrum_state>(); |
1461 | 1461 | device_t *cpu = machine.device("maincpu"); |
1462 | address_space &space = | |
1462 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1463 | 1463 | |
1464 | 1464 | logerror("Skipping last 132 bytes of the 16K ROM dump at offset:0000\n"); |
1465 | 1465 | |
r18027 | r18028 | |
1591 | 1591 | UINT16 data; |
1592 | 1592 | spectrum_state *state = machine.driver_data<spectrum_state>(); |
1593 | 1593 | device_t *cpu = machine.device("maincpu"); |
1594 | address_space &space = | |
1594 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1595 | 1595 | |
1596 | 1596 | data = (snapdata[SNP_OFFSET + 1] << 8) | snapdata[SNP_OFFSET + 0]; |
1597 | 1597 | LOAD_REG(cpu, Z80_AF, data); |
r18027 | r18028 | |
1768 | 1768 | { |
1769 | 1769 | UINT8 counthi, countlo, compress, fill; |
1770 | 1770 | UINT16 block = 0, count, i, j, numbytes; |
1771 | address_space &space = | |
1771 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1772 | 1772 | |
1773 | 1773 | i = SNX_HDR - 1; |
1774 | 1774 | numbytes = 0; |
r18027 | r18028 | |
1818 | 1818 | UINT16 data, addr; |
1819 | 1819 | spectrum_state *state = machine.driver_data<spectrum_state>(); |
1820 | 1820 | device_t *cpu = machine.device("maincpu"); |
1821 | address_space &space = | |
1821 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1822 | 1822 | |
1823 | 1823 | data = (snapdata[SNX_OFFSET + 4] << 8) | snapdata[SNX_OFFSET + 5]; |
1824 | 1824 | if (data != 0x25) |
r18027 | r18028 | |
1972 | 1972 | UINT16 addr, data; |
1973 | 1973 | spectrum_state *state = machine.driver_data<spectrum_state>(); |
1974 | 1974 | device_t *cpu = machine.device("maincpu"); |
1975 | address_space &space = | |
1975 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1976 | 1976 | |
1977 | 1977 | if (state->m_port_7ffd_data == -1) |
1978 | 1978 | { |
r18027 | r18028 | |
2083 | 2083 | { |
2084 | 2084 | UINT8 ch; |
2085 | 2085 | int i; |
2086 | address_space &space = | |
2086 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
2087 | 2087 | |
2088 | 2088 | do |
2089 | 2089 | { |
r18027 | r18028 | |
2194 | 2194 | int i; |
2195 | 2195 | UINT8 lo, hi, data; |
2196 | 2196 | SPECTRUM_Z80_SNAPSHOT_TYPE z80_type; |
2197 | address_space &space = | |
2197 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
2198 | 2198 | |
2199 | 2199 | z80_type = spectrum_identify_z80(snapdata, snapsize); |
2200 | 2200 | |
r18027 | r18028 | |
2520 | 2520 | void spectrum_setup_scr(running_machine &machine, UINT8 *quickdata, UINT32 quicksize) |
2521 | 2521 | { |
2522 | 2522 | int i; |
2523 | address_space &space = | |
2523 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
2524 | 2524 | |
2525 | 2525 | for (i = 0; i < quicksize; i++) |
2526 | 2526 | space.write_byte(i + BASE_RAM, quickdata[i]); |
r18027 | r18028 | |
2560 | 2560 | UINT8 data; |
2561 | 2561 | UINT16 start, len; |
2562 | 2562 | spectrum_state *state = machine.driver_data<spectrum_state>(); |
2563 | address_space &space = | |
2563 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
2564 | 2564 | |
2565 | 2565 | start = (quickdata[RAW_OFFSET + 4] << 8) | quickdata[RAW_OFFSET + 3]; |
2566 | 2566 | len = (quickdata[RAW_OFFSET + 2] << 8) | quickdata[RAW_OFFSET + 1]; |
r18027 | r18028 | |
---|---|---|
35 | 35 | |
36 | 36 | QUICKLOAD_LOAD( trs80_cmd ) |
37 | 37 | { |
38 | address_space | |
38 | address_space &program = image.device().machine().firstcpu->space(AS_PROGRAM); | |
39 | 39 | |
40 | 40 | UINT8 type, length; |
41 | 41 | UINT8 data[0x100]; |
r18027 | r18028 | |
57 | 57 | image.fread( &addr, 2); |
58 | 58 | UINT16 address = (addr[1] << 8) | addr[0]; |
59 | 59 | if (LOG) logerror("/CMD object code block: address %04x length %u\n", address, block_length); |
60 | ptr = program | |
60 | ptr = program.get_write_ptr(address); | |
61 | 61 | image.fread( ptr, block_length); |
62 | 62 | } |
63 | 63 | break; |
r18027 | r18028 | |
---|---|---|
30 | 30 | UINT32 bytesread; |
31 | 31 | UINT16 address = 0; |
32 | 32 | int i; |
33 | address_space &space = | |
33 | address_space &space = image.device().machine().firstcpu->space(AS_PROGRAM); | |
34 | 34 | |
35 | 35 | if (!file_type) |
36 | 36 | goto error; |
r18027 | r18028 | |
93 | 93 | |
94 | 94 | static void cbm_quick_sethiaddress( running_machine &machine, UINT16 hiaddress ) |
95 | 95 | { |
96 | address_space &space = | |
96 | address_space &space = machine.firstcpu->space(AS_PROGRAM); | |
97 | 97 | |
98 | 98 | space.write_byte(0x31, hiaddress & 0xff); |
99 | 99 | space.write_byte(0x2f, hiaddress & 0xff); |
r18027 | r18028 | |
120 | 120 | |
121 | 121 | static void cbm_pet_quick_sethiaddress( running_machine &machine, UINT16 hiaddress ) |
122 | 122 | { |
123 | address_space &space = | |
123 | address_space &space = machine.firstcpu->space(AS_PROGRAM); | |
124 | 124 | |
125 | 125 | space.write_byte(0x2e, hiaddress & 0xff); |
126 | 126 | space.write_byte(0x2c, hiaddress & 0xff); |
r18027 | r18028 | |
137 | 137 | |
138 | 138 | static void cbm_pet1_quick_sethiaddress(running_machine &machine, UINT16 hiaddress) |
139 | 139 | { |
140 | address_space &space = | |
140 | address_space &space = machine.firstcpu->space(AS_PROGRAM); | |
141 | 141 | |
142 | 142 | space.write_byte(0x80, hiaddress & 0xff); |
143 | 143 | space.write_byte(0x7e, hiaddress & 0xff); |
r18027 | r18028 | |
154 | 154 | |
155 | 155 | static void cbmb_quick_sethiaddress(running_machine &machine, UINT16 hiaddress) |
156 | 156 | { |
157 | address_space &space = | |
157 | address_space &space = machine.firstcpu->space(AS_PROGRAM); | |
158 | 158 | |
159 | 159 | space.write_byte(0xf0046, hiaddress & 0xff); |
160 | 160 | space.write_byte(0xf0047, hiaddress >> 8); |
r18027 | r18028 | |
172 | 172 | |
173 | 173 | static void cbm_c65_quick_sethiaddress( running_machine &machine, UINT16 hiaddress ) |
174 | 174 | { |
175 | address_space &space = | |
175 | address_space &space = machine.firstcpu->space(AS_PROGRAM); | |
176 | 176 | |
177 | 177 | space.write_byte(0x82, hiaddress & 0xff); |
178 | 178 | space.write_byte(0x83, hiaddress >> 8); |
r18027 | r18028 | |
---|---|---|
1588 | 1588 | { |
1589 | 1589 | if ((state->m_parallel_drum.wfb >= 1) && (state->m_parallel_drum.wfb <= 22)) |
1590 | 1590 | { |
1591 | drum_write(state, state->m_parallel_drum.wfb-1, dc, (signed)device->machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1591 | drum_write(state, state->m_parallel_drum.wfb-1, dc, (signed)device->machine().device("maincpu")->memory().space(AS_PROGRAM).read_dword(state->m_parallel_drum.wcl<<2)); | |
1592 | 1592 | } |
1593 | 1593 | |
1594 | 1594 | if ((state->m_parallel_drum.rfb >= 1) && (state->m_parallel_drum.rfb <= 22)) |
1595 | 1595 | { |
1596 | device->machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1596 | device->machine().device("maincpu")->memory().space(AS_PROGRAM).write_dword(state->m_parallel_drum.wcl<<2, drum_read(state, state->m_parallel_drum.rfb-1, dc)); | |
1597 | 1597 | } |
1598 | 1598 | |
1599 | 1599 | state->m_parallel_drum.wc = (state->m_parallel_drum.wc+1) & 07777; |
r18027 | r18028 | |
1862 | 1862 | device.state().set_state_int(PDP1_MA, device.state().state_int(PDP1_PC)); |
1863 | 1863 | device.state().set_state_int(PDP1_IR, LAC); /* this instruction is actually executed */ |
1864 | 1864 | |
1865 | device.state().set_state_int(PDP1_MB, (signed)device.memory().space(AS_PROGRAM) | |
1865 | device.state().set_state_int(PDP1_MB, (signed)device.memory().space(AS_PROGRAM).read_dword(PDP1_MA<<2)); | |
1866 | 1866 | device.state().set_state_int(PDP1_AC, device.state().state_int(PDP1_MB)); |
1867 | 1867 | } |
1868 | 1868 | if (control_transitions & pdp1_deposit) |
r18027 | r18028 | |
1874 | 1874 | device.state().set_state_int(PDP1_IR, DAC); /* this instruction is actually executed */ |
1875 | 1875 | |
1876 | 1876 | device.state().set_state_int(PDP1_MB, device.state().state_int(PDP1_AC)); |
1877 | device.memory().space(AS_PROGRAM) | |
1877 | device.memory().space(AS_PROGRAM).write_dword(device.state().state_int(PDP1_MA)<<2, device.state().state_int(PDP1_MB)); | |
1878 | 1878 | } |
1879 | 1879 | if (control_transitions & pdp1_read_in) |
1880 | 1880 | { /* set cpu to read instructions from perforated tape */ |
r18027 | r18028 | |
---|---|---|
236 | 236 | |
237 | 237 | void elf2_state::machine_start() |
238 | 238 | { |
239 | address_space | |
239 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
240 | 240 | |
241 | 241 | /* initialize LED displays */ |
242 | 242 | m_led_l->rbi_w(1); |
243 | 243 | m_led_h->rbi_w(1); |
244 | 244 | |
245 | 245 | /* setup memory banking */ |
246 | program->install_read_bank(0x0000, 0x00ff, "bank1"); | |
247 | program->install_write_handler(0x0000, 0x00ff, write8_delegate(FUNC(elf2_state::memory_w), this)); | |
246 | program.install_read_bank(0x0000, 0x00ff, "bank1"); | |
247 | program.install_write_handler(0x0000, 0x00ff, write8_delegate(FUNC(elf2_state::memory_w), this)); | |
248 | 248 | membank("bank1")->configure_entry(0, m_ram->pointer()); |
249 | 249 | membank("bank1")->set_entry(0); |
250 | 250 |
r18027 | r18028 | |
---|---|---|
228 | 228 | static void duart_tx(device_t *device, int channel, UINT8 data) |
229 | 229 | { |
230 | 230 | device_t *devconf = device->machine().device(TERMINAL_TAG); |
231 | dynamic_cast<generic_terminal_device *>(devconf)->write( | |
231 | dynamic_cast<generic_terminal_device *>(devconf)->write(devconf->machine().driver_data()->generic_space(), 0, data); | |
232 | 232 | #ifdef SERIAL_TO_STDERR |
233 | 233 | fprintf(stderr, "%02X ",data); |
234 | 234 | #endif |
r18027 | r18028 | |
---|---|---|
646 | 646 | |
647 | 647 | static QUICKLOAD_LOAD(homelab) |
648 | 648 | { |
649 | address_space &space = | |
649 | address_space &space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM); | |
650 | 650 | int i=0; |
651 | 651 | UINT8 ch; |
652 | 652 | UINT16 quick_addr; |
r18027 | r18028 | |
---|---|---|
53 | 53 | |
54 | 54 | void vt520_state::machine_reset() |
55 | 55 | { |
56 | address_space &space = | |
56 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
57 | 57 | UINT8 *rom = memregion("maincpu")->base(); |
58 | 58 | space.unmap_write(0x0000, 0xffff); |
59 | 59 | membank("bank1")->set_base(rom + 0x70000); |
r18027 | r18028 | |
---|---|---|
72 | 72 | |
73 | 73 | void pc8401a_state::bankswitch(UINT8 data) |
74 | 74 | { |
75 | address_space | |
75 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
76 | 76 | |
77 | 77 | int rombank = data & 0x03; |
78 | 78 | int ram0000 = (data >> 2) & 0x03; |
r18027 | r18028 | |
84 | 84 | if (rombank < 3) |
85 | 85 | { |
86 | 86 | /* internal ROM */ |
87 | program->install_read_bank(0x0000, 0x7fff, "bank1"); | |
88 | program->unmap_write(0x0000, 0x7fff); | |
87 | program.install_read_bank(0x0000, 0x7fff, "bank1"); | |
88 | program.unmap_write(0x0000, 0x7fff); | |
89 | 89 | membank("bank1")->set_entry(rombank); |
90 | 90 | } |
91 | 91 | else |
92 | 92 | { |
93 | 93 | /* ROM cartridge */ |
94 | program | |
94 | program.unmap_readwrite(0x0000, 0x7fff); | |
95 | 95 | } |
96 | 96 | //logerror("0x0000-0x7fff = ROM %u\n", rombank); |
97 | 97 | break; |
98 | 98 | |
99 | 99 | case 1: /* RAM 0000H to 7FFFH */ |
100 | program | |
100 | program.install_readwrite_bank(0x0000, 0x7fff, "bank1"); | |
101 | 101 | membank("bank1")->set_entry(4); |
102 | 102 | //logerror("0x0000-0x7fff = RAM 0-7fff\n"); |
103 | 103 | break; |
104 | 104 | |
105 | 105 | case 2: /* RAM 8000H to FFFFH */ |
106 | program | |
106 | program.install_readwrite_bank(0x0000, 0x7fff, "bank1"); | |
107 | 107 | membank("bank1")->set_entry(5); |
108 | 108 | //logerror("0x0000-0x7fff = RAM 8000-ffff\n"); |
109 | 109 | break; |
r18027 | r18028 | |
116 | 116 | switch (ram8000) |
117 | 117 | { |
118 | 118 | case 0: /* cell addresses 0000H to 3FFFH */ |
119 | program | |
119 | program.install_readwrite_bank(0x8000, 0xbfff, "bank3"); | |
120 | 120 | membank("bank3")->set_entry(0); |
121 | 121 | //logerror("0x8000-0xbfff = RAM 0-3fff\n"); |
122 | 122 | break; |
123 | 123 | |
124 | 124 | case 1: /* cell addresses 4000H to 7FFFH */ |
125 | program | |
125 | program.install_readwrite_bank(0x8000, 0xbfff, "bank3"); | |
126 | 126 | membank("bank3")->set_entry(1); |
127 | 127 | //logerror("0x8000-0xbfff = RAM 4000-7fff\n"); |
128 | 128 | break; |
129 | 129 | |
130 | 130 | case 2: /* cell addresses 8000H to BFFFH */ |
131 | program | |
131 | program.install_readwrite_bank(0x8000, 0xbfff, "bank3"); | |
132 | 132 | membank("bank3")->set_entry(2); |
133 | 133 | //logerror("0x8000-0xbfff = RAM 8000-bfff\n"); |
134 | 134 | break; |
r18027 | r18028 | |
136 | 136 | case 3: /* RAM cartridge */ |
137 | 137 | if (m_ram->size() > 64) |
138 | 138 | { |
139 | program | |
139 | program.install_readwrite_bank(0x8000, 0xbfff, "bank3"); | |
140 | 140 | membank("bank3")->set_entry(3); // TODO or 4 |
141 | 141 | } |
142 | 142 | else |
143 | 143 | { |
144 | program | |
144 | program.unmap_readwrite(0x8000, 0xbfff); | |
145 | 145 | } |
146 | 146 | //logerror("0x8000-0xbfff = RAM cartridge\n"); |
147 | 147 | break; |
r18027 | r18028 | |
150 | 150 | if (BIT(data, 6)) |
151 | 151 | { |
152 | 152 | /* CRT video RAM */ |
153 | program->install_readwrite_bank(0xc000, 0xdfff, "bank4"); | |
154 | program->unmap_readwrite(0xe000, 0xe7ff); | |
153 | program.install_readwrite_bank(0xc000, 0xdfff, "bank4"); | |
154 | program.unmap_readwrite(0xe000, 0xe7ff); | |
155 | 155 | membank("bank4")->set_entry(1); |
156 | 156 | //logerror("0xc000-0xdfff = video RAM\n"); |
157 | 157 | } |
158 | 158 | else |
159 | 159 | { |
160 | 160 | /* RAM */ |
161 | program | |
161 | program.install_readwrite_bank(0xc000, 0xe7ff, "bank4"); | |
162 | 162 | membank("bank4")->set_entry(0); |
163 | 163 | //logerror("0xc000-0e7fff = RAM c000-e7fff\n"); |
164 | 164 | } |
r18027 | r18028 | |
---|---|---|
2611 | 2611 | INTERRUPT_GEN_MEMBER(pc9801_state::pc9801_vrtc_irq) |
2612 | 2612 | { |
2613 | 2613 | #if 0 |
2614 | address_space &space = | |
2614 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2615 | 2615 | static UINT8 test; |
2616 | 2616 | |
2617 | 2617 | if(machine().input().code_pressed_once(JOYCODE_BUTTON1)) |
r18027 | r18028 | |
---|---|---|
759 | 759 | logerror("%s MMU BIOS ROM\n", machine.system().name); |
760 | 760 | base3 = base + 0x14000; /* 8K lo BIOS */ |
761 | 761 | base4 = base + 0x15800; /* 4K FP ROM + 8K hi BIOS */ |
762 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xc000, 0xcfff, "bank3"); | |
763 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0xc000, 0xcfff); | |
764 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xd800, 0xffff, "bank4"); | |
765 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0xd800, 0xffff); | |
762 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xc000, 0xcfff, "bank3"); | |
763 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xc000, 0xcfff); | |
764 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xd800, 0xffff, "bank4"); | |
765 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xd800, 0xffff); | |
766 | 766 | } |
767 | 767 | else |
768 | 768 | { |
769 | 769 | logerror("%s MMU BIOS RAM\n", machine.system().name); |
770 | 770 | base3 = base + 0x0c000; /* 8K RAM */ |
771 | 771 | base4 = base + 0x0d800; /* 4K RAM + 8K RAM */ |
772 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank(0xc000, 0xcfff, "bank3"); | |
773 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank(0xd800, 0xffff, "bank4"); | |
772 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank(0xc000, 0xcfff, "bank3"); | |
773 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank(0xd800, 0xffff, "bank4"); | |
774 | 774 | } |
775 | 775 | machine.root_device().membank("bank3")->set_base(base3); |
776 | 776 | machine.root_device().membank("bank4")->set_base(base4); |
r18027 | r18028 | |
779 | 779 | if( new_mmu & 0x02 ) |
780 | 780 | { |
781 | 781 | logerror("%s MMU BASIC RAM\n", machine.system().name); |
782 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
782 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank(0xa000, 0xbfff, "bank1"); | |
783 | 783 | base1 = base + 0x0a000; /* 8K RAM */ |
784 | 784 | } |
785 | 785 | else |
786 | 786 | { |
787 | 787 | logerror("%s MMU BASIC ROM\n", machine.system().name); |
788 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xa000, 0xbfff, "bank1"); | |
789 | machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xa000, 0xbfff); | |
788 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xa000, 0xbfff, "bank1"); | |
789 | machine.device("maincpu")->memory().space(AS_PROGRAM).nop_write(0xa000, 0xbfff); | |
790 | 790 | base1 = base + 0x10000; /* 8K BASIC */ |
791 | 791 | } |
792 | 792 | |
r18027 | r18028 | |
796 | 796 | if( new_mmu & 0x80 ) |
797 | 797 | { |
798 | 798 | logerror("%s MMU SELFTEST RAM\n", machine.system().name); |
799 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
799 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank(0x5000, 0x57ff, "bank2"); | |
800 | 800 | base2 = base + 0x05000; /* 0x0800 bytes */ |
801 | 801 | } |
802 | 802 | else |
803 | 803 | { |
804 | 804 | logerror("%s MMU SELFTEST ROM\n", machine.system().name); |
805 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5000, 0x57ff, "bank2"); | |
806 | machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x5000, 0x57ff); | |
805 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x5000, 0x57ff, "bank2"); | |
806 | machine.device("maincpu")->memory().space(AS_PROGRAM).nop_write(0x5000, 0x57ff); | |
807 | 807 | base2 = base + 0x15000; /* 0x0800 bytes */ |
808 | 808 | } |
809 | 809 | machine.root_device().membank("bank2")->set_base(base2); |
r18027 | r18028 | |
821 | 821 | logerror("%s MMU BIOS ROM\n", machine.system().name); |
822 | 822 | base3 = base + 0x14000; /* 8K lo BIOS */ |
823 | 823 | base4 = base + 0x15800; /* 4K FP ROM + 8K hi BIOS */ |
824 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xc000, 0xcfff, "bank3"); | |
825 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0xc000, 0xcfff); | |
826 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xd800, 0xffff, "bank4"); | |
827 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0xd800, 0xffff); | |
824 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xc000, 0xcfff, "bank3"); | |
825 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xc000, 0xcfff); | |
826 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xd800, 0xffff, "bank4"); | |
827 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xd800, 0xffff); | |
828 | 828 | } |
829 | 829 | else |
830 | 830 | { |
831 | 831 | logerror("%s MMU BIOS RAM\n", machine.system().name); |
832 | 832 | base3 = base + 0x0c000; /* 8K RAM */ |
833 | 833 | base4 = base + 0x0d800; /* 4K RAM + 8K RAM */ |
834 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank(0xc000, 0xcfff, "bank3"); | |
835 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank(0xd800, 0xffff, "bank4"); | |
834 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank(0xc000, 0xcfff, "bank3"); | |
835 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank(0xd800, 0xffff, "bank4"); | |
836 | 836 | } |
837 | 837 | machine.root_device().membank("bank3")->set_base(base3); |
838 | 838 | machine.root_device().membank("bank4")->set_base(base4); |
r18027 | r18028 | |
842 | 842 | { |
843 | 843 | logerror("%s MMU SELFTEST RAM\n", machine.system().name); |
844 | 844 | base2 = base + 0x05000; /* 0x0800 bytes */ |
845 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
845 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank(0x5000, 0x57ff, "bank2"); | |
846 | 846 | } |
847 | 847 | else |
848 | 848 | { |
849 | 849 | logerror("%s MMU SELFTEST ROM\n", machine.system().name); |
850 | 850 | base2 = base + 0x15000; /* 0x0800 bytes */ |
851 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5000, 0x57ff, "bank2"); | |
852 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x5000, 0x57ff); | |
851 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x5000, 0x57ff, "bank2"); | |
852 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x5000, 0x57ff); | |
853 | 853 | } |
854 | 854 | machine.root_device().membank("bank2")->set_base(base2); |
855 | 855 | } |
r18027 | r18028 | |
865 | 865 | logerror("%s MMU BIOS ROM\n", machine.system().name); |
866 | 866 | base3 = base + 0x14000; /* 8K lo BIOS */ |
867 | 867 | base4 = base + 0x15800; /* 4K FP ROM + 8K hi BIOS */ |
868 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xc000, 0xcfff, "bank3"); | |
869 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0xc000, 0xcfff); | |
870 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xd800, 0xffff, "bank4"); | |
871 | machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0xd800, 0xffff); | |
868 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xc000, 0xcfff, "bank3"); | |
869 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xc000, 0xcfff); | |
870 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xd800, 0xffff, "bank4"); | |
871 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xd800, 0xffff); | |
872 | 872 | } |
873 | 873 | else |
874 | 874 | { |
875 | 875 | logerror("%s MMU BIOS RAM\n", machine.system().name); |
876 | 876 | base3 = base + 0x0c000; /* 8K RAM */ |
877 | 877 | base4 = base + 0x0d800; /* 4K RAM + 8K RAM */ |
878 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank(0xc000, 0xcfff, "bank3"); | |
879 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank(0xd800, 0xffff, "bank4"); | |
878 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank(0xc000, 0xcfff, "bank3"); | |
879 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank(0xd800, 0xffff, "bank4"); | |
880 | 880 | } |
881 | 881 | machine.root_device().membank("bank3")->set_base(base3); |
882 | 882 | machine.root_device().membank("bank4")->set_base(base4); |
r18027 | r18028 | |
886 | 886 | if( new_mmu & 0x80 ) |
887 | 887 | { |
888 | 888 | logerror("%s MMU SELFTEST RAM\n", machine.system().name); |
889 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
889 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank(0x5000, 0x57ff, "bank2"); | |
890 | 890 | base2 = base + 0x05000; /* 0x0800 bytes */ |
891 | 891 | } |
892 | 892 | else |
893 | 893 | { |
894 | 894 | logerror("%s MMU SELFTEST ROM\n", machine.system().name); |
895 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5000, 0x57ff, "bank2"); | |
896 | machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x5000, 0x57ff); | |
895 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x5000, 0x57ff, "bank2"); | |
896 | machine.device("maincpu")->memory().space(AS_PROGRAM).nop_write(0x5000, 0x57ff); | |
897 | 897 | base2 = base + 0x15000; /* 0x0800 bytes */ |
898 | 898 | } |
899 | 899 | machine.root_device().membank("bank2")->set_base(base2); |
r18027 | r18028 | |
---|---|---|
26 | 26 | |
27 | 27 | void mc1000_state::bankswitch() |
28 | 28 | { |
29 | address_space | |
29 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
30 | 30 | |
31 | 31 | /* MC6845 video RAM */ |
32 | 32 | membank("bank2")->set_entry(m_mc6845_bank); |
r18027 | r18028 | |
34 | 34 | /* extended RAM */ |
35 | 35 | if (m_ram->size() > 16*1024) |
36 | 36 | { |
37 | program | |
37 | program.install_readwrite_bank(0x4000, 0x7fff, "bank3"); | |
38 | 38 | } |
39 | 39 | else |
40 | 40 | { |
41 | program | |
41 | program.unmap_readwrite(0x4000, 0x7fff); | |
42 | 42 | } |
43 | 43 | |
44 | 44 | /* MC6847 video RAM */ |
r18027 | r18028 | |
46 | 46 | { |
47 | 47 | if (m_ram->size() > 16*1024) |
48 | 48 | { |
49 | program | |
49 | program.install_readwrite_bank(0x8000, 0x97ff, "bank4"); | |
50 | 50 | } |
51 | 51 | else |
52 | 52 | { |
53 | program | |
53 | program.unmap_readwrite(0x8000, 0x97ff); | |
54 | 54 | } |
55 | 55 | } |
56 | 56 | else |
57 | 57 | { |
58 | program | |
58 | program.install_readwrite_bank(0x8000, 0x97ff, "bank4"); | |
59 | 59 | } |
60 | 60 | |
61 | 61 | membank("bank4")->set_entry(m_mc6847_bank); |
r18027 | r18028 | |
63 | 63 | /* extended RAM */ |
64 | 64 | if (m_ram->size() > 16*1024) |
65 | 65 | { |
66 | program | |
66 | program.install_readwrite_bank(0x9800, 0xbfff, "bank5"); | |
67 | 67 | } |
68 | 68 | else |
69 | 69 | { |
70 | program | |
70 | program.unmap_readwrite(0x9800, 0xbfff); | |
71 | 71 | } |
72 | 72 | } |
73 | 73 | |
r18027 | r18028 | |
323 | 323 | |
324 | 324 | void mc1000_state::machine_start() |
325 | 325 | { |
326 | address_space | |
326 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
327 | 327 | |
328 | 328 | /* setup memory banking */ |
329 | 329 | UINT8 *rom = memregion(Z80_TAG)->base(); |
330 | 330 | |
331 | program | |
331 | program.install_readwrite_bank(0x0000, 0x1fff, "bank1"); | |
332 | 332 | membank("bank1")->configure_entry(0, rom); |
333 | 333 | membank("bank1")->configure_entry(1, rom + 0xc000); |
334 | 334 | membank("bank1")->set_entry(1); |
335 | 335 | |
336 | 336 | m_rom0000 = 1; |
337 | 337 | |
338 | program | |
338 | program.install_readwrite_bank(0x2000, 0x27ff, "bank2"); | |
339 | 339 | membank("bank2")->configure_entry(0, rom + 0x2000); |
340 | 340 | membank("bank2")->configure_entry(1, m_mc6845_video_ram); |
341 | 341 | membank("bank2")->set_entry(0); |
r18027 | r18028 | |
499 | 499 | DRIVER_INIT_MEMBER(mc1000_state,mc1000) |
500 | 500 | { |
501 | 501 | |
502 | machine().device(Z80_TAG)->memory().space(AS_PROGRAM) | |
502 | machine().device(Z80_TAG)->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(mc1000_state::mc1000_direct_update_handler), this)); | |
503 | 503 | } |
504 | 504 | |
505 | 505 | /* System Drivers */ |
r18027 | r18028 | |
---|---|---|
245 | 245 | |
246 | 246 | void adam_state::bankswitch() |
247 | 247 | { |
248 | address_space | |
248 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
249 | 249 | UINT8 *ram = m_ram->pointer(); |
250 | 250 | |
251 | 251 | switch (m_mioc & 0x03) |
r18027 | r18028 | |
253 | 253 | case LO_SMARTWRITER: |
254 | 254 | if (BIT(m_adamnet, 1)) |
255 | 255 | { |
256 | program->unmap_readwrite(0x0000, 0x5fff); | |
257 | program->install_rom(0x6000, 0x7fff, memregion("wp")->base() + 0x8000); | |
256 | program.unmap_readwrite(0x0000, 0x5fff); | |
257 | program.install_rom(0x6000, 0x7fff, memregion("wp")->base() + 0x8000); | |
258 | 258 | } |
259 | 259 | else |
260 | 260 | { |
261 | program | |
261 | program.install_rom(0x0000, 0x7fff, memregion("wp")->base()); | |
262 | 262 | } |
263 | 263 | break; |
264 | 264 | |
265 | 265 | case LO_INTERNAL_RAM: |
266 | program | |
266 | program.install_ram(0x0000, 0x7fff, ram); | |
267 | 267 | break; |
268 | 268 | |
269 | 269 | case LO_RAM_EXPANSION: |
270 | 270 | if (m_ram->size() > 64 * 1024) |
271 | program | |
271 | program.install_ram(0x0000, 0x7fff, ram + 0x10000); | |
272 | 272 | else |
273 | program | |
273 | program.unmap_readwrite(0x0000, 0x7fff); | |
274 | 274 | break; |
275 | 275 | |
276 | 276 | case LO_OS7_ROM_INTERNAL_RAM: |
277 | program->install_rom(0x0000, 0x1fff, memregion("os7")->base()); | |
278 | program->install_ram(0x2000, 0x7fff, ram + 0x2000); | |
277 | program.install_rom(0x0000, 0x1fff, memregion("os7")->base()); | |
278 | program.install_ram(0x2000, 0x7fff, ram + 0x2000); | |
279 | 279 | break; |
280 | 280 | } |
281 | 281 | |
282 | 282 | switch ((m_mioc >> 2) & 0x03) |
283 | 283 | { |
284 | 284 | case HI_INTERNAL_RAM: |
285 | program | |
285 | program.install_ram(0x8000, 0xffff, ram + 0x8000); | |
286 | 286 | break; |
287 | 287 | |
288 | 288 | case HI_ROM_EXPANSION: |
289 | program | |
289 | program.install_rom(0x8000, 0xffff, memregion("xrom")->base()); | |
290 | 290 | break; |
291 | 291 | |
292 | 292 | case HI_RAM_EXPANSION: |
293 | 293 | if (m_game) |
294 | 294 | { |
295 | program | |
295 | program.install_rom(0x8000, 0xffff, memregion("cart")->base()); | |
296 | 296 | } |
297 | 297 | else |
298 | 298 | { |
299 | 299 | if (m_ram->size() > 64 * 1024) |
300 | program | |
300 | program.install_ram(0x8000, 0xffff, ram + 0x18000); | |
301 | 301 | else |
302 | program | |
302 | program.unmap_readwrite(0x8000, 0xffff); | |
303 | 303 | } |
304 | 304 | break; |
305 | 305 | |
306 | 306 | case HI_CARTRIDGE_ROM: |
307 | program | |
307 | program.install_rom(0x8000, 0xffff, memregion("cart")->base()); | |
308 | 308 | break; |
309 | 309 | } |
310 | 310 | } |
r18027 | r18028 | |
---|---|---|
65 | 65 | |
66 | 66 | void msbc1_state::machine_reset() |
67 | 67 | { |
68 | void *ram = machine().firstcpu->space(AS_PROGRAM) | |
68 | void *ram = machine().firstcpu->space(AS_PROGRAM).get_write_ptr(0); | |
69 | 69 | UINT8 *rom = memregion(MC68000R12_TAG)->base(); |
70 | 70 | |
71 | 71 | memcpy(ram, rom, 8); |
r18027 | r18028 | |
---|---|---|
71 | 71 | |
72 | 72 | void unixpc_state::machine_reset() |
73 | 73 | { |
74 | address_space | |
74 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
75 | 75 | |
76 | 76 | // force ROM into lower mem on reset |
77 | romlmap_w( | |
77 | romlmap_w(program, 0, 0, 0xffff); | |
78 | 78 | |
79 | 79 | // reset cpu so that it can pickup the new values |
80 | 80 | m_maincpu->reset(); |
r18027 | r18028 | |
---|---|---|
137 | 137 | static TIMER_DEVICE_CALLBACK( mc8020_kbd ) |
138 | 138 | { |
139 | 139 | device_t *cpu = timer.machine().device( "maincpu" ); |
140 | address_space | |
140 | address_space &mem = cpu->memory().space(AS_PROGRAM); | |
141 | 141 | char kbdrow[6]; |
142 | 142 | UINT8 i; |
143 | 143 | for (i = 1; i < 8; i++) |
144 | 144 | { |
145 | 145 | sprintf(kbdrow,"X%X", i); |
146 | mem | |
146 | mem.write_word(0xd20+i, timer.machine().root_device().ioport(kbdrow)->read()); | |
147 | 147 | } |
148 | 148 | } |
149 | 149 |
r18027 | r18028 | |
---|---|---|
651 | 651 | |
652 | 652 | static void tsp_sprite_enable(running_machine &machine, UINT32 spr_offset, UINT8 sw_bit) |
653 | 653 | { |
654 | address_space &space = | |
654 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
655 | 655 | |
656 | 656 | space.write_word(spr_offset, space.read_word(spr_offset) & ~0x200); |
657 | 657 | space.write_word(spr_offset, space.read_word(spr_offset) | (sw_bit & 0x200)); |
r18027 | r18028 | |
---|---|---|
2069 | 2069 | static TIMER_DEVICE_CALLBACK(keyboard_callback) |
2070 | 2070 | { |
2071 | 2071 | pc6001_state *state = timer.machine().driver_data<pc6001_state>(); |
2072 | address_space &space = | |
2072 | address_space &space = timer.machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2073 | 2073 | UINT32 key1 = timer.machine().root_device().ioport("key1")->read(); |
2074 | 2074 | UINT32 key2 = timer.machine().root_device().ioport("key2")->read(); |
2075 | 2075 | UINT32 key3 = timer.machine().root_device().ioport("key3")->read(); |
r18027 | r18028 | |
---|---|---|
888 | 888 | |
889 | 889 | READ8_MEMBER( pc1512_state::memr_r ) |
890 | 890 | { |
891 | address_space | |
891 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
892 | 892 | offs_t page_offset = m_dma_page[m_dma_channel] << 16; |
893 | 893 | |
894 | return program | |
894 | return program.read_byte(page_offset + offset); | |
895 | 895 | } |
896 | 896 | |
897 | 897 | WRITE8_MEMBER( pc1512_state::memw_w ) |
898 | 898 | { |
899 | address_space | |
899 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
900 | 900 | offs_t page_offset = m_dma_page[m_dma_channel] << 16; |
901 | 901 | |
902 | program | |
902 | program.write_byte(page_offset + offset, data); | |
903 | 903 | } |
904 | 904 | |
905 | 905 | READ8_MEMBER( pc1512_state::ior1_r ) |
r18027 | r18028 | |
1210 | 1210 | |
1211 | 1211 | if (ram_size < 640 * 1024) |
1212 | 1212 | { |
1213 | address_space *program = m_maincpu->space(AS_PROGRAM); | |
1214 | program->unmap_readwrite(ram_size, 0x9ffff); | |
1213 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
1214 | program.unmap_readwrite(ram_size, 0x9ffff); | |
1215 | 1215 | } |
1216 | 1216 | |
1217 | 1217 | // state saving |
r18027 | r18028 | |
---|---|---|
224 | 224 | |
225 | 225 | void spc1000_state::machine_reset() |
226 | 226 | { |
227 | address_space &space = | |
227 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
228 | 228 | UINT8 *mem = memregion("maincpu")->base(); |
229 | 229 | UINT8 *ram = machine().device<ram_device>(RAM_TAG)->pointer(); |
230 | 230 |
r18027 | r18028 | |
---|---|---|
92 | 92 | |
93 | 93 | QUICKLOAD_LOAD( pipbug ) |
94 | 94 | { |
95 | address_space &space = | |
95 | address_space &space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM); | |
96 | 96 | int i; |
97 | 97 | int quick_addr = 0x0440; |
98 | 98 | int exec_addr; |
r18027 | r18028 | |
---|---|---|
217 | 217 | static void vii_blit(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT32 xoff, UINT32 yoff, UINT32 attr, UINT32 ctrl, UINT32 bitmap_addr, UINT16 tile) |
218 | 218 | { |
219 | 219 | vii_state *state = machine.driver_data<vii_state>(); |
220 | address_space &space = | |
220 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
221 | 221 | |
222 | 222 | UINT32 h = 8 << ((attr & PAGE_TILE_HEIGHT_MASK) >> PAGE_TILE_HEIGHT_SHIFT); |
223 | 223 | UINT32 w = 8 << ((attr & PAGE_TILE_WIDTH_MASK) >> PAGE_TILE_WIDTH_SHIFT); |
r18027 | r18028 | |
293 | 293 | UINT32 tilemap = regs[4]; |
294 | 294 | UINT32 palette_map = regs[5]; |
295 | 295 | UINT32 h, w, hn, wn; |
296 | address_space &space = | |
296 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
297 | 297 | |
298 | 298 | if(!(ctrl & PAGE_ENABLE_MASK)) |
299 | 299 | { |
r18027 | r18028 | |
355 | 355 | static void vii_blit_sprite(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, int depth, UINT32 base_addr) |
356 | 356 | { |
357 | 357 | vii_state *state = machine.driver_data<vii_state>(); |
358 | address_space &space = | |
358 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
359 | 359 | UINT16 tile, attr; |
360 | 360 | INT16 x, y; |
361 | 361 | UINT32 h, w; |
r18027 | r18028 | |
445 | 445 | |
446 | 446 | void vii_state::vii_do_dma(UINT32 len) |
447 | 447 | { |
448 | address_space | |
448 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
449 | 449 | UINT32 src = m_video_regs[0x70]; |
450 | 450 | UINT32 dst = m_video_regs[0x71] + 0x2c00; |
451 | 451 | UINT32 j; |
452 | 452 | |
453 | 453 | for(j = 0; j < len; j++) |
454 | 454 | { |
455 | mem | |
455 | mem.write_word((dst+j) << 1, mem.read_word((src+j) << 1)); | |
456 | 456 | } |
457 | 457 | |
458 | 458 | m_video_regs[0x72] = 0; |
r18027 | r18028 | |
616 | 616 | |
617 | 617 | void vii_state::spg_do_dma(UINT32 len) |
618 | 618 | { |
619 | address_space | |
619 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
620 | 620 | |
621 | 621 | UINT32 src = ((m_io_regs[0x101] & 0x3f) << 16) | m_io_regs[0x100]; |
622 | 622 | UINT32 dst = m_io_regs[0x103] & 0x3fff; |
623 | 623 | UINT32 j; |
624 | 624 | |
625 | 625 | for(j = 0; j < len; j++) |
626 | mem | |
626 | mem.write_word((dst+j) << 1, mem.read_word((src+j) << 1)); | |
627 | 627 | |
628 | 628 | m_io_regs[0x102] = 0; |
629 | 629 | } |
r18027 | r18028 | |
---|---|---|
114 | 114 | static void data_from_i8031(device_t *device, int data) |
115 | 115 | { |
116 | 116 | pes_state *state = device->machine().driver_data<pes_state>(); |
117 | state->m_terminal->write( | |
117 | state->m_terminal->write(device->machine().driver_data()->generic_space(),0,data); | |
118 | 118 | #ifdef DEBUG_SERIAL_CB |
119 | 119 | fprintf(stderr,"callback: output from i8031/pes to pc/terminal: %02X\n",data); |
120 | 120 | #endif |
r18027 | r18028 | |
---|---|---|
1937 | 1937 | |
1938 | 1938 | INPUT_CHANGED_MEMBER(x1_state::ipl_reset) |
1939 | 1939 | { |
1940 | //address_space &space = | |
1940 | //address_space &space = machine().device("x1_cpu")->memory().space(AS_PROGRAM); | |
1941 | 1941 | |
1942 | 1942 | m_x1_cpu->set_input_line(INPUT_LINE_RESET, newval ? CLEAR_LINE : ASSERT_LINE); |
1943 | 1943 | |
r18027 | r18028 | |
2404 | 2404 | TIMER_DEVICE_CALLBACK(x1_keyboard_callback) |
2405 | 2405 | { |
2406 | 2406 | x1_state *state = timer.machine().driver_data<x1_state>(); |
2407 | address_space &space = | |
2407 | address_space &space = timer.machine().device("x1_cpu")->memory().space(AS_PROGRAM); | |
2408 | 2408 | UINT32 key1 = timer.machine().root_device().ioport("key1")->read(); |
2409 | 2409 | UINT32 key2 = timer.machine().root_device().ioport("key2")->read(); |
2410 | 2410 | UINT32 key3 = timer.machine().root_device().ioport("key3")->read(); |
r18027 | r18028 | |
---|---|---|
120 | 120 | |
121 | 121 | void palm_state::machine_start() |
122 | 122 | { |
123 | address_space &space = | |
123 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
124 | 124 | space.install_read_bank (0x000000, machine().device<ram_device>(RAM_TAG)->size() - 1, machine().device<ram_device>(RAM_TAG)->size() - 1, 0, "bank1"); |
125 | 125 | space.install_write_bank(0x000000, machine().device<ram_device>(RAM_TAG)->size() - 1, machine().device<ram_device>(RAM_TAG)->size() - 1, 0, "bank1"); |
126 | 126 | membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer()); |
r18027 | r18028 | |
---|---|---|
57 | 57 | |
58 | 58 | void xor100_state::bankswitch() |
59 | 59 | { |
60 | address_space | |
60 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
61 | 61 | int banks = m_ram->size() / 0x10000; |
62 | 62 | |
63 | 63 | switch (m_mode) |
r18027 | r18028 | |
65 | 65 | case EPROM_0000: |
66 | 66 | if (m_bank < banks) |
67 | 67 | { |
68 | program | |
68 | program.install_write_bank(0x0000, 0xffff, "bank1"); | |
69 | 69 | membank("bank1")->set_entry(1 + m_bank); |
70 | 70 | } |
71 | 71 | else |
72 | 72 | { |
73 | program | |
73 | program.unmap_write(0x0000, 0xffff); | |
74 | 74 | } |
75 | 75 | |
76 | program->install_read_bank(0x0000, 0xf7ff, 0x07ff, 0, "bank2"); | |
77 | program->install_read_bank(0xf800, 0xffff, "bank3"); | |
76 | program.install_read_bank(0x0000, 0xf7ff, 0x07ff, 0, "bank2"); | |
77 | program.install_read_bank(0xf800, 0xffff, "bank3"); | |
78 | 78 | membank("bank2")->set_entry(0); |
79 | 79 | membank("bank3")->set_entry(0); |
80 | 80 | break; |
r18027 | r18028 | |
82 | 82 | case EPROM_F800: |
83 | 83 | if (m_bank < banks) |
84 | 84 | { |
85 | program->install_write_bank(0x0000, 0xffff, "bank1"); | |
86 | program->install_read_bank(0x0000, 0xf7ff, "bank2"); | |
85 | program.install_write_bank(0x0000, 0xffff, "bank1"); | |
86 | program.install_read_bank(0x0000, 0xf7ff, "bank2"); | |
87 | 87 | membank("bank1")->set_entry(1 + m_bank); |
88 | 88 | membank("bank2")->set_entry(1 + m_bank); |
89 | 89 | } |
90 | 90 | else |
91 | 91 | { |
92 | program->unmap_write(0x0000, 0xffff); | |
93 | program->unmap_read(0x0000, 0xf7ff); | |
92 | program.unmap_write(0x0000, 0xffff); | |
93 | program.unmap_read(0x0000, 0xf7ff); | |
94 | 94 | } |
95 | 95 | |
96 | program | |
96 | program.install_read_bank(0xf800, 0xffff, "bank3"); | |
97 | 97 | membank("bank3")->set_entry(0); |
98 | 98 | break; |
99 | 99 | |
100 | 100 | case EPROM_OFF: |
101 | 101 | if (m_bank < banks) |
102 | 102 | { |
103 | program->install_write_bank(0x0000, 0xffff, "bank1"); | |
104 | program->install_read_bank(0x0000, 0xf7ff, "bank2"); | |
105 | program->install_read_bank(0xf800, 0xffff, "bank3"); | |
103 | program.install_write_bank(0x0000, 0xffff, "bank1"); | |
104 | program.install_read_bank(0x0000, 0xf7ff, "bank2"); | |
105 | program.install_read_bank(0xf800, 0xffff, "bank3"); | |
106 | 106 | membank("bank1")->set_entry(1 + m_bank); |
107 | 107 | membank("bank2")->set_entry(1 + m_bank); |
108 | 108 | membank("bank3")->set_entry(1 + m_bank); |
109 | 109 | } |
110 | 110 | else |
111 | 111 | { |
112 | program->unmap_write(0x0000, 0xffff); | |
113 | program->unmap_read(0x0000, 0xf7ff); | |
114 | program->unmap_read(0xf800, 0xffff); | |
112 | program.unmap_write(0x0000, 0xffff); | |
113 | program.unmap_read(0x0000, 0xf7ff); | |
114 | program.unmap_read(0xf800, 0xffff); | |
115 | 115 | } |
116 | 116 | break; |
117 | 117 | } |
r18027 | r18028 | |
---|---|---|
320 | 320 | |
321 | 321 | static QUICKLOAD_LOAD( d6800 ) |
322 | 322 | { |
323 | address_space &space = | |
323 | address_space &space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM); | |
324 | 324 | int i; |
325 | 325 | int quick_addr = 0x0200; |
326 | 326 | int exec_addr = 0xc000; |
r18027 | r18028 | |
---|---|---|
175 | 175 | irq_mask = data; |
176 | 176 | ///printf("%02x\n",data); |
177 | 177 | // FIXME - the below 2 lines are needed, otherwise nothing ever gets written to videoram |
178 | address_space *mem = m_subcpu->space(AS_PROGRAM); | |
179 | data = mem->read_byte(0xe800); | |
178 | address_space &mem = m_subcpu->space(AS_PROGRAM); | |
179 | data = mem.read_byte(0xe800); | |
180 | 180 | } |
181 | 181 | |
182 | 182 | WRITE8_MEMBER( fp1100_state::main_to_sub_w ) |
r18027 | r18028 | |
---|---|---|
237 | 237 | |
238 | 238 | void tmc600_state::machine_start() |
239 | 239 | { |
240 | address_space | |
240 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
241 | 241 | |
242 | 242 | /* configure RAM */ |
243 | 243 | switch (m_ram->size()) |
244 | 244 | { |
245 | 245 | case 8*1024: |
246 | program | |
246 | program.unmap_readwrite(0x8000, 0xbfff); | |
247 | 247 | break; |
248 | 248 | |
249 | 249 | case 16*1024: |
250 | program | |
250 | program.unmap_readwrite(0xa000, 0xbfff); | |
251 | 251 | break; |
252 | 252 | } |
253 | 253 |
r18027 | r18028 | |
---|---|---|
161 | 161 | { |
162 | 162 | m_term_data = data; |
163 | 163 | //m_term_key = 1; |
164 | address_space *mem = m_maincpu->space(AS_PROGRAM); | |
165 | mem->write_byte(0xebec, data); // this has to be 0xecf1 for bios 1 | |
166 | mem->write_byte(0xebd0, 1); // any non-zero here | |
164 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
165 | mem.write_byte(0xebec, data); // this has to be 0xecf1 for bios 1 | |
166 | mem.write_byte(0xebd0, 1); // any non-zero here | |
167 | 167 | } |
168 | 168 | |
169 | 169 | static ASCII_KEYBOARD_INTERFACE( keyboard_intf ) |
r18027 | r18028 | |
---|---|---|
590 | 590 | |
591 | 591 | void ace_state::machine_start() |
592 | 592 | { |
593 | address_space | |
593 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
594 | 594 | |
595 | 595 | /* configure RAM */ |
596 | 596 | switch (m_ram->size()) |
597 | 597 | { |
598 | 598 | case 1*1024: |
599 | program | |
599 | program.unmap_readwrite(0x4000, 0xffff); | |
600 | 600 | break; |
601 | 601 | |
602 | 602 | case 16*1024: |
603 | program | |
603 | program.unmap_readwrite(0x8000, 0xffff); | |
604 | 604 | break; |
605 | 605 | |
606 | 606 | case 32*1024: |
607 | program | |
607 | program.unmap_readwrite(0xc000, 0xffff); | |
608 | 608 | break; |
609 | 609 | } |
610 | 610 | } |
r18027 | r18028 | |
---|---|---|
326 | 326 | { |
327 | 327 | UINT8 *messram = machine().device<ram_device>(RAM_TAG)->pointer(); |
328 | 328 | device_t *beta = machine().device(BETA_DISK_TAG); |
329 | address_space &space = | |
329 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
330 | 330 | |
331 | 331 | m_ram_0000 = NULL; |
332 | 332 | space.install_read_bank(0x0000, 0x3fff, "bank1"); |
r18027 | r18028 | |
---|---|---|
620 | 620 | |
621 | 621 | DRIVER_INIT_MEMBER(spectrum_state,spectrum) |
622 | 622 | { |
623 | address_space &space = | |
623 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
624 | 624 | |
625 | 625 | switch (machine().device<ram_device>(RAM_TAG)->size()) |
626 | 626 | { |
r18027 | r18028 | |
633 | 633 | |
634 | 634 | MACHINE_RESET_MEMBER(spectrum_state,spectrum) |
635 | 635 | { |
636 | address_space &space = | |
636 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
637 | 637 | |
638 | 638 | space.set_direct_update_handler(direct_update_delegate(FUNC(spectrum_state::spectrum_direct), this)); |
639 | 639 |
r18027 | r18028 | |
---|---|---|
479 | 479 | DRIVER_INIT_MEMBER(mpf1_state,mpf1) |
480 | 480 | { |
481 | 481 | |
482 | m_maincpu->space(AS_PROGRAM) | |
482 | m_maincpu->space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(mpf1_state::mpf1_direct_update_handler), this)); | |
483 | 483 | } |
484 | 484 | |
485 | 485 | COMP( 1979, mpf1, 0, 0, mpf1, mpf1, mpf1_state, mpf1, "Multitech", "Micro Professor 1", 0) |
r18027 | r18028 | |
---|---|---|
100 | 100 | INPUT_CHANGED_MEMBER(astrocde_mess_state::set_write_protect) // run when RAM expansion write protect switch is changed |
101 | 101 | { |
102 | 102 | int ram_expansion_installed = 0, write_protect_on = 0, expansion_ram_start = 0, expansion_ram_end = 0, shadow_ram_end = 0; |
103 | <<<<<<< .mine | |
104 | address_space &space = field.machine().device("maincpu")->memory().space(AS_PROGRAM); | |
105 | UINT8 *expram = field.machine().device<ram_device>("ram_tag")->pointer(); | |
106 | ======= | |
103 | 107 | address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM); |
104 | 108 | UINT8 *expram = machine().device<ram_device>("ram_tag")->pointer(); |
109 | >>>>>>> .r18023 | |
105 | 110 | |
106 | 111 | get_ram_expansion_settings(ram_expansion_installed, write_protect_on, expansion_ram_start, expansion_ram_end, shadow_ram_end); // passing by reference |
107 | 112 | |
r18027 | r18028 | |
320 | 325 | MACHINE_RESET_MEMBER(astrocde_mess_state, astrocde) |
321 | 326 | { |
322 | 327 | int ram_expansion_installed = 0, write_protect_on = 0, expansion_ram_start = 0, expansion_ram_end = 0, shadow_ram_end = 0; |
328 | <<<<<<< .mine | |
329 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
330 | UINT8 *expram = machine.device<ram_device>("ram_tag")->pointer(); | |
331 | ======= | |
323 | 332 | address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM); |
324 | 333 | UINT8 *expram = machine().device<ram_device>("ram_tag")->pointer(); |
334 | >>>>>>> .r18023 | |
325 | 335 | space.unmap_readwrite(0x5000, 0xffff); // unmap any previously installed expansion RAM |
326 | 336 | |
327 | 337 | get_ram_expansion_settings(ram_expansion_installed, write_protect_on, expansion_ram_start, expansion_ram_end, shadow_ram_end); // passing by reference |
r18027 | r18028 | |
---|---|---|
800 | 800 | |
801 | 801 | READ8_MEMBER( plus4_state::exp_dma_r ) |
802 | 802 | { |
803 | return m_maincpu->space(AS_PROGRAM) | |
803 | return m_maincpu->space(AS_PROGRAM).read_byte(offset); | |
804 | 804 | } |
805 | 805 | |
806 | 806 | WRITE8_MEMBER( plus4_state::exp_dma_w ) |
807 | 807 | { |
808 | m_maincpu->space(AS_PROGRAM) | |
808 | m_maincpu->space(AS_PROGRAM).write_byte(offset, data); | |
809 | 809 | } |
810 | 810 | |
811 | 811 | WRITE_LINE_MEMBER( plus4_state::exp_irq_w ) |
r18027 | r18028 | |
---|---|---|
355 | 355 | |
356 | 356 | static TIMER_CALLBACK( swyft_reset ) |
357 | 357 | { |
358 | memset(machine.device("maincpu")->memory().space(AS_PROGRAM) | |
358 | memset(machine.device("maincpu")->memory().space(AS_PROGRAM).get_read_ptr(0xe2341), 0xff, 1); | |
359 | 359 | } |
360 | 360 | |
361 | 361 | MACHINE_START_MEMBER(cat_state,swyft) |
r18027 | r18028 | |
---|---|---|
67 | 67 | if (m_fdc_fifo_empty[m_fdc_fifo_sel]) return; |
68 | 68 | |
69 | 69 | if (m_fdc_dmabytes) { |
70 | address_space | |
70 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
71 | 71 | for (int i = 0; i < 8; i++) { |
72 | 72 | UINT16 data = m_fdc_fifo[m_fdc_fifo_sel][i]; |
73 | 73 | |
74 | 74 | if (LOG) logerror("Flushing DMA FIFO %u data %04x to address %06x\n", m_fdc_fifo_sel, data, m_dma_base); |
75 | 75 | |
76 | 76 | if(m_dma_base >= 8) |
77 | program | |
77 | program.write_word(m_dma_base, data); | |
78 | 78 | m_dma_base += 2; |
79 | 79 | } |
80 | 80 | m_fdc_dmabytes -= 16; |
r18027 | r18028 | |
98 | 98 | void st_state::fill_dma_fifo() |
99 | 99 | { |
100 | 100 | if (m_fdc_dmabytes) { |
101 | address_space | |
101 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
102 | 102 | for (int i = 0; i < 8; i++) { |
103 | UINT16 data = program | |
103 | UINT16 data = program.read_word(m_dma_base); | |
104 | 104 | |
105 | 105 | if (LOG) logerror("Filling DMA FIFO %u with data %04x from memory address %06x\n", m_fdc_fifo_sel, data, m_dma_base); |
106 | 106 | |
r18027 | r18028 | |
2142 | 2142 | |
2143 | 2143 | void st_state::configure_memory() |
2144 | 2144 | { |
2145 | address_space | |
2145 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
2146 | 2146 | |
2147 | 2147 | switch (m_ram->size()) |
2148 | 2148 | { |
2149 | 2149 | case 256 * 1024: |
2150 | program | |
2150 | program.unmap_readwrite(0x040000, 0x3fffff); | |
2151 | 2151 | break; |
2152 | 2152 | |
2153 | 2153 | case 512 * 1024: |
2154 | program | |
2154 | program.unmap_readwrite(0x080000, 0x3fffff); | |
2155 | 2155 | break; |
2156 | 2156 | |
2157 | 2157 | case 1024 * 1024: |
2158 | program | |
2158 | program.unmap_readwrite(0x100000, 0x3fffff); | |
2159 | 2159 | break; |
2160 | 2160 | |
2161 | 2161 | case 2048 * 1024: |
2162 | program | |
2162 | program.unmap_readwrite(0x200000, 0x3fffff); | |
2163 | 2163 | break; |
2164 | 2164 | } |
2165 | 2165 | } |
r18027 | r18028 | |
2292 | 2292 | void stbook_state::machine_start() |
2293 | 2293 | { |
2294 | 2294 | /* configure RAM banking */ |
2295 | address_space | |
2295 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
2296 | 2296 | |
2297 | 2297 | switch (m_ram->size()) |
2298 | 2298 | { |
2299 | 2299 | case 1024 * 1024: |
2300 | program | |
2300 | program.unmap_readwrite(0x100000, 0x3fffff); | |
2301 | 2301 | break; |
2302 | 2302 | } |
2303 | 2303 |
r18027 | r18028 | |
---|---|---|
642 | 642 | |
643 | 643 | void sg1000_state::install_cartridge(UINT8 *ptr, int size) |
644 | 644 | { |
645 | address_space | |
645 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
646 | 646 | |
647 | 647 | switch (size) |
648 | 648 | { |
649 | 649 | case 40 * 1024: |
650 | program->install_read_bank(0x8000, 0x9fff, "bank1"); | |
651 | program->unmap_write(0x8000, 0x9fff); | |
650 | program.install_read_bank(0x8000, 0x9fff, "bank1"); | |
651 | program.unmap_write(0x8000, 0x9fff); | |
652 | 652 | membank("bank1")->configure_entry(0, memregion(Z80_TAG)->base() + 0x8000); |
653 | 653 | membank("bank1")->set_entry(0); |
654 | 654 | break; |
655 | 655 | |
656 | 656 | case 48 * 1024: |
657 | program->install_read_bank(0x8000, 0xbfff, "bank1"); | |
658 | program->unmap_write(0x8000, 0xbfff); | |
657 | program.install_read_bank(0x8000, 0xbfff, "bank1"); | |
658 | program.unmap_write(0x8000, 0xbfff); | |
659 | 659 | membank("bank1")->configure_entry(0, memregion(Z80_TAG)->base() + 0x8000); |
660 | 660 | membank("bank1")->set_entry(0); |
661 | 661 | break; |
r18027 | r18028 | |
663 | 663 | default: |
664 | 664 | if (IS_CARTRIDGE_TV_DRAW(ptr)) |
665 | 665 | { |
666 | program->install_write_handler(0x6000, 0x6000, 0, 0, write8_delegate(FUNC(sg1000_state::tvdraw_axis_w), this), 0); | |
667 | program->install_read_handler(0x8000, 0x8000, 0, 0, read8_delegate(FUNC(sg1000_state::tvdraw_status_r), this), 0); | |
668 | program->install_read_handler(0xa000, 0xa000, 0, 0, read8_delegate(FUNC(sg1000_state::tvdraw_data_r), this), 0); | |
669 | program->nop_write(0xa000, 0xa000); | |
666 | program.install_write_handler(0x6000, 0x6000, 0, 0, write8_delegate(FUNC(sg1000_state::tvdraw_axis_w), this), 0); | |
667 | program.install_read_handler(0x8000, 0x8000, 0, 0, read8_delegate(FUNC(sg1000_state::tvdraw_status_r), this), 0); | |
668 | program.install_read_handler(0xa000, 0xa000, 0, 0, read8_delegate(FUNC(sg1000_state::tvdraw_data_r), this), 0); | |
669 | program.nop_write(0xa000, 0xa000); | |
670 | 670 | } |
671 | 671 | else if (IS_CARTRIDGE_THE_CASTLE(ptr)) |
672 | 672 | { |
673 | program | |
673 | program.install_readwrite_bank(0x8000, 0x9fff, "bank1"); | |
674 | 674 | } |
675 | 675 | break; |
676 | 676 | } |
r18027 | r18028 | |
684 | 684 | { |
685 | 685 | running_machine &machine = image.device().machine(); |
686 | 686 | sg1000_state *state = machine.driver_data<sg1000_state>(); |
687 | address_space | |
687 | address_space &program = machine.device(Z80_TAG)->memory().space(AS_PROGRAM); | |
688 | 688 | UINT8 *ptr = state->memregion(Z80_TAG)->base(); |
689 | 689 | UINT32 ram_size = 0x400; |
690 | 690 | bool install_2000_ram = false; |
r18027 | r18028 | |
781 | 781 | |
782 | 782 | if ( install_2000_ram ) |
783 | 783 | { |
784 | program | |
784 | program.install_ram(0x2000, 0x3FFF); | |
785 | 785 | } |
786 | 786 | |
787 | 787 | /* work RAM banking */ |
788 | program | |
788 | program.install_readwrite_bank(0xc000, 0xc000 + ram_size - 1, 0, 0x4000 - ram_size, "bank2"); | |
789 | 789 | |
790 | 790 | return IMAGE_INIT_PASS; |
791 | 791 | } |
r18027 | r18028 | |
825 | 825 | |
826 | 826 | void sc3000_state::install_cartridge(UINT8 *ptr, int size) |
827 | 827 | { |
828 | address_space | |
828 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
829 | 829 | |
830 | 830 | /* include SG-1000 mapping */ |
831 | 831 | sg1000_state::install_cartridge(ptr, size); |
832 | 832 | |
833 | 833 | if (IS_CARTRIDGE_BASIC_LEVEL_III(ptr)) |
834 | 834 | { |
835 | program->install_readwrite_bank(0x8000, 0xbfff, "bank1"); | |
836 | program->install_readwrite_bank(0xc000, 0xffff, "bank2"); | |
835 | program.install_readwrite_bank(0x8000, 0xbfff, "bank1"); | |
836 | program.install_readwrite_bank(0xc000, 0xffff, "bank2"); | |
837 | 837 | } |
838 | 838 | else if (IS_CARTRIDGE_MUSIC_EDITOR(ptr)) |
839 | 839 | { |
840 | program->install_readwrite_bank(0x8000, 0x9fff, "bank1"); | |
841 | program->install_readwrite_bank(0xc000, 0xc7ff, 0, 0x3800, "bank2"); | |
840 | program.install_readwrite_bank(0x8000, 0x9fff, "bank1"); | |
841 | program.install_readwrite_bank(0xc000, 0xc7ff, 0, 0x3800, "bank2"); | |
842 | 842 | } |
843 | 843 | else |
844 | 844 | { |
845 | 845 | /* regular cartridges */ |
846 | program | |
846 | program.install_readwrite_bank(0xc000, 0xc7ff, 0, 0x3800, "bank2"); | |
847 | 847 | } |
848 | 848 | } |
849 | 849 |
r18027 | r18028 | |
---|---|---|
1261 | 1261 | static void scsi_irq(running_machine &machine, int state) |
1262 | 1262 | { |
1263 | 1263 | ip22_state *drvstate = machine.driver_data<ip22_state>(); |
1264 | address_space &space = | |
1264 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1265 | 1265 | |
1266 | 1266 | if (state) |
1267 | 1267 | { |
r18027 | r18028 | |
---|---|---|
75 | 75 | |
76 | 76 | void px8_state::bankswitch() |
77 | 77 | { |
78 | address_space | |
78 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
79 | 79 | UINT8 *ram = m_ram->pointer(); |
80 | 80 | UINT8 *ipl_rom = memregion(UPD70008_TAG)->base(); |
81 | 81 | |
82 | 82 | if (!m_bank0) |
83 | 83 | { |
84 | 84 | /* IPL ROM */ |
85 | program | |
85 | program.install_rom(0x0000, 0x7fff, ipl_rom); | |
86 | 86 | } |
87 | 87 | else |
88 | 88 | { |
89 | 89 | if (m_bk2) |
90 | 90 | { |
91 | 91 | /* D-RAM (L) */ |
92 | program | |
92 | program.install_ram(0x0000, 0x7fff, ram); | |
93 | 93 | } |
94 | 94 | else |
95 | 95 | { |
96 | 96 | /* OPTION ROM (L) */ |
97 | program | |
97 | program.unmap_readwrite(0x0000, 0x7fff); | |
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
101 | 101 | if (m_bk2) |
102 | 102 | { |
103 | 103 | /* D-RAM (H) */ |
104 | program | |
104 | program.install_ram(0x8000, 0xffff, ram + 0x8000); | |
105 | 105 | } |
106 | 106 | else |
107 | 107 | { |
108 | 108 | /* OPTION ROM (H) */ |
109 | program | |
109 | program.unmap_readwrite(0x8000, 0xffff); | |
110 | 110 | } |
111 | 111 | } |
112 | 112 |
r18027 | r18028 | |
---|---|---|
757 | 757 | |
758 | 758 | void mm1_state::machine_reset() |
759 | 759 | { |
760 | address_space | |
760 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
761 | 761 | int i; |
762 | 762 | |
763 | 763 | // reset LS259 |
764 | for (i = 0; i < 8; i++) ls259_w( | |
764 | for (i = 0; i < 8; i++) ls259_w(program, i, 0); | |
765 | 765 | |
766 | 766 | // set FDC ready |
767 | 767 | if (!ioport("T5")->read()) upd765_ready_w(m_fdc, 1); |
r18027 | r18028 | |
---|---|---|
783 | 783 | { |
784 | 784 | if ( ( address & 0x1FFF ) >= 0x1FF6 && ( address & 0x1FFF ) <= 0x1FF9 ) |
785 | 785 | { |
786 | modeF6_switch_w( | |
786 | modeF6_switch_w(machine().device("maincpu")->memory().space(AS_PROGRAM), ( address & 0x1FFF ) - 0x1FF6, 0 ); | |
787 | 787 | } |
788 | 788 | return address; |
789 | 789 | } |
r18027 | r18028 | |
1129 | 1129 | m_bank_base[1] = memregion("user1")->base() + 0x1000 * ( ( address & 0x2000 ) ? 0 : 1 ); |
1130 | 1130 | membank("bank1")->set_base(m_bank_base[1] ); |
1131 | 1131 | /* and restore old opbase handler */ |
1132 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
1132 | machine().device("maincpu")->memory().space(AS_PROGRAM).set_direct_update_handler(m_FE_old_opbase_handler); | |
1133 | 1133 | } |
1134 | 1134 | else |
1135 | 1135 | { |
r18027 | r18028 | |
1142 | 1142 | static void modeFE_switch(running_machine &machine,UINT16 offset, UINT8 data) |
1143 | 1143 | { |
1144 | 1144 | a2600_state *state = machine.driver_data<a2600_state>(); |
1145 | address_space& space = | |
1145 | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
1146 | 1146 | /* Retrieve last byte read by the cpu (for this mapping scheme this |
1147 | 1147 | should be the last byte that was on the data bus |
1148 | 1148 | */ |
r18027 | r18028 | |
1290 | 1290 | "bank4", |
1291 | 1291 | }; |
1292 | 1292 | |
1293 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
1293 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank( | |
1294 | 1294 | 0x1000 + (i + 0) * 0x1000 / count - 0, |
1295 | 1295 | 0x1000 + (i + 1) * 0x1000 / count - 1, handler[i]); |
1296 | 1296 | |
r18027 | r18028 | |
1732 | 1732 | |
1733 | 1733 | void a2600_state::machine_reset() |
1734 | 1734 | { |
1735 | address_space& space = | |
1735 | address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1736 | 1736 | int chip = 0xFF; |
1737 | 1737 | static const unsigned char snowwhite[] = { 0x10, 0xd0, 0xff, 0xff }; // Snow White Proto |
1738 | 1738 |
r18027 | r18028 | |
---|---|---|
234 | 234 | static void pcw_update_read_memory_block(running_machine &machine, int block, int bank) |
235 | 235 | { |
236 | 236 | pcw_state *state = machine.driver_data<pcw_state>(); |
237 | address_space &space = | |
237 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
238 | 238 | char block_name[10]; |
239 | 239 | |
240 | 240 | sprintf(block_name,"bank%d",block+1); |
r18027 | r18028 | |
---|---|---|
674 | 674 | |
675 | 675 | void sb2m600_state::machine_start() |
676 | 676 | { |
677 | address_space | |
677 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
678 | 678 | |
679 | 679 | /* configure RAM banking */ |
680 | 680 | membank("bank1")->configure_entry(0, memregion(M6502_TAG)->base()); |
r18027 | r18028 | |
683 | 683 | switch (m_ram->size()) |
684 | 684 | { |
685 | 685 | case 4*1024: |
686 | program->install_readwrite_bank(0x0000, 0x0fff, "bank1"); | |
687 | program->unmap_readwrite(0x1000, 0x1fff); | |
686 | program.install_readwrite_bank(0x0000, 0x0fff, "bank1"); | |
687 | program.unmap_readwrite(0x1000, 0x1fff); | |
688 | 688 | break; |
689 | 689 | |
690 | 690 | case 8*1024: |
691 | program | |
691 | program.install_readwrite_bank(0x0000, 0x1fff, "bank1"); | |
692 | 692 | break; |
693 | 693 | } |
694 | 694 | |
r18027 | r18028 | |
699 | 699 | |
700 | 700 | void c1p_state::machine_start() |
701 | 701 | { |
702 | address_space | |
702 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
703 | 703 | |
704 | 704 | /* configure RAM banking */ |
705 | 705 | membank("bank1")->configure_entry(0, memregion(M6502_TAG)->base()); |
r18027 | r18028 | |
708 | 708 | switch (m_ram->size()) |
709 | 709 | { |
710 | 710 | case 8*1024: |
711 | program->install_readwrite_bank(0x0000, 0x1fff, "bank1"); | |
712 | program->unmap_readwrite(0x2000, 0x4fff); | |
711 | program.install_readwrite_bank(0x0000, 0x1fff, "bank1"); | |
712 | program.unmap_readwrite(0x2000, 0x4fff); | |
713 | 713 | break; |
714 | 714 | |
715 | 715 | case 20*1024: |
716 | program | |
716 | program.install_readwrite_bank(0x0000, 0x4fff, "bank1"); | |
717 | 717 | break; |
718 | 718 | } |
719 | 719 |
r18027 | r18028 | |
---|---|---|
155 | 155 | |
156 | 156 | WRITE8_MEMBER( rex6000_state::bankswitch_w ) |
157 | 157 | { |
158 | address_space | |
158 | address_space& program = m_maincpu->space(AS_PROGRAM); | |
159 | 159 | |
160 | 160 | m_bank[offset&3] = data; |
161 | 161 | |
r18027 | r18028 | |
170 | 170 | |
171 | 171 | if (m_banks[0].type != BANK_UNKNOWN) |
172 | 172 | { |
173 | program | |
173 | program.install_readwrite_handler(0x8000, 0x9fff, 0, 0, read8_delegate(FUNC(rex6000_state::flash_0x8000_r), this), write8_delegate(FUNC(rex6000_state::flash_0x8000_w), this)); | |
174 | 174 | } |
175 | 175 | else |
176 | 176 | { |
177 | program | |
177 | program.unmap_readwrite(0x8000, 0x9fff); | |
178 | 178 | } |
179 | 179 | |
180 | 180 | break; |
r18027 | r18028 | |
187 | 187 | |
188 | 188 | if (m_banks[1].type == BANK_RAM) |
189 | 189 | { |
190 | program | |
190 | program.install_ram(0xa000, 0xbfff, m_ram_base + ((m_banks[1].page & 0x03)<<13)); | |
191 | 191 | } |
192 | 192 | else if (m_banks[1].type != BANK_UNKNOWN) |
193 | 193 | { |
194 | program | |
194 | program.install_readwrite_handler(0xa000, 0xbfff, 0, 0, read8_delegate(FUNC(rex6000_state::flash_0xa000_r), this), write8_delegate(FUNC(rex6000_state::flash_0xa000_w), this)); | |
195 | 195 | } |
196 | 196 | else |
197 | 197 | { |
198 | program | |
198 | program.unmap_readwrite(0xa000, 0xbfff); | |
199 | 199 | } |
200 | 200 | |
201 | 201 | break; |
r18027 | r18028 | |
452 | 452 | } |
453 | 453 | void rex6000_state::machine_reset() |
454 | 454 | { |
455 | address_space | |
455 | address_space& program = m_maincpu->space(AS_PROGRAM); | |
456 | 456 | |
457 | program->install_readwrite_handler(0x8000, 0x9fff, 0, 0, read8_delegate(FUNC(rex6000_state::flash_0x8000_r), this), write8_delegate(FUNC(rex6000_state::flash_0x8000_w), this)); | |
458 | program->install_readwrite_handler(0xa000, 0xbfff, 0, 0, read8_delegate(FUNC(rex6000_state::flash_0xa000_r), this), write8_delegate(FUNC(rex6000_state::flash_0xa000_w), this)); | |
457 | program.install_readwrite_handler(0x8000, 0x9fff, 0, 0, read8_delegate(FUNC(rex6000_state::flash_0x8000_r), this), write8_delegate(FUNC(rex6000_state::flash_0x8000_w), this)); | |
458 | program.install_readwrite_handler(0xa000, 0xbfff, 0, 0, read8_delegate(FUNC(rex6000_state::flash_0xa000_r), this), write8_delegate(FUNC(rex6000_state::flash_0xa000_w), this)); | |
459 | 459 | |
460 | 460 | m_banks[0].type = 0x04; |
461 | 461 | m_banks[0].type = 0; |
r18027 | r18028 | |
493 | 493 | } |
494 | 494 | else |
495 | 495 | { |
496 | data = m_flash[mem_type]->space(0) | |
496 | data = m_flash[mem_type]->space(0).read_byte(((lcd_bank & 0x7f)<<13) | (y*30 + x)); | |
497 | 497 | } |
498 | 498 | |
499 | 499 | |
r18027 | r18028 | |
569 | 569 | { |
570 | 570 | static const char magic[] = "ApplicationName:Addin"; |
571 | 571 | running_machine &machine = image.device().machine(); |
572 | address_space | |
572 | address_space& flash = machine.device("flash0b")->memory().space(0); | |
573 | 573 | UINT32 img_start = 0; |
574 | 574 | UINT8 *data; |
575 | 575 | |
r18027 | r18028 | |
583 | 583 | img_start += 0xa0; //skip the icon (40x32 pixel) |
584 | 584 | |
585 | 585 | for (int i=0; i<image.length() - img_start ;i++) |
586 | flash | |
586 | flash.write_byte(i, data[img_start + i]); | |
587 | 587 | |
588 | 588 | auto_free(machine, data); |
589 | 589 |
r18027 | r18028 | |
---|---|---|
126 | 126 | |
127 | 127 | void v1050_state::bankswitch() |
128 | 128 | { |
129 | address_space | |
129 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
130 | 130 | |
131 | 131 | int bank = (m_bank >> 1) & 0x03; |
132 | 132 | |
133 | 133 | if (BIT(m_bank, 0)) |
134 | 134 | { |
135 | program | |
135 | program.install_readwrite_bank(0x0000, 0x1fff, "bank1"); | |
136 | 136 | membank("bank1")->set_entry(bank); |
137 | 137 | } |
138 | 138 | else |
139 | 139 | { |
140 | program->install_read_bank(0x0000, 0x1fff, "bank1"); | |
141 | program->unmap_write(0x0000, 0x1fff); | |
140 | program.install_read_bank(0x0000, 0x1fff, "bank1"); | |
141 | program.unmap_write(0x0000, 0x1fff); | |
142 | 142 | membank("bank1")->set_entry(3); |
143 | 143 | } |
144 | 144 | |
r18027 | r18028 | |
146 | 146 | |
147 | 147 | if (bank == 2) |
148 | 148 | { |
149 | program | |
149 | program.unmap_readwrite(0x4000, 0xbfff); | |
150 | 150 | } |
151 | 151 | else |
152 | 152 | { |
153 | program->install_readwrite_bank(0x4000, 0x7fff, "bank3"); | |
154 | program->install_readwrite_bank(0x8000, 0xbfff, "bank4"); | |
153 | program.install_readwrite_bank(0x4000, 0x7fff, "bank3"); | |
154 | program.install_readwrite_bank(0x8000, 0xbfff, "bank4"); | |
155 | 155 | membank("bank3")->set_entry(bank); |
156 | 156 | membank("bank4")->set_entry(bank); |
157 | 157 | } |
r18027 | r18028 | |
702 | 702 | static WRITE8_DEVICE_HANDLER( misc_ppi_pb_w ) |
703 | 703 | { |
704 | 704 | centronics_device *centronics = device->machine().device<centronics_device>(CENTRONICS_TAG); |
705 | centronics->write( | |
705 | centronics->write( device->machine().driver_data()->generic_space() , 0, ~data & 0xff); | |
706 | 706 | } |
707 | 707 | |
708 | 708 | static READ8_DEVICE_HANDLER( misc_ppi_pc_r ) |
r18027 | r18028 | |
1020 | 1020 | |
1021 | 1021 | void v1050_state::machine_start() |
1022 | 1022 | { |
1023 | address_space | |
1023 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
1024 | 1024 | |
1025 | 1025 | // initialize SASI bus |
1026 | 1026 | m_sasibus->init_scsibus(256); |
r18027 | r18028 | |
1042 | 1042 | membank("bank1")->configure_entry(2, ram + 0x1c000); |
1043 | 1043 | membank("bank1")->configure_entry(3, memregion(Z80_TAG)->base()); |
1044 | 1044 | |
1045 | program | |
1045 | program.install_readwrite_bank(0x2000, 0x3fff, "bank2"); | |
1046 | 1046 | membank("bank2")->configure_entries(0, 2, ram + 0x2000, 0x10000); |
1047 | 1047 | membank("bank2")->configure_entry(2, ram + 0x1e000); |
1048 | 1048 | |
1049 | program | |
1049 | program.install_readwrite_bank(0x4000, 0x7fff, "bank3"); | |
1050 | 1050 | membank("bank3")->configure_entries(0, 2, ram + 0x4000, 0x10000); |
1051 | 1051 | |
1052 | program | |
1052 | program.install_readwrite_bank(0x8000, 0xbfff, "bank4"); | |
1053 | 1053 | membank("bank4")->configure_entries(0, 2, ram + 0x8000, 0x10000); |
1054 | 1054 | |
1055 | program | |
1055 | program.install_readwrite_bank(0xc000, 0xffff, "bank5"); | |
1056 | 1056 | membank("bank5")->configure_entries(0, 3, ram + 0xc000, 0); |
1057 | 1057 | |
1058 | 1058 | bankswitch(); |
r18027 | r18028 | |
---|---|---|
907 | 907 | |
908 | 908 | void ql_state::machine_reset() |
909 | 909 | { |
910 | address_space | |
910 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
911 | 911 | |
912 | 912 | m_disk_type=ioport(QL_CONFIG_PORT)->read() & DISK_TYPE_MASK; |
913 | 913 | logerror("disktype=%d\n",m_disk_type); |
r18027 | r18028 | |
920 | 920 | switch (m_ram->size()) |
921 | 921 | { |
922 | 922 | case 128*1024: |
923 | program | |
923 | program.unmap_readwrite(0x040000, 0x0fffff); | |
924 | 924 | break; |
925 | 925 | |
926 | 926 | case 192*1024: |
927 | program | |
927 | program.unmap_readwrite(0x050000, 0x0fffff); | |
928 | 928 | break; |
929 | 929 | |
930 | 930 | case 256*1024: |
931 | program | |
931 | program.unmap_readwrite(0x060000, 0x0fffff); | |
932 | 932 | break; |
933 | 933 | |
934 | 934 | case 384*1024: |
935 | program | |
935 | program.unmap_readwrite(0x080000, 0x0fffff); | |
936 | 936 | break; |
937 | 937 | |
938 | 938 | case 640*1024: |
939 | program | |
939 | program.unmap_readwrite(0x0c0000, 0x0fffff); | |
940 | 940 | break; |
941 | 941 | } |
942 | 942 | |
r18027 | r18028 | |
944 | 944 | { |
945 | 945 | case DISK_TYPE_SANDY : |
946 | 946 | logerror("Configuring SandySuperDisk\n"); |
947 | program->install_rom(0x0c0000, 0x0c3fff, &machine().root_device().memregion(M68008_TAG)->base()[SANDY_ROM_BASE]); | |
948 | program->install_read_handler(SANDY_IO_BASE, SANDY_IO_END, 0, 0, read8_delegate(FUNC(ql_state::disk_io_r), this)); | |
949 | program->install_write_handler(SANDY_IO_BASE, SANDY_IO_END, 0, 0, write8_delegate(FUNC(ql_state::disk_io_w), this)); | |
947 | program.install_rom(0x0c0000, 0x0c3fff, &machine().root_device().memregion(M68008_TAG)->base()[SANDY_ROM_BASE]); | |
948 | program.install_read_handler(SANDY_IO_BASE, SANDY_IO_END, 0, 0, read8_delegate(FUNC(ql_state::disk_io_r), this)); | |
949 | program.install_write_handler(SANDY_IO_BASE, SANDY_IO_END, 0, 0, write8_delegate(FUNC(ql_state::disk_io_w), this)); | |
950 | 950 | m_disk_io_base=SANDY_IO_BASE; |
951 | 951 | break; |
952 | 952 | case DISK_TYPE_TRUMP : |
953 | 953 | logerror("Configuring TrumpCard\n"); |
954 | program->install_read_handler(CART_ROM_BASE, CART_ROM_END, 0, 0, read8_delegate(FUNC(ql_state::cart_rom_r), this)); | |
955 | program->install_read_handler(TRUMP_ROM_BASE, TRUMP_ROM_END, 0, 0, read8_delegate(FUNC(ql_state::trump_card_rom_r), this)); | |
956 | program->install_read_handler(TRUMP_IO_BASE, TRUMP_IO_END, 0, 0, read8_delegate(FUNC(ql_state::disk_io_r), this)); | |
957 | program->install_write_handler(TRUMP_IO_BASE, TRUMP_IO_END, 0, 0, write8_delegate(FUNC(ql_state::disk_io_w), this)); | |
954 | program.install_read_handler(CART_ROM_BASE, CART_ROM_END, 0, 0, read8_delegate(FUNC(ql_state::cart_rom_r), this)); | |
955 | program.install_read_handler(TRUMP_ROM_BASE, TRUMP_ROM_END, 0, 0, read8_delegate(FUNC(ql_state::trump_card_rom_r), this)); | |
956 | program.install_read_handler(TRUMP_IO_BASE, TRUMP_IO_END, 0, 0, read8_delegate(FUNC(ql_state::disk_io_r), this)); | |
957 | program.install_write_handler(TRUMP_IO_BASE, TRUMP_IO_END, 0, 0, write8_delegate(FUNC(ql_state::disk_io_w), this)); | |
958 | 958 | m_disk_io_base=TRUMP_IO_BASE; |
959 | 959 | break; |
960 | 960 | } |
r18027 | r18028 | |
---|---|---|
550 | 550 | } |
551 | 551 | |
552 | 552 | /* overlay disabled, map RAM on 0x000000 */ |
553 | device->machine().device("maincpu")->memory().space(AS_PROGRAM) | |
553 | device->machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(0x000000, state->m_chip_ram.bytes() - 1, 0, mirror_mask, "bank1"); | |
554 | 554 | |
555 | 555 | /* if there is a cart region, check for cart overlay */ |
556 | 556 | if (device->machine().root_device().memregion("user2")->base() != NULL) |
r18027 | r18028 | |
558 | 558 | } |
559 | 559 | else |
560 | 560 | /* overlay enabled, map Amiga system ROM on 0x000000 */ |
561 | device->machine().device("maincpu")->memory().space(AS_PROGRAM) | |
561 | device->machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x000000, state->m_chip_ram.bytes() - 1); | |
562 | 562 | |
563 | 563 | set_led_status( device->machine(), 0, ( data & 2 ) ? 0 : 1 ); /* bit 2 = Power Led on Amiga */ |
564 | 564 | output_set_value("power_led", ( data & 2 ) ? 0 : 1); |
r18027 | r18028 | |
597 | 597 | if (machine.root_device().ioport("hardware")->read() & 0x08) |
598 | 598 | { |
599 | 599 | /* Install RTC */ |
600 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
600 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0xdc0000, 0xdc003f, FUNC(amiga_clock_r), FUNC(amiga_clock_w)); | |
601 | 601 | } |
602 | 602 | else |
603 | 603 | { |
604 | 604 | /* No RTC support */ |
605 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
605 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_readwrite(0xdc0000, 0xdc003f); | |
606 | 606 | } |
607 | 607 | } |
608 | 608 |
r18027 | r18028 | |
---|---|---|
192 | 192 | |
193 | 193 | void abc800_state::bankswitch() |
194 | 194 | { |
195 | address_space | |
195 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
196 | 196 | |
197 | 197 | if (m_fetch_charram) |
198 | 198 | { |
199 | 199 | // HR video RAM selected |
200 | program | |
200 | program.install_ram(0x0000, 0x3fff, m_video_ram); | |
201 | 201 | } |
202 | 202 | else |
203 | 203 | { |
204 | 204 | // BASIC ROM selected |
205 | program | |
205 | program.install_rom(0x0000, 0x3fff, memregion(Z80_TAG)->base()); | |
206 | 206 | } |
207 | 207 | } |
208 | 208 | |
r18027 | r18028 | |
213 | 213 | |
214 | 214 | void abc802_state::bankswitch() |
215 | 215 | { |
216 | address_space | |
216 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
217 | 217 | |
218 | 218 | if (m_lrs) |
219 | 219 | { |
220 | 220 | // ROM and video RAM selected |
221 | program->install_rom(0x0000, 0x77ff, memregion(Z80_TAG)->base()); | |
222 | program->install_ram(0x7800, 0x7fff, m_char_ram); | |
221 | program.install_rom(0x0000, 0x77ff, memregion(Z80_TAG)->base()); | |
222 | program.install_ram(0x7800, 0x7fff, m_char_ram); | |
223 | 223 | } |
224 | 224 | else |
225 | 225 | { |
226 | 226 | // low RAM selected |
227 | program | |
227 | program.install_ram(0x0000, 0x7fff, m_ram->pointer()); | |
228 | 228 | } |
229 | 229 | } |
230 | 230 | |
r18027 | r18028 | |
235 | 235 | |
236 | 236 | void abc806_state::bankswitch() |
237 | 237 | { |
238 | address_space | |
238 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
239 | 239 | UINT32 videoram_mask = m_ram->size() - (32 * 1024) - 1; |
240 | 240 | int bank; |
241 | 241 | char bank_name[10]; |
r18027 | r18028 | |
256 | 256 | sprintf(bank_name,"bank%d",bank); |
257 | 257 | //logerror("%04x-%04x: Video RAM %04x (32K)\n", start_addr, end_addr, videoram_offset); |
258 | 258 | |
259 | program | |
259 | program.install_readwrite_bank(start_addr, end_addr, bank_name); | |
260 | 260 | membank(bank_name)->configure_entry(1, m_video_ram + videoram_offset); |
261 | 261 | membank(bank_name)->set_entry(1); |
262 | 262 | } |
r18027 | r18028 | |
270 | 270 | sprintf(bank_name,"bank%d",bank); |
271 | 271 | //logerror("%04x-%04x: Work RAM (32K)\n", start_addr, end_addr); |
272 | 272 | |
273 | program | |
273 | program.install_readwrite_bank(start_addr, end_addr, bank_name); | |
274 | 274 | membank(bank_name)->set_entry(0); |
275 | 275 | } |
276 | 276 | } |
r18027 | r18028 | |
290 | 290 | // map to video RAM |
291 | 291 | //logerror("%04x-%04x: Video RAM %04x (4K)\n", start_addr, end_addr, videoram_offset); |
292 | 292 | |
293 | program | |
293 | program.install_readwrite_bank(start_addr, end_addr, bank_name); | |
294 | 294 | membank(bank_name)->configure_entry(1, m_video_ram + videoram_offset); |
295 | 295 | membank(bank_name)->set_entry(1); |
296 | 296 | } |
r18027 | r18028 | |
304 | 304 | // ROM |
305 | 305 | //logerror("%04x-%04x: ROM (4K)\n", start_addr, end_addr); |
306 | 306 | |
307 | program->install_read_bank(start_addr, end_addr, bank_name); | |
308 | program->unmap_write(start_addr, end_addr); | |
307 | program.install_read_bank(start_addr, end_addr, bank_name); | |
308 | program.unmap_write(start_addr, end_addr); | |
309 | 309 | membank(bank_name)->set_entry(0); |
310 | 310 | break; |
311 | 311 | |
r18027 | r18028 | |
313 | 313 | // ROM/char RAM |
314 | 314 | //logerror("%04x-%04x: ROM (4K)\n", start_addr, end_addr); |
315 | 315 | |
316 | program->install_read_bank(0x7000, 0x77ff, bank_name); | |
317 | program->unmap_write(0x7000, 0x77ff); | |
318 | program->install_readwrite_handler(0x7800, 0x7fff, 0, 0, read8_delegate(FUNC(abc806_state::charram_r),this), write8_delegate(FUNC(abc806_state::charram_w),this)); | |
316 | program.install_read_bank(0x7000, 0x77ff, bank_name); | |
317 | program.unmap_write(0x7000, 0x77ff); | |
318 | program.install_readwrite_handler(0x7800, 0x7fff, 0, 0, read8_delegate(FUNC(abc806_state::charram_r),this), write8_delegate(FUNC(abc806_state::charram_w),this)); | |
319 | 319 | membank(bank_name)->set_entry(0); |
320 | 320 | break; |
321 | 321 | |
r18027 | r18028 | |
323 | 323 | // work RAM |
324 | 324 | //logerror("%04x-%04x: Work RAM (4K)\n", start_addr, end_addr); |
325 | 325 | |
326 | program | |
326 | program.install_readwrite_bank(start_addr, end_addr, bank_name); | |
327 | 327 | membank(bank_name)->set_entry(0); |
328 | 328 | break; |
329 | 329 | } |
r18027 | r18028 | |
349 | 349 | |
350 | 350 | if (start_addr == 0x7000) |
351 | 351 | { |
352 | program->install_readwrite_bank(0x7000, 0x77ff, bank_name); | |
353 | program->install_readwrite_handler(0x7800, 0x7fff, 0, 0, read8_delegate(FUNC(abc806_state::charram_r), this), write8_delegate(FUNC(abc806_state::charram_w), this)); | |
352 | program.install_readwrite_bank(0x7000, 0x77ff, bank_name); | |
353 | program.install_readwrite_handler(0x7800, 0x7fff, 0, 0, read8_delegate(FUNC(abc806_state::charram_r), this), write8_delegate(FUNC(abc806_state::charram_w), this)); | |
354 | 354 | } |
355 | 355 | else |
356 | 356 | { |
357 | program | |
357 | program.install_readwrite_bank(start_addr, end_addr, bank_name); | |
358 | 358 | } |
359 | 359 | |
360 | 360 | membank(bank_name)->configure_entry(1, m_video_ram + videoram_offset); |
r18027 | r18028 | |
1498 | 1498 | |
1499 | 1499 | DRIVER_INIT_MEMBER(abc800c_state,driver_init) |
1500 | 1500 | { |
1501 | m_maincpu->space(AS_PROGRAM) | |
1501 | m_maincpu->space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(abc800c_state::direct_update_handler), this)); | |
1502 | 1502 | } |
1503 | 1503 | |
1504 | 1504 | |
r18027 | r18028 | |
1532 | 1532 | |
1533 | 1533 | DRIVER_INIT_MEMBER(abc800m_state,driver_init) |
1534 | 1534 | { |
1535 | m_maincpu->space(AS_PROGRAM) | |
1535 | m_maincpu->space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(abc800m_state::direct_update_handler), this)); | |
1536 | 1536 | } |
1537 | 1537 | |
1538 | 1538 | |
r18027 | r18028 | |
1556 | 1556 | |
1557 | 1557 | DRIVER_INIT_MEMBER(abc802_state,driver_init) |
1558 | 1558 | { |
1559 | m_maincpu->space(AS_PROGRAM) | |
1559 | m_maincpu->space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(abc802_state::direct_update_handler), this)); | |
1560 | 1560 | } |
1561 | 1561 | |
1562 | 1562 | |
r18027 | r18028 | |
1590 | 1590 | |
1591 | 1591 | DRIVER_INIT_MEMBER(abc806_state,driver_init) |
1592 | 1592 | { |
1593 | m_maincpu->space(AS_PROGRAM) | |
1593 | m_maincpu->space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(abc806_state::direct_update_handler), this)); | |
1594 | 1594 | } |
1595 | 1595 | |
1596 | 1596 |
r18027 | r18028 | |
---|---|---|
602 | 602 | |
603 | 603 | void a7000_state::viddma_transfer_start() |
604 | 604 | { |
605 | address_space | |
605 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
606 | 606 | UINT32 src = m_viddma_addr_start; |
607 | 607 | UINT32 dst = 0; |
608 | 608 | UINT32 size = m_viddma_addr_end; |
r18027 | r18028 | |
612 | 612 | /* TODO: this should actually be a qword transfer */ |
613 | 613 | for(dma_index = 0;dma_index < size;dma_index++) |
614 | 614 | { |
615 | vram[dst] = mem | |
615 | vram[dst] = mem.read_byte(src); | |
616 | 616 | |
617 | 617 | src++; |
618 | 618 | dst++; |
r18027 | r18028 | |
---|---|---|
417 | 417 | |
418 | 418 | WRITE_LINE_MEMBER( bigbord2_state::frame ) |
419 | 419 | { |
420 | address_space &space = | |
420 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
421 | 421 | static UINT8 framecnt; |
422 | 422 | framecnt++; |
423 | 423 |
r18027 | r18028 | |
---|---|---|
32 | 32 | |
33 | 33 | void tvc_state::tvc_set_mem_page(UINT8 data) |
34 | 34 | { |
35 | address_space &space = | |
35 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
36 | 36 | switch(data & 0x18) |
37 | 37 | { |
38 | 38 | case 0x00 : // system ROM selected |
r18027 | r18028 | |
---|---|---|
167 | 167 | |
168 | 168 | void tmc2000_state::bankswitch() |
169 | 169 | { |
170 | address_space | |
170 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
171 | 171 | UINT8 *ram = m_ram->pointer(); |
172 | 172 | UINT8 *rom = memregion(CDP1802_TAG)->base(); |
173 | 173 | |
174 | 174 | if (m_roc) |
175 | 175 | { |
176 | 176 | // monitor ROM |
177 | program | |
177 | program.install_rom(0x0000, 0x01ff, 0, 0x7e00, rom); | |
178 | 178 | } |
179 | 179 | else |
180 | 180 | { |
r18027 | r18028 | |
182 | 182 | switch (m_ram->size()) |
183 | 183 | { |
184 | 184 | case 4 * 1024: |
185 | program | |
185 | program.install_ram(0x0000, 0x0fff, 0, 0x7000, ram); | |
186 | 186 | break; |
187 | 187 | |
188 | 188 | case 16 * 1024: |
189 | program | |
189 | program.install_ram(0x0000, 0x3fff, 0, 0x4000, ram); | |
190 | 190 | break; |
191 | 191 | |
192 | 192 | case 32 * 1024: |
193 | program | |
193 | program.install_ram(0x0000, 0x7fff, ram); | |
194 | 194 | break; |
195 | 195 | } |
196 | 196 | } |
r18027 | r18028 | |
198 | 198 | if (m_rac) |
199 | 199 | { |
200 | 200 | // color RAM |
201 | program->install_ram(0x8000, 0x81ff, 0, 0x7e00, m_colorram); | |
202 | program->unmap_read(0x8000, 0x81ff, 0, 0x7e00); | |
201 | program.install_ram(0x8000, 0x81ff, 0, 0x7e00, m_colorram); | |
202 | program.unmap_read(0x8000, 0x81ff, 0, 0x7e00); | |
203 | 203 | } |
204 | 204 | else |
205 | 205 | { |
206 | 206 | // monitor ROM |
207 | program | |
207 | program.install_rom(0x8000, 0x81ff, 0, 0x7e00, rom); | |
208 | 208 | } |
209 | 209 | } |
210 | 210 | |
r18027 | r18028 | |
220 | 220 | WRITE8_MEMBER( nano_state::bankswitch_w ) |
221 | 221 | { |
222 | 222 | /* enable RAM */ |
223 | address_space | |
223 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
224 | 224 | UINT8 *ram = m_ram->pointer(); |
225 | program | |
225 | program.install_ram(0x0000, 0x0fff, 0, 0x7000, ram); | |
226 | 226 | |
227 | 227 | /* write to CDP1864 tone latch */ |
228 | 228 | m_cti->tone_latch_w(space, 0, data); |
r18027 | r18028 | |
745 | 745 | m_cti->reset(); |
746 | 746 | |
747 | 747 | /* enable ROM */ |
748 | address_space | |
748 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
749 | 749 | UINT8 *rom = memregion(CDP1802_TAG)->base(); |
750 | program | |
750 | program.install_rom(0x0000, 0x01ff, 0, 0x7e00, rom); | |
751 | 751 | } |
752 | 752 | |
753 | 753 | /* Machine Drivers */ |
r18027 | r18028 | |
---|---|---|
853 | 853 | running_machine &machine = image.device().machine(); |
854 | 854 | crvision_state *state = machine.driver_data<crvision_state>(); |
855 | 855 | UINT8 *mem = state->memregion(M6502_TAG)->base(); |
856 | address_space | |
856 | address_space &program = machine.device(M6502_TAG)->memory().space(AS_PROGRAM); | |
857 | 857 | |
858 | 858 | if (image.software_entry() == NULL) |
859 | 859 | { |
r18027 | r18028 | |
873 | 873 | case 0x1000: // 4K |
874 | 874 | memcpy(mem + 0x9000, temp_copy, 0x1000); // load 4KB at 0x9000 |
875 | 875 | memcpy(mem + 0xb000, mem + 0x9000, 0x1000); // mirror 4KB at 0xb000 |
876 | program | |
876 | program.install_read_bank(0x8000, 0xbfff, 0, 0x2000, BANK_ROM1); | |
877 | 877 | break; |
878 | 878 | |
879 | 879 | case 0x1800: // 6K |
r18027 | r18028 | |
883 | 883 | memcpy(mem + 0x8800, mem + 0x8000, 0x0800); // mirror higher 2KB at 0x8800 |
884 | 884 | memcpy(mem + 0xa000, mem + 0x8000, 0x0800); // mirror higher 2KB at 0xa000 |
885 | 885 | memcpy(mem + 0xa800, mem + 0x8000, 0x0800); // mirror higher 2KB at 0xa800 |
886 | program | |
886 | program.install_read_bank(0x8000, 0xbfff, 0, 0x2000, BANK_ROM1); | |
887 | 887 | break; |
888 | 888 | |
889 | 889 | case 0x2000: // 8K |
890 | 890 | memcpy(mem + 0x8000, temp_copy, 0x2000); // load 8KB at 0x8000 |
891 | 891 | memcpy(mem + 0xa000, mem + 0x8000, 0x2000); // mirror 8KB at 0xa000 |
892 | program | |
892 | program.install_read_bank(0x8000, 0xbfff, 0, 0x2000, BANK_ROM1); | |
893 | 893 | break; |
894 | 894 | |
895 | 895 | case 0x2800: // 10K |
r18027 | r18028 | |
903 | 903 | memcpy(mem + 0x6800, mem + 0x4000, 0x0800); // mirror higher 2KB at 0x6800 |
904 | 904 | memcpy(mem + 0x7000, mem + 0x4000, 0x0800); // mirror higher 2KB at 0x7000 |
905 | 905 | memcpy(mem + 0x7800, mem + 0x4000, 0x0800); // mirror higher 2KB at 0x7800 |
906 | program->install_read_bank(0x8000, 0xbfff, BANK_ROM1); | |
907 | program->install_read_bank(0x4000, 0x7fff, BANK_ROM2); | |
906 | program.install_read_bank(0x8000, 0xbfff, BANK_ROM1); | |
907 | program.install_read_bank(0x4000, 0x7fff, BANK_ROM2); | |
908 | 908 | break; |
909 | 909 | |
910 | 910 | case 0x3000: // 12K |
r18027 | r18028 | |
914 | 914 | memcpy(mem + 0x5000, mem + 0x4000, 0x1000); // mirror higher 4KB at 0x5000 |
915 | 915 | memcpy(mem + 0x6000, mem + 0x4000, 0x1000); // mirror higher 4KB at 0x6000 |
916 | 916 | memcpy(mem + 0x7000, mem + 0x4000, 0x1000); // mirror higher 4KB at 0x7000 |
917 | program->install_read_bank(0x8000, 0xbfff, BANK_ROM1); | |
918 | program->install_read_bank(0x4000, 0x7fff, BANK_ROM2); | |
917 | program.install_read_bank(0x8000, 0xbfff, BANK_ROM1); | |
918 | program.install_read_bank(0x4000, 0x7fff, BANK_ROM2); | |
919 | 919 | break; |
920 | 920 | |
921 | 921 | case 0x4000: // 16K |
922 | 922 | memcpy(mem + 0xa000, temp_copy, 0x2000); // load lower 8KB at 0xa000 |
923 | 923 | memcpy(mem + 0x8000, temp_copy + 0x2000, 0x2000); // load higher 8KB at 0x8000 |
924 | program->install_read_bank(0x8000, 0xbfff, BANK_ROM1); | |
925 | program->install_read_bank(0x4000, 0x7fff, BANK_ROM2); | |
924 | program.install_read_bank(0x8000, 0xbfff, BANK_ROM1); | |
925 | program.install_read_bank(0x4000, 0x7fff, BANK_ROM2); | |
926 | 926 | break; |
927 | 927 | |
928 | 928 | case 0x4800: // 18K |
r18027 | r18028 | |
936 | 936 | memcpy(mem + 0x6800, mem + 0x4000, 0x0800); // mirror higher 2KB at 0x6800 |
937 | 937 | memcpy(mem + 0x7000, mem + 0x4000, 0x0800); // mirror higher 2KB at 0x7000 |
938 | 938 | memcpy(mem + 0x7800, mem + 0x4000, 0x0800); // mirror higher 2KB at 0x7800 |
939 | program->install_read_bank(0x8000, 0xbfff, BANK_ROM1); | |
940 | program->install_read_bank(0x4000, 0x7fff, BANK_ROM2); | |
939 | program.install_read_bank(0x8000, 0xbfff, BANK_ROM1); | |
940 | program.install_read_bank(0x4000, 0x7fff, BANK_ROM2); | |
941 | 941 | break; |
942 | 942 | |
943 | 943 | default: |
r18027 | r18028 | |
---|---|---|
2459 | 2459 | m_towns_cd.read_timer = machine().scheduler().timer_alloc(FUNC(towns_cdrom_read_byte), (void*)machine().device("dma_1")); |
2460 | 2460 | |
2461 | 2461 | machine().device("maincpu")->execute().set_irq_acknowledge_callback(towns_irq_callback); |
2462 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
2462 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_ram(0x100000,machine().device<ram_device>(RAM_TAG)->size()-1,0xffffffff,0,NULL); | |
2463 | 2463 | |
2464 | 2464 | } |
2465 | 2465 | |
r18027 | r18028 | |
2472 | 2472 | |
2473 | 2473 | void towns_state::machine_reset() |
2474 | 2474 | { |
2475 | address_space *program; | |
2476 | ||
2477 | 2475 | m_maincpu = machine().device<cpu_device>("maincpu"); |
2478 | program = m_maincpu->space(AS_PROGRAM); | |
2476 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
2479 | 2477 | m_dma_1 = machine().device("dma_1"); |
2480 | 2478 | m_dma_2 = machine().device("dma_2"); |
2481 | 2479 | m_fdc = machine().device("fdc"); |
r18027 | r18028 | |
2496 | 2494 | m_towns_mainmem_enable = 0x00; |
2497 | 2495 | m_towns_system_port = 0x00; |
2498 | 2496 | m_towns_ram_enable = 0x00; |
2499 | towns_update_video_banks( | |
2497 | towns_update_video_banks(program); | |
2500 | 2498 | m_towns_kb_status = 0x18; |
2501 | 2499 | m_towns_kb_irq1_enable = 0; |
2502 | 2500 | m_towns_pad_mask = 0x7f; |
r18027 | r18028 | |
---|---|---|
55 | 55 | /* Bank Switching */ |
56 | 56 | |
57 | 57 | #define memory_install_unmapped(program, bank, bank_start, bank_end) \ |
58 | program | |
58 | program.unmap_readwrite(bank_start, bank_end); | |
59 | 59 | |
60 | 60 | #define memory_install_rom_helper(program, bank, bank_start, bank_end) \ |
61 | program->install_read_bank(bank_start, bank_end, bank); \ | |
62 | program->unmap_write(bank_start, bank_end); | |
61 | program.install_read_bank(bank_start, bank_end, bank); \ | |
62 | program.unmap_write(bank_start, bank_end); | |
63 | 63 | |
64 | 64 | #define memory_install_ram_helper(program, bank, bank_start, bank_end) \ |
65 | program | |
65 | program.install_readwrite_bank(bank_start, bank_end, bank); | |
66 | 66 | |
67 | 67 | void newbrain_eim_state::bankswitch() |
68 | 68 | { |
69 | address_space | |
69 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
70 | 70 | int bank; |
71 | 71 | |
72 | 72 | for (bank = 1; bank < 9; bank++) |
r18027 | r18028 | |
104 | 104 | |
105 | 105 | void newbrain_state::bankswitch() |
106 | 106 | { |
107 | address_space | |
107 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
108 | 108 | int bank; |
109 | 109 | |
110 | 110 | for (bank = 1; bank < 9; bank++) |
r18027 | r18028 | |
---|---|---|
696 | 696 | |
697 | 697 | READ8_MEMBER( wangpc_state::memr_r ) |
698 | 698 | { |
699 | address_space | |
699 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
700 | 700 | offs_t addr = (m_dma_page[m_dack] << 16) | offset; |
701 | 701 | |
702 | return program | |
702 | return program.read_byte(addr); | |
703 | 703 | } |
704 | 704 | |
705 | 705 | WRITE8_MEMBER( wangpc_state::memw_w ) |
706 | 706 | { |
707 | address_space | |
707 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
708 | 708 | offs_t addr = (m_dma_page[m_dack] << 16) | offset; |
709 | 709 | |
710 | program | |
710 | program.write_byte(addr, data); | |
711 | 711 | } |
712 | 712 | |
713 | 713 | READ8_MEMBER( wangpc_state::ior2_r ) |
r18027 | r18028 | |
---|---|---|
1405 | 1405 | { |
1406 | 1406 | state->m_nvptr = (UINT8 *)&state->m_vboy_sram; |
1407 | 1407 | |
1408 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x06000000, 0x0600ffff, read32_delegate(FUNC(vboy_state::sram_r),state)); | |
1409 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x06000000, 0x0600ffff, write32_delegate(FUNC(vboy_state::sram_w),state)); | |
1408 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x06000000, 0x0600ffff, read32_delegate(FUNC(vboy_state::sram_r),state)); | |
1409 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x06000000, 0x0600ffff, write32_delegate(FUNC(vboy_state::sram_w),state)); | |
1410 | 1410 | |
1411 | 1411 | image.battery_load(state->m_nvptr, 0x10000, 0x00); |
1412 | 1412 | state->m_nvimage = image; |
r18027 | r18028 | |
---|---|---|
293 | 293 | |
294 | 294 | READ8_MEMBER( fk1_state::fk1_bank_ram_r ) |
295 | 295 | { |
296 | address_space | |
296 | address_space &space_mem = m_maincpu->space(AS_PROGRAM); | |
297 | 297 | UINT8 *ram = machine().device<ram_device>(RAM_TAG)->pointer(); |
298 | 298 | |
299 | space_mem | |
299 | space_mem.install_write_bank(0x0000, 0x3fff, "bank1"); | |
300 | 300 | membank("bank1")->set_base(ram); |
301 | 301 | membank("bank2")->set_base(ram + 0x4000); |
302 | 302 | return 0; |
r18027 | r18028 | |
304 | 304 | |
305 | 305 | READ8_MEMBER( fk1_state::fk1_bank_rom_r ) |
306 | 306 | { |
307 | address_space *space_mem = m_maincpu->space(AS_PROGRAM); | |
308 | space_mem->unmap_write(0x0000, 0x3fff); | |
307 | address_space &space_mem = m_maincpu->space(AS_PROGRAM); | |
308 | space_mem.unmap_write(0x0000, 0x3fff); | |
309 | 309 | membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base()); |
310 | 310 | membank("bank2")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0x10000); |
311 | 311 | return 0; |
r18027 | r18028 | |
423 | 423 | |
424 | 424 | void fk1_state::machine_reset() |
425 | 425 | { |
426 | address_space &space = | |
426 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
427 | 427 | UINT8 *ram = machine().device<ram_device>(RAM_TAG)->pointer(); |
428 | 428 | |
429 | 429 | space.unmap_write(0x0000, 0x3fff); |
r18027 | r18028 | |
---|---|---|
209 | 209 | static SNAPSHOT_LOAD( vtech1 ) |
210 | 210 | { |
211 | 211 | vtech1_state *vtech1 = image.device().machine().driver_data<vtech1_state>(); |
212 | address_space &space = | |
212 | address_space &space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM); | |
213 | 213 | UINT8 i, header[24]; |
214 | 214 | UINT16 start, end, size; |
215 | 215 | char pgmname[18]; |
r18027 | r18028 | |
628 | 628 | |
629 | 629 | DRIVER_INIT_MEMBER(vtech1_state,vtech1) |
630 | 630 | { |
631 | address_space | |
631 | address_space &prg = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
632 | 632 | int id; |
633 | 633 | |
634 | 634 | /* ram */ |
r18027 | r18028 | |
642 | 642 | if (m_ram_size == 18*1024 || m_ram_size == 22*1024 || m_ram_size == 32*1024) |
643 | 643 | { |
644 | 644 | offs_t base = 0x7800 + (m_ram_size - 0x4000); |
645 | prg | |
645 | prg.install_readwrite_bank(base, base + 0x3fff, "bank2"); | |
646 | 646 | membank("bank2")->set_base(m_ram + base - 0x7800); |
647 | 647 | } |
648 | 648 | |
r18027 | r18028 | |
650 | 650 | if (m_ram_size >= 66*1024) |
651 | 651 | { |
652 | 652 | /* install fixed first bank */ |
653 | prg | |
653 | prg.install_readwrite_bank(0x8000, 0xbfff, "bank2"); | |
654 | 654 | membank("bank2")->set_base(m_ram + 0x800); |
655 | 655 | |
656 | 656 | /* install the others, dynamically banked in */ |
657 | prg | |
657 | prg.install_readwrite_bank(0xc000, 0xffff, "bank3"); | |
658 | 658 | membank("bank3")->configure_entries(0, (m_ram_size - 0x4800) / 0x4000, m_ram + 0x4800, 0x4000); |
659 | 659 | membank("bank3")->set_entry(0); |
660 | 660 | } |
r18027 | r18028 | |
681 | 681 | |
682 | 682 | DRIVER_INIT_MEMBER(vtech1_state,vtech1h) |
683 | 683 | { |
684 | address_space | |
684 | address_space &prg = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
685 | 685 | |
686 | 686 | DRIVER_INIT_CALL(vtech1); |
687 | 687 | |
r18027 | r18028 | |
689 | 689 | //m_videoram_size = 0x2000; |
690 | 690 | //m_videoram = auto_alloc_array(machine(), UINT8, m_videoram_size); |
691 | 691 | |
692 | prg | |
692 | prg.install_readwrite_bank(0x7000, 0x77ff, "bank4"); | |
693 | 693 | membank("bank4")->configure_entries(0, 4, m_videoram, 0x800); |
694 | 694 | membank("bank4")->set_entry(0); |
695 | 695 | } |
r18027 | r18028 | |
---|---|---|
130 | 130 | WRITE8_MEMBER( camplynx_state::lynx128k_bank_w ) |
131 | 131 | { |
132 | 132 | /* get address space */ |
133 | address_space *mem = m_maincpu->space(AS_PROGRAM); | |
134 | UINT8 *base = mem->machine().root_device().memregion("maincpu")->base(); | |
133 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
134 | UINT8 *base = mem.machine().root_device().memregion("maincpu")->base(); | |
135 | 135 | |
136 | 136 | /* Set read banks */ |
137 | 137 | UINT8 bank = data & 0x0f; |
r18027 | r18028 | |
330 | 330 | |
331 | 331 | MACHINE_RESET_MEMBER(camplynx_state,lynx128k) |
332 | 332 | { |
333 | address_space *mem = m_maincpu->space(AS_PROGRAM); | |
334 | mem->install_read_bank (0x0000, 0x1fff, "bank1"); | |
335 | mem->install_read_bank (0x2000, 0x3fff, "bank2"); | |
336 | mem->install_read_bank (0x4000, 0x5fff, "bank3"); | |
337 | mem->install_read_bank (0x6000, 0x7fff, "bank4"); | |
338 | mem->install_read_bank (0x8000, 0x9fff, "bank5"); | |
339 | mem->install_read_bank (0xa000, 0xbfff, "bank6"); | |
340 | mem->install_read_bank (0xc000, 0xdfff, "bank7"); | |
341 | mem->install_read_bank (0xe000, 0xffff, "bank8"); | |
342 | mem->install_write_bank (0x0000, 0x1fff, "bank11"); | |
343 | mem->install_write_bank (0x2000, 0x3fff, "bank12"); | |
344 | mem->install_write_bank (0x4000, 0x5fff, "bank13"); | |
345 | mem->install_write_bank (0x6000, 0x7fff, "bank14"); | |
346 | mem->install_write_bank (0x8000, 0x9fff, "bank15"); | |
347 | mem->install_write_bank (0xa000, 0xbfff, "bank16"); | |
348 | mem->install_write_bank (0xc000, 0xdfff, "bank17"); | |
349 | mem->install_write_bank (0xe000, 0xffff, "bank18"); | |
333 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
334 | mem.install_read_bank (0x0000, 0x1fff, "bank1"); | |
335 | mem.install_read_bank (0x2000, 0x3fff, "bank2"); | |
336 | mem.install_read_bank (0x4000, 0x5fff, "bank3"); | |
337 | mem.install_read_bank (0x6000, 0x7fff, "bank4"); | |
338 | mem.install_read_bank (0x8000, 0x9fff, "bank5"); | |
339 | mem.install_read_bank (0xa000, 0xbfff, "bank6"); | |
340 | mem.install_read_bank (0xc000, 0xdfff, "bank7"); | |
341 | mem.install_read_bank (0xe000, 0xffff, "bank8"); | |
342 | mem.install_write_bank (0x0000, 0x1fff, "bank11"); | |
343 | mem.install_write_bank (0x2000, 0x3fff, "bank12"); | |
344 | mem.install_write_bank (0x4000, 0x5fff, "bank13"); | |
345 | mem.install_write_bank (0x6000, 0x7fff, "bank14"); | |
346 | mem.install_write_bank (0x8000, 0x9fff, "bank15"); | |
347 | mem.install_write_bank (0xa000, 0xbfff, "bank16"); | |
348 | mem.install_write_bank (0xc000, 0xdfff, "bank17"); | |
349 | mem.install_write_bank (0xe000, 0xffff, "bank18"); | |
350 | 350 | |
351 | lynx128k_bank_w( | |
351 | lynx128k_bank_w(mem, 0, 0); | |
352 | 352 | } |
353 | 353 | |
354 | 354 | WRITE8_MEMBER( camplynx_state::lynx128k_irq ) |
r18027 | r18028 | |
---|---|---|
612 | 612 | static void main_cpu_banking_init( running_machine &machine ) |
613 | 613 | { |
614 | 614 | ng_aes_state *state = machine.driver_data<ng_aes_state>(); |
615 | address_space &mainspace = | |
615 | address_space &mainspace = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
616 | 616 | |
617 | 617 | /* create vector banks */ |
618 | 618 | state->membank(NEOGEO_BANK_VECTORS)->configure_entry(0, machine.root_device().memregion("mainbios")->base()); |
r18027 | r18028 | |
753 | 753 | set_audio_cpu_banking(machine); |
754 | 754 | |
755 | 755 | state->m_audio_cpu_rom_source_last = 0; |
756 | set_audio_cpu_rom_source( | |
756 | set_audio_cpu_rom_source(machine.device("maincpu")->memory().space(AS_PROGRAM), 0); | |
757 | 757 | } |
758 | 758 | |
759 | 759 | |
r18027 | r18028 | |
1149 | 1149 | _set_main_cpu_bank_address(state->machine()); |
1150 | 1150 | _set_main_cpu_vector_table_source(state->machine()); |
1151 | 1151 | set_audio_cpu_banking(state->machine()); |
1152 | _set_audio_cpu_rom_source( | |
1152 | _set_audio_cpu_rom_source(state->machine().device("maincpu")->memory().space(AS_PROGRAM)); | |
1153 | 1153 | } |
1154 | 1154 | |
1155 | 1155 | static void common_machine_start(running_machine &machine) |
r18027 | r18028 | |
1254 | 1254 | MACHINE_RESET_MEMBER(ng_aes_state,neogeo) |
1255 | 1255 | { |
1256 | 1256 | offs_t offs; |
1257 | address_space &space = | |
1257 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
1258 | 1258 | |
1259 | 1259 | /* reset system control registers */ |
1260 | 1260 | for (offs = 0; offs < 8; offs++) |
r18027 | r18028 | |
---|---|---|
104 | 104 | |
105 | 105 | void pc8201_state::bankswitch(UINT8 data) |
106 | 106 | { |
107 | address_space | |
107 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
108 | 108 | |
109 | 109 | int rom_bank = data & 0x03; |
110 | 110 | int ram_bank = (data >> 2) & 0x03; |
r18027 | r18028 | |
114 | 114 | if (rom_bank > 1) |
115 | 115 | { |
116 | 116 | /* RAM */ |
117 | program | |
117 | program.install_readwrite_bank(0x0000, 0x7fff, "bank1"); | |
118 | 118 | } |
119 | 119 | else |
120 | 120 | { |
121 | 121 | /* ROM */ |
122 | program->install_read_bank(0x0000, 0x7fff, "bank1"); | |
123 | program->unmap_write(0x0000, 0x7fff); | |
122 | program.install_read_bank(0x0000, 0x7fff, "bank1"); | |
123 | program.unmap_write(0x0000, 0x7fff); | |
124 | 124 | } |
125 | 125 | |
126 | 126 | membank("bank1")->set_entry(rom_bank); |
r18027 | r18028 | |
130 | 130 | case 0: |
131 | 131 | if (m_ram->size() > 16 * 1024) |
132 | 132 | { |
133 | program | |
133 | program.install_readwrite_bank(0x8000, 0xffff, "bank2"); | |
134 | 134 | } |
135 | 135 | else |
136 | 136 | { |
137 | program->unmap_readwrite(0x8000, 0xbfff); | |
138 | program->install_readwrite_bank(0xc000, 0xffff, "bank2"); | |
137 | program.unmap_readwrite(0x8000, 0xbfff); | |
138 | program.install_readwrite_bank(0xc000, 0xffff, "bank2"); | |
139 | 139 | } |
140 | 140 | break; |
141 | 141 | |
142 | 142 | case 1: |
143 | program | |
143 | program.unmap_readwrite(0x8000, 0xffff); | |
144 | 144 | break; |
145 | 145 | |
146 | 146 | case 2: |
147 | 147 | if (m_ram->size() > 32 * 1024) |
148 | program | |
148 | program.install_readwrite_bank(0x8000, 0xffff, "bank2"); | |
149 | 149 | else |
150 | program | |
150 | program.unmap_readwrite(0x8000, 0xffff); | |
151 | 151 | break; |
152 | 152 | |
153 | 153 | case 3: |
154 | 154 | if (m_ram->size() > 64 * 1024) |
155 | program | |
155 | program.install_readwrite_bank(0x8000, 0xffff, "bank2"); | |
156 | 156 | else |
157 | program | |
157 | program.unmap_readwrite(0x8000, 0xffff); | |
158 | 158 | break; |
159 | 159 | } |
160 | 160 | |
r18027 | r18028 | |
454 | 454 | |
455 | 455 | void tandy200_state::bankswitch(UINT8 data) |
456 | 456 | { |
457 | address_space | |
457 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
458 | 458 | |
459 | 459 | int rom_bank = data & 0x03; |
460 | 460 | int ram_bank = (data >> 2) & 0x03; |
r18027 | r18028 | |
464 | 464 | if (rom_bank == 3) |
465 | 465 | { |
466 | 466 | /* invalid ROM bank */ |
467 | program | |
467 | program.unmap_readwrite(0x0000, 0x7fff); | |
468 | 468 | } |
469 | 469 | else |
470 | 470 | { |
471 | program->install_read_bank(0x0000, 0x7fff, "bank1"); | |
472 | program->unmap_write(0x0000, 0x7fff); | |
471 | program.install_read_bank(0x0000, 0x7fff, "bank1"); | |
472 | program.unmap_write(0x0000, 0x7fff); | |
473 | 473 | membank("bank1")->set_entry(rom_bank); |
474 | 474 | } |
475 | 475 | |
476 | 476 | if (m_ram->size() < ((ram_bank + 1) * 24 * 1024)) |
477 | 477 | { |
478 | 478 | /* invalid RAM bank */ |
479 | program | |
479 | program.unmap_readwrite(0xa000, 0xffff); | |
480 | 480 | } |
481 | 481 | else |
482 | 482 | { |
483 | program | |
483 | program.install_readwrite_bank(0xa000, 0xffff, "bank2"); | |
484 | 484 | membank("bank2")->set_entry(ram_bank); |
485 | 485 | } |
486 | 486 | } |
r18027 | r18028 | |
1127 | 1127 | |
1128 | 1128 | void kc85_state::machine_start() |
1129 | 1129 | { |
1130 | address_space | |
1130 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
1131 | 1131 | |
1132 | 1132 | /* initialize RTC */ |
1133 | 1133 | m_rtc->cs_w(1); |
1134 | 1134 | m_rtc->oe_w(1); |
1135 | 1135 | |
1136 | 1136 | /* configure ROM banking */ |
1137 | program->install_read_bank(0x0000, 0x7fff, "bank1"); | |
1138 | program->unmap_write(0x0000, 0x7fff); | |
1137 | program.install_read_bank(0x0000, 0x7fff, "bank1"); | |
1138 | program.unmap_write(0x0000, 0x7fff); | |
1139 | 1139 | membank("bank1")->configure_entry(0, memregion(I8085_TAG)->base()); |
1140 | 1140 | membank("bank1")->configure_entry(1, memregion("option")->base()); |
1141 | 1141 | membank("bank1")->set_entry(0); |
r18027 | r18028 | |
1144 | 1144 | switch (m_ram->size()) |
1145 | 1145 | { |
1146 | 1146 | case 16 * 1024: |
1147 | program->unmap_readwrite(0x8000, 0xbfff); | |
1148 | program->install_readwrite_bank(0xc000, 0xffff, "bank2"); | |
1147 | program.unmap_readwrite(0x8000, 0xbfff); | |
1148 | program.install_readwrite_bank(0xc000, 0xffff, "bank2"); | |
1149 | 1149 | break; |
1150 | 1150 | |
1151 | 1151 | case 32 * 1024: |
1152 | program | |
1152 | program.install_readwrite_bank(0x8000, 0xffff,"bank2"); | |
1153 | 1153 | break; |
1154 | 1154 | } |
1155 | 1155 | |
r18027 | r18028 | |
1194 | 1194 | |
1195 | 1195 | void trsm100_state::machine_start() |
1196 | 1196 | { |
1197 | address_space | |
1197 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
1198 | 1198 | |
1199 | 1199 | /* initialize RTC */ |
1200 | 1200 | m_rtc->cs_w(1); |
1201 | 1201 | m_rtc->oe_w(1); |
1202 | 1202 | |
1203 | 1203 | /* configure ROM banking */ |
1204 | program->install_read_bank(0x0000, 0x7fff, "bank1"); | |
1205 | program->unmap_write(0x0000, 0x7fff); | |
1204 | program.install_read_bank(0x0000, 0x7fff, "bank1"); | |
1205 | program.unmap_write(0x0000, 0x7fff); | |
1206 | 1206 | membank("bank1")->configure_entry(0, memregion(I8085_TAG)->base()); |
1207 | 1207 | membank("bank1")->configure_entry(1, memregion("option")->base()); |
1208 | 1208 | membank("bank1")->set_entry(0); |
r18027 | r18028 | |
1211 | 1211 | switch (m_ram->size()) |
1212 | 1212 | { |
1213 | 1213 | case 8 * 1024: |
1214 | program->unmap_readwrite(0x8000, 0xcfff); | |
1215 | program->install_readwrite_bank(0xe000, 0xffff, "bank2"); | |
1214 | program.unmap_readwrite(0x8000, 0xcfff); | |
1215 | program.install_readwrite_bank(0xe000, 0xffff, "bank2"); | |
1216 | 1216 | break; |
1217 | 1217 | |
1218 | 1218 | case 16 * 1024: |
1219 | program->unmap_readwrite(0x8000, 0xbfff); | |
1220 | program->install_readwrite_bank(0xc000, 0xffff, "bank2"); | |
1219 | program.unmap_readwrite(0x8000, 0xbfff); | |
1220 | program.install_readwrite_bank(0xc000, 0xffff, "bank2"); | |
1221 | 1221 | break; |
1222 | 1222 | |
1223 | 1223 | case 24 * 1024: |
1224 | program->unmap_readwrite(0x8000, 0x9fff); | |
1225 | program->install_readwrite_bank(0xa000, 0xffff, "bank2"); | |
1224 | program.unmap_readwrite(0x8000, 0x9fff); | |
1225 | program.install_readwrite_bank(0xa000, 0xffff, "bank2"); | |
1226 | 1226 | break; |
1227 | 1227 | |
1228 | 1228 | case 32 * 1024: |
1229 | program | |
1229 | program.install_readwrite_bank(0x8000, 0xffff, "bank2"); | |
1230 | 1230 | break; |
1231 | 1231 | } |
1232 | 1232 |
r18027 | r18028 | |
---|---|---|
637 | 637 | |
638 | 638 | void bml3_state::machine_reset() |
639 | 639 | { |
640 | address_space | |
640 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
641 | 641 | |
642 | 642 | /* defaults */ |
643 | mem->install_rom(0xa000, 0xfeff,mem->machine().root_device().memregion("maincpu")->base() + 0xa000); | |
644 | mem->install_rom(0xfff0, 0xffff,mem->machine().root_device().memregion("maincpu")->base() + 0xfff0); | |
645 | mem->install_write_handler(0xa000, 0xbfff, 0, 0,write8_delegate(FUNC(bml3_state::bml3_a000_w), this),0); | |
646 | mem->install_write_handler(0xc000, 0xdfff, 0, 0,write8_delegate(FUNC(bml3_state::bml3_c000_w), this),0); | |
647 | mem->install_write_handler(0xe000, 0xefff, 0, 0,write8_delegate(FUNC(bml3_state::bml3_e000_w), this),0); | |
648 | mem->install_write_handler(0xf000, 0xfeff, 0, 0,write8_delegate(FUNC(bml3_state::bml3_f000_w), this),0); | |
649 | mem->install_write_handler(0xfff0, 0xffff, 0, 0,write8_delegate(FUNC(bml3_state::bml3_fff0_w), this),0); | |
643 | mem.install_rom(0xa000, 0xfeff,mem.machine().root_device().memregion("maincpu")->base() + 0xa000); | |
644 | mem.install_rom(0xfff0, 0xffff,mem.machine().root_device().memregion("maincpu")->base() + 0xfff0); | |
645 | mem.install_write_handler(0xa000, 0xbfff, 0, 0,write8_delegate(FUNC(bml3_state::bml3_a000_w), this),0); | |
646 | mem.install_write_handler(0xc000, 0xdfff, 0, 0,write8_delegate(FUNC(bml3_state::bml3_c000_w), this),0); | |
647 | mem.install_write_handler(0xe000, 0xefff, 0, 0,write8_delegate(FUNC(bml3_state::bml3_e000_w), this),0); | |
648 | mem.install_write_handler(0xf000, 0xfeff, 0, 0,write8_delegate(FUNC(bml3_state::bml3_f000_w), this),0); | |
649 | mem.install_write_handler(0xfff0, 0xffff, 0, 0,write8_delegate(FUNC(bml3_state::bml3_fff0_w), this),0); | |
650 | 650 | |
651 | 651 | m_firq_mask = -1; // disable firq |
652 | 652 | } |
r18027 | r18028 | |
701 | 701 | |
702 | 702 | WRITE8_MEMBER(bml3_state::bml3_piaA_w) |
703 | 703 | { |
704 | address_space | |
704 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
705 | 705 | /* ROM banking: |
706 | 706 | -0-- --0- 0xa000 - 0xbfff ROM R RAM W |
707 | 707 | -1-- --0- 0xa000 - 0xbfff RAM R/W |
r18027 | r18028 | |
721 | 721 | { |
722 | 722 | if(data & 0x40) |
723 | 723 | { |
724 | mem | |
724 | mem.install_readwrite_handler(0xa000, 0xbfff, 0, 0, | |
725 | 725 | read8_delegate(FUNC(bml3_state::bml3_a000_r), this), |
726 | 726 | write8_delegate(FUNC(bml3_state::bml3_a000_w), this), 0); |
727 | 727 | } |
728 | 728 | else |
729 | 729 | { |
730 | mem->install_rom(0xa000, 0xbfff, | |
731 | mem->machine().root_device().memregion("maincpu")->base() + 0xa000); | |
732 | mem->install_write_handler(0xa000, 0xbfff, 0, 0, | |
730 | mem.install_rom(0xa000, 0xbfff, | |
731 | mem.machine().root_device().memregion("maincpu")->base() + 0xa000); | |
732 | mem.install_write_handler(0xa000, 0xbfff, 0, 0, | |
733 | 733 | write8_delegate(FUNC(bml3_state::bml3_a000_w), this), |
734 | 734 | 0); |
735 | 735 | } |
r18027 | r18028 | |
739 | 739 | { |
740 | 740 | if(data & 0x40) |
741 | 741 | { |
742 | mem | |
742 | mem.install_readwrite_handler(0xc000, 0xdfff, 0, 0, | |
743 | 743 | read8_delegate(FUNC(bml3_state::bml3_c000_r), this), |
744 | 744 | write8_delegate(FUNC(bml3_state::bml3_c000_w), this), 0); |
745 | 745 | } |
746 | 746 | else |
747 | 747 | { |
748 | mem->install_rom(0xc000, 0xdfff, | |
749 | mem->machine().root_device().memregion("maincpu")->base() + 0xc000); | |
750 | mem->install_write_handler(0xc000, 0xdfff, 0, 0, | |
748 | mem.install_rom(0xc000, 0xdfff, | |
749 | mem.machine().root_device().memregion("maincpu")->base() + 0xc000); | |
750 | mem.install_write_handler(0xc000, 0xdfff, 0, 0, | |
751 | 751 | write8_delegate(FUNC(bml3_state::bml3_c000_w), this), |
752 | 752 | 0); |
753 | 753 | } |
r18027 | r18028 | |
757 | 757 | { |
758 | 758 | if(data & 0x80) |
759 | 759 | { |
760 | mem | |
760 | mem.install_readwrite_handler(0xe000, 0xefff, 0, 0, | |
761 | 761 | read8_delegate(FUNC(bml3_state::bml3_e000_r), this), |
762 | 762 | write8_delegate(FUNC(bml3_state::bml3_e000_w), this), 0); |
763 | 763 | } |
764 | 764 | else |
765 | 765 | { |
766 | mem->install_rom(0xe000, 0xefff, | |
767 | mem->machine().root_device().memregion("maincpu")->base() + 0xe000); | |
768 | mem->install_write_handler(0xe000, 0xefff, 0, 0, | |
766 | mem.install_rom(0xe000, 0xefff, | |
767 | mem.machine().root_device().memregion("maincpu")->base() + 0xe000); | |
768 | mem.install_write_handler(0xe000, 0xefff, 0, 0, | |
769 | 769 | write8_delegate(FUNC(bml3_state::bml3_e000_w), this), |
770 | 770 | 0); |
771 | 771 | } |
r18027 | r18028 | |
773 | 773 | |
774 | 774 | if(data & 1) |
775 | 775 | { |
776 | mem | |
776 | mem.install_readwrite_handler(0xf000, 0xfeff, 0, 0, | |
777 | 777 | read8_delegate(FUNC(bml3_state::bml3_f000_r), this), |
778 | 778 | write8_delegate(FUNC(bml3_state::bml3_f000_w), this), 0); |
779 | 779 | } |
780 | 780 | else |
781 | 781 | { |
782 | mem->install_rom(0xf000, 0xfeff, | |
783 | mem->machine().root_device().memregion("maincpu")->base() + 0xf000); | |
784 | mem->install_write_handler(0xf000, 0xfeff, 0, 0, | |
782 | mem.install_rom(0xf000, 0xfeff, | |
783 | mem.machine().root_device().memregion("maincpu")->base() + 0xf000); | |
784 | mem.install_write_handler(0xf000, 0xfeff, 0, 0, | |
785 | 785 | write8_delegate(FUNC(bml3_state::bml3_f000_w), this), |
786 | 786 | 0); |
787 | 787 | } |
788 | 788 | |
789 | 789 | if(data & 2) |
790 | 790 | { |
791 | mem | |
791 | mem.install_readwrite_handler(0xfff0, 0xffff, 0, 0, | |
792 | 792 | read8_delegate(FUNC(bml3_state::bml3_fff0_r), this), |
793 | 793 | write8_delegate(FUNC(bml3_state::bml3_fff0_w), this), 0); |
794 | 794 | } |
795 | 795 | else |
796 | 796 | { |
797 | mem->install_rom(0xfff0, 0xffff, | |
798 | mem->machine().root_device().memregion("maincpu")->base() + 0xfff0); | |
799 | mem->install_write_handler(0xfff0, 0xffff, 0, 0, | |
797 | mem.install_rom(0xfff0, 0xffff, | |
798 | mem.machine().root_device().memregion("maincpu")->base() + 0xfff0); | |
799 | mem.install_write_handler(0xfff0, 0xffff, 0, 0, | |
800 | 800 | write8_delegate(FUNC(bml3_state::bml3_fff0_w), this), |
801 | 801 | 0); |
802 | 802 | } |
r18027 | r18028 | |
---|---|---|
431 | 431 | { |
432 | 432 | device_t *cpu = machine().device("maincpu"); |
433 | 433 | |
434 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
434 | machine().device("maincpu")->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(psx1_state::psx_default), this)); | |
435 | 435 | |
436 | 436 | if( load_psxexe( cpu, m_exe_buffer, m_exe_size ) || |
437 | 437 | load_cpe( cpu, m_exe_buffer, m_exe_size ) || |
r18027 | r18028 | |
455 | 455 | static QUICKLOAD_LOAD( psx_exe_load ) |
456 | 456 | { |
457 | 457 | psx1_state *state = image.device().machine().driver_data<psx1_state>(); |
458 | address_space &space = | |
458 | address_space &space = image.device().machine().device( "maincpu")->memory().space( AS_PROGRAM ); | |
459 | 459 | |
460 | 460 | state->m_exe_size = 0; |
461 | 461 | state->m_exe_buffer = (UINT8*)malloc( quickload_size ); |
r18027 | r18028 | |
---|---|---|
167 | 167 | |
168 | 168 | WRITE8_MEMBER(samcoupe_state::samcoupe_lmpr_w) |
169 | 169 | { |
170 | address_space &space_program = | |
170 | address_space &space_program = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
171 | 171 | |
172 | 172 | m_lmpr = data; |
173 | 173 | samcoupe_update_memory(space_program); |
r18027 | r18028 | |
180 | 180 | |
181 | 181 | WRITE8_MEMBER(samcoupe_state::samcoupe_hmpr_w) |
182 | 182 | { |
183 | address_space &space_program = | |
183 | address_space &space_program = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
184 | 184 | |
185 | 185 | m_hmpr = data; |
186 | 186 | samcoupe_update_memory(space_program); |
r18027 | r18028 | |
193 | 193 | |
194 | 194 | WRITE8_MEMBER(samcoupe_state::samcoupe_vmpr_w) |
195 | 195 | { |
196 | address_space &space_program = | |
196 | address_space &space_program = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
197 | 197 | |
198 | 198 | m_vmpr = data; |
199 | 199 | samcoupe_update_memory(space_program); |
r18027 | r18028 | |
---|---|---|
348 | 348 | return IMAGE_INIT_FAIL; |
349 | 349 | } |
350 | 350 | |
351 | memcpy (image.device().machine().device("maincpu")->memory().space(AS_PROGRAM) | |
351 | memcpy (image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).get_read_ptr(startaddr), | |
352 | 352 | data+0x20, endaddr - startaddr + 1); |
353 | 353 | |
354 | 354 | if (runaddr) |
r18027 | r18028 | |
---|---|---|
44 | 44 | |
45 | 45 | void tiki100_state::bankswitch() |
46 | 46 | { |
47 | address_space | |
47 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
48 | 48 | |
49 | 49 | if (m_vire) |
50 | 50 | { |
51 | 51 | if (!m_rome) |
52 | 52 | { |
53 | 53 | /* reserved */ |
54 | program | |
54 | program.unmap_readwrite(0x0000, 0xffff); | |
55 | 55 | } |
56 | 56 | else |
57 | 57 | { |
58 | 58 | /* GFXRAM, GFXRAM, RAM */ |
59 | program->install_readwrite_handler(0x0000, 0x7fff, read8_delegate(FUNC(tiki100_state::gfxram_r), this), write8_delegate(FUNC(tiki100_state::gfxram_w), this)); | |
60 | program->install_readwrite_bank(0x8000, 0xffff, "bank3"); | |
59 | program.install_readwrite_handler(0x0000, 0x7fff, read8_delegate(FUNC(tiki100_state::gfxram_r), this), write8_delegate(FUNC(tiki100_state::gfxram_w), this)); | |
60 | program.install_readwrite_bank(0x8000, 0xffff, "bank3"); | |
61 | 61 | |
62 | 62 | membank("bank1")->set_entry(BANK_VIDEO_RAM); |
63 | 63 | membank("bank2")->set_entry(BANK_VIDEO_RAM); |
r18027 | r18028 | |
69 | 69 | if (!m_rome) |
70 | 70 | { |
71 | 71 | /* ROM, RAM, RAM */ |
72 | program->install_read_bank(0x0000, 0x3fff, "bank1"); | |
73 | program->unmap_write(0x0000, 0x3fff); | |
74 | program->install_readwrite_bank(0x4000, 0x7fff, "bank2"); | |
75 | program->install_readwrite_bank(0x8000, 0xffff, "bank3"); | |
72 | program.install_read_bank(0x0000, 0x3fff, "bank1"); | |
73 | program.unmap_write(0x0000, 0x3fff); | |
74 | program.install_readwrite_bank(0x4000, 0x7fff, "bank2"); | |
75 | program.install_readwrite_bank(0x8000, 0xffff, "bank3"); | |
76 | 76 | |
77 | 77 | membank("bank1")->set_entry(BANK_ROM); |
78 | 78 | membank("bank2")->set_entry(BANK_RAM); |
r18027 | r18028 | |
81 | 81 | else |
82 | 82 | { |
83 | 83 | /* RAM, RAM, RAM */ |
84 | program->install_readwrite_bank(0x0000, 0x3fff, "bank1"); | |
85 | program->install_readwrite_bank(0x4000, 0x7fff, "bank2"); | |
86 | program->install_readwrite_bank(0x8000, 0xffff, "bank3"); | |
84 | program.install_readwrite_bank(0x0000, 0x3fff, "bank1"); | |
85 | program.install_readwrite_bank(0x4000, 0x7fff, "bank2"); | |
86 | program.install_readwrite_bank(0x8000, 0xffff, "bank3"); | |
87 | 87 | |
88 | 88 | membank("bank1")->set_entry(BANK_RAM); |
89 | 89 | membank("bank2")->set_entry(BANK_RAM); |
r18027 | r18028 | |
---|---|---|
120 | 120 | MACHINE_RESET_MEMBER(atm_state,atm) |
121 | 121 | { |
122 | 122 | UINT8 *messram = machine().device<ram_device>(RAM_TAG)->pointer(); |
123 | address_space &space = | |
123 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
124 | 124 | device_t *beta = machine().device(BETA_DISK_TAG); |
125 | 125 | |
126 | 126 | space.install_read_bank(0x0000, 0x3fff, "bank1"); |
r18027 | r18028 | |
---|---|---|
182 | 182 | else if (offset < 0x180000) |
183 | 183 | { |
184 | 184 | // video RAM |
185 | address_space &program = | |
185 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
186 | 186 | data = video_ram_r(program, offset); |
187 | 187 | } |
188 | 188 | else |
r18027 | r18028 | |
209 | 209 | else if (offset < 0x180000) |
210 | 210 | { |
211 | 211 | // video RAM |
212 | address_space &program = | |
212 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
213 | 213 | video_ram_w(program, offset, data); |
214 | 214 | } |
215 | 215 | else |
r18027 | r18028 | |
242 | 242 | |
243 | 243 | UINT8 abc1600_state::read_internal_io(offs_t offset) |
244 | 244 | { |
245 | address_space &program = | |
245 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
246 | 246 | UINT8 data = 0; |
247 | 247 | |
248 | 248 | if (X11) |
r18027 | r18028 | |
467 | 467 | |
468 | 468 | void abc1600_state::write_internal_io(offs_t offset, UINT8 data) |
469 | 469 | { |
470 | address_space &program = | |
470 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
471 | 471 | |
472 | 472 | if (X11) |
473 | 473 | { |
r18027 | r18028 | |
770 | 770 | |
771 | 771 | UINT8 abc1600_state::read_supervisor_memory(offs_t offset) |
772 | 772 | { |
773 | address_space &program = | |
773 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
774 | 774 | UINT8 data = 0; |
775 | 775 | |
776 | 776 | if (!A2 && !A1) |
r18027 | r18028 | |
799 | 799 | |
800 | 800 | void abc1600_state::write_supervisor_memory(offs_t offset, UINT8 data) |
801 | 801 | { |
802 | address_space &program = | |
802 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
803 | 803 | |
804 | 804 | if (!A2 && !A1) |
805 | 805 | { |
r18027 | r18028 | |
1879 | 1879 | |
1880 | 1880 | void abc1600_state::machine_reset() |
1881 | 1881 | { |
1882 | address_space &program = | |
1882 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
1883 | 1883 | |
1884 | 1884 | // clear special control register |
1885 | 1885 | for (int i = 0; i < 8; i++) |
r18027 | r18028 | |
---|---|---|
657 | 657 | |
658 | 658 | DRIVER_INIT_MEMBER(sage2_state,sage2) |
659 | 659 | { |
660 | address_space *program = machine().device<cpu_device>(M68000_TAG)->space(AS_PROGRAM); | |
661 | program->set_direct_update_handler(direct_update_delegate(FUNC(sage2_state::sage2_direct_update_handler), this)); | |
660 | address_space &program = machine().device<cpu_device>(M68000_TAG)->space(AS_PROGRAM); | |
661 | program.set_direct_update_handler(direct_update_delegate(FUNC(sage2_state::sage2_direct_update_handler), this)); | |
662 | 662 | |
663 | 663 | // patch out i8251 test |
664 | 664 | machine().root_device().memregion(M68000_TAG)->base()[0x1be8] = 0xd6; |
r18027 | r18028 | |
---|---|---|
255 | 255 | |
256 | 256 | DRIVER_INIT_MEMBER(vcs80_state,vcs80) |
257 | 257 | { |
258 | machine().device(Z80_TAG)->memory().space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate(FUNC(vcs80_state::vcs80_direct_update_handler), this)); | |
259 | machine().device(Z80_TAG)->memory().space(AS_IO)->set_direct_update_handler(direct_update_delegate(FUNC(vcs80_state::vcs80_direct_update_handler), this)); | |
258 | machine().device(Z80_TAG)->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(vcs80_state::vcs80_direct_update_handler), this)); | |
259 | machine().device(Z80_TAG)->memory().space(AS_IO).set_direct_update_handler(direct_update_delegate(FUNC(vcs80_state::vcs80_direct_update_handler), this)); | |
260 | 260 | } |
261 | 261 | |
262 | 262 | /* System Drivers */ |
r18027 | r18028 | |
---|---|---|
57 | 57 | |
58 | 58 | UINT32 itt3030_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
59 | 59 | { |
60 | address_space &space = | |
60 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
61 | 61 | |
62 | 62 | for(int y = 0; y < 24; y++ ) |
63 | 63 | { |
r18027 | r18028 | |
---|---|---|
288 | 288 | |
289 | 289 | void ob68k1a_state::machine_start() |
290 | 290 | { |
291 | address_space | |
291 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
292 | 292 | |
293 | 293 | // configure RAM |
294 | 294 | switch (m_ram->size()) |
295 | 295 | { |
296 | 296 | case 32*1024: |
297 | program | |
297 | program.unmap_readwrite(0x008000, 0x01ffff); | |
298 | 298 | break; |
299 | 299 | } |
300 | 300 | } |
r18027 | r18028 | |
306 | 306 | |
307 | 307 | void ob68k1a_state::machine_reset() |
308 | 308 | { |
309 | address_space | |
309 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
310 | 310 | |
311 | 311 | // initialize COM8116 |
312 | 312 | // m_dbrg->stt_w(program, 0, 0x01); |
313 | 313 | // m_dbrg->str_w(program, 0, 0x01); |
314 | 314 | |
315 | 315 | // set reset vector |
316 | void *ram = program | |
316 | void *ram = program.get_write_ptr(0); | |
317 | 317 | UINT8 *rom = memregion(MC68000L10_TAG)->base(); |
318 | 318 | |
319 | 319 | memcpy(ram, rom, 8); |
r18027 | r18028 | |
---|---|---|
49 | 49 | |
50 | 50 | READ8_MEMBER( tandy2k_state::videoram_r ) |
51 | 51 | { |
52 | address_space | |
52 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
53 | 53 | |
54 | 54 | offs_t addr = (m_vram_base << 15) | (offset << 1); |
55 | UINT16 data = program | |
55 | UINT16 data = program.read_word(addr); | |
56 | 56 | |
57 | 57 | // character |
58 | 58 | m_drb0->write(space, 0, data & 0xff); |
r18027 | r18028 | |
319 | 319 | static CRT9007_DRAW_SCANLINE( tandy2k_crt9007_display_pixels ) |
320 | 320 | { |
321 | 321 | tandy2k_state *state = device->machine().driver_data<tandy2k_state>(); |
322 | address_space | |
322 | address_space &program = state->m_maincpu->space(AS_PROGRAM); | |
323 | 323 | |
324 | 324 | for (int sx = 0; sx < x_count; sx++) |
325 | 325 | { |
326 | 326 | UINT32 videoram_addr = ((state->m_vram_base << 15) | (va << 1)) + sx; |
327 | UINT8 videoram_data = program | |
327 | UINT8 videoram_data = program.read_word(videoram_addr); | |
328 | 328 | UINT16 charram_addr = (videoram_data << 4) | sl; |
329 | 329 | UINT8 charram_data = state->m_char_ram[charram_addr] & 0xff; |
330 | 330 | |
r18027 | r18028 | |
670 | 670 | void tandy2k_state::machine_start() |
671 | 671 | { |
672 | 672 | // memory banking |
673 | address_space | |
673 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
674 | 674 | UINT8 *ram = m_ram->pointer(); |
675 | 675 | int ram_size = m_ram->size(); |
676 | 676 | |
677 | program | |
677 | program.install_ram(0x00000, ram_size - 1, ram); | |
678 | 678 | |
679 | 679 | // patch out i186 relocation register check |
680 | 680 | UINT8 *rom = memregion(I80186_TAG)->base(); |
r18027 | r18028 | |
---|---|---|
1042 | 1042 | { |
1043 | 1043 | running_machine &machine = image.device().machine(); |
1044 | 1044 | x07_state *state = machine.driver_data<x07_state>(); |
1045 | address_space &space = | |
1045 | address_space &space = state->m_maincpu->space( AS_PROGRAM ); | |
1046 | 1046 | UINT16 ram_size = state->m_ram->size(); |
1047 | 1047 | |
1048 | 1048 | if (image.software_entry() == NULL) |
r18027 | r18028 | |
1454 | 1454 | save_item(NAME(m_cursor.on)); |
1455 | 1455 | |
1456 | 1456 | /* install RAM */ |
1457 | address_space *program = m_maincpu->space(AS_PROGRAM); | |
1458 | program->install_ram(0x0000, m_ram->size() - 1, m_ram->pointer()); | |
1457 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
1458 | program.install_ram(0x0000, m_ram->size() - 1, m_ram->pointer()); | |
1459 | 1459 | } |
1460 | 1460 | |
1461 | 1461 | void x07_state::machine_reset() |
r18027 | r18028 | |
---|---|---|
439 | 439 | |
440 | 440 | void nanos_state::machine_reset() |
441 | 441 | { |
442 | address_space &space = | |
442 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
443 | 443 | |
444 | 444 | space.install_write_bank(0x0000, 0x0fff, "bank3"); |
445 | 445 | space.install_write_bank(0x1000, 0xffff, "bank2"); |
r18027 | r18028 | |
---|---|---|
145 | 145 | static TIMER_DEVICE_CALLBACK( timer_callback ) |
146 | 146 | { |
147 | 147 | z9001_state *state = timer.machine().driver_data<z9001_state>(); |
148 | state->m_maincpu->space(AS_PROGRAM) | |
148 | state->m_maincpu->space(AS_PROGRAM).write_byte(0x006a, 0); | |
149 | 149 | } |
150 | 150 | |
151 | 151 | void z9001_state::machine_reset() |
r18027 | r18028 | |
218 | 218 | |
219 | 219 | WRITE8_MEMBER( z9001_state::kbd_put ) |
220 | 220 | { |
221 | m_maincpu->space(AS_PROGRAM) | |
221 | m_maincpu->space(AS_PROGRAM).write_byte(0x0025, data); | |
222 | 222 | } |
223 | 223 | |
224 | 224 | static ASCII_KEYBOARD_INTERFACE( keyboard_intf ) |
r18027 | r18028 | |
---|---|---|
579 | 579 | |
580 | 580 | if(m_mio_sel) |
581 | 581 | { |
582 | address_space | |
582 | address_space &ram_space = m_maincpu->space(AS_PROGRAM); | |
583 | 583 | |
584 | 584 | m_mio_sel = 0; |
585 | 585 | //printf("%08x\n",offset); |
586 | 586 | //return 0x0d; // hack: this is used for reading the keyboard data, we can fake it a little ... (modify fda4) |
587 | return ram_space | |
587 | return ram_space.read_byte(offset); | |
588 | 588 | } |
589 | 589 | |
590 | 590 | io_port = offset & 0xff; //trim down to 8-bit bus |
r18027 | r18028 | |
630 | 630 | |
631 | 631 | if(m_mio_sel) |
632 | 632 | { |
633 | address_space | |
633 | address_space &ram_space = m_maincpu->space(AS_PROGRAM); | |
634 | 634 | m_mio_sel = 0; |
635 | ram_space | |
635 | ram_space.write_byte(offset, data); | |
636 | 636 | return; |
637 | 637 | } |
638 | 638 |
r18027 | r18028 | |
---|---|---|
824 | 824 | static void fm7_update_psg(running_machine &machine) |
825 | 825 | { |
826 | 826 | fm7_state *state = machine.driver_data<fm7_state>(); |
827 | address_space &space = | |
827 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
828 | 828 | |
829 | 829 | if(state->m_type == SYS_FM7) |
830 | 830 | { |
r18027 | r18028 | |
1963 | 1963 | } |
1964 | 1964 | if(m_type == SYS_FM77AV || m_type == SYS_FM77AV40EX || m_type == SYS_FM11) |
1965 | 1965 | { |
1966 | fm7_mmr_refresh( | |
1966 | fm7_mmr_refresh(machine().device("maincpu")->memory().space(AS_PROGRAM)); | |
1967 | 1967 | } |
1968 | 1968 | if(m_type == SYS_FM11) |
1969 | 1969 | { |
r18027 | r18028 | |
---|---|---|
84 | 84 | DRIVER_INIT_MEMBER(indiana_state,indiana) |
85 | 85 | { |
86 | 86 | pc_vga_init(machine(), indiana_vga_setting, NULL); |
87 | pc_vga_io_init(machine(), | |
87 | pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0x7f7a0000, machine().device("maincpu")->memory().space(AS_PROGRAM), 0x7f600000); | |
88 | 88 | } |
89 | 89 | |
90 | 90 | /* ROM definition */ |
r18027 | r18028 | |
---|---|---|
190 | 190 | |
191 | 191 | void exp85_state::machine_start() |
192 | 192 | { |
193 | address_space | |
193 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
194 | 194 | |
195 | 195 | /* setup memory banking */ |
196 | program->install_read_bank(0x0000, 0x07ff, "bank1"); | |
197 | program->unmap_write(0x0000, 0x07ff); | |
196 | program.install_read_bank(0x0000, 0x07ff, "bank1"); | |
197 | program.unmap_write(0x0000, 0x07ff); | |
198 | 198 | membank("bank1")->configure_entry(0, memregion(I8085A_TAG)->base() + 0xf000); |
199 | 199 | membank("bank1")->configure_entry(1, memregion(I8085A_TAG)->base()); |
200 | 200 | membank("bank1")->set_entry(0); |
r18027 | r18028 | |
---|---|---|
617 | 617 | |
618 | 618 | void m5_state::machine_start() |
619 | 619 | { |
620 | address_space | |
620 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
621 | 621 | |
622 | 622 | // configure RAM |
623 | 623 | switch (m_ram->size()) |
624 | 624 | { |
625 | 625 | case 4*1024: |
626 | program | |
626 | program.unmap_readwrite(0x8000, 0xffff); | |
627 | 627 | break; |
628 | 628 | |
629 | 629 | case 36*1024: |
r18027 | r18028 | |
---|---|---|
219 | 219 | |
220 | 220 | WRITE8_MEMBER( a5105_state::a5105_memsel_w ) |
221 | 221 | { |
222 | address_space | |
222 | address_space &prog = m_maincpu->space( AS_PROGRAM ); | |
223 | 223 | |
224 | 224 | if (m_memsel[0] != ((data & 0x03) >> 0)) |
225 | 225 | { |
r18027 | r18028 | |
229 | 229 | { |
230 | 230 | case 0: |
231 | 231 | membank("bank1")->set_base(m_rom_base); |
232 | prog->install_read_bank(0x0000, 0x3fff, "bank1"); | |
233 | prog->unmap_write(0x0000, 0x3fff); | |
232 | prog.install_read_bank(0x0000, 0x3fff, "bank1"); | |
233 | prog.unmap_write(0x0000, 0x3fff); | |
234 | 234 | break; |
235 | 235 | case 2: |
236 | 236 | membank("bank1")->set_base(m_ram_base); |
237 | prog | |
237 | prog.install_readwrite_bank(0x0000, 0x3fff, "bank1"); | |
238 | 238 | break; |
239 | 239 | default: |
240 | prog | |
240 | prog.unmap_readwrite(0x0000, 0x3fff); | |
241 | 241 | break; |
242 | 242 | } |
243 | 243 | } |
r18027 | r18028 | |
250 | 250 | { |
251 | 251 | case 0: |
252 | 252 | membank("bank2")->set_base(m_rom_base + 0x4000); |
253 | prog->install_read_bank(0x4000, 0x7fff, "bank2"); | |
254 | prog->unmap_write(0x4000, 0x4000); | |
253 | prog.install_read_bank(0x4000, 0x7fff, "bank2"); | |
254 | prog.unmap_write(0x4000, 0x4000); | |
255 | 255 | break; |
256 | 256 | case 1: |
257 | 257 | membank("bank2")->set_base(machine().root_device().memregion("k5651")->base()); |
258 | prog->install_read_bank(0x4000, 0x7fff, "bank2"); | |
259 | prog->unmap_write(0x4000, 0x4000); | |
258 | prog.install_read_bank(0x4000, 0x7fff, "bank2"); | |
259 | prog.unmap_write(0x4000, 0x4000); | |
260 | 260 | break; |
261 | 261 | case 2: |
262 | 262 | membank("bank2")->set_base(m_ram_base + 0x4000); |
263 | prog | |
263 | prog.install_readwrite_bank(0x4000, 0x7fff, "bank2"); | |
264 | 264 | break; |
265 | 265 | default: |
266 | prog | |
266 | prog.unmap_readwrite(0x4000, 0x7fff); | |
267 | 267 | break; |
268 | 268 | } |
269 | 269 | } |
r18027 | r18028 | |
276 | 276 | { |
277 | 277 | case 0: |
278 | 278 | membank("bank3")->set_base(m_rom_base + 0x8000); |
279 | prog->install_read_bank(0x8000, 0xbfff, "bank3"); | |
280 | prog->unmap_write(0x8000, 0xbfff); | |
279 | prog.install_read_bank(0x8000, 0xbfff, "bank3"); | |
280 | prog.unmap_write(0x8000, 0xbfff); | |
281 | 281 | break; |
282 | 282 | case 2: |
283 | 283 | membank("bank3")->set_base(m_ram_base + 0x8000); |
284 | prog | |
284 | prog.install_readwrite_bank(0x8000, 0xbfff, "bank3"); | |
285 | 285 | break; |
286 | 286 | default: |
287 | prog | |
287 | prog.unmap_readwrite(0x8000, 0xbfff); | |
288 | 288 | break; |
289 | 289 | } |
290 | 290 | } |
r18027 | r18028 | |
297 | 297 | { |
298 | 298 | case 2: |
299 | 299 | membank("bank4")->set_base(m_ram_base + 0xc000); |
300 | prog | |
300 | prog.install_readwrite_bank(0xc000, 0xffff, "bank4"); | |
301 | 301 | break; |
302 | 302 | default: |
303 | prog | |
303 | prog.unmap_readwrite(0xc000, 0xffff); | |
304 | 304 | break; |
305 | 305 | } |
306 | 306 | } |
r18027 | r18028 | |
454 | 454 | |
455 | 455 | void a5105_state::machine_reset() |
456 | 456 | { |
457 | address_space &space = | |
457 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
458 | 458 | a5105_ab_w(space, 0, 9); // turn motor off |
459 | 459 | beep_set_frequency(m_beep, 500); |
460 | 460 |
r18027 | r18028 | |
---|---|---|
321 | 321 | static void nc_refresh_memory_bank_config(running_machine &machine, int bank) |
322 | 322 | { |
323 | 323 | nc_state *state = machine.driver_data<nc_state>(); |
324 | address_space &space = | |
324 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
325 | 325 | int mem_type; |
326 | 326 | int mem_bank; |
327 | 327 | char bank1[10]; |
r18027 | r18028 | |
---|---|---|
513 | 513 | |
514 | 514 | static READ16_DEVICE_HANDLER( p8k_16_ctc_r ) |
515 | 515 | { |
516 | return (UINT16)downcast<z80ctc_device *>(device)->read( | |
516 | return (UINT16)downcast<z80ctc_device *>(device)->read(device->machine().driver_data()->generic_space(),(offset & 0x06) >> 1); | |
517 | 517 | } |
518 | 518 | |
519 | 519 | static WRITE16_DEVICE_HANDLER( p8k_16_ctc_w ) |
520 | 520 | { |
521 | downcast<z80ctc_device *>(device)->write( | |
521 | downcast<z80ctc_device *>(device)->write(device->machine().driver_data()->generic_space(), (offset & 0x06) >> 1, (UINT8)(data & 0xff)); | |
522 | 522 | } |
523 | 523 | |
524 | 524 | READ16_MEMBER( p8k_state::portff82_r ) |
r18027 | r18028 | |
---|---|---|
51 | 51 | |
52 | 52 | void bw12_state::bankswitch() |
53 | 53 | { |
54 | address_space | |
54 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
55 | 55 | |
56 | 56 | switch (m_bank) |
57 | 57 | { |
58 | 58 | case 0: /* ROM */ |
59 | program->install_read_bank(0x0000, 0x7fff, "bank1"); | |
60 | program->unmap_write(0x0000, 0x7fff); | |
59 | program.install_read_bank(0x0000, 0x7fff, "bank1"); | |
60 | program.unmap_write(0x0000, 0x7fff); | |
61 | 61 | break; |
62 | 62 | |
63 | 63 | case 1: /* BK0 */ |
64 | program | |
64 | program.install_readwrite_bank(0x0000, 0x7fff, "bank1"); | |
65 | 65 | break; |
66 | 66 | |
67 | 67 | case 2: /* BK1 */ |
68 | 68 | case 3: /* BK2 */ |
69 | 69 | if (m_ram->size() > 64*1024) |
70 | 70 | { |
71 | program | |
71 | program.install_readwrite_bank(0x0000, 0x7fff, "bank1"); | |
72 | 72 | } |
73 | 73 | else |
74 | 74 | { |
75 | program | |
75 | program.unmap_readwrite(0x0000, 0x7fff); | |
76 | 76 | } |
77 | 77 | break; |
78 | 78 | } |
r18027 | r18028 | |
---|---|---|
112 | 112 | { |
113 | 113 | UINT8 *messram = machine().device<ram_device>(RAM_TAG)->pointer(); |
114 | 114 | device_t *beta = machine().device(BETA_DISK_TAG); |
115 | address_space &space = | |
115 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
116 | 116 | |
117 | 117 | space.install_read_bank(0x0000, 0x3fff, "bank1"); |
118 | 118 | space.unmap_write(0x0000, 0x3fff); |
r18027 | r18028 | |
---|---|---|
121 | 121 | |
122 | 122 | WRITE8_MEMBER( prestige_state::bankswitch_w ) |
123 | 123 | { |
124 | address_space | |
124 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
125 | 125 | |
126 | 126 | switch (offset) |
127 | 127 | { |
r18027 | r18028 | |
159 | 159 | { |
160 | 160 | //cartridge memory is writable |
161 | 161 | if (data & 0x08) |
162 | program | |
162 | program.install_readwrite_bank(0x4000, 0x7fff, "bank2"); | |
163 | 163 | else |
164 | program | |
164 | program.unmap_write(0x4000, 0x7fff); | |
165 | 165 | |
166 | 166 | if (data & 0x04) |
167 | program | |
167 | program.install_readwrite_bank(0x8000, 0xbfff, "bank3"); | |
168 | 168 | else |
169 | program | |
169 | program.unmap_write(0x8000, 0xbfff); | |
170 | 170 | |
171 | program | |
171 | program.install_readwrite_bank(0xc000, 0xdfff, "bank4"); | |
172 | 172 | } |
173 | 173 | else |
174 | 174 | { |
175 | 175 | //cartridge memory is read-only |
176 | 176 | if (data & 0x02) |
177 | program | |
177 | program.unmap_write(0xc000, 0xdfff); | |
178 | 178 | else |
179 | program | |
179 | program.install_readwrite_bank(0xc000, 0xdfff, "bank4"); | |
180 | 180 | |
181 | program | |
181 | program.unmap_write(0x4000, 0xbfff); | |
182 | 182 | } |
183 | 183 | break; |
184 | 184 | case 6: |
r18027 | r18028 | |
---|---|---|
67 | 67 | // install read bank |
68 | 68 | if (m_bank_type[bank] != Z88_BANK_ROM) |
69 | 69 | { |
70 | m_maincpu->space(AS_PROGRAM)->install_read_bank(bank<<14, (bank<<14) + 0x3fff, bank_tag); | |
71 | m_maincpu->space(AS_PROGRAM)->unmap_write(bank<<14, (bank<<14) + 0x3fff); | |
70 | m_maincpu->space(AS_PROGRAM).install_read_bank(bank<<14, (bank<<14) + 0x3fff, bank_tag); | |
71 | m_maincpu->space(AS_PROGRAM).unmap_write(bank<<14, (bank<<14) + 0x3fff); | |
72 | 72 | m_bank_type[bank] = Z88_BANK_ROM; |
73 | 73 | } |
74 | 74 | |
r18027 | r18028 | |
81 | 81 | // install readwrite bank |
82 | 82 | if (m_bank_type[bank] != Z88_BANK_RAM) |
83 | 83 | { |
84 | m_maincpu->space(AS_PROGRAM) | |
84 | m_maincpu->space(AS_PROGRAM).install_readwrite_bank(bank<<14, (bank<<14) + 0x3fff, bank_tag); | |
85 | 85 | m_bank_type[bank] = Z88_BANK_RAM; |
86 | 86 | } |
87 | 87 | |
r18027 | r18028 | |
92 | 92 | { |
93 | 93 | if (m_bank_type[bank] != Z88_BANK_UNMAP) |
94 | 94 | { |
95 | m_maincpu->space(AS_PROGRAM) | |
95 | m_maincpu->space(AS_PROGRAM).unmap_readwrite(bank<<14, (bank<<14) + 0x3fff); | |
96 | 96 | m_bank_type[bank] = Z88_BANK_UNMAP; |
97 | 97 | } |
98 | 98 | } |
r18027 | r18028 | |
107 | 107 | switch (bank) |
108 | 108 | { |
109 | 109 | case 0: |
110 | m_maincpu->space(AS_PROGRAM) | |
110 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x0000, 0x3fff, 0, 0, read8_delegate(FUNC(z88_state::bank0_cart_r), this), write8_delegate(FUNC(z88_state::bank0_cart_w), this)); | |
111 | 111 | break; |
112 | 112 | case 1: |
113 | m_maincpu->space(AS_PROGRAM) | |
113 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x4000, 0x7fff, 0, 0, read8_delegate(FUNC(z88_state::bank1_cart_r), this), write8_delegate(FUNC(z88_state::bank1_cart_w), this)); | |
114 | 114 | break; |
115 | 115 | case 2: |
116 | m_maincpu->space(AS_PROGRAM) | |
116 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x8000, 0xbfff, 0, 0, read8_delegate(FUNC(z88_state::bank2_cart_r), this), write8_delegate(FUNC(z88_state::bank2_cart_w), this)); | |
117 | 117 | break; |
118 | 118 | case 3: |
119 | m_maincpu->space(AS_PROGRAM) | |
119 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xc000, 0xffff, 0, 0, read8_delegate(FUNC(z88_state::bank3_cart_r), this), write8_delegate(FUNC(z88_state::bank3_cart_w), this)); | |
120 | 120 | break; |
121 | 121 | } |
122 | 122 | |
r18027 | r18028 | |
128 | 128 | // override setting for lower 8k of bank 0 |
129 | 129 | if (bank == 0) |
130 | 130 | { |
131 | m_maincpu->space(AS_PROGRAM) | |
131 | m_maincpu->space(AS_PROGRAM).install_read_bank(0, 0x1fff, "bank1"); | |
132 | 132 | |
133 | 133 | // enable RAM |
134 | 134 | if (rams) |
135 | m_maincpu->space(AS_PROGRAM) | |
135 | m_maincpu->space(AS_PROGRAM).install_write_bank(0, 0x1fff, "bank1"); | |
136 | 136 | else |
137 | m_maincpu->space(AS_PROGRAM) | |
137 | m_maincpu->space(AS_PROGRAM).unmap_write(0, 0x1fff); | |
138 | 138 | |
139 | 139 | membank("bank1")->set_entry(rams & 1); |
140 | 140 | } |
r18027 | r18028 | |
---|---|---|
340 | 340 | // set to 1 after boot for restore the ram in the first bank |
341 | 341 | if (data & 0x01) |
342 | 342 | { |
343 | address_space *space_prg = m_maincpu->space(AS_PROGRAM); | |
344 | space_prg->install_write_bank(0x0000, 0x3fff, "bank1"); | |
343 | address_space &space_prg = m_maincpu->space(AS_PROGRAM); | |
344 | space_prg.install_write_bank(0x0000, 0x3fff, "bank1"); | |
345 | 345 | membank("bank1")->set_entry(0); |
346 | 346 | } |
347 | 347 | } |
r18027 | r18028 | |
472 | 472 | |
473 | 473 | WRITE8_MEMBER( pcg850v_state::g850v_bank_w ) |
474 | 474 | { |
475 | address_space | |
475 | address_space &space_prg = m_maincpu->space(AS_PROGRAM); | |
476 | 476 | |
477 | 477 | if (data < 0x16) |
478 | 478 | { |
479 | space_prg | |
479 | space_prg.install_read_bank(0xc000, 0xffff, "bank4"); | |
480 | 480 | membank("bank4")->set_entry(data); |
481 | 481 | } |
482 | 482 | else |
483 | 483 | { |
484 | space_prg | |
484 | space_prg.unmap_read(0xc000, 0xffff); | |
485 | 485 | } |
486 | 486 | |
487 | 487 | m_g850v_bank_num = data; |
r18027 | r18028 | |
873 | 873 | |
874 | 874 | void pce220_state::machine_reset() |
875 | 875 | { |
876 | address_space &space = | |
876 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
877 | 877 | space.unmap_write(0x0000, 0x3fff); |
878 | 878 | |
879 | 879 | // install the boot code into the first bank |
r18027 | r18028 | |
---|---|---|
433 | 433 | { |
434 | 434 | device_t *devconf = device->machine().device(TERMINAL_TAG); |
435 | 435 | verboselog(device->machine(), 0, "duarta_tx: %02x\n", data); |
436 | dynamic_cast<generic_terminal_device *>(devconf)->write( | |
436 | dynamic_cast<generic_terminal_device *>(devconf)->write(devconf->machine().driver_data()->generic_space(), 0, data); | |
437 | 437 | } |
438 | 438 | |
439 | 439 | static const duart68681_config sgi_ip2_duart68681a_config = |
r18027 | r18028 | |
---|---|---|
369 | 369 | /* |
370 | 370 | static void pcw16_set_bank_handlers(running_machine &machine, int bank, PCW16_RAM_TYPE type) |
371 | 371 | { |
372 | address_space &space = | |
372 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
373 | 373 | pcw16_state *state = machine.driver_data<pcw16_state>(); |
374 | 374 | switch (type) { |
375 | 375 | case PCW16_MEM_ROM: |
r18027 | r18028 | |
441 | 441 | flashdev = machine.device<intelfsh8_device>("flash1"); |
442 | 442 | } |
443 | 443 | |
444 | mem_ptr = (unsigned char *)flashdev->space() | |
444 | mem_ptr = (unsigned char *)flashdev->space().get_read_ptr(0); | |
445 | 445 | } |
446 | 446 | |
447 | 447 | } |
r18027 | r18028 | |
---|---|---|
97 | 97 | static void duart_tx(device_t *device, int channel, UINT8 data) |
98 | 98 | { |
99 | 99 | ht68k_state *state = device->machine().driver_data<ht68k_state>(); |
100 | state->m_terminal->write( | |
100 | state->m_terminal->write(device->machine().driver_data()->generic_space(), 0, data); | |
101 | 101 | } |
102 | 102 | |
103 | 103 | static UINT8 duart_input(device_t *device) |
r18027 | r18028 | |
---|---|---|
154 | 154 | //we're in disabled debug_printf |
155 | 155 | unsigned char* buf = (unsigned char *)alloca(200); |
156 | 156 | unsigned char temp; |
157 | address_space | |
157 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
158 | 158 | |
159 | 159 | memset(buf,0,200); |
160 | 160 | |
161 | 161 | int i = 0; |
162 | while ((temp=program | |
162 | while ((temp=program.read_byte(m_maincpu->state_int(ARM7_R0)+i))) { | |
163 | 163 | buf[i++]=temp; |
164 | 164 | //m_terminal->write(space, 0, temp); |
165 | 165 | } |
r18027 | r18028 | |
---|---|---|
304 | 304 | dma_slot &ds = dma_slots[slot]; |
305 | 305 | ds.drq = state; |
306 | 306 | if(state && (ds.state & DMA_ENABLE)) { |
307 | address_space &space = | |
307 | address_space &space = maincpu->space(AS_PROGRAM); | |
308 | 308 | if(ds.state & DMA_READ) { |
309 | 309 | while(ds.drq) { |
310 | 310 | dma_check_update(slot); |
r18027 | r18028 | |
---|---|---|
48 | 48 | |
49 | 49 | void prof80_state::bankswitch() |
50 | 50 | { |
51 | address_space | |
51 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
52 | 52 | UINT8 *ram = m_ram->pointer(); |
53 | 53 | UINT8 *rom = memregion(Z80_TAG)->base(); |
54 | 54 | int bank; |
r18027 | r18028 | |
62 | 62 | switch (block) |
63 | 63 | { |
64 | 64 | case BLK_RAM1: |
65 | program | |
65 | program.install_ram(start_addr, end_addr, ram + ((bank % 8) * 0x1000)); | |
66 | 66 | break; |
67 | 67 | |
68 | 68 | case BLK_RAM2: |
69 | program | |
69 | program.install_ram(start_addr, end_addr, ram + 0x8000 + ((bank % 8) * 0x1000)); | |
70 | 70 | break; |
71 | 71 | |
72 | 72 | case BLK_RAM3: |
73 | program | |
73 | program.install_ram(start_addr, end_addr, ram + 0x10000 + ((bank % 8) * 0x1000)); | |
74 | 74 | break; |
75 | 75 | |
76 | 76 | case BLK_RAM4: |
77 | program | |
77 | program.install_ram(start_addr, end_addr, ram + 0x18000 + ((bank % 8) * 0x1000)); | |
78 | 78 | break; |
79 | 79 | |
80 | 80 | case BLK_EPROM: |
81 | program | |
81 | program.install_rom(start_addr, end_addr, rom + ((bank % 2) * 0x1000)); | |
82 | 82 | break; |
83 | 83 | |
84 | 84 | default: |
85 | program | |
85 | program.unmap_readwrite(start_addr, end_addr); | |
86 | 86 | } |
87 | 87 | |
88 | 88 | //logerror("Segment %u address %04x-%04x block %u\n", bank, start_addr, end_addr, block); |
r18027 | r18028 | |
---|---|---|
1192 | 1192 | void apollo_terminal_write(UINT8 data) { |
1193 | 1193 | if (dsp_terminal != NULL) { |
1194 | 1194 | // output data to the terminal emulator |
1195 | dynamic_cast<generic_terminal_device *>(dsp_terminal)->write( | |
1195 | dynamic_cast<generic_terminal_device *>(dsp_terminal)->write(dsp_terminal->machine().driver_data()->generic_space(), 0, data); | |
1196 | 1196 | } |
1197 | 1197 | } |
1198 | 1198 |
r18027 | r18028 | |
---|---|---|
65 | 65 | |
66 | 66 | DRIVER_INIT_MEMBER(dc_state,dcus) |
67 | 67 | { |
68 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
68 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xc2303b0, 0xc2303b7, FUNC(dcus_idle_skip_r)); | |
69 | 69 | |
70 | 70 | DRIVER_INIT_CALL(dc); |
71 | 71 | } |
72 | 72 | |
73 | 73 | DRIVER_INIT_MEMBER(dc_state,dcjp) |
74 | 74 | { |
75 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
75 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0xc2302f8, 0xc2302ff, FUNC(dcjp_idle_skip_r)); | |
76 | 76 | |
77 | 77 | DRIVER_INIT_CALL(dc); |
78 | 78 | } |
r18027 | r18028 | |
---|---|---|
80 | 80 | static void to_term(device_t *device, int data ) |
81 | 81 | { |
82 | 82 | basic52_state *state = device->machine().driver_data<basic52_state>(); |
83 | address_space &space = | |
83 | address_space &space = device->memory().space(AS_PROGRAM); | |
84 | 84 | state->m_terminal->write(space, 0, data); |
85 | 85 | } |
86 | 86 |
r18027 | r18028 | |
---|---|---|
216 | 216 | /* install expansion memory if available */ |
217 | 217 | if (machine().device<ram_device>(RAM_TAG)->size() > 0x1000) |
218 | 218 | { |
219 | address_space &space = | |
219 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
220 | 220 | |
221 | 221 | space.install_readwrite_bank(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 0x1000 - 1, "bank1"); |
222 | 222 | membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer()); |
r18027 | r18028 | |
---|---|---|
138 | 138 | static QUICKLOAD_LOAD( lynx ) |
139 | 139 | { |
140 | 140 | device_t *cpu = image.device().machine().device("maincpu"); |
141 | address_space &space = | |
141 | address_space &space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM); | |
142 | 142 | UINT8 *data = NULL; |
143 | 143 | UINT8 *rom = image.device().machine().root_device().memregion("maincpu")->base(); |
144 | 144 | UINT8 header[10]; // 80 08 dw Start dw Len B S 9 3 |
r18027 | r18028 | |
---|---|---|
110 | 110 | |
111 | 111 | INPUT_CHANGED_MEMBER(x1twin_state::ipl_reset) |
112 | 112 | { |
113 | //address_space &space = | |
113 | //address_space &space = machine().device("x1_cpu")->memory().space(AS_PROGRAM); | |
114 | 114 | |
115 | 115 | m_x1_cpu->set_input_line(INPUT_LINE_RESET, newval ? CLEAR_LINE : ASSERT_LINE); |
116 | 116 |
r18027 | r18028 | |
---|---|---|
211 | 211 | void spectrum_plus3_update_memory(running_machine &machine) |
212 | 212 | { |
213 | 213 | spectrum_state *state = machine.driver_data<spectrum_state>(); |
214 | address_space &space = | |
214 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
215 | 215 | UINT8 *messram = machine.device<ram_device>(RAM_TAG)->pointer(); |
216 | 216 | |
217 | 217 | if (state->m_port_7ffd_data & 8) |
r18027 | r18028 | |
---|---|---|
398 | 398 | */ |
399 | 399 | INTERRUPT_GEN_MEMBER(apexc_state::apexc_interrupt) |
400 | 400 | { |
401 | address_space& space = | |
401 | address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
402 | 402 | UINT32 edit_keys; |
403 | 403 | int control_keys; |
404 | 404 |
r18027 | r18028 | |
---|---|---|
2622 | 2622 | |
2623 | 2623 | MACHINE_START_MEMBER(x68k_state,x68000) |
2624 | 2624 | { |
2625 | address_space &space = | |
2625 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2626 | 2626 | /* Install RAM handlers */ |
2627 | 2627 | m_spriteram = (UINT16*)(*memregion("user1")); |
2628 | 2628 | space.install_legacy_read_handler(0x000000,0xbffffb,0xffffffff,0,FUNC(x68k_emptyram_r)); |
r18027 | r18028 | |
2652 | 2652 | |
2653 | 2653 | MACHINE_START_MEMBER(x68k_state,x68030) |
2654 | 2654 | { |
2655 | address_space &space = | |
2655 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
2656 | 2656 | /* Install RAM handlers */ |
2657 | 2657 | m_spriteram = (UINT16*)(*memregion("user1")); |
2658 | 2658 | space.install_legacy_read_handler(0x000000,0xbffffb,0xffffffff,0,FUNC(x68k_rom0_r),0xffffffff); |
r18027 | r18028 | |
---|---|---|
75 | 75 | static MC6845_UPDATE_ROW( victor9k_update_row ) |
76 | 76 | { |
77 | 77 | victor9k_state *state = device->machine().driver_data<victor9k_state>(); |
78 | address_space | |
78 | address_space &program = state->m_maincpu->space(AS_PROGRAM); | |
79 | 79 | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
80 | 80 | |
81 | 81 | if (BIT(ma, 13)) |
r18027 | r18028 | |
90 | 90 | { |
91 | 91 | UINT16 code = (state->m_video_ram[video_ram_addr + 1] << 8) | state->m_video_ram[video_ram_addr]; |
92 | 92 | UINT32 char_ram_addr = (BIT(ma, 12) << 16) | ((code & 0xff) << 5) | (ra << 1); |
93 | UINT16 data = program | |
93 | UINT16 data = program.read_word(char_ram_addr); | |
94 | 94 | |
95 | 95 | for (int x = 0; x <= 10; x++) |
96 | 96 | { |
r18027 | r18028 | |
926 | 926 | m_maincpu->set_irq_acknowledge_callback(victor9k_irq_callback); |
927 | 927 | |
928 | 928 | // memory banking |
929 | address_space *program = m_maincpu->space(AS_PROGRAM); | |
930 | program->install_ram(0x00000, m_ram->size() - 1, m_ram->pointer()); | |
929 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
930 | program.install_ram(0x00000, m_ram->size() - 1, m_ram->pointer()); | |
931 | 931 | } |
932 | 932 | |
933 | 933 | // Machine Driver |
r18027 | r18028 | |
---|---|---|
528 | 528 | /* bank register */ |
529 | 529 | WRITE8_MEMBER(px4_state::px4_bankr_w) |
530 | 530 | { |
531 | address_space &space_program = | |
531 | address_space &space_program = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
532 | 532 | |
533 | 533 | if (VERBOSE) |
534 | 534 | logerror("%s: px4_bankr_w (0x%02x)\n", machine().describe_context(), data); |
r18027 | r18028 | |
---|---|---|
218 | 218 | |
219 | 219 | QUICKLOAD_LOAD( instruct ) |
220 | 220 | { |
221 | address_space &space = | |
221 | address_space &space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM); | |
222 | 222 | int i; |
223 | 223 | int quick_addr = 0x0100; |
224 | 224 | int exec_addr; |
r18027 | r18028 | |
---|---|---|
456 | 456 | |
457 | 457 | READ8_MEMBER( pc8001_state::dma_io_r ) |
458 | 458 | { |
459 | address_space | |
459 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
460 | 460 | |
461 | return program | |
461 | return program.read_byte(offset); | |
462 | 462 | } |
463 | 463 | |
464 | 464 | WRITE8_MEMBER( pc8001_state::dma_io_w ) |
465 | 465 | { |
466 | address_space | |
466 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
467 | 467 | |
468 | program | |
468 | program.write_byte(offset, data); | |
469 | 469 | } |
470 | 470 | |
471 | 471 | static I8257_INTERFACE( dmac_intf ) |
r18027 | r18028 | |
491 | 491 | |
492 | 492 | void pc8001_state::machine_start() |
493 | 493 | { |
494 | address_space | |
494 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
495 | 495 | |
496 | 496 | /* initialize RTC */ |
497 | 497 | m_rtc->cs_w(1); |
r18027 | r18028 | |
504 | 504 | UINT8 *ram = m_ram->pointer(); |
505 | 505 | |
506 | 506 | membank("bank1")->configure_entry(1, memregion("n80")->base()); |
507 | program->install_read_bank(0x0000, 0x5fff, "bank1"); | |
508 | program->unmap_write(0x0000, 0x5fff); | |
507 | program.install_read_bank(0x0000, 0x5fff, "bank1"); | |
508 | program.unmap_write(0x0000, 0x5fff); | |
509 | 509 | |
510 | 510 | switch (m_ram->size()) |
511 | 511 | { |
512 | 512 | case 16*1024: |
513 | 513 | membank("bank3")->configure_entry(0, ram); |
514 | program->unmap_readwrite(0x6000, 0xbfff); | |
515 | program->unmap_readwrite(0x8000, 0xbfff); | |
516 | program->install_readwrite_bank(0xc000, 0xffff, "bank3"); | |
514 | program.unmap_readwrite(0x6000, 0xbfff); | |
515 | program.unmap_readwrite(0x8000, 0xbfff); | |
516 | program.install_readwrite_bank(0xc000, 0xffff, "bank3"); | |
517 | 517 | break; |
518 | 518 | |
519 | 519 | case 32*1024: |
520 | 520 | membank("bank3")->configure_entry(0, ram); |
521 | program->unmap_readwrite(0x6000, 0xbfff); | |
522 | program->install_readwrite_bank(0x8000, 0xffff, "bank3"); | |
521 | program.unmap_readwrite(0x6000, 0xbfff); | |
522 | program.install_readwrite_bank(0x8000, 0xffff, "bank3"); | |
523 | 523 | break; |
524 | 524 | |
525 | 525 | case 64*1024: |
526 | 526 | membank("bank1")->configure_entry(0, ram); |
527 | 527 | membank("bank2")->configure_entry(0, ram + 0x6000); |
528 | 528 | membank("bank3")->configure_entry(0, ram + 0x8000); |
529 | program->install_readwrite_bank(0x0000, 0x5fff, "bank1"); | |
530 | program->install_readwrite_bank(0x6000, 0xbfff, "bank2"); | |
531 | program->install_readwrite_bank(0x8000, 0xffff, "bank3"); | |
529 | program.install_readwrite_bank(0x0000, 0x5fff, "bank1"); | |
530 | program.install_readwrite_bank(0x6000, 0xbfff, "bank2"); | |
531 | program.install_readwrite_bank(0x8000, 0xffff, "bank3"); | |
532 | 532 | membank("bank2")->set_entry(0); |
533 | 533 | break; |
534 | 534 | } |
r18027 | r18028 | |
---|---|---|
228 | 228 | { |
229 | 229 | spectrum_state *state = machine.driver_data<spectrum_state>(); |
230 | 230 | UINT8 *messram = machine.device<ram_device>(RAM_TAG)->pointer(); |
231 | address_space &space = | |
231 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
232 | 232 | unsigned char *ChosenROM, *ExROM; |
233 | 233 | const timex_cart_t *timex_cart = timex_cart_data(); |
234 | 234 | int timex_cart_type = timex_cart->type; |
r18027 | r18028 | |
---|---|---|
51 | 51 | |
52 | 52 | */ |
53 | 53 | |
54 | address_space | |
54 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
55 | 55 | |
56 | 56 | int max_ram_bank = 0; |
57 | 57 | |
r18027 | r18028 | |
87 | 87 | switch (m_bank) |
88 | 88 | { |
89 | 89 | case BANK_RAM1: |
90 | program | |
90 | program.install_readwrite_bank(0x0000, 0x7fff, "bank1"); | |
91 | 91 | break; |
92 | 92 | |
93 | 93 | case BANK_VRAM: |
94 | program | |
94 | program.install_readwrite_bank(0x0000, 0x3fff, 0, 0x4000, "bank1"); | |
95 | 95 | break; |
96 | 96 | |
97 | 97 | case BANK_RAM2: |
r18027 | r18028 | |
101 | 101 | case BANK_RAM6: |
102 | 102 | if (m_bank > max_ram_bank) |
103 | 103 | { |
104 | program | |
104 | program.unmap_readwrite(0x0000, 0x7fff); | |
105 | 105 | } |
106 | 106 | else |
107 | 107 | { |
108 | program | |
108 | program.install_readwrite_bank(0x0000, 0x7fff, "bank1"); | |
109 | 109 | } |
110 | 110 | break; |
111 | 111 | |
112 | 112 | case BANK_ROM: |
113 | program->install_read_bank(0x0000, 0x7fff, "bank1"); | |
114 | program->unmap_write(0x0000, 0x7fff); | |
113 | program.install_read_bank(0x0000, 0x7fff, "bank1"); | |
114 | program.unmap_write(0x0000, 0x7fff); | |
115 | 115 | break; |
116 | 116 | } |
117 | 117 | |
r18027 | r18028 | |
133 | 133 | |
134 | 134 | */ |
135 | 135 | |
136 | address_space | |
136 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
137 | 137 | |
138 | 138 | int max_ram_bank = BANK_RAM1; |
139 | 139 | |
r18027 | r18028 | |
164 | 164 | { |
165 | 165 | case BANK_RAM1: |
166 | 166 | case BANK_RAMCARD_RAM: |
167 | program | |
167 | program.install_readwrite_bank(0x0000, 0x7fff, "bank1"); | |
168 | 168 | break; |
169 | 169 | |
170 | 170 | case BANK_VRAM: |
171 | program | |
171 | program.install_readwrite_bank(0x0000, 0x3fff, 0, 0x4000, "bank1"); | |
172 | 172 | break; |
173 | 173 | |
174 | 174 | case BANK_RAM3: |
r18027 | r18028 | |
176 | 176 | case BANK_RAM6: |
177 | 177 | if (m_bank > max_ram_bank) |
178 | 178 | { |
179 | program | |
179 | program.unmap_readwrite(0x0000, 0x7fff); | |
180 | 180 | } |
181 | 181 | else |
182 | 182 | { |
183 | program | |
183 | program.install_readwrite_bank(0x0000, 0x7fff, "bank1"); | |
184 | 184 | } |
185 | 185 | break; |
186 | 186 | |
187 | 187 | case BANK_RAMCARD_ROM: |
188 | program->install_read_bank(0x0000, 0x3fff, 0, 0x4000, "bank1"); | |
189 | program->unmap_write(0x0000, 0x3fff, 0, 0x4000); | |
188 | program.install_read_bank(0x0000, 0x3fff, 0, 0x4000, "bank1"); | |
189 | program.unmap_write(0x0000, 0x3fff, 0, 0x4000); | |
190 | 190 | break; |
191 | 191 | |
192 | 192 | case BANK_ROM: |
193 | program->install_read_bank(0x0000, 0x7fff, "bank1"); | |
194 | program->unmap_write(0x0000, 0x7fff); | |
193 | program.install_read_bank(0x0000, 0x7fff, "bank1"); | |
194 | program.unmap_write(0x0000, 0x7fff); | |
195 | 195 | break; |
196 | 196 | } |
197 | 197 | |
r18027 | r18028 | |
200 | 200 | |
201 | 201 | WRITE8_MEMBER( bw2_state::ramcard_bank_w ) |
202 | 202 | { |
203 | address_space | |
203 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
204 | 204 | |
205 | 205 | UINT8 ramcard_bank = data & 0x0f; |
206 | 206 | UINT32 bank_offset = ramcard_bank * 0x8000; |
207 | 207 | |
208 | 208 | if ((get_ramdisk_size() == 256) && (ramcard_bank > 7)) |
209 | 209 | { |
210 | program | |
210 | program.unmap_readwrite(0x0000, 0x7fff); | |
211 | 211 | } |
212 | 212 | else |
213 | 213 | { |
214 | program | |
214 | program.install_readwrite_bank(0x0000, 0x7fff, "bank1"); | |
215 | 215 | } |
216 | 216 | |
217 | 217 | membank("bank1")->configure_entry(BANK_RAMCARD_RAM, m_ramcard_ram + bank_offset); |
r18027 | r18028 | |
638 | 638 | |
639 | 639 | void bw2_state::machine_reset() |
640 | 640 | { |
641 | address_space | |
641 | address_space &io = machine().device(Z80_TAG)->memory().space(AS_IO); | |
642 | 642 | |
643 | 643 | if (get_ramdisk_size() > 0) |
644 | 644 | { |
r18027 | r18028 | |
649 | 649 | membank("bank1")->configure_entry(BANK_RAMCARD_RAM, m_ramcard_ram); |
650 | 650 | membank("bank1")->configure_entry(BANK_RAM6, m_ram->pointer() + 0x18000); |
651 | 651 | |
652 | io | |
652 | io.install_write_handler(0x30, 0x30, 0, 0x0f, write8_delegate(FUNC(bw2_state::ramcard_bank_w), this), 0); | |
653 | 653 | } |
654 | 654 | else |
655 | 655 | { |
r18027 | r18028 | |
657 | 657 | |
658 | 658 | membank("bank1")->configure_entries(BANK_RAM2, 5, m_ram->pointer() + 0x8000, 0x8000); |
659 | 659 | |
660 | io | |
660 | io.unmap_write(0x30, 0x30, 0, 0x0f); | |
661 | 661 | } |
662 | 662 | |
663 | 663 | membank("bank1")->set_entry(BANK_ROM); |
r18027 | r18028 | |
---|---|---|
108 | 108 | case 0x11: |
109 | 109 | case 0x12: |
110 | 110 | case 0x13: |
111 | enterprise_update_memory_page( | |
111 | enterprise_update_memory_page(device->machine().device("maincpu")->memory().space(AS_PROGRAM), offset - 0x0f, data); | |
112 | 112 | break; |
113 | 113 | |
114 | 114 | case 0x15: |
r18027 | r18028 | |
---|---|---|
438 | 438 | |
439 | 439 | WRITE8_MEMBER( portfolio_state::ncc1_w ) |
440 | 440 | { |
441 | address_space | |
441 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
442 | 442 | |
443 | 443 | if (BIT(data, 0)) |
444 | 444 | { |
445 | 445 | // system ROM |
446 | 446 | UINT8 *rom = memregion(M80C88A_TAG)->base(); |
447 | program | |
447 | program.install_rom(0xc0000, 0xdffff, rom); | |
448 | 448 | } |
449 | 449 | else |
450 | 450 | { |
451 | 451 | // credit card memory |
452 | program | |
452 | program.unmap_readwrite(0xc0000, 0xdffff); | |
453 | 453 | } |
454 | 454 | |
455 | 455 | //logerror("NCC %02x\n", data); |
r18027 | r18028 | |
763 | 763 | |
764 | 764 | void portfolio_state::machine_start() |
765 | 765 | { |
766 | address_space | |
766 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
767 | 767 | |
768 | 768 | /* set CPU interrupt vector callback */ |
769 | 769 | m_maincpu->set_irq_acknowledge_callback(portfolio_int_ack); |
r18027 | r18028 | |
772 | 772 | switch (machine().device<ram_device>(RAM_TAG)->size()) |
773 | 773 | { |
774 | 774 | case 128 * 1024: |
775 | program | |
775 | program.unmap_readwrite(0x1f000, 0x9efff); | |
776 | 776 | break; |
777 | 777 | |
778 | 778 | case 384 * 1024: |
779 | program | |
779 | program.unmap_readwrite(0x5f000, 0x9efff); | |
780 | 780 | break; |
781 | 781 | } |
782 | 782 | |
r18027 | r18028 | |
801 | 801 | |
802 | 802 | void portfolio_state::machine_reset() |
803 | 803 | { |
804 | address_space | |
804 | address_space &io = m_maincpu->space(AS_IO); | |
805 | 805 | |
806 | 806 | // peripherals |
807 | 807 | m_pid = ioport("PERIPHERAL")->read(); |
808 | 808 | |
809 | io->unmap_readwrite(0x8070, 0x807b); | |
810 | io->unmap_readwrite(0x807d, 0x807e); | |
809 | io.unmap_readwrite(0x8070, 0x807b); | |
810 | io.unmap_readwrite(0x807d, 0x807e); | |
811 | 811 | |
812 | 812 | switch (m_pid) |
813 | 813 | { |
814 | 814 | case PID_SERIAL: |
815 | io | |
815 | io.install_readwrite_handler(0x8070, 0x8077, read8_delegate(FUNC(ins8250_device::ins8250_r), (ins8250_device*)m_uart), write8_delegate(FUNC(ins8250_device::ins8250_w), (ins8250_device*)m_uart)); | |
816 | 816 | break; |
817 | 817 | |
818 | 818 | case PID_PARALLEL: |
819 | io | |
819 | io.install_readwrite_handler(0x8078, 0x807b, read8_delegate(FUNC(i8255_device::read), (i8255_device*)m_ppi), write8_delegate(FUNC(i8255_device::write), (i8255_device*)m_ppi)); | |
820 | 820 | break; |
821 | 821 | } |
822 | 822 | } |
r18027 | r18028 | |
---|---|---|
123 | 123 | |
124 | 124 | void atom_state::bankswitch() |
125 | 125 | { |
126 | address_space | |
126 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
127 | 127 | |
128 | 128 | UINT8 *eprom = memregion(EXTROM_TAG)->base() + (m_eprom << 12); |
129 | 129 | |
130 | program | |
130 | program.install_rom(0xa000, 0xafff, eprom); | |
131 | 131 | } |
132 | 132 | |
133 | 133 | /*------------------------------------------------- |
r18027 | r18028 | |
648 | 648 | generator. I don't know if this is hardware, or random data because the |
649 | 649 | ram chips are not cleared at start-up. So at this time, these numbers |
650 | 650 | are poked into the memory to simulate it. When I have more details I will fix it */ |
651 | UINT8 *m_baseram = (UINT8 *)m_maincpu->space(AS_PROGRAM) | |
651 | UINT8 *m_baseram = (UINT8 *)m_maincpu->space(AS_PROGRAM).get_write_ptr(0x0000); | |
652 | 652 | |
653 | 653 | m_baseram[0x08] = machine().rand() & 0x0ff; |
654 | 654 | m_baseram[0x09] = machine().rand() & 0x0ff; |
r18027 | r18028 | |
---|---|---|
236 | 236 | |
237 | 237 | DRIVER_INIT_MEMBER(mc10_state,mc10) |
238 | 238 | { |
239 | address_space &prg = | |
239 | address_space &prg = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
240 | 240 | |
241 | 241 | /* initialize keyboard strobe */ |
242 | 242 | m_keyboard_strobe = 0x00; |
r18027 | r18028 | |
---|---|---|
257 | 257 | |
258 | 258 | DRIVER_INIT_MEMBER(apricot_state,apricot) |
259 | 259 | { |
260 | address_space | |
260 | address_space &prg = m_maincpu->space(AS_PROGRAM); | |
261 | 261 | |
262 | 262 | UINT8 *ram = m_ram->pointer(); |
263 | 263 | UINT32 ram_size = m_ram->size(); |
264 | 264 | |
265 | prg->unmap_readwrite(0x40000, 0xeffff); | |
266 | prg->install_ram(0x00000, ram_size - 1, ram); | |
265 | prg.unmap_readwrite(0x40000, 0xeffff); | |
266 | prg.install_ram(0x00000, ram_size - 1, ram); | |
267 | 267 | |
268 | 268 | m_maincpu->set_irq_acknowledge_callback(apricot_irq_ack); |
269 | 269 |
r18027 | r18028 | |
---|---|---|
296 | 296 | |
297 | 297 | void lc80_state::machine_start() |
298 | 298 | { |
299 | address_space | |
299 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
300 | 300 | |
301 | 301 | /* setup memory banking */ |
302 | 302 | membank("bank1")->configure_entry(0, memregion(Z80_TAG)->base()); // TODO |
r18027 | r18028 | |
314 | 314 | membank("bank4")->configure_entry(0, memregion(Z80_TAG)->base() + 0x2000); |
315 | 315 | membank("bank4")->set_entry(0); |
316 | 316 | |
317 | program->install_readwrite_bank(0x0000, 0x07ff, "bank1"); | |
318 | program->install_readwrite_bank(0x0800, 0x0fff, "bank2"); | |
319 | program->install_readwrite_bank(0x1000, 0x17ff, "bank3"); | |
317 | program.install_readwrite_bank(0x0000, 0x07ff, "bank1"); | |
318 | program.install_readwrite_bank(0x0800, 0x0fff, "bank2"); | |
319 | program.install_readwrite_bank(0x1000, 0x17ff, "bank3"); | |
320 | 320 | |
321 | 321 | switch (m_ram->size()) |
322 | 322 | { |
323 | 323 | case 1*1024: |
324 | program->install_readwrite_bank(0x2000, 0x23ff, "bank4"); | |
325 | program->unmap_readwrite(0x2400, 0x2fff); | |
324 | program.install_readwrite_bank(0x2000, 0x23ff, "bank4"); | |
325 | program.unmap_readwrite(0x2400, 0x2fff); | |
326 | 326 | break; |
327 | 327 | |
328 | 328 | case 2*1024: |
329 | program->install_readwrite_bank(0x2000, 0x27ff, "bank4"); | |
330 | program->unmap_readwrite(0x2800, 0x2fff); | |
329 | program.install_readwrite_bank(0x2000, 0x27ff, "bank4"); | |
330 | program.unmap_readwrite(0x2800, 0x2fff); | |
331 | 331 | break; |
332 | 332 | |
333 | 333 | case 3*1024: |
334 | program->install_readwrite_bank(0x2000, 0x2bff, "bank4"); | |
335 | program->unmap_readwrite(0x2c00, 0x2fff); | |
334 | program.install_readwrite_bank(0x2000, 0x2bff, "bank4"); | |
335 | program.unmap_readwrite(0x2c00, 0x2fff); | |
336 | 336 | break; |
337 | 337 | |
338 | 338 | case 4*1024: |
339 | program | |
339 | program.install_readwrite_bank(0x2000, 0x2fff, "bank4"); | |
340 | 340 | break; |
341 | 341 | } |
342 | 342 |
r18027 | r18028 | |
---|---|---|
525 | 525 | DRIVER_INIT_MEMBER(rx78_state,rx78) |
526 | 526 | { |
527 | 527 | UINT32 ram_size = machine().device<ram_device>(RAM_TAG)->size(); |
528 | address_space | |
528 | address_space &prg = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
529 | 529 | |
530 | 530 | if(ram_size == 0x4000) |
531 | prg | |
531 | prg.unmap_readwrite(0x6000, 0xafff); | |
532 | 532 | } |
533 | 533 | |
534 | 534 | /* Driver */ |
r18027 | r18028 | |
---|---|---|
706 | 706 | gp32_state *state = machine.driver_data<gp32_state>(); |
707 | 707 | UINT32 *regs = &state->m_s3c240x_dma_regs[dma<<3]; |
708 | 708 | UINT32 curr_tc, curr_src, curr_dst; |
709 | address_space &space = | |
709 | address_space &space = machine.device( "maincpu")->memory().space( AS_PROGRAM); | |
710 | 710 | int dsz, inc_src, inc_dst, servmode; |
711 | 711 | static const UINT32 ch_int[] = { INT_DMA0, INT_DMA1, INT_DMA2, INT_DMA3 }; |
712 | 712 | verboselog( machine, 5, "DMA %d trigger\n", dma); |
r18027 | r18028 | |
---|---|---|
993 | 993 | { |
994 | 994 | acan_dma_regs_t *acan_dma_regs = &m_acan_dma_regs; |
995 | 995 | int ch = (offset < 0x10/2) ? 0 : 1; |
996 | address_space | |
996 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
997 | 997 | |
998 | 998 | switch(offset) |
999 | 999 | { |
r18027 | r18028 | |
1039 | 1039 | { |
1040 | 1040 | if(data & 0x1000) |
1041 | 1041 | { |
1042 | mem | |
1042 | mem.write_word(acan_dma_regs->dest[ch], mem.read_word(acan_dma_regs->source[ch])); | |
1043 | 1043 | acan_dma_regs->dest[ch]+=2; |
1044 | 1044 | acan_dma_regs->source[ch]+=2; |
1045 | 1045 | if(data & 0x0100) |
r18027 | r18028 | |
1048 | 1048 | } |
1049 | 1049 | else |
1050 | 1050 | { |
1051 | mem | |
1051 | mem.write_byte(acan_dma_regs->dest[ch], mem.read_byte(acan_dma_regs->source[ch])); | |
1052 | 1052 | acan_dma_regs->dest[ch]++; |
1053 | 1053 | acan_dma_regs->source[ch]++; |
1054 | 1054 | } |
r18027 | r18028 | |
1128 | 1128 | |
1129 | 1129 | READ8_MEMBER( supracan_state::supracan_6502_soundmem_r ) |
1130 | 1130 | { |
1131 | address_space | |
1131 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
1132 | 1132 | UINT8 data = m_soundram[offset]; |
1133 | 1133 | |
1134 | 1134 | switch(offset) |
r18027 | r18028 | |
1140 | 1140 | |
1141 | 1141 | case 0x410: // Sound IRQ enable |
1142 | 1142 | data = m_sound_irq_enable_reg; |
1143 | if(!mem->debugger_access()) verboselog(m_hack_68k_to_6502_access ? "maincpu" : "soundcpu", machine(), 0, "supracan_soundreg_r: IRQ enable: %04x\n", data); | |
1144 | if(!mem->debugger_access()) | |
1143 | if(!mem.debugger_access()) verboselog(m_hack_68k_to_6502_access ? "maincpu" : "soundcpu", machine(), 0, "supracan_soundreg_r: IRQ enable: %04x\n", data); | |
1144 | if(!mem.debugger_access()) | |
1145 | 1145 | { |
1146 | 1146 | if(m_sound_irq_enable_reg & m_sound_irq_source_reg) |
1147 | 1147 | { |
r18027 | r18028 | |
1156 | 1156 | case 0x411: // Sound IRQ source |
1157 | 1157 | data = m_sound_irq_source_reg; |
1158 | 1158 | m_sound_irq_source_reg = 0; |
1159 | if(!mem->debugger_access()) verboselog(m_hack_68k_to_6502_access ? "maincpu" : "soundcpu", machine(), 3, "supracan_soundreg_r: IRQ source: %04x\n", data); | |
1160 | if(!mem->debugger_access()) | |
1159 | if(!mem.debugger_access()) verboselog(m_hack_68k_to_6502_access ? "maincpu" : "soundcpu", machine(), 3, "supracan_soundreg_r: IRQ source: %04x\n", data); | |
1160 | if(!mem.debugger_access()) | |
1161 | 1161 | { |
1162 | 1162 | machine().device("soundcpu")->execute().set_input_line(0, CLEAR_LINE); |
1163 | 1163 | } |
1164 | 1164 | break; |
1165 | 1165 | case 0x420: |
1166 | if(!mem | |
1166 | if(!mem.debugger_access()) verboselog(m_hack_68k_to_6502_access ? "maincpu" : "soundcpu", machine(), 3, "supracan_soundreg_r: Sound hardware status? (not yet implemented): %02x\n", 0); | |
1167 | 1167 | break; |
1168 | 1168 | case 0x422: |
1169 | if(!mem | |
1169 | if(!mem.debugger_access()) verboselog(m_hack_68k_to_6502_access ? "maincpu" : "soundcpu", machine(), 3, "supracan_soundreg_r: Sound hardware data? (not yet implemented): %02x\n", 0); | |
1170 | 1170 | break; |
1171 | 1171 | case 0x404: |
1172 | 1172 | case 0x405: |
r18027 | r18028 | |
1177 | 1177 | default: |
1178 | 1178 | if(offset >= 0x300 && offset < 0x500) |
1179 | 1179 | { |
1180 | if(!mem | |
1180 | if(!mem.debugger_access()) verboselog(m_hack_68k_to_6502_access ? "maincpu" : "soundcpu", machine(), 0, "supracan_soundreg_r: Unknown register %04x\n", offset); | |
1181 | 1181 | } |
1182 | 1182 | break; |
1183 | 1183 | } |
r18027 | r18028 | |
1357 | 1357 | |
1358 | 1358 | WRITE16_MEMBER( supracan_state::supracan_68k_soundram_w ) |
1359 | 1359 | { |
1360 | address_space | |
1360 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
1361 | 1361 | m_soundram[offset*2 + 1] = data & 0xff; |
1362 | 1362 | m_soundram[offset*2 + 0] = data >> 8; |
1363 | 1363 | |
r18027 | r18028 | |
1366 | 1366 | if(mem_mask & 0xff00) |
1367 | 1367 | { |
1368 | 1368 | m_hack_68k_to_6502_access = true; |
1369 | supracan_6502_soundmem_w( | |
1369 | supracan_6502_soundmem_w(mem, offset*2, data >> 8); | |
1370 | 1370 | m_hack_68k_to_6502_access = false; |
1371 | 1371 | } |
1372 | 1372 | if(mem_mask & 0x00ff) |
1373 | 1373 | { |
1374 | 1374 | m_hack_68k_to_6502_access = true; |
1375 | supracan_6502_soundmem_w( | |
1375 | supracan_6502_soundmem_w(mem, offset*2 + 1, data & 0xff); | |
1376 | 1376 | m_hack_68k_to_6502_access = false; |
1377 | 1377 | } |
1378 | 1378 | } |
r18027 | r18028 | |
1380 | 1380 | |
1381 | 1381 | READ16_MEMBER( supracan_state::supracan_68k_soundram_r ) |
1382 | 1382 | { |
1383 | address_space | |
1383 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
1384 | 1384 | UINT16 val = m_soundram[offset*2 + 0] << 8; |
1385 | 1385 | val |= m_soundram[offset*2 + 1]; |
1386 | 1386 | |
r18027 | r18028 | |
1390 | 1390 | if(mem_mask & 0xff00) |
1391 | 1391 | { |
1392 | 1392 | m_hack_68k_to_6502_access = true; |
1393 | val |= supracan_6502_soundmem_r( | |
1393 | val |= supracan_6502_soundmem_r(mem, offset*2) << 8; | |
1394 | 1394 | m_hack_68k_to_6502_access = false; |
1395 | 1395 | } |
1396 | 1396 | if(mem_mask & 0x00ff) |
1397 | 1397 | { |
1398 | 1398 | m_hack_68k_to_6502_access = true; |
1399 | val |= supracan_6502_soundmem_r( | |
1399 | val |= supracan_6502_soundmem_r(mem, offset*2 + 1); | |
1400 | 1400 | m_hack_68k_to_6502_access = false; |
1401 | 1401 | } |
1402 | 1402 | } |
r18027 | r18028 | |
1454 | 1454 | |
1455 | 1455 | READ16_MEMBER( supracan_state::supracan_video_r ) |
1456 | 1456 | { |
1457 | address_space | |
1457 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
1458 | 1458 | UINT16 data = m_video_regs[offset]; |
1459 | 1459 | |
1460 | 1460 | switch(offset) |
1461 | 1461 | { |
1462 | 1462 | case 0x00/2: // Video IRQ flags |
1463 | if(!mem | |
1463 | if(!mem.debugger_access()) | |
1464 | 1464 | { |
1465 | 1465 | //verboselog("maincpu", machine(), 0, "read video IRQ flags (%04x)\n", data); |
1466 | 1466 | m_maincpu->set_input_line(7, CLEAR_LINE); |
r18027 | r18028 | |
1472 | 1472 | data = 0; |
1473 | 1473 | break; |
1474 | 1474 | case 0x100/2: |
1475 | if(!mem | |
1475 | if(!mem.debugger_access()) verboselog("maincpu", machine(), 0, "read tilemap_flags[0] (%04x)\n", data); | |
1476 | 1476 | break; |
1477 | 1477 | case 0x106/2: |
1478 | if(!mem | |
1478 | if(!mem.debugger_access()) verboselog("maincpu", machine(), 0, "read tilemap_scrolly[0] (%04x)\n", data); | |
1479 | 1479 | break; |
1480 | 1480 | case 0x120/2: |
1481 | if(!mem | |
1481 | if(!mem.debugger_access()) verboselog("maincpu", machine(), 0, "read tilemap_flags[1] (%04x)\n", data); | |
1482 | 1482 | break; |
1483 | 1483 | default: |
1484 | if(!mem | |
1484 | if(!mem.debugger_access()) verboselog("maincpu", machine(), 0, "supracan_video_r: Unknown register: %08x (%04x & %04x)\n", 0xf00000 + (offset << 1), data, mem_mask); | |
1485 | 1485 | break; |
1486 | 1486 | } |
1487 | 1487 | |
r18027 | r18028 | |
1557 | 1557 | |
1558 | 1558 | WRITE16_MEMBER( supracan_state::supracan_video_w ) |
1559 | 1559 | { |
1560 | address_space | |
1560 | address_space &mem = m_maincpu->space(AS_PROGRAM); | |
1561 | 1561 | acan_sprdma_regs_t *acan_sprdma_regs = &m_acan_sprdma_regs; |
1562 | 1562 | int i; |
1563 | 1563 | |
r18027 | r18028 | |
1618 | 1618 | { |
1619 | 1619 | if(data & 0x0100) //dma 0x00 fill (or fixed value?) |
1620 | 1620 | { |
1621 | mem | |
1621 | mem.write_word(acan_sprdma_regs->dst, 0); | |
1622 | 1622 | acan_sprdma_regs->dst+=2 * acan_sprdma_regs->dst_inc; |
1623 | 1623 | //memset(supracan_vram,0x00,0x020000); |
1624 | 1624 | } |
1625 | 1625 | else |
1626 | 1626 | { |
1627 | mem | |
1627 | mem.write_word(acan_sprdma_regs->dst, mem.read_word(acan_sprdma_regs->src)); | |
1628 | 1628 | acan_sprdma_regs->dst+=2 * acan_sprdma_regs->dst_inc; |
1629 | 1629 | acan_sprdma_regs->src+=2 * acan_sprdma_regs->src_inc; |
1630 | 1630 | } |
r18027 | r18028 | |
---|---|---|
101 | 101 | static UINT32 scsi53c810_fetch(running_machine &machine, UINT32 dsp) |
102 | 102 | { |
103 | 103 | UINT32 result; |
104 | result = machine.device("ppc1")->memory().space(AS_PROGRAM) | |
104 | result = machine.device("ppc1")->memory().space(AS_PROGRAM).read_dword(dsp & 0x7FFFFFFF); | |
105 | 105 | return BYTE_REVERSE32(result); |
106 | 106 | } |
107 | 107 |
r18027 | r18028 | |
---|---|---|
166 | 166 | |
167 | 167 | QUICKLOAD_LOAD( cd2650 ) |
168 | 168 | { |
169 | address_space &space = | |
169 | address_space &space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM); | |
170 | 170 | int i; |
171 | 171 | int quick_addr = 0x440; |
172 | 172 | int exec_addr; |
r18027 | r18028 | |
---|---|---|
117 | 117 | |
118 | 118 | void tek4051_state::bankswitch(UINT8 data) |
119 | 119 | { |
120 | address_space | |
120 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
121 | 121 | |
122 | 122 | //int d = data & 0x07; |
123 | 123 | int lbs = (data >> 3) & 0x07; |
r18027 | r18028 | |
125 | 125 | switch (lbs) |
126 | 126 | { |
127 | 127 | case LBS_RBC: |
128 | program | |
128 | program.install_rom(0x8800, 0xa7ff, memregion(MC6800_TAG)->base() + 0x800); | |
129 | 129 | break; |
130 | 130 | |
131 | 131 | case LBS_BSOFL: |
132 | program | |
132 | program.install_rom(0x8800, 0xa7ff, memregion("020_0147_00")->base()); | |
133 | 133 | break; |
134 | 134 | |
135 | 135 | case LBS_BSCOM: |
136 | program | |
136 | program.install_rom(0x8800, 0xa7ff, memregion("672_0799_08")->base()); | |
137 | 137 | break; |
138 | 138 | |
139 | 139 | default: |
140 | program | |
140 | program.unmap_readwrite(0x8800, 0xa7ff); | |
141 | 141 | } |
142 | 142 | } |
143 | 143 | |
r18027 | r18028 | |
1167 | 1167 | |
1168 | 1168 | void tek4051_state::machine_start() |
1169 | 1169 | { |
1170 | address_space | |
1170 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
1171 | 1171 | |
1172 | 1172 | // configure RAM |
1173 | 1173 | switch (m_ram->size()) |
1174 | 1174 | { |
1175 | 1175 | case 8*1024: |
1176 | program | |
1176 | program.unmap_readwrite(0x2000, 0x7fff); | |
1177 | 1177 | break; |
1178 | 1178 | |
1179 | 1179 | case 16*1024: |
1180 | program | |
1180 | program.unmap_readwrite(0x4000, 0x7fff); | |
1181 | 1181 | break; |
1182 | 1182 | |
1183 | 1183 | case 24*1024: |
1184 | program | |
1184 | program.unmap_readwrite(0x6000, 0x7fff); | |
1185 | 1185 | break; |
1186 | 1186 | } |
1187 | 1187 |
r18027 | r18028 | |
---|---|---|
32 | 32 | |
33 | 33 | UINT32 f1_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
34 | 34 | { |
35 | address_space | |
35 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
36 | 36 | int lines = m_200_256 ? 200 : 256; |
37 | 37 | |
38 | 38 | for (int y = 0; y < lines; y++) |
r18027 | r18028 | |
41 | 41 | |
42 | 42 | for (int sx = 0; sx < 80; sx++) |
43 | 43 | { |
44 | UINT16 data = program | |
44 | UINT16 data = program.read_word(addr); | |
45 | 45 | |
46 | 46 | if (m_40_80) |
47 | 47 | { |
r18027 | r18028 | |
---|---|---|
337 | 337 | |
338 | 338 | |
339 | 339 | /* install expansion memory*/ |
340 | address_space | |
340 | address_space &program = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
341 | 341 | UINT8 *ram = machine().device<ram_device>(RAM_TAG)->pointer(); |
342 | 342 | UINT16 ram_size = machine().device<ram_device>(RAM_TAG)->size(); |
343 | 343 | |
344 | 344 | if (ram_size > 0x4000) |
345 | program | |
345 | program.install_ram(0x8000, 0x3fff + ram_size, ram); | |
346 | 346 | } |
347 | 347 | |
348 | 348 |
r18027 | r18028 | |
---|---|---|
121 | 121 | { |
122 | 122 | // rom BAS0 |
123 | 123 | state->membank("bank1")->set_base(state->memregion("maincpu")->base() + 0x0000); /* BAS0 ROM */ |
124 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
124 | machine.device("maincpu")->memory().space(AS_PROGRAM).nop_write(0x0000, 0x1fff); | |
125 | 125 | state->m_ram_at_0000 = 0; |
126 | 126 | } |
127 | 127 | else if (!BIT(cs,4)) |
128 | 128 | { |
129 | 129 | // rom BOOT |
130 | 130 | state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x4000); /* BOOT ROM */ |
131 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
131 | machine.device("maincpu")->memory().space(AS_PROGRAM).nop_write(0x0000, 0x1fff); | |
132 | 132 | state->m_ram_at_0000 = 0; |
133 | 133 | } |
134 | 134 | else |
135 | 135 | { |
136 | 136 | // RAM |
137 | 137 | state->membank("bank1")->set_base(messram); |
138 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
138 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(0x0000, 0x1fff, "bank1"); | |
139 | 139 | state->m_ram_at_0000 = 1; |
140 | 140 | } |
141 | 141 | |
r18027 | r18028 | |
143 | 143 | if (!BIT(cs,1)) |
144 | 144 | { |
145 | 145 | state->membank("bank2")->set_base(machine.root_device().memregion("maincpu")->base() + 0x2000); /* BAS1 ROM */ |
146 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
146 | machine.device("maincpu")->memory().space(AS_PROGRAM).nop_write(0x2000, 0x3fff); | |
147 | 147 | } |
148 | 148 | else |
149 | 149 | { |
150 | 150 | state->membank("bank2")->set_base(messram + 0x2000); /* RAM */ |
151 | machine.device("maincpu")->memory().space(AS_PROGRAM) | |
151 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(0x2000, 0x3fff, "bank2"); | |
152 | 152 | } |
153 | 153 | |
154 | 154 | if (BIT(ls175,2)) |
r18027 | r18028 | |
524 | 524 | // this is a reset of ls175 in mmu |
525 | 525 | elwro800jr_mmu_w(machine(), 0); |
526 | 526 | |
527 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
527 | machine().device("maincpu")->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(elwro800_state::elwro800_direct_handler), this)); | |
528 | 528 | } |
529 | 529 | |
530 | 530 | static const cassette_interface elwro800jr_cassette_interface = |
r18027 | r18028 | |
---|---|---|
118 | 118 | void ms0515_state::machine_reset() |
119 | 119 | { |
120 | 120 | UINT8 *ram = machine().device<ram_device>(RAM_TAG)->pointer(); |
121 | ms0515_bank_w( | |
121 | ms0515_bank_w(machine().driver_data()->generic_space(),0,0); | |
122 | 122 | |
123 | 123 | m_video_ram = ram + 0000000 + 0340000; |
124 | 124 | m_blink = 0; |
r18027 | r18028 | |
---|---|---|
174 | 174 | |
175 | 175 | void mstation_state::refresh_memory(UINT8 bank, UINT8 chip_select) |
176 | 176 | { |
177 | address_space | |
177 | address_space& program = m_maincpu->space(AS_PROGRAM); | |
178 | 178 | int &active_flash = (bank == 1 ? m_flash_at_0x4000 : m_flash_at_0x8000); |
179 | 179 | char bank_tag[6]; |
180 | 180 | |
r18027 | r18028 | |
185 | 185 | if (active_flash < 0) |
186 | 186 | { |
187 | 187 | if (bank == 1) |
188 | program | |
188 | program.install_readwrite_handler(0x4000, 0x7fff, 0, 0, read8_delegate(FUNC(mstation_state::flash_0x4000_read_handler), this), write8_delegate(FUNC(mstation_state::flash_0x4000_write_handler), this)); | |
189 | 189 | else |
190 | program | |
190 | program.install_readwrite_handler(0x8000, 0xbfff, 0, 0, read8_delegate(FUNC(mstation_state::flash_0x8000_read_handler), this), write8_delegate(FUNC(mstation_state::flash_0x8000_write_handler), this)); | |
191 | 191 | } |
192 | 192 | |
193 | 193 | active_flash = chip_select ? 1 : 0; |
r18027 | r18028 | |
195 | 195 | case 1: // banked RAM |
196 | 196 | sprintf(bank_tag,"bank%d", bank); |
197 | 197 | membank(bank_tag)->set_base(m_ram_base + (((bank == 1 ? m_bank1[0] : m_bank2[0]) & 0x07)<<14)); |
198 | program | |
198 | program.install_readwrite_bank (bank * 0x4000, bank * 0x4000 + 0x3fff, bank_tag); | |
199 | 199 | active_flash = -1; |
200 | 200 | break; |
201 | 201 | case 2: // left LCD panel |
202 | program | |
202 | program.install_readwrite_handler(bank * 0x4000, bank * 0x4000 + 0x3fff, 0, 0, read8_delegate(FUNC(mstation_state::lcd_left_r), this), write8_delegate(FUNC(mstation_state::lcd_left_w), this)); | |
203 | 203 | active_flash = -1; |
204 | 204 | break; |
205 | 205 | case 4: // right LCD panel |
206 | program | |
206 | program.install_readwrite_handler(bank * 0x4000, bank * 0x4000 + 0x3fff, 0, 0, read8_delegate(FUNC(mstation_state::lcd_right_r), this), write8_delegate(FUNC(mstation_state::lcd_right_w), this)); | |
207 | 207 | active_flash = -1; |
208 | 208 | break; |
209 | 209 | default: |
210 | 210 | logerror("Unknown chip %02x mapped at %04x - %04x\n", chip_select, bank * 0x4000, bank * 0x4000 + 0x3fff); |
211 | program | |
211 | program.unmap_readwrite(bank * 0x4000, bank * 0x4000 + 0x3fff); | |
212 | 212 | active_flash = -1; |
213 | 213 | break; |
214 | 214 | } |
r18027 | r18028 | |
---|---|---|
65 | 65 | |
66 | 66 | READ8_MEMBER(pcfx_state::extio_r) |
67 | 67 | { |
68 | address_space | |
68 | address_space &io_space = m_maincpu->space(AS_IO); | |
69 | 69 | |
70 | return io_space | |
70 | return io_space.read_byte(offset); | |
71 | 71 | } |
72 | 72 | |
73 | 73 | WRITE8_MEMBER(pcfx_state::extio_w) |
74 | 74 | { |
75 | address_space | |
75 | address_space &io_space = m_maincpu->space(AS_IO); | |
76 | 76 | |
77 | io_space | |
77 | io_space.write_byte(offset, data); | |
78 | 78 | } |
79 | 79 | |
80 | 80 | static ADDRESS_MAP_START( pcfx_mem, AS_PROGRAM, 32, pcfx_state ) |
r18027 | r18028 | |
---|---|---|
113 | 113 | { |
114 | 114 | UINT32 ram_size = machine().device<ram_device>(RAM_TAG)->size(); |
115 | 115 | |
116 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
116 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler( 0x02000000, 0x02000000+(ram_size-1), read32_delegate(FUNC(a310_state::a310_psy_wram_r), this), write32_delegate(FUNC(a310_state::a310_psy_wram_w), this)); | |
117 | 117 | |
118 | 118 | archimedes_driver_init(machine()); |
119 | 119 | } |
r18027 | r18028 | |
---|---|---|
158 | 158 | |
159 | 159 | void avigo_state::refresh_memory(UINT8 bank, UINT8 chip_select) |
160 | 160 | { |
161 | address_space& space = | |
161 | address_space& space = m_maincpu->space(AS_PROGRAM); | |
162 | 162 | int &active_flash = (bank == 1 ? m_flash_at_0x4000 : m_flash_at_0x8000); |
163 | 163 | char bank_tag[6]; |
164 | 164 | |
r18027 | r18028 | |
246 | 246 | /* if is a cold start initialize flash contents */ |
247 | 247 | if (!m_warm_start) |
248 | 248 | { |
249 | memcpy(m_flashes[0]->space()->get_read_ptr(0), memregion("bios")->base() + 0x000000, 0x100000); | |
250 | memcpy(m_flashes[1]->space()->get_read_ptr(0), memregion("bios")->base() + 0x100000, 0x100000); | |
249 | memcpy(m_flashes[0]->space().get_read_ptr(0), memregion("bios")->base() + 0x000000, 0x100000); | |
250 | memcpy(m_flashes[1]->space().get_read_ptr(0), memregion("bios")->base() + 0x100000, 0x100000); | |
251 | 251 | } |
252 | 252 | |
253 | 253 | m_irq = 0; |
r18027 | r18028 | |
293 | 293 | save_item(NAME(m_warm_start)); |
294 | 294 | |
295 | 295 | // save all flash contents |
296 | save_pointer(NAME((UINT8*)m_flashes[0]->space()->get_read_ptr(0)), 0x100000); | |
297 | save_pointer(NAME((UINT8*)m_flashes[1]->space()->get_read_ptr(0)), 0x100000); | |
298 | save_pointer(NAME((UINT8*)m_flashes[2]->space()->get_read_ptr(0)), 0x100000); | |
296 | save_pointer(NAME((UINT8*)m_flashes[0]->space().get_read_ptr(0)), 0x100000); | |
297 | save_pointer(NAME((UINT8*)m_flashes[1]->space().get_read_ptr(0)), 0x100000); | |
298 | save_pointer(NAME((UINT8*)m_flashes[2]->space().get_read_ptr(0)), 0x100000); | |
299 | 299 | |
300 | 300 | // register postload callback |
301 | 301 | machine().save().register_postload(save_prepost_delegate(FUNC(avigo_state::postload), this)); |
r18027 | r18028 | |
830 | 830 | static QUICKLOAD_LOAD(avigo) |
831 | 831 | { |
832 | 832 | avigo_state *state = image.device().machine().driver_data<avigo_state>(); |
833 | address_space | |
833 | address_space& flash1 = state->m_flashes[1]->space(0); | |
834 | 834 | const char *systemname = image.device().machine().system().name; |
835 | 835 | UINT32 first_app_page = (0x50000>>14); |
836 | 836 | int app_page; |
r18027 | r18028 | |
846 | 846 | |
847 | 847 | for (int offset=0; offset<0x4000; offset++) |
848 | 848 | { |
849 | if (flash1 | |
849 | if (flash1.read_byte((app_page<<14) + offset) != 0xff) | |
850 | 850 | { |
851 | 851 | empty_page = false; |
852 | 852 | break; |
r18027 | r18028 | |
863 | 863 | logerror("Application loaded at 0x%05x-0x%05x\n", app_page<<14, (app_page<<14) + (UINT32)image.length()); |
864 | 864 | |
865 | 865 | // copy app file into flash memory |
866 | image.fread((UINT8*)state->m_flashes[1]->space() | |
866 | image.fread((UINT8*)state->m_flashes[1]->space().get_read_ptr(app_page<<14), image.length()); | |
867 | 867 | |
868 | 868 | // update the application ID |
869 | flash1 | |
869 | flash1.write_byte((app_page<<14) + 0x1a5, 0x80 + (app_page - (first_app_page>>14))); | |
870 | 870 | |
871 | 871 | // reset the CPU for allow at the Avigo OS to recognize the installed app |
872 | 872 | state->m_warm_start = 1; |
r18027 | r18028 | |
---|---|---|
840 | 840 | |
841 | 841 | DRIVER_INIT_MEMBER(mpz80_state,mpz80) |
842 | 842 | { |
843 | address_space *program = machine().device<cpu_device>(Z80_TAG)->space(AS_PROGRAM); | |
844 | program->set_direct_update_handler(direct_update_delegate(FUNC(mpz80_state::mpz80_direct_update_handler), this)); | |
843 | address_space &program = machine().device<cpu_device>(Z80_TAG)->space(AS_PROGRAM); | |
844 | program.set_direct_update_handler(direct_update_delegate(FUNC(mpz80_state::mpz80_direct_update_handler), this)); | |
845 | 845 | } |
846 | 846 | |
847 | 847 |
r18027 | r18028 | |
---|---|---|
30 | 30 | |
31 | 31 | void super6_state::bankswitch() |
32 | 32 | { |
33 | address_space | |
33 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
34 | 34 | UINT8 *ram = m_ram->pointer(); |
35 | 35 | UINT8 *rom = memregion(Z80_TAG)->base(); |
36 | 36 | |
37 | 37 | // power on jump |
38 | if (!BIT(m_bank0, 6)) { program | |
38 | if (!BIT(m_bank0, 6)) { program.install_rom(0x0000, 0x07ff, 0, 0xf800, rom); return; } | |
39 | 39 | |
40 | 40 | // first 64KB of memory |
41 | program | |
41 | program.install_ram(0x0000, 0xffff, ram); | |
42 | 42 | |
43 | 43 | // second 64KB of memory |
44 | 44 | int map = (m_bank1 >> 4) & 0x07; |
r18027 | r18028 | |
46 | 46 | switch (map) |
47 | 47 | { |
48 | 48 | case 0: |
49 | if (BIT(m_bank1, 0)) program->install_ram(0x0000, 0x3fff, ram + 0x10000); | |
50 | if (BIT(m_bank1, 1)) program->install_ram(0x4000, 0x7fff, ram + 0x14000); | |
51 | if (BIT(m_bank1, 2)) program->install_ram(0x8000, 0xbfff, ram + 0x18000); | |
52 | if (BIT(m_bank1, 3)) program->install_ram(0xc000, 0xffff, ram + 0x1c000); | |
49 | if (BIT(m_bank1, 0)) program.install_ram(0x0000, 0x3fff, ram + 0x10000); | |
50 | if (BIT(m_bank1, 1)) program.install_ram(0x4000, 0x7fff, ram + 0x14000); | |
51 | if (BIT(m_bank1, 2)) program.install_ram(0x8000, 0xbfff, ram + 0x18000); | |
52 | if (BIT(m_bank1, 3)) program.install_ram(0xc000, 0xffff, ram + 0x1c000); | |
53 | 53 | break; |
54 | 54 | |
55 | 55 | case 1: |
56 | if (BIT(m_bank1, 0)) program->install_ram(0x0000, 0x3fff, ram + 0x10000); | |
57 | if (BIT(m_bank1, 1)) program->install_ram(0x4000, 0x7fff, ram + 0x14000); | |
58 | if (BIT(m_bank1, 2)) program->install_ram(0x8000, 0xbfff, ram + 0x18000); | |
59 | if (BIT(m_bank1, 3)) program->install_ram(0xc000, 0xffff, ram + 0x0000); | |
56 | if (BIT(m_bank1, 0)) program.install_ram(0x0000, 0x3fff, ram + 0x10000); | |
57 | if (BIT(m_bank1, 1)) program.install_ram(0x4000, 0x7fff, ram + 0x14000); | |
58 | if (BIT(m_bank1, 2)) program.install_ram(0x8000, 0xbfff, ram + 0x18000); | |
59 | if (BIT(m_bank1, 3)) program.install_ram(0xc000, 0xffff, ram + 0x0000); | |
60 | 60 | break; |
61 | 61 | |
62 | 62 | case 2: |
63 | if (BIT(m_bank1, 0)) program->install_ram(0x0000, 0x3fff, ram + 0x10000); | |
64 | if (BIT(m_bank1, 1)) program->install_ram(0x4000, 0x7fff, ram + 0x14000); | |
65 | if (BIT(m_bank1, 2)) program->install_ram(0x8000, 0xbfff, ram + 0x4000); | |
66 | if (BIT(m_bank1, 3)) program->install_ram(0xc000, 0xffff, ram + 0x1c000); | |
63 | if (BIT(m_bank1, 0)) program.install_ram(0x0000, 0x3fff, ram + 0x10000); | |
64 | if (BIT(m_bank1, 1)) program.install_ram(0x4000, 0x7fff, ram + 0x14000); | |
65 | if (BIT(m_bank1, 2)) program.install_ram(0x8000, 0xbfff, ram + 0x4000); | |
66 | if (BIT(m_bank1, 3)) program.install_ram(0xc000, 0xffff, ram + 0x1c000); | |
67 | 67 | break; |
68 | 68 | |
69 | 69 | case 3: |
70 | if (BIT(m_bank1, 0)) program->install_ram(0x0000, 0x3fff, ram + 0x10000); | |
71 | if (BIT(m_bank1, 1)) program->install_ram(0x4000, 0x7fff, ram + 0x14000); | |
72 | if (BIT(m_bank1, 2)) program->install_ram(0x8000, 0xbfff, ram + 0x0000); | |
73 | if (BIT(m_bank1, 3)) program->install_ram(0xc000, 0xffff, ram + 0x4000); | |
70 | if (BIT(m_bank1, 0)) program.install_ram(0x0000, 0x3fff, ram + 0x10000); | |
71 | if (BIT(m_bank1, 1)) program.install_ram(0x4000, 0x7fff, ram + 0x14000); | |
72 | if (BIT(m_bank1, 2)) program.install_ram(0x8000, 0xbfff, ram + 0x0000); | |
73 | if (BIT(m_bank1, 3)) program.install_ram(0xc000, 0xffff, ram + 0x4000); | |
74 | 74 | break; |
75 | 75 | |
76 | 76 | case 4: |
77 | if (BIT(m_bank1, 0)) program->install_ram(0x0000, 0x3fff, ram + 0xc000); | |
78 | if (BIT(m_bank1, 1)) program->install_ram(0x4000, 0x7fff, ram + 0x14000); | |
79 | if (BIT(m_bank1, 2)) program->install_ram(0x8000, 0xbfff, ram + 0x18000); | |
80 | if (BIT(m_bank1, 3)) program->install_ram(0xc000, 0xffff, ram + 0x1c000); | |
77 | if (BIT(m_bank1, 0)) program.install_ram(0x0000, 0x3fff, ram + 0xc000); | |
78 | if (BIT(m_bank1, 1)) program.install_ram(0x4000, 0x7fff, ram + 0x14000); | |
79 | if (BIT(m_bank1, 2)) program.install_ram(0x8000, 0xbfff, ram + 0x18000); | |
80 | if (BIT(m_bank1, 3)) program.install_ram(0xc000, 0xffff, ram + 0x1c000); | |
81 | 81 | break; |
82 | 82 | } |
83 | 83 | |
84 | 84 | // bank 0 overrides |
85 | if (BIT(m_bank0, 0)) program->install_ram(0x0000, 0x3fff, ram + 0x0000); | |
86 | if (BIT(m_bank0, 1)) program->install_ram(0x4000, 0x7fff, ram + 0x4000); | |
87 | if (BIT(m_bank0, 2)) program->install_ram(0x8000, 0xbfff, ram + 0x8000); | |
88 | if (BIT(m_bank0, 3)) program->install_ram(0xc000, 0xffff, ram + 0xc000); | |
85 | if (BIT(m_bank0, 0)) program.install_ram(0x0000, 0x3fff, ram + 0x0000); | |
86 | if (BIT(m_bank0, 1)) program.install_ram(0x4000, 0x7fff, ram + 0x4000); | |
87 | if (BIT(m_bank0, 2)) program.install_ram(0x8000, 0xbfff, ram + 0x8000); | |
88 | if (BIT(m_bank0, 3)) program.install_ram(0xc000, 0xffff, ram + 0xc000); | |
89 | 89 | |
90 | 90 | // PROM enabled |
91 | if (!BIT(m_bank0, 5)) program | |
91 | if (!BIT(m_bank0, 5)) program.install_rom(0xf000, 0xf7ff, 0, 0x800, rom); | |
92 | 92 | } |
93 | 93 | |
94 | 94 |
r18027 | r18028 | |
---|---|---|
848 | 848 | |
849 | 849 | READ8_MEMBER( c64_state::exp_dma_r ) |
850 | 850 | { |
851 | return m_maincpu->space(AS_PROGRAM) | |
851 | return m_maincpu->space(AS_PROGRAM).read_byte(offset); | |
852 | 852 | } |
853 | 853 | |
854 | 854 | WRITE8_MEMBER( c64_state::exp_dma_w ) |
855 | 855 | { |
856 | m_maincpu->space(AS_PROGRAM) | |
856 | m_maincpu->space(AS_PROGRAM).write_byte(offset, data); | |
857 | 857 | } |
858 | 858 | |
859 | 859 | WRITE_LINE_MEMBER( c64_state::exp_irq_w ) |
r18027 | r18028 | |
---|---|---|
445 | 445 | m_hw_version = m_HW1; |
446 | 446 | m_initial_pc = ((rom[2]) << 16) | rom[3]; |
447 | 447 | |
448 | m_maincpu->space(AS_PROGRAM) | |
448 | m_maincpu->space(AS_PROGRAM).unmap_read(0x200000, 0x5fffff); | |
449 | 449 | |
450 | 450 | if (m_initial_pc > 0x400000) |
451 | 451 | { |
452 | m_maincpu->space(AS_PROGRAM) | |
452 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x400000, 0x5fffff, 0, 0, read16_delegate(FUNC(ti68k_state::flash_r), this),write16_delegate(FUNC(ti68k_state::flash_w), this)); | |
453 | 453 | } |
454 | 454 | else |
455 | 455 | { |
456 | m_maincpu->space(AS_PROGRAM) | |
456 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x200000, 0x3fffff, 0, 0, read16_delegate(FUNC(ti68k_state::flash_r), this), write16_delegate(FUNC(ti68k_state::flash_w), this)); | |
457 | 457 | } |
458 | 458 | } |
459 | 459 | |
r18027 | r18028 | |
493 | 493 | for (y = 0; y < height; y++) |
494 | 494 | for (x = 0; x < width / 8; x++) |
495 | 495 | { |
496 | UINT8 s_byte= m_maincpu->space(AS_PROGRAM) | |
496 | UINT8 s_byte= m_maincpu->space(AS_PROGRAM).read_byte(m_lcd_base + y * (width/8) + x); | |
497 | 497 | for (b = 0; b<8; b++) |
498 | 498 | bitmap.pix16(y, x * 8 + (7 - b)) = BIT(s_byte, b); |
499 | 499 | } |
r18027 | r18028 | |
---|---|---|
143 | 143 | |
144 | 144 | void xerox820_state::bankswitch(int bank) |
145 | 145 | { |
146 | address_space | |
146 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
147 | 147 | UINT8 *ram = m_ram->pointer(); |
148 | 148 | |
149 | 149 | if (bank) |
150 | 150 | { |
151 | 151 | /* ROM */ |
152 | program->install_rom(0x0000, 0x0fff, memregion("monitor")->base()); | |
153 | program->unmap_readwrite(0x1000, 0x1fff); | |
154 | program->install_ram(0x3000, 0x3fff, m_video_ram); | |
152 | program.install_rom(0x0000, 0x0fff, memregion("monitor")->base()); | |
153 | program.unmap_readwrite(0x1000, 0x1fff); | |
154 | program.install_ram(0x3000, 0x3fff, m_video_ram); | |
155 | 155 | } |
156 | 156 | else |
157 | 157 | { |
158 | 158 | /* RAM */ |
159 | program | |
159 | program.install_ram(0x0000, 0x3fff, ram); | |
160 | 160 | } |
161 | 161 | } |
162 | 162 | |
163 | 163 | void xerox820ii_state::bankswitch(int bank) |
164 | 164 | { |
165 | address_space | |
165 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
166 | 166 | UINT8 *ram = m_ram->pointer(); |
167 | 167 | |
168 | 168 | if (bank) |
169 | 169 | { |
170 | 170 | /* ROM */ |
171 | program->install_rom(0x0000, 0x17ff, memregion("monitor")->base()); | |
172 | program->unmap_readwrite(0x1800, 0x2fff); | |
173 | program->install_ram(0x3000, 0x3fff, m_video_ram); | |
174 | program->unmap_readwrite(0x4000, 0xbfff); | |
171 | program.install_rom(0x0000, 0x17ff, memregion("monitor")->base()); | |
172 | program.unmap_readwrite(0x1800, 0x2fff); | |
173 | program.install_ram(0x3000, 0x3fff, m_video_ram); | |
174 | program.unmap_readwrite(0x4000, 0xbfff); | |
175 | 175 | } |
176 | 176 | else |
177 | 177 | { |
178 | 178 | /* RAM */ |
179 | program | |
179 | program.install_ram(0x0000, 0xbfff, ram); | |
180 | 180 | } |
181 | 181 | } |
182 | 182 |
r18027 | r18028 | |
---|---|---|
164 | 164 | if (data < 2) |
165 | 165 | { |
166 | 166 | membank("bank1")->set_entry(data); |
167 | m_maincpu->space(AS_PROGRAM) | |
167 | m_maincpu->space(AS_PROGRAM).unmap_write(0x0000, 0x7fff); | |
168 | 168 | } |
169 | 169 | else |
170 | 170 | { |
171 | 171 | membank("bank1")->set_entry((data <= m_banks_num) ? data : m_banks_num); |
172 | m_maincpu->space(AS_PROGRAM) | |
172 | m_maincpu->space(AS_PROGRAM).install_write_bank(0x0000, 0x7fff, "bank1"); | |
173 | 173 | } |
174 | 174 | } |
175 | 175 | |
r18027 | r18028 | |
342 | 342 | void micronic_state::machine_reset() |
343 | 343 | { |
344 | 344 | membank("bank1")->set_entry(0); |
345 | m_maincpu->space(AS_PROGRAM) | |
345 | m_maincpu->space(AS_PROGRAM).unmap_write(0x0000, 0x7fff); | |
346 | 346 | } |
347 | 347 | |
348 | 348 |
r18027 | r18028 | |
---|---|---|
339 | 339 | { |
340 | 340 | running_machine &machine = image.device().machine(); |
341 | 341 | vc4000_state *state = machine.driver_data<vc4000_state>(); |
342 | address_space | |
342 | address_space &memspace = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
343 | 343 | UINT32 size; |
344 | 344 | |
345 | 345 | if (image.software_entry() == NULL) |
r18027 | r18028 | |
352 | 352 | |
353 | 353 | if (size > 0x1000) /* 6k rom + 1k ram - Chess2 only */ |
354 | 354 | { |
355 | memspace | |
355 | memspace.install_read_bank(0x0800, 0x15ff, "bank1"); /* extra rom */ | |
356 | 356 | state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x1000); |
357 | 357 | |
358 | memspace | |
358 | memspace.install_readwrite_bank(0x1800, 0x1bff, "bank2"); /* ram */ | |
359 | 359 | state->membank("bank2")->set_base(machine.root_device().memregion("maincpu")->base() + 0x1800); |
360 | 360 | } |
361 | 361 | else if (size > 0x0800) /* some 4k roms have 1k of mirrored ram */ |
362 | 362 | { |
363 | memspace | |
363 | memspace.install_read_bank(0x0800, 0x0fff, "bank1"); /* extra rom */ | |
364 | 364 | state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x0800); |
365 | 365 | |
366 | memspace | |
366 | memspace.install_readwrite_bank(0x1000, 0x15ff, 0, 0x800, "bank2"); /* ram */ | |
367 | 367 | state->membank("bank2")->set_base(machine.root_device().memregion("maincpu")->base() + 0x1000); |
368 | 368 | } |
369 | 369 | else if (size == 0x0800) /* 2k roms + 2k ram - Hobby Module(Radofin) and elektor TVGC*/ |
370 | 370 | { |
371 | memspace | |
371 | memspace.install_readwrite_bank(0x0800, 0x0fff, "bank1"); /* ram */ | |
372 | 372 | state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x0800); |
373 | 373 | } |
374 | 374 | |
r18027 | r18028 | |
530 | 530 | |
531 | 531 | QUICKLOAD_LOAD(vc4000) |
532 | 532 | { |
533 | address_space &space = | |
533 | address_space &space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM); | |
534 | 534 | int i; |
535 | 535 | int quick_addr = 0x08c0; |
536 | 536 | int exec_addr; |
r18027 | r18028 | |
---|---|---|
252 | 252 | |
253 | 253 | void cosmicos_state::set_ram_mode() |
254 | 254 | { |
255 | address_space | |
255 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
256 | 256 | UINT8 *ram = m_ram->pointer(); |
257 | 257 | |
258 | 258 | if (m_ram_disable) |
259 | 259 | { |
260 | program | |
260 | program.unmap_readwrite(0xff00, 0xffff); | |
261 | 261 | } |
262 | 262 | else |
263 | 263 | { |
264 | 264 | if (m_ram_protect) |
265 | 265 | { |
266 | program | |
266 | program.install_rom(0xff00, 0xffff, ram); | |
267 | 267 | } |
268 | 268 | else |
269 | 269 | { |
270 | program | |
270 | program.install_ram(0xff00, 0xffff, ram); | |
271 | 271 | } |
272 | 272 | } |
273 | 273 | } |
r18027 | r18028 | |
486 | 486 | |
487 | 487 | void cosmicos_state::machine_start() |
488 | 488 | { |
489 | address_space | |
489 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
490 | 490 | |
491 | 491 | /* initialize LED display */ |
492 | 492 | m_led->rbi_w(1); |
r18027 | r18028 | |
495 | 495 | switch (m_ram->size()) |
496 | 496 | { |
497 | 497 | case 256: |
498 | program | |
498 | program.unmap_readwrite(0x0000, 0xbfff); | |
499 | 499 | break; |
500 | 500 | |
501 | 501 | case 4*1024: |
502 | program | |
502 | program.unmap_readwrite(0x1000, 0xbfff); | |
503 | 503 | break; |
504 | 504 | } |
505 | 505 | |
r18027 | r18028 | |
622 | 622 | |
623 | 623 | DRIVER_INIT_MEMBER(cosmicos_state,cosmicos) |
624 | 624 | { |
625 | address_space | |
625 | address_space &program = machine().device(CDP1802_TAG)->memory().space(AS_PROGRAM); | |
626 | 626 | |
627 | program | |
627 | program.set_direct_update_handler(direct_update_delegate(FUNC(cosmicos_state::cosmicos_direct_update_handler), this)); | |
628 | 628 | } |
629 | 629 | |
630 | 630 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
r18027 | r18028 | |
---|---|---|
124 | 124 | |
125 | 125 | READ8_MEMBER( vic10_state::vic_videoram_r ) |
126 | 126 | { |
127 | address_space | |
127 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
128 | 128 | |
129 | 129 | if (offset < 0x3000) |
130 | return program | |
130 | return program.read_byte(offset); | |
131 | 131 | |
132 | return program | |
132 | return program.read_byte(0xe000 + (offset & 0x1fff)); | |
133 | 133 | } |
134 | 134 | |
135 | 135 |
r18027 | r18028 | |
---|---|---|
154 | 154 | int ctrl; |
155 | 155 | int srcadd, dstadd; |
156 | 156 | UINT32 src, dst; |
157 | address_space &space = | |
157 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
158 | 158 | gba_state *state = machine.driver_data<gba_state>(); |
159 | 159 | |
160 | 160 | src = state->m_dma_src[ch]; |
r18027 | r18028 | |
3061 | 3061 | |
3062 | 3062 | if (cart_size <= (16 * 1024 * 1024)) |
3063 | 3063 | { |
3064 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xd000000, 0xdffffff, read32_delegate(FUNC(gba_state::eeprom_r),state)); | |
3065 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xd000000, 0xdffffff, write32_delegate(FUNC(gba_state::eeprom_w),state)); | |
3064 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xd000000, 0xdffffff, read32_delegate(FUNC(gba_state::eeprom_r),state)); | |
3065 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xd000000, 0xdffffff, write32_delegate(FUNC(gba_state::eeprom_w),state)); | |
3066 | 3066 | } |
3067 | 3067 | else |
3068 | 3068 | { |
3069 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xdffff00, 0xdffffff, read32_delegate(FUNC(gba_state::eeprom_r),state)); | |
3070 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xdffff00, 0xdffffff, write32_delegate(FUNC(gba_state::eeprom_w),state)); | |
3069 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xdffff00, 0xdffffff, read32_delegate(FUNC(gba_state::eeprom_r),state)); | |
3070 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xdffff00, 0xdffffff, write32_delegate(FUNC(gba_state::eeprom_w),state)); | |
3071 | 3071 | } |
3072 | 3072 | } |
3073 | 3073 | |
r18027 | r18028 | |
3076 | 3076 | state->m_nvptr = (UINT8 *)&state->m_gba_sram; |
3077 | 3077 | state->m_nvsize = 0x10000; |
3078 | 3078 | |
3079 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xe000000, 0xe00ffff, read32_delegate(FUNC(gba_state::sram_r),state)); | |
3080 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xe000000, 0xe00ffff, write32_delegate(FUNC(gba_state::sram_w),state)); | |
3079 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xe000000, 0xe00ffff, read32_delegate(FUNC(gba_state::sram_r),state)); | |
3080 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xe000000, 0xe00ffff, write32_delegate(FUNC(gba_state::sram_w),state)); | |
3081 | 3081 | } |
3082 | 3082 | |
3083 | 3083 | if (chip & GBA_CHIP_FLASH_1M) |
r18027 | r18028 | |
3087 | 3087 | state->m_flash_size = 0x20000; |
3088 | 3088 | state->m_flash_mask = 0x1ffff/4; |
3089 | 3089 | |
3090 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xe000000, 0xe01ffff, read32_delegate(FUNC(gba_state::flash_r),state)); | |
3091 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xe000000, 0xe01ffff, write32_delegate(FUNC(gba_state::flash_w),state)); | |
3090 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xe000000, 0xe01ffff, read32_delegate(FUNC(gba_state::flash_r),state)); | |
3091 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xe000000, 0xe01ffff, write32_delegate(FUNC(gba_state::flash_w),state)); | |
3092 | 3092 | } |
3093 | 3093 | |
3094 | 3094 | if ((chip & GBA_CHIP_FLASH) || (chip & GBA_CHIP_FLASH_512)) |
r18027 | r18028 | |
3098 | 3098 | state->m_flash_size = 0x10000; |
3099 | 3099 | state->m_flash_mask = 0xffff/4; |
3100 | 3100 | |
3101 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xe000000, 0xe00ffff, read32_delegate(FUNC(gba_state::flash_r),state)); | |
3102 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xe000000, 0xe00ffff, write32_delegate(FUNC(gba_state::flash_w),state)); | |
3101 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xe000000, 0xe00ffff, read32_delegate(FUNC(gba_state::flash_r),state)); | |
3102 | image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xe000000, 0xe00ffff, write32_delegate(FUNC(gba_state::flash_w),state)); | |
3103 | 3103 | } |
3104 | 3104 | |
3105 | 3105 | if (chip & GBA_CHIP_RTC) |
r18027 | r18028 | |
3204 | 3204 | |
3205 | 3205 | DRIVER_INIT_MEMBER(gba_state,gbadv) |
3206 | 3206 | { |
3207 | machine().device("maincpu")->memory().space(AS_PROGRAM) | |
3207 | machine().device("maincpu")->memory().space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(gba_state::gba_direct), this)); | |
3208 | 3208 | } |
3209 | 3209 | |
3210 | 3210 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */ |
r18027 | r18028 | |
---|---|---|
809 | 809 | |
810 | 810 | void vixen_state::machine_reset() |
811 | 811 | { |
812 | address_space | |
812 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
813 | 813 | |
814 | program->install_read_bank(0x0000, 0xefff, 0xfff, 0, "bank1"); | |
815 | program->install_write_bank(0x0000, 0xefff, 0xfff, 0, "bank2"); | |
814 | program.install_read_bank(0x0000, 0xefff, 0xfff, 0, "bank1"); | |
815 | program.install_write_bank(0x0000, 0xefff, 0xfff, 0, "bank2"); | |
816 | 816 | |
817 | 817 | membank("bank1")->set_entry(1); |
818 | 818 | membank("bank2")->set_entry(1); |
r18027 | r18028 | |
910 | 910 | { |
911 | 911 | if (m_reset) |
912 | 912 | { |
913 | address_space | |
913 | address_space &program = m_maincpu->space(AS_PROGRAM); | |
914 | 914 | |
915 | program->install_read_bank(0x0000, 0xefff, "bank1"); | |
916 | program->install_write_bank(0x0000, 0xefff, "bank2"); | |
915 | program.install_read_bank(0x0000, 0xefff, "bank1"); | |
916 | program.install_write_bank(0x0000, 0xefff, "bank2"); | |
917 | 917 | |
918 | 918 | membank("bank1")->set_entry(0); |
919 | 919 | membank("bank2")->set_entry(0); |
r18027 | r18028 | |
931 | 931 | |
932 | 932 | DRIVER_INIT_MEMBER(vixen_state,vixen) |
933 | 933 | { |
934 | address_space *program = machine().device<cpu_device>(Z8400A_TAG)->space(AS_PROGRAM); | |
935 | program->set_direct_update_handler(direct_update_delegate(FUNC(vixen_state::vixen_direct_update_handler), this)); | |
934 | address_space &program = machine().device<cpu_device>(Z8400A_TAG)->space(AS_PROGRAM); | |
935 | program.set_direct_update_handler(direct_update_delegate(FUNC(vixen_state::vixen_direct_update_handler), this)); | |
936 | 936 | } |
937 | 937 | |
938 | 938 |
Previous | 199869 Revisions | Next |