Previous 15994 Revisions Next

r2455 Thursday 24th April, 2008 at 12:00:53 UTC by Nathan Woods
Updated to MAME 0.124u4 core
[docs]messnew.txt
[src/emu]devconv.h emu.mak emuopts.c emupal.c memory.c memory.h romload.c sound.c ui.c validity.c video.c
[src/emu/cpu/adsp2100]adsp2100.c
[src/emu/cpu/alph8201]8201dasm.c alph8201.c
[src/emu/cpu/apexc]apexc.c
[src/emu/cpu/arm]arm.c
[src/emu/cpu/arm7]arm7.c
[src/emu/cpu/asap]asap.c
[src/emu/cpu/ccpu]ccpu.c
[src/emu/cpu/cop400]cop410.c cop420.c
[src/emu/cpu/dsp32]dsp32.c
[src/emu/cpu/dsp56k]dsp56k.c
[src/emu/cpu/e132xs]e132xs.c
[src/emu/cpu/f8]f8.c
[src/emu/cpu/g65816]g65816cm.h
[src/emu/cpu/h6280]h6280.c
[src/emu/cpu/h83002]h83002.c
[src/emu/cpu/i8039]i8039.c
[src/emu/cpu/i8051]i8051.c
[src/emu/cpu/i8085]i8085.c
[src/emu/cpu/i86]i286.c i86.c
[src/emu/cpu/i8x41]i8x41.c
[src/emu/cpu/i960]i960.c
[src/emu/cpu/konami]konami.c
[src/emu/cpu/lh5801]lh5801.c
[src/emu/cpu/m37710]m37710.c m37710cm.h
[src/emu/cpu/m6502]6502dasm.c m4510.c m6502.c m6509.c m65ce02.c
[src/emu/cpu/m6800]m6800.c
[src/emu/cpu/m68000]m68kmame.h
[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/minx]minx.c
[src/emu/cpu/mips]mdrc64.c mdrcold.c mips3.c mips3com.c psx.c r3000.c
[src/emu/cpu/nec]nec.c
[src/emu/cpu/pdp1]pdp1.c tx0.c
[src/emu/cpu/pic16c5x]pic16c5x.c
[src/emu/cpu/powerpc]ppc.c ppcdrc.c
[src/emu/cpu/s2650]s2650.c
[src/emu/cpu/saturn]saturn.c
[src/emu/cpu/sc61860]sc61860.c
[src/emu/cpu/se3208]se3208.c
[src/emu/cpu/sh2]sh2.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/ssp1601]ssp1601.c
[src/emu/cpu/t11]t11.c t11ops.c t11table.c
[src/emu/cpu/tlcs90]tlcs90.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/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/z80]z80.c
[src/emu/cpu/z8000]z8000.c
[src/emu/cpu/z80gb]z80gb.c
[src/emu/debug]debugcpu.c
[src/emu/machine]6522via.c 68681.c* 68681.h* 8042kbdc.c am53cf96.c idectrl.c microtch.c* microtch.h* msm6242.c smc91c9x.c z80dma.c
[src/emu/sound]2203intf.c 2203intf.h 2608intf.c 2608intf.h 2610intf.c ay8910.c ay8910.h c352.c disc_flt.c es5503.c es5506.c fm.c scsp.c
[src/emu/video]generic.c voodoo.c
[src/lib/util]sha1.c
[src/mame]mame.mak mamedriv.c
[src/mame/audio]amiga.c aztarac.c cage.c carnival.c cchasm.c cclimber.c cinemat.c cps3.c cyberbal.c dcs.c exidy.c harddriv.c irem.c jedi.c leland.c mario.c mcr.c redalert.c scramble.c segag80r.c seibu.c spacefb.c starwars.c system16.c taito_en.c taitosnd.c timeplt.c trackfld.c
[src/mame/drivers]1942.c 40love.c 88games.c acommand.c aeroboto.c aerofgt.c airbustr.c aliens.c alpha68k.c ambush.c ampoker2.c angelkds.c aquarium.c arabian.c argus.c arkanoid.c armedf.c ashnojoe.c asterix.c astinvad.c astrocde.c atarigt.c atarigx2.c atarisy2.c atetris.c aztarac.c badlands.c bagman.c baraduke.c battlane.c battlnts.c bbusters.c beathead.c bfcobra.c bfm_sc2.c bigevglf.c bigfghtr.c bishjan.c bking.c bladestl.c blktiger.c blockhl.c blueprnt.c bmcbowl.c bottom9.c boxer.c btoads.c bublbobl.c buggychl.c bwidow.c bwing.c cabal.c capbowl.c carrera.c cave.c cbuster.c ccastles.c cclimber.c centiped.c chaknpop.c champbas.c changela.c cherrym.c cherrym2.c chinagat.c chinsan.c chqflag.c cidelsa.c circusc.c cischeat.c citycon.c clayshoo.c cliffhgr.c cloak.c cloud9.c cninja.c cntsteer.c coinmstr.c cojag.c combatsc.c compgolf.c contra.c coolpool.c cop01.c couple.c cowrace.c cps1.c cps2.c crgolf.c crystal.c cshooter.c cvs.c cybertnk.c dacholer.c darius.c darkseal.c dassault.c dblewing.c dbz.c dcheese.c ddayjlc.c ddenlovr.c ddrible.c dec8.c deco156.c deco32.c deco_mlc.c destroyr.c dgpix.c discoboy.c diverboy.c djboy.c djmain.c dlair.c dogfgt.c dominob.c dooyong.c dreamwld.c dribling.c dunhuang.c dwarfd.c dynax.c egghunt.c enigma2.c epos.c equites.c esh.c ettrivia.c exctsccr.c exerion.c exidy440.c expro02.c exterm.c exzisus.c f-32.c fcombat.c fcrash.c fgoal.c filetto.c finalizr.c findout.c firebeat.c firetrap.c flkatck.c flower.c flstory.c foodf.c freekick.c fromanc2.c funkybee.c funworld.c funybubl.c fuukifg3.c gaelco.c gaelco3d.c gaiden.c galaxian.c galaxold.c galdrvr.c gameplan.c gaplus.c gbusters.c gcpinbal.c genesis.c getrivia.c gijoe.c ginganin.c gladiatr.c glass.c gng.c goal92.c goldstar.c gottlieb.c gpworld.c gradius3.c grchamp.c groundfx.c gstream.c gsword.c gticlub.c guab.c gunbustr.c gyruss.c hal21.c halleys.c hanaawas.c hanaroku.c hcastle.c hexa.c hnayayoi.c hng64.c holeland.c homedata.c homerun.c hornet.c hotblock.c hyhoo.c hyprduel.c igs_180.c igs_blit.c imolagp.c iqblock.c irobot.c ironhors.c istellar.c itech32.c itech8.c jack.c jalmah.c jchan.c jcross.c jedi.c jongkyo.c jrpacman.c junofrst.c kaneko16.c karnov.c kchamp.c kingobox.c kinst.c kncljoe.c koikoi.c konamigq.c konamigv.c konamigx.c konamim2.c ksayakyu.c ksys573.c kyugo.c labyrunr.c ladyfrog.c laserbas.c laserbat.c lasso.c lastduel.c lastfght.c legionna.c leland.c lemmings.c lethal.c limenko.c lkage.c lockon.c looping.c lordgun.c lsasquad.c lucky8.c lvcards.c m107.c m62.c m92.c macrossp.c madalien.c magic10.c magmax.c mainevt.c mainsnk.c mappy.c maxaflex.c mayumi.c mazerbla.c mcr68.c megadriv.c megaplay.c megasys1.c megatech.c megazone.c meijinsn.c merit.c meritm.c metlclsh.c metro.c mexico86.c micro3d.c midvunit.c mikie.c missile.c mjsister.c mjsiyoub.c mlanding.c model1.c model2.c model3.c momoko.c moo.c mosaic.c mouser.c mpu4drvr.c mquake.c mrflea.c ms32.c msisaac.c munchmo.c mw8080bw.c mwarr.c namcona1.c namconb1.c namcos1.c namcos12.c namcos21.c namcos22.c namcos23.c namcos86.c nbmj8688.c nbmj8891.c nbmj8991.c nemesis.c neogeo.c ninjakd2.c nmk16.c nova2001.c nycaptor.c nyny.c ojankohs.c omegrace.c othldrby.c overdriv.c pacland.c pacman.c pandoras.c parodius.c pasha2.c pastelg.c peplus.c pgm.c phoenix.c pipedrm.c pipeline.c pirates.c pitnrun.c pkscram.c pktgaldx.c plygonet.c pntnpuzl.c polepos.c policetr.c poolshrk.c pooyan.c popeye.c popper.c powerins.c prehisle.c psikyo.c psikyo4.c psikyosh.c psychic5.c punchout.c pushman.c qdrmfgp.c quasar.c quizdna.c r2dtank.c rabbit.c raiden.c raiden2.c rainbow.c rallyx.c rbmk.c rcasino.c realbrk.c redalert.c redclash.c retofinv.c rmhaihai.c rockrage.c rollerg.c route16.c royalmah.c rpunch.c runaway.c rungun.c sandscrp.c sbasketb.c sbrkout.c scobra.c scotrsht.c scramble.c seattle.c segac2.c segag80r.c segahang.c segald.c segaorun.c segas16a.c segas16b.c segas18.c segas32.c segaxbd.c segaybd.c seibuspi.c seicross.c senjyo.c seta.c sf.c sgladiat.c shangha3.c shanghai.c shangkid.c shisen.c shootout.c shougi.c sidearms.c sidepckt.c silkroad.c simpl156.c simpsons.c skykid.c skylncr.c slapfght.c slapshot.c smstrv.c snk.c snookr10.c* sonson.c spaceg.c spcforce.c speedspn.c spiders.c splash.c sprint8.c spy.c srmp2.c srmp6.c ssfindo.c sshangha.c sslam.c sspeedr.c ssrj.c stv.c stvinit.c suna16.c suna8.c superchs.c superdq.c superqix.c supertnk.c suprgolf.c suprridr.c system16.c tail2nos.c taito_b.c taito_f2.c taito_f3.c taito_l.c taito_z.c taitoair.c taitojc.c taitosj.c tankbatt.c tankbust.c taxidrvr.c tbowl.c tcl.c tecmo.c tehkanwc.c tempest.c tetrisp2.c thayers.c thedeep.c thepit.c thunderj.c thunderx.c tickee.c tigeroad.c timelimt.c tmaster.c tmnt.c tnzs.c toaplan2.c toratora.c toypop.c tp84.c tryout.c ttchamp.c tubep.c tumbleb.c turbo.c turbosub.c tutankhm.c twin16.c twins.c tx1.c uapce.c ultraman.c ultrsprt.c undrfire.c unico.c vamphalf.c vastar.c vegaeo.c vegas.c vendetta.c vicdual.c vigilant.c volfied.c vroulet.c wardner.c warpwarp.c wc90.c wc90b.c wecleman.c wilytowr.c wink.c wiping.c witch.c wwfsstar.c wwfwfest.c xain.c xexex.c xmen.c xxmissio.c xyonix.c zaccaria.c zaxxon.c zerozone.c zn.c zr107.c
[src/mame/includes]cps1.h galaxold.h m62.h tx1.h
[src/mame/machine]amiga.c arkanoid.c asic65.c atarifb.c atarigen.c balsente.c beezer.c bigevglf.c bsktball.c buggychl.c cubocd32.c dc.c dec0.c decocass.c decoprot.c docastle.c flstory.c galaxold.c harddriv.c irem_cpu.c konamigx.c konppc.c leland.c lkage.c lsasquad.c mhavoc.c midwayic.c midwunit.c midyunit.c n64.c namcond1.c namcos1.c namcos2.c neoprot.c nitedrvr.c nycaptor.c pitnrun.c playch10.c psx.c retofinv.c scramble.c segaic16.c segas32.c seicop.c simpsons.c slapfght.c snes.c stvcd.c stvprot.c subs.c tait8741.c taitosj.c tatsumi.c toaplan1.c twincobr.c tx1.c vertigo.c vsnes.c williams.c
[src/mame/video]1942.c aerofgt.c alpha68k.c amiga.c angelkds.c arkanoid.c armedf.c atarisy1.c atarisy2.c balsente.c battlane.c battlera.c battlex.c beathead.c beezer.c bfm_adr2.c bigevglf.c bionicc.c blktiger.c blmbycar.c blstroid.c btime.c bwing.c carjmbre.c cave.c ccastles.c cchasm.c centiped.c changela.c cidelsa.c cischeat.c cloud9.c combatsc.c commando.c cps1.c crshrace.c csk.c dc.c dcheese.c dec0.c dec8.c deco16ic.c deco32.c decocass.c deniam.c djboy.c dooyong.c dynduke.c eolith.c exidy.c exidy440.c fastfred.c foodf.c fromanc2.c fromance.c funworld.c funybubl.c gaelco2.c galpani2.c galpanic.c gameplan.c genesis.c ginganin.c gladiatr.c gottlieb.c grchamp.c groundfx.c gticlub.c gundealr.c harddriv.c homerun.c hyprduel.c irobot.c itech32.c itech8.c jaguar.c jedi.c jpmimpct.c kangaroo.c konamigx.c konamiic.c kyugo.c lastduel.c lethalj.c liberate.c lockon.c lordgun.c m10.c m58.c m62.c m72.c m92.c matmania.c mcr3.c mcr68.c megasys1.c metro.c midtunit.c midvunit.c namcos1.c namcos22.c nbmj8891.c nbmj8991.c nbmj9195.c nemesis.c neogeo.c niyanpai.c ojankohs.c pacman.c paradise.c playch10.c playmark.c policetr.c popeye.c popper.c powerins.c psikyosh.c psx.c quizdna.c rastan.c rockola.c rpunch.c runaway.c segag80r.c segaic16.c segaic24.c shangha3.c shisen.c sidearms.c snk68.c snookr10.c* sshangha.c ssozumo.c ssv.c st0016.c stactics.c starshp1.c stvvdp1.c stvvdp2.c subs.c suna16.c suna8.c suprnova.c system1.c system16.c taito_b.c taito_f3.c taito_z.c taitoic.c tatsumi.c tetrisp2.c thepit.c thief.c tiamc1.c tigeroad.c tmnt.c toaplan1.c toaplan2.c toki.c tryout.c tubep.c turbo.c twin16.c twincobr.c tx1.c undrfire.c unico.c usgames.c vigilant.c volfied.c wecleman.c williams.c ygv608.c yunsung8.c
[src/mess/drivers]amstrad.c apple2.c atarist.c cgenie.c coco.c cpschngr.c einstein.c intv.c microtan.c msx.c oric.c orion.c pc8801.c spectrum.c svi318.c vectrex.c
[src/osd/windows]winmain.c winmain.h

src/mame/audio/cchasm.c
r2454r2455
2222    switch (offset & 0x61 )
2323    {
2424    case 0x00:
25        coin = (input_port_3_r (machine, offset) >> 4) & 0x7;
25        coin = (input_port_read_indexed(machine, 3) >> 4) & 0x7;
2626        if (coin != 0x7) coin |= 0x8;
2727        return sound_flags | coin;
2828
r2454r2455
119119      sound_flags &= ~0x40;
120120      return soundlatch4_r (machine,offset) << 8;
121121   case 0x2:
122      return (sound_flags| (input_port_3_r (machine, offset) & 0x07) | 0x08) << 8;
122      return (sound_flags| (input_port_read_indexed(machine, 3) & 0x07) | 0x08) << 8;
123123   case 0x5:
124      return input_port_2_r (machine, offset) << 8;
124      return input_port_read_indexed(machine, 2) << 8;
125125   case 0x8:
126      return input_port_1_r (machine, offset) << 8;
126      return input_port_read_indexed(machine, 1) << 8;
127127   default:
128128      return 0xff << 8;
129129   }
r2454r2455
169169
170170static TIMER_CALLBACK( cchasm_sh_update )
171171{
172    if ((input_port_3_r (machine, 0) & 0x70) != 0x70)
172    if ((input_port_read_indexed(machine, 3) & 0x70) != 0x70)
173173        z80ctc_0_trg0_w (machine, 0, 1);
174174}
175175
src/mame/audio/spacefb.c
r2454r2455
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "cpu/i8039/i8039.h"
109#include "sound/dac.h"
1110#include "sound/samples.h"
r2454r2455
3736
3837WRITE8_HANDLER( spacefb_port_1_w )
3938{
40   cpunum_set_input_line(Machine, 1, 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE);
39   cpunum_set_input_line(machine, 1, 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE);
4140
4241   /* enemy killed */
4342   if (!(data & 0x01) && (spacefb_sound_latch & 0x01))  sample_start(0,0,0);
src/mame/audio/cps3.c
r2454r2455
142142
143143   if (offset < 0x80)
144144   {
145      return chip.voice[offset / 8].regs[offset & 7] & ~mem_mask;
145      return chip.voice[offset / 8].regs[offset & 7] & mem_mask;
146146   }
147147   else if (offset == 0x80)
148148   {
src/mame/audio/amiga.c
r2454r2455
8383
8484static TIMER_CALLBACK( signal_irq )
8585{
86   amiga_custom_w(machine, REG_INTREQ, 0x8000 | (0x80 << param), 0);
86   amiga_custom_w(machine, REG_INTREQ, 0x8000 | (0x80 << param), 0xffff);
8787}
8888
8989
src/mame/audio/timeplt.c
r2454r2455
1111***************************************************************************/
1212
1313#include "driver.h"
14#include "deprecat.h"
1514#include "sound/ay8910.h"
1615#include "sound/flt_rc.h"
1716#include "timeplt.h"
r2454r2455
110109   if (timeplt_last_irq_state == 0 && data)
111110   {
112111      /* setting bit 0 low then high triggers IRQ on the sound CPU */
113      cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
112      cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);
114113   }
115114
116115   timeplt_last_irq_state = data;
r2454r2455
155154
156155static const struct AY8910interface timeplt_ay8910_interface =
157156{
157   AY8910_LEGACY_OUTPUT,
158   AY8910_DEFAULT_LOADS,
158159   soundlatch_r,
159   timeplt_portB_r
160   timeplt_portB_r,
161   NULL,
162   NULL
160163};
161164
162165
src/mame/audio/cinemat.c
r2454r2455
14711471
14721472static const struct AY8910interface demon_ay8910_interface_1 =
14731473{
1474   AY8910_LEGACY_OUTPUT,
1475   AY8910_DEFAULT_LOADS,
14741476   sound_porta_r,
14751477   sound_portb_r,
14761478   0,
r2454r2455
14791481
14801482static const struct AY8910interface demon_ay8910_interface_3 =
14811483{
1484   AY8910_LEGACY_OUTPUT,
1485   AY8910_DEFAULT_LOADS,
14821486   0,
14831487   0,
14841488   0,
src/mame/audio/cyberbal.c
r2454r2455
6363   memory_set_bankptr(8, &bank_base[0x1000 * ((data >> 6) & 3)]);
6464   coin_counter_w(1, (data >> 5) & 1);
6565   coin_counter_w(0, (data >> 4) & 1);
66   cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
66   cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
6767   if (!(data & 0x01)) sndti_reset(SOUND_YM2151, 0);
6868
6969}
src/mame/audio/trackfld.c
r2454r2455
11#include "driver.h"
2#include "deprecat.h"
32#include "sound/vlm5030.h"
43#include "sound/msm5205.h"
54#include "sound/sn76496.h"
r2454r2455
9089    if (last == 0 && data)
9190    {
9291        /* setting bit 0 low then high triggers IRQ on the sound CPU */
93        cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
92        cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);
9493    }
9594
9695    last = data;
src/mame/audio/cage.c
r2454r2455
467467      logerror("%06X:CAGE read command = %04X\n", activecpu_get_pc(), cage_from_main);
468468   cpu_to_cage_ready = 0;
469469   update_control_lines();
470   cpunum_set_input_line(Machine, cage_cpu, TMS32031_IRQ0, CLEAR_LINE);
470   cpunum_set_input_line(machine, cage_cpu, TMS32031_IRQ0, CLEAR_LINE);
471471   return cage_from_main;
472472}
473473
r2454r2455
506506      logerror("%06X:main read data = %04X\n", activecpu_get_pc(), soundlatch_word_r(Machine, 0, 0));
507507   cage_to_cpu_ready = 0;
508508   update_control_lines();
509   return soundlatch_word_r(Machine, 0, 0);
509   return soundlatch_word_r(Machine, 0, 0xffff);
510510}
511511
512512
src/mame/audio/cclimber.c
r2454r2455
7777
7878const struct AY8910interface cclimber_ay8910_interface =
7979{
80   0,
81   0,
80   AY8910_LEGACY_OUTPUT,
81   AY8910_DEFAULT_LOADS,
82   NULL,
83   NULL,
8284   cclimber_sample_select_w,
83   0
85   NULL
8486};
8587
8688const struct Samplesinterface cclimber_samples_interface =
src/mame/audio/mcr.c
r2454r2455
322322{
323323   /* a read here asynchronously resets the 14024 count, clearing /SINT */
324324   ssio_14024_count = 0;
325   cpunum_set_input_line(Machine, ssio_sound_cpu, 0, CLEAR_LINE);
325   cpunum_set_input_line(machine, ssio_sound_cpu, 0, CLEAR_LINE);
326326   return 0xff;
327327}
328328
r2454r2455
446446/********* sound interfaces ***********/
447447static const struct AY8910interface ssio_ay8910_interface_1 =
448448{
449   0,
450   0,
449   AY8910_LEGACY_OUTPUT,
450   AY8910_DEFAULT_LOADS,
451   NULL,
452   NULL,
451453   ssio_porta0_w,
452454   ssio_portb0_w
453455};
454456
455457static const struct AY8910interface ssio_ay8910_interface_2 =
456458{
457   0,
458   0,
459   AY8910_LEGACY_OUTPUT,
460   AY8910_DEFAULT_LOADS,
461   NULL,
462   NULL,
459463   ssio_porta1_w,
460464   ssio_portb1_w
461465};
src/mame/audio/aztarac.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "cpu/z80/z80.h"
109#include "aztarac.h"
1110
src/mame/audio/taitosnd.c
r2454r2455
9999//#endif
100100         /* this does a hi-lo transition to reset the sound cpu */
101101         if (data)
102            cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
102            cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
103103         else
104104         {
105            cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
105            cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
106106                cpu_spin(); /* otherwise no sound in driftout */
107107            }
108108         break;
src/mame/audio/irem.c
r2454r2455
145145
146146static WRITE8_HANDLER( sound_irq_ack_w )
147147{
148   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
148   cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
149149}
150150
151151
r2454r2455
190190
191191static const struct AY8910interface irem_ay8910_interface_1 =
192192{
193   AY8910_LEGACY_OUTPUT,
194   AY8910_DEFAULT_LOADS,
193195   soundlatch_r,
194   0,
195   0,
196   NULL,
197   NULL,
196198   ay8910_0_portb_w
197199};
198200
199201static const struct AY8910interface irem_ay8910_interface_2 =
200202{
201   0,
202   0,
203   AY8910_LEGACY_OUTPUT,
204   AY8910_DEFAULT_LOADS,
205   NULL,
206   NULL,
203207   ay8910_1_porta_w,
204   0
208   NULL
205209};
206210
207211static const struct MSM5205interface irem_msm5205_interface_1 =
src/mame/audio/leland.c
r2454r2455
12701270
12711271   /* handle partials */
12721272   if (!ACCESSING_BITS_8_15)
1273      data = (i80186_internal_port_r(machine, offset, 0) & 0xff00) | (data & 0x00ff);
1273      data = (i80186_internal_port_r(machine, offset, 0xff00) & 0xff00) | (data & 0x00ff);
12741274   else if (!ACCESSING_BITS_0_7)
1275      data = (i80186_internal_port_r(machine, offset, 0) & 0x00ff) | (data & 0xff00);
1275      data = (i80186_internal_port_r(machine, offset, 0x00ff) & 0x00ff) | (data & 0xff00);
12761276
12771277   switch (offset)
12781278   {
12791279      case 0x22/2:
1280         if (LOG_PORTS) logerror("%05X:80186 EOI = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff);
1280         if (LOG_PORTS) logerror("%05X:80186 EOI = %04X & %04X\n", activecpu_get_pc(), data, mem_mask);
12811281         handle_eoi(0x8000);
12821282         update_interrupt_state();
12831283         break;
12841284
12851285      case 0x24/2:
1286         logerror("%05X:ERROR - write to 80186 interrupt poll = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff);
1286         logerror("%05X:ERROR - write to 80186 interrupt poll = %04X & %04X\n", activecpu_get_pc(), data, mem_mask);
12871287         break;
12881288
12891289      case 0x26/2:
1290         logerror("%05X:ERROR - write to 80186 interrupt poll status = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff);
1290         logerror("%05X:ERROR - write to 80186 interrupt poll status = %04X & %04X\n", activecpu_get_pc(), data, mem_mask);
12911291         break;
12921292
12931293      case 0x28/2:
1294         if (LOG_PORTS) logerror("%05X:80186 interrupt mask = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff);
1294         if (LOG_PORTS) logerror("%05X:80186 interrupt mask = %04X & %04X\n", activecpu_get_pc(), data, mem_mask);
12951295         i80186.intr.timer  = (i80186.intr.timer  & ~0x08) | ((data << 3) & 0x08);
12961296         i80186.intr.dma[0] = (i80186.intr.dma[0] & ~0x08) | ((data << 1) & 0x08);
12971297         i80186.intr.dma[1] = (i80186.intr.dma[1] & ~0x08) | ((data << 0) & 0x08);
r2454r2455
13031303         break;
13041304
13051305      case 0x2a/2:
1306         if (LOG_PORTS) logerror("%05X:80186 interrupt priority mask = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff);
1306         if (LOG_PORTS) logerror("%05X:80186 interrupt priority mask = %04X & %04X\n", activecpu_get_pc(), data, mem_mask);
13071307         i80186.intr.priority_mask = data & 0x0007;
13081308         update_interrupt_state();
13091309         break;
13101310
13111311      case 0x2c/2:
1312         if (LOG_PORTS) logerror("%05X:80186 interrupt in-service = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff);
1312         if (LOG_PORTS) logerror("%05X:80186 interrupt in-service = %04X & %04X\n", activecpu_get_pc(), data, mem_mask);
13131313         i80186.intr.in_service = data & 0x00ff;
13141314         update_interrupt_state();
13151315         break;
13161316
13171317      case 0x2e/2:
1318         if (LOG_PORTS) logerror("%05X:80186 interrupt request = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff);
1318         if (LOG_PORTS) logerror("%05X:80186 interrupt request = %04X & %04X\n", activecpu_get_pc(), data, mem_mask);
13191319         i80186.intr.request = (i80186.intr.request & ~0x00c0) | (data & 0x00c0);
13201320         update_interrupt_state();
13211321         break;
13221322
13231323      case 0x30/2:
1324         if (LOG_PORTS) logerror("%05X:WARNING - wrote to 80186 interrupt status = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff);
1324         if (LOG_PORTS) logerror("%05X:WARNING - wrote to 80186 interrupt status = %04X & %04X\n", activecpu_get_pc(), data, mem_mask);
13251325         i80186.intr.status = (i80186.intr.status & ~0x8000) | (data & 0x8000);
13261326         i80186.intr.status = (i80186.intr.status & ~0x0007) | (data & 0x0007);
13271327         update_interrupt_state();
13281328         break;
13291329
13301330      case 0x32/2:
1331         if (LOG_PORTS) logerror("%05X:80186 timer interrupt contol = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff);
1331         if (LOG_PORTS) logerror("%05X:80186 timer interrupt contol = %04X & %04X\n", activecpu_get_pc(), data, mem_mask);
13321332         i80186.intr.timer = data & 0x000f;
13331333         break;
13341334
13351335      case 0x34/2:
1336         if (LOG_PORTS) logerror("%05X:80186 DMA 0 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff);
1336         if (LOG_PORTS) logerror("%05X:80186 DMA 0 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask);
13371337         i80186.intr.dma[0] = data & 0x000f;
13381338         break;
13391339
13401340      case 0x36/2:
1341         if (LOG_PORTS) logerror("%05X:80186 DMA 1 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff);
1341         if (LOG_PORTS) logerror("%05X:80186 DMA 1 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask);
13421342         i80186.intr.dma[1] = data & 0x000f;
13431343         break;
13441344
13451345      case 0x38/2:
1346         if (LOG_PORTS) logerror("%05X:80186 INT 0 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff);
1346         if (LOG_PORTS) logerror("%05X:80186 INT 0 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask);
13471347         i80186.intr.ext[0] = data & 0x007f;
13481348         break;
13491349
13501350      case 0x3a/2:
1351         if (LOG_PORTS) logerror("%05X:80186 INT 1 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff);
1351         if (LOG_PORTS) logerror("%05X:80186 INT 1 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask);
13521352         i80186.intr.ext[1] = data & 0x007f;
13531353         break;
13541354
13551355      case 0x3c/2:
1356         if (LOG_PORTS) logerror("%05X:80186 INT 2 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff);
1356         if (LOG_PORTS) logerror("%05X:80186 INT 2 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask);
13571357         i80186.intr.ext[2] = data & 0x001f;
13581358         break;
13591359
13601360      case 0x3e/2:
1361         if (LOG_PORTS) logerror("%05X:80186 INT 3 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff);
1361         if (LOG_PORTS) logerror("%05X:80186 INT 3 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask);
13621362         i80186.intr.ext[3] = data & 0x001f;
13631363         break;
13641364
13651365      case 0x50/2:
13661366      case 0x58/2:
13671367      case 0x60/2:
1368         if (LOG_PORTS) logerror("%05X:80186 Timer %d count = %04X & %04X\n", activecpu_get_pc(), (offset - 0x50/2) / 4, data, mem_mask ^ 0xffff);
1368         if (LOG_PORTS) logerror("%05X:80186 Timer %d count = %04X & %04X\n", activecpu_get_pc(), (offset - 0x50/2) / 4, data, mem_mask);
13691369         which = (offset - 0x50/2) / 4;
13701370         internal_timer_update(which, data, -1, -1, -1);
13711371         break;
r2454r2455
13731373      case 0x52/2:
13741374      case 0x5a/2:
13751375      case 0x62/2:
1376         if (LOG_PORTS) logerror("%05X:80186 Timer %d max A = %04X & %04X\n", activecpu_get_pc(), (offset - 0x50/2) / 4, data, mem_mask ^ 0xffff);
1376         if (LOG_PORTS) logerror("%05X:80186 Timer %d max A = %04X & %04X\n", activecpu_get_pc(), (offset - 0x50/2) / 4, data, mem_mask);
13771377         which = (offset - 0x50/2) / 4;
13781378         internal_timer_update(which, -1, data, -1, -1);
13791379         break;
13801380
13811381      case 0x54/2:
13821382      case 0x5c/2:
1383         if (LOG_PORTS) logerror("%05X:80186 Timer %d max B = %04X & %04X\n", activecpu_get_pc(), (offset - 0x50/2) / 4, data, mem_mask ^ 0xffff);
1383         if (LOG_PORTS) logerror("%05X:80186 Timer %d max B = %04X & %04X\n", activecpu_get_pc(), (offset - 0x50/2) / 4, data, mem_mask);
13841384         which = (offset - 0x50/2) / 4;
13851385         internal_timer_update(which, -1, -1, data, -1);
13861386         break;
r2454r2455
13881388      case 0x56/2:
13891389      case 0x5e/2:
13901390      case 0x66/2:
1391         if (LOG_PORTS) logerror("%05X:80186 Timer %d control = %04X & %04X\n", activecpu_get_pc(), (offset - 0x50/2) / 4, data, mem_mask  ^ 0xffff);
1391         if (LOG_PORTS) logerror("%05X:80186 Timer %d control = %04X & %04X\n", activecpu_get_pc(), (offset - 0x50/2) / 4, data, mem_mask);
13921392         which = (offset - 0x50/2) / 4;
13931393         internal_timer_update(which, -1, -1, -1, data);
13941394         break;
13951395
13961396      case 0xa0/2:
1397         if (LOG_PORTS) logerror("%05X:80186 upper chip select = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff);
1397         if (LOG_PORTS) logerror("%05X:80186 upper chip select = %04X & %04X\n", activecpu_get_pc(), data, mem_mask);
13981398         i80186.mem.upper = data | 0xc038;
13991399         break;
14001400
14011401      case 0xa2/2:
1402         if (LOG_PORTS) logerror("%05X:80186 lower chip select = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff);
1402         if (LOG_PORTS) logerror("%05X:80186 lower chip select = %04X & %04X\n", activecpu_get_pc(), data, mem_mask);
14031403         i80186.mem.lower = (data & 0x3fff) | 0x0038;
14041404         break;
14051405
14061406      case 0xa4/2:
1407         if (LOG_PORTS) logerror("%05X:80186 peripheral chip select = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff);
1407         if (LOG_PORTS) logerror("%05X:80186 peripheral chip select = %04X & %04X\n", activecpu_get_pc(), data, mem_mask);
14081408         i80186.mem.peripheral = data | 0x0038;
14091409         break;
14101410
14111411      case 0xa6/2:
1412         if (LOG_PORTS) logerror("%05X:80186 middle chip select = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff);
1412         if (LOG_PORTS) logerror("%05X:80186 middle chip select = %04X & %04X\n", activecpu_get_pc(), data, mem_mask);
14131413         i80186.mem.middle = data | 0x01f8;
14141414         break;
14151415
14161416      case 0xa8/2:
1417         if (LOG_PORTS) logerror("%05X:80186 middle P chip select = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff);
1417         if (LOG_PORTS) logerror("%05X:80186 middle P chip select = %04X & %04X\n", activecpu_get_pc(), data, mem_mask);
14181418         i80186.mem.middle_size = data | 0x8038;
14191419
14201420         temp = (i80186.mem.peripheral & 0xffc0) << 4;
r2454r2455
14341434
14351435      case 0xc0/2:
14361436      case 0xd0/2:
1437         if (LOG_PORTS) logerror("%05X:80186 DMA%d lower source address = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask ^ 0xffff);
1437         if (LOG_PORTS) logerror("%05X:80186 DMA%d lower source address = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask);
14381438         which = (offset - 0xc0/2) / 8;
14391439         stream_update(dma_stream);
14401440         i80186.dma[which].source = (i80186.dma[which].source & ~0x0ffff) | (data & 0x0ffff);
r2454r2455
14421442
14431443      case 0xc2/2:
14441444      case 0xd2/2:
1445         if (LOG_PORTS) logerror("%05X:80186 DMA%d upper source address = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask ^ 0xffff);
1445         if (LOG_PORTS) logerror("%05X:80186 DMA%d upper source address = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask);
14461446         which = (offset - 0xc0/2) / 8;
14471447         stream_update(dma_stream);
14481448         i80186.dma[which].source = (i80186.dma[which].source & ~0xf0000) | ((data << 16) & 0xf0000);
r2454r2455
14501450
14511451      case 0xc4/2:
14521452      case 0xd4/2:
1453         if (LOG_PORTS) logerror("%05X:80186 DMA%d lower dest address = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask ^ 0xffff);
1453         if (LOG_PORTS) logerror("%05X:80186 DMA%d lower dest address = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask);
14541454         which = (offset - 0xc0/2) / 8;
14551455         stream_update(dma_stream);
14561456         i80186.dma[which].dest = (i80186.dma[which].dest & ~0x0ffff) | (data & 0x0ffff);
r2454r2455
14581458
14591459      case 0xc6/2:
14601460      case 0xd6/2:
1461         if (LOG_PORTS) logerror("%05X:80186 DMA%d upper dest address = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask ^ 0xffff);
1461         if (LOG_PORTS) logerror("%05X:80186 DMA%d upper dest address = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask);
14621462         which = (offset - 0xc0/2) / 8;
14631463         stream_update(dma_stream);
14641464         i80186.dma[which].dest = (i80186.dma[which].dest & ~0xf0000) | ((data << 16) & 0xf0000);
r2454r2455
14661466
14671467      case 0xc8/2:
14681468      case 0xd8/2:
1469         if (LOG_PORTS) logerror("%05X:80186 DMA%d transfer count = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask ^ 0xffff);
1469         if (LOG_PORTS) logerror("%05X:80186 DMA%d transfer count = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask);
14701470         which = (offset - 0xc0/2) / 8;
14711471         stream_update(dma_stream);
14721472         i80186.dma[which].count = data;
r2454r2455
14741474
14751475      case 0xca/2:
14761476      case 0xda/2:
1477         if (LOG_PORTS) logerror("%05X:80186 DMA%d control = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask ^ 0xffff);
1477         if (LOG_PORTS) logerror("%05X:80186 DMA%d control = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask);
14781478         which = (offset - 0xc0/2) / 8;
14791479         stream_update(dma_stream);
14801480         update_dma_control(which, data);
14811481         break;
14821482
14831483      case 0xfe/2:
1484         if (LOG_PORTS) logerror("%05X:80186 relocation register = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff);
1484         if (LOG_PORTS) logerror("%05X:80186 relocation register = %04X & %04X\n", activecpu_get_pc(), data, mem_mask);
14851485
14861486         /* we assume here there that this doesn't happen too often */
14871487         /* plus, we can't really remove the old memory range, so we also assume that it's */
r2454r2455
14981498         break;
14991499
15001500      default:
1501         logerror("%05X:80186 port %02X = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask ^ 0xffff);
1501         logerror("%05X:80186 port %02X = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask);
15021502         break;
15031503   }
15041504}
r2454r2455
16601660   }
16611661
16621662   /* /RESET */
1663   cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, data & 0x80  ? CLEAR_LINE : ASSERT_LINE);
1663   cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, data & 0x80  ? CLEAR_LINE : ASSERT_LINE);
16641664
16651665   /* /NMI */
16661666/*  If the master CPU doesn't get a response by the time it's ready to send
16671667    the next command, it uses an NMI to force the issue; unfortunately, this
16681668    seems to really screw up the sound system. It turns out it's better to
16691669    just wait for the original interrupt to occur naturally */
1670/*  cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, data & 0x40  ? CLEAR_LINE : ASSERT_LINE);*/
1670/*  cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, data & 0x40  ? CLEAR_LINE : ASSERT_LINE);*/
16711671
16721672   /* INT0 */
16731673   if (data & 0x20)
r2454r2455
19231923      case 0x01:
19241924      case 0x02:
19251925         if (ACCESSING_BITS_0_7)
1926            dac_w(machine, offset, data, 0xff00);
1926            dac_w(machine, offset, data, 0x00ff);
19271927         return;
19281928
19291929      case 0x03:
1930         dac_w(machine, 0, ((data << 13) & 0xe000) | ((data << 10) & 0x1c00) | ((data << 7) & 0x0300), 0x00ff);
1931         dac_w(machine, 2, ((data << 10) & 0xe000) | ((data <<  7) & 0x1c00) | ((data << 4) & 0x0300), 0x00ff);
1932         dac_w(machine, 4, ((data <<  8) & 0xc000) | ((data <<  6) & 0x3000) | ((data << 4) & 0x0c00) | ((data << 2) & 0x0300), 0x00ff);
1930         dac_w(machine, 0, ((data << 13) & 0xe000) | ((data << 10) & 0x1c00) | ((data << 7) & 0x0300), 0xff00);
1931         dac_w(machine, 2, ((data << 10) & 0xe000) | ((data <<  7) & 0x1c00) | ((data << 4) & 0x0300), 0xff00);
1932         dac_w(machine, 4, ((data <<  8) & 0xc000) | ((data <<  6) & 0x3000) | ((data << 4) & 0x0c00) | ((data << 2) & 0x0300), 0xff00);
19331933         return;
19341934   }
19351935
src/mame/audio/carnival.c
r2454r2455
3737/*****************************************************************************/
3838
3939#include "driver.h"
40#include "deprecat.h"
4140#include "cpu/i8039/i8039.h"
4241#include "sound/ay8910.h"
4342#include "sound/samples.h"
r2454r2455
236235
237236   if ( bitsGoneHigh & OUT_PORT_2_MUSIC_RESET )
238237      /* reset output is no longer asserted active low */
239      cpunum_set_input_line(Machine, CPU_MUSIC_ID, INPUT_LINE_RESET, PULSE_LINE );
238      cpunum_set_input_line(machine, CPU_MUSIC_ID, INPUT_LINE_RESET, PULSE_LINE );
240239}
241240
242241
src/mame/audio/taito_en.c
r2454r2455
9797
9898   /* IRQ ack */
9999   if (offset==0xf) {
100      cpunum_set_input_line(Machine, 1, 6, CLEAR_LINE);
100      cpunum_set_input_line(machine, 1, 6, CLEAR_LINE);
101101      return 0;
102102   }
103103
src/mame/audio/harddriv.c
r2454r2455
118118
119119WRITE16_HANDLER( hd68k_snd_reset_w )
120120{
121   cpunum_set_input_line(Machine, hdcpu_sound, INPUT_LINE_RESET, ASSERT_LINE);
122   cpunum_set_input_line(Machine, hdcpu_sound, INPUT_LINE_RESET, CLEAR_LINE);
121   cpunum_set_input_line(machine, hdcpu_sound, INPUT_LINE_RESET, ASSERT_LINE);
122   cpunum_set_input_line(machine, hdcpu_sound, INPUT_LINE_RESET, CLEAR_LINE);
123123   mainflag = soundflag = 0;
124124   update_68k_interrupts(Machine);
125125   logerror("%06X:Reset sound\n", activecpu_get_previouspc());
r2454r2455
222222      case 4:   /* RES320 */
223223         logerror("%06X:RES320=%d\n", activecpu_get_previouspc(), data);
224224         if (hdcpu_sounddsp != -1)
225            cpunum_set_input_line(Machine, hdcpu_sounddsp, INPUT_LINE_HALT, data ? CLEAR_LINE : ASSERT_LINE);
225            cpunum_set_input_line(machine, hdcpu_sounddsp, INPUT_LINE_HALT, data ? CLEAR_LINE : ASSERT_LINE);
226226         break;
227227
228228      case 7:   /* LED */
src/mame/audio/seibu.c
r2454r2455
323323
324324WRITE8_HANDLER( seibu_irq_clear_w )
325325{
326   update_irq_lines(Machine, VECTOR_INIT);
326   update_irq_lines(machine, VECTOR_INIT);
327327}
328328
329329WRITE8_HANDLER( seibu_rst10_ack_w )
r2454r2455
333333
334334WRITE8_HANDLER( seibu_rst18_ack_w )
335335{
336   update_irq_lines(Machine, RST18_CLEAR);
336   update_irq_lines(machine, RST18_CLEAR);
337337}
338338
339339void seibu_ym3812_irqhandler(int linestate)
r2454r2455
443443            main2sub[offset] = data;
444444            break;
445445         case 4:
446            update_irq_lines(Machine, RST18_ASSERT);
446            update_irq_lines(machine, RST18_ASSERT);
447447            break;
448448         case 6:
449449            /* just a guess */
r2454r2455
459459
460460READ8_HANDLER( seibu_main_v30_r )
461461{
462   return seibu_main_word_r(machine,offset/2,0) >> (8 * (offset & 1));
462   return seibu_main_word_r(machine,offset/2,0xffff) >> (8 * (offset & 1));
463463}
464464
465465WRITE8_HANDLER( seibu_main_v30_w )
466466{
467   seibu_main_word_w(machine,offset/2,data << (8 * (offset & 1)),0xff00 >> (8 * (offset & 1)));
467   seibu_main_word_w(machine,offset/2,data << (8 * (offset & 1)),0x00ff << (8 * (offset & 1)));
468468}
469469
470470WRITE16_HANDLER( seibu_main_mustb_w )
r2454r2455
474474
475475//  logerror("seibu_main_mustb_w: %x -> %x %x\n", data, main2sub[0], main2sub[1]);
476476
477   update_irq_lines(Machine, RST18_ASSERT);
477   update_irq_lines(machine, RST18_ASSERT);
478478}
479479
480480/***************************************************************************/
r2454r2455
497497
498498const struct YM2203interface seibu_ym2203_interface =
499499{
500   0,0,0,0,seibu_ym2203_irqhandler
500   {
501      AY8910_LEGACY_OUTPUT,
502      AY8910_DEFAULT_LOADS,
503      NULL, NULL, NULL, NULL
504   },
505   seibu_ym2203_irqhandler
501506};
502507
503508/***************************************************************************/
src/mame/audio/segag80r.c
r2454r2455
99
1010#include "driver.h"
1111#include "streams.h"
12#include "deprecat.h"
1312#include "cpu/i8039/i8039.h"
1413#include "segag80r.h"
1514#include "machine/8255ppi.h"
r2454r2455
425424};
426425
427426
427static const ppi8255_interface ppi8255_005_intf =
428{
429   NULL,
430   NULL,
431   NULL,
432   sega005_sound_a_w,
433   sega005_sound_b_w,
434   NULL
435};
436
437
428438MACHINE_DRIVER_START( 005_sound_board )
429439
440   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
441   MDRV_DEVICE_CONFIG( ppi8255_005_intf )
442
430443   /* sound hardware */
431444   MDRV_SOUND_START(005)
432445
r2454r2455
449462
450463static SOUND_START( 005 )
451464{
452   static const ppi8255_interface ppi_intf =
453   {
454      1,
455      { 0 },
456      { 0 },
457      { 0 },
458      { sega005_sound_a_w },
459      { sega005_sound_b_w },
460      { 0 }
461   };
462   ppi8255_init(&ppi_intf);
463
464465   state_save_register_global_array(sound_state);
465466   state_save_register_global(sound_addr);
466467   state_save_register_global(sound_data);
r2454r2455
819820 *
820821 *************************************/
821822
823static const ppi8255_interface monsterb_ppi_intf =
824{
825   NULL,
826   NULL,
827   n7751_status_r,
828   monsterb_sound_a_w,
829   monsterb_sound_b_w,
830   n7751_command_w
831};
832
833
822834MACHINE_DRIVER_START( monsterb_sound_board )
823835
836   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
837   MDRV_DEVICE_CONFIG( monsterb_ppi_intf )
838
824839   /* basic machine hardware */
825840   MDRV_CPU_ADD(N7751, 6000000)
826841   MDRV_CPU_PROGRAM_MAP(monsterb_7751_map,0)
r2454r2455
851866
852867static SOUND_START( monsterb )
853868{
854   static const ppi8255_interface ppi_intf =
855   {
856      1,
857      { 0 },
858      { 0 },
859      { n7751_status_r },
860      { monsterb_sound_a_w },
861      { monsterb_sound_b_w },
862      { n7751_command_w }
863   };
864   ppi8255_init(&ppi_intf);
865
866869   state_save_register_global_array(sound_state);
867870   state_save_register_global(sound_addr);
868871   state_save_register_global(n7751_command);
r2454r2455
934937        D3    = /INT line
935938    */
936939   n7751_command = data & 0x07;
937   cpunum_set_input_line(Machine, 1, 0, ((data & 0x08) == 0) ? ASSERT_LINE : CLEAR_LINE);
940   cpunum_set_input_line(machine, 1, 0, ((data & 0x08) == 0) ? ASSERT_LINE : CLEAR_LINE);
938941   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
939942}
940943
src/mame/audio/scramble.c
r2454r2455
377377
378378static const struct AY8910interface ad2083_ay8910_interface_1 =
379379{
380   scramble_portB_r
380   AY8910_LEGACY_OUTPUT,
381   AY8910_DEFAULT_LOADS,
382   scramble_portB_r,
383   NULL,
384   NULL,
385   NULL
381386};
382387
383388static const struct AY8910interface ad2083_ay8910_interface_2 =
384389{
385   hotshock_soundlatch_r
390   AY8910_LEGACY_OUTPUT,
391   AY8910_DEFAULT_LOADS,
392   hotshock_soundlatch_r,
393   NULL,
394   NULL,
395   NULL
386396};
387397
388398static ADDRESS_MAP_START( ad2083_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/audio/system16.c
r2454r2455
11// system 16 - 7751 emulation, based on monster bash code.
22#include "driver.h"
3#include "deprecat.h"
43#include "cpu/i8039/i8039.h"
54#include "sound/dac.h"
65
r2454r2455
3938
4039   if ((data & 0x0f) != 8)
4140   {
42      cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, PULSE_LINE);
41      cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, PULSE_LINE);
4342      timer_set(ATTOTIME_IN_USEC(300), NULL, data, trigger_7751_sound);
4443   }
4544}
src/mame/audio/redalert.c
r2454r2455
99
1010#include "driver.h"
1111#include "rescap.h"
12#include "deprecat.h"
1312#include "cpu/i8085/i8085.h"
1413#include "machine/6821pia.h"
1514#include "sound/ay8910.h"
r2454r2455
128127
129128static const struct AY8910interface redalert_ay8910_interface =
130129{
131   soundlatch_r, 0,      /* port A/B read */
132   0, redalert_analog_w   /* port A/B write */
130   AY8910_LEGACY_OUTPUT,
131   AY8910_DEFAULT_LOADS,
132   soundlatch_r, NULL,      /* port A/B read */
133   NULL, redalert_analog_w   /* port A/B write */
133134};
134135
135136
r2454r2455
312313
313314static const struct AY8910interface demoneye_ay8910_interface =
314315{
315   soundlatch_r, 0,   /* port A/B read */
316   0, 0            /* port A/B write */
316   AY8910_LEGACY_OUTPUT,
317   AY8910_DEFAULT_LOADS,
318   soundlatch_r, NULL,   /* port A/B read */
319   NULL, NULL            /* port A/B write */
317320};
318321
319322
src/mame/audio/starwars.c
r2454r2455
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1211#include "cpu/m6809/m6809.h"
1312#include "sound/5220intf.h"
1413#include "includes/starwars.h"
r2454r2455
8887
8988      case 5: /* 0x85 - Read Interrupt Flag Register */
9089         if (irq_flag)
91            cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, CLEAR_LINE);
90            cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, CLEAR_LINE);
9291         temp = irq_flag;
9392         irq_flag = 0;   /* Clear int flags */
9493         return temp;
r2454r2455
186185{
187186   port_A &= 0x7f; /* ready to receive new commands from main */
188187   if (PA7_irq)
189      cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, CLEAR_LINE);
188      cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, CLEAR_LINE);
190189   return sound_data;
191190}
192191
r2454r2455
240239   port_A &= 0x3f;
241240
242241   /* reset sound CPU here  */
243   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE);
242   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, PULSE_LINE);
244243}
245244
src/mame/audio/mario.c
r2454r2455
430430
431431static const struct AY8910interface ay8910_interface =
432432{
433   soundlatch_r
433   AY8910_LEGACY_OUTPUT,
434   AY8910_DEFAULT_LOADS,
435   soundlatch_r,
436   NULL,
437   NULL,
438   NULL
434439};
435440
436441
src/mame/audio/dcs.c
r2454r2455
14171417   if (dsio.start_on_next_write && --dsio.start_on_next_write == 0)
14181418   {
14191419      logerror("Starting DSIO CPU\n");
1420      cpunum_set_input_line(Machine, dcs.cpunum, INPUT_LINE_HALT, CLEAR_LINE);
1420      cpunum_set_input_line(machine, dcs.cpunum, INPUT_LINE_HALT, CLEAR_LINE);
14211421   }
14221422}
14231423
r2454r2455
15551555   if (!dcs.last_input_empty && dcs.input_empty_cb)
15561556      (*dcs.input_empty_cb)(dcs.last_input_empty = 1);
15571557   SET_INPUT_EMPTY();
1558   cpunum_set_input_line(Machine, dcs.cpunum, ADSP2105_IRQ2, CLEAR_LINE);
1558   cpunum_set_input_line(machine, dcs.cpunum, ADSP2105_IRQ2, CLEAR_LINE);
15591559}
15601560
15611561
15621562static READ16_HANDLER( input_latch_r )
15631563{
15641564   if (dcs.auto_ack)
1565      input_latch_ack_w(machine,0,0,0);
1565      input_latch_ack_w(machine,0,0,0xffff);
15661566   if (LOG_DCS_IO)
15671567      logerror("%08X:input_latch_r(%04X)\n", activecpu_get_pc(), dcs.input_data);
15681568   return dcs.input_data;
r2454r2455
18271827         if (data & 0x0200)
18281828         {
18291829            logerror("%04X:Rebooting DCS due to SYSCONTROL write\n", activecpu_get_pc());
1830            cpunum_set_input_line(Machine, dcs.cpunum, INPUT_LINE_RESET, PULSE_LINE);
1830            cpunum_set_input_line(machine, dcs.cpunum, INPUT_LINE_RESET, PULSE_LINE);
18311831            dcs_boot();
18321832            dcs.control_regs[SYSCONTROL_REG] = 0;
18331833         }
r2454r2455
20702070      timer_set(ATTOTIME_IN_USEC(1), NULL, param, s1_ack_callback2);
20712071      return;
20722072   }
2073   output_latch_w(machine, 0, 0x000a, 0);
2073   output_latch_w(machine, 0, 0x000a, 0xffff);
20742074}
20752075
20762076
r2454r2455
20822082      timer_set(ATTOTIME_IN_USEC(1), NULL, param, s1_ack_callback1);
20832083      return;
20842084   }
2085   output_latch_w(machine, 0, param, 0);
2085   output_latch_w(machine, 0, param, 0xffff);
20862086
20872087   /* chain to the next word we need to write back */
20882088   timer_set(ATTOTIME_IN_USEC(1), NULL, 0, s1_ack_callback2);
r2454r2455
22202220      timer_set(ATTOTIME_IN_USEC(1), NULL, param, s2_ack_callback);
22212221      return;
22222222   }
2223   output_latch_w(machine, 0, param, 0);
2224   output_control_w(machine, 0, (dcs.output_control & ~0xff00) | 0x0300, 0);
2223   output_latch_w(machine, 0, param, 0xffff);
2224   output_control_w(machine, 0, (dcs.output_control & ~0xff00) | 0x0300, 0xffff);
22252225}
22262226
22272227
src/mame/audio/jedi.c
r2454r2455
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110#include "cpu/m6502/m6502.h"
1211#include "sound/5220intf.h"
1312#include "sound/pokey.h"
r2454r2455
6160
6261static WRITE8_HANDLER( irq_ack_w )
6362{
64   cpunum_set_input_line(Machine, 1, M6502_IRQ_LINE, CLEAR_LINE);
63   cpunum_set_input_line(machine, 1, M6502_IRQ_LINE, CLEAR_LINE);
6564}
6665
6766
r2454r2455
7473
7574WRITE8_HANDLER( jedi_audio_reset_w )
7675{
77   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
76   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
7877}
7978
8079
src/mame/audio/exidy.c
r2454r2455
447447      {
448448         case 0:   /* port A */
449449            if (has_mc3417)
450               cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
450               cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
451451            riot_porta_data = (riot_porta_data & ~riot_porta_ddr) | (data & riot_porta_ddr);
452452            break;
453453
src/mame/machine/nycaptor.c
r2454r2455
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1211
1312static UINT8 from_main,from_mcu;
1413static int mcu_sent = 0,main_sent = 0;
r2454r2455
5655   if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02))
5756   {
5857      portA_in = from_main;
59      if (main_sent) cpunum_set_input_line(Machine, 3,0,CLEAR_LINE);
58      if (main_sent) cpunum_set_input_line(machine, 3,0,CLEAR_LINE);
6059      main_sent = 0;
6160
6261   }
r2454r2455
103102
104103   from_main = data;
105104   main_sent = 1;
106   cpunum_set_input_line(Machine, 3,0,ASSERT_LINE);
105   cpunum_set_input_line(machine, 3,0,ASSERT_LINE);
107106}
108107
109108READ8_HANDLER( nycaptor_mcu_r )
src/mame/machine/irem_cpu.c
r2454r2455
108108
109109
110110const UINT8 lethalth_decryption_table[256] = {
111   0x7d,0x26,0x5d,xxxx,0xba,xxxx,0x1e,0x5e, 0xb8,xxxx,0xbc,0xe8,0x01,xxxx,0x4a,0x25, /* 00 */
112// ???? !!!! !!!!      !!!!      !!!! !!!!  !!!!      !!!! !!!! !!!!           !!!!
111   0x7f,0x26,0x5d,xxxx,0xba,xxxx,0x1e,0x5e, 0xb8,xxxx,0xbc,0xe8,0x01,xxxx,0x4a,0x25, /* 00 */
112// ssss !!!! !!!!      !!!!      !!!! !!!!  !!!!      !!!! !!!! !!!!           !!!!
113113   xxxx,0xbd,xxxx,0x22,0x10,xxxx,0x02,0x57, 0x70,xxxx,0x7e,xxxx,0xe7,0x52,xxxx,0xa9, /* 10 */
114114//                !!!!           !!!! !!!!            ????      !!!! !!!!      gggg
115115   xxxx,xxxx,0xc6,0x06,0xa0,0xfe,0xcf,0x8e, 0x43,0x8f,0x2d,xxxx,0xd4,0x85,0x75,0xa2, /* 20 */
116116//           !!!! !!!!      !!!! !!!! !!!!  !!!!                          !!!! !!!!
117   0x3d,xxxx,xxxx,0x38,0x78,0x89,0xd1,0x80, 0x3b,0x72,0x07,xxxx,0x42,0x37,0x0a,0x18, /* 30 */
118// gggg           !!!! ???? !!!! !!!! !!!!  !!!! !!!! !!!!                !!!!
117   0x3d,xxxx,xxxx,0x38,0x7c,0x89,0xd1,0x80, 0x3b,0x72,0x07,xxxx,0x42,0x37,0x0a,0x18, /* 30 */
118// gggg           !!!! ???? !!!! !!!! !!!!  !!!! !!!! !!!!           ssss !!!!
119119   0x88,0xb4,0x98,0x8b,0xb9,0x9c,0xad,0x0e, 0x2b,xxxx,0xbf,xxxx,0x55,xxxx,0x56,0xb0, /* 40 */
120// !!!!          !!!! !!!! !!!! !!!!       gggg      !!!!      !!!!      !!!! !!!!
120// !!!!      pppp !!!! !!!! !!!! !!!!       gggg      !!!!      !!!!      !!!! !!!!
121121   0x93,0x91,xxxx,0xeb,xxxx,0x50,0x41,0x29, 0x47,xxxx,xxxx,0x60,xxxx,0xab,xxxx,xxxx, /* 50 */
122//     !!!! !!!!      !!!!      !!!! !!!!                      !!!!      !!!!
122// pppp !!!! !!!!      !!!!      !!!! !!!!                      !!!!      !!!!
123123   0xc3,0xe2,0xd0,0xb2,0x11,0x79,xxxx,0x08, xxxx,0xfb,xxxx,0x2c,0x23,xxxx,0x28,0x0d, /* 60 */
124124// !!!! !!!! !!!! !!!!      ????                 !!!!           !!!!
125   xxxx,xxxx,xxxx,0x83,0x3c,xxxx,0x1b,0x34, 0x5b,xxxx,0x40,xxxx,xxxx,0x04,0xfc,0x30, /* 70 */
126//                !!!! !!!!                 !!!!                     !!!! !!!! ????
125   xxxx,xxxx,xxxx,0x83,0x3c,xxxx,0x1b,0x34, 0x5b,xxxx,0x40,xxxx,xxxx,0x04,0xfc,0xcd, /* 70 */
126//                !!!! !!!!                 !!!!                     !!!! !!!! ssss
127127   0xb1,0xf3,0x8a,xxxx,xxxx,0x87,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,0xbe,0x84,0x1f,0xe6, /* 80 */
128128//      !!!! !!!!                                               !!!!      !!!! !!!!
129129   0xff,xxxx,0x12,xxxx,0xb5,0x36,xxxx,0xb3, xxxx,xxxx,xxxx,0xd2,0x4e,xxxx,xxxx,xxxx, /* 90 */
130130// !!!!                     !!!!      !!!!
131   0xa5,xxxx,xxxx,0xc7,xxxx,0x27,0x0b,xxxx, 0x20,xxxx,xxxx,xxxx,xxxx,xxxx,0x61,0x7f, /* A0 */
131   0xa5,xxxx,xxxx,0xc7,xxxx,0x27,0x0b,xxxx, 0x20,xxxx,xxxx,xxxx,xxxx,xxxx,0x61,0x7d, /* A0 */
132132// !!!!           !!!!           !!!!                                     !!!! ????
133133   xxxx,xxxx,0x86,0x0f,xxxx,0xb7,xxxx,0x4f, xxxx,xxxx,0xc0,0xfd,xxxx,0x39,xxxx,0x77, /* B0 */
134134//           !!!! !!!!                                !!!!           !!!!      !!!!
r2454r2455
147147"!!!!" -> checked against gussun
148148"gggg" -> very probably
149149"pppp" -> probably
150"ssss" -> sure
150151"????" -> missing
151152
15200 -> (79,7d,"7f") ->
153
1531541a -> (78,7c,7e) ->
15415534 -> (78,7c,7e) -> 78
155156
15615765 -> (79,
157af -> (79,7d,7f) (strange 71) ->
158af -> (79,7d) (strange 71) ->
158159d9 -> (11e07 from 11de6) (70,78    -> to handle a01ce=000-7d0 -> 0x78
159160ed -> (p76,78,7c,7e) ->
160161fb ->
161162
162163probably:
1637f -> 30 (little machine in the game)
16442 -> 0x98 (083a3)
16550 -> 0x93 (083a7)
164166c5 -> (18d56 - from 1844f) (71,73,76,79,7a,7d,7e) -> to handle level number (a008d=00-0f) -> 0x76
165167
166168very probably:
16716948 -> 0x2b
168170e5 -> 0x73
171
172sure:
17300 -> 0x7f
1743d -> 0x37
1757f -> 0xcd (little machine in the game - 16058)
176
169177*/
170178// 0x2c (0xd4) complete guess
171179// 0x2d (0x85) complete guess
src/mame/machine/cubocd32.c
r2454r2455
361361#if LOG_AKIKO_CD
362362      logerror( "Akiko CD IRQ\n" );
363363#endif
364      amiga_custom_w(Machine, REG_INTREQ, 0x8000 | INTENA_PORTS, 0);
364      amiga_custom_w(Machine, REG_INTREQ, 0x8000 | INTENA_PORTS, 0xffff);
365365   }
366366}
367367
src/mame/machine/playch10.c
r2454r2455
102102
103103WRITE8_HANDLER( pc10_GAMERES_w )
104104{
105   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ( data & 1 ) ? CLEAR_LINE : ASSERT_LINE );
105   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ( data & 1 ) ? CLEAR_LINE : ASSERT_LINE );
106106}
107107
108108WRITE8_HANDLER( pc10_GAMESTOP_w )
109109{
110   cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ( data & 1 ) ? CLEAR_LINE : ASSERT_LINE );
110   cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ( data & 1 ) ? CLEAR_LINE : ASSERT_LINE );
111111}
112112
113113WRITE8_HANDLER( pc10_PPURES_w )
src/mame/machine/stvprot.c
r2454r2455
356356
357357static WRITE32_HANDLER( decathlt_prot_w )
358358{
359   decathlt_protregs[offset] = (data&~mem_mask)|(decathlt_protregs[offset]&mem_mask);
359   decathlt_protregs[offset] = (data&mem_mask)|(decathlt_protregs[offset]&~mem_mask);
360360//  decathlt_protregs[0] = 0x0c00000/4;
361361
362362   if (offset==0) // seems to set a (scrambled?) source address
r2454r2455
370370
371371   if (offset==1) // uploads 2 tables...
372372   {
373      if (mem_mask==0x0000ffff)
373      if (mem_mask==0xffff0000)
374374      {
375375         if (data == 0x80000000)
376376         {
r2454r2455
393393
394394//          mame_printf_info("ARGH! %08x %08x\n",mem_mask,data);
395395      }
396      else if (mem_mask==0xffff0000)
396      else if (mem_mask==0x0000ffff)
397397      {
398398         if (decathlt_prot_uploadmode==1)
399399         {
src/mame/machine/asic65.c
r2454r2455
158158      else if (!state && asic65_reset_state)
159159      {
160160         if (asic65_command != -1)
161            asic65_data_w(Machine, 1, asic65_command, 0);
161            asic65_data_w(Machine, 1, asic65_command, 0xffff);
162162      }
163163
164164      /* update the state */
r2454r2455
480480static READ16_HANDLER( asic65_68k_r )
481481{
482482   asic65_tfull = 0;
483   cpunum_set_input_line(Machine, asic65_cpunum, 0, CLEAR_LINE);
483   cpunum_set_input_line(machine, asic65_cpunum, 0, CLEAR_LINE);
484484   return asic65_tdata;
485485}
486486
src/mame/machine/docastle.c
r2454r2455
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1211#include "cpu/z80/z80.h"
1312#include "includes/docastle.h"
1413
r2454r2455
5756
5857   if (offset == 8)
5958      /* awake the master CPU */
60      cpu_trigger(Machine, 500);
59      cpu_trigger(machine, 500);
6160}
6261
6362
r2454r2455
7978
8079WRITE8_HANDLER( docastle_nmitrigger_w )
8180{
82   cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE);
81   cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
8382}
src/mame/machine/midyunit.c
r2454r2455
55**************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "cpu/tms34010/tms34010.h"
109#include "cpu/m6809/m6809.h"
1110#include "machine/6821pia.h"
r2454r2455
580579
581580         case SOUND_YAWDIM:
582581            soundlatch_w(machine, 0, data);
583            cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
582            cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
584583            break;
585584      }
586585}
src/mame/machine/flstory.c
r2454r2455
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1211
1312extern UINT8 *onna34ro_workram;
1413extern UINT8 *victnine_workram;
r2454r2455
7170   if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02))
7271   {
7372      portA_in = from_main;
74      if (main_sent) cpunum_set_input_line(Machine, 2,0,CLEAR_LINE);
73      if (main_sent) cpunum_set_input_line(machine, 2,0,CLEAR_LINE);
7574      main_sent = 0;
7675logerror("read command %02x from main cpu\n",portA_in);
7776   }
r2454r2455
118117logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data);
119118   from_main = data;
120119   main_sent = 1;
121   cpunum_set_input_line(Machine, 2,0,ASSERT_LINE);
120   cpunum_set_input_line(machine, 2,0,ASSERT_LINE);
122121}
123122
124123READ8_HANDLER( flstory_mcu_r )
src/mame/machine/segas32.c
r2454r2455
124124{
125125   UINT16 level;
126126//Perform write
127   system32_workram[CLEARED_LEVELS / 2] = (data & ~mem_mask) | (system32_workram[CLEARED_LEVELS / 2] & mem_mask);
127   system32_workram[CLEARED_LEVELS / 2] = (data & mem_mask) | (system32_workram[CLEARED_LEVELS / 2] & ~mem_mask);
128128
129129//Refresh current level
130130      if (system32_workram[CLEARED_LEVELS / 2] == 0)
r2454r2455
155155// and can write things into work RAM.  we simulate that here for burning rival.
156156READ16_HANDLER(brival_protection_r)
157157{
158   if (!mem_mask)   // only trap on word-wide reads
158   if (mem_mask == 0xffff)   // only trap on word-wide reads
159159   {
160160      switch (offset)
161161      {
r2454r2455
244244WRITE16_HANDLER( darkedge_protection_w )
245245{
246246   logerror("%06x:darkedge_prot_w(%06X) = %04X & %04X\n",
247      activecpu_get_pc(), 0xa00000 + 2*offset, data, mem_mask ^ 0xffff);
247      activecpu_get_pc(), 0xa00000 + 2*offset, data, mem_mask);
248248}
249249
250250
251251READ16_HANDLER( darkedge_protection_r )
252252{
253253   logerror("%06x:darkedge_prot_r(%06X) & %04X\n",
254      activecpu_get_pc(), 0xa00000 + 2*offset, mem_mask ^ 0xffff);
254      activecpu_get_pc(), 0xa00000 + 2*offset, mem_mask);
255255   return 0xffff;
256256}
257257
src/mame/machine/slapfght.c
r2454r2455
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1211
1312
1413UINT8 *slapfight_dpram;
r2454r2455
6463/* Reset and hold sound CPU */
6564WRITE8_HANDLER( slapfight_port_00_w )
6665{
67   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
66   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
6867   getstar_sh_intenabled = 0;
6968}
7069
7170/* Release reset on sound CPU */
7271WRITE8_HANDLER( slapfight_port_01_w )
7372{
74   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
73   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
7574}
7675
7776/* Disable and clear hardware interrupt */
r2454r2455
192191   if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02))
193192   {
194193      portA_in = from_main;
195      if (main_sent) cpunum_set_input_line(Machine, 2,0,CLEAR_LINE);
194      if (main_sent) cpunum_set_input_line(machine, 2,0,CLEAR_LINE);
196195      main_sent = 0;
197196   }
198197   if ((ddrB & 0x04) && (data & 0x04) && (~portB_out & 0x04))
r2454r2455
233232   from_main = data;
234233   main_sent = 1;
235234   mcu_sent=0;
236   cpunum_set_input_line(Machine, 2,0,ASSERT_LINE);
235   cpunum_set_input_line(machine, 2,0,ASSERT_LINE);
237236}
238237
239238READ8_HANDLER( tigerh_mcu_r )
src/mame/machine/mhavoc.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "video/avgdvg.h"
109#include "sound/5220intf.h"
1110#include "cpu/m6502/m6502.h"
r2454r2455
6261WRITE8_HANDLER( mhavoc_alpha_irq_ack_w )
6362{
6463   /* clear the line and reset the clock */
65   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
64   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
6665   alpha_irq_clock = 0;
6766   alpha_irq_clock_enable = 1;
6867}
r2454r2455
7170WRITE8_HANDLER( mhavoc_gamma_irq_ack_w )
7271{
7372   /* clear the line and reset the clock */
74   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
73   cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
7574   gamma_irq_clock = 0;
7675}
7776
r2454r2455
320319   player_1 = (data >> 5) & 1;
321320
322321   /* Bit 3 = Gamma reset */
323   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
322   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
324323   if (!(data & 0x08))
325324   {
326325      logerror("\t\t\t\t*** resetting gamma processor. ***\n");
src/mame/machine/decocass.c
r2454r2455
55 ***********************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "cpu/m6502/m6502.h"
109#include "cpu/i8x41/i8x41.h"
1110#include "machine/decocass.h"
r2454r2455
136135{
137136   UINT8 data = soundlatch_r(machine, 0);
138137   LOG(4,("CPU #%d sound command <- $%02x\n", cpu_getactivecpu(), data));
139   cpunum_set_input_line(Machine, 1, M6502_IRQ_LINE, CLEAR_LINE);
138   cpunum_set_input_line(machine, 1, M6502_IRQ_LINE, CLEAR_LINE);
140139   decocass_sound_ack &= ~0x80;
141140   return data;
142141}
r2454r2455
182181WRITE8_HANDLER( decocass_quadrature_decoder_reset_w )
183182{
184183   /* just latch the analog controls here */
185   decocass_quadrature_decoder[0] = input_port_3_r(machine, 0);
186   decocass_quadrature_decoder[1] = input_port_4_r(machine, 0);
187   decocass_quadrature_decoder[2] = input_port_5_r(machine, 0);
188   decocass_quadrature_decoder[3] = input_port_6_r(machine, 0);
184   decocass_quadrature_decoder[0] = input_port_read_indexed(machine,3);
185   decocass_quadrature_decoder[1] = input_port_read_indexed(machine,4);
186   decocass_quadrature_decoder[2] = input_port_read_indexed(machine,5);
187   decocass_quadrature_decoder[3] = input_port_read_indexed(machine,6);
189188}
190189
191190WRITE8_HANDLER( decocass_adc_w )
r2454r2455
282281   decocass_reset = data;
283282
284283   /* CPU #1 active hight reset */
285   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, data & 0x01 );
284   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, data & 0x01 );
286285
287286   /* on reset also remove the sound timer */
288287   if (data & 1)
289288      timer_adjust_oneshot(decocass_sound_timer, attotime_never, 0);
290289
291290   /* 8041 active low reset */
292   cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 0x08) ^ 0x08 );
291   cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (data & 0x08) ^ 0x08 );
293292}
294293
295294static const char *dirnm(int speed)
src/mame/machine/twincobr.c
r2454r2455
159159   if (data == 0) {
160160      if (dsp_execute) {
161161         LOG(("Turning the main CPU on\n"));
162         cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, CLEAR_LINE);
162         cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, CLEAR_LINE);
163163         dsp_execute = 0;
164164      }
165165      twincobr_dsp_BIO = ASSERT_LINE;
src/mame/machine/konppc.c
r2454r2455
147147            pci_bridge_enable[cgboard_id] = (data & 0x20000000) ? 1 : 0;
148148
149149            if (data & 0x10000000)
150               cpunum_set_input_line(Machine, dsp, INPUT_LINE_RESET, CLEAR_LINE);
150               cpunum_set_input_line(machine, dsp, INPUT_LINE_RESET, CLEAR_LINE);
151151            else
152               cpunum_set_input_line(Machine, dsp, INPUT_LINE_RESET, ASSERT_LINE);
152               cpunum_set_input_line(machine, dsp, INPUT_LINE_RESET, ASSERT_LINE);
153153
154154            if (data & 0x02000000)
155               cpunum_set_input_line(Machine, dsp, INPUT_LINE_IRQ0, ASSERT_LINE);
155               cpunum_set_input_line(machine, dsp, INPUT_LINE_IRQ0, ASSERT_LINE);
156156
157157            if (data & 0x04000000)
158               cpunum_set_input_line(Machine, dsp, INPUT_LINE_IRQ1, ASSERT_LINE);
158               cpunum_set_input_line(machine, dsp, INPUT_LINE_IRQ1, ASSERT_LINE);
159159         }
160160
161161         if (ACCESSING_BITS_0_7)
r2454r2455
184184{
185185   if (cgboard_id < MAX_CG_BOARDS)
186186   {
187      cpu_trigger(Machine, 10000);      // Remove the timeout (a part of the GTI Club FIFO test workaround)
187      cpu_trigger(machine, 10000);      // Remove the timeout (a part of the GTI Club FIFO test workaround)
188188      COMBINE_DATA(dsp_shared_ram[cgboard_id] + (offset + (dsp_shared_ram_bank[cgboard_id] * DSP_BANK_SIZE_WORD)));
189189   }
190190}
src/mame/machine/leland.c
r2454r2455
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110#include "machine/eeprom.h"
1211#include "cpu/z80/z80.h"
1312#include "leland.h"
src/mame/machine/midwayic.c
r2454r2455
853853{
854854   UINT32 result = 0;
855855   if (ACCESSING_BITS_0_15)
856      result |= midway_ioasic_r(machine, offset*2, 0xffff0000) & 0xffff;
856      result |= midway_ioasic_r(machine, offset*2, 0x0000ffff) & 0xffff;
857857   if (ACCESSING_BITS_16_31)
858      result |= (midway_ioasic_r(machine, offset*2+1, 0xffff0000) & 0xffff) << 16;
858      result |= (midway_ioasic_r(machine, offset*2+1, 0x0000ffff) & 0xffff) << 16;
859859   return result;
860860}
861861
r2454r2455
949949WRITE32_HANDLER( midway_ioasic_packed_w )
950950{
951951   if (ACCESSING_BITS_0_15)
952      midway_ioasic_w(machine, offset*2, data & 0xffff, 0xffff0000);
952      midway_ioasic_w(machine, offset*2, data & 0xffff, 0x0000ffff);
953953   if (ACCESSING_BITS_16_31)
954      midway_ioasic_w(machine, offset*2+1, data >> 16, 0xffff0000);
954      midway_ioasic_w(machine, offset*2+1, data >> 16, 0x0000ffff);
955955}
956956
957957
r2454r2455
10751075
10761076   /* offset 0 is a special case */
10771077   if (offset == 0)
1078      result = ide_controller32_r(device, ideoffs, 0xffff0000);
1078      result = ide_controller32_r(device, ideoffs, 0x0000ffff);
10791079
10801080   /* everything else is byte-sized */
10811081   else
1082      result = ide_controller32_r(device, ideoffs, ~(0xff << shift)) >> shift;
1082      result = ide_controller32_r(device, ideoffs, 0xff << shift) >> shift;
10831083   return result;
10841084}
10851085
r2454r2455
10921092
10931093   /* offset 0 is a special case */
10941094   if (offset == 0)
1095      ide_controller32_w(device, ideoffs, data, 0xffff0000);
1095      ide_controller32_w(device, ideoffs, data, 0x0000ffff);
10961096
10971097   /* everything else is byte-sized */
10981098   else
1099      ide_controller32_w(device, ideoffs, data << shift, ~(0xff << shift));
1099      ide_controller32_w(device, ideoffs, data << shift, 0xff << shift);
11001100}
src/mame/machine/konamigx.c
r2454r2455
536536
537537   // cull off-screen objects
538538   if (dst_x > dst_maxx || dst_y > dst_maxy) return;
539   if ((nozoom = (scalex == 0x10000 && scaley == 0x10000)))
539   nozoom = (scalex == 0x10000 && scaley == 0x10000);
540   if (nozoom)
540541   {
541542      dst_h = dst_w = 16;
542543      src_fdy = src_fdx = 1;
r2454r2455
12461247
12471248
12481249   // abort if object database failed to initialize
1249   if (!(objpool = gx_objpool)) return;
1250   objpool = gx_objpool;
1251   if (!objpool) return;
12501252
12511253   // clear screen with backcolor and update flicker pulse
12521254   K054338_fill_backcolor(machine, bitmap, konamigx_wrport1_0 & 0x20);
12531255   parity ^= 1;
12541256
12551257   // abort if video has been disabled
1256   if (!(disp = K055555_read_register(K55_INPUT_ENABLES))) return;
1258   disp = K055555_read_register(K55_INPUT_ENABLES);
1259   if (!disp) return;
12571260   cltc_shdpri = K054338_read_register(K338_REG_CONTROL);
12581261   if (!(cltc_shdpri & K338_CTL_KILL)) return;
12591262
r2454r2455
14371440      }
14381441      else
14391442      {
1440         if ((shadow = k>>10 & 3)) // object has shadow?
1443         shadow = k>>10 & 3;
1444         if (shadow) // object has shadow?
14411445         {
14421446            if (shadow != 1 || K053246_objset1 & 0x20)
14431447            {
r2454r2455
16701674      alpha = 255;
16711675      if (drawmode & 2)
16721676      {
1673         if ((alpha = color>>K055555_MIXSHIFT & 3)) alpha = K054338_set_alpha_level(alpha);
1677         alpha = color>>K055555_MIXSHIFT & 3;
1678         if (alpha) alpha = K054338_set_alpha_level(alpha);
16741679         if (alpha <= 0) continue;
16751680      }
16761681      color &= K055555_COLORMASK;
r2454r2455
22192224      srcend = src + count * 0x30;
22202225      do
22212226      {
2222         if (!src[0] || !(i = src[7] & 0xf)) continue; // reject retired or zero-element groups
2227         if (!src[0]) continue;
2228         i = src[7] & 0xf;
2229         if (!i) continue; // reject retired or zero-element groups
22232230         i <<= 2;
22242231         hoffs = src[5]>>16;
22252232         voffs = src[6]>>16;
src/mame/machine/toaplan1.c
r2454r2455
160160{
161161   /* Bit 0x80 is secondary CPU (HD647180) ready signal */
162162   logerror("PC:%04x Warning !!! IO reading from $14000a\n",activecpu_get_previouspc());
163   return (0x80 | input_port_6_word_r(machine,0,0)) & 0xff;
163   return (0x80 | input_port_read_indexed(machine,6)) & 0xff;
164164}
165165
166166READ16_HANDLER( vimana_input_port_5_word_r )
167167{
168168   int data, p;
169169
170   p = input_port_5_word_r(machine,0,0);
170   p = input_port_read_indexed(machine,5);
171171   vimana_latch ^= p;
172172   data = (vimana_latch & p );
173173
src/mame/machine/stvcd.c
r2454r2455
13511351
13521352      case 0x98000:
13531353      case 0x18000:
1354         if (mem_mask == 0)
1354         if (mem_mask == 0xffffffff)
13551355         {
13561356            rv = cd_readLong(offset);
13571357         }
1358         else if (mem_mask == 0x0000ffff)
1358         else if (mem_mask == 0xffff0000)
13591359         {
13601360            rv = cd_readWord(offset)<<16;
13611361         }
1362         else if (mem_mask == 0xffff0000)
1362         else if (mem_mask == 0x0000ffff)
13631363         {
13641364            rv = cd_readWord(offset);
13651365         }
src/mame/machine/dc.c
r2454r2455
55*/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "debugger.h"
109#include "dc.h"
1110#include "cpu/sh4/sh4.h"
r2454r2455
142141   *shift = 0;
143142
144143   // non 32-bit accesses have not yet been seen here, we need to know when they are
145   if ((mem_mask != U64(0x00000000ffffffff)) && (mem_mask != U64(0xffffffff00000000)))
144   if ((mem_mask != U64(0xffffffff00000000)) && (mem_mask != U64(0x00000000ffffffff)))
146145   {
147146      mame_printf_verbose("Wrong mask! (PC=%x)\n", activecpu_get_pc());
148147      #ifdef ENABLE_DEBUGGER
r2454r2455
150149      #endif
151150   }
152151
153   if (mem_mask == U64(0x00000000ffffffff))
152   if (mem_mask == U64(0xffffffff00000000))
154153   {
155154      reg++;
156155      *shift = 32;
r2454r2455
633632{
634633   UINT32 off;
635634
636   if ((int)mem_mask & 1)
635   if ((int)~mem_mask & 1)
637636   {
638637      off=(offset << 1) | 1;
639638   }
r2454r2455
654653{
655654   UINT32 dat,off;
656655
657   if ((int)mem_mask & 1)
656   if ((int)~mem_mask & 1)
658657   {
659658      dat=(UINT32)(data >> 32);
660659      off=(offset << 1) | 1;
r2454r2455
748747
749748   // from ElSemi: this makes Atomiswave do it's "verbose boot" with a Sammy logo and diagnostics instead of just running the cart.
750749   // our PVR emulation is apparently not good enough for that to work yet though.
751   if ((reg == 0x280/4) && (mem_mask == U64(0xffffffff00000000)))
750   if ((reg == 0x280/4) && (mem_mask == U64(0x00000000ffffffff)))
752751   {
753752      return 1;
754753   }
r2454r2455
850849
851850//  mame_printf_verbose("AICA REG: [%08x] read %llx, mask %llx\n", 0x700000+reg*4, (UINT64)offset, mem_mask);
852851
853   return (UINT64) AICA_0_r(machine, offset*2, 0x0000)<<shift;
852   return (UINT64) AICA_0_r(machine, offset*2, 0xffff)<<shift;
854853}
855854
856855WRITE64_HANDLER( dc_aica_reg_w )
r2454r2455
867866      if (dat & 1)
868867      {
869868         /* halt the ARM7 */
870         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
869         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
871870      }
872871      else
873872      {
874873         /* it's alive ! */
875         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
874         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
876875      }
877876        }
878877
r2454r2455
883882
884883READ32_HANDLER( dc_arm_aica_r )
885884{
886   return AICA_0_r(machine, offset*2, 0x0000);
885   return AICA_0_r(machine, offset*2, 0xffff);
887886}
888887
889888WRITE32_HANDLER( dc_arm_aica_w )
src/mame/machine/scramble.c
r2454r2455
6464   MACHINE_RESET_CALL(galaxold);
6565}
6666
67static READ8_HANDLER( scrambls_input_port_2_r )
68{
69  static const UINT8 mask[] = { 0x20, 0x20, 0x80, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0 };
7067
71   UINT8 res;
72
73   res = input_port_read_indexed(machine, 2);
74
75/*logerror("%04x: read IN2\n",activecpu_get_pc());*/
76
77  /*
78    p_security_2B : process(security_count)
79    begin
80      -- I am not sure what this chip does yet, but this gets us past the initial check for now.
81      case security_count is
82        when "000" => net_1e10_i <= '0'; net_1e12_i <= '1';
83        when "001" => net_1e10_i <= '0'; net_1e12_i <= '1';
84        when "010" => net_1e10_i <= '1'; net_1e12_i <= '0';
85        when "011" => net_1e10_i <= '1'; net_1e12_i <= '1';
86        when "100" => net_1e10_i <= '1'; net_1e12_i <= '1';
87        when "101" => net_1e10_i <= '1'; net_1e12_i <= '1';
88        when "110" => net_1e10_i <= '1'; net_1e12_i <= '1';
89        when "111" => net_1e10_i <= '1'; net_1e12_i <= '1';
90        when others => null;
91      end case;
92    end process;
93  */
94  res = (res & ~((1<<7)|(1<<5))) | mask[security_2B_counter];
95  security_2B_counter = (security_2B_counter + 1) & 0x07;
96
97   return res;
98}
99
10068static READ8_HANDLER( ckongs_input_port_1_r )
10169{
10270   return (input_port_read_indexed(machine, 1) & 0xfc) | ((input_port_read_indexed(machine, 2) & 0x06) >> 1);
r2454r2455
182150   }
183151}
184152
185static READ8_HANDLER( scrambls_protection_r )
186{
187   /*logerror("%04x: read protection\n",activecpu_get_pc());*/
188153
189  /*
190    p_security_6J : process(xb)
191    begin
192      -- chip K10A PAL16L8
193      -- equations from Mark @ http://www.leopardcats.com/
194      xbo(3 downto 0) <= xb(3 downto 0);
195      xbo(4) <= not(xb(0) or xb(1) or xb(2) or xb(3));
196      xbo(5) <= not((not xb(2) and not xb(0)) or (not xb(2) and not xb(1)) or (not xb(3) and not xb(0)) or (not xb(3) and not xb(1)));
197
198      xbo(6) <= not(not xb(0) and not xb(3));
199      xbo(7) <= not((not xb(1)) or xb(2));
200    end process;
201  */
202  UINT8 xbo = xb & 0x0f;
203
204  xbo |= ( ~(xb | (xb>>1) | (xb>>2) | (xb>>3)) & 0x01) << 4;
205  xbo |= ( ~( (~(xb>>2)&~xb) | (~(xb>>2)&~(xb>>1)) | (~(xb>>3)&~xb) | (~(xb>>3)&~(xb>>1)) ) & 0x01) << 5;
206  xbo |= ( ~(~xb&~(xb>>3)) & 0x01) << 6;
207  xbo |= ( ~(~(xb>>1)|(xb>>2)) & 0x01) << 7;
208
209  return (xbo);
210}
211
212
213static WRITE8_HANDLER( theend_coin_counter_w )
214{
215   coin_counter_w(0, data & 0x80);
216}
217
218
219154static READ8_HANDLER( mariner_protection_1_r )
220155{
221156   return 7;
r2454r2455
259194   cavelon_banksw();
260195
261196   if      ((offset >= 0x0100) && (offset <= 0x0103))
262      return ppi8255_0_r(machine, offset - 0x0100);
197      return ppi8255_r((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), offset - 0x0100);
263198   else if ((offset >= 0x0200) && (offset <= 0x0203))
264      return ppi8255_1_r(machine, offset - 0x0200);
199      return ppi8255_r((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset - 0x0200);
265200
266201   return 0xff;
267202}
r2454r2455
271206   cavelon_banksw();
272207
273208   if      ((offset >= 0x0100) && (offset <= 0x0103))
274      ppi8255_0_w(machine, offset - 0x0100, data);
209      ppi8255_w((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), offset - 0x0100, data);
275210   else if ((offset >= 0x0200) && (offset <= 0x0203))
276      ppi8255_1_w(machine, offset - 0x0200, data);
211      ppi8255_w((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset - 0x0200, data);
277212}
278213
279214
r2454r2455
288223}
289224
290225
291static const ppi8255_interface ppi8255_intf =
226const ppi8255_interface scramble_ppi_ppi8255_intf[2] =
292227{
293   2,                         /* 2 chips */
294   {input_port_0_r, 0},         /* Port A read */
295   {input_port_1_r, 0},         /* Port B read */
296   {input_port_2_r, 0},         /* Port C read */
297   {0, soundlatch_w},            /* Port A write */
298   {0, scramble_sh_irqtrigger_w},   /* Port B write */
299   {0, 0},                   /* Port C write */
228   {
229      input_port_0_r,            /* Port A read */
230      input_port_1_r,            /* Port B read */
231      input_port_2_r,            /* Port C read */
232      NULL,                  /* Port A write */
233      NULL,                  /* Port B write */
234      NULL                   /* Port C write */
235   },
236   {
237      NULL,                  /* Port A read */
238      NULL,                  /* Port B read */
239      NULL,                  /* Port C read */
240      soundlatch_w,            /* Port A write */
241      scramble_sh_irqtrigger_w,   /* Port B write */
242      NULL                  /* Port C write */
243   }
300244};
301245
302/* extra chip for sample latch */
303static const ppi8255_interface sfx_ppi8255_intf =
246
247const ppi8255_interface stratgyx_ppi8255_intf[2] =
304248{
305   3,                            /* 3 chips */
306   {input_port_0_r, 0, soundlatch2_r},   /* Port A read */
307   {input_port_1_r, 0, 0},            /* Port B read */
308   {input_port_2_r, 0, 0},            /* Port C read */
309   {0, soundlatch_w, 0},            /* Port A write */
310   {0, scramble_sh_irqtrigger_w, 0},   /* Port B write */
311   {0, 0, 0},                      /* Port C write */
249   {
250      input_port_0_r,            /* Port A read */
251      input_port_1_r,            /* Port B read */
252      stratgyx_input_port_2_r,   /* Port C read */
253      NULL,                  /* Port A write */
254      NULL,                  /* Port B write */
255      NULL                   /* Port C write */
256   },
257   {
258      NULL,                  /* Port A read */
259      NULL,                  /* Port B read */
260      stratgyx_input_port_3_r,   /* Port C read */
261      soundlatch_w,            /* Port A write */
262      scramble_sh_irqtrigger_w,   /* Port B write */
263      NULL                  /* Port C write */
264   }
312265};
313266
314/* extra chip for sample latch */
315static const ppi8255_interface monsterz_ppi8255_intf =
267
268const ppi8255_interface moonwar_ppi8255_intf[2] =
316269{
317   3,                            /* 3 chips */
318   {input_port_0_r, 0, 0},   /* Port A read */
319   {input_port_1_r, 0, 0},            /* Port B read */
320   {input_port_2_r, 0, 0},            /* Port C read */
321   {0, soundlatch_w, 0},            /* Port A write */
322   {0, scramble_sh_irqtrigger_w, 0},   /* Port B write */
323   {0, 0, 0},                      /* Port C write */
270   {
271      moonwar_input_port_0_r,      /* Port A read */
272      input_port_1_r,            /* Port B read */
273      input_port_2_r,            /* Port C read */
274      NULL,                  /* Port A write */
275      NULL,                  /* Port B write */
276      moonwar_port_select_w       /* Port C write */
277   },
278   {
279      NULL,                  /* Port A read */
280      NULL,                  /* Port B read */
281      NULL,                  /* Port C read */
282      soundlatch_w,            /* Port A write */
283      scramble_sh_irqtrigger_w,   /* Port B write */
284      NULL                  /* Port C write */
285   }
324286};
325287
326288
327DRIVER_INIT( scramble_ppi )
289const ppi8255_interface darkplnt_ppi8255_intf[2] =
328290{
329   ppi8255_init(&ppi8255_intf);
330}
291   {
292      input_port_0_r,            /* Port A read */
293      darkplnt_input_port_1_r,   /* Port B read */
294      input_port_2_r,            /* Port C read */
295      NULL,                  /* Port A write */
296      NULL,                  /* Port B write */
297      NULL                   /* Port C write */
298   },
299   {
300      NULL,                  /* Port A read */
301      NULL,                  /* Port B read */
302      NULL,                  /* Port C read */
303      soundlatch_w,            /* Port A write */
304      scramble_sh_irqtrigger_w,   /* Port B write */
305      NULL                  /* Port C write */
306   }
307};
331308
332DRIVER_INIT( scobra )
309
310const ppi8255_interface scramble_ppi8255_intf[2] =
333311{
334   DRIVER_INIT_CALL(scramble_ppi);
312   {
313      input_port_0_r,            /* Port A read */
314      input_port_1_r,            /* Port B read */
315      input_port_2_r,            /* Port C read */
316      NULL,                  /* Port A write */
317      NULL,                  /* Port B write */
318      NULL                   /* Port C write */
319   },
320   {
321      NULL,                  /* Port A read */
322      NULL,                  /* Port B read */
323      scramble_protection_r,      /* Port C read */
324      soundlatch_w,            /* Port A write */
325      scramble_sh_irqtrigger_w,   /* Port B write */
326      scramble_protection_w      /* Port C write */
327   }
328};
335329
336   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa803, 0xa803, 0, 0, scrambold_background_enable_w);
337}
338330
339DRIVER_INIT( atlantis )
331const ppi8255_interface ckongs_ppi8255_intf[2] =
340332{
341   DRIVER_INIT_CALL(scramble_ppi);
333   {
334      input_port_0_r,            /* Port A read */
335      ckongs_input_port_1_r,      /* Port B read */
336      ckongs_input_port_2_r,      /* Port C read */
337      NULL,                  /* Port A write */
338      NULL,                  /* Port B write */
339      NULL                   /* Port C write */
340   },
341   {
342      NULL,                  /* Port A read */
343      NULL,                  /* Port B read */
344      NULL,                  /* Port C read */
345      soundlatch_w,            /* Port A write */
346      scramble_sh_irqtrigger_w,   /* Port B write */
347      NULL                  /* Port C write */
348   }
349};
342350
343   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6803, 0x6803, 0, 0, scrambold_background_enable_w);
344}
345351
346DRIVER_INIT( scramble )
352const ppi8255_interface mars_ppi8255_intf[2] =
347353{
348   DRIVER_INIT_CALL(atlantis);
354   {
355      input_port_0_r,            /* Port A read */
356      input_port_1_r,            /* Port B read */
357      input_port_2_r,            /* Port C read */
358      NULL,                  /* Port A write */
359      NULL,                  /* Port B write */
360      NULL                   /* Port C write */
361   },
362   {
363      NULL,                  /* Port A read */
364      NULL,                  /* Port B read */
365      input_port_3_r,            /* Port C read */
366      soundlatch_w,            /* Port A write */
367      scramble_sh_irqtrigger_w,   /* Port B write */
368      NULL                  /* Port C write */
369   }
370};
349371
350   ppi8255_set_portCread (1, scramble_protection_r);
351   ppi8255_set_portCwrite(1, scramble_protection_w);
352}
353372
354DRIVER_INIT( scrambls )
373const ppi8255_interface mrkougar_ppi8255_intf[2] =
355374{
356   DRIVER_INIT_CALL(atlantis);
375   {
376      input_port_0_r,            /* Port A read */
377      input_port_1_r,            /* Port B read */
378      input_port_2_r,            /* Port C read */
379      NULL,                  /* Port A write */
380      NULL,                  /* Port B write */
381      NULL                   /* Port C write */
382   },
383   {
384      NULL,                  /* Port A read */
385      NULL,                  /* Port B read */
386      NULL,                  /* Port C read */
387      soundlatch_w,            /* Port A write */
388      mrkougar_sh_irqtrigger_w,   /* Port B write */
389      NULL                  /* Port C write */
390   }
391};
357392
358   ppi8255_set_portCread(0, scrambls_input_port_2_r);
359   ppi8255_set_portCread(1, scrambls_protection_r);
360   ppi8255_set_portCwrite(1, scramble_protection_w);
393
394DRIVER_INIT( scramble_ppi )
395{
361396}
362397
363DRIVER_INIT( theend )
398DRIVER_INIT( scobra )
364399{
365   DRIVER_INIT_CALL(scramble_ppi);
400   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa803, 0xa803, 0, 0, scrambold_background_enable_w);
401}
366402
367   ppi8255_set_portCwrite(0, theend_coin_counter_w);
403DRIVER_INIT( atlantis )
404{
405   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6803, 0x6803, 0, 0, scrambold_background_enable_w);
368406}
369407
370DRIVER_INIT( stratgyx )
408DRIVER_INIT( scramble )
371409{
372   DRIVER_INIT_CALL(scramble_ppi);
410   DRIVER_INIT_CALL(atlantis);
411}
373412
413DRIVER_INIT( stratgyx )
414{
374415   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0, scrambold_background_green_w);
375416   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb002, 0xb002, 0, 0, scrambold_background_blue_w);
376417   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb00a, 0xb00a, 0, 0, scrambold_background_red_w);
377
378   ppi8255_set_portCread(0, stratgyx_input_port_2_r);
379   ppi8255_set_portCread(1, stratgyx_input_port_3_r);
380418}
381419
382420DRIVER_INIT( tazmani2 )
383421{
384   DRIVER_INIT_CALL(scramble_ppi);
385
386422   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb002, 0xb002, 0, 0, scrambold_background_enable_w);
387423}
388424
389DRIVER_INIT( amidar )
390{
391   DRIVER_INIT_CALL(scramble_ppi);
392
393   /* Amidar has a the DIP switches connected to port C of the 2nd 8255 */
394   ppi8255_set_portCread(1, input_port_3_r);
395}
396
397425DRIVER_INIT( ckongs )
398426{
399   DRIVER_INIT_CALL(scramble_ppi);
400
401   ppi8255_set_portBread(0, ckongs_input_port_1_r);
402   ppi8255_set_portCread(0, ckongs_input_port_2_r);
403427}
404428
405429DRIVER_INIT( mariner )
406430{
407   DRIVER_INIT_CALL(scramble_ppi);
408
409431   /* extra ROM */
410432   memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5800, 0x67ff, 0, 0, SMH_BANK1, SMH_UNMAP);
411433   memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x5800);
r2454r2455
422444   offs_t A;
423445   UINT8 *ROM;
424446
425
426   DRIVER_INIT_CALL(scramble_ppi);
427
428
429447   /* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */
430448   ROM = memory_region(REGION_CPU2);
431449   for (A = 0;A < 0x0800;A++)
r2454r2455
442460   offs_t A;
443461   UINT8 *ROM;
444462
445
446   DRIVER_INIT_CALL(scramble_ppi);
447
448463   /* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */
449464   ROM = memory_region(REGION_CPU2);
450465   for (A = 0;A < 0x0800;A++)
r2454r2455
456471   offs_t i;
457472   UINT8 *RAM;
458473
459
460   DRIVER_INIT_CALL(scramble_ppi);
461
462
463474   /* Address lines are scrambled on the main CPU */
464475
465476   /* A0 -> A2 */
r2454r2455
487498DRIVER_INIT( mars )
488499{
489500   DRIVER_INIT_CALL(devilfsh);
490
491   /* extra port */
492   ppi8255_set_portCread(1, input_port_3_r);
493501}
494502
495503DRIVER_INIT( hotshock )
r2454r2455
503511{
504512   UINT8 *ROM = memory_region(REGION_CPU1);
505513
506   DRIVER_INIT_CALL(scramble_ppi);
507
508514   /* banked ROM */
509515   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1);
510516   memory_configure_bank(1, 0, 2, &ROM[0x00000], 0x10000);
r2454r2455
521527
522528DRIVER_INIT( moonwar )
523529{
524   DRIVER_INIT_CALL(scramble_ppi);
525
526   /* special handler for the spinner */
527   ppi8255_set_portAread (0, moonwar_input_port_0_r);
528   ppi8255_set_portCwrite(0, moonwar_port_select_w);
529
530530   state_save_register_global(moonwar_port_select);
531531}
532532
533533DRIVER_INIT( darkplnt )
534534{
535   DRIVER_INIT_CALL(scramble_ppi);
536
537   /* special handler for the spinner */
538   ppi8255_set_portBread(0, darkplnt_input_port_1_r);
539
540535   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb00a, 0xb00a, 0, 0, darkplnt_bullet_color_w);
541536}
542537
r2454r2455
573568      ctr++;
574569   }
575570
576   DRIVER_INIT_CALL(scramble_ppi);
577
578571   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa804, 0xa804, 0, 0, scrambold_background_enable_w);
579572}
580573
581574DRIVER_INIT( mimonsco )
582575{
583   DRIVER_INIT_CALL(scramble_ppi);
584
585576   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa804, 0xa804, 0, 0, scrambold_background_enable_w);
586577}
587578
588579DRIVER_INIT( mimonscr )
589580{
590   DRIVER_INIT_CALL(scramble_ppi);
591
592581   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6804, 0x6804, 0, 0, scrambold_background_enable_w);
593582}
594583
r2454r2455
782771   offs_t A;
783772
784773
785   DRIVER_INIT_CALL(scramble_ppi);
786
787
788774   for (A = 0;A < 0x4000;A++)
789775   {
790776      UINT8 xormask;
r2454r2455
824810   offs_t A;
825811
826812
827   DRIVER_INIT_CALL(scramble_ppi);
828
829
830813   for (A = 0;A < 0x4000;A++)
831814   {
832815      UINT8 xormask;
r2454r2455
874857DRIVER_INIT( mrkougar )
875858{
876859   DRIVER_INIT_CALL(devilfsh);
877
878   /* no sound enabled bit */
879   ppi8255_set_portBwrite(1, mrkougar_sh_irqtrigger_w);
880860}
881861
882862DRIVER_INIT( mrkougb )
883863{
884   DRIVER_INIT_CALL(scramble_ppi);
885
886   /* no sound enabled bit */
887   ppi8255_set_portBwrite(1, mrkougar_sh_irqtrigger_w);
888864}
889865
890DRIVER_INIT( sfx )
891{
892   ppi8255_init(&sfx_ppi8255_intf);
893}
894
895DRIVER_INIT( monsterz )
896{
897   ppi8255_init(&monsterz_ppi8255_intf);
898
899   /* extra ROM */
900   memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, SMH_BANK1);
901   memory_set_bankptr(1, memory_region(REGION_CPU2) + 0x3000);
902}
903
904static READ8_HANDLER( scorpion_prot_r )
905{
906   /* HACK! return register C */
907   return activecpu_get_reg(Z80_C) & 0xff;
908}
909
910static READ8_HANDLER( scorpion_sound_status_r )
911{
912   return 1;
913}
914
915DRIVER_INIT( scorpion )
916{
917   ppi8255_init(&ppi8255_intf);
918
919   ppi8255_set_portCread(1, scorpion_prot_r);
920
921   /* extra ROM */
922   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5800, 0x67ff, 0, 0, SMH_BANK1);
923   memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x5800);
924
925   /* no background related */
926   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6803, 0x6803, 0, 0, SMH_NOP);
927
928   memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3000, 0, 0, scorpion_sound_status_r);
929}
930
931866DRIVER_INIT( ad2083 )
932867{
933868   UINT8 c;
src/mame/machine/pitnrun.c
r2454r2455
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1211#include "cpu/m6805/m6805.h"
1312
1413
r2454r2455
110109   {
111110      /* 68705 is going to read data from the Z80 */
112111      timer_call_after_resynch(NULL, 0,pitnrun_mcu_data_real_r);
113      cpunum_set_input_line(Machine, 2,0,CLEAR_LINE);
112      cpunum_set_input_line(machine, 2,0,CLEAR_LINE);
114113      portA_in = fromz80;
115114   }
116115   if (~data & 0x04)
src/mame/machine/namcos1.c
r2454r2455
586586      namcos1_reset = data & 1;
587587   }
588588
589   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
590   cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
591   cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
589   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
590   cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
591   cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
592592}
593593
594594
src/mame/machine/segaic16.c
r2454r2455
410410
411411READ16_HANDLER( segaic16_memory_mapper_lsb_r )
412412{
413   return memory_mapper_r(&memory_mapper, offset, segaic16_open_bus_r(machine,0,0));
413   return memory_mapper_r(&memory_mapper, offset, segaic16_open_bus_r(machine,0,0xffff));
414414}
415415
416416
src/mame/machine/buggychl.c
r2454r2455
11#include "driver.h"
2#include "deprecat.h"
32#include "cpu/z80/z80.h"
43
54
r2454r2455
7574   if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02))
7675   {
7776      portA_in = from_main;
78      if (main_sent) cpunum_set_input_line(Machine, 2,0,CLEAR_LINE);
77      if (main_sent) cpunum_set_input_line(machine, 2,0,CLEAR_LINE);
7978      main_sent = 0;
8079logerror("read command %02x from main cpu\n",portA_in);
8180   }
r2454r2455
132131logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data);
133132   from_main = data;
134133   main_sent = 1;
135   cpunum_set_input_line(Machine, 2,0,ASSERT_LINE);
134   cpunum_set_input_line(machine, 2,0,ASSERT_LINE);
136135}
137136
138137READ8_HANDLER( buggychl_mcu_r )
src/mame/machine/n64.c
r2454r2455
314314                    //  cpu_spinuntil_trigger(6789);
315315
316316                        // printf( "Clearing RSP_STATUS_HALT\n" );
317                        cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
317                        cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
318318                        cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) & ~RSP_STATUS_HALT );
319319                        // RSP_STATUS &= ~RSP_STATUS_HALT;
320320                    //}
r2454r2455
326326                if (data & 0x00000002)      // set halt
327327                {
328328                    // printf( "Setting RSP_STATUS_HALT\n" );
329                    cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
329                    cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
330330                    cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) | RSP_STATUS_HALT );
331331                    // RSP_STATUS |= RSP_STATUS_HALT;
332332                }
r2454r2455
15341534
15351535READ32_HANDLER( n64_pif_ram_r )
15361536{
1537    /*mame_printf_debug( "pif_ram_r: %08X, %08X = %08X\n", offset << 2, mem_mask, ( ( pif_ram[offset*4+0] << 24 ) | ( pif_ram[offset*4+1] << 16 ) | ( pif_ram[offset*4+2] <<  8 ) | ( pif_ram[offset*4+3] <<  0 ) ) & ~mem_mask );*/
1537    /*mame_printf_debug( "pif_ram_r: %08X, %08X = %08X\n", offset << 2, mem_mask, ( ( pif_ram[offset*4+0] << 24 ) | ( pif_ram[offset*4+1] << 16 ) | ( pif_ram[offset*4+2] <<  8 ) | ( pif_ram[offset*4+3] <<  0 ) ) & mem_mask );*/
15381538    if( offset == ( 0x24 / 4 ) )
15391539    {
15401540        cic_status = 0x00000080;
r2454r2455
15431543    {
15441544        return cic_status;
15451545    }
1546    return ( ( pif_ram[offset*4+0] << 24 ) | ( pif_ram[offset*4+1] << 16 ) | ( pif_ram[offset*4+2] <<  8 ) | ( pif_ram[offset*4+3] <<  0 ) ) & ~mem_mask;
1546    return ( ( pif_ram[offset*4+0] << 24 ) | ( pif_ram[offset*4+1] << 16 ) | ( pif_ram[offset*4+2] <<  8 ) | ( pif_ram[offset*4+3] <<  0 ) ) & mem_mask;
15471547}
15481548
15491549WRITE32_HANDLER( n64_pif_ram_w )
15501550{
15511551    /*mame_printf_debug("pif_ram_w: %08X, %08X, %08X\n", data, offset << 4, mem_mask);*/
15521552    /*
1553    if( (~mem_mask) & 0xff000000 )
1553    if( mem_mask & 0xff000000 )
15541554    {
15551555        pif_ram[offset*4+0] = ( data >> 24 ) & 0x000000ff;
15561556    }
1557    if( (~mem_mask) & 0x00ff0000 )
1557    if( mem_mask & 0x00ff0000 )
15581558    {
15591559        pif_ram[offset*4+1] = ( data >> 16 ) & 0x000000ff;
15601560    }
1561    if( (~mem_mask) & 0x0000ff00 )
1561    if( mem_mask & 0x0000ff00 )
15621562    {
15631563        pif_ram[offset*4+2] = ( data >>  8 ) & 0x000000ff;
15641564    }
1565    if( (~mem_mask) & 0x000000ff )
1565    if( mem_mask & 0x000000ff )
15661566    {
15671567        pif_ram[offset*4+3] = ( data >>  0 ) & 0x000000ff;
15681568    }
src/mame/machine/tait8741.c
r2454r2455
88*/
99
1010#include "driver.h"
11#include "deprecat.h"
1211#include "tait8741.h"
1312
1413#define VERBOSE 0
src/mame/machine/balsente.c
r2454r2455
10141014   counter_set_gate(0, (data >> 1) & 1);
10151015
10161016   /* bits D2 and D4 control the clear/reset flags on the flip-flop that feeds counter 0 */
1017   if (!(data & 0x04)) set_counter_0_ff(Machine, 1);
1018   if (!(data & 0x10)) set_counter_0_ff(Machine, 0);
1017   if (!(data & 0x04)) set_counter_0_ff(machine, 1);
1018   if (!(data & 0x10)) set_counter_0_ff(machine, 0);
10191019
10201020   /* bit 5 clears the NMI interrupt; recompute the I/O state now */
10211021   m6850_update_io();
r2454r2455
12191219
12201220READ8_HANDLER( shrike_shared_6809_r )
12211221{
1222  UINT16 mem_mask = offset & 1 ? 0xff : 0xff00;
1222  UINT16 mem_mask = offset & 1 ? 0xff00 : 0x00ff;
12231223
12241224  switch( offset )
12251225  {
12261226    case 6: // return OK for 68k status register until motors hooked up
12271227      return 0;
12281228    default:
1229      return ( shrike_shared[offset >> 1] & mem_mask ) >> ( ~mem_mask & 8 );
1229      return ( shrike_shared[offset >> 1] & ~mem_mask ) >> ( mem_mask & 8 );
12301230  }
12311231}
12321232
12331233
12341234WRITE8_HANDLER( shrike_shared_6809_w )
12351235{
1236  UINT16 mem_mask = offset & 1 ? 0xff : 0xff00;
1237  shrike_shared[offset >> 1] = ( shrike_shared[offset >> 1] & ~mem_mask ) | ( data << ( ~mem_mask & 0x8 ) );
1236  UINT16 mem_mask = offset & 1 ? 0xff00 : 0x00ff;
1237  shrike_shared[offset >> 1] = ( shrike_shared[offset >> 1] & mem_mask ) | ( data << ( mem_mask & 0x8 ) );
12381238}
12391239
12401240// uses movep, so writes even 8 bit addresses to odd 16 bit addresses, reads as 16 bit from odd addresses
r2454r2455
12461246
12471247READ16_HANDLER( shrike_io_68k_r )
12481248{
1249  return ( shrike_io[offset] & ~mem_mask ) >> ( 8 & mem_mask );
1249  return ( shrike_io[offset] & mem_mask ) >> ( 8 & ~mem_mask );
12501250}
12511251
src/mame/machine/vsnes.c
r2454r2455
11711171static WRITE8_HANDLER ( set_bnglngby_irq_w )
11721172{
11731173   ret = data;
1174   cpunum_set_input_line(Machine, 0, 0, ( data & 2 ) ? ASSERT_LINE : CLEAR_LINE );
1174   cpunum_set_input_line(machine, 0, 0, ( data & 2 ) ? ASSERT_LINE : CLEAR_LINE );
11751175   /* other values ??? */
11761176   /* 0, 4, 84 */
11771177}
r2454r2455
12571257   ppu2c0x_set_videorom_bank( cpu_getactivecpu(), 0, 8, ( data & 4 ) ? 1 : 0, 512 );
12581258
12591259   /* bit 1 ( data & 2 ) triggers irq on the other cpu */
1260   cpunum_set_input_line(Machine, other_cpu, 0, ( data & 2 ) ? CLEAR_LINE : ASSERT_LINE );
1260   cpunum_set_input_line(machine, other_cpu, 0, ( data & 2 ) ? CLEAR_LINE : ASSERT_LINE );
12611261
12621262   /* move along */
12631263   if ( cpu_getactivecpu() == 0 )
src/mame/machine/snes.c
r2454r2455
14311431      case MEMSEL:   /* Access cycle designation in memory (2) area */
14321432         /* FIXME: Need to adjust the speed only during access of banks 0x80+
14331433             * Currently we are just increasing it no matter what */
1434//          cpunum_set_clockscale(Machine, 0, (data & 0x1) ? 1.335820896 : 1.0 );
1434//          cpunum_set_clockscale(machine, 0, (data & 0x1) ? 1.335820896 : 1.0 );
14351435#ifdef SNES_DBG_REG_W
14361436         if( (data & 0x1) != (snes_ram[MEMSEL] & 0x1) )
14371437            mame_printf_debug( "CPU speed: %f Mhz\n", (data & 0x1) ? 3.58 : 2.68 );
src/mame/machine/taitosj.c
r2454r2455
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1211#include "cpu/m6805/m6805.h"
1312
1413
r2454r2455
203202   {
204203      /* 68705 is going to read data from the Z80 */
205204      timer_call_after_resynch(NULL, 0,taitosj_mcu_data_real_r);
206      cpunum_set_input_line(Machine, 2,0,CLEAR_LINE);
205      cpunum_set_input_line(machine, 2,0,CLEAR_LINE);
207206      portA_in = fromz80;
208207      LOG(("%04x: 68705 <- Z80 %02x\n",activecpu_get_pc(),portA_in));
209208   }
r2454r2455
317316
318317READ8_HANDLER( alpine_port_2_r )
319318{
320   return input_port_2_r(machine,offset) | protection_value;
319   return input_port_read_indexed(machine,2) | protection_value;
321320}
src/mame/machine/amiga.c
r2454r2455
320320   }
321321   else
322322   {
323      amiga_cia_w(Machine, 0x1001/2, 1, 0);
323      amiga_cia_w(Machine, 0x1001/2, 1, 0xffff);
324324   }
325325
326326   if (activecpu_get_pc() < 0x80000)
r2454r2455
345345   }
346346   else
347347   {
348      amiga_cia_w(machine, 0x1001/2, 1, 0);
348      amiga_cia_w(machine, 0x1001/2, 1, 0xffff);
349349   }
350350
351351   /* call the system-specific callback */
r2454r2455
372372   if (scanline == 0)
373373   {
374374      /* signal VBLANK IRQ */
375      amiga_custom_w(machine, REG_INTREQ, 0x8000 | INTENA_VERTB, 0);
375      amiga_custom_w(machine, REG_INTREQ, 0x8000 | INTENA_VERTB, 0xffff);
376376
377377      /* clock the first CIA TOD */
378378      cia_clock_tod(0);
r2454r2455
982982   CUSTOM_REG(REG_DMACON) &= ~0x4000;
983983
984984   /* signal an interrupt */
985   amiga_custom_w(machine, REG_INTREQ, 0x8000 | INTENA_BLIT, 0);
985   amiga_custom_w(machine, REG_INTREQ, 0x8000 | INTENA_BLIT, 0xffff);
986986
987987   /* reset the blitter timer */
988988   timer_reset( amiga_blitter_timer, attotime_never);
r2454r2455
10831083   data = cia_read(which, offset >> 7);
10841084
10851085   if (LOG_CIA)
1086      logerror("%06x:cia_%c_read(%03x) = %04x & %04x\n", safe_activecpu_get_pc(), 'A' + ((~offset & 0x0800) >> 11), offset * 2, data << shift, mem_mask ^ 0xffff);
1086      logerror("%06x:cia_%c_read(%03x) = %04x & %04x\n", safe_activecpu_get_pc(), 'A' + ((~offset & 0x0800) >> 11), offset * 2, data << shift, mem_mask);
10871087
10881088   return data << shift;
10891089}
r2454r2455
11011101   int which;
11021102
11031103   if (LOG_CIA)
1104      logerror("%06x:cia_%c_write(%03x) = %04x & %04x\n", safe_activecpu_get_pc(), 'A' + ((~offset & 0x0800) >> 11), offset * 2, data, mem_mask ^ 0xffff);
1104      logerror("%06x:cia_%c_write(%03x) = %04x & %04x\n", safe_activecpu_get_pc(), 'A' + ((~offset & 0x0800) >> 11), offset * 2, data, mem_mask);
11051105
11061106   /* offsets 0000-07ff reference CIA B, and are accessed via the MSB */
11071107   if ((offset & 0x0800) == 0)
r2454r2455
11351135
11361136static void amiga_cia_0_irq(int state)
11371137{
1138   amiga_custom_w(Machine, REG_INTREQ, (state ? 0x8000 : 0x0000) | INTENA_PORTS, 0);
1138   amiga_custom_w(Machine, REG_INTREQ, (state ? 0x8000 : 0x0000) | INTENA_PORTS, 0xffff);
11391139}
11401140
11411141
11421142static void amiga_cia_1_irq(int state)
11431143{
1144   amiga_custom_w(Machine, REG_INTREQ, (state ? 0x8000 : 0x0000) | INTENA_EXTER, 0);
1144   amiga_custom_w(Machine, REG_INTREQ, (state ? 0x8000 : 0x0000) | INTENA_EXTER, 0xffff);
11451145}
11461146
11471147
r2454r2455
12861286   CUSTOM_REG(REG_SERDATR) |= 0x3000;
12871287
12881288   /* signal an interrupt */
1289   amiga_custom_w(machine, REG_INTREQ, 0x8000 | INTENA_TBE, 0);
1289   amiga_custom_w(machine, REG_INTREQ, 0x8000 | INTENA_TBE, 0xffff);
12901290}
12911291
12921292
r2454r2455
15221522   }
15231523
15241524   /* signal an interrupt */
1525   amiga_custom_w(Machine, REG_INTREQ, 0x8000 | INTENA_RBF, 0);
1525   amiga_custom_w(Machine, REG_INTREQ, 0x8000 | INTENA_RBF, 0xffff);
15261526}
15271527
15281528
r2454r2455
17341734{
17351735   int move_to_next = FALSE;
17361736
1737   logerror("autoconfig_w(%02X) = %04X & %04X\n", offset, data, mem_mask ^ 0xffff);
1737   logerror("autoconfig_w(%02X) = %04X & %04X\n", offset, data, mem_mask);
17381738
17391739   /* if no current device, bail */
17401740   if (!cur_autoconfig || !ACCESSING_BITS_8_15)
src/mame/machine/vertigo.c
r2454r2455
166166{
167167   /* Reset sound cpu */
168168   if ((data & 2) == 0)
169      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
169      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
170170   else
171      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
171      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
172172}
173173
174174
src/mame/machine/lkage.c
r2454r2455
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1211
1312
1413static UINT8 from_main,from_mcu;
r2454r2455
6867   if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02))
6968   {
7069      portA_in = from_main;
71      if (main_sent) cpunum_set_input_line(Machine, 2,0,CLEAR_LINE);
70      if (main_sent) cpunum_set_input_line(machine, 2,0,CLEAR_LINE);
7271      main_sent = 0;
7372logerror("read command %02x from main cpu\n",portA_in);
7473   }
r2454r2455
116115logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data);
117116   from_main = data;
118117   main_sent = 1;
119   cpunum_set_input_line(Machine, 2,0,ASSERT_LINE);
118   cpunum_set_input_line(machine, 2,0,ASSERT_LINE);
120119}
121120
122121READ8_HANDLER( lkage_mcu_r )
src/mame/machine/neoprot.c
r2454r2455
400400   state_save_register_global(neogeo_rng);
401401
402402   memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, addr1, addr1 + 1, 0, 0, sma_random_r);
403   memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, addr2, addr2 + 2, 0, 0, sma_random_r);
403   memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, addr2, addr2 + 1, 0, 0, sma_random_r);
404404}
405405
406406
src/mame/machine/atarigen.c
r2454r2455
521521      {
522522         atarigen_slapstic_last_pc = pc;
523523         atarigen_slapstic_last_address = address;
524         atarigen_slapstic_r(machine, (address >> 1) & 0x3fff, 0);
524         atarigen_slapstic_r(machine, (address >> 1) & 0x3fff, 0xffff);
525525      }
526526      return ~0;
527527   }
r2454r2455
733733READ16_HANDLER( atarigen_sound_r )
734734{
735735   atarigen_sound_to_cpu_ready = 0;
736   atarigen_sound_int_ack_w(machine, 0, 0, 0);
736   atarigen_sound_int_ack_w(machine, 0, 0, 0xffff);
737737   return atarigen_sound_to_cpu | 0xff00;
738738}
739739
740740READ16_HANDLER( atarigen_sound_upper_r )
741741{
742742   atarigen_sound_to_cpu_ready = 0;
743   atarigen_sound_int_ack_w(machine, 0, 0, 0);
743   atarigen_sound_int_ack_w(machine, 0, 0, 0xffff);
744744   return (atarigen_sound_to_cpu << 8) | 0x00ff;
745745}
746746
747747READ32_HANDLER( atarigen_sound_upper32_r )
748748{
749749   atarigen_sound_to_cpu_ready = 0;
750   atarigen_sound_int_ack32_w(machine, 0, 0, 0);
750   atarigen_sound_int_ack32_w(machine, 0, 0, 0xffff);
751751   return (atarigen_sound_to_cpu << 24) | 0x00ffffff;
752752}
753753
r2454r2455
808808
809809   /* reset the sound write state */
810810   atarigen_sound_to_cpu_ready = 0;
811   atarigen_sound_int_ack_w(machine, 0, 0, 0);
811   atarigen_sound_int_ack_w(machine, 0, 0, 0xffff);
812812
813813   /* allocate a high frequency timer until a response is generated */
814814   /* the main CPU is *very* sensistive to the timing of the response */
r2454r2455
12371237
12381238      /* scanline IRQ ack here */
12391239      case 0x1e:
1240         atarigen_scanline_int_ack_w(screen->machine, 0, 0, 0);
1240         atarigen_scanline_int_ack_w(screen->machine, 0, 0, 0xffff);
12411241         break;
12421242
12431243      /* log anything else */
src/mame/machine/midwunit.c
r2454r2455
191191         return input_port_read_indexed(machine, offset);
192192
193193      case 4:
194         return (midway_serial_pic_status_r() << 12) | midwunit_sound_state_r(machine,0,0);
194         return (midway_serial_pic_status_r() << 12) | midwunit_sound_state_r(machine,0,0xffff);
195195
196196      default:
197197         logerror("%08X:Unknown I/O read from %d\n", activecpu_get_pc(), offset);
r2454r2455
281281         /* non-loopback case: bit 0 means data ready, bit 2 means ok to send */
282282         else
283283         {
284            int temp = midwunit_sound_state_r(machine, 0, 0);
284            int temp = midwunit_sound_state_r(machine, 0, 0xffff);
285285            result |= (temp & 0x800) >> 9;
286286            result |= (~temp & 0x400) >> 10;
287287            timer_call_after_resynch(NULL, 0, 0);
r2454r2455
296296
297297         /* non-loopback case: read from the DCS system */
298298         else
299            result = midwunit_sound_r(machine, 0, 0);
299            result = midwunit_sound_r(machine, 0, 0xffff);
300300         break;
301301
302302      case 5:   /* register 5 seems to be like 3, but with in/out swapped */
r2454r2455
308308         /* non-loopback case: bit 0 means data ready, bit 2 means ok to send */
309309         else
310310         {
311            int temp = midwunit_sound_state_r(machine, 0, 0);
311            int temp = midwunit_sound_state_r(machine, 0, 0xffff);
312312            result |= (temp & 0x800) >> 11;
313313            result |= (~temp & 0x400) >> 8;
314314            timer_call_after_resynch(NULL, 0, 0);
src/mame/machine/namcos2.c
r2454r2455
779779      /* If the interrupt enable bit is set trigger an A/D IRQ */
780780      if(data&0x20)
781781      {
782         cpunum_set_input_line(Machine, CPU_MCU, HD63705_INT_ADCONV , PULSE_LINE);
782         cpunum_set_input_line(machine, CPU_MCU, HD63705_INT_ADCONV , PULSE_LINE);
783783      }
784784   }
785785}
src/mame/machine/tx1.c
r2454r2455
44
55***************************************************************************/
66#include "driver.h"
7#include "deprecat.h"
87#include "debugger.h"
98#include "machine/8255ppi.h"
109#include "tx1.h"
r2454r2455
14731472 *************************************/
14741473MACHINE_START( tx1 )
14751474{
1476   ppi8255_init(&tx1_ppi8255_intf);
1477
14781475   /* Initialise for each game */
14791476   prom = (UINT16*)memory_region(REGION_USER1) + (0x8000 >> 1);
14801477
r2454r2455
14871484
14881485MACHINE_START( buggyboy )
14891486{
1490   ppi8255_init(&buggyboy_ppi8255_intf);
1491
14921487   /* Initialise for each game */
14931488   prom = (UINT16*)memory_region(REGION_USER1) + (0x8000 >> 1);
14941489
src/mame/machine/decoprot.c
r2454r2455
7171***************************************************************************/
7272
7373#include "driver.h"
74#include "deprecat.h"
7574#include "machine/eeprom.h"
7675#include "decoprot.h"
7776
r2454r2455
17291728{
17301729   switch (offset * 2)
17311730   {
1732   case 0x298: return input_port_0_word_r(machine, 0, 0);
1733   case 0x342: return input_port_1_word_r(machine, 0, 0);
1734   case 0x506: return input_port_2_word_r(machine, 0, 0);
1731   case 0x298: return input_port_read_indexed(machine,0);
1732   case 0x342: return input_port_read_indexed(machine,1);
1733   case 0x506: return input_port_read_indexed(machine,2);
17351734   }
17361735
17371736   logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",activecpu_get_pc(),offset<<1);
r2454r2455
17561755   const UINT16* prot_ram=deco16_prot_ram;
17571756   switch (offset * 2)
17581757   {
1759   case 0x5b2: return input_port_0_word_r(machine, 0, 0);
1760   case 0x44c: return input_port_1_word_r(machine, 0, 0);
1761   case 0x042: return input_port_2_word_r(machine, 0, 0);
1758   case 0x5b2: return input_port_read_indexed(machine,0);
1759   case 0x44c: return input_port_read_indexed(machine,1);
1760   case 0x042: return input_port_read_indexed(machine,2);
17621761
17631762   case 0x510: return DECO_PORT(0);
17641763   case 0x51a: return DECO_PORT(2);
src/mame/machine/tatsumi.c
r2454r2455
11#include "driver.h"
2#include "deprecat.h"
32#include "tatsumi.h"
43#include "sound/2151intf.h"
54#include "sound/okim6295.h"
r2454r2455
4948   if (tatsumi_control_word&0x7f00)
5049   {
5150      logerror("Unknown control Word: %04x\n",tatsumi_control_word);
52      cpunum_set_input_line(Machine, 3, INPUT_LINE_HALT, CLEAR_LINE); // ?
51      cpunum_set_input_line(machine, 3, INPUT_LINE_HALT, CLEAR_LINE); // ?
5352   }
5453   if ((tatsumi_control_word&0x8)==0 && !(tatsumi_last_control&0x8))
55      cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ4, ASSERT_LINE);
54      cpunum_set_input_line(machine, 1, INPUT_LINE_IRQ4, ASSERT_LINE);
5655
5756   if (tatsumi_control_word&0x10)
58      cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
57      cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
5958   else
60      cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
59      cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
6160
6261   if (tatsumi_control_word&0x80)
63      cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, ASSERT_LINE);
62      cpunum_set_input_line(machine, 2, INPUT_LINE_HALT, ASSERT_LINE);
6463   else
65      cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, CLEAR_LINE);
64      cpunum_set_input_line(machine, 2, INPUT_LINE_HALT, CLEAR_LINE);
6665
6766   tatsumi_last_control=tatsumi_control_word;
6867}
6968
7069WRITE16_HANDLER( apache3_irq_ack_w )
7170{
72   cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ4, CLEAR_LINE);
71   cpunum_set_input_line(machine, 1, INPUT_LINE_IRQ4, CLEAR_LINE);
7372
7473   if ((data&2) && (tatsumi_last_irq&2)==0)
7574   {
76      cpunum_set_input_line(Machine, 3, INPUT_LINE_HALT, ASSERT_LINE);
75      cpunum_set_input_line(machine, 3, INPUT_LINE_HALT, ASSERT_LINE);
7776   }
7877
7978   if ((tatsumi_last_irq&2) && (data&2)==0)
8079   {
81      cpunum_set_input_line(Machine, 3, INPUT_LINE_HALT, CLEAR_LINE);
82      cpunum_set_input_line_and_vector(Machine, 3, 0, HOLD_LINE, 0xc7 | 0x10);
80      cpunum_set_input_line(machine, 3, INPUT_LINE_HALT, CLEAR_LINE);
81      cpunum_set_input_line_and_vector(machine, 3, 0, HOLD_LINE, 0xc7 | 0x10);
8382   }
8483
8584   tatsumi_last_irq=data;
r2454r2455
187186   COMBINE_DATA(&tatsumi_control_word);
188187
189188   if (tatsumi_control_word&0x10)
190      cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
189      cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
191190   else
192      cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
191      cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
193192
194193   if (tatsumi_control_word&0x4)
195      cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, ASSERT_LINE);
194      cpunum_set_input_line(machine, 2, INPUT_LINE_HALT, ASSERT_LINE);
196195   else
197      cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, CLEAR_LINE);
196      cpunum_set_input_line(machine, 2, INPUT_LINE_HALT, CLEAR_LINE);
198197
199198//  if (offset==1 && (tatsumi_control_w&0xfeff)!=(last_bank&0xfeff))
200199//      logerror("%08x:  Changed bank to %04x (%d)\n",activecpu_get_pc(),tatsumi_control_w,offset);
r2454r2455
220219    */
221220
222221   if ((tatsumi_control_word&0x8)==0 && !(tatsumi_last_control&0x8))
223      cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ4, ASSERT_LINE);
222      cpunum_set_input_line(machine, 1, INPUT_LINE_IRQ4, ASSERT_LINE);
224223//  if (tatsumi_control_w&0x200)
225224//      cpu_set_reset_line(1, CLEAR_LINE);
226225//  else
r2454r2455
253252    */
254253
255254   COMBINE_DATA(&roundup5_e0000_ram[offset]);
256   cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ4, CLEAR_LINE); // guess, probably wrong
255   cpunum_set_input_line(machine, 1, INPUT_LINE_IRQ4, CLEAR_LINE); // guess, probably wrong
257256
258257//  logerror("d_68k_e0000_w %06x %04x\n",activecpu_get_pc(),data);
259258}
r2454r2455
284283
285284   if ((tatsumi_control_word&4)==4 && (tatsumi_last_control&4)==0) {
286285//      logerror("68k 2 halt\n");
287      cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
286      cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
288287   }
289288
290289   if ((tatsumi_control_word&4)==0 && (tatsumi_last_control&4)==4) {
291290//      logerror("68k 2 irq go\n");
292      cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
291      cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
293292   }
294293
295294
src/mame/machine/arkanoid.c
r2454r2455
121121
122122READ8_HANDLER( arkanoid_68705_input_0_r )
123123{
124   int res = input_port_0_r(machine,offset) & 0x3f;
124   int res = input_port_read_indexed(machine,0) & 0x3f;
125125
126126   /* bit 0x40 comes from the sticky bit */
127127   if (!z80write) res |= 0x40;
r2454r2455
136136{
137137   if (arkanoid_paddle_select)
138138   {
139      arkanoid_paddle_value = input_port_3_r(machine,offset);
139      arkanoid_paddle_value = input_port_read_indexed(machine,3);
140140   }
141141   else
142142   {
143      arkanoid_paddle_value = input_port_2_r(machine,offset);
143      arkanoid_paddle_value = input_port_read_indexed(machine,2);
144144   }
145145
146146   return arkanoid_paddle_value;
src/mame/machine/galaxold.c
r2454r2455
517517
518518   state_save_register_global(gmgalax_selected_game);
519519
520   gmgalax_select_game(input_port_6_r(machine, 0) & 0x01);
520   gmgalax_select_game(input_port_read_indexed(machine, 6) & 0x01);
521521}
522522
523523INTERRUPT_GEN( gmgalax_vh_interrupt )
524524{
525525   // reset the cpu if the selected game changed
526   int new_game = input_port_6_r(machine, 0) & 0x01;
526   int new_game = input_port_read_indexed(machine, 6) & 0x01;
527527
528528   if (gmgalax_selected_game != new_game)
529529   {
src/mame/machine/retofinv.c
r2454r2455
11#include "driver.h"
2#include "deprecat.h"
32#include "cpu/z80/z80.h"
43
54
r2454r2455
5756   if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02))
5857   {
5958      portA_in = from_main;
60      if (main_sent) cpunum_set_input_line(Machine, 3,0,CLEAR_LINE);
59      if (main_sent) cpunum_set_input_line(machine, 3,0,CLEAR_LINE);
6160      main_sent = 0;
6261//logerror("read command %02x from main cpu\n",portA_in);
6362   }
r2454r2455
114113logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data);
115114   from_main = data;
116115   main_sent = 1;
117   cpunum_set_input_line(Machine, 3,0,ASSERT_LINE);
116   cpunum_set_input_line(machine, 3,0,ASSERT_LINE);
118117}
119118
120119READ8_HANDLER( retofinv_mcu_r )
src/mame/machine/bsktball.c
r2454r2455
7373   int p2_vert;
7474   int temp;
7575
76   p1_horiz = input_port_0_r(machine, offset);
77   p1_vert  = input_port_1_r(machine, offset);
78   p2_horiz = input_port_2_r(machine, offset);
79   p2_vert  = input_port_3_r(machine, offset);
76   p1_horiz = input_port_read_indexed(machine,0);
77   p1_vert  = input_port_read_indexed(machine,1);
78   p2_horiz = input_port_read_indexed(machine,2);
79   p2_vert  = input_port_read_indexed(machine,3);
8080
8181   /* Set direction bits */
8282
r2454r2455
146146   }
147147   else
148148   {
149      temp = input_port_4_r(machine, offset) & 0x0F;
149      temp = input_port_read_indexed(machine, 4) & 0x0F;
150150      /* Remap button 1 back to the Start button */
151151      /* NOTE:  This is an ADDED feature, not a part of the original hardware! */
152152      temp = (temp) & (temp>>2);
src/mame/machine/harddriv.c
r2454r2455
737737   }
738738
739739   /* detect changes to HEBLNK and HSBLNK and force an update before they change */
740   if ((offset == REG_HEBLNK || offset == REG_HSBLNK) && data != tms34010_io_register_r(machine, offset, 0))
740   if ((offset == REG_HEBLNK || offset == REG_HSBLNK) && data != tms34010_io_register_r(machine, offset, 0xffff))
741741      video_screen_update_partial(machine->primary_screen, video_screen_get_vpos(machine->primary_screen) - 1);
742742
743743   tms34010_io_register_w(machine, offset, data, mem_mask);
src/mame/machine/psx.c
r2454r2455
8686   switch( offset )
8787   {
8888   case 0x00:
89      verboselog( 2, "psx irq data ( %08x, %08x ) %08x -> %08x\n", data, mem_mask, m_n_irqdata, ( m_n_irqdata & mem_mask ) | ( m_n_irqdata & m_n_irqmask & data ) );
90      m_n_irqdata = ( m_n_irqdata & mem_mask ) | ( m_n_irqdata & m_n_irqmask & data );
89      verboselog( 2, "psx irq data ( %08x, %08x ) %08x -> %08x\n", data, mem_mask, m_n_irqdata, ( m_n_irqdata & ~mem_mask ) | ( m_n_irqdata & m_n_irqmask & data ) );
90      m_n_irqdata = ( m_n_irqdata & ~mem_mask ) | ( m_n_irqdata & m_n_irqmask & data );
9191      psx_irq_update();
9292      break;
9393   case 0x01:
94      verboselog( 2, "psx irq mask ( %08x, %08x ) %08x -> %08x\n", data, mem_mask, m_n_irqmask, ( m_n_irqmask & mem_mask ) | data );
95      m_n_irqmask = ( m_n_irqmask & mem_mask ) | data;
94      verboselog( 2, "psx irq mask ( %08x, %08x ) %08x -> %08x\n", data, mem_mask, m_n_irqmask, ( m_n_irqmask & ~mem_mask ) | data );
95      m_n_irqmask = ( m_n_irqmask & ~mem_mask ) | data;
9696      if( ( m_n_irqmask & ~( 0x1 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80 | 0x100 | 0x200 | 0x400 ) ) != 0 )
9797      {
9898         verboselog( 0, "psx_irq_w( %08x, %08x, %08x ) unknown irq\n", offset, data, mem_mask );
r2454r2455
403403      {
404404      case 0x0:
405405         verboselog( 1, "psx_dma_w( %04x, %08x, %08x ) dpcp\n", offset, data, mem_mask );
406         m_n_dpcp = ( m_n_dpcp & mem_mask ) | data;
406         m_n_dpcp = ( m_n_dpcp & ~mem_mask ) | data;
407407         break;
408408      case 0x1:
409         m_n_dicr = ( m_n_dicr & mem_mask ) |
410            ( ~mem_mask & 0x80000000 & m_n_dicr ) |
411            ( ~data & ~mem_mask & 0x7f000000 & m_n_dicr ) |
412            ( data & ~mem_mask & 0x00ffffff );
409         m_n_dicr = ( m_n_dicr & ~mem_mask ) |
410            ( mem_mask & 0x80000000 & m_n_dicr ) |
411            ( ~data & mem_mask & 0x7f000000 & m_n_dicr ) |
412            ( data & mem_mask & 0x00ffffff );
413413/* todo: find out whether to do this instead of dma_interrupt_update()
414414
415415            if( ( m_n_dicr & 0x7f000000 ) != 0 )
src/mame/machine/dec0.c
r2454r2455
527527   robocop_shared_ram[offset]=data&0xff;
528528
529529   if (offset==0x7ff) /* A control address - not standard ram */
530      cpunum_set_input_line(Machine, 2,0,HOLD_LINE);
530      cpunum_set_input_line(machine, 2,0,HOLD_LINE);
531531}
532532
533533/******************************************************************************/
src/mame/machine/beezer.c
r2454r2455
6161static WRITE8_HANDLER( b_via_0_pa_w )
6262{
6363   if ((data & 0x08) == 0)
64      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
64      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
6565   else
66      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
66      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
6767
6868   if ((data & 0x04) == 0)
6969   {
src/mame/machine/lsasquad.c
r2454r2455
11#include "driver.h"
2#include "deprecat.h"
32#include "cpu/z80/z80.h"
43
54
r2454r2455
3231   sound_nmi_enable = 1;
3332   if (pending_nmi)
3433   {
35      cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE);
34      cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
3635      pending_nmi = 0;
3736   }
3837}
r2454r2455
145144   if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02))
146145   {
147146      portA_in = from_main;
148      if (main_sent) cpunum_set_input_line(Machine, 2,0,CLEAR_LINE);
147      if (main_sent) cpunum_set_input_line(machine, 2,0,CLEAR_LINE);
149148      main_sent = 0;
150149//logerror("read command %02x from main cpu\n",portA_in);
151150   }
r2454r2455
169168//logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data);
170169   from_main = data;
171170   main_sent = 1;
172   cpunum_set_input_line(Machine, 2,0,ASSERT_LINE);
171   cpunum_set_input_line(machine, 2,0,ASSERT_LINE);
173172}
174173
175174READ8_HANDLER( lsasquad_mcu_r )
src/mame/machine/williams.c
r2454r2455
863863static READ8_HANDLER( lottofun_input_port_0_r )
864864{
865865   /* merge in the ticket dispenser status */
866   return input_port_0_r(machine,offset) | ticket_dispenser_r(machine,offset);
866   return input_port_read_indexed(machine,0) | ticket_dispenser_r(machine,offset);
867867}
868868
869869
src/mame/machine/namcond1.c
r2454r2455
1010***************************************************************************/
1111
1212#include "driver.h"
13#include "deprecat.h"
1413#include "cpu/m6809/m6809.h"
1514#include "namcond1.h"
1615
r2454r2455
9897            // this is a kludge until we emulate the h8
9998       if ((namcond1_h8_irq5_enabled == 0) && (data != 0x0000))
10099       {
101          cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
100          cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
102101       }
103102            namcond1_h8_irq5_enabled = ( data != 0x0000 );
104103            break;
src/mame/machine/atarifb.c
r2454r2455
152152           (sign_x_2 >> 6) |
153153           (sign_y_1 >> 5) |
154154           (sign_x_1 >> 4) |
155           input_port_0_r(machine, offset);
155           input_port_read_indexed(machine,0);
156156      return val;
157157   }
158158   else
r2454r2455
184184{
185185   if ((CTRLD & 0x20)==0x00)
186186   {
187      return input_port_1_r(machine, offset);
187      return input_port_read_indexed(machine,1);
188188   }
189189   else
190190   {
r2454r2455
282282{
283283   if ((CTRLD & 0x40)==0x00)
284284   {
285      return input_port_2_r(machine, offset);
285      return input_port_read_indexed(machine,2);
286286   }
287287   else if ((CTRLD & 0x60) == 0x60)
288288   /* LD1 and LD2 both high, return Team 2 right player (player 3) */
src/mame/machine/simpsons.c
r2454r2455
11#include "driver.h"
2#include "deprecat.h"
32#include "video/konamiic.h"
43#include "cpu/konami/konami.h"
54#include "machine/eeprom.h"
src/mame/machine/subs.c
r2454r2455
2929INTERRUPT_GEN( subs_interrupt )
3030{
3131   /* only do NMI interrupt if not in TEST mode */
32   if ((input_port_2_r(machine, 0) & 0x40)==0x40)
32   if ((input_port_read_indexed(machine, 2) & 0x40)==0x40)
3333      cpunum_set_input_line(machine, 0,INPUT_LINE_NMI,PULSE_LINE);
3434}
3535
r2454r2455
4646   int this_val;
4747   int delta;
4848
49   this_val=input_port_3_r(machine, 0);
49   this_val=input_port_read_indexed(machine, 3);
5050
5151   delta=this_val-last_val;
5252   last_val=this_val;
r2454r2455
112112***************************************************************************/
113113READ8_HANDLER( subs_control_r )
114114{
115   int inport = input_port_1_r(machine, offset);
115   int inport = input_port_read_indexed(machine, 1);
116116
117117   switch (offset & 0x07)
118118   {
r2454r2455
134134***************************************************************************/
135135READ8_HANDLER( subs_coin_r )
136136{
137   int inport = input_port_2_r(machine, offset);
137   int inport = input_port_read_indexed(machine, 2);
138138
139139   switch (offset & 0x07)
140140   {
r2454r2455
156156***************************************************************************/
157157READ8_HANDLER( subs_options_r )
158158{
159   int opts = input_port_0_r(machine, offset);
159   int opts = input_port_read_indexed(machine, 0);
160160
161161   switch (offset & 0x03)
162162   {
src/mame/machine/seicop.c
r2454r2455
768768      //case (0x5b4/2):
769769      //  return cop_mcu_ram[offset];
770770
771      case (0x700/2): return input_port_1_word_r(machine,0,0);
772      case (0x704/2):   return input_port_2_word_r(machine,0,0);
773      case (0x708/2):   return input_port_4_word_r(machine,0,0);
774      case (0x70c/2):   return input_port_3_word_r(machine,0,0);
775      case (0x71c/2): return input_port_5_word_r(machine,0,0);
771      case (0x700/2): return input_port_read_indexed(machine,1);
772      case (0x704/2):   return input_port_read_indexed(machine,2);
773      case (0x708/2):   return input_port_read_indexed(machine,4);
774      case (0x70c/2):   return input_port_read_indexed(machine,3);
775      case (0x71c/2): return input_port_read_indexed(machine,5);
776776   }
777777}
778778
r2454r2455
892892      /*case (0x740/2):
893893        {
894894            soundlatch_w(1,data&0x00ff);
895            cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE );
895            cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE );
896896            break;
897897        }*/
898898   }
r2454r2455
13131313        *********************************************************************/
13141314
13151315      /* Seibu Sound System */
1316      case (0x3c8/2):   return seibu_main_word_r(machine,2,0);
1317      case (0x3cc/2):   return seibu_main_word_r(machine,3,0);
1318      case (0x3d4/2): return seibu_main_word_r(machine,5,0);
1316      case (0x3c8/2):   return seibu_main_word_r(machine,2,0xffff);
1317      case (0x3cc/2):   return seibu_main_word_r(machine,3,0xffff);
1318      case (0x3d4/2): return seibu_main_word_r(machine,5,0xffff);
13191319
13201320      /* Inputs */
1321      case (0x340/2): return input_port_1_word_r(machine,0,0);
1322      case (0x344/2):   return input_port_2_word_r(machine,0,0);
1323      case (0x348/2): return input_port_4_word_r(machine,0,0);
1324      case (0x34c/2): return input_port_3_word_r(machine,0,0);
1321      case (0x340/2): return input_port_read_indexed(machine,1);
1322      case (0x344/2):   return input_port_read_indexed(machine,2);
1323      case (0x348/2): return input_port_read_indexed(machine,4);
1324      case (0x34c/2): return input_port_read_indexed(machine,3);
13251325
13261326   }
13271327}
r2454r2455
13971397        700-7ff - Output (Seibu Sound System)
13981398        *********************************************************************/
13991399
1400      case (0x3c0/2):   { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0xff00); break; }
1401      case (0x3c4/2):   { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0xff00); break; }
1402      case (0x3d0/2):   { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0xff00); break; }
1403      case (0x3d8/2):   { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0xff00); break; }
1400      case (0x3c0/2):   { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0x00ff); break; }
1401      case (0x3c4/2):   { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0x00ff); break; }
1402      case (0x3d0/2):   { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0x00ff); break; }
1403      case (0x3d8/2):   { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0x00ff); break; }
14041404   }
14051405}
14061406
r2454r2455
14241424
14251425      /* returning 0xffff for some inputs for now, breaks coinage but
14261426           allows cupsoc to boot */
1427      case (0x300/2): return input_port_1_word_r(machine,0,0);
1428      case (0x304/2): return input_port_2_word_r(machine,0,0);
1429      case (0x308/2): return input_port_4_word_r(machine,0,0);
1430      case (0x30c/2): return input_port_3_word_r(machine,0,0);
1427      case (0x300/2): return input_port_read_indexed(machine,1);
1428      case (0x304/2): return input_port_read_indexed(machine,2);
1429      case (0x308/2): return input_port_read_indexed(machine,4);
1430      case (0x30c/2): return input_port_read_indexed(machine,3);
14311431      case (0x314/2): return 0xffff;
1432      case (0x31c/2): return input_port_5_word_r(machine,0,0);
1432      case (0x31c/2): return input_port_read_indexed(machine,5);
14331433
14341434      case (0x340/2): return 0xffff;
14351435      case (0x344/2): return 0xffff;
1436      case (0x348/2):   return 0xffff;//seibu_main_word_r(machine,2,0);
1437      case (0x34c/2): return 0xffff;//seibu_main_word_r(machine,3,0);
1438      case (0x354/2): return 0xffff;//seibu_main_word_r(machine,5,0);
1436      case (0x348/2):   return 0xffff;//seibu_main_word_r(machine,2,0xffff);
1437      case (0x34c/2): return 0xffff;//seibu_main_word_r(machine,3,0xffff);
1438      case (0x354/2): return 0xffff;//seibu_main_word_r(machine,5,0xffff);
14391439      case (0x35c/2): return 0xffff;
14401440   }
14411441}
r2454r2455
15511551      case (0x238/2): { legionna_scrollram16[6] = cop_mcu_ram[offset]; break; }
15521552      case (0x23a/2): { legionna_scrollram16[7] = cop_mcu_ram[offset]; break; }
15531553
1554      case (0x340/2):   { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0xff00); break; }
1555      case (0x344/2):   { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0xff00); break; }
1556      case (0x350/2):   { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0xff00); break; }
1557      case (0x358/2):   { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0xff00); break; }
1554      case (0x340/2):   { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0x00ff); break; }
1555      case (0x344/2):   { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0x00ff); break; }
1556      case (0x350/2):   { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0x00ff); break; }
1557      case (0x358/2):   { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0x00ff); break; }
15581558   }
15591559}
15601560
r2454r2455
15711571         break;
15721572
15731573      /* Non-protection reads */
1574      case (0x308/2):   return seibu_main_word_r(machine,2,0);
1575      case (0x30c/2):   return seibu_main_word_r(machine,3,0);
1576      case (0x314/2):   return seibu_main_word_r(machine,5,0);
1574      case (0x308/2):   return seibu_main_word_r(machine,2,0xffff);
1575      case (0x30c/2):   return seibu_main_word_r(machine,3,0xffff);
1576      case (0x314/2):   return seibu_main_word_r(machine,5,0xffff);
15771577
15781578      /* Inputs */
1579      case (0x340/2): return input_port_1_word_r(machine,0,0);
1580      case (0x344/2): return input_port_2_word_r(machine,0,0);
1581      case (0x348/2): return input_port_4_word_r(machine,0,0);
1582      case (0x34c/2): return input_port_3_word_r(machine,0,0);
1579      case (0x340/2): return input_port_read_indexed(machine,1);
1580      case (0x344/2): return input_port_read_indexed(machine,2);
1581      case (0x348/2): return input_port_read_indexed(machine,4);
1582      case (0x34c/2): return input_port_read_indexed(machine,3);
15831583   }
15841584}
15851585
r2454r2455
16011601      case (0x228/2): { legionna_scrollram16[4] = cop_mcu_ram[offset]; break; }
16021602      case (0x22a/2): { legionna_scrollram16[5] = cop_mcu_ram[offset]; break; }
16031603
1604      case (0x300/2):   { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0xff00); break; }
1605      case (0x304/2):   { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0xff00); break; }
1606      case (0x310/2):   { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0xff00); break; }
1607      case (0x318/2):   { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0xff00); break; }
1604      case (0x300/2):   { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0x00ff); break; }
1605      case (0x304/2):   { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0x00ff); break; }
1606      case (0x310/2):   { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0x00ff); break; }
1607      case (0x318/2):   { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0x00ff); break; }
16081608   }
16091609}
16101610
r2454r2455
16221622
16231623      /* Non-protection reads */
16241624
1625      case (0x308/2):   return seibu_main_word_r(machine,2,0);
1626      case (0x30c/2):   return seibu_main_word_r(machine,3,0);
1627      case (0x314/2): return seibu_main_word_r(machine,5,0);
1625      case (0x308/2):   return seibu_main_word_r(machine,2,0xffff);
1626      case (0x30c/2):   return seibu_main_word_r(machine,3,0xffff);
1627      case (0x314/2): return seibu_main_word_r(machine,5,0xffff);
16281628
16291629      /* Inputs */
1630      case (0x340/2): return input_port_1_word_r(machine,0,0);
1631      case (0x344/2):   return input_port_2_word_r(machine,0,0);
1632      case (0x348/2): return input_port_4_word_r(machine,0,0);
1633      case (0x34c/2): return input_port_3_word_r(machine,0,0);
1634      case (0x35c/2): return input_port_5_word_r(machine,0,0);
1630      case (0x340/2): return input_port_read_indexed(machine,1);
1631      case (0x344/2):   return input_port_read_indexed(machine,2);
1632      case (0x348/2): return input_port_read_indexed(machine,4);
1633      case (0x34c/2): return input_port_read_indexed(machine,3);
1634      case (0x35c/2): return input_port_read_indexed(machine,5);
16351635   }
16361636}
16371637
r2454r2455
16541654      case (0x228/2): { legionna_scrollram16[4] = cop_mcu_ram[offset]; break; }
16551655      case (0x22a/2): { legionna_scrollram16[5] = cop_mcu_ram[offset]; break; }
16561656
1657      case (0x300/2):   { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0xff00); break; }
1658      case (0x304/2):   { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0xff00); break; }
1659      case (0x310/2):   { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0xff00); break; }
1660      case (0x318/2):   { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0xff00); break; }
1657      case (0x300/2):   { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0x00ff); break; }
1658      case (0x304/2):   { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0x00ff); break; }
1659      case (0x310/2):   { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0x00ff); break; }
1660      case (0x318/2):   { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0x00ff); break; }
16611661
16621662   }
16631663}
r2454r2455
16881688         return cop_mcu_ram[offset];
16891689
16901690      /* Non-protection reads */
1691      case (0x308/2): return seibu_main_word_r(machine,2,0);
1692      case (0x30c/2): return seibu_main_word_r(machine,3,0);
1693      case (0x314/2): return seibu_main_word_r(machine,5,0);
1691      case (0x308/2): return seibu_main_word_r(machine,2,0xffff);
1692      case (0x30c/2): return seibu_main_word_r(machine,3,0xffff);
1693      case (0x314/2): return seibu_main_word_r(machine,5,0xffff);
16941694
16951695      /* Inputs */
1696      case (0x340/2): return input_port_1_word_r(machine,0,0);
1697      case (0x344/2):   return input_port_2_word_r(machine,0,0);
1698      case (0x348/2): return input_port_4_word_r(machine,0,0);
1699      case (0x34c/2): return input_port_3_word_r(machine,0,0);
1700      case (0x35c/2): return input_port_5_word_r(machine,0,0);
1696      case (0x340/2): return input_port_read_indexed(machine,1);
1697      case (0x344/2):   return input_port_read_indexed(machine,2);
1698      case (0x348/2): return input_port_read_indexed(machine,4);
1699      case (0x34c/2): return input_port_read_indexed(machine,3);
1700      case (0x35c/2): return input_port_read_indexed(machine,5);
17011701   }
17021702}
17031703
r2454r2455
18611861      //case (0x280/2): break;
18621862      //case (0x6fc/2): break;
18631863
1864      case (0x300/2):   { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0xff00); break; }
1865      case (0x304/2):   { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0xff00); break; }
1866      case (0x310/2):   { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0xff00); break; }
1867      case (0x318/2):   { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0xff00); break; }
1864      case (0x300/2):   { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0x00ff); break; }
1865      case (0x304/2):   { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0x00ff); break; }
1866      case (0x310/2):   { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0x00ff); break; }
1867      case (0x318/2):   { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0x00ff); break; }
18681868   }
18691869}
18701870
r2454r2455
18991899        *********************************************************************/
19001900
19011901      /* Seibu Sound System */
1902      case (0x308/2):   return seibu_main_word_r(machine,2,0);
1903      case (0x30c/2):   return seibu_main_word_r(machine,3,0);
1904      case (0x314/2): return seibu_main_word_r(machine,5,0);
1902      case (0x308/2):   return seibu_main_word_r(machine,2,0xffff);
1903      case (0x30c/2):   return seibu_main_word_r(machine,3,0xffff);
1904      case (0x314/2): return seibu_main_word_r(machine,5,0xffff);
19051905
19061906      /* Inputs */
1907      case (0x340/2): return input_port_1_word_r(machine,0,0);
1908      case (0x344/2):   return input_port_2_word_r(machine,0,0);
1909      case (0x348/2):   return input_port_0_word_r(machine,0,0);
1910      case (0x34c/2):   return input_port_3_word_r(machine,0,0);
1907      case (0x340/2): return input_port_read_indexed(machine,1);
1908      case (0x344/2):   return input_port_read_indexed(machine,2);
1909      case (0x348/2):   return input_port_read_indexed(machine,0);
1910      case (0x34c/2):   return input_port_read_indexed(machine,3);
19111911
19121912   }
19131913}
r2454r2455
19631963        700-7ff - Output (Seibu Sound System)
19641964        *********************************************************************/
19651965
1966      case (0x300/2):   { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0xff00); break; }
1967      case (0x304/2):   { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0xff00); break; }
1968      case (0x310/2):   { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0xff00); break; }
1969      case (0x318/2):   { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0xff00); break; }
1966      case (0x300/2):   { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0x00ff); break; }
1967      case (0x304/2):   { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0x00ff); break; }
1968      case (0x310/2):   { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0x00ff); break; }
1969      case (0x318/2):   { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0x00ff); break; }
19701970   }
19711971}
19721972
r2454r2455
19881988      case (0x34c/2): return input_port_read_indexed(machine, 5) | 0xff00;
19891989
19901990      /* Inputs */
1991      case (0x308/2):   return seibu_main_word_r(machine,2,0);
1992      case (0x30c/2):   return seibu_main_word_r(machine,3,0);
1993      case (0x314/2): return seibu_main_word_r(machine,5,0);
1991      case (0x308/2):   return seibu_main_word_r(machine,2,0xffff);
1992      case (0x30c/2):   return seibu_main_word_r(machine,3,0xffff);
1993      case (0x314/2): return seibu_main_word_r(machine,5,0xffff);
19941994
19951995   }
19961996}
r2454r2455
20332033      case (0x2be/2): sprcpt_adr_w(machine,offset,data,mem_mask); break;
20342034      case (0x2ce/2): sprcpt_flags_2_w(machine,offset,data,mem_mask); break;
20352035
2036      case (0x300/2):   { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0xff00); break; }
2037      case (0x304/2):   { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0xff00); break; }
2038      case (0x310/2):   { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0xff00); break; }
2039      case (0x318/2):   { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0xff00); break; }
2036      case (0x300/2):   { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0x00ff); break; }
2037      case (0x304/2):   { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0x00ff); break; }
2038      case (0x310/2):   { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0x00ff); break; }
2039      case (0x318/2):   { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0x00ff); break; }
20402040
20412041
20422042   }
src/mame/machine/bigevglf.c
r2454r2455
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1211
1312
1413static UINT8 from_mcu;
r2454r2455
4544
4645   if ((ddrB & 0x02) && (~portB_out & 0x02) && (data & 0x02)) /* positive going transition of the clock */
4746   {
48      cpunum_set_input_line(Machine, 3,0,CLEAR_LINE);
47      cpunum_set_input_line(machine, 3,0,CLEAR_LINE);
4948      main_sent = 0;
5049
5150   }
r2454r2455
8685{
8786   portA_in = data;
8887   main_sent = 1;
89   cpunum_set_input_line(Machine, 3,0,ASSERT_LINE);
88   cpunum_set_input_line(machine, 3,0,ASSERT_LINE);
9089}
9190
9291
src/mame/machine/nitedrvr.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "nitedrvr.h"
109#include "sound/discrete.h"
1110
src/mame/mamedriv.c
r2454r2455
17351735
17361736   /* Taito "tnzs" (Seta) hardware */
17371737   DRIVER( plumppop )   /* A98 (c) 1987 Taito Corporation (Japan) */
1738   DRIVER( jpopnics )  /* (c)1992 NICs, based on Plump Pop code */
17381739   DRIVER( extrmatn )   /* B06 (c) 1987 World Games */
17391740   DRIVER( extrmatj )   /* B06 (c) 1987 Taito Corporation (Japan)*/
17401741   DRIVER( arknoid2 )   /* B08 (c) 1987 Taito Corporation Japan (World) */
r2454r2455
22772278   DRIVER( 1942 )      /* 12/1984 (c) 1984 */
22782279   DRIVER( 1942a )      /* 12/1984 (c) 1984 */
22792280   DRIVER( 1942b )      /* 12/1984 (c) 1984 */
2281   DRIVER( 1942w )      /* 12/1984 (c) 1984 + Williams Electronics license (c) 1985 */
22802282   DRIVER( exedexes )   /*  2/1985 (c) 1985 */
22812283   DRIVER( savgbees )   /*  2/1985 (c) 1985 + Memetron license */
22822284   DRIVER( commando )   /*  5/1985 (c) 1985 (World) */
r2454r2455
22882290   DRIVER( gng )      /*  9/1985 (c) 1985 */
22892291   DRIVER( gnga )      /*  9/1985 (c) 1985 */
22902292   DRIVER( gngbl )      /* bootleg */
2293   DRIVER( gngblita )   /* bootleg */
22912294   DRIVER( gngt )      /*  9/1985 (c) 1985 */
22922295   DRIVER( makaimur )   /*  9/1985 (c) 1985 */
22932296   DRIVER( makaimuc )   /*  9/1985 (c) 1985 */
r2454r2455
43944397   DRIVER( solomonj )   /* (c) 1986 Tecmo */
43954398   DRIVER( rygar )      /* 6002 - (c) 1986 Tecmo */
43964399   DRIVER( rygar2 )   /* 6002 - (c) 1986 Tecmo */
4400   DRIVER( rygar3 )   /* 6002 - (c) 1986 Tecmo */
43974401   DRIVER( rygarj )   /* 6002 - (c) 1986 Tecmo */
43984402   DRIVER( gemini )   /* (c) 1987 Tecmo */
43994403   DRIVER( silkworm )   /* 6217 - (c) 1988 Tecmo */
r2454r2455
78677871   DRIVER( jokercrd )   /* (c) 1993 Vesely Svet */
78687872   DRIVER( mongolnw )   /* 199? bootleg */
78697873   DRIVER( soccernw )   /* 199? bootleg */
7870   DRIVER( snookr10 )   /* (c) 1998 Sandiy */
78717874   DRIVER( saloon )   /* 199? unknown */
78727875
7876   /* Sandii' */
7877   DRIVER( snookr10 )   /* (c) 1998 Sandii' */
7878   DRIVER( apple10 )   /* (c) 1998 Sandii' */
7879   DRIVER( tenballs )   /* 1997 unknown */
7880
78737881   DRIVER( vroulet )   /* (c) 1989 World Game */
78747882   DRIVER( rcasino )   /* (c) 1984 Dyna Electronics */
78757883   DRIVER( cmv801 )   /* (c) 198? Corsica */
src/mame/includes/cps1.h
r2454r2455
1515
1616extern const struct QSound_interface qsound_interface;
1717
18READ16_HANDLER( cps1_input_r );
18READ16_HANDLER( cps1_dsw_r );
1919READ16_HANDLER( cps1_in1_r );
2020READ16_HANDLER( cps1_in2_r );
2121READ16_HANDLER( cps1_in3_r );
r2454r2455
4545extern int cps1_scancalls;
4646
4747extern UINT16 *cps1_gfxram;     /* Video RAM */
48extern UINT16 *cps1_output;     /* Output ports */
48extern UINT16 *cps1_cps_a_regs;
49extern UINT16 *cps1_cps_b_regs;
4950extern size_t cps1_gfxram_size;
50extern size_t cps1_output_size;
5151
5252extern UINT16 *cps1_other;
5353extern tilemap *cps1_bg_tilemap[3];
r2454r2455
6060extern UINT16 *cps2_output;
6161extern size_t cps2_output_size;
6262
63int cps1_port(int offset);
64READ16_HANDLER( cps1_output_r );
65WRITE16_HANDLER( cps1_output_w );
63WRITE16_HANDLER( cps1_cps_a_w );
64WRITE16_HANDLER( cps1_cps_b_w );
65READ16_HANDLER( cps1_cps_b_r );
6666
6767DRIVER_INIT( cps1 );
6868DRIVER_INIT( cps2_video );
src/mame/includes/m62.h
r2454r2455
1818WRITE8_HANDLER( m62_hscroll_high_w );
1919WRITE8_HANDLER( m62_vscroll_low_w );
2020WRITE8_HANDLER( m62_vscroll_high_w );
21WRITE8_HANDLER( ldrun3_topbottom_mask_w );
2122extern UINT8 *m62_tileram;
2223extern UINT8 *m62_textram;
2324
r2454r2455
3031
3132VIDEO_START( ldrun2 );
3233
34VIDEO_UPDATE( ldrun3 );
35
3336VIDEO_START( battroad );
3437VIDEO_UPDATE( battroad );
3538
src/mame/includes/tx1.h
r2454r2455
2929
3030/*----------- defined in drivers/tx1.c -----------*/
3131extern UINT16 *tx1_math_ram;
32extern const ppi8255_interface tx1_ppi8255_intf;
33extern const ppi8255_interface buggyboy_ppi8255_intf;
3432
3533/*----------- defined in machine/tx1.c -----------*/
3634READ16_HANDLER( tx1_spcs_rom_r );
src/mame/includes/galaxold.h
r2454r2455
1111
1212***************************************************************************/
1313
14#include "machine/8255ppi.h"
15
1416/*----------- defined in video/galaxian.c -----------*/
1517
1618extern UINT8 *galaxold_videoram;
r2454r2455
152154
153155/*----------- defined in machine/scramble.c -----------*/
154156
157extern const ppi8255_interface scramble_ppi_ppi8255_intf[2];
158extern const ppi8255_interface stratgyx_ppi8255_intf[2];
159extern const ppi8255_interface moonwar_ppi8255_intf[2];
160extern const ppi8255_interface darkplnt_ppi8255_intf[2];
161extern const ppi8255_interface scramble_ppi8255_intf[2];
162extern const ppi8255_interface ckongs_ppi8255_intf[2];
163extern const ppi8255_interface mars_ppi8255_intf[2];
164extern const ppi8255_interface mrkougar_ppi8255_intf[2];
165
166
155167DRIVER_INIT( scramble_ppi );
156DRIVER_INIT( amidar );
168DRIVER_INIT( scobra );
169DRIVER_INIT( atlantis );
170DRIVER_INIT( scramble );
171DRIVER_INIT( stratgyx );
172DRIVER_INIT( tazmani2 );
173DRIVER_INIT( ckongs );
174DRIVER_INIT( mariner );
157175DRIVER_INIT( frogger );
158176DRIVER_INIT( froggers );
159DRIVER_INIT( scobra );
160DRIVER_INIT( stratgyx );
177DRIVER_INIT( devilfsh );
178DRIVER_INIT( mars );
179DRIVER_INIT( hotshock );
180DRIVER_INIT( cavelon );
161181DRIVER_INIT( moonwar );
162182DRIVER_INIT( darkplnt );
163DRIVER_INIT( tazmani2 );
183DRIVER_INIT( mimonkey );
184DRIVER_INIT( mimonsco );
185DRIVER_INIT( mimonscr );
164186DRIVER_INIT( anteater );
165187DRIVER_INIT( rescue );
166188DRIVER_INIT( minefld );
r2454r2455
168190DRIVER_INIT( superbon );
169191DRIVER_INIT( hustler );
170192DRIVER_INIT( billiard );
171DRIVER_INIT( mimonkey );
172DRIVER_INIT( mimonsco );
173DRIVER_INIT( atlantis );
174DRIVER_INIT( scramble );
175DRIVER_INIT( scrambls );
176DRIVER_INIT( theend );
177DRIVER_INIT( ckongs );
178DRIVER_INIT( mariner );
179DRIVER_INIT( mars );
180DRIVER_INIT( devilfsh );
181DRIVER_INIT( hotshock );
182DRIVER_INIT( cavelon );
183193DRIVER_INIT( mrkougar );
184194DRIVER_INIT( mrkougb );
185DRIVER_INIT( mimonscr );
186DRIVER_INIT( sfx );
187DRIVER_INIT( monsterz );
188DRIVER_INIT( scorpion );
189195DRIVER_INIT( ad2083 );
190196
191197MACHINE_RESET( scramble );
src/mame/mame.mak
r2454r2455
847847   $(DRIVERS)/gijoe.o $(VIDEO)/gijoe.o \
848848   $(DRIVERS)/gradius3.o $(VIDEO)/gradius3.o \
849849   $(DRIVERS)/gticlub.o $(VIDEO)/gticlub.o \
850   $(DRIVERS)/gyruss.o $(AUDIO)/gyruss.o $(VIDEO)/gyruss.o \
850   $(DRIVERS)/gyruss.o $(VIDEO)/gyruss.o \
851851   $(DRIVERS)/hcastle.o $(VIDEO)/hcastle.o \
852852   $(DRIVERS)/hexion.o $(VIDEO)/hexion.o \
853853   $(DRIVERS)/hornet.o $(MACHINE)/konppc.o \
r2454r2455
16031603   $(DRIVERS)/skylncr.o \
16041604   $(DRIVERS)/sliver.o \
16051605   $(DRIVERS)/smstrv.o \
1606   $(DRIVERS)/snookr10.o $(VIDEO)/snookr10.o \
16061607   $(DRIVERS)/sprcros2.o $(VIDEO)/sprcros2.o \
16071608   $(DRIVERS)/ssfindo.o \
16081609   $(DRIVERS)/ssingles.o \
src/mame/video/blktiger.c
r2454r2455
11#include "driver.h"
2#include "deprecat.h"
32
43UINT8 *blktiger_txvideoram;
54
r2454r2455
161160   coin_counter_w(1,data & 2);
162161
163162   /* bit 5 resets the sound CPU */
164   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
163   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
165164
166165   /* bit 6 flips screen */
167166   flip_screen_set(data & 0x40);
src/mame/video/dynduke.c
r2454r2455
11
22#include "driver.h"
3#include "deprecat.h"
43
54static tilemap *bg_layer,*fg_layer,*tx_layer;
65UINT16 *dynduke_back_data,*dynduke_fore_data,*dynduke_scroll_ram;
r2454r2455
1615
1716   COMBINE_DATA(&paletteram16[offset]);
1817   color=paletteram16[offset];
19   palette_set_color_rgb(Machine,offset,pal4bit(color >> 0),pal4bit(color >> 4),pal4bit(color >> 8));
18   palette_set_color_rgb(machine,offset,pal4bit(color >> 0),pal4bit(color >> 4),pal4bit(color >> 8));
2019}
2120
2221WRITE16_HANDLER( dynduke_background_w )
r2454r2455
245244
246245VIDEO_EOF( dynduke )
247246{
248   buffer_spriteram16_w(machine,0,0,0); // Could be a memory location instead
247   buffer_spriteram16_w(machine,0,0,0xffff); // Could be a memory location instead
249248}
src/mame/video/tryout.c
r2454r2455
66****************************************************************/
77
88#include "driver.h"
9#include "deprecat.h"
109
1110static tilemap *fg_tilemap, *bg_tilemap;
1211static UINT8 vram_bank;
r2454r2455
141140      break;
142141   }
143142
144   decodechar(Machine->gfx[2],(offset-0x400/64)&0x7f,tryout_vram_gfx);
143   decodechar(machine->gfx[2],(offset-0x400/64)&0x7f,tryout_vram_gfx);
145144   tilemap_mark_all_tiles_dirty(bg_tilemap);
146145}
147146
src/mame/video/aerofgt.c
r2454r2455
447447   }
448448}
449449
450static void aerfboo2_draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int chip,int chip_disabled_pri)
451{
452   int attr_start,base,first;
453
454   base = chip * 0x0200;
455//  first = 4 * aerofgt_spriteram3[0x1fe + base];
456   first = 0;
457
458   for (attr_start = base + 0x0200-4;attr_start >= first + base;attr_start -= 4)
459   {
460      int map_start;
461      int ox,oy,x,y,xsize,ysize,zoomx,zoomy,flipx,flipy,color,pri;
462// some other drivers still use this wrong table, they have to be upgraded
463//      int zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 };
464
465      if (!(aerofgt_spriteram3[attr_start + 2] & 0x0080)) continue;
466      pri = aerofgt_spriteram3[attr_start + 2] & 0x0010;
467      if ( chip_disabled_pri & !pri) continue;
468      if (!chip_disabled_pri & (pri>>4)) continue;
469      ox = aerofgt_spriteram3[attr_start + 1] & 0x01ff;
470      xsize = (aerofgt_spriteram3[attr_start + 2] & 0x0700) >> 8;
471      zoomx = (aerofgt_spriteram3[attr_start + 1] & 0xf000) >> 12;
472      oy = aerofgt_spriteram3[attr_start + 0] & 0x01ff;
473      ysize = (aerofgt_spriteram3[attr_start + 2] & 0x7000) >> 12;
474      zoomy = (aerofgt_spriteram3[attr_start + 0] & 0xf000) >> 12;
475      flipx = aerofgt_spriteram3[attr_start + 2] & 0x0800;
476      flipy = aerofgt_spriteram3[attr_start + 2] & 0x8000;
477      color = (aerofgt_spriteram3[attr_start + 2] & 0x000f) + 16 * spritepalettebank;
478
479      map_start = aerofgt_spriteram3[attr_start + 3];
480
481// aerofgt has this adjustment, but doing it here would break turbo force title screen
482//      ox += (xsize*zoomx+2)/4;
483//      oy += (ysize*zoomy+2)/4;
484
485      zoomx = 32 - zoomx;
486      zoomy = 32 - zoomy;
487
488      for (y = 0;y <= ysize;y++)
489      {
490         int sx,sy;
491
492         if (flipy) sy = ((oy + zoomy * (ysize - y)/2 + 16) & 0x1ff) - 16;
493         else sy = ((oy + zoomy * y / 2 + 16) & 0x1ff) - 16;
494
495         for (x = 0;x <= xsize;x++)
496         {
497            int code;
498
499            if (flipx) sx = ((ox + zoomx * (xsize - x) / 2 + 16) & 0x1ff) - 16;
500            else sx = ((ox + zoomx * x / 2 + 16) & 0x1ff) - 16;
501
502            if (chip == 0)
503               code = aerofgt_spriteram1[map_start % (aerofgt_spriteram1_size/2)];
504            else
505               code = aerofgt_spriteram2[map_start % (aerofgt_spriteram2_size/2)];
506
507            pdrawgfxzoom(bitmap,machine->gfx[sprite_gfx + chip],
508                      code,
509                      color,
510                      flipx,flipy,
511                      sx,sy,
512                      cliprect,TRANSPARENCY_PEN,15,
513                      zoomx << 11, zoomy << 11,
514                      pri ? 0 : 2);
515            map_start++;
516         }
517
518         if (xsize == 2) map_start += 1;
519         if (xsize == 4) map_start += 3;
520         if (xsize == 5) map_start += 2;
521         if (xsize == 6) map_start += 1;
522      }
523   }
524}
525
450526static void pspikesb_draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
451527{
452528   int i;
r2454r2455
789865   return 0;
790866}
791867
868VIDEO_UPDATE( aerfboo2 )
869{
870   int i,scrolly;
871
872   tilemap_set_scroll_rows(bg1_tilemap,512);
873   scrolly = bg1scrolly+2;
874   for (i = 0;i < 256;i++)
875//      tilemap_set_scrollx(bg1_tilemap,(i + scrolly) & 0x1ff,aerofgt_rasterram[i]-11);
876      tilemap_set_scrollx(bg1_tilemap,(i + scrolly) & 0x1ff,aerofgt_rasterram[7]-11);
877   tilemap_set_scrolly(bg1_tilemap,0,scrolly);
878   tilemap_set_scrollx(bg2_tilemap,0,bg2scrollx-7);
879   tilemap_set_scrolly(bg2_tilemap,0,bg2scrolly+2);
880
881   fillbitmap(priority_bitmap,0,cliprect);
882
883   tilemap_draw(bitmap,cliprect,bg1_tilemap,0,0);
884   tilemap_draw(bitmap,cliprect,bg2_tilemap,0,1);
885
886   /* we use the priority buffer so sprites are drawn front to back */
887   aerfboo2_draw_sprites(screen->machine,bitmap,cliprect,1,-1); //ship
888   aerfboo2_draw_sprites(screen->machine,bitmap,cliprect,1, 0); //intro
889   aerfboo2_draw_sprites(screen->machine,bitmap,cliprect,0,-1); //enemy
890   aerfboo2_draw_sprites(screen->machine,bitmap,cliprect,0, 0); //enemy
891   return 0;
892}
893
792894VIDEO_UPDATE( wbbc97 )
793895{
794896   int i,scrolly;
src/mame/video/ygv608.c
r2454r2455
12211221         if (++p3_state == 3)
12221222         {
12231223            p3_state = 0;
1224            palette_set_color_rgb(Machine,ygv608.regs.s.cc,
1224            palette_set_color_rgb(machine,ygv608.regs.s.cc,
12251225                pal6bit(ygv608.colour_palette[ygv608.regs.s.cc][0]),
12261226                pal6bit(ygv608.colour_palette[ygv608.regs.s.cc][1]),
12271227                pal6bit(ygv608.colour_palette[ygv608.regs.s.cc][2]) );
src/mame/video/stvvdp1.c
r2454r2455
301301         }
302302
303303         /* needed by pblbeach, it doesn't clear local coordinates in its sprite list...*/
304         if ( !strcmp(Machine->gamedrv->name, "pblbeach") )
304         if ( !strcmp(machine->gamedrv->name, "pblbeach") )
305305         {
306306            stvvdp1_local_x = stvvdp1_local_y = 0;
307307         }
r2454r2455
319319            if(!(stv_scu[40] & 0x2000)) /*Sprite draw end irq*/
320320            {
321321               logerror( "Interrupt: Sprite draw end, Vector 0x4d, Level 0x02\n" );
322               cpunum_set_input_line_and_vector(Machine, 0, 2, HOLD_LINE , 0x4d);
322               cpunum_set_input_line_and_vector(machine, 0, 2, HOLD_LINE , 0x4d);
323323            }
324324         }
325325      }
r2454r2455
356356
357357//  if (((offset * 4) > 0xdf) && ((offset * 4) < 0x140))
358358//  {
359//      logerror("cpu #%d (PC=%08X): VRAM dword write to %08X = %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), offset*4, data, mem_mask ^ 0xffffffff);
359//      logerror("cpu #%d (PC=%08X): VRAM dword write to %08X = %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), offset*4, data, mem_mask);
360360//  }
361361
362362   data = stv_vdp1_vram[offset];
src/mame/video/nbmj9195.c
r2454r2455
6969      g = ((nbmj9195_palette[offset + 0] & 0xf0) >> 4);
7070      b = ((nbmj9195_palette[offset + 1] & 0x0f) >> 0);
7171
72      palette_set_color_rgb(Machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
72      palette_set_color_rgb(machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
7373   }
7474}
7575
r2454r2455
9292   g = nbmj9195_nb22090_palette[(0x100 + (offs_h * 0x300) + offs_l)];
9393   b = nbmj9195_nb22090_palette[(0x200 + (offs_h * 0x300) + offs_l)];
9494
95   palette_set_color(Machine, ((offs_h * 0x100) + offs_l), MAKE_RGB(r, g, b));
95   palette_set_color(machine, ((offs_h * 0x100) + offs_l), MAKE_RGB(r, g, b));
9696}
9797
9898/******************************************************************************
src/mame/video/twincobr.c
r2454r2455
290290WRITE8_HANDLER( wardner_txlayer_w )
291291{
292292   int shift = 8 * (offset & 1);
293   twincobr_txoffs_w(machine, offset / 2, data << shift, 0xff00 >> shift);
293   twincobr_txoffs_w(machine, offset / 2, data << shift, 0xff << shift);
294294}
295295
296296WRITE8_HANDLER( wardner_bglayer_w )
297297{
298298   int shift = 8 * (offset & 1);
299   twincobr_bgoffs_w(machine, offset / 2, data << shift, 0xff00 >> shift);
299   twincobr_bgoffs_w(machine, offset / 2, data << shift, 0xff << shift);
300300}
301301
302302WRITE8_HANDLER( wardner_fglayer_w )
303303{
304304   int shift = 8 * (offset & 1);
305   twincobr_fgoffs_w(machine, offset / 2, data << shift, 0xff00 >> shift);
305   twincobr_fgoffs_w(machine, offset / 2, data << shift, 0xff << shift);
306306}
307307
308308WRITE8_HANDLER( wardner_txscroll_w )
309309{
310310   int shift = 8 * (offset & 1);
311   twincobr_txscroll_w(machine, offset / 2, data << shift, 0xff00 >> shift);
311   twincobr_txscroll_w(machine, offset / 2, data << shift, 0xff << shift);
312312}
313313
314314WRITE8_HANDLER( wardner_bgscroll_w )
315315{
316316   int shift = 8 * (offset & 1);
317   twincobr_bgscroll_w(machine, offset / 2, data << shift, 0xff00 >> shift);
317   twincobr_bgscroll_w(machine, offset / 2, data << shift, 0xff << shift);
318318}
319319
320320WRITE8_HANDLER( wardner_fgscroll_w )
321321{
322322   int shift = 8 * (offset & 1);
323   twincobr_fgscroll_w(machine, offset / 2, data << shift, 0xff00 >> shift);
323   twincobr_fgscroll_w(machine, offset / 2, data << shift, 0xff << shift);
324324}
325325
326326WRITE8_HANDLER( wardner_exscroll_w )   /* Extra unused video layer */
r2454r2455
338338{
339339   int shift = 8 * (offset & 1);
340340   switch (offset/2) {
341      case 0: return twincobr_txram_r(machine,0,0) >> shift; break;
342      case 1: return twincobr_bgram_r(machine,0,0) >> shift; break;
343      case 2: return twincobr_fgram_r(machine,0,0) >> shift; break;
341      case 0: return twincobr_txram_r(machine,0,0xffff) >> shift; break;
342      case 1: return twincobr_bgram_r(machine,0,0xffff) >> shift; break;
343      case 2: return twincobr_fgram_r(machine,0,0xffff) >> shift; break;
344344   }
345345   return 0;
346346}
r2454r2455
349349{
350350   int shift = 8 * (offset & 1);
351351   switch (offset/2) {
352      case 0: twincobr_txram_w(machine,0,data << shift, 0xff00 >> shift); break;
353      case 1: twincobr_bgram_w(machine,0,data << shift, 0xff00 >> shift); break;
354      case 2: twincobr_fgram_w(machine,0,data << shift, 0xff00 >> shift); break;
352      case 0: twincobr_txram_w(machine,0,data << shift, 0xff << shift); break;
353      case 1: twincobr_bgram_w(machine,0,data << shift, 0xff << shift); break;
354      case 2: twincobr_fgram_w(machine,0,data << shift, 0xff << shift); break;
355355   }
356356}
357357
r2454r2455
517517   /* Spriteram is always 1 frame ahead, suggesting spriteram buffering.
518518        There are no CPU output registers that control this so we
519519        assume it happens automatically every frame, at the end of vblank */
520   buffer_spriteram16_w(machine,0,0,0);
520   buffer_spriteram16_w(machine,0,0,0xffff);
521521}
src/mame/video/galpani2.c
r2454r2455
7272WRITE16_HANDLER( galpani2_palette_##_n_##_w ) \
7373{ \
7474   UINT16 newword = COMBINE_DATA(&galpani2_palette_##_n_[offset]); \
75   palette_set_color_rgb( Machine, offset + 0x4000 + _n_ * 0x100, pal5bit(newword >> 5), pal5bit(newword >> 10), pal5bit(newword >> 0) ); \
75   palette_set_color_rgb( machine, offset + 0x4000 + _n_ * 0x100, pal5bit(newword >> 5), pal5bit(newword >> 10), pal5bit(newword >> 0) ); \
7676}
7777
7878galpani2_BG8_REGS_R( 0 )
src/mame/video/thief.c
r2454r2455
33*/
44
55#include "driver.h"
6#include "deprecat.h"
76
87static UINT8 thief_read_mask, thief_write_mask;
98static UINT8 thief_video_control;
r2454r2455
6867   int r = intensity[(data & 0x03) >> 0];
6968    int g = intensity[(data & 0x0C) >> 2];
7069    int b = intensity[(data & 0x30) >> 4];
71   palette_set_color( Machine,offset,MAKE_RGB(r,g,b) );
70   palette_set_color( machine,offset,MAKE_RGB(r,g,b) );
7271}
7372
7473/***************************************************************************/
src/mame/video/ccastles.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "ccastles.h"
109#include "video/resnet.h"
1110
r2454r2455
125124   bit2 = (~b >> 2) & 0x01;
126125   b = combine_3_weights(bweights, bit0, bit1, bit2);
127126
128   palette_set_color(Machine, offset & 0x1f, MAKE_RGB(r, g, b));
127   palette_set_color(machine, offset & 0x1f, MAKE_RGB(r, g, b));
129128}
130129
131130
src/mame/video/policetr.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "cpu/mips/r3000.h"
109#include "policetr.h"
1110
r2454r2455
159158{
160159   /* we assume 4-byte accesses */
161160   if (mem_mask)
162      logerror("%08X: policetr_video_w access with mask %08X\n", activecpu_get_previouspc(), ~mem_mask);
161      logerror("%08X: policetr_video_w access with mask %08X\n", activecpu_get_previouspc(), mem_mask);
163162
164163   /* 4 offsets */
165164   switch (offset)
r2454r2455
209208
210209            /* log anything else */
211210            default:
212               logerror("%08X: policetr_video_w(2) = %08X & %08X with latch %02X\n", activecpu_get_previouspc(), data, ~mem_mask, video_latch);
211               logerror("%08X: policetr_video_w(2) = %08X & %08X with latch %02X\n", activecpu_get_previouspc(), data, mem_mask, video_latch);
213212               break;
214213         }
215214         break;
r2454r2455
223222            /* latch 0x00 is unknown; 0, 1, and 2 get written into the upper 12 bits before rendering */
224223            case 0x00:
225224               if (data != (0 << 20) && data != (1 << 20) && data != (2 << 20))
226                  logerror("%08X: policetr_video_w(3) = %08X & %08X with latch %02X\n", activecpu_get_previouspc(), data, ~mem_mask, video_latch);
225                  logerror("%08X: policetr_video_w(3) = %08X & %08X with latch %02X\n", activecpu_get_previouspc(), data, mem_mask, video_latch);
227226               break;
228227
229228            /* latch 0x10 specifies destination bitmap X and Y offsets */
r2454r2455
235234            /* latch 0x20 is unknown; either 0xef or 0x100 is written every IRQ4 */
236235            case 0x20:
237236               if (data != (0x100 << 12) && data != (0xef << 12))
238                  logerror("%08X: policetr_video_w(3) = %08X & %08X with latch %02X\n", activecpu_get_previouspc(), data, ~mem_mask, video_latch);
237                  logerror("%08X: policetr_video_w(3) = %08X & %08X with latch %02X\n", activecpu_get_previouspc(), data, mem_mask, video_latch);
239238               break;
240239
241240            /* latch 0x40 is unknown; a 0 is written every IRQ4 */
242241            case 0x40:
243242               if (data != 0)
244                  logerror("%08X: policetr_video_w(3) = %08X & %08X with latch %02X\n", activecpu_get_previouspc(), data, ~mem_mask, video_latch);
243                  logerror("%08X: policetr_video_w(3) = %08X & %08X with latch %02X\n", activecpu_get_previouspc(), data, mem_mask, video_latch);
245244               break;
246245
247246            /* latch 0x50 clears IRQ4 */
248247            case 0x50:
249               cpunum_set_input_line(Machine, 0, R3000_IRQ4, CLEAR_LINE);
248               cpunum_set_input_line(machine, 0, R3000_IRQ4, CLEAR_LINE);
250249               break;
251250
252251            /* latch 0x60 clears IRQ5 */
253252            case 0x60:
254               cpunum_set_input_line(Machine, 0, R3000_IRQ5, CLEAR_LINE);
253               cpunum_set_input_line(machine, 0, R3000_IRQ5, CLEAR_LINE);
255254               break;
256255
257256            /* log anything else */
258257            default:
259               logerror("%08X: policetr_video_w(3) = %08X & %08X with latch %02X\n", activecpu_get_previouspc(), data, ~mem_mask, video_latch);
258               logerror("%08X: policetr_video_w(3) = %08X & %08X with latch %02X\n", activecpu_get_previouspc(), data, mem_mask, video_latch);
260259               break;
261260         }
262261         break;
r2454r2455
346345      palette_data[palette_index] = (data >> 16) & 0xff;
347346      if (++palette_index == 3)
348347      {
349         palette_set_color(Machine, palette_offset, MAKE_RGB(palette_data[0], palette_data[1], palette_data[2]));
348         palette_set_color(machine, palette_offset, MAKE_RGB(palette_data[0], palette_data[1], palette_data[2]));
350349         palette_index = 0;
351350      }
352351   }
src/mame/video/midtunit.c
r2454r2455
55**************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "profiler.h"
109#include "cpu/tms34010/tms34010.h"
1110#include "cpu/tms34010/34010ops.h"
r2454r2455
299298
300299   COMBINE_DATA(&paletteram16[offset]);
301300   newword = paletteram16[offset];
302   palette_set_color_rgb(Machine, offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
301   palette_set_color_rgb(machine, offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
303302}
304303
305304
r2454r2455
685684
686685   /* high bit triggers action */
687686   command = dma_register[DMA_COMMAND];
688   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
687   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
689688   if (!(command & 0x8000))
690689      return;
691690
src/mame/video/system1.c
r2454r2455
88*************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1211#include "system1.h"
1312
1413UINT8 *system1_scroll_y;
r2454r2455
105104      b = pal2bit(data >> 6);
106105   }
107106
108   palette_set_color(Machine,offset,MAKE_RGB(r,g,b));
107   palette_set_color(machine,offset,MAKE_RGB(r,g,b));
109108}
110109
111110static STATE_POSTLOAD( system1_postload )
src/mame/video/powerins.c
r2454r2455
3838**************************************************************************/
3939
4040#include "driver.h"
41#include "deprecat.h"
4241
4342/* Variables that driver has access to: */
4443UINT16 *powerins_vram_0, *powerins_vctrl_0;
r2454r2455
9695   int g = ((newword >>  7) & 0x1E ) | ((newword >> 2) & 0x01);
9796   int b = ((newword >>  3) & 0x1E ) | ((newword >> 1) & 0x01);
9897
99   palette_set_color_rgb( Machine,offset, pal5bit(r),pal5bit(g),pal5bit(b) );
98   palette_set_color_rgb( machine,offset, pal5bit(r),pal5bit(g),pal5bit(b) );
10099}
101100
102101
src/mame/video/niyanpai.c
r2454r2455
6868         g  = ((niyanpai_palette[(0x080 + (offs_h * 0x180) + offs_l)] & 0xff00) >> 8);
6969         b  = ((niyanpai_palette[(0x100 + (offs_h * 0x180) + offs_l)] & 0xff00) >> 8);
7070
71         palette_set_color(Machine, ((offs_h << 8) + (offs_l << 1) + 0), MAKE_RGB(r, g, b));
71         palette_set_color(machine, ((offs_h << 8) + (offs_l << 1) + 0), MAKE_RGB(r, g, b));
7272      }
7373
7474      if (ACCESSING_BITS_0_7)
r2454r2455
7777         g  = ((niyanpai_palette[(0x080 + (offs_h * 0x180) + offs_l)] & 0x00ff) >> 0);
7878         b  = ((niyanpai_palette[(0x100 + (offs_h * 0x180) + offs_l)] & 0x00ff) >> 0);
7979
80         palette_set_color(Machine, ((offs_h << 8) + (offs_l << 1) + 1), MAKE_RGB(r, g, b));
80         palette_set_color(machine, ((offs_h << 8) + (offs_l << 1) + 1), MAKE_RGB(r, g, b));
8181      }
8282   }
8383}
src/mame/video/stvvdp2.c
r2454r2455
51095109         b = ((stv_vdp2_cram[offset] & 0x00ff0000) >> 16);
51105110         g = ((stv_vdp2_cram[offset] & 0x0000ff00) >> 8);
51115111         r = ((stv_vdp2_cram[offset] & 0x000000ff) >> 0);
5112         palette_set_color(Machine,offset,MAKE_RGB(r,g,b));
5112         palette_set_color(machine,offset,MAKE_RGB(r,g,b));
51135113      }
51145114      break;
51155115      /*Mode 0*/
r2454r2455
51205120         b = ((stv_vdp2_cram[offset] & 0x00007c00) >> 10);
51215121         g = ((stv_vdp2_cram[offset] & 0x000003e0) >> 5);
51225122         r = ((stv_vdp2_cram[offset] & 0x0000001f) >> 0);
5123         palette_set_color_rgb(Machine,(offset*2)+1,pal5bit(r),pal5bit(g),pal5bit(b));
5123         palette_set_color_rgb(machine,(offset*2)+1,pal5bit(r),pal5bit(g),pal5bit(b));
51245124         b = ((stv_vdp2_cram[offset] & 0x7c000000) >> 26);
51255125         g = ((stv_vdp2_cram[offset] & 0x03e00000) >> 21);
51265126         r = ((stv_vdp2_cram[offset] & 0x001f0000) >> 16);
5127         palette_set_color_rgb(Machine,offset*2,pal5bit(r),pal5bit(g),pal5bit(b));
5127         palette_set_color_rgb(machine,offset*2,pal5bit(r),pal5bit(g),pal5bit(b));
51285128      }
51295129      break;
51305130      /*Mode 1*/
r2454r2455
51355135         b = ((stv_vdp2_cram[offset] & 0x00007c00) >> 10);
51365136         g = ((stv_vdp2_cram[offset] & 0x000003e0) >> 5);
51375137         r = ((stv_vdp2_cram[offset] & 0x0000001f) >> 0);
5138         palette_set_color_rgb(Machine,(offset*2)+1,pal5bit(r),pal5bit(g),pal5bit(b));
5138         palette_set_color_rgb(machine,(offset*2)+1,pal5bit(r),pal5bit(g),pal5bit(b));
51395139         b = ((stv_vdp2_cram[offset] & 0x7c000000) >> 26);
51405140         g = ((stv_vdp2_cram[offset] & 0x03e00000) >> 21);
51415141         r = ((stv_vdp2_cram[offset] & 0x001f0000) >> 16);
5142         palette_set_color_rgb(Machine,offset*2,pal5bit(r),pal5bit(g),pal5bit(b));
5142         palette_set_color_rgb(machine,offset*2,pal5bit(r),pal5bit(g),pal5bit(b));
51435143      }
51445144      break;
51455145   }
src/mame/video/jedi.c
r2454r2455
1515***************************************************************************/
1616
1717#include "driver.h"
18#include "deprecat.h"
1918#include "jedi.h"
2019
2120
src/mame/video/suprnova.c
r2454r2455
1515*/
1616
1717#include "driver.h"
18#include "deprecat.h"
1918
2019#define SUPRNOVA_DECODE_BUFFER_SIZE 0x2000
2120
r2454r2455
138137      r <<= 3;
139138   }
140139
141   palette_set_color(Machine,offset,MAKE_RGB(r,g,b));
140   palette_set_color(machine,offset,MAKE_RGB(r,g,b));
142141}
143142
144143
r2454r2455
970969
971970VIDEO_EOF(skns)
972971{
973   buffer_spriteram32_w(machine,0,0,0);
972   buffer_spriteram32_w(machine,0,0,0xffffffff);
974973}
src/mame/video/paradise.c
r2454r2455
2626***************************************************************************/
2727
2828#include "driver.h"
29#include "deprecat.h"
3029#include "paradise.h"
3130
3231/* Variables that driver has access to: */
r2454r2455
5453{
5554   paletteram[offset] = data;
5655   offset %= 0x800;
57   palette_set_color_rgb(Machine,offset,   paletteram[offset + 0x800 * 0],
56   palette_set_color_rgb(machine,offset,   paletteram[offset + 0x800 * 0],
5857                                 paletteram[offset + 0x800 * 1],
5958                                 paletteram[offset + 0x800 * 2]   );
6059}
r2454r2455
8786   int bank2 = (data & 0xf0);
8887
8988   for (i = 0; i < 15; i++)
90      palette_set_color_rgb(Machine,0x800+i,   paletteram[0x200 + bank2 + i + 0x800 * 0],
89      palette_set_color_rgb(machine,0x800+i,   paletteram[0x200 + bank2 + i + 0x800 * 0],
9190                                    paletteram[0x200 + bank2 + i + 0x800 * 1],
9291                                    paletteram[0x200 + bank2 + i + 0x800 * 2]   );
9392   if (paradise_palbank != bank1)
src/mame/video/volfied.c
r2454r2455
3434
3535WRITE16_HANDLER( volfied_video_ram_w )
3636{
37   mem_mask |= ~video_mask;
37   mem_mask &= video_mask;
3838
3939   COMBINE_DATA(&video_ram[offset]);
4040}
src/mame/video/balsente.c
r2454r2455
77****************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110#include "balsente.h"
1211
1312
r2454r2455
107106   g = paletteram[(offset & ~3) + 1];
108107   b = paletteram[(offset & ~3) + 2];
109108
110   palette_set_color_rgb(Machine, offset / 4, pal4bit(r), pal4bit(g), pal4bit(b));
109   palette_set_color_rgb(machine, offset / 4, pal4bit(r), pal4bit(g), pal4bit(b));
111110}
112111
113112
src/mame/video/itech32.c
r2454r2455
66***************************************************************************/
77
88#include "driver.h"
9#include "deprecat.h"
109#include "profiler.h"
1110#include "cpu/m68000/m68000.h"
1211#include "itech32.h"
r2454r2455
272271      double intensity = (double)(data & 0xff) / (double)0x60;
273272      int i;
274273      for (i = 0; i < 8192; i++)
275         palette_set_brightness(Machine, i, intensity);
274         palette_set_brightness(machine, i, intensity);
276275   }
277276}
278277
r2454r2455
350349   g = paletteram16[offset & ~1] >> 8;
351350   b = paletteram16[offset |  1] >> 8;
352351
353   palette_set_color(Machine, offset / 2, MAKE_RGB(r, g, b));
352   palette_set_color(machine, offset / 2, MAKE_RGB(r, g, b));
354353}
355354
356355
r2454r2455
367366   g = paletteram16[offset & ~1] >> 8;
368367   b = paletteram16[offset |  1] & 0xff;
369368
370   palette_set_color(Machine, offset / 2, MAKE_RGB(r, g, b));
369   palette_set_color(machine, offset / 2, MAKE_RGB(r, g, b));
371370}
372371
373372
r2454r2455
381380   g = (paletteram32[offset] >> 8) & 0xff;
382381   b = (paletteram32[offset] >> 16) & 0xff;
383382
384   palette_set_color(Machine, offset, MAKE_RGB(r, g, b));
383   palette_set_color(machine, offset, MAKE_RGB(r, g, b));
385384}
386385
387386
r2454r2455
395394   g = (paletteram32[offset] >> 8) & 0xff;
396395   b = paletteram32[offset] & 0xff;
397396
398   palette_set_color(Machine, offset, MAKE_RGB(r, g, b));
397   palette_set_color(machine, offset, MAKE_RGB(r, g, b));
399398}
400399
401400
r2454r2455
14161415
14171416READ16_HANDLER( bloodstm_video_r )
14181417{
1419   return itech32_video_r(machine, offset / 2,0);
1418   return itech32_video_r(machine, offset / 2, mem_mask);
14201419}
14211420
14221421
r2454r2455
14381437
14391438READ32_HANDLER( itech020_video_r )
14401439{
1441   int result = itech32_video_r(machine,offset,0);
1440   int result = itech32_video_r(machine, offset, mem_mask);
14421441   return (result << 16) | result;
14431442}
14441443
src/mame/video/amiga.c
r2454r2455
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110#include "includes/amiga.h"
1211
1312
r2454r2455
225224      if (LOG_COPPER)
226225         logerror("%02X.%02X: Write to %s = %04x\n", last_scanline, xpos / 2, amiga_custom_names[copper_pending_offset & 0xff], copper_pending_data);
227226
228      amiga_custom_w(machine, copper_pending_offset, copper_pending_data, 0);
227      amiga_custom_w(machine, copper_pending_offset, copper_pending_data, 0xffff);
229228      copper_pending_offset = 0;
230229   }
231230
src/mame/video/undrfire.c
r2454r2455
495495   /* See if we should draw artificial gun targets */
496496   /* (not yet implemented...) */
497497
498   if (input_port_7_word_r(screen->machine,0,0) & 0x1)   /* Fake DSW */
498   if (input_port_read_indexed(screen->machine,7) & 0x1)   /* Fake DSW */
499499   {
500500      popmessage("Gunsights on");
501501   }
r2454r2455
639639   /* See if we should draw artificial gun targets */
640640   /* (not yet implemented...) */
641641
642   if (input_port_7_word_r(screen->machine,0,0) & 0x1)   /* Fake DSW */
642   if (input_port_read_indexed(screen->machine,7) & 0x1)   /* Fake DSW */
643643   {
644644      popmessage("Gunsights on");
645645   }
src/mame/video/deco32.c
r2454r2455
157157   g = (paletteram32[offset] >> 8) & 0xff;
158158   r = (paletteram32[offset] >> 0) & 0xff;
159159
160   palette_set_color(Machine,offset,MAKE_RGB(r,g,b));
160   palette_set_color(machine,offset,MAKE_RGB(r,g,b));
161161}
162162
163163WRITE32_HANDLER( deco32_buffered_palette_w )
r2454r2455
168168
169169WRITE32_HANDLER( deco32_palette_dma_w )
170170{
171   const int m=Machine->config->total_colors;
171   const int m=machine->config->total_colors;
172172   int r,g,b,i;
173173
174174   for (i=0; i<m; i++) {
r2454r2455
185185            g = (paletteram32[i] >> 8) & 0xff;
186186            r = (paletteram32[i] >> 0) & 0xff;
187187
188            palette_set_color(Machine,i,MAKE_RGB(r,g,b));
188            palette_set_color(machine,i,MAKE_RGB(r,g,b));
189189         }
190190      }
191191   }
src/mame/video/grchamp.c
r2454r2455
22
33/* updated by Hans Andersson, dec 2005     */
44#include "driver.h"
5#include "deprecat.h"
65#include "video/resnet.h"
76#include "includes/grchamp.h"
87
r2454r2455
5554
5655WRITE8_HANDLER( grchamp_left_w )
5756{
58   grchamp_state *state = Machine->driver_data;
57   grchamp_state *state = machine->driver_data;
5958   state->leftram[offset] = data;
6059   tilemap_mark_tile_dirty(state->left_tilemap, offset);
6160}
6261
6362WRITE8_HANDLER( grchamp_center_w )
6463{
65   grchamp_state *state = Machine->driver_data;
64   grchamp_state *state = machine->driver_data;
6665   state->centerram[offset] = data;
6766   tilemap_mark_tile_dirty(state->center_tilemap, offset);
6867}
6968
7069WRITE8_HANDLER( grchamp_right_w )
7170{
72   grchamp_state *state = Machine->driver_data;
71   grchamp_state *state = machine->driver_data;
7372   state->rightram[offset] = data;
7473   tilemap_mark_tile_dirty(state->right_tilemap, offset);
7574}
src/mame/video/fastfred.c
r2454r2455
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110#include "video/resnet.h"
1211#include "fastfred.h"
1312
src/mame/video/galpanic.c
r2454r2455
11#include "driver.h"
2#include "deprecat.h"
32#include "kan_pand.h"
43
54UINT16 *galpanic_bgvideoram,*galpanic_fgvideoram;
r2454r2455
4544{
4645   data = COMBINE_DATA(&paletteram16[offset]);
4746   /* bit 0 seems to be a transparency flag for the front bitmap */
48   palette_set_color_rgb(Machine,offset,pal5bit(data >> 6),pal5bit(data >> 11),pal5bit(data >> 1));
47   palette_set_color_rgb(machine,offset,pal5bit(data >> 6),pal5bit(data >> 11),pal5bit(data >> 1));
4948}
5049
5150
src/mame/video/gticlub.c
r2454r2455
287287         {
288288            if (K001005_fifo_read_ptr < 0x3ff)
289289            {
290               //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, CLEAR_LINE);
290               //cpunum_set_input_line(machine, 2, SHARC_INPUT_FLAG1, CLEAR_LINE);
291291               cpuintrf_push_context(2);
292292               sharc_set_flag_input(1, CLEAR_LINE);
293293               cpuintrf_pop_context();
294294            }
295295            else
296296            {
297               //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE);
297               //cpunum_set_input_line(machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE);
298298               cpuintrf_push_context(2);
299299               sharc_set_flag_input(1, ASSERT_LINE);
300300               cpuintrf_pop_context();
r2454r2455
302302         }
303303         else
304304         {
305            //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE);
305            //cpunum_set_input_line(machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE);
306306            cpuintrf_push_context(2);
307307            sharc_set_flag_input(1, ASSERT_LINE);
308308            cpuintrf_pop_context();
r2454r2455
346346         {
347347            if (K001005_fifo_write_ptr < 0x400)
348348            {
349               //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE);
349               //cpunum_set_input_line(machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE);
350350               cpuintrf_push_context(2);
351351               sharc_set_flag_input(1, ASSERT_LINE);
352352               cpuintrf_pop_context();
353353            }
354354            else
355355            {
356               //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, CLEAR_LINE);
356               //cpunum_set_input_line(machine, 2, SHARC_INPUT_FLAG1, CLEAR_LINE);
357357               cpuintrf_push_context(2);
358358               sharc_set_flag_input(1, CLEAR_LINE);
359359               cpuintrf_pop_context();
r2454r2455
361361         }
362362         else
363363         {
364            //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE);
364            //cpunum_set_input_line(machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE);
365365            cpuintrf_push_context(2);
366366            sharc_set_flag_input(1, ASSERT_LINE);
367367            cpuintrf_pop_context();
src/mame/video/foodf.c
r2454r2455
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "machine/atarigen.h"
109#include "foodf.h"
1110#include "video/resnet.h"
r2454r2455
108107   bit1 = (newword >> 7) & 0x01;
109108   b = combine_2_weights(bweights, bit0, bit1);
110109
111   palette_set_color(Machine, offset, MAKE_RGB(r, g, b));
110   palette_set_color(machine, offset, MAKE_RGB(r, g, b));
112111}
113112
114113
src/mame/video/armedf.c
r2454r2455
351351
352352VIDEO_EOF( armedf )
353353{
354   buffer_spriteram16_w(machine,0,0,0);
354   buffer_spriteram16_w(machine,0,0,0xffff);
355355}
src/mame/video/psx.c
r2454r2455
614614   visarea.min_x = visarea.min_y = 0;
615615   visarea.max_x = m_n_screenwidth - 1;
616616   visarea.max_y = m_n_screenheight - 1;
617   video_screen_configure(Machine->primary_screen, m_n_screenwidth, m_n_screenheight, &visarea, HZ_TO_ATTOSECONDS(refresh));
617   video_screen_configure(machine->primary_screen, m_n_screenwidth, m_n_screenheight, &visarea, HZ_TO_ATTOSECONDS(refresh));
618618}
619619
620620static void psx_gpu_init( running_machine *machine )
r2454r2455
39073907
39083908void psx_gpu_reset( void )
39093909{
3910   psx_gpu_w( Machine, 1, 0, 0 );
3910   psx_gpu_w( Machine, 1, 0, 0xffffffff );
39113911}
39123912
39133913void psx_lightgun_set( int n_x, int n_y )
src/mame/video/beezer.c
r2454r2455
11#include "driver.h"
2#include "deprecat.h"
32#include "cpu/m6809/m6809.h"
43#include "machine/6522via.h"
54
r2454r2455
5958   bit1 = (data >> 7) & 0x01;
6059   b = 0x5f * bit0 + 0xa0 * bit1;
6160
62   palette_set_color(Machine, offset, MAKE_RGB(r, g, b));
61   palette_set_color(machine, offset, MAKE_RGB(r, g, b));
6362}
6463
6564READ8_HANDLER( beezer_line_r )
src/mame/video/system16.c
r2454r2455
8989
9090***************************************************************************/
9191#include "driver.h"
92#include "deprecat.h"
9392#include "system16.h"
9493#include "video/resnet.h"
9594
r2454r2455
524523      gh = combine_6_weights(weights[1][1], g0, g1, g2, g3, g4, 1);
525524      bh = combine_6_weights(weights[1][2], b0, b1, b2, b3, b4, 1);
526525
527      palette_set_color( Machine, offset, MAKE_RGB(r, g, b) );
526      palette_set_color( machine, offset, MAKE_RGB(r, g, b) );
528527
529      palette_set_color( Machine, offset+Machine->config->total_colors/2,MAKE_RGB(rs,gs,bs));
528      palette_set_color( machine, offset+machine->config->total_colors/2,MAKE_RGB(rs,gs,bs));
530529   }
531530}
532531
src/mame/video/deniam.c
r2454r2455
11#include "driver.h"
2#include "deprecat.h"
32
43
54UINT16 *deniam_videoram,*deniam_textram;
r2454r2455
146145   r = ((data << 1) & 0x1e) | ((data >> 12) & 0x01);
147146   g = ((data >> 3) & 0x1e) | ((data >> 13) & 0x01);
148147   b = ((data >> 7) & 0x1e) | ((data >> 14) & 0x01);
149   palette_set_color_rgb(Machine,offset,pal5bit(r),pal5bit(g),pal5bit(b));
148   palette_set_color_rgb(machine,offset,pal5bit(r),pal5bit(g),pal5bit(b));
150149}
151150
152151
src/mame/video/mcr3.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "mcr.h"
109
1110
r2454r2455
150149   offset &= 0x7f;
151150
152151   /* high bit of red comes from low bit of address */
153   palette_set_color_rgb(Machine, offset / 2, pal3bit(((offset & 1) << 2) + (data >> 6)), pal3bit(data >> 0), pal3bit(data >> 3));
152   palette_set_color_rgb(machine, offset / 2, pal3bit(((offset & 1) << 2) + (data >> 6)), pal3bit(data >> 0), pal3bit(data >> 3));
154153}
155154
156155
src/mame/video/taito_b.c
r2454r2455
162162   int i;
163163
164164    for (i = 0;i < 0x40000;i++)
165      hitice_pixelram_w(machine,i,0,0);
165      hitice_pixelram_w(machine,i,0,0xffff);
166166}
167167
168168static TILE_GET_INFO( get_bg_tile_info )
src/mame/video/taitoic.c
r2454r2455
533533***************************************************************************/
534534
535535#include "driver.h"
536#include "deprecat.h"
537536#include "taitoic.h"
538537
539538#define TOPSPEED_ROAD_COLORS
r2454r2455
26122611
26132612READ32_HANDLER( TC0100SCN_ctrl_long_r )
26142613{
2615   return (TC0100SCN_ctrl_word_0_r(machine,offset*2,0)<<16)|TC0100SCN_ctrl_word_0_r(machine,offset*2+1,0);
2614   return (TC0100SCN_ctrl_word_0_r(machine,offset*2,0xffff)<<16)|TC0100SCN_ctrl_word_0_r(machine,offset*2+1,0xffff);
26162615}
26172616
26182617WRITE32_HANDLER( TC0100SCN_ctrl_long_w )
r2454r2455
26232622
26242623READ32_HANDLER( TC0100SCN_long_r )
26252624{
2626   return (TC0100SCN_word_0_r(machine,offset*2,0)<<16)|TC0100SCN_word_0_r(machine,offset*2+1,0);
2625   return (TC0100SCN_word_0_r(machine,offset*2,0xffff)<<16)|TC0100SCN_word_0_r(machine,offset*2+1,0xffff);
26272626}
26282627
26292628WRITE32_HANDLER( TC0100SCN_long_w )
26302629{
26312630   if (ACCESSING_BITS_16_31)
26322631   {
2633      int oldword = TC0100SCN_word_0_r(machine,offset*2,0);
2632      int oldword = TC0100SCN_word_0_r(machine,offset*2,0xffff);
26342633      int newword = data>>16;
26352634      if (!ACCESSING_BITS_16_23)
26362635         newword |= (oldword &0x00ff);
26372636      if (!ACCESSING_BITS_24_31)
26382637         newword |= (oldword &0xff00);
2639      TC0100SCN_word_0_w(machine,offset*2,newword,0);
2638      TC0100SCN_word_0_w(machine,offset*2,newword,0xffff);
26402639   }
26412640   if (ACCESSING_BITS_0_15)
26422641   {
2643      int oldword = TC0100SCN_word_0_r(machine,(offset*2)+1,0);
2642      int oldword = TC0100SCN_word_0_r(machine,(offset*2)+1,0xffff);
26442643      int newword = data&0xffff;
26452644      if (!ACCESSING_BITS_0_7)
26462645         newword |= (oldword &0x00ff);
26472646      if (!ACCESSING_BITS_8_15)
26482647         newword |= (oldword &0xff00);
2649      TC0100SCN_word_0_w(machine,(offset*2)+1,newword,0);
2648      TC0100SCN_word_0_w(machine,(offset*2)+1,newword,0xffff);
26502649   }
26512650}
26522651
r2454r2455
32813280
32823281READ32_HANDLER( TC0480SCP_ctrl_long_r )
32833282{
3284   return (TC0480SCP_ctrl_word_r(machine,offset*2,0)<<16)|TC0480SCP_ctrl_word_r(machine,offset*2+1,0);
3283   return (TC0480SCP_ctrl_word_r(machine,offset*2,0xffff)<<16)|TC0480SCP_ctrl_word_r(machine,offset*2+1,0xffff);
32853284}
32863285
32873286/* TODO: byte access ? */
r2454r2455
32943293
32953294READ32_HANDLER( TC0480SCP_long_r )
32963295{
3297   return (TC0480SCP_word_r(machine,offset*2,0)<<16)|TC0480SCP_word_r(machine,offset*2+1,0);
3296   return (TC0480SCP_word_r(machine,offset*2,0xffff)<<16)|TC0480SCP_word_r(machine,offset*2+1,0xffff);
32983297}
32993298
33003299WRITE32_HANDLER( TC0480SCP_long_w )
33013300{
33023301   if (ACCESSING_BITS_16_31)
33033302   {
3304      int oldword = TC0480SCP_word_r(machine,offset*2,0);
3303      int oldword = TC0480SCP_word_r(machine,offset*2,0xffff);
33053304      int newword = data>>16;
33063305      if (!ACCESSING_BITS_16_23)
33073306         newword |= (oldword &0x00ff);
33083307      if (!ACCESSING_BITS_24_31)
33093308         newword |= (oldword &0xff00);
3310      TC0480SCP_word_w(machine,offset*2,newword,0);
3309      TC0480SCP_word_w(machine,offset*2,newword,0xffff);
33113310   }
33123311   if (ACCESSING_BITS_0_15)
33133312   {
3314      int oldword = TC0480SCP_word_r(machine,(offset*2)+1,0);
3313      int oldword = TC0480SCP_word_r(machine,(offset*2)+1,0xffff);
33153314      int newword = data&0xffff;
33163315      if (!ACCESSING_BITS_0_7)
33173316         newword |= (oldword &0x00ff);
33183317      if (!ACCESSING_BITS_8_15)
33193318         newword |= (oldword &0xff00);
3320      TC0480SCP_word_w(machine,(offset*2)+1,newword,0);
3319      TC0480SCP_word_w(machine,(offset*2)+1,newword,0xffff);
33213320   }
33223321}
33233322
r2454r2455
47324731         }
47334732      }
47344733
4735      palette_set_color(Machine, i + (chip << 12),MAKE_RGB(r,g,b));
4734      palette_set_color(machine, i + (chip << 12),MAKE_RGB(r,g,b));
47364735   }
47374736}
47384737
r2454r2455
48154814      case 1:
48164815      {
48174816         TC0110PCR_ram[0][(TC0110PCR_addr[0])] = data & 0xffff;
4818         palette_set_color_rgb(Machine,TC0110PCR_addr[0],pal5bit(data >> 0),pal5bit(data >> 5),pal5bit(data >> 10));
4817         palette_set_color_rgb(machine,TC0110PCR_addr[0],pal5bit(data >> 0),pal5bit(data >> 5),pal5bit(data >> 10));
48194818         break;
48204819      }
48214820
r2454r2455
48374836      case 1:
48384837      {
48394838         TC0110PCR_ram[0][(TC0110PCR_addr[0])] = data & 0xffff;
4840         palette_set_color_rgb(Machine,TC0110PCR_addr[0],pal5bit(data >> 0),pal5bit(data >> 5),pal5bit(data >> 10));
4839         palette_set_color_rgb(machine,TC0110PCR_addr[0],pal5bit(data >> 0),pal5bit(data >> 5),pal5bit(data >> 10));
48414840         break;
48424841      }
48434842
r2454r2455
48604859      {
48614860         TC0110PCR_ram[1][(TC0110PCR_addr[1])] = data & 0xffff;
48624861         /* change a color in the second color area (4096-8191) */
4863         palette_set_color_rgb(Machine,TC0110PCR_addr[1] + 4096,pal5bit(data >> 0),pal5bit(data >> 5),pal5bit(data >> 10));
4862         palette_set_color_rgb(machine,TC0110PCR_addr[1] + 4096,pal5bit(data >> 0),pal5bit(data >> 5),pal5bit(data >> 10));
48644863         break;
48654864      }
48664865
r2454r2455
48834882      {
48844883         TC0110PCR_ram[2][(TC0110PCR_addr[2])] = data & 0xffff;
48854884         /* change a color in the second color area (8192-12288) */
4886         palette_set_color_rgb(Machine,TC0110PCR_addr[2] + 8192,pal5bit(data >> 0),pal5bit(data >> 5),pal5bit(data >> 10));
4885         palette_set_color_rgb(machine,TC0110PCR_addr[2] + 8192,pal5bit(data >> 0),pal5bit(data >> 5),pal5bit(data >> 10));
48874886         break;
48884887      }
48894888
r2454r2455
49074906      case 1:
49084907      {
49094908         TC0110PCR_ram[0][(TC0110PCR_addr[0])] = data & 0xffff;
4910         palette_set_color_rgb(Machine,TC0110PCR_addr[0],pal5bit(data >> 10),pal5bit(data >> 5),pal5bit(data >> 0));
4909         palette_set_color_rgb(machine,TC0110PCR_addr[0],pal5bit(data >> 10),pal5bit(data >> 5),pal5bit(data >> 0));
49114910         break;
49124911      }
49134912
r2454r2455
49314930      case 1:
49324931      {
49334932         TC0110PCR_ram[0][(TC0110PCR_addr[0])] = data & 0xffff;
4934         palette_set_color_rgb(Machine,TC0110PCR_addr[0],pal4bit(data >> 0),pal4bit(data >> 4),pal4bit(data >> 8));
4933         palette_set_color_rgb(machine,TC0110PCR_addr[0],pal4bit(data >> 0),pal4bit(data >> 4),pal4bit(data >> 8));
49354934         break;
49364935      }
49374936
src/mame/video/suna8.c
r2454r2455
7070***************************************************************************/
7171
7272#include "driver.h"
73#include "deprecat.h"
7473
7574#define TILEMAPS 0
7675
r2454r2455
166165         (((rgb & (1<<0x6))?1:0)<<2) |
167166         (((rgb & (1<<0x7))?1:0)<<3);
168167
169   palette_set_color_rgb(Machine,offset/2,pal4bit(r),pal4bit(g),pal4bit(b));
168   palette_set_color_rgb(machine,offset/2,pal4bit(r),pal4bit(g),pal4bit(b));
170169}
171170
172171
src/mame/video/btime.c
r2454r2455
292292    /* For now we just check 0x40 in DSW1, and ignore the write if we */
293293    /* are in upright controls mode. */
294294
295    if (input_port_3_r(machine, 0) & 0x40) /* cocktail mode */
295    if (input_port_read_indexed(machine, 3) & 0x40) /* cocktail mode */
296296        btime_video_control_w(machine, offset, data);
297297}
298298
src/mame/video/cps1.c
r2454r2455
2525Ghouls 'n Ghosts (World / US)               1988  88620B-2  DM620            LWIO  None       CPS-B-01  DL-0411-10001  None
2626  (alt B-board revision - Japan)                  88622B-2  DM22A            LWIO  88622-C-1  CPS-B-01  DL-0411-10001  None
2727Strider                                     1989  89624B-2  ST24M1           LWIO  88622-C-1  CPS-B-01  DL-0411-10001  None
28  (alt B-board revision)                          89624B-3  ST24B2           LWIO
28  (alt B-board revision)                          89624B-2  ST24M2           LWIO  88622-C-2  CPS-B-01  DL-0411-10001  None
29  (alt B-board revision)                          89624B-3  ST24B2           LWIO  88622-C-2  CPS-B-01  DL-0411-10001  None
2930  (alt B-board revision)                          ?         ST22B            ?
30Dynasty Wars                                1989  88622B-3  TK22B            IOB1  88622-C-2  CPS-B-02  DL-0411-10002
31Dynasty Wars                                1989  88624B-3  TK24B?           ?     88622-C-2  CPS-B-02  DL-0411-10002
32  (alt B-board revision - Japan)                  88622B-3  TK22B            IOB1
3133Willow                                      1989  89624B-3  WL24B            LWIO  88622-C-4  CPS-B-03  DL-0411-10003  None
3234  (alt C-board revision)                                                           88622-C-2
3335UN Squadron / Area 88                       1989  89624B-3  AR24B            LWIO  88622-C-4  CPS-B-11  DL-0411-10004  None
3436  (alt B-board revision - Japan)                  88622B-2  AR22B            LWIO
3537Final Fight (first rev)                     1989  89624B-3  S224B            IOB1  88622-C-5  CPS-B-04  DL-0411-10005  None
3638Final Fight (US 900112)                                                            ?          CPS-B-04@ DL-0411-10001  None
37Final Fight (US 900613)                                                            ?          CPS-B-05  DL-0411-10006
38Final Fight (Japan 900305) (alt B-board revision) ?         ?                      ?          CPS-B-02  DL-0411-10002
39Final Fight (US 900613)                                                            88622-C-5  CPS-B-05  DL-0411-10006
40Final Fight (Japan 900305) (alt B-board revision) 88622B-2  S222B?           LWIO  88622-C-5  CPS-B-02  DL-0411-10002
39411941                                        1990  ?         YI24B            ?     88622-C-5  CPS-B-05  DL-0411-10006  ?
4042Mercs                                       1990  89624B-3  0224B            IOB1  90628-C-1  CPS-B-12  DL-0411-10007  C628
4143  (alt C-board revision)                                                           90628-C-2
r2454r2455
4446Nemo                                        1990  89624B-3  NM24B            IOB1  88622-C-5  CPS-B-15  DL-0411-10010  None
4547Carrier Air Wing / U.S. Navy                1990  89624B-3  CA24B            IOB1  88622-C-5  CPS-B-16  DL-0411-10011  None
4648  (alt B-board revision - Japan)                  89625B-1  CA22B
47Street Fighter II (910214)                  1991  89622B-3  STF29            IOB1  90632C-1   CPS-B-17  DL-0411-10012  C632
49Street Fighter II (910214)                  1991  90629B-2  STF29            IOB1  90632C-1   CPS-B-17  DL-0411-10012  C632
4850Street Fighter II (US 910206)                                                                 CPS-B-17  DL-0411-10012
49Street Fighter II (US 910228)                                                      ?          CPS-B-18  ?
51Street Fighter II (US 910228)                                                                CPS-B-18  DL-0411-10013  C632B
5052Street Fighter II (Japan 910306)                                                              CPS-B-12  DL-0411-10007
5153Street Fighter II (US 910318)                                                                 CPS-B-05  DL-0411-10006
5254Street Fighter II (US 910411)                                                                 CPS-B-15  DL-0411-10010
r2454r2455
5658Street Fighter II (Japan 911210)                                                              CPS-B-13  DL-0411-10008
5759Three Wonders*                              1991  89624B-3  RT24B            IOB1  90630C-4   CPS-B-21  DL-0921-10014        IOC1
5860  (alt B-board revision - Japan)                  89625B-1  RT22B            IOB1
61  (alt B-board revision)                          91634B-2  ?                ?
5962King of Dragons*                            1991  90629B-3  KD29B            IOB1  90631C-5   CPS-B-21  DL-0921-10014  C632  IOC1
6063Captain Commando*                           1991  91635B-2  CC63B     CCPRG  IOB1  90631C-5   CPS-B-21  DL-0921-10014  C632  IOC1
6164Knights of the Round*                       1991  91635B-2  KR63B     BPRG1  IOB1  90631C-5   CPS-B-21  DL-0921-10014  C632  IOC1
r2454r2455
8790
8891
8992
90OUTPUT PORTS
93CPS-A Registers
94---------------
91950x00-0x01     OBJ RAM base (/256)
92960x02-0x03     Scroll1 (8x8) RAM base (/256)
93970x04-0x05     Scroll2 (16x16) RAM base (/256)
r2454r2455
125129              Mega Twins (underwater, cave)
126130              Carrier Air Wing (hazy background at beginning of mission 8, put 07 at ff8501 to jump there)
127131              Magic Sword (fire on floor 3; screen distort after continue)
128              Varth (title screen)
132              Varth (title screen, end of stage 4)
129133              Captain Commando (end game sequence)
130134
131135              Tests done on msword at the beginning of gameplay (many thanks to Corrado Tomaselli for these):
r2454r2455
141145              TODO:
142146              the scroll2/scroll3 disable bits are supported by the emulation,
143147              while the scroll1 weird effect is not (it doesn't seem to make a
144              difference on any game).
148              difference in any game).
145149
146150
147Some registers move from game to game.. following example strider
151CPS-B Registers
152---------------
153Unlike CPS-A registers, which are at fixed addresses, CPS-B registers move from game to game.
154Following example strider
155
1481560x66-0x67   Layer control register
149157            bits 14-15 seem to be unused
150158                ghouls sets bits 15 in service mode when you press button 2 in
r2454r2455
197205            bits 0-3 have been verified on a msword pcb, while bits 4-5 are only
198206            supposed.
199207
200Fixed registers
2010x80-0x81     Sound command
2020x88-0x89     Sound fade
203208
204
205209A special note has to be made about tile/sprite codes. Even if all graphics are
206210stored together in the same ROMs, the hardware knows which part of the ROM space
207211is 8x8 tiles, 16x16 tiles, 16x16 spites, 32x32 tiles, and all games tested only
r2454r2455
269273  IRQ4 is some sort of scanline interrupt used for that purpose.
270274
271275* Its unknown what CPS2_OBJ_BASE register (0x400000) does but it is not a object base
272  register. All games use 0x7000 even if 0x7080 is used at this register (checked on
273  real HW). Maybe it sets the object bank used when cps2_objram_bank is set.
276  register. The base is 0x7000 for all games even if 0x7080 is written to this register
277  (checked on real HW). Maybe it sets the object bank used when cps2_objram_bank is set.
274278
275279* Sprites are currently lagged by one frame to keep sync with backgrounds. This causes
276  sprites to stay on screen one frame longer (visable in VSAV attract mode).
280  sprites to stay on screen one frame longer (visible in VSAV attract mode).
277281
278282Marvel Vs. Capcom
279* Sometimes currupt gfx are displayed on the 32x32 layer as the screen flashes at the
283* Sometimes corrupt gfx are displayed on the 32x32 layer as the screen flashes at the
280284  start of super combo moves. The problem seems to be due to tiles being fetched before
281285  the first 32x32 tile offset and results in data coming from 16x16 or 8x8 tiles instead.
282286
283287CPS1:
284288SF2
285289* Missing chain in the foreground in Ken's level, and sign in Chun Li's level.
286  Those graphics are in the backmost layer.
290  Those graphics are in the backmost layer. Probably they are leftover from game
291  development and aren't supposed to be visible.
287292
288King of Dragons (World).
289* Distortion effect missing on character description screen during attract
290mode. The game rapidly toggles on and off the layer enable bit.
291I think this IS the correct behaviour. The Japanese version does the
292distortion as expected.
293
2942933wonders
295294* writes to output ports 42, 44, 46.
296295
r2454r2455
302301==============
303302
304303There are often some redundant high bits in the scroll layer's attributes.
305I think that these are spare bits that the game uses for to store additional
304I think that these are spare bits that the game uses to store additional
306305information, not used by the hardware.
307306The games seem to use them to mark platforms, kill zones and no-go areas.
308307
r2454r2455
358357   int mult_result_lo;
359358   int mult_result_hi;
360359
360   /* unknown registers which might be related to the multiply protection */
361   int unknown1;
362   int unknown2;
363   int unknown3;
364
361365   int layer_control;
362366   int priority[4];
363   int palette_control;  /* Control register? seems to be always 0x3f */
367   int palette_control;
364368
365369   /* ideally, the layer enable masks should consist of only one bit, */
366370   /* but in many cases it is unknown which bit is which. */
367371   int layer_enable_mask[5];
368372
373   /* these depend on the B-board model and PAL */
369374   int bank_sizes[4];
370375   const struct gfx_range *bank_mapper;
371376
372   int bank_scroll1;
373   int bank_scroll2;
374   int bank_scroll3;
377   /* some C-boards have additional I/O for extra buttons/extra players */
378   int in2_addr;
379   int in3_addr;
380   int out2_addr;
375381
376   /* Some characters aren't visible */
377   const int start_scroll2;
378   const int end_scroll2;
379   const int start_scroll3;
380   const int end_scroll3;
381
382382   int bootleg_kludge;
383383};
384384
385385static const struct CPS1config *cps1_game_config;
386386
387387
388/*                 CPSB ID    multiply protection  ctrl     priority masks   palctrl    layer enable masks  */
389#define CPS_B_01 0x00,0x0000, 0,0,0,0, /* n/a */   0x66,{0x68,0x6a,0x6c,0x6e},0x70, {0x02,0x04,0x08,0x30,0x30}
390#define CPS_B_02 0x60,0x0002, 0,0,0,0, /* n/a */   0x6c,{0x6a,0x68,0x66,0x64},0x62, {0x02,0x04,0x08,0x00,0x00}
391#define CPS_B_03 0x00,0x0000, 0,0,0,0, /* n/a */   0x70,{0x6e,0x6c,0x6a,0x68},0x66, {0x20,0x10,0x08,0x00,0x00}
392#define CPS_B_04 0x60,0x0004, 0,0,0,0, /* n/a */   0x6e,{0x66,0x70,0x68,0x72},0x6a, {0x02,0x0c,0x0c,0x00,0x00}
393#define CPS_B_05 0x60,0x0005, 0,0,0,0, /* n/a */   0x68,{0x6a,0x6c,0x6e,0x70},0x72, {0x02,0x08,0x20,0x14,0x14}
394#define CPS_B_11 0x72,0x0401, 0,0,0,0, /* n/a */   0x66,{0x68,0x6a,0x6c,0x6e},0x70, {0x08,0x10,0x20,0x00,0x00}
395#define CPS_B_12 0x60,0x0402, 0,0,0,0, /* n/a */   0x6c,{0x6a,0x68,0x66,0x64},0x62, {0x02,0x04,0x08,0x00,0x00}
396#define CPS_B_13 0x6e,0x0403, 0,0,0,0, /* n/a */   0x62,{0x64,0x66,0x68,0x6a},0x6c, {0x20,0x02,0x04,0x00,0x00}
397#define CPS_B_14 0x5e,0x0404, 0,0,0,0, /* n/a */   0x52,{0x54,0x56,0x58,0x5a},0x5c, {0x08,0x20,0x10,0x00,0x00}
398#define CPS_B_15 0x4e,0x0405, 0,0,0,0, /* n/a */   0x42,{0x44,0x46,0x48,0x4a},0x4c, {0x04,0x02,0x20,0x00,0x00}
399#define CPS_B_16 0x40,0x0406, 0,0,0,0, /* n/a */   0x4c,{0x4a,0x48,0x46,0x44},0x42, {0x10,0x0a,0x0a,0x00,0x00}
400#define CPS_B_17 0x48,0x0407, 0,0,0,0, /* n/a */   0x54,{0x52,0x50,0x4e,0x4c},0x4a, {0x08,0x10,0x02,0x00,0x00}
401#define CPS_B_18 0xd0,0x0408, 0,0,0,0, /* n/a */   0xdc,{0xda,0xd8,0xd6,0xd4},0xd2, {0x10,0x08,0x02,0x00,0x00}
402#define NOBATTRY 0x00,0x0000, 0x40,0x42,0x44,0x46, 0x66,{0x68,0x6a,0x6c,0x6e},0x70, {0x02,0x04,0x08,0x30,0x30}   // pang3 sets layer enable to 0x26 on startup
403#define BATTRY_1 0x72,0x0800, 0x4e,0x4c,0x4a,0x48, 0x68,{0x66,0x64,0x62,0x60},0x70, {0x20,0x04,0x08,0x12,0x12}
404#define BATTRY_2 0x00,0x0000, 0x5e,0x5c,0x5a,0x58, 0x60,{0x6e,0x6c,0x6a,0x68},0x70, {0x30,0x08,0x30,0x00,0x00}
405#define BATTRY_3 0x00,0x0000, 0x46,0x44,0x42,0x40, 0x60,{0x6e,0x6c,0x6a,0x68},0x70, {0x20,0x12,0x12,0x00,0x00}
406#define BATTRY_4 0x00,0x0000, 0x46,0x44,0x42,0x40, 0x68,{0x66,0x64,0x62,0x60},0x70, {0x20,0x10,0x02,0x00,0x00}
407#define BATTRY_5 0x00,0x0000, 0x4e,0x4c,0x4a,0x48, 0x60,{0x6e,0x6c,0x6a,0x68},0x70, {0x20,0x06,0x06,0x00,0x00}
408#define BATTRY_6 0x00,0x0000, 0x00,0x00,0x00,0x00, 0x60,{0x6e,0x6c,0x6a,0x68},0x70, {0x20,0x14,0x14,0x00,0x00}
409#define BATTRY_7 0x00,0x0000, 0x00,0x00,0x00,0x00, 0x6c,{0x00,0x00,0x00,0x00},0x52, {0x14,0x02,0x14,0x00,0x00}
410#define QSOUND_1 0x00,0x0000, 0x00,0x00,0x00,0x00, 0x62,{0x64,0x66,0x68,0x6a},0x6c, {0x10,0x08,0x04,0x00,0x00}
411#define QSOUND_2 0x00,0x0000, 0x00,0x00,0x00,0x00, 0x4a,{0x4c,0x4e,0x40,0x42},0x44, {0x16,0x16,0x16,0x00,0x00}
412#define QSOUND_3 0x4e,0x0c00, 0x00,0x00,0x00,0x00, 0x52,{0x54,0x56,0x48,0x4a},0x4c, {0x04,0x02,0x20,0x00,0x00}
413#define QSOUND_4 0x6e,0x0c01, 0x00,0x00,0x00,0x00, 0x56,{0x40,0x42,0x68,0x6a},0x6c, {0x04,0x08,0x10,0x00,0x00}
414#define QSOUND_5 0x5e,0x0c02, 0x00,0x00,0x00,0x00, 0x6a,{0x6c,0x6e,0x70,0x72},0x5c, {0x04,0x08,0x10,0x00,0x00}
415#define HACK_B_1 0x00,0x0000, 0x00,0x00,0x00,0x00, 0x54,{0x52,0x50,0x4e,0x4c},0x5c, {0xff,0xff,0xff,0x00,0x00}
388#define __not_applicable__   -1,-1,-1,-1,-1,-1,-1
416389
390/*                     CPSB ID    multiply protection      unknown      ctrl     priority masks   palctrl    layer enable masks  */
391#define CPS_B_01      -1, 0x0000,          __not_applicable__,          0x26,{0x28,0x2a,0x2c,0x2e},0x30, {0x02,0x04,0x08,0x30,0x30}
392#define CPS_B_02     0x20,0x0002,          __not_applicable__,          0x2c,{0x2a,0x28,0x26,0x24},0x22, {0x02,0x04,0x08,0x00,0x00}
393#define CPS_B_03      -1, 0x0000,          __not_applicable__,          0x30,{0x2e,0x2c,0x2a,0x28},0x26, {0x20,0x10,0x08,0x00,0x00}
394#define CPS_B_04     0x20,0x0004,          __not_applicable__,          0x2e,{0x26,0x30,0x28,0x32},0x2a, {0x02,0x04,0x08,0x00,0x00}
395#define CPS_B_05     0x20,0x0005,          __not_applicable__,          0x28,{0x2a,0x2c,0x2e,0x30},0x32, {0x02,0x08,0x20,0x14,0x14}
396#define CPS_B_11     0x32,0x0401,          __not_applicable__,          0x26,{0x28,0x2a,0x2c,0x2e},0x30, {0x08,0x10,0x20,0x00,0x00}
397#define CPS_B_12     0x20,0x0402,          __not_applicable__,          0x2c,{0x2a,0x28,0x26,0x24},0x22, {0x02,0x04,0x08,0x00,0x00}
398#define CPS_B_13     0x2e,0x0403,          __not_applicable__,          0x22,{0x24,0x26,0x28,0x2a},0x2c, {0x20,0x02,0x04,0x00,0x00}
399#define CPS_B_14     0x1e,0x0404,          __not_applicable__,          0x12,{0x14,0x16,0x18,0x1a},0x1c, {0x08,0x20,0x10,0x00,0x00}
400#define CPS_B_15     0x0e,0x0405,          __not_applicable__,          0x02,{0x04,0x06,0x08,0x0a},0x0c, {0x04,0x02,0x20,0x00,0x00}
401#define CPS_B_16     0x00,0x0406,          __not_applicable__,          0x0c,{0x0a,0x08,0x06,0x04},0x02, {0x10,0x0a,0x0a,0x00,0x00}
402#define CPS_B_17     0x08,0x0407,          __not_applicable__,          0x14,{0x12,0x10,0x0e,0x0c},0x0a, {0x08,0x10,0x02,0x00,0x00}
403#define CPS_B_18     0x10,0x0408,          __not_applicable__,          0x1c,{0x1a,0x18,0x16,0x14},0x12, {0x10,0x08,0x02,0x00,0x00}
404#define CPS_B_21_DEF 0x32,  -1,   0x00,0x02,0x04,0x06, 0x08, -1,  -1,   0x26,{0x28,0x2a,0x2c,0x2e},0x30, {0x02,0x04,0x08,0x30,0x30}   // pang3 sets layer enable to 0x26 on startup
405#define CPS_B_21_BT1 0x32,0x0800, 0x0e,0x0c,0x0a,0x08, 0x06,0x04,0x02,  0x28,{0x26,0x24,0x22,0x20},0x30, {0x20,0x04,0x08,0x12,0x12}
406#define CPS_B_21_BT2  -1,   -1,   0x1e,0x1c,0x1a,0x18,  -1, 0x0c,0x0a,  0x20,{0x2e,0x2c,0x2a,0x28},0x30, {0x30,0x08,0x30,0x00,0x00}
407#define CPS_B_21_BT3  -1,   -1,   0x06,0x04,0x02,0x00, 0x0e,0x0c,0x0a,  0x20,{0x2e,0x2c,0x2a,0x28},0x30, {0x20,0x12,0x12,0x00,0x00}
408#define CPS_B_21_BT4  -1,   -1,   0x06,0x04,0x02,0x00, 0x1e,0x1c,0x0a,  0x28,{0x26,0x24,0x22,0x20},0x30, {0x20,0x10,0x02,0x00,0x00}
409#define CPS_B_21_BT5 0x32,  -1,   0x0e,0x0c,0x0a,0x08, 0x1e,0x1c,0x1a,  0x20,{0x2e,0x2c,0x2a,0x28},0x30, {0x20,0x04,0x02,0x00,0x00}
410#define CPS_B_21_BT6  -1,   -1,    -1,  -1,  -1,  -1,   -1,  -1,  -1,   0x20,{0x2e,0x2c,0x2a,0x28},0x30, {0x20,0x14,0x14,0x00,0x00}
411#define CPS_B_21_BT7  -1,   -1,    -1,  -1,  -1,  -1,   -1,  -1,  -1,   0x2c,{ -1,  -1,  -1,  -1 },0x12, {0x14,0x02,0x14,0x00,0x00}
412#define CPS_B_21_QS1  -1,   -1,    -1,  -1,  -1,  -1,   -1,  -1,  -1,   0x22,{0x24,0x26,0x28,0x2a},0x2c, {0x10,0x08,0x04,0x00,0x00}
413#define CPS_B_21_QS2  -1,   -1,    -1,  -1,  -1,  -1,   -1, 0x2e,0x20,  0x0a,{0x0c,0x0e,0x00,0x02},0x04, {0x16,0x16,0x16,0x00,0x00}
414#define CPS_B_21_QS3 0x0e,0x0c00,  -1,  -1,  -1,  -1,  0x2c, -1,  -1,   0x12,{0x14,0x16,0x08,0x0a},0x0c, {0x04,0x02,0x20,0x00,0x00}
415#define CPS_B_21_QS4 0x2e,0x0c01,  -1,  -1,  -1,  -1,  0x1c,0x1e,0x08,  0x16,{0x00,0x02,0x28,0x2a},0x2c, {0x04,0x08,0x10,0x00,0x00}
416#define CPS_B_21_QS5 0x1e,0x0c02,  -1,  -1,  -1,  -1,  0x0c, -1,  -1,   0x2a,{0x2c,0x2e,0x30,0x32},0x1c, {0x04,0x08,0x10,0x00,0x00}
417#define HACK_B_1      -1,   -1,    -1,  -1,  -1,  -1,   -1,  -1,  -1,   0x14,{0x12,0x10,0x0e,0x0c},0x1c, {0xff,0xff,0xff,0x00,0x00}
417418
419/*
420CPS_B_21_DEF is CPS-B-21 at default settings (no battery)
421CPS_B_21_BTx are various battery configurations
422CPS_B_21_QSx are various battery configurations in Q-Sound games
423*/
418424
425
419426#define mapper_LWCHR   { 0x8000, 0x8000, 0, 0 }, mapper_LWCHR_table
420427static const struct gfx_range mapper_LWCHR_table[] =
421428{
r2454r2455
482489};
483490
484491
485#define mapper_TK22B   { 0x8000, 0x8000, 0, 0 }, mapper_TK22B_table
486static const struct gfx_range mapper_TK22B_table[] =   // unknown PAL
492#define mapper_TK22B   { 0x4000, 0x4000, 0x4000, 0x4000 }, mapper_TK22B_table
493static const struct gfx_range mapper_TK22B_table[] =
487494{
495   // verified from PAL dump:
496   // bank 0 = pin 19 (ROMs 1,5, 9,13,17,24,32,38)
497   // bank 1 = pin 16 (ROMs 2,6,10,14,18,25,33,39)
498   // bank 2 = pin 14 (ROMs 3,7,11,15,19,21,26,28)
499   // bank 3 = pin 12 (ROMS 4,8,12,16,20,22,27,29)
500
488501   /* type            start  end      bank */
489   { GFXTYPE_SPRITES, 0x0000, 0x5fff, 0 },
490   { GFXTYPE_SCROLL1, 0x6000, 0x7fff, 0 },
502   { GFXTYPE_SPRITES, 0x0000, 0x3fff, 0 },
491503
492   { GFXTYPE_SCROLL3, 0x0000, 0x3fff, 1 },   // 8000-bfff physical
493   { GFXTYPE_SCROLL2, 0x4000, 0x7fff, 1 },   // c000-ffff physical
504   { GFXTYPE_SPRITES, 0x4000, 0x5fff, 1 },
505   { GFXTYPE_SCROLL1, 0x6000, 0x7fff, 1 },
506
507   { GFXTYPE_SCROLL3, 0x0000, 0x3fff, 2 },
508
509   { GFXTYPE_SCROLL2, 0x4000, 0x7fff, 3 },
494510   { 0 }
495511};
496512
r2454r2455
703719};
704720
705721
706#define mapper_STF29   { 0x10000, 0x8000, 0, 0 }, mapper_STF29_table
722#define mapper_STF29   { 0x8000, 0x8000, 0x8000, 0 }, mapper_STF29_table
707723static const struct gfx_range mapper_STF29_table[] =
708724{
725   // verified from PAL dump:
726   // bank 0 = pin 19 (ROMs 5,6,7,8)
727   // bank 1 = pin 14 (ROMs 14,15,16,17)
728   // bank 2 = pin 12 (ROMS 24,25,26,27)
729
709730   /* type            start    end      bank */
710   { GFXTYPE_SPRITES, 0x00000, 0x0ffff, 0 },
731   { GFXTYPE_SPRITES, 0x00000, 0x07fff, 0 },
711732
712   { GFXTYPE_SPRITES, 0x10000, 0x11fff, 1 },
713   { GFXTYPE_SCROLL3, 0x02000, 0x03fff, 1 },   // 12000-13fff physical
714   { GFXTYPE_SCROLL1, 0x04000, 0x04fff, 1 },   // 14000-14fff physical
715   { GFXTYPE_SCROLL2, 0x05000, 0x07fff, 1 },   // 15000-17fff physical
733   { GFXTYPE_SPRITES, 0x08000, 0x0ffff, 1 },
734
735   { GFXTYPE_SPRITES, 0x10000, 0x11fff, 2 },
736   { GFXTYPE_SCROLL3, 0x02000, 0x03fff, 2 },
737   { GFXTYPE_SCROLL1, 0x04000, 0x04fff, 2 },
738   { GFXTYPE_SCROLL2, 0x05000, 0x07fff, 2 },
716739   { 0 }
717740};
718741
719742
743
744// RT24B and RT22B are equivalent, but since we could dump both PALs we are
745// documenting both.
746
747#define mapper_RT24B   { 0x8000, 0x8000, 0, 0 }, mapper_RT24B_table
748static const struct gfx_range mapper_RT24B_table[] =
749{
750   // verified from PAL dump:
751   // bank 0 = pin 16 (ROMs 1,3,5,7)
752   // bank 1 = pin 19 (ROMs 2,4,6,8)
753   // pin 12 & pin 14 are never enabled
754
755   /* type            start   end     bank */
756   { GFXTYPE_SPRITES, 0x0000, 0x53ff, 0 },
757   { GFXTYPE_SCROLL1, 0x5400, 0x6fff, 0 },
758   { GFXTYPE_SCROLL3, 0x7000, 0x7fff, 0 },
759
760   { GFXTYPE_SCROLL3, 0x0000, 0x3fff, 1 },
761   { GFXTYPE_SCROLL2, 0x2800, 0x7fff, 1 },
762   { GFXTYPE_SPRITES, 0x5400, 0x7fff, 1 },
763   { 0 }
764};
765
720766#define mapper_RT22B   { 0x4000, 0x4000, 0x4000, 0x4000 }, mapper_RT22B_table
721767static const struct gfx_range mapper_RT22B_table[] =
722768{
r2454r2455
784830};
785831
786832
787#define mapper_S9263B   { 0x10000, 0x8000, 0, 0 }, mapper_S9263B_table
833#define mapper_S9263B   { 0x8000, 0x8000, 0x8000, 0 }, mapper_S9263B_table
788834static const struct gfx_range mapper_S9263B_table[] =
789835{
790836   /* type            start    end      bank */
791   { GFXTYPE_SPRITES, 0x00000, 0x0ffff, 0 },
837   { GFXTYPE_SPRITES, 0x00000, 0x07fff, 0 },
792838
793   { GFXTYPE_SPRITES, 0x10000, 0x11fff, 1 },
794   { GFXTYPE_SCROLL3, 0x02000, 0x03fff, 1 },   // 12000-13fff physical
795   { GFXTYPE_SCROLL1, 0x04000, 0x04fff, 1 },   // 14000-14fff physical
796   { GFXTYPE_SCROLL2, 0x05000, 0x07fff, 1 },   // 15000-17fff physical
839   { GFXTYPE_SPRITES, 0x08000, 0x0ffff, 1 },
840
841   { GFXTYPE_SPRITES, 0x10000, 0x11fff, 2 },
842   { GFXTYPE_SCROLL3, 0x02000, 0x03fff, 2 },   // 12000-13fff physical
843   { GFXTYPE_SCROLL1, 0x04000, 0x04fff, 2 },   // 14000-14fff physical
844   { GFXTYPE_SCROLL2, 0x05000, 0x07fff, 2 },   // 15000-17fff physical
797845   { 0 }
798846};
799847
r2454r2455
859907};
860908
861909
862#define mapper_MB63B   { 0x10000, 0x8000, 0, 0 }, mapper_MB63B_table
910#define mapper_MB63B   { 0x8000, 0x8000, 0x8000, 0 }, mapper_MB63B_table
863911static const struct gfx_range mapper_MB63B_table[] =
864912{
865913   /* type                              start    end      bank */
866914   { GFXTYPE_SCROLL1,                   0x00000, 0x00fff, 0 },
867   { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x01000, 0x0ffff, 0 },
915   { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x01000, 0x07fff, 0 },
868916
869   { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x10000, 0x167ff, 1 },
870   { GFXTYPE_SCROLL3,                   0x16800, 0x17fff, 1 },
917   { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x08000, 0x0ffff, 1 },
918
919   { GFXTYPE_SPRITES | GFXTYPE_SCROLL2, 0x10000, 0x167ff, 2 },
920   { GFXTYPE_SCROLL3,                   0x16800, 0x17fff, 2 },
871921   { 0 }
872922};
873923
r2454r2455
9711021
9721022static const struct CPS1config cps1_config_table[]=
9731023{
974   /* name       CPSB     gfx mapper    kludge */
975   {"forgottn", CPS_B_01, mapper_LWCHR },
976   {"lostwrld", CPS_B_01, mapper_LWCHR },
977   {"ghouls",   CPS_B_01, mapper_DM620 },
978   {"ghoulsu",  CPS_B_01, mapper_DM620 },
979   {"daimakai", CPS_B_01, mapper_DM620 },
980   {"strider",  CPS_B_01, mapper_ST22B },
981   {"stridrua", CPS_B_01, mapper_ST22B },
982   {"striderj", CPS_B_01, mapper_ST22B },
983   {"stridrja", CPS_B_01, mapper_ST22B },
984   {"dynwar",   CPS_B_02, mapper_TK22B },
985   {"dynwarj",  CPS_B_02, mapper_TK22B },
986   {"willow",   CPS_B_03, mapper_WL24B },
987   {"willowj",  CPS_B_03, mapper_WL24B },
988   {"willowje", CPS_B_03, mapper_WL24B },
989   {"ffight",   CPS_B_04, mapper_S224B },
990   {"ffightu",  CPS_B_04, mapper_S224B },
991   {"ffightua", CPS_B_01, mapper_S224B },
992   {"ffightub", CPS_B_05, mapper_S224B },
993   {"ffightj",  CPS_B_04, mapper_S224B },
994   {"ffightj1", CPS_B_02, mapper_S224B },
995   {"1941",     CPS_B_05, mapper_YI24B },
996   {"1941j",    CPS_B_05, mapper_YI24B },
997   {"unsquad",  CPS_B_11, mapper_AR24B },   /* CPSB ID not checked, but it's the same as sf2eg */
998   {"area88",   CPS_B_11, mapper_AR24B },   /* CPSB ID not checked, but it's the same as sf2eg */
999   {"mercs",    CPS_B_12, mapper_0224B },   /* (uses port 74) */
1000   {"mercsu",   CPS_B_12, mapper_0224B },   /* (uses port 74) */
1001   {"mercsua",  CPS_B_12, mapper_0224B },   /* (uses port 74) */
1002   {"mercsj",   CPS_B_12, mapper_0224B },   /* (uses port 74) */
1003   {"msword",   CPS_B_13, mapper_MS24B },   /* CPSB ID not checked, but it's the same as sf2j */
1004   {"mswordr1", CPS_B_13, mapper_MS24B },   /* CPSB ID not checked, but it's the same as sf2j */
1005   {"mswordu",  CPS_B_13, mapper_MS24B },   /* CPSB ID not checked, but it's the same as sf2j */
1006   {"mswordj",  CPS_B_13, mapper_MS24B },   /* CPSB ID not checked, but it's the same as sf2j */
1007   {"mtwins",   CPS_B_14, mapper_CK24B },
1008   {"chikij",   CPS_B_14, mapper_CK24B },
1009   {"nemo",     CPS_B_15, mapper_NM24B },
1010   {"nemoj",    CPS_B_15, mapper_NM24B },
1011   {"cawing",   CPS_B_16, mapper_CA24B },
1012   {"cawingr1", CPS_B_16, mapper_CA24B },
1013   {"cawingu",  CPS_B_16, mapper_CA24B },
1014   {"cawingj",  CPS_B_16, mapper_CA24B },
1015   {"sf2",      CPS_B_11, mapper_STF29 },
1016   {"sf2eb",    CPS_B_17, mapper_STF29 },
1017   {"sf2ua",    CPS_B_17, mapper_STF29 },
1018   {"sf2ub",    CPS_B_17, mapper_STF29 },
1019   {"sf2ud",    CPS_B_05, mapper_STF29 },
1020   {"sf2ue",    CPS_B_18, mapper_STF29 },
1021   {"sf2uf",    CPS_B_15, mapper_STF29 },
1022   {"sf2ui",    CPS_B_14, mapper_STF29 },
1023   {"sf2uk",    CPS_B_17, mapper_STF29 }, // check CPS_B
1024   {"sf2j",     CPS_B_13, mapper_STF29 },
1025   {"sf2ja",    CPS_B_17, mapper_STF29 },
1026   {"sf2jc",    CPS_B_12, mapper_STF29 },
1024   /* name       CPSB         gfx mapper   in2  in3  out2   kludge */
1025   {"forgottn", CPS_B_01,     mapper_LWCHR },
1026   {"lostwrld", CPS_B_01,     mapper_LWCHR },
1027   {"ghouls",   CPS_B_01,     mapper_DM620 },
1028   {"ghoulsu",  CPS_B_01,     mapper_DM620 },
1029   {"daimakai", CPS_B_01,     mapper_DM620 },
1030   {"strider",  CPS_B_01,     mapper_ST22B },
1031   {"stridrua", CPS_B_01,     mapper_ST22B },
1032   {"striderj", CPS_B_01,     mapper_ST22B },
1033   {"stridrja", CPS_B_01,     mapper_ST22B },
1034   {"dynwar",   CPS_B_02,     mapper_TK22B },
1035   {"dynwarj",  CPS_B_02,     mapper_TK22B },
1036   {"willow",   CPS_B_03,     mapper_WL24B },
1037   {"willowj",  CPS_B_03,     mapper_WL24B },
1038   {"willowje", CPS_B_03,     mapper_WL24B },
1039   {"ffight",   CPS_B_04,     mapper_S224B },
1040   {"ffightu",  CPS_B_04,     mapper_S224B },
1041   {"ffightua", CPS_B_01,     mapper_S224B },
1042   {"ffightub", CPS_B_05,     mapper_S224B },
1043   {"ffightj",  CPS_B_04,     mapper_S224B },
1044   {"ffightj1", CPS_B_02,     mapper_S224B },
1045   {"1941",     CPS_B_05,     mapper_YI24B },
1046   {"1941j",    CPS_B_05,     mapper_YI24B },
1047   {"unsquad",  CPS_B_11,     mapper_AR24B },   /* CPSB ID not checked, but it's the same as sf2eg */
1048   {"area88",   CPS_B_11,     mapper_AR24B },   /* CPSB ID not checked, but it's the same as sf2eg */
1049   {"mercs",    CPS_B_12,     mapper_0224B,  0x36, 0, 0x34 },
1050   {"mercsu",   CPS_B_12,     mapper_0224B,  0x36, 0, 0x34 },
1051   {"mercsua",  CPS_B_12,     mapper_0224B,  0x36, 0, 0x34 },
1052   {"mercsj",   CPS_B_12,     mapper_0224B,  0x36, 0, 0x34 },
1053   {"msword",   CPS_B_13,     mapper_MS24B },   /* CPSB ID not checked, but it's the same as sf2j */
1054   {"mswordr1", CPS_B_13,     mapper_MS24B },   /* CPSB ID not checked, but it's the same as sf2j */
1055   {"mswordu",  CPS_B_13,     mapper_MS24B },   /* CPSB ID not checked, but it's the same as sf2j */
1056   {"mswordj",  CPS_B_13,     mapper_MS24B },   /* CPSB ID not checked, but it's the same as sf2j */
1057   {"mtwins",   CPS_B_14,     mapper_CK24B },
1058   {"chikij",   CPS_B_14,     mapper_CK24B },
1059   {"nemo",     CPS_B_15,     mapper_NM24B },
1060   {"nemoj",    CPS_B_15,     mapper_NM24B },
1061   {"cawing",   CPS_B_16,     mapper_CA24B },
1062   {"cawingr1", CPS_B_16,     mapper_CA24B },
1063   {"cawingu",  CPS_B_16,     mapper_CA24B },
1064   {"cawingj",  CPS_B_16,     mapper_CA24B },
1065   {"sf2",      CPS_B_11,     mapper_STF29,  0x36 },
1066   {"sf2eb",    CPS_B_17,     mapper_STF29,  0x36 },
1067   {"sf2ua",    CPS_B_17,     mapper_STF29,  0x36 },
1068   {"sf2ub",    CPS_B_17,     mapper_STF29,  0x36 },
1069   {"sf2ud",    CPS_B_05,     mapper_STF29,  0x36 },
1070   {"sf2ue",    CPS_B_18,     mapper_STF29,  0x3c },
1071   {"sf2uf",    CPS_B_15,     mapper_STF29,  0x36 },
1072   {"sf2ui",    CPS_B_14,     mapper_STF29,  0x36 },
1073   {"sf2uk",    CPS_B_17,     mapper_STF29,  0x36 }, // check CPS_B
1074   {"sf2j",     CPS_B_13,     mapper_STF29,  0x36 },
1075   {"sf2ja",    CPS_B_17,     mapper_STF29,  0x36 },
1076   {"sf2jc",    CPS_B_12,     mapper_STF29,  0x36 },
10271077   /* from here onwards the CPS-B board has suicide battery and multiply protection */
1028   {"3wonders", BATTRY_1, mapper_RT22B },
1029   {"3wonderu", BATTRY_1, mapper_RT22B },
1030   {"wonder3",  BATTRY_1, mapper_RT22B },
1031   {"kod",      BATTRY_2, mapper_KD29B },
1032   {"kodu",     BATTRY_2, mapper_KD29B },
1033   {"kodj",     BATTRY_2, mapper_KD29B },
1034   {"kodb",     BATTRY_2, mapper_KD29B },   /* bootleg, doesn't use multiply protection */
1035   {"captcomm", BATTRY_3, mapper_CC63B },
1036   {"captcomu", BATTRY_3, mapper_CC63B },
1037   {"captcomj", BATTRY_3, mapper_CC63B },
1038   {"knights",  BATTRY_4, mapper_KR63B },
1039   {"knightsu", BATTRY_4, mapper_KR63B },
1040   {"knightsj", BATTRY_4, mapper_KR63B },
1041   {"sf2ce",    NOBATTRY, mapper_S9263B },
1042   {"sf2ceua",  NOBATTRY, mapper_S9263B },
1043   {"sf2ceub",  NOBATTRY, mapper_S9263B },
1044   {"sf2ceuc",  NOBATTRY, mapper_S9263B },
1045   {"sf2cej",   NOBATTRY, mapper_S9263B },
1046   {"sf2rb",    NOBATTRY, mapper_S9263B },
1047   {"sf2rb2",   NOBATTRY, mapper_S9263B },
1048   {"sf2red",   NOBATTRY, mapper_S9263B },
1049   {"sf2v004",  NOBATTRY, mapper_S9263B },
1050   {"sf2accp2", NOBATTRY, mapper_S9263B },
1051   {"sf2m1",    NOBATTRY, mapper_S9263B },
1052   {"sf2m2",    NOBATTRY, mapper_S9263B },
1053   {"sf2m3",    NOBATTRY, mapper_S9263B },
1054   {"sf2m4",    HACK_B_1, mapper_S9263B, 1 },
1055   {"sf2m5",    NOBATTRY, mapper_S9263B, 1 },
1056   {"sf2m6",    NOBATTRY, mapper_S9263B, 1 },
1057   {"sf2m7",    NOBATTRY, mapper_S9263B, 1 },
1058   {"sf2yyc",   NOBATTRY, mapper_S9263B, 1 },
1059   {"sf2koryu", NOBATTRY, mapper_S9263B, 1 },
1060   {"varth",    CPS_B_04, mapper_VA24B },   /* CPSB test has been patched out (60=0008) */
1061   {"varthr1",  CPS_B_04, mapper_VA24B },   /* CPSB test has been patched out (60=0008) */
1062   {"varthu",   CPS_B_04, mapper_VA24B },   /* CPSB test has been patched out (60=0008) */
1063   {"varthj",   BATTRY_5, mapper_VA24B },   /* CPSB test has been patched out (72=0001) */
1064   {"cworld2j", BATTRY_6, mapper_Q522B },   /* The 0x76 priority values are incorrect values */
1065   {"wof",      NOBATTRY, mapper_TK263B },   /* bootleg? */
1066   {"wofa",     NOBATTRY, mapper_TK263B },   /* bootleg? */
1067   {"wofu",     QSOUND_1, mapper_TK263B },
1068   {"wofj",     QSOUND_1, mapper_TK263B },
1069   {"dino",     QSOUND_2, mapper_CD63B },   /* layer enable never used */
1070   {"dinou",    QSOUND_2, mapper_CD63B },   /* layer enable never used */
1071   {"dinoj",    QSOUND_2, mapper_CD63B },   /* layer enable never used */
1072   {"punisher", QSOUND_3, mapper_PS63B },
1073   {"punishru", QSOUND_3, mapper_PS63B },
1074   {"punishrj", QSOUND_3, mapper_PS63B },
1075   {"slammast", QSOUND_4, mapper_MB63B },
1076   {"slammasu", QSOUND_4, mapper_MB63B },
1077   {"mbomberj", QSOUND_4, mapper_MB63B },
1078   {"mbombrd",  QSOUND_5, mapper_MB63B },
1079   {"mbombrdj", QSOUND_5, mapper_MB63B },
1080   {"sf2hf",    NOBATTRY, mapper_S9263B },
1081   {"sf2t",     NOBATTRY, mapper_S9263B },
1082   {"sf2tj",    NOBATTRY, mapper_S9263B },
1083   {"qad",      BATTRY_7, mapper_QD22B },   /* TODO: layer enable */
1084   {"qadj",     NOBATTRY, mapper_qadj },
1085   {"qtono2",   NOBATTRY, mapper_qtono2 },
1086   {"megaman",  NOBATTRY, mapper_RCM63B },
1087   {"rockmanj", NOBATTRY, mapper_RCM63B },
1088   {"pnickj",   NOBATTRY, mapper_pnickj },
1089   {"pang3",    NOBATTRY, mapper_pang3 },   /* EEPROM port is among the CPS registers (handled by DRIVER_INIT) */
1090   {"pang3j",   NOBATTRY, mapper_pang3 },   /* EEPROM port is among the CPS registers (handled by DRIVER_INIT) */
1078   {"3wonders", CPS_B_21_BT1, mapper_RT24B },
1079   {"3wonderu", CPS_B_21_BT1, mapper_RT24B },
1080   {"wonder3",  CPS_B_21_BT1, mapper_RT22B },   // equivalent to RT24B
1081   {"kod",      CPS_B_21_BT2, mapper_KD29B,  0x36, 0, 0x34 },
1082   {"kodu",     CPS_B_21_BT2, mapper_KD29B,  0x36, 0, 0x34 },
1083   {"kodj",     CPS_B_21_BT2, mapper_KD29B,  0x36, 0, 0x34 },
1084   {"kodb",     CPS_B_21_BT2, mapper_KD29B,  0x36, 0, 0x34 },   /* bootleg, doesn't use multiply protection */
1085   {"captcomm", CPS_B_21_BT3, mapper_CC63B,  0x36, 0x38, 0x34 },
1086   {"captcomu", CPS_B_21_BT3, mapper_CC63B,  0x36, 0x38, 0x34 },
1087   {"captcomj", CPS_B_21_BT3, mapper_CC63B,  0x36, 0x38, 0x34 },
1088   {"knights",  CPS_B_21_BT4, mapper_KR63B,  0x36, 0, 0x34 },
1089   {"knightsu", CPS_B_21_BT4, mapper_KR63B,  0x36, 0, 0x34 },
1090   {"knightsj", CPS_B_21_BT4, mapper_KR63B,  0x36, 0, 0x34 },
1091   {"sf2ce",    CPS_B_21_DEF, mapper_S9263B, 0x36 },
1092   {"sf2ceua",  CPS_B_21_DEF, mapper_S9263B, 0x36 },
1093   {"sf2ceub",  CPS_B_21_DEF, mapper_S9263B, 0x36 },
1094   {"sf2ceuc",  CPS_B_21_DEF, mapper_S9263B, 0x36 },
1095   {"sf2cej",   CPS_B_21_DEF, mapper_S9263B, 0x36 },
1096   {"sf2rb",    CPS_B_21_DEF, mapper_S9263B, 0x36 },
1097   {"sf2rb2",   CPS_B_21_DEF, mapper_S9263B, 0x36 },
1098   {"sf2red",   CPS_B_21_DEF, mapper_S9263B, 0x36 },
1099   {"sf2v004",  CPS_B_21_DEF, mapper_S9263B, 0x36 },
1100   {"sf2accp2", CPS_B_21_DEF, mapper_S9263B, 0x36 },
1101   {"sf2m1",    CPS_B_21_DEF, mapper_S9263B, 0x36 },
1102   {"sf2m2",    CPS_B_21_DEF, mapper_S9263B, 0x36 },
1103   {"sf2m3",    CPS_B_21_DEF, mapper_S9263B, 0x36 },
1104   {"sf2m4",    HACK_B_1,     mapper_S9263B, 0x36, 0, 0, 1 },
1105   {"sf2m5",    CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
1106   {"sf2m6",    CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
1107   {"sf2m7",    CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
1108   {"sf2yyc",   CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
1109   {"sf2koryu", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
1110   {"varth",    CPS_B_04,     mapper_VA24B },   /* CPSB test has been patched out (60=0008) register is also written to, possibly leftover from development */
1111   {"varthr1",  CPS_B_04,     mapper_VA24B },   /* CPSB test has been patched out (60=0008) register is also written to, possibly leftover from development */
1112   {"varthu",   CPS_B_04,     mapper_VA24B },   /* CPSB test has been patched out (60=0008) register is also written to, possibly leftover from development */
1113   {"varthj",   CPS_B_21_BT5, mapper_VA24B },   /* CPSB test has been patched out (72=0001) register is also written to, possibly leftover from development */
1114   {"cworld2j", CPS_B_21_BT6, mapper_Q522B,  0x36, 0, 0x34 },   /* (ports 36, 34 probably leftover input code from another game) */
1115   {"wof",      CPS_B_21_DEF, mapper_TK263B },   /* bootleg? */
1116   {"wofa",     CPS_B_21_DEF, mapper_TK263B },   /* bootleg? */
1117   {"wofu",     CPS_B_21_QS1, mapper_TK263B },
1118   {"wofj",     CPS_B_21_QS1, mapper_TK263B },
1119   {"dino",     CPS_B_21_QS2, mapper_CD63B },   /* layer enable never used */
1120   {"dinou",    CPS_B_21_QS2, mapper_CD63B },   /* layer enable never used */
1121   {"dinoj",    CPS_B_21_QS2, mapper_CD63B },   /* layer enable never used */
1122   {"punisher", CPS_B_21_QS3, mapper_PS63B },
1123   {"punishru", CPS_B_21_QS3, mapper_PS63B },
1124   {"punishrj", CPS_B_21_QS3, mapper_PS63B },
1125   {"slammast", CPS_B_21_QS4, mapper_MB63B },
1126   {"slammasu", CPS_B_21_QS4, mapper_MB63B },
1127   {"mbomberj", CPS_B_21_QS4, mapper_MB63B },
1128   {"mbombrd",  CPS_B_21_QS5, mapper_MB63B },
1129   {"mbombrdj", CPS_B_21_QS5, mapper_MB63B },
1130   {"sf2hf",    CPS_B_21_DEF, mapper_S9263B, 0x36 },
1131   {"sf2t",     CPS_B_21_DEF, mapper_S9263B, 0x36 },
1132   {"sf2tj",    CPS_B_21_DEF, mapper_S9263B, 0x36 },
1133   {"qad",      CPS_B_21_BT7, mapper_QD22B,  0x36 },   /* TODO: layer enable (port 36 probably leftover input code from another game) */
1134   {"qadj",     CPS_B_21_DEF, mapper_qadj,   0x36, 0x38, 0x34 },   /* (ports 36, 38, 34 probably leftover input code from another game) */
1135   {"qtono2",   CPS_B_21_DEF, mapper_qtono2, 0x36, 0x38, 0x34 },   /* (ports 36, 38, 34 probably leftover input code from another game) */
1136   {"megaman",  CPS_B_21_DEF, mapper_RCM63B },
1137   {"rockmanj", CPS_B_21_DEF, mapper_RCM63B },
1138   {"pnickj",   CPS_B_21_DEF, mapper_pnickj },
1139   {"pang3",    CPS_B_21_DEF, mapper_pang3 },   /* EEPROM port is among the CPS registers (handled by DRIVER_INIT) */
1140   {"pang3j",   CPS_B_21_DEF, mapper_pang3 },   /* EEPROM port is among the CPS registers (handled by DRIVER_INIT) */
10911141   #ifdef MESS
1092   {"sfzch",    NOBATTRY, mapper_cps2 },
1142   {"sfzch",    CPS_B_21_DEF, mapper_cps2 },
10931143   #endif
10941144
10951145    /* CPS2 games */
1096   {"cps2",     NOBATTRY, mapper_cps2 },
1146   {"cps2",     CPS_B_21_DEF, mapper_cps2 },
10971147
10981148   {0}      /* End of table */
10991149};
r2454r2455
11021152
11031153/* Public variables */
11041154UINT16 *cps1_gfxram;
1105UINT16 *cps1_output;
1155UINT16 *cps1_cps_a_regs;
1156UINT16 *cps1_cps_b_regs;
11061157
11071158size_t cps1_gfxram_size;
1108size_t cps1_output_size;
11091159
11101160/* Offset of each palette entry */
11111161#define cps1_palette_entries (32*6)  /* Number colour schemes in palette */
r2454r2455
11361186static int stars1x, stars1y, stars2x, stars2y;
11371187
11381188
1139/* Output ports */
1140#define CPS1_OBJ_BASE           0x00    /* Base address of objects */
1141#define CPS1_SCROLL1_BASE       0x02    /* Base address of scroll 1 */
1142#define CPS1_SCROLL2_BASE       0x04    /* Base address of scroll 2 */
1143#define CPS1_SCROLL3_BASE       0x06    /* Base address of scroll 3 */
1144#define CPS1_OTHER_BASE         0x08    /* Base address of other video */
1145#define CPS1_PALETTE_BASE       0x0a    /* Base address of palette */
1146#define CPS1_SCROLL1_SCROLLX    0x0c    /* Scroll 1 X */
1147#define CPS1_SCROLL1_SCROLLY    0x0e    /* Scroll 1 Y */
1148#define CPS1_SCROLL2_SCROLLX    0x10    /* Scroll 2 X */
1149#define CPS1_SCROLL2_SCROLLY    0x12    /* Scroll 2 Y */
1150#define CPS1_SCROLL3_SCROLLX    0x14    /* Scroll 3 X */
1151#define CPS1_SCROLL3_SCROLLY    0x16    /* Scroll 3 Y */
1152#define CPS1_STARS1_SCROLLX     0x18    /* Stars 1 X */
1153#define CPS1_STARS1_SCROLLY     0x1a    /* Stars 1 Y */
1154#define CPS1_STARS2_SCROLLX     0x1c    /* Stars 2 X */
1155#define CPS1_STARS2_SCROLLY     0x1e    /* Stars 2 Y */
1156#define CPS1_ROWSCROLL_OFFS     0x20    /* base of row scroll offsets in other RAM */
1157#define CPS1_VIDEOCONTROL       0x22    /* flip screen, rowscroll enable */
1189/* CPS-A registers */
1190#define CPS1_OBJ_BASE           (0x00/2)    /* Base address of objects */
1191#define CPS1_SCROLL1_BASE       (0x02/2)    /* Base address of scroll 1 */
1192#define CPS1_SCROLL2_BASE       (0x04/2)    /* Base address of scroll 2 */
1193#define CPS1_SCROLL3_BASE       (0x06/2)    /* Base address of scroll 3 */
1194#define CPS1_OTHER_BASE         (0x08/2)    /* Base address of other video */
1195#define CPS1_PALETTE_BASE       (0x0a/2)    /* Base address of palette */
1196#define CPS1_SCROLL1_SCROLLX    (0x0c/2)    /* Scroll 1 X */
1197#define CPS1_SCROLL1_SCROLLY    (0x0e/2)    /* Scroll 1 Y */
1198#define CPS1_SCROLL2_SCROLLX    (0x10/2)    /* Scroll 2 X */
1199#define CPS1_SCROLL2_SCROLLY    (0x12/2)    /* Scroll 2 Y */
1200#define CPS1_SCROLL3_SCROLLX    (0x14/2)    /* Scroll 3 X */
1201#define CPS1_SCROLL3_SCROLLY    (0x16/2)    /* Scroll 3 Y */
1202#define CPS1_STARS1_SCROLLX     (0x18/2)    /* Stars 1 X */
1203#define CPS1_STARS1_SCROLLY     (0x1a/2)    /* Stars 1 Y */
1204#define CPS1_STARS2_SCROLLX     (0x1c/2)    /* Stars 2 X */
1205#define CPS1_STARS2_SCROLLY     (0x1e/2)    /* Stars 2 Y */
1206#define CPS1_ROWSCROLL_OFFS     (0x20/2)    /* base of row scroll offsets in other RAM */
1207#define CPS1_VIDEOCONTROL       (0x22/2)    /* flip screen, rowscroll enable */
11581208
1159#define CPS1_SCROLL2_WIDTH      0x40
1160#define CPS1_SCROLL2_HEIGHT     0x40
11611209
1162
11631210/*
11641211CPS1 VIDEO RENDERER
11651212
r2454r2455
12601307}
12611308
12621309
1263int cps1_port(int offset)
1310INLINE UINT16 *cps1_base(int offset,int boundary)
12641311{
1265   return cps1_output[offset/2];
1266}
1312   int base = cps1_cps_a_regs[offset]*256;
12671313
1268INLINE UINT16 *cps1_base(int offset,int boundary)
1269{
1270   int base=cps1_port(offset)*256;
12711314   /*
12721315    The scroll RAM must start on a 0x4000 boundary.
12731316    Some games do not do this.
r2454r2455
12821325
12831326
12841327
1285READ16_HANDLER( cps1_output_r )
1328WRITE16_HANDLER( cps1_cps_a_w )
12861329{
1287   if (VERBOSE && offset >= 0x18/2) logerror("PC %06x: read output port %02x\n",activecpu_get_pc(),offset*2);
1330   data = COMBINE_DATA(&cps1_cps_a_regs[offset]);
12881331
1332   /*
1333    The main CPU writes the palette to gfxram, and the CPS-B custom copies it
1334    to the real palette RAM, which is separated from gfxram.
1335    This is done ONLY after the palette base register is written to. It is not
1336    known what the exact timing should be, how long it should take and when it
1337    should happen. We are assuming that the copy happens immediately, since it
1338    fixes glitches in the ghouls intro, but it might happen at next vblank.
1339    */
1340   if (offset == CPS1_PALETTE_BASE)
1341      cps1_build_palette(machine, cps1_base(CPS1_PALETTE_BASE,cps1_palette_align));
1342
1343   if (offset > CPS1_VIDEOCONTROL)
1344      popmessage("write to CPS-A register %02x contact MAMEDEV", offset*2);
1345}
1346
1347
1348READ16_HANDLER( cps1_cps_b_r )
1349{
12891350   /* Some games interrogate a couple of registers on bootup. */
12901351   /* These are CPS1 board B self test checks. They wander from game to */
12911352   /* game. */
1292   if (offset && offset == cps1_game_config->cpsb_addr/2)
1353   if (offset == cps1_game_config->cpsb_addr/2)
12931354      return cps1_game_config->cpsb_value;
12941355
1295   /* some games use as a protection check the ability to do 16-bit multiplies */
1356   /* some games use as a protection check the ability to do 16-bit multiplications */
12961357   /* with a 32-bit result, by writing the factors to two ports and reading the */
12971358   /* result from two other ports. */
1298   if (offset && offset == cps1_game_config->mult_result_lo/2)
1299      return (cps1_output[cps1_game_config->mult_factor1/2] *
1300            cps1_output[cps1_game_config->mult_factor2/2]) & 0xffff;
1301   if (offset && offset == cps1_game_config->mult_result_hi/2)
1302      return (cps1_output[cps1_game_config->mult_factor1/2] *
1303            cps1_output[cps1_game_config->mult_factor2/2]) >> 16;
1359   if (offset == cps1_game_config->mult_result_lo/2)
1360      return (cps1_cps_b_regs[cps1_game_config->mult_factor1/2] *
1361            cps1_cps_b_regs[cps1_game_config->mult_factor2/2]) & 0xffff;
1362   if (offset == cps1_game_config->mult_result_hi/2)
1363      return (cps1_cps_b_regs[cps1_game_config->mult_factor1/2] *
1364            cps1_cps_b_regs[cps1_game_config->mult_factor2/2]) >> 16;
13041365
1305   return cps1_output[offset];
1366   if (offset == cps1_game_config->in2_addr/2)   /* Extra input ports (on C-board) */
1367      return input_port_read(machine, "IN2");
1368
1369   if (offset == cps1_game_config->in3_addr/2)   /* Player 4 controls (on C-board) ("Captain Commando") */
1370      return input_port_read(machine, "IN3");
1371
1372   if (cps_version == 2)
1373   {
1374      if (offset == 0x12/2)
1375      {
1376         return cps1_cps_b_regs[0x12/2];
1377      }
1378   }
1379
1380   popmessage("CPS-B read port %02x contact MAMEDEV", offset*2);
1381
1382   return 0xffff;
13061383}
13071384
13081385
1309WRITE16_HANDLER( cps1_output_w )
1386WRITE16_HANDLER( cps1_cps_b_w )
13101387{
1311   data = COMBINE_DATA(&cps1_output[offset]);
1388   data = COMBINE_DATA(&cps1_cps_b_regs[offset]);
13121389
1313   /* To mark scanlines for raster effects */
1314   if(offset == 0x52/2)
1390   if (cps_version == 2)
13151391   {
1316      cps1_scanline2 = (data & 0x1ff);
1392      /* To mark scanlines for raster effects */
1393      if (offset == 0x0e/2)
1394      {
1395         // UNKNOWN
1396         return;
1397      }
1398      if (offset == 0x10/2)
1399      {
1400         cps1_scanline1 = (data & 0x1ff);
1401         return;
1402      }
1403      if (offset == 0x12/2)
1404      {
1405         cps1_scanline2 = (data & 0x1ff);
1406         return;
1407      }
13171408   }
1318   if(offset == 0x50/2)
1409
1410
1411   // additional outputs on C-board
1412   if (offset == cps1_game_config->out2_addr/2)
13191413   {
1320      cps1_scanline1 = (data & 0x1ff);
1414      if (ACCESSING_BITS_0_7)
1415      {
1416         if (cps1_game_config->cpsb_value == 0x0402)   // Mercs (CN2 connector)
1417         {
1418            coin_lockout_w(2,~data & 0x01);
1419            set_led_status(0,data & 0x02);
1420            set_led_status(1,data & 0x04);
1421            set_led_status(2,data & 0x08);
1422         }
1423         else   // kod, captcomm, knights
1424         {
1425            coin_lockout_w(2,~data & 0x02);
1426            coin_lockout_w(3,~data & 0x08);
1427         }
1428      }
13211429   }
13221430
13231431
1324#ifdef MAME_DEBUG
1325if (cps1_game_config->palette_control && offset == cps1_game_config->palette_control/2 && data != 0x3f)
1326   logerror("palette_control = %04x",data);
1327#endif
1328if (VERBOSE)
1329{
1330if (offset > 0x22/2 &&
1331      offset != cps1_game_config->layer_control/2 &&
1332      offset != cps1_game_config->priority[0]/2 &&
1333      offset != cps1_game_config->priority[1]/2 &&
1334      offset != cps1_game_config->priority[2]/2 &&
1335      offset != cps1_game_config->priority[3]/2 &&
1336      offset != cps1_game_config->palette_control/2)
1337   logerror("PC %06x: write %02x to output port %02x\n",activecpu_get_pc(),data,offset*2);
1338
1339#ifdef MAME_DEBUG
1340if (cps1_game_config->priority[0] && offset == cps1_game_config->priority[0]/2 && data != 0x00)
1341   popmessage("priority0 %04x",data);
1342#endif
1432   if (offset != cps1_game_config->cpsb_addr/2 &&   // only varth writes here
1433         offset != cps1_game_config->mult_factor1/2 &&
1434         offset != cps1_game_config->mult_factor2/2 &&
1435         offset != cps1_game_config->layer_control/2 &&
1436         offset != cps1_game_config->unknown1/2 &&
1437         offset != cps1_game_config->unknown2/2 &&
1438         offset != cps1_game_config->unknown3/2 &&
1439         offset != cps1_game_config->priority[0]/2 &&
1440         offset != cps1_game_config->priority[1]/2 &&
1441         offset != cps1_game_config->priority[2]/2 &&
1442         offset != cps1_game_config->priority[3]/2 &&
1443         offset != cps1_game_config->palette_control/2 &&
1444         offset != cps1_game_config->out2_addr/2)
1445      popmessage("CPS-B write %04x to port %02x contact MAMEDEV", data, offset*2);
13431446}
13441447
1345   /*
1346    The main CPU writes the palette to gfxram, and the CPS-B custom copies it
1347    to the real palette RAM, which is separated from gfxram.
1348    This is done ONLY after the palette base register is written to. It is not
1349    known what the exact timing should be, how long it should take and when it
1350    should happen. We are assuming that the copy happens immediately, since it
1351    fixes glitches in the ghouls intro, but it might happen at next vblank.
1352    */
1353   if (offset == CPS1_PALETTE_BASE/2)
1354      cps1_build_palette(machine, cps1_base(CPS1_PALETTE_BASE,cps1_palette_align));
1355}
13561448
13571449
1358
13591450INLINE int cps2_port(int offset)
13601451{
13611452    return cps2_output[offset/2];
r2454r2455
14731564   /* Some of the sf2 hacks use only sprite port 0x9100 and the scroll layers are offset */
14741565   if (cps1_game_config->bootleg_kludge == 1)
14751566   {
1476      cps1_output[CPS1_OBJ_BASE/2] = 0x9100;
1477      cps1_obj=cps1_base(CPS1_OBJ_BASE, cps1_obj_size);
1567      cps1_cps_a_regs[CPS1_OBJ_BASE] = 0x9100;
1568      cps1_obj = cps1_base(CPS1_OBJ_BASE, cps1_obj_size);
14781569      scroll1xoff = -0x0c;
14791570      scroll2xoff = -0x0e;
14801571      scroll3xoff = -0x10;
14811572   }
14821573   else
14831574   {
1484      cps1_obj=cps1_base(CPS1_OBJ_BASE, cps1_obj_size);
1575      cps1_obj = cps1_base(CPS1_OBJ_BASE, cps1_obj_size);
14851576      scroll1xoff = 0;
14861577      scroll2xoff = 0;
14871578      scroll3xoff = 0;
14881579   }
1489   cps1_other=cps1_base(CPS1_OTHER_BASE,cps1_other_size);
1580   cps1_other = cps1_base(CPS1_OTHER_BASE,cps1_other_size);
14901581
14911582   /* Get scroll values */
1492   cps1_scroll1x=cps1_port(CPS1_SCROLL1_SCROLLX) + scroll1xoff;
1493   cps1_scroll1y=cps1_port(CPS1_SCROLL1_SCROLLY);
1494   cps1_scroll2x=cps1_port(CPS1_SCROLL2_SCROLLX) + scroll2xoff;
1495   cps1_scroll2y=cps1_port(CPS1_SCROLL2_SCROLLY);
1496   cps1_scroll3x=cps1_port(CPS1_SCROLL3_SCROLLX) + scroll3xoff;
1497   cps1_scroll3y=cps1_port(CPS1_SCROLL3_SCROLLY);
1498   stars1x =cps1_port(CPS1_STARS1_SCROLLX);
1499   stars1y =cps1_port(CPS1_STARS1_SCROLLY);
1500   stars2x =cps1_port(CPS1_STARS2_SCROLLX);
1501   stars2y =cps1_port(CPS1_STARS2_SCROLLY);
1583   cps1_scroll1x = cps1_cps_a_regs[CPS1_SCROLL1_SCROLLX] + scroll1xoff;
1584   cps1_scroll1y = cps1_cps_a_regs[CPS1_SCROLL1_SCROLLY];
1585   cps1_scroll2x = cps1_cps_a_regs[CPS1_SCROLL2_SCROLLX] + scroll2xoff;
1586   cps1_scroll2y = cps1_cps_a_regs[CPS1_SCROLL2_SCROLLY];
1587   cps1_scroll3x = cps1_cps_a_regs[CPS1_SCROLL3_SCROLLX] + scroll3xoff;
1588   cps1_scroll3y = cps1_cps_a_regs[CPS1_SCROLL3_SCROLLY];
1589   stars1x = cps1_cps_a_regs[CPS1_STARS1_SCROLLX];
1590   stars1y = cps1_cps_a_regs[CPS1_STARS1_SCROLLY];
1591   stars2x = cps1_cps_a_regs[CPS1_STARS2_SCROLLX];
1592   stars2y = cps1_cps_a_regs[CPS1_STARS2_SCROLLY];
15021593
15031594   /* Get layer enable bits */
1504   layercontrol=cps1_port(cps1_game_config->layer_control);
1505   videocontrol=cps1_port(CPS1_VIDEOCONTROL);
1595   layercontrol = cps1_cps_b_regs[cps1_game_config->layer_control/2];
1596   videocontrol = cps1_cps_a_regs[CPS1_VIDEOCONTROL];
15061597   tilemap_set_enable(cps1_bg_tilemap[0],layercontrol & cps1_game_config->layer_enable_mask[0]);
15071598   tilemap_set_enable(cps1_bg_tilemap[1],(layercontrol & cps1_game_config->layer_enable_mask[1]) && (videocontrol & 4));
15081599   tilemap_set_enable(cps1_bg_tilemap[2],(layercontrol & cps1_game_config->layer_enable_mask[2]) && (videocontrol & 8));
r2454r2455
15101601   cps1_stars_enabled[1] = layercontrol & cps1_game_config->layer_enable_mask[4];
15111602
15121603
1513#ifdef MAME_DEBUG
15141604{
15151605   int enablemask;
15161606
1517#if 0
1518if (input_code_pressed(KEYCODE_Z))
1519{
1520   if (input_code_pressed(KEYCODE_Q)) cps1_layer_enabled[3]=0;
1521   if (input_code_pressed(KEYCODE_W)) cps1_layer_enabled[2]=0;
1522   if (input_code_pressed(KEYCODE_E)) cps1_layer_enabled[1]=0;
1523   if (input_code_pressed(KEYCODE_R)) cps1_layer_enabled[0]=0;
1524   if (input_code_pressed(KEYCODE_T))
1525   {
1526      popmessage("%d %d %d %d layer %02x",
1527         (layercontrol>>0x06)&03,
1528         (layercontrol>>0x08)&03,
1529         (layercontrol>>0x0a)&03,
1530         (layercontrol>>0x0c)&03,
1531         layercontrol&0xc03f
1532         );
1533   }
1534
1535}
1536#endif
1537
15381607   enablemask = 0;
15391608   if (cps1_game_config->layer_enable_mask[0] == cps1_game_config->layer_enable_mask[1])
15401609      enablemask = cps1_game_config->layer_enable_mask[0];
r2454r2455
15451614   if (enablemask)
15461615   {
15471616      if (((layercontrol & enablemask) && (layercontrol & enablemask) != enablemask))
1548         popmessage("layer %02x",layercontrol&0xc03f);
1617         popmessage("layer %02x contact MAMEDEV",layercontrol&0xc03f);
15491618   }
1550}
1551#endif
15521619
1553{
1554   int enablemask;
15551620   enablemask = cps1_game_config->layer_enable_mask[0] | cps1_game_config->layer_enable_mask[1]
15561621         | cps1_game_config->layer_enable_mask[2]
15571622         | cps1_game_config->layer_enable_mask[3] | cps1_game_config->layer_enable_mask[4];
r2454r2455
15671632   int page = (offset >> 7) & 0x3c0;
15681633   COMBINE_DATA(&cps1_gfxram[offset]);
15691634
1570   if (page == (cps1_port(CPS1_SCROLL1_BASE) & 0x3c0))
1635   if (page == (cps1_cps_a_regs[CPS1_SCROLL1_BASE] & 0x3c0))
15711636      tilemap_mark_tile_dirty(cps1_bg_tilemap[0],offset/2 & 0x0fff);
1572   if (page == (cps1_port(CPS1_SCROLL2_BASE) & 0x3c0))
1637   if (page == (cps1_cps_a_regs[CPS1_SCROLL2_BASE] & 0x3c0))
15731638      tilemap_mark_tile_dirty(cps1_bg_tilemap[1],offset/2 & 0x0fff);
1574   if (page == (cps1_port(CPS1_SCROLL3_BASE) & 0x3c0))
1639   if (page == (cps1_cps_a_regs[CPS1_SCROLL3_BASE] & 0x3c0))
15751640      tilemap_mark_tile_dirty(cps1_bg_tilemap[2],offset/2 & 0x0fff);
15761641}
15771642
r2454r2455
17231788      int mask;
17241789
17251790      /* Get transparency registers */
1726      if (cps1_game_config->priority[i])
1727         mask = cps1_port(cps1_game_config->priority[i]) ^ 0xffff;
1728      else mask = 0xffff;   /* completely transparent if priority masks not defined (mercs, qad) */
1791      if (cps1_game_config->priority[i] != -1)
1792         mask = cps1_cps_b_regs[cps1_game_config->priority[i]/2] ^ 0xffff;
1793      else mask = 0xffff;   /* completely transparent if priority masks not defined (qad) */
17291794
17301795      tilemap_set_transmask(cps1_bg_tilemap[0],i,mask,0x8000);
17311796      tilemap_set_transmask(cps1_bg_tilemap[1],i,mask,0x8000);
r2454r2455
17631828   }
17641829
17651830   memset(cps1_gfxram, 0, cps1_gfxram_size);   /* Clear GFX RAM */
1766   memset(cps1_output, 0, cps1_output_size);   /* Clear output ports */
1831   memset(cps1_cps_a_regs, 0, 0x40);   /* Clear CPS-A registers */
1832   memset(cps1_cps_b_regs, 0, 0x40);   /* Clear CPS-B registers */
17671833
17681834   if (cps_version == 2)
17691835   {
r2454r2455
17721838   }
17731839
17741840   /* Put in some defaults */
1775   cps1_output[CPS1_OBJ_BASE/2]     = 0x9200;
1776   cps1_output[CPS1_SCROLL1_BASE/2] = 0x9000;
1777   cps1_output[CPS1_SCROLL2_BASE/2] = 0x9040;
1778   cps1_output[CPS1_SCROLL3_BASE/2] = 0x9080;
1779   cps1_output[CPS1_OTHER_BASE/2]   = 0x9100;
1841   cps1_cps_a_regs[CPS1_OBJ_BASE]     = 0x9200;
1842   cps1_cps_a_regs[CPS1_SCROLL1_BASE] = 0x9000;
1843   cps1_cps_a_regs[CPS1_SCROLL2_BASE] = 0x9040;
1844   cps1_cps_a_regs[CPS1_SCROLL3_BASE] = 0x9080;
1845   cps1_cps_a_regs[CPS1_OTHER_BASE]   = 0x9100;
17801846
17811847   assert_always(cps1_game_config, "cps1_game_config hasn't been set up yet");
17821848
r2454r2455
18101876   int offset, page;
18111877   const UINT16 *palette_ram = palette_base;
18121878
1813   int ctrl = cps1_port(cps1_game_config->palette_control);
1879   int ctrl = cps1_cps_b_regs[cps1_game_config->palette_control/2];
18141880
18151881   /*
18161882    The palette is copied only for pages that are enabled in the ctrl
r2454r2455
23932459VIDEO_UPDATE( cps1 )
23942460{
23952461   int layercontrol,l0,l1,l2,l3;
2396   int videocontrol=cps1_port(CPS1_VIDEOCONTROL);
2462   int videocontrol = cps1_cps_a_regs[CPS1_VIDEOCONTROL];
23972463
23982464
23992465   flip_screen_set(videocontrol & 0x8000);
24002466
2401   layercontrol = cps1_output[cps1_game_config->layer_control/2];
2467   layercontrol = cps1_cps_b_regs[cps1_game_config->layer_control/2];
24022468
24032469   /* Get video memory base registers */
24042470   cps1_get_video_base();
r2454r2455
24222488
24232489      tilemap_set_scroll_rows(cps1_bg_tilemap[1],1024);
24242490
2425      otheroffs = cps1_port(CPS1_ROWSCROLL_OFFS);
2491      otheroffs = cps1_cps_a_regs[CPS1_ROWSCROLL_OFFS];
24262492
24272493      for (i = 0;i < 256;i++)
24282494         tilemap_set_scrollx(cps1_bg_tilemap[1],(i - scrly) & 0x3ff,cps1_scroll2x + cps1_other[(i + otheroffs) & 0x3ff]);
src/mame/video/stactics.c
r2454r2455
4747***************************************************************************/
4848
4949#include "driver.h"
50#include "deprecat.h"
5150#include "stactics.h"
5251
5352
r2454r2455
9291
9392WRITE8_HANDLER( stactics_scroll_ram_w )
9493{
95   stactics_state *state = Machine->driver_data;
94   stactics_state *state = machine->driver_data;
9695
9796   if (data & 0x01)
9897   {
r2454r2455
130129
131130WRITE8_HANDLER( stactics_speed_latch_w )
132131{
133   stactics_state *state = Machine->driver_data;
132   stactics_state *state = machine->driver_data;
134133
135134   /* This writes to a shift register which is clocked by   */
136135   /* a 555 oscillator.  This value determines the speed of */
r2454r2455
157156
158157WRITE8_HANDLER( stactics_shot_trigger_w )
159158{
160   stactics_state *state = Machine->driver_data;
159   stactics_state *state = machine->driver_data;
161160
162161   state->shot_standby = 0;
163162}
r2454r2455
165164
166165WRITE8_HANDLER( stactics_shot_flag_clear_w )
167166{
168   stactics_state *state = Machine->driver_data;
167   stactics_state *state = machine->driver_data;
169168
170169   state->shot_arrive = 0;
171170}
src/mame/video/lethalj.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "cpu/tms34010/tms34010.h"
109#include "lethalj.h"
1110
r2454r2455
6261      case 4:
6362      case 5:
6463         /* latch the crosshair position */
65         get_crosshair_xy(Machine, offset - 4, &beamx, &beamy);
64         get_crosshair_xy(machine, offset - 4, &beamx, &beamy);
6665         gunx = beamx;
6766         guny = beamy;
6867         blank_palette = 1;
r2454r2455
170169
171170   /* clear the IRQ on offset 0 */
172171   else if (offset == 0)
173      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
172      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
174173}
175174
176175
src/mame/video/itech8.c
r2454r2455
8888***************************************************************************/
8989
9090#include "driver.h"
91#include "deprecat.h"
9291#include "video/tms34061.h"
9392#include "video/tlc34076.h"
9493#include "cpu/m6809/m6809.h"
r2454r2455
470469   /* a read from offset 3 clears the interrupt and returns the status */
471470   if (offset == 3)
472471   {
473      itech8_update_interrupts(Machine, -1, -1, 0);
472      itech8_update_interrupts(machine, -1, -1, 0);
474473      if (blit_in_progress)
475474         result |= 0x80;
476475      else
src/mame/video/hyprduel.c
r2454r2455
5555***************************************************************************/
5656
5757#include "driver.h"
58#include "deprecat.h"
5958
6059#define RASTER_LINES 262
6160#define FIRST_VISIBLE_LINE 0
r2454r2455
8584{
8685   data = COMBINE_DATA(&paletteram16[offset]);
8786   /* We need the ^0xff because we had to invert the pens in the gfx */
88   palette_set_color_rgb(Machine,offset^0xff,pal5bit(data >> 6),pal5bit(data >> 11),pal5bit(data >> 1));
87   palette_set_color_rgb(machine,offset^0xff,pal5bit(data >> 6),pal5bit(data >> 11),pal5bit(data >> 1));
8988}
9089
9190
src/mame/video/sshangha.c
r2454r2455
66***************************************************************************/
77
88#include "driver.h"
9#include "deprecat.h"
109
1110UINT16 *sshangha_pf2_data,*sshangha_pf1_data;
1211UINT16 *sshangha_pf1_rowscroll,*sshangha_pf2_rowscroll;
r2454r2455
2726   g = (paletteram16[offset+1] >> 8) & 0xff;
2827   r = (paletteram16[offset+1] >> 0) & 0xff;
2928
30   palette_set_color(Machine,offset/2,MAKE_RGB(r,g,b));
29   palette_set_color(machine,offset/2,MAKE_RGB(r,g,b));
3130}
3231
3332static void sshangha_tilemap_draw(bitmap_t *bitmap, const rectangle *cliprect)
src/mame/video/kyugo.c
r2454r2455
181181      sx = spriteram_area3[offs+1] + 256 * (spriteram_area2[offs+1] & 1);
182182      if (sx > 320) sx -= 512;
183183
184      sy = 255 - spriteram_area1[offs];
184      sy = 255 - spriteram_area1[offs] + 2;
185      if (sy > 0xf0) sy -= 256;
186
185187      if (flipscreen) sy = 240 - sy;
186188
187189      color = spriteram_area1[offs+1] & 0x1f;
src/mame/video/segaic24.c
r2454r2455
2323*/
2424
2525#include "driver.h"
26#include "deprecat.h"
2726#include "segaic24.h"
2827
2928
r2454r2455
6564   r |= r >> 5;
6665   g |= g >> 5;
6766   b |= b >> 5;
68   set_color(Machine, offset, r, g, b, data & 0x8000);
67   set_color(machine, offset, r, g, b, data & 0x8000);
6968}
7069
7170// - System 24
src/mame/video/popeye.c
r2454r2455
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110
1211UINT8 *popeye_background_pos;
1312UINT8 *popeye_palettebank;
src/mame/video/lordgun.c
r2454r2455
3636***************************************************************************/
3737
3838#include "driver.h"
39#include "deprecat.h"
4039
4140// Variables needed by driver:
4241
src/mame/video/tiamc1.c
r2454r2455
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1211
1312
1413UINT8 *tiamc1_tileram;
r2454r2455
8483
8584WRITE8_HANDLER( tiamc1_palette_w )
8685{
87   palette_set_color(Machine, offset, palette[data]);
86   palette_set_color(machine, offset, palette[data]);
8887}
8988
9089PALETTE_INIT( tiamc1 )
src/mame/video/toaplan1.c
r2454r2455
119119
120120
121121#include "driver.h"
122#include "deprecat.h"
123122#include "toaplan1.h"
124123#include "cpu/m68000/m68000.h"
125124
r2454r2455
319318
320319static STATE_POSTLOAD( rallybik_flipscreen )
321320{
322   rallybik_bcu_flipscreen_w(Machine, 0, bcu_flipscreen, 0);
321   rallybik_bcu_flipscreen_w(machine, 0, bcu_flipscreen, 0xffff);
323322}
324323
325324static STATE_POSTLOAD( toaplan1_flipscreen )
326325{
327   toaplan1_bcu_flipscreen_w(Machine, 0, bcu_flipscreen, 0);
326   toaplan1_bcu_flipscreen_w(machine, 0, bcu_flipscreen, 0xffff);
328327}
329328
330329
r2454r2455
12301229
12311230VIDEO_EOF( rallybik )
12321231{
1233   buffer_spriteram16_w(machine, 0, 0, 0);
1232   buffer_spriteram16_w(machine, 0, 0, 0xffff);
12341233}
12351234
12361235VIDEO_EOF( toaplan1 )
12371236{
1238   buffer_spriteram16_w(machine, 0, 0, 0);
1237   buffer_spriteram16_w(machine, 0, 0, 0xffff);
12391238   memcpy(toaplan1_buffered_spritesizeram16, toaplan1_spritesizeram16, TOAPLAN1_SPRITESIZERAM_SIZE);
12401239}
12411240
12421241VIDEO_EOF( samesame )
12431242{
1244   buffer_spriteram16_w(machine, 0, 0, 0);
1243   buffer_spriteram16_w(machine, 0, 0, 0xffff);
12451244   memcpy(toaplan1_buffered_spritesizeram16, toaplan1_spritesizeram16, TOAPLAN1_SPRITESIZERAM_SIZE);
12461245   cpunum_set_input_line(machine, 0, MC68000_IRQ_2, HOLD_LINE);   /* Frame done */
12471246}
src/mame/video/segag80r.c
r2454r2455
612612   {
613613      /* port 0: irq ack */
614614      case 0:
615         cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
615         cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
616616         break;
617617
618618      /* port 1: background control
src/mame/video/tmnt.c
r2454r2455
11#include "driver.h"
2#include "deprecat.h"
32#include "machine/eeprom.h"
43#include "video/konamiic.h"
54
r2454r2455
323322   offset &= ~1;
324323
325324   data = (paletteram16[offset] << 8) | paletteram16[offset+1];
326   palette_set_color_rgb(Machine,offset / 2,pal5bit(data >> 0),pal5bit(data >> 5),pal5bit(data >> 10));
325   palette_set_color_rgb(machine,offset / 2,pal5bit(data >> 0),pal5bit(data >> 5),pal5bit(data >> 10));
327326}
328327
329328
r2454r2455
340339
341340      /* bit 3 high then low triggers irq on sound CPU */
342341      if (last == 0x08 && (data & 0x08) == 0)
343         cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
342         cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);
344343
345344      last = data & 0x08;
346345
r2454r2455
366365
367366      /* bit 2 = trigger irq on sound CPU */
368367      if (last == 0x04 && (data & 0x04) == 0)
369         cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
368         cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);
370369
371370      last = data & 0x04;
372371
r2454r2455
388387
389388      /* bit 2 = trigger irq on sound CPU */
390389      if (last == 0x00 && (data & 0x04) == 0x04)
391         cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
390         cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);
392391
393392      last = data & 0x04;
394393
src/mame/video/jpmimpct.c
r2454r2455
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "cpu/tms34010/tms34010.h"
109#include "jpmimpct.h"
1110
r2454r2455
6160
6261         if (++*addr_cnt == 3)
6362         {
64            palette_set_color(Machine, bt477.address, MAKE_RGB(color[0], color[1], color[2]));
63            palette_set_color(machine, bt477.address, MAKE_RGB(color[0], color[1], color[2]));
6564            *addr_cnt = 0;
6665
6766            /* Address register increments */
src/mame/video/dc.c
r2454r2455
5252   *shift = 0;
5353
5454   // non 32-bit accesses have not yet been seen here, we need to know when they are
55   if ((mem_mask != U64(0x00000000ffffffff)) && (mem_mask != U64(0xffffffff00000000)))
55   if ((mem_mask != U64(0xffffffff00000000)) && (mem_mask != U64(0x00000000ffffffff)))
5656   {
5757      assert_always(0, "Wrong mask!\n");
5858   }
5959
60   if (mem_mask == U64(0x00000000ffffffff))
60   if (mem_mask == U64(0xffffffff00000000))
6161   {
6262      reg++;
6363      *shift = 32;
r2454r2455
199199   static UINT32 ignoretexalpha,flipuv,clampuv,filtermode,sstexture,mmdadjust,tsinstruction;
200200   static UINT32 depthcomparemode,cullingmode,zwritedisable,cachebypass,dcalcctrl,volumeinstruction,mipmapped,vqcompressed,strideselect;
201201
202   if (!mem_mask)    // 64 bit
202   if (mem_mask == U64(0xffffffffffffffff))    // 64 bit
203203   {
204204      tafifo_buff[tafifo_pos]=(UINT32)data;
205205      tafifo_buff[tafifo_pos+1]=(UINT32)(data >> 32);
src/mame/video/segaic16.c
r2454r2455
591591   b = ((newval >> 14) & 0x01) | ((newval >> 7) & 0x1e);
592592
593593   /* normal colors */
594   palette_set_color_rgb(Machine, offset + 0 * palette.entries, palette.normal[r],  palette.normal[g],  palette.normal[b]);
595   palette_set_color_rgb(Machine, offset + 1 * palette.entries, palette.shadow[r],  palette.shadow[g],  palette.shadow[b]);
596   palette_set_color_rgb(Machine, offset + 2 * palette.entries, palette.hilight[r], palette.hilight[g], palette.hilight[b]);
594   palette_set_color_rgb(machine, offset + 0 * palette.entries, palette.normal[r],  palette.normal[g],  palette.normal[b]);
595   palette_set_color_rgb(machine, offset + 1 * palette.entries, palette.shadow[r],  palette.shadow[g],  palette.shadow[b]);
596   palette_set_color_rgb(machine, offset + 2 * palette.entries, palette.hilight[r], palette.hilight[g], palette.hilight[b]);
597597}
598598
599599
src/mame/video/bionicc.c
r2454r2455
243243
244244VIDEO_EOF( bionicc )
245245{
246   buffer_spriteram16_w(machine,0,0,0);
246   buffer_spriteram16_w(machine,0,0,0xffff);
247247}
src/mame/video/playmark.c
r2454r2455
11#include "driver.h"
2#include "deprecat.h"
32
43UINT16 *bigtwin_bgvideoram;
54UINT16 *wbeachvl_videoram1,*wbeachvl_videoram2,*wbeachvl_videoram3;
r2454r2455
251250   g |= ((val & 0x04) >> 2);
252251   b |= ((val & 0x02) >> 1);
253252
254   palette_set_color_rgb(Machine,offset,pal5bit(r),pal5bit(g),pal5bit(b));
253   palette_set_color_rgb(machine,offset,pal5bit(r),pal5bit(g),pal5bit(b));
255254}
256255
257256WRITE16_HANDLER( bigtwin_scroll_w )
src/mame/video/gameplan.c
r2454r2455
119119
120120static WRITE8_HANDLER( video_data_w )
121121{
122   gameplan_state *state = Machine->driver_data;
122   gameplan_state *state = machine->driver_data;
123123
124124   state->video_data = data;
125125}
r2454r2455
127127
128128static WRITE8_HANDLER( gameplan_video_command_w )
129129{
130   gameplan_state *state = Machine->driver_data;
130   gameplan_state *state = machine->driver_data;
131131
132132   state->video_command = data & 0x07;
133133}
r2454r2455
135135
136136static WRITE8_HANDLER( leprechn_video_command_w )
137137{
138   gameplan_state *state = Machine->driver_data;
138   gameplan_state *state = machine->driver_data;
139139
140140   state->video_command = (data >> 3) & 0x07;
141141}
src/mame/video/beathead.c
r2454r2455
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "beathead.h"
109
1110
r2454r2455
5857WRITE32_HANDLER( beathead_vram_transparent_w )
5958{
6059   /* writes to this area appear to handle transparency */
61   if (!(data & 0x000000ff)) mem_mask |= 0x000000ff;
62   if (!(data & 0x0000ff00)) mem_mask |= 0x0000ff00;
63   if (!(data & 0x00ff0000)) mem_mask |= 0x00ff0000;
64   if (!(data & 0xff000000)) mem_mask |= 0xff000000;
60   if (!(data & 0x000000ff)) mem_mask &= ~0x000000ff;
61   if (!(data & 0x0000ff00)) mem_mask &= ~0x0000ff00;
62   if (!(data & 0x00ff0000)) mem_mask &= ~0x00ff0000;
63   if (!(data & 0xff000000)) mem_mask &= ~0xff000000;
6564   COMBINE_DATA(&videoram32[offset]);
6665}
6766
r2454r2455
7170   /* it appears that writes to this area pass in a mask for 4 words in VRAM */
7271   /* allowing them to be filled from a preset latch */
7372   offset &= ~3;
74   data = data & ~mem_mask & 0x0f0f0f0f;
73   data = data & mem_mask & 0x0f0f0f0f;
7574
7675   /* for now, just handle the bulk fill case; the others we'll catch later */
7776   if (data == 0x0f0f0f0f)
r2454r2455
115114   if ((oldword & 8) && !(newword & 8) && video_screen_get_vpos(machine->primary_screen) != 261)
116115   {
117116      logerror("Suspending time! (scanline = %d)\n", video_screen_get_vpos(machine->primary_screen));
118      cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, ASSERT_LINE);
117      cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, ASSERT_LINE);
119118   }
120119}
121120
r2454r2455
133132   int r = ((newword >> 9) & 0x3e) | ((newword >> 15) & 0x01);
134133   int g = ((newword >> 4) & 0x3e) | ((newword >> 15) & 0x01);
135134   int b = ((newword << 1) & 0x3e) | ((newword >> 15) & 0x01);
136   palette_set_color_rgb(Machine, offset, pal6bit(r), pal6bit(g), pal6bit(b));
135   palette_set_color_rgb(machine, offset, pal6bit(r), pal6bit(g), pal6bit(b));
137136}
138137
139138
src/mame/video/st0016.c
r2454r2455
105105   st0016_paletteram[ST0016_PAL_BANK_SIZE*st0016_pal_bank+offset]=data;
106106   val=st0016_paletteram[color*2]+(st0016_paletteram[color*2+1]<<8);
107107   if(!color)
108      palette_set_color_rgb(Machine,UNUSED_PEN,pal5bit(val >> 0),pal5bit(val >> 5),pal5bit(val >> 10)); /* same as color 0 - bg ? */
109   palette_set_color_rgb(Machine,color,pal5bit(val >> 0),pal5bit(val >> 5),pal5bit(val >> 10));
108      palette_set_color_rgb(machine,UNUSED_PEN,pal5bit(val >> 0),pal5bit(val >> 5),pal5bit(val >> 10)); /* same as color 0 - bg ? */
109   palette_set_color_rgb(machine,color,pal5bit(val >> 0),pal5bit(val >> 5),pal5bit(val >> 10));
110110}
111111
112112READ8_HANDLER(st0016_character_ram_r)
r2454r2455
117117WRITE8_HANDLER(st0016_character_ram_w)
118118{
119119   st0016_charram[ST0016_CHAR_BANK_SIZE*st0016_char_bank+offset]=data;
120   decodechar(Machine->gfx[st0016_ramgfx], st0016_char_bank,(UINT8 *) st0016_charram);
120   decodechar(machine->gfx[st0016_ramgfx], st0016_char_bank,(UINT8 *) st0016_charram);
121121}
122122
123123READ8_HANDLER(st0016_vregs_r)
r2454r2455
421421static STATE_POSTLOAD( st0016_postload )
422422{
423423   int i;
424   st0016_rom_bank_w(Machine,0,st0016_rom_bank);
424   st0016_rom_bank_w(machine,0,st0016_rom_bank);
425425   for(i=0;i<ST0016_MAX_CHAR_BANK;i++)
426      decodechar(Machine->gfx[st0016_ramgfx], i,(UINT8 *) st0016_charram);
426      decodechar(machine->gfx[st0016_ramgfx], i,(UINT8 *) st0016_charram);
427427}
428428
429429
src/mame/video/cchasm.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "video/vector.h"
109#include "cchasm.h"
1110
r2454r2455
115114         cchasm_refresh();
116115         break;
117116      case 0xf7:
118         cpunum_set_input_line (Machine, 0, 2, CLEAR_LINE);
117         cpunum_set_input_line (machine, 0, 2, CLEAR_LINE);
119118         break;
120119      }
121120   }
src/mame/video/battlex.c
r2454r2455
11#include "driver.h"
2#include "deprecat.h"
32
43static int battlex_scroll_lsb;
54static int battlex_scroll_msb;
r2454r2455
3635
3736WRITE8_HANDLER( battlex_palette_w )
3837{
39   palette_set_color_rgb(Machine,16*8 + offset,pal1bit(data >> 2),pal1bit(data >> 0),pal1bit(data >> 1));
38   palette_set_color_rgb(machine,16*8 + offset,pal1bit(data >> 2),pal1bit(data >> 0),pal1bit(data >> 1));
4039}
4140
4241WRITE8_HANDLER( battlex_scroll_x_lsb_w )
src/mame/video/toaplan2.c
r2454r2455
656656   {
657657      int code = offset/32;
658658      COMBINE_DATA(&toaplan2_tx_gfxram16[offset]);
659      decodechar(Machine->gfx[2], code, toaplan2_tx_gfxram);
659      decodechar(machine->gfx[2], code, toaplan2_tx_gfxram);
660660
661661      tilemap_mark_all_tiles_dirty(tx_tilemap);
662662   }
r2454r2455
699699
700700   /* Decode text characters */
701701   for (code = 0; code < 1024; code++)
702      decodechar (Machine->gfx[2], code, raizing_tx_gfxram);
702      decodechar (machine->gfx[2], code, raizing_tx_gfxram);
703703   tilemap_mark_all_tiles_dirty(tx_tilemap);
704704}
705705
r2454r2455
10671067
10681068READ16_HANDLER( pipibibi_videoram16_r )
10691069{
1070   toaplan2_voffs_w(0, offset, 0, 0);
1070   toaplan2_voffs_w(0, offset, 0xffff, 0);
10711071   return toaplan2_videoram16_r(0, 0);
10721072}
10731073
10741074WRITE16_HANDLER( pipibibi_videoram16_w)
10751075{
1076   toaplan2_voffs_w(0, offset, 0, 0);
1076   toaplan2_voffs_w(0, offset, 0xffff, 0);
10771077   toaplan2_videoram16_w(0, data, mem_mask, 0);
10781078}
10791079
src/mame/video/wecleman.c
r2454r2455
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1211#include "video/konamiic.h"
1312
1413#define BMP_PAD      8
r2454r2455
880879   g = ((newword >> 3) & 0x1E ) | ((newword >> 13) & 0x01);
881880   b = ((newword >> 7) & 0x1E ) | ((newword >> 14) & 0x01);
882881
883   palette_set_color_rgb(Machine, offset, pal5bit(r), pal5bit(g), pal5bit(b));
882   palette_set_color_rgb(machine, offset, pal5bit(r), pal5bit(g), pal5bit(b));
884883   r>>=1; g>>=1; b>>=1;
885   palette_set_color_rgb(Machine, offset+0x800, pal5bit(r)/2, pal5bit(g)/2, pal5bit(b)/2);
884   palette_set_color_rgb(machine, offset+0x800, pal5bit(r)/2, pal5bit(g)/2, pal5bit(b)/2);
886885}
887886
888887WRITE16_HANDLER( wecleman_paletteram16_SSSSBBBBGGGGRRRR_word_w )
r2454r2455
891890
892891   // the highest nibble has some unknown functions
893892//  if (newword & 0xf000) logerror("MSN set on color %03x: %1x\n", offset, newword>>12);
894   palette_set_color_rgb(Machine, offset, pal4bit(newword >> 0), pal4bit(newword >> 4), pal4bit(newword >> 8));
893   palette_set_color_rgb(machine, offset, pal4bit(newword >> 0), pal4bit(newword >> 4), pal4bit(newword >> 8));
895894}
896895
897896
src/mame/video/tetrisp2.c
r2454r2455
3939***************************************************************************/
4040
4141#include "driver.h"
42#include "deprecat.h"
4342
4443
4544extern UINT16 tetrisp2_systemregs[0x10];
r2454r2455
7271{
7372   data = COMBINE_DATA(&paletteram16[offset]);
7473   if ((offset & 1) == 0)
75      palette_set_color_rgb(Machine,offset/2,pal5bit(data >> 1),pal5bit(data >> 6),pal5bit(data >> 11));
74      palette_set_color_rgb(machine,offset/2,pal5bit(data >> 1),pal5bit(data >> 6),pal5bit(data >> 11));
7675}
7776
7877WRITE16_HANDLER( rocknms_sub_palette_w )
7978{
8079   data = COMBINE_DATA(&paletteram16_2[offset]);
8180   if ((offset & 1) == 0)
82      palette_set_color_rgb(Machine,(0x8000 + (offset/2)),pal5bit(data >> 1),pal5bit(data >> 6),pal5bit(data >> 11));
81      palette_set_color_rgb(machine,(0x8000 + (offset/2)),pal5bit(data >> 1),pal5bit(data >> 6),pal5bit(data >> 11));
8382}
8483
8584
src/mame/video/lastduel.c
r2454r2455
290290   /* Spriteram is always 1 frame ahead, suggesting buffering.  I can't find
291291        a register to control this so I assume it happens automatically
292292        every frame at the end of vblank */
293   buffer_spriteram16_w(machine,0,0,0);
293   buffer_spriteram16_w(machine,0,0,0xffff);
294294}
src/mame/video/alpha68k.c
r2454r2455
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98
109static tilemap *fix_tilemap;
1110static int bank_base,flipscreen;
r2454r2455
3837   g = ((newword >> 3) & 0x1e) | ((newword >> 13) & 0x01);
3938   b = ((newword << 1) & 0x1e) | ((newword >> 12) & 0x01);
4039
41   palette_set_color_rgb(Machine,offset,pal5bit(r),pal5bit(g),pal5bit(b));
40   palette_set_color_rgb(machine,offset,pal5bit(r),pal5bit(g),pal5bit(b));
4241}
4342
4443/******************************************************************************/
src/mame/video/cischeat.c
r2454r2455
5454***************************************************************************/
5555
5656#include "driver.h"
57#include "deprecat.h"
5857#include "megasys1.h"
5958
6059/* Variables only used here: */
r2454r2455
225224      case 0x0004/2 : return input_port_read_indexed(machine, 3);   // Motor Limit Switches
226225      case 0x0006/2 : return input_port_read_indexed(machine, 4);   // DSW 1 & 2
227226
228      case 0x0008/2 :   return soundlatch2_word_r(machine,0,0);   // From sound cpu
227      case 0x0008/2 :   return soundlatch2_word_r(machine,0,0xffff);   // From sound cpu
229228
230229      case 0x0010/2 :
231230         switch (cischeat_ip_select & 0x3)
r2454r2455
274273         break;
275274
276275      case 0x000a/2   :   // to sound cpu
277         soundlatch_word_w(machine,0,new_data,0);
276         soundlatch_word_w(machine,0,new_data,0xffff);
278277         break;
279278
280279      case 0x000c/2   :   break;   // ??
r2454r2455
298297      case 0x2208/2   : break;   // watchdog reset
299298
300299      /* Not sure about this one.. */
301      case 0x2308/2   :   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE );
302                     cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE );
303                     cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE );
300      case 0x2308/2   :   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE );
301                     cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE );
302                     cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE );
304303                     break;
305304
306305      default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data);
r2454r2455
386385      case 0x2208/2   : break;   // watchdog reset
387386
388387      case 0x2300/2   :   /* Sound CPU: reads latch during int 4, and stores command */
389                     soundlatch_word_w(machine,0,new_data,0);
388                     soundlatch_word_w(machine,0,new_data,0xffff);
390389                     cpunum_set_input_line(machine, 3,4,HOLD_LINE);
391390                     break;
392391
r2454r2455
505504      case 0x0014/2   :   break;
506505
507506      /* Usually written in sequence, but not always */
508      case 0x0008/2   :   soundlatch_word_w(machine,0,new_data,0);   break;
507      case 0x0008/2   :   soundlatch_word_w(machine,0,new_data,0xffff);   break;
509508      case 0x0018/2   :   cpunum_set_input_line(machine, 3,4,HOLD_LINE);   break;
510509
511510      case 0x0010/2   :   break;
r2454r2455
13501349#if 1
13511350   popmessage("Cmd: %04X Pos:%04X Lim:%04X Inp:%04X",
13521351                  scudhamm_motor_command,
1353                  scudhamm_motor_pos_r(screen->machine,0,0),
1354                  scudhamm_motor_status_r(screen->machine,0,0),
1355                  scudhamm_analog_r(screen->machine,0,0) );
1352                  scudhamm_motor_pos_r(screen->machine,0,0xffff),
1353                  scudhamm_motor_status_r(screen->machine,0,0xffff),
1354                  scudhamm_analog_r(screen->machine,0,0xffff) );
13561355#endif
13571356
13581357}
src/mame/video/namcos22.c
r2454r2455
22172217   dirtypal[offset&(0x7fff/4)] = 1;
22182218}
22192219
2220static void namcos22_reset(running_machine *machine)
2221{
2222   memset(&mSceneRoot, 0, sizeof(mSceneRoot));
2223   mpFreeSceneNode = NULL;
2224}
2225
22202226static void namcos22_exit(running_machine *machine)
22212227{
22222228   poly_free(poly);
r2454r2455
22432249#else
22442250   poly = poly_alloc(4000, sizeof(poly_extra_data), 0);
22452251#endif
2252   add_reset_callback(machine, namcos22_reset);
22462253   add_exit_callback(machine, namcos22_exit);
22472254}
22482255
src/mame/video/rockola.c
r2454r2455
126126      backcolor = data & 7;
127127
128128      for (i = 0;i < 32;i += 4)
129         palette_set_color(Machine, COLOR(1, i), palette[4 * backcolor + 0x20]);
129         palette_set_color(machine, COLOR(1, i), palette[4 * backcolor + 0x20]);
130130   }
131131
132132   /* bit 3 selects char bank */
r2454r2455
275275      backcolor = data & 0x03;
276276
277277      for (i = 0; i < 16; i += 4)
278         palette_set_color(Machine, COLOR(1, i), palette[backcolor + 0x10]);
278         palette_set_color(machine, COLOR(1, i), palette[backcolor + 0x10]);
279279   }
280280}
281281
src/mame/video/centiped.c
r2454r2455
55*************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "centiped.h"
109
1110
r2454r2455
235234
236235      /* character colors, set directly */
237236      if ((offset & 0x08) == 0)
238         palette_set_color(Machine, offset & 0x03, color);
237         palette_set_color(machine, offset & 0x03, color);
239238
240239      /* sprite colors - set all the applicable ones */
241240      else
r2454r2455
247246         for (i = 0; i < 0x100; i += 4)
248247         {
249248            if (offset == ((i >> 2) & 0x03))
250               palette_set_color(Machine, i + 4 + 1, color);
249               palette_set_color(machine, i + 4 + 1, color);
251250
252251            if (offset == ((i >> 4) & 0x03))
253               palette_set_color(Machine, i + 4 + 2, color);
252               palette_set_color(machine, i + 4 + 2, color);
254253
255254            if (offset == ((i >> 6) & 0x03))
256               palette_set_color(Machine, i + 4 + 3, color);
255               palette_set_color(machine, i + 4 + 3, color);
257256         }
258257      }
259258   }
r2454r2455
390389{
391390   paletteram[offset] = data;
392391
393   melliped_mazeinv_set_color(Machine, offset, data);
392   melliped_mazeinv_set_color(machine, offset, data);
394393}
395394
396395
r2454r2455
399398   paletteram[offset] = data;
400399
401400   /* the value passed in is a look-up index into the color PROM */
402   melliped_mazeinv_set_color(Machine, offset, ~memory_region(REGION_PROMS)[~data & 0x0f]);
401   melliped_mazeinv_set_color(machine, offset, ~memory_region(REGION_PROMS)[~data & 0x0f]);
403402}
404403
405404
src/mame/video/atarisy1.c
r2454r2455
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "machine/atarigen.h"
109#include "atarisy1.h"
1110
r2454r2455
249248   /* sound CPU reset */
250249   if (diff & 0x0080)
251250   {
252      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (newselect & 0x0080) ? CLEAR_LINE : ASSERT_LINE);
251      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (newselect & 0x0080) ? CLEAR_LINE : ASSERT_LINE);
253252      if (!(newselect & 0x0080)) atarigen_sound_reset();
254253   }
255254
r2454r2455
380379          ((offset & 0xc0) == 0x40 && (newword == 0xffff || oldword == 0xffff)))
381380      {
382381         /* if the timer is in the active bank, update the display list */
383         atarimo_0_spriteram_w(machine, offset, data, 0);
382         atarimo_0_spriteram_w(machine, offset, data, 0xffff);
384383         update_timers(machine, video_screen_get_vpos(machine->primary_screen));
385384      }
386385
r2454r2455
393392   }
394393
395394   /* let the MO handler do the basic work */
396   atarimo_0_spriteram_w(machine, offset, data, 0);
395   atarimo_0_spriteram_w(machine, offset, data, 0xffff);
397396}
398397
399398
r2454r2455
407406static TIMER_CALLBACK( int3off_callback )
408407{
409408   /* clear the state */
410   atarigen_scanline_int_ack_w(machine, 0, 0, 0);
409   atarigen_scanline_int_ack_w(machine, 0, 0, 0xffff);
411410}
412411
413412
src/mame/video/dec0.c
r2454r2455
611611   offset&=0xffe;
612612   myword=buffer[offset] + (buffer[offset+1]<<8);
613613
614   if (offset<0x10) dec0_pf3_control_0_w(machine,offset/2,myword,0);
615   else dec0_pf3_control_1_w(machine,(offset-0x10)/2,myword,0);
614   if (offset<0x10) dec0_pf3_control_0_w(machine,offset/2,myword,0xffff);
615   else dec0_pf3_control_1_w(machine,(offset-0x10)/2,myword,0xffff);
616616}
617617
618618WRITE8_HANDLER( dec0_pf3_data_8bit_w )
src/mame/video/ssv.c
r2454r2455
136136***************************************************************************/
137137
138138#include "driver.h"
139#include "deprecat.h"
140139#include "seta.h"
141140#ifdef MAME_DEBUG
142141#include "ui.h"
r2454r2455
400399   g = data1 >> 8;
401400   b = data1 & 0xff;
402401
403   palette_set_color(Machine, offset>>1, MAKE_RGB(r, g, b));
402   palette_set_color(machine, offset>>1, MAKE_RGB(r, g, b));
404403}
405404
406405/***************************************************************************
src/mame/video/metro.c
r2454r2455
5252***************************************************************************/
5353
5454#include "driver.h"
55#include "deprecat.h"
5655#include "video/konamiic.h"
5756
5857/* Variables that driver has access to: */
r2454r2455
130129{
131130   data = COMBINE_DATA(&paletteram16[offset]);
132131   /* We need the ^0xff because we had to invert the pens in the gfx */
133   palette_set_color_rgb(Machine,offset^0xff,pal5bit(data >> 6),pal5bit(data >> 11),pal5bit(data >> 1));
132   palette_set_color_rgb(machine,offset^0xff,pal5bit(data >> 6),pal5bit(data >> 11),pal5bit(data >> 1));
134133}
135134
136135
src/mame/video/angelkds.c
r2454r2455
77*/
88
99#include "driver.h"
10#include "deprecat.h"
1110
1211
1312static tilemap *tx_tilemap,*bgbot_tilemap ,*bgtop_tilemap;
r2454r2455
254253   paletteram[offset] = data;
255254
256255   no=offset & 0xff;
257   palette_set_color_rgb(Machine,no,pal4bit(paletteram[no]),pal4bit(paletteram[no]>>4),pal4bit(paletteram[no+0x100]));
256   palette_set_color_rgb(machine,no,pal4bit(paletteram[no]),pal4bit(paletteram[no]>>4),pal4bit(paletteram[no+0x100]));
258257}
259258
260259/*** Video Start & Update
src/mame/video/midvunit.c
r2454r2455
512512
513513   COMBINE_DATA(&paletteram32[offset]);
514514   newword = paletteram32[offset];
515   palette_set_color_rgb(Machine, offset, pal5bit(newword >> 10), pal5bit(newword >> 5), pal5bit(newword >> 0));
515   palette_set_color_rgb(machine, offset, pal5bit(newword >> 10), pal5bit(newword >> 5), pal5bit(newword >> 0));
516516}
517517
518518
src/mame/video/usgames.c
r2454r2455
11#include "driver.h"
2#include "deprecat.h"
32
43UINT8 *usgames_videoram,*usgames_charram;
54
r2454r2455
6362{
6463   usgames_charram[offset] = data;
6564
66   decodechar(Machine->gfx[0], offset/8, usgames_charram);
65   decodechar(machine->gfx[0], offset/8, usgames_charram);
6766
6867   tilemap_mark_all_tiles_dirty(usgames_tilemap);
6968}
src/mame/video/suna16.c
r2454r2455
5858***************************************************************************/
5959
6060#include "driver.h"
61#include "deprecat.h"
6261
6362static int color_bank;
6463
r2454r2455
105104{
106105   offset += color_bank * 256;
107106   data = COMBINE_DATA(&paletteram16[offset]);
108   palette_set_color_rgb( Machine, offset, pal5bit(data >> 0),pal5bit(data >> 5),pal5bit(data >> 10));
107   palette_set_color_rgb( machine, offset, pal5bit(data >> 0),pal5bit(data >> 5),pal5bit(data >> 10));
109108}
110109
111110
src/mame/video/eolith.c
r2454r2455
99{
1010   UINT32 *dest = &vram[offset+(0x40000/4)*eolith_buffer];
1111
12   if (mem_mask == 0)
12   if (mem_mask == 0xffffffff)
1313   {
1414      if (~data & 0x80000000)
1515         *dest = (*dest & 0x0000ffff) | (data & 0xffff0000);
r2454r2455
1717      if (~data & 0x00008000)
1818         *dest = (*dest & 0xffff0000) | (data & 0x0000ffff);
1919   }
20   else if (((mem_mask == 0x0000ffff) && (~data & 0x80000000)) ||
21           ((mem_mask == 0xffff0000) && (~data & 0x00008000)))
20   else if (((mem_mask == 0xffff0000) && (~data & 0x80000000)) ||
21           ((mem_mask == 0x0000ffff) && (~data & 0x00008000)))
2222      COMBINE_DATA(dest);
2323}
2424
src/mame/video/bigevglf.c
r2454r2455
66
77***************************************************************************/
88#include "driver.h"
9#include "deprecat.h"
109
1110
1211UINT8 *bigevglf_spriteram1;
r2454r2455
2726
2827   paletteram[offset] = data;
2928   color = paletteram[offset&0x3ff] | (paletteram[0x400+(offset&0x3ff)] << 8);
30   palette_set_color_rgb(Machine, offset&0x3ff, pal4bit(color >> 4), pal4bit(color >> 0), pal4bit(color >> 8));
29   palette_set_color_rgb(machine, offset&0x3ff, pal4bit(color >> 4), pal4bit(color >> 0), pal4bit(color >> 8));
3130}
3231
3332WRITE8_HANDLER( bigevglf_gfxcontrol_w )
src/mame/video/commando.c
r2454r2455
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110
1211UINT8 *commando_videoram2, *commando_colorram2;
1312
r2454r2455
6059   coin_counter_w(1, data & 0x02);
6160
6261   // bit 4 resets the sound CPU
63   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE);
62   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE);
6463
6564   // bit 7 flips screen
6665   flip_screen_set(data & 0x80);
src/mame/video/atarisy2.c
r2454r2455
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "machine/atarigen.h"
109#include "slapstic.h"
1110#include "atarisy2.h"
r2454r2455
241240   red = (color_table[(newword >> 12) & 15] * inten) >> 4;
242241   green = (color_table[(newword >> 8) & 15] * inten) >> 4;
243242   blue = (color_table[(newword >> 4) & 15] * inten) >> 4;
244   palette_set_color(Machine, offset, MAKE_RGB(red, green, blue));
243   palette_set_color(machine, offset, MAKE_RGB(red, green, blue));
245244}
246245
247246
src/mame/video/yunsung8.c
r2454r2455
2828***************************************************************************/
2929
3030#include "driver.h"
31#include "deprecat.h"
3231
3332/* Variables that driver has access to: */
3433
r2454r2455
8382      color = RAM[offset & ~1] | (RAM[offset | 1] << 8);
8483
8584      /* BBBBBGGGGGRRRRRx */
86      palette_set_color_rgb(Machine, offset/2 + (bank ? 0x400:0), pal5bit(color >> 0), pal5bit(color >> 5), pal5bit(color >> 10));
85      palette_set_color_rgb(machine, offset/2 + (bank ? 0x400:0), pal5bit(color >> 0), pal5bit(color >> 5), pal5bit(color >> 10));
8786   }
8887   else
8988   {
src/mame/video/jaguar.c
r2454r2455
733733   switch (offset)
734734   {
735735      case 0:
736         get_crosshair_xy(Machine, 1, &beamx, &beamy);
736         get_crosshair_xy(machine, 1, &beamx, &beamy);
737737         return (beamy << 16) | (beamx ^ 0x1ff);
738738
739739      case 1:
740         get_crosshair_xy(Machine, 0, &beamx, &beamy);
740         get_crosshair_xy(machine, 0, &beamx, &beamy);
741741         return (beamy << 16) | (beamx ^ 0x1ff);
742742
743743      case 2:
src/mame/video/ojankohs.c
r2454r2455
88******************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1211#include "cpu/z80/z80.h"
1312
1413
r2454r2455
7978         ((ojankohs_paletteram[offset + 1] & 0xe0) >> 5);
8079   b = (ojankohs_paletteram[offset + 1] & 0x1f) >> 0;
8180
82   palette_set_color_rgb(Machine,offset >> 1, pal5bit(r), pal5bit(g), pal5bit(b));
81   palette_set_color_rgb(machine,offset >> 1, pal5bit(r), pal5bit(g), pal5bit(b));
8382}
8483
8584WRITE8_HANDLER( ccasino_palette_w )
r2454r2455
9897         ((ojankohs_paletteram[offset + 1] & 0xe0) >> 5);
9998   b = (ojankohs_paletteram[offset + 1] & 0x1f) >> 0;
10099
101   palette_set_color_rgb(Machine,offset >> 1, pal5bit(r), pal5bit(g), pal5bit(b));
100   palette_set_color_rgb(machine,offset >> 1, pal5bit(r), pal5bit(g), pal5bit(b));
102101}
103102
104103WRITE8_HANDLER( ojankoc_palette_w )
r2454r2455
116115   g = (color >>  5) & 0x1f;
117116   b = (color >>  0) & 0x1f;
118117
119   palette_set_color_rgb(Machine,offset >> 1, pal5bit(r), pal5bit(g), pal5bit(b));
118   palette_set_color_rgb(machine,offset >> 1, pal5bit(r), pal5bit(g), pal5bit(b));
120119}
121120
122121
src/mame/video/bfm_adr2.c
r2454r2455
9191***************************************************************************/
9292
9393#include "driver.h"
94#include "deprecat.h"
9594#include "cpu/m6809/m6809.h"
9695#include "machine/bfm_bd1.h"  // vfd
9796#include "video/bfm_adr2.h"
r2454r2455
290289      r = ((data & 0x18)>>3) *  85;  // 00011000b = 0x18
291290      g = ((data & 0x06)>>1) *  85;  // 00000110b = 0x06
292291      b = ((data & 0x01)   ) * 255;
293      palette_set_color(Machine, pal, MAKE_RGB(r,g,b));
292      palette_set_color(machine, pal, MAKE_RGB(r,g,b));
294293   }
295294
296295   if ( adder2_screen_page_reg & SL_ACCESS )
src/mame/video/nbmj8891.c
r2454r2455
5757   g = ((nbmj8891_palette[offset + 1] & 0xf0) >> 4);
5858   b = ((nbmj8891_palette[offset + 1] & 0x0f) >> 0);
5959
60   palette_set_color_rgb(Machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
60   palette_set_color_rgb(machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
6161}
6262
6363READ8_HANDLER( nbmj8891_palette_type2_r )
r2454r2455
7979   g = ((nbmj8891_palette[offset + 0x000] & 0xf0) >> 4);
8080   b = ((nbmj8891_palette[offset + 0x100] & 0x0f) >> 0);
8181
82   palette_set_color_rgb(Machine, (offset & 0x0ff), pal4bit(r), pal4bit(g), pal4bit(b));
82   palette_set_color_rgb(machine, (offset & 0x0ff), pal4bit(r), pal4bit(g), pal4bit(b));
8383}
8484
8585READ8_HANDLER( nbmj8891_palette_type3_r )
r2454r2455
101101   g = ((nbmj8891_palette[offset + 0] & 0xf0) >> 4);
102102   b = ((nbmj8891_palette[offset + 0] & 0x0f) >> 0);
103103
104   palette_set_color_rgb(Machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
104   palette_set_color_rgb(machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
105105}
106106
107107WRITE8_HANDLER( nbmj8891_clutsel_w )
src/mame/video/liberate.c
r2454r2455
1010*******************************************************************************/
1111
1212#include "driver.h"
13#include "deprecat.h"
1413#include "cpu/m6502/m6502.h"
1514
1615static int background_color,background_disable;
src/mame/video/turbo.c
r2454r2455
55*************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "turbo.h"
109#include "video/resnet.h"
1110
r2454r2455
205204
206205WRITE8_HANDLER( turbo_videoram_w )
207206{
208   turbo_state *state = Machine->driver_data;
207   turbo_state *state = machine->driver_data;
209208   state->videoram[offset] = data;
210209   if (offset < 0x400)
211210   {
r2454r2455
217216
218217WRITE8_HANDLER( buckrog_bitmap_w )
219218{
220   turbo_state *state = Machine->driver_data;
219   turbo_state *state = machine->driver_data;
221220   state->buckrog_bitmap_ram[offset] = data & 1;
222221}
223222
src/mame/video/nemesis.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98
109UINT16 *nemesis_videoram1b;
1110UINT16 *nemesis_videoram2b;
r2454r2455
9493   else
9594   {
9695      if (data & 0x100)
97         cpunum_set_input_line_and_vector(Machine, 1, 0, HOLD_LINE, 0xff);
96         cpunum_set_input_line_and_vector(machine, 1, 0, HOLD_LINE, 0xff);
9897   }
9998}
10099
r2454r2455
149148   bit5=(data >>  14)&1;
150149   b = MULTIPLIER;
151150
152   palette_set_color(Machine,offset,MAKE_RGB(r,g,b));
151   palette_set_color(machine,offset,MAKE_RGB(r,g,b));
153152}
154153
155154WRITE16_HANDLER( salamander_palette_word_w )
r2454r2455
158157   offset &= ~1;
159158
160159   data = ((paletteram16[offset] << 8) & 0xff00) | (paletteram16[offset+1] & 0xff);
161   palette_set_color_rgb(Machine,offset / 2,pal5bit(data >> 0),pal5bit(data >> 5),pal5bit(data >> 10));
160   palette_set_color_rgb(machine,offset / 2,pal5bit(data >> 0),pal5bit(data >> 5),pal5bit(data >> 10));
162161}
163162
164163WRITE16_HANDLER( nemesis_videoram1b_word_w )
src/mame/video/deco16ic.c
r2454r2455
195195   g = (paletteram16[offset+1] >> 8) & 0xff;
196196   r = (paletteram16[offset+1] >> 0) & 0xff;
197197
198   palette_set_color(Machine,offset/2,MAKE_RGB(r,g,b));
198   palette_set_color(machine,offset/2,MAKE_RGB(r,g,b));
199199}
200200
201201WRITE16_HANDLER( deco16_buffered_palette_w )
r2454r2455
206206
207207WRITE16_HANDLER( deco16_palette_dma_w )
208208{
209   const int m=Machine->config->total_colors;
209   const int m=machine->config->total_colors;
210210   int r,g,b,i;
211211
212212   for (i=0; i<m; i++) {
r2454r2455
217217         g = (paletteram16[i*2+1] >> 8) & 0xff;
218218         r = (paletteram16[i*2+1] >> 0) & 0xff;
219219
220         palette_set_color(Machine,i,MAKE_RGB(r,g,b));
220         palette_set_color(machine,i,MAKE_RGB(r,g,b));
221221      }
222222   }
223223}
src/mame/video/1942.c
r2454r2455
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110
1211
1312UINT8 *c1942_fgvideoram;
r2454r2455
186185
187186   coin_counter_w(0,data & 0x01);
188187
189   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE);
188   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE);
190189
191190   flip_screen_set(data & 0x80);
192191}
src/mame/video/fromanc2.c
r2454r2455
77******************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110
1211static int fromanc2_scrollx[2][4], fromanc2_scrolly[2][4];
1312static int fromanc2_gfxbank[2][4];
r2454r2455
8382
8483   // GGGG_GRRR_RRBB_BBBx
8584   color = ((offset & 0x0700) << 1) + (offset & 0x00ff);
86   palette_set_color_rgb(Machine, 0x000 + color, pal5bit(data >> 6), pal5bit(data >> 11), pal5bit(data >> 1));
85   palette_set_color_rgb(machine, 0x000 + color, pal5bit(data >> 6), pal5bit(data >> 11), pal5bit(data >> 1));
8786}
8887
8988WRITE16_HANDLER( fromanc2_paletteram_1_w )
r2454r2455
9493
9594   // GGGG_GRRR_RRBB_BBBx
9695   color = ((offset & 0x0700) << 1) + (offset & 0x00ff);
97   palette_set_color_rgb(Machine, 0x100 + color, pal5bit(data >> 6), pal5bit(data >> 11), pal5bit(data >> 1));
96   palette_set_color_rgb(machine, 0x100 + color, pal5bit(data >> 6), pal5bit(data >> 11), pal5bit(data >> 1));
9897}
9998
10099
r2454r2455
116115
117116   // xGGG_GGRR_RRRB_BBBB
118117   color = ((offset & 0x0700) << 1) + (offset & 0x00ff);
119   palette_set_color_rgb(Machine, 0x000 + color, pal5bit(data >> 5), pal5bit(data >> 10), pal5bit(data >> 0));
118   palette_set_color_rgb(machine, 0x000 + color, pal5bit(data >> 5), pal5bit(data >> 10), pal5bit(data >> 0));
120119}
121120
122121WRITE16_HANDLER( fromancr_paletteram_1_w )
r2454r2455
127126
128127   // xGGG_GGRR_RRRB_BBBB
129128   color = ((offset & 0x0700) << 1) + (offset & 0x00ff);
130   palette_set_color_rgb(Machine, 0x100 + color, pal5bit(data >> 5), pal5bit(data >> 10), pal5bit(data >> 0));
129   palette_set_color_rgb(machine, 0x100 + color, pal5bit(data >> 5), pal5bit(data >> 10), pal5bit(data >> 0));
131130}
132131
133132
r2454r2455
149148
150149   // xRRR_RRGG_GGGB_BBBB
151150   color = ((offset & 0x0700) << 1) + (offset & 0x00ff);
152   palette_set_color_rgb(Machine, 0x000 + color, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
151   palette_set_color_rgb(machine, 0x000 + color, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
153152}
154153
155154WRITE16_HANDLER( fromanc4_paletteram_1_w )
r2454r2455
160159
161160   // xRRR_RRGG_GGGB_BBBB
162161   color = ((offset & 0x0700) << 1) + (offset & 0x00ff);
163   palette_set_color_rgb(Machine, 0x100 + color, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
162   palette_set_color_rgb(machine, 0x100 + color, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
164163}
165164
166165
src/mame/video/unico.c
r2454r2455
3737***************************************************************************/
3838
3939#include "driver.h"
40#include "deprecat.h"
4140#include "unico.h"
4241
4342/* Variables needed by drivers: */
r2454r2455
6564   COMBINE_DATA(&paletteram16[offset]);
6665   data1 = paletteram16[offset & ~1];
6766   data2 = paletteram16[offset |  1];
68   palette_set_color_rgb( Machine,offset/2,
67   palette_set_color_rgb( machine,offset/2,
6968       (data1 >> 8) & 0xFC,
7069       (data1 >> 0) & 0xFC,
7170       (data2 >> 8) & 0xFC   );
r2454r2455
7473WRITE32_HANDLER( unico_palette32_w )
7574{
7675   UINT32 rgb0 = COMBINE_DATA(&paletteram32[offset]);
77   palette_set_color_rgb( Machine,offset,
76   palette_set_color_rgb( machine,offset,
7877       (rgb0 >> 24) & 0xFC,
7978       (rgb0 >> 16) & 0xFC,
8079       (rgb0 >>  8) & 0xFC   );
src/mame/video/carjmbre.c
r2454r2455
44*/
55
66#include "driver.h"
7#include "deprecat.h"
87
98static tilemap *carjmbre_tilemap;
109
r2454r2455
5655   if(oldbg!=carjmbre_bgcolor)
5756   {
5857      for (i=0;i<64;i+=4)
59         palette_set_color_rgb(Machine, i, (carjmbre_bgcolor&0xff)*0x50, (carjmbre_bgcolor&0xff)*0x50, (carjmbre_bgcolor&0xff)!=0?0x50:0);
58         palette_set_color_rgb(machine, i, (carjmbre_bgcolor&0xff)*0x50, (carjmbre_bgcolor&0xff)*0x50, (carjmbre_bgcolor&0xff)!=0?0x50:0);
6059   }
6160}
6261
src/mame/video/battlera.c
r2454r2455
5454   if (offset%2) offset-=1;
5555
5656   pal_word=paletteram[offset] | (paletteram[offset+1]<<8);
57   palette_set_color_rgb(Machine, offset/2, pal3bit(pal_word >> 3), pal3bit(pal_word >> 6), pal3bit(pal_word >> 0));
57   palette_set_color_rgb(machine, offset/2, pal3bit(pal_word >> 3), pal3bit(pal_word >> 6), pal3bit(pal_word >> 0));
5858}
5959
6060/******************************************************************************/
src/mame/video/namcos1.c
r2454r2455
55*******************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98
109
1110/*
r2454r2455
197196      r = namcos1_paletteram[offset];
198197      g = namcos1_paletteram[offset + 0x0800];
199198      b = namcos1_paletteram[offset + 0x1000];
200      palette_set_color(Machine,color,MAKE_RGB(r,g,b));
199      palette_set_color(machine,color,MAKE_RGB(r,g,b));
201200   }
202201   else
203202   {
src/mame/video/gundealr.c
r2454r2455
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110
1211
1312
r2454r2455
101100   b = (val >> 4) & 0x0f;
102101   /* TODO: the bottom 4 bits are used as well, but I'm not sure about the meaning */
103102
104   palette_set_color_rgb(Machine,offset / 2,pal4bit(r),pal4bit(g),pal4bit(b));
103   palette_set_color_rgb(machine,offset / 2,pal4bit(r),pal4bit(g),pal4bit(b));
105104}
106105
107106WRITE8_HANDLER( gundealr_fg_scroll_w )
src/mame/video/m62.c
r2454r2455
2828static INT32 m62_background_hscroll;
2929static INT32 m62_background_vscroll;
3030
31static int ldrun3_topbottom_mask;
32
3133static UINT8 *irem_textram;
3234static size_t irem_textram_size;
3335
r2454r2455
406408   m62_background_hscroll = 0;
407409   m62_background_vscroll = 0;
408410
409   tilemap_set_transmask(m62_background,0,0xffff,0x0000);   /* split type 0 is totally transparent in front half */
410   tilemap_set_transmask(m62_background,1,0x0001,0xfffe);   /* split type 1 has pen 0 transparent in front half */
411
412411   register_savestate();
413412
414413   if( rows != 0 )
r2454r2455
458457   /* is the following right? */
459458   if( ( tile_index / 64 ) < 6 || ( ( color & 0x1f ) >> 1 ) > 0x0c )
460459   {
461      tileinfo->group = 1;
460      tileinfo->category = 1;
462461   }
463462   else
464463   {
465      tileinfo->group = 0;
464      tileinfo->category = 0;
466465   }
467466}
468467
468VIDEO_START( kungfum )
469{
470   m62_start( get_kungfum_bg_tile_info, 32, 0, 8, 8, 64, 32 );
471}
472
469473VIDEO_UPDATE( kungfum )
470474{
471475   int i;
r2454r2455
477481   {
478482      tilemap_set_scrollx( m62_background, i, m62_background_hscroll );
479483   }
480   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_LAYER1, 0 );
484   tilemap_draw( bitmap, cliprect, m62_background, 0, 0 );
481485   draw_sprites( screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00 );
482   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_LAYER0, 0 );
486   tilemap_draw( bitmap, cliprect, m62_background, 1, 0 );
483487   return 0;
484488}
485489
486VIDEO_START( kungfum )
487{
488   m62_start( get_kungfum_bg_tile_info, 32, 0, 8, 8, 64, 32 );
489}
490490
491491
492492static TILE_GET_INFO( get_ldrun_bg_tile_info )
r2454r2455
512512   }
513513}
514514
515VIDEO_START( ldrun )
516{
517   m62_start( get_ldrun_bg_tile_info, 1, 1, 8, 8, 64, 32 );
518   tilemap_set_transmask(m62_background,0,0xffff,0x0000);   /* split type 0 is totally transparent in front half */
519   tilemap_set_transmask(m62_background,1,0x0001,0xfffe);   /* split type 1 has pen 0 transparent in front half */
520}
521
515522VIDEO_UPDATE( ldrun )
516523{
517524   tilemap_set_scrollx( m62_background, 0, m62_background_hscroll );
r2454r2455
524531   return 0;
525532}
526533
527VIDEO_START( ldrun )
528{
529   m62_start( get_ldrun_bg_tile_info, 1, 1, 8, 8, 64, 32 );
530}
531
532534static TILE_GET_INFO( get_ldrun2_bg_tile_info )
533535{
534536   int code;
r2454r2455
555557VIDEO_START( ldrun2 )
556558{
557559   m62_start( get_ldrun2_bg_tile_info, 1, 1, 8, 8, 64, 32 );
560   tilemap_set_transmask(m62_background,0,0xffff,0x0000);   /* split type 0 is totally transparent in front half */
561   tilemap_set_transmask(m62_background,1,0x0001,0xfffe);   /* split type 1 has pen 0 transparent in front half */
558562}
559563
564
565
566WRITE8_HANDLER( ldrun3_topbottom_mask_w )
567{
568   ldrun3_topbottom_mask = data & 1;
569}
570
571VIDEO_UPDATE( ldrun3 )
572{
573   VIDEO_UPDATE_CALL(ldrun);
574
575   if (ldrun3_topbottom_mask)
576   {
577      rectangle my_cliprect = *cliprect;
578
579      my_cliprect.min_y = 0*8;
580      my_cliprect.max_y = 1*8-1;
581      fillbitmap(bitmap,get_black_pen(screen->machine),&my_cliprect);
582
583      my_cliprect.min_y = 31*8;
584      my_cliprect.max_y = 32*8-1;
585      fillbitmap(bitmap,get_black_pen(screen->machine),&my_cliprect);
586   }
587
588   return 0;
589}
590
591
560592static TILE_GET_INFO( get_battroad_bg_tile_info )
561593{
562594   int code;
r2454r2455
589621   SET_TILE_INFO( 2, code | ( ( color & 0x40 ) << 3 ) | ( ( color & 0x10 ) << 4 ), color & 0x0f, 0 );
590622}
591623
624VIDEO_START( battroad )
625{
626   m62_start( get_battroad_bg_tile_info, 1, 1, 8, 8, 64, 32 );
627   m62_textlayer( get_battroad_fg_tile_info, 1, 1, 8, 8, 32, 32 );
628   tilemap_set_transmask(m62_background,0,0xffff,0x0000);   /* split type 0 is totally transparent in front half */
629   tilemap_set_transmask(m62_background,1,0x0001,0xfffe);   /* split type 1 has pen 0 transparent in front half */
630}
631
592632VIDEO_UPDATE( battroad )
593633{
594634   tilemap_set_scrollx( m62_background, 0, m62_background_hscroll );
r2454r2455
605645   return 0;
606646}
607647
608VIDEO_START( battroad )
609{
610   m62_start( get_battroad_bg_tile_info, 1, 1, 8, 8, 64, 32 );
611   m62_textlayer( get_battroad_fg_tile_info, 1, 1, 8, 8, 32, 32 );
612}
613648
614
615649/* almost identical but scrolling background, more characters, */
616650/* no char x flip, and more sprites */
617651static TILE_GET_INFO( get_ldrun4_bg_tile_info )
r2454r2455
623657   SET_TILE_INFO( 0, code | ( ( color & 0xc0 ) << 2 ) | ( ( color & 0x20 ) << 5 ), color & 0x1f, 0 );
624658}
625659
660VIDEO_START( ldrun4 )
661{
662   m62_start( get_ldrun4_bg_tile_info, 1, 0, 8, 8, 64, 32 );
663}
664
626665VIDEO_UPDATE( ldrun4 )
627666{
628667   tilemap_set_scrollx( m62_background, 0, m62_background_hscroll );
629668
630   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_OPAQUE, 0 );
669   tilemap_draw( bitmap, cliprect, m62_background, 0, 0 );
631670   draw_sprites( screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00 );
632671   return 0;
633672}
634673
635VIDEO_START( ldrun4 )
636{
637   m62_start( get_ldrun4_bg_tile_info, 1, 0, 8, 8, 64, 32 );
638}
639674
640
641675static TILE_GET_INFO( get_lotlot_bg_tile_info )
642676{
643677   int code;
r2454r2455
662696   SET_TILE_INFO( 2, code | ( ( color & 0xc0 ) << 2 ), color & 0x1f, 0 );
663697}
664698
699VIDEO_START( lotlot )
700{
701   m62_start( get_lotlot_bg_tile_info, 1, 1, 12, 10, 32, 64 );
702   m62_textlayer( get_lotlot_fg_tile_info, 1, 1, 12, 10, 32, 64 );
703}
704
665705VIDEO_UPDATE( lotlot )
666706{
667707   tilemap_set_scrollx( m62_background, 0, m62_background_hscroll - 64 );
r2454r2455
670710   tilemap_set_scrolly( m62_foreground, 0, 32 );
671711   tilemap_set_transparent_pen( m62_foreground, 0 );
672712
673   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_OPAQUE, 0 );
713   tilemap_draw( bitmap, cliprect, m62_background, 0, 0 );
674714   tilemap_draw( bitmap, cliprect, m62_foreground, 0, 0 );
675715   draw_sprites( screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00 );
676716   return 0;
677717}
678718
679VIDEO_START( lotlot )
680{
681   m62_start( get_lotlot_bg_tile_info, 1, 1, 12, 10, 32, 64 );
682   m62_textlayer( get_lotlot_fg_tile_info, 1, 1, 12, 10, 32, 64 );
683}
684719
685
686720WRITE8_HANDLER( kidniki_text_vscroll_low_w )
687721{
688722   kidniki_text_vscroll = (kidniki_text_vscroll & 0xff00) | data;
r2454r2455
721755   SET_TILE_INFO( 2, code | ( ( color & 0xc0 ) << 2 ), color & 0x1f, 0 );
722756}
723757
724VIDEO_UPDATE( kidniki )
725{
726   tilemap_set_scrollx( m62_background, 0, m62_background_hscroll );
727   tilemap_set_scrollx( m62_foreground, 0, -64 );
728   tilemap_set_scrolly( m62_foreground, 0, kidniki_text_vscroll + 128 );
729   tilemap_set_transparent_pen( m62_foreground, 0 );
730
731   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_LAYER1, 0 );
732   draw_sprites( screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00 );
733   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_LAYER0, 0 );
734   tilemap_draw( bitmap, cliprect, m62_foreground, 0, 0 );
735   return 0;
736}
737
738758VIDEO_START( kidniki )
739759{
740760   m62_background = tilemap_create( get_kidniki_bg_tile_info, tilemap_scan_rows,  8, 8, 64, 32 );
r2454r2455
750770   m62_textlayer( get_kidniki_fg_tile_info, 1, 1, 12, 8, 32, 64 );
751771}
752772
773VIDEO_UPDATE( kidniki )
774{
775   tilemap_set_scrollx( m62_background, 0, m62_background_hscroll );
776   tilemap_set_scrollx( m62_foreground, 0, -64 );
777   tilemap_set_scrolly( m62_foreground, 0, kidniki_text_vscroll + 128 );
778   tilemap_set_transparent_pen( m62_foreground, 0 );
753779
780   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_LAYER1, 0 );
781   draw_sprites( screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00 );
782   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_LAYER0, 0 );
783   tilemap_draw( bitmap, cliprect, m62_foreground, 0, 0 );
784   return 0;
785}
786
787
754788WRITE8_HANDLER( spelunkr_palbank_w )
755789{
756790   if (spelunkr_palbank != (data & 0x01))
r2454r2455
780814   SET_TILE_INFO( 2, code | ( ( color & 0x10 ) << 4 ), ( color & 0x0f ) | ( spelunkr_palbank << 4 ), 0 );
781815}
782816
817VIDEO_START( spelunkr )
818{
819   m62_start( get_spelunkr_bg_tile_info, 1, 1, 8, 8, 64, 64 );
820   m62_textlayer( get_spelunkr_fg_tile_info, 1, 1, 12, 8, 32, 32 );
821}
822
783823VIDEO_UPDATE( spelunkr )
784824{
785825   tilemap_set_scrollx( m62_background, 0, m62_background_hscroll );
r2454r2455
788828   tilemap_set_scrolly( m62_foreground, 0, 0 );
789829   tilemap_set_transparent_pen( m62_foreground, 0 );
790830
791   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_OPAQUE, 0 );
831   tilemap_draw( bitmap, cliprect, m62_background, 0, 0 );
792832   draw_sprites( screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00 );
793833   tilemap_draw( bitmap, cliprect, m62_foreground, 0, 0 );
794834   return 0;
795835}
796836
797VIDEO_START( spelunkr )
798{
799   m62_start( get_spelunkr_bg_tile_info, 1, 1, 8, 8, 64, 64 );
800   m62_textlayer( get_spelunkr_fg_tile_info, 1, 1, 12, 8, 32, 32 );
801}
802837
803
804838WRITE8_HANDLER( spelunk2_gfxport_w )
805839{
806840   m62_hscroll_high_w(machine,0,(data&2)>>1);
r2454r2455
822856   SET_TILE_INFO( 0, code | ( ( color & 0xf0 ) << 4 ), ( color & 0x0f ) | ( spelunkr_palbank << 4 ), 0 );
823857}
824858
859VIDEO_START( spelunk2 )
860{
861   m62_start( get_spelunk2_bg_tile_info, 1, 1, 8, 8, 64, 64 );
862   m62_textlayer( get_spelunkr_fg_tile_info, 1, 1, 12, 8, 32, 32 );
863}
864
825865VIDEO_UPDATE( spelunk2 )
826866{
827867   tilemap_set_scrollx( m62_background, 0, m62_background_hscroll - 1);
r2454r2455
830870   tilemap_set_scrolly( m62_foreground, 0, 0 );
831871   tilemap_set_transparent_pen( m62_foreground, 0 );
832872
833   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_OPAQUE, 0 );
873   tilemap_draw( bitmap, cliprect, m62_background, 0, 0 );
834874   draw_sprites( screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00 );
835875   tilemap_draw( bitmap, cliprect, m62_foreground, 0, 0 );
836876   return 0;
837877}
838878
839VIDEO_START( spelunk2 )
840{
841   m62_start( get_spelunk2_bg_tile_info, 1, 1, 8, 8, 64, 64 );
842   m62_textlayer( get_spelunkr_fg_tile_info, 1, 1, 12, 8, 32, 32 );
843}
844879
845
846880static TILE_GET_INFO( get_youjyudn_bg_tile_info )
847881{
848882   int code;
r2454r2455
869903   SET_TILE_INFO( 2, code | ( ( color & 0xc0 ) << 2 ), ( color & 0x0f ), 0 );
870904}
871905
906VIDEO_START( youjyudn )
907{
908   m62_start( get_youjyudn_bg_tile_info, 1, 0, 8, 16, 64, 16 );
909   m62_textlayer( get_youjyudn_fg_tile_info, 1, 1, 12, 8, 32, 32 );
910   tilemap_set_transmask(m62_background,0,0xffff,0x0000);   /* split type 0 is totally transparent in front half */
911   tilemap_set_transmask(m62_background,1,0x0001,0xfffe);   /* split type 1 has pen 0 transparent in front half */
912}
913
872914VIDEO_UPDATE( youjyudn )
873915{
874916   tilemap_set_scrollx( m62_background, 0, m62_background_hscroll );
r2454r2455
883925   return 0;
884926}
885927
886VIDEO_START( youjyudn )
887{
888   m62_start( get_youjyudn_bg_tile_info, 1, 0, 8, 16, 64, 16 );
889   m62_textlayer( get_youjyudn_fg_tile_info, 1, 1, 12, 8, 32, 32 );
890}
891928
892
893929WRITE8_HANDLER( horizon_scrollram_w )
894930{
895931   horizon_scrollram[ offset ] = data;
r2454r2455
912948   }
913949}
914950
951VIDEO_START( horizon )
952{
953   m62_start( get_horizon_bg_tile_info, 32, 0, 8, 8, 64, 32 );
954   tilemap_set_transmask(m62_background,0,0xffff,0x0000);   /* split type 0 is totally transparent in front half */
955   tilemap_set_transmask(m62_background,1,0x0001,0xfffe);   /* split type 1 has pen 0 transparent in front half */
956}
957
915958VIDEO_UPDATE( horizon )
916959{
917960   int i;
r2454r2455
924967   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_LAYER0, 0 );
925968   return 0;
926969}
927
928VIDEO_START( horizon )
929{
930   m62_start( get_horizon_bg_tile_info, 32, 0, 8, 8, 64, 32 );
931}
src/mame/video/toki.c
r2454r2455
3838
3939VIDEO_EOF( toki )
4040{
41   buffer_spriteram16_w(machine,0,0,0);
41   buffer_spriteram16_w(machine,0,0,0xffff);
4242}
4343
4444VIDEO_EOF( tokib )
4545{
46   buffer_spriteram16_w(machine,0,0,0);
46   buffer_spriteram16_w(machine,0,0,0xffff);
4747}
4848
4949static TILE_GET_INFO( get_text_tile_info )
src/mame/video/ginganin.c
r2454r2455
5858**************************************************************************/
5959
6060#include "driver.h"
61#include "deprecat.h"
6261
6362/* Variables only used here */
6463static tilemap *bg_tilemap, *fg_tilemap, *tx_tilemap;
r2454r2455
182181      break;
183182   case 7:
184183      soundlatch_w(machine,0,data);
185      cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
184      cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
186185      break;
187186   default:
188187      logerror("CPU #0 PC %06X : Warning, videoreg %04X <- %04X\n",activecpu_get_pc(),offset,data);
src/mame/video/popper.c
r2454r2455
44*/
55
66#include "driver.h"
7#include "deprecat.h"
7#include "video/resnet.h"
88
99static tilemap *popper_p123_tilemap, *popper_p0_tilemap, *popper_ol_p123_tilemap, *popper_ol_p0_tilemap;
1010UINT8 *popper_videoram, *popper_attribram, *popper_ol_videoram, *popper_ol_attribram, *popper_spriteram;
r2454r2455
1212static INT32 popper_flipscreen, popper_e002, popper_gfx_bank;
1313static rectangle tilemap_clip;
1414
15PALETTE_INIT( popper )
15
16/***************************************************************************
17 *
18 * Color guns - from schematics
19 *
20 ***************************************************************************/
21
22static const res_net_decode_info popper_decode_info =
1623{
17   int i;
24   1,      // there may be two proms needed to construct color
25   0,      // start at 0
26   63,   // end at 255
27   //  R,   G,   B,
28   {   0,   0,   0, },      // offsets
29   {   0,   3,   6, },      // shifts
30   {0x07,0x07,0x03, }       // masks
31};
1832
19   for (i = 0;i < machine->config->total_colors; i++)
33static const res_net_info popper_net_info =
34{
35   RES_NET_VCC_5V | RES_NET_VBIAS_5V | RES_NET_VIN_TTL_OUT,
2036   {
21      int bit0,bit1,bit2,r,g,b;
37      { RES_NET_AMP_NONE, 0, 0, 3, { 1000, 470, 220 } },
38      { RES_NET_AMP_NONE, 0, 0, 3, { 1000, 470, 220 } },
39      { RES_NET_AMP_NONE, 0, 0, 2, {  470, 220,   0 } }
40   }
41};
2242
23      /* red component */
24      bit0 = (*color_prom >> 0) & 0x01;
25      bit1 = (*color_prom >> 1) & 0x01;
26      bit2 = (*color_prom >> 2) & 0x01;
27      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
28      /* green component */
29      bit0 = (*color_prom >> 3) & 0x01;
30      bit1 = (*color_prom >> 4) & 0x01;
31      bit2 = (*color_prom >> 5) & 0x01;
32      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
33      /* blue component */
34      bit1 = (*color_prom >> 6) & 0x01;
35      bit2 = (*color_prom >> 7) & 0x01;
36      b = 0x97 * bit1 + 0x68 * bit2;
37      palette_set_color(machine,i,MAKE_RGB(r,g,b));
38      color_prom++;
39   }
43/***************************************************************************
44 *
45 * PALETTE_INIT
46 *
47 ***************************************************************************/
48
49PALETTE_INIT( popper )
50{
51   rgb_t   *rgb;
52
53   rgb = compute_res_net_all(color_prom, &popper_decode_info, &popper_net_info);
54   palette_set_colors(machine, 0, rgb, 64);
55   palette_normalize_range(machine->palette, 0, 63, 0, 255);
56   free(rgb);
4057}
4158
4259WRITE8_HANDLER( popper_ol_videoram_w )
src/mame/video/djboy.c
r2454r2455
44 * video hardware for DJ Boy
55 */
66#include "driver.h"
7#include "deprecat.h"
87#include "kan_pand.h"
98
109static UINT8 djboy_videoreg, djboy_scrollx, djboy_scrolly;
r2454r2455
5756   offset &= ~1;
5857   val = (paletteram[offset]<<8) | paletteram[offset+1];
5958
60   palette_set_color_rgb(Machine,offset/2,pal4bit(val >> 8),pal4bit(val >> 4),pal4bit(val >> 0));
59   palette_set_color_rgb(machine,offset/2,pal4bit(val >> 8),pal4bit(val >> 4),pal4bit(val >> 0));
6160}
6261
6362VIDEO_UPDATE( djboy )
src/mame/video/sidearms.c
r2454r2455
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110
1211extern int sidearms_gameid;
1312
r2454r2455
5352   /* bit 4 resets the sound CPU */
5453   if (data & 0x10)
5554   {
56      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE);
55      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, PULSE_LINE);
5756   }
5857
5958   /* bit 5 enables starfield */
src/mame/video/vigilant.c
r2454r2455
1515***************************************************************************/
1616
1717#include "driver.h"
18#include "deprecat.h"
1918
2019
2120static const rectangle bottomvisiblearea =
r2454r2455
110109   g = (paletteram[bank + offset + 0x100] << 3) & 0xFF;
111110   b = (paletteram[bank + offset + 0x200] << 3) & 0xFF;
112111
113   palette_set_color(Machine, (bank >> 2) + offset,MAKE_RGB(r,g,b));
112   palette_set_color(machine, (bank >> 2) + offset,MAKE_RGB(r,g,b));
114113}
115114
116115
src/mame/video/nbmj8991.c
r2454r2455
5151   g = ((paletteram[offset + 1] & 0xf0) >> 4);
5252   b = ((paletteram[offset + 1] & 0x0f) >> 0);
5353
54   palette_set_color_rgb(Machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
54   palette_set_color_rgb(machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
5555}
5656
5757WRITE8_HANDLER( nbmj8991_palette_type2_w )
r2454r2455
6868   g = (((paletteram[offset + 0] & 0x03) << 3) | ((paletteram[offset + 1] & 0xe0) >> 5));
6969   b = ((paletteram[offset + 1] & 0x1f) >> 0);
7070
71   palette_set_color_rgb(Machine, (offset / 2), pal5bit(r), pal5bit(g), pal5bit(b));
71   palette_set_color_rgb(machine, (offset / 2), pal5bit(r), pal5bit(g), pal5bit(b));
7272}
7373
7474WRITE8_HANDLER( nbmj8991_palette_type3_w )
r2454r2455
8585   g = ((paletteram[offset + 0] & 0xf0) >> 4);
8686   b = ((paletteram[offset + 0] & 0x0f) >> 0);
8787
88   palette_set_color_rgb(Machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
88   palette_set_color_rgb(machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
8989}
9090
9191/******************************************************************************
src/mame/video/exidy440.c
r2454r2455
138138      word = (local_paletteram[offset] << 8) + local_paletteram[offset + 1];
139139
140140      /* extract the 5-5-5 RGB colors */
141      palette_set_color_rgb(Machine, offset / 2, pal5bit(word >> 10), pal5bit(word >> 5), pal5bit(word >> 0));
141      palette_set_color_rgb(machine, offset / 2, pal5bit(word >> 10), pal5bit(word >> 5), pal5bit(word >> 0));
142142   }
143143}
144144
r2454r2455
221221      {
222222         /* extract a word and the 5-5-5 RGB components */
223223         int word = (local_paletteram[offset] << 8) + local_paletteram[offset + 1];
224         palette_set_color_rgb(Machine, i, pal5bit(word >> 10), pal5bit(word >> 5), pal5bit(word >> 0));
224         palette_set_color_rgb(machine, i, pal5bit(word >> 10), pal5bit(word >> 5), pal5bit(word >> 0));
225225      }
226226   }
227227}
src/mame/video/tx1.c
r2454r2455
44
55****************************************************************************/
66#include "driver.h"
7#include "deprecat.h"
87#include "profiler.h"
98#include "render.h"
109#include "cpu/i86/i86.h"
r2454r2455
15771576      }
15781577      case 0xe0:
15791578      {
1580         cpunum_set_input_line(Machine, 1, INPUT_LINE_TEST, CLEAR_LINE);
1579         cpunum_set_input_line(machine, 1, INPUT_LINE_TEST, CLEAR_LINE);
15811580         vregs.flags = data;
15821581         break;
15831582      }
src/mame/video/blstroid.c
r2454r2455
9999static TIMER_CALLBACK( irq_off )
100100{
101101   /* clear the interrupt */
102   atarigen_scanline_int_ack_w(machine, 0, 0, 0);
102   atarigen_scanline_int_ack_w(machine, 0, 0, 0xffff);
103103}
104104
105105
src/mame/video/tatsumi.c
r2454r2455
5151
5252   offset=offset%0xc000;
5353
54   decodechar(Machine->gfx[1],offset/0x10,(UINT8 *)roundup5_vram);
54   decodechar(machine->gfx[1],offset/0x10,(UINT8 *)roundup5_vram);
5555}
5656
5757
r2454r2455
8383
8484   offset&=~1;
8585   word = ((paletteram16[offset] & 0xff)<<8) | (paletteram16[offset+1] & 0xff);
86   palette_set_color_rgb(Machine,offset/2,pal5bit(word >> 10),pal5bit(word >> 5),pal5bit(word >> 0));
86   palette_set_color_rgb(machine,offset/2,pal5bit(word >> 10),pal5bit(word >> 5),pal5bit(word >> 0));
8787}
8888
8989
r2454r2455
113113//  logerror("PAL: %04x %02x\n",offset,data);
114114
115115   data = paletteram16[offset];
116   palette_set_color_rgb(Machine,offset,pal5bit(data >> 10),pal5bit(data >> 5),pal5bit(data >> 0));
116   palette_set_color_rgb(machine,offset,pal5bit(data >> 10),pal5bit(data >> 5),pal5bit(data >> 0));
117117}
118118
119119
src/mame/video/konamiic.c
r2454r2455
58785878
58795879READ16_HANDLER( K056832_5bpp_rom_word_r )
58805880{
5881   if (mem_mask == 0x00ff)
5881   if (mem_mask == 0xff00)
58825882   {
58835883      return K056832_rom_read_b(offset*2, 4, 5, 0)<<8;
58845884   }
5885   else if (mem_mask == 0xff00)
5885   else if (mem_mask == 0x00ff)
58865886   {
58875887      return K056832_rom_read_b(offset*2+1, 4, 5, 0)<<16;
58885888   }
r2454r2455
58955895
58965896READ32_HANDLER( K056832_5bpp_rom_long_r )
58975897{
5898   if (mem_mask == 0x00ffffff)
5898   if (mem_mask == 0xff000000)
58995899   {
59005900      return K056832_rom_read_b(offset*4, 4, 5, 0)<<24;
59015901   }
5902   else if (mem_mask == 0xff00ffff)
5902   else if (mem_mask == 0x00ff0000)
59035903   {
59045904      return K056832_rom_read_b(offset*4+1, 4, 5, 0)<<16;
59055905   }
5906   else if (mem_mask == 0xffff00ff)
5906   else if (mem_mask == 0x0000ff00)
59075907   {
59085908      return K056832_rom_read_b(offset*4+2, 4, 5, 0)<<8;
59095909   }
5910   else if (mem_mask == 0xffffff00)
5910   else if (mem_mask == 0x000000ff)
59115911   {
59125912      return K056832_rom_read_b(offset*4+3, 4, 5, 1);
59135913   }
r2454r2455
59205920
59215921READ32_HANDLER( K056832_6bpp_rom_long_r )
59225922{
5923   if (mem_mask == 0x00ffffff)
5923   if (mem_mask == 0xff000000)
59245924   {
59255925      return K056832_rom_read_b(offset*4, 4, 6, 0)<<24;
59265926   }
5927   else if (mem_mask == 0xff00ffff)
5927   else if (mem_mask == 0x00ff0000)
59285928   {
59295929      return K056832_rom_read_b(offset*4+1, 4, 6, 0)<<16;
59305930   }
5931   else if (mem_mask == 0xffff00ff)
5931   else if (mem_mask == 0x0000ff00)
59325932   {
59335933      return K056832_rom_read_b(offset*4+2, 4, 6, 0)<<8;
59345934   }
5935   else if (mem_mask == 0xffffff00)
5935   else if (mem_mask == 0x000000ff)
59365936   {
59375937      return K056832_rom_read_b(offset*4+3, 4, 6, 0);
59385938   }
r2454r2455
62066206   UINT16 old_mask, old_data;
62076207
62086208   tile_ptr = &K056832_videoram[K056832_SelectedPagex4096+offset];
6209   old_mask = mem_mask;
6210   mem_mask = ~mem_mask;
6209   old_mask = ~mem_mask;
62116210   old_data = *tile_ptr;
62126211   data = (data & mem_mask) | (old_data & old_mask);
62136212
r2454r2455
62486247   UINT32 old_mask, old_data;
62496248
62506249   tile_ptr = &K056832_videoram[K056832_SelectedPagex4096+offset*2];
6251   old_mask = mem_mask;
6252   mem_mask = ~mem_mask;
6250   old_mask = ~mem_mask;
62536251   old_data = (UINT32)tile_ptr[0]<<16 | (UINT32)tile_ptr[1];
62546252   data = (data & mem_mask) | (old_data & old_mask);
62556253
r2454r2455
64026400{
64036401   if (offset & 1)
64046402   {
6405      K056832_word_w(machine, (offset>>1), data, 0xff00);
6403      K056832_word_w(machine, (offset>>1), data, 0x00ff);
64066404   }
64076405   else
64086406   {
6409      K056832_word_w(machine, (offset>>1), data<<8, 0x00ff);
6407      K056832_word_w(machine, (offset>>1), data<<8, 0xff00);
64106408   }
64116409}
64126410
r2454r2455
64146412{
64156413   if (offset & 1)
64166414   {
6417      K056832_b_word_w(machine, (offset>>1), data, 0xff00);
6415      K056832_b_word_w(machine, (offset>>1), data, 0x00ff);
64186416   }
64196417   else
64206418   {
6421      K056832_b_word_w(machine, (offset>>1), data<<8, 0x00ff);
6419      K056832_b_word_w(machine, (offset>>1), data<<8, 0xff00);
64226420   }
64236421}
64246422
r2454r2455
64396437#define LINE_WIDTH 512
64406438
64416439#define DRAW_PIX(N) \
6442   if ((pen = src_ptr[N])) \
6440   pen = src_ptr[N]; \
6441   if (pen) \
64436442   { pen += basepen; xpr_ptr[count+N] = TILEMAP_PIXEL_LAYER0; dst_ptr[count+N] = pen; } else \
64446443   { xpr_ptr[count+N] = 0; }
64456444
r2454r2455
65806579   cmaxy = cliprect->max_y;
65816580
65826581   // flip correction registers
6583   if ((flipy = K056832_regs[0] & 0x20))
6582   flipy = K056832_regs[0] & 0x20;
6583   if (flipy)
65846584   {
65856585      corr = K056832_regs[0x3c/2];
65866586      if (corr & 0x400)
r2454r2455
65896589   dy += corr;
65906590   ay = (unsigned)(dy - K056832_LayerOffset[layer][1]) % height;
65916591
6592   if ((flipx = K056832_regs[0] & 0x10))
6592   flipx = K056832_regs[0] & 0x10;
6593   if (flipx)
65936594   {
65946595      corr = K056832_regs[0x3a/2];
65956596      if (corr & 0x800)
r2454r2455
68576858   cmaxy = cliprect->max_y;
68586859
68596860   // flip correction registers
6860   if ((flipy = K056832_regs[0] & 0x20))
6861   flipy = K056832_regs[0] & 0x20;
6862   if (flipy)
68616863   {
68626864      corr = K056832_regs[0x3c/2];
68636865      if (corr & 0x400)
r2454r2455
68666868   dy += corr;
68676869   ay = (unsigned)(dy - K056832_LayerOffset[layer][1]) % height;
68686870
6869   if ((flipx = K056832_regs[0] & 0x10))
6871   flipx = K056832_regs[0] & 0x10;
6872   if (flipx)
68706873   {
68716874      corr = K056832_regs[0x3a/2];
68726875      if (corr & 0x800)
r2454r2455
71947197
71957198WRITE16_HANDLER( K055555_word_w )
71967199{
7197   if (mem_mask == 0xff00)
7200   if (mem_mask == 0x00ff)
71987201   {
71997202      K055555_write_reg(offset, data&0xff);
72007203   }
src/mame/video/blmbycar.c
r2454r2455
2929***************************************************************************/
3030
3131#include "driver.h"
32#include "deprecat.h"
3332
3433/* Variables needed by driver: */
3534
r2454r2455
5049WRITE16_HANDLER( blmbycar_palette_w )
5150{
5251   data = COMBINE_DATA(&paletteram16[offset]);
53   palette_set_color_rgb( Machine, offset, pal4bit(data >> 4), pal4bit(data >> 0), pal4bit(data >> 8));
52   palette_set_color_rgb( machine, offset, pal4bit(data >> 4), pal4bit(data >> 0), pal4bit(data >> 8));
5453}
5554
5655
src/mame/video/harddriv.c
r2454r2455
286286         break;
287287
288288      case 0x04:
289         if (Machine->config->total_colors >= 256 * 8)
289         if (machine->config->total_colors >= 256 * 8)
290290            update_palette_bank((gfx_palettebank & ~4) | (val << 2));
291291         break;
292292
src/mame/video/m72.c
r2454r2455
353353
354354      /* bit 4 resets sound CPU (active low) */
355355      if (data & 0x10)
356         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
356         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
357357      else
358         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
358         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
359359
360360      /* bit 5 = "bank"? */
361361   }
src/mame/video/snk68.c
r2454r2455
1313***************************************************************************/
1414
1515#include "driver.h"
16#include "deprecat.h"
1716
1817static int sprite_flip, pow_charbase=0; //*
1918static tilemap *fix_tilemap;
r2454r2455
127126   g = ((newword >> 3) & 0x1e) | ((newword >> 13) & 0x01) ;
128127   b = ((newword << 1) & 0x1e) | ((newword >> 12) & 0x01) ;
129128
130   palette_set_color_rgb(Machine,offset,pal5bit(r),pal5bit(g),pal5bit(b));
129   palette_set_color_rgb(machine,offset,pal5bit(r),pal5bit(g),pal5bit(b));
131130}
132131
133132WRITE16_HANDLER( pow_video16_w )
src/mame/video/mcr68.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "mcr.h"
109
1110
r2454r2455
134133
135134   COMBINE_DATA(&paletteram16[offset]);
136135   newword = paletteram16[offset];
137   palette_set_color_rgb(Machine, offset, pal3bit(newword >> 6), pal3bit(newword >> 0), pal3bit(newword >> 3));
136   palette_set_color_rgb(machine, offset, pal3bit(newword >> 6), pal3bit(newword >> 0), pal3bit(newword >> 3));
138137}
139138
140139
r2454r2455
144143
145144   COMBINE_DATA(&paletteram16[offset]);
146145   newword = paletteram16[offset];
147   palette_set_color_rgb(Machine, offset, pal5bit(~newword >> 10), pal5bit(~newword >> 0), pal5bit(~newword >> 5));
146   palette_set_color_rgb(machine, offset, pal5bit(~newword >> 10), pal5bit(~newword >> 0), pal5bit(~newword >> 5));
148147}
149148
150149
src/mame/video/funworld.c
r2454r2455
4646    * Joker Card (Ver.A267BC, encrypted),               Vesely Svet,        1993.
4747    * Mongolfier New (italian),                         bootleg,            199?.
4848    * Soccer New (italian),                             bootleg,            199?.
49    * Snooker 10 (Ver 1.11),                            Sandii',            1998.
5049    * Saloon (french, encrypted),                       unknown,            199?.
5150
5251
r2454r2455
157156   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 4, 8, 112, 34);
158157}
159158
160VIDEO_START(snookr10)
161{
162   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 4, 8, 128, 32);
163}
164
165159VIDEO_UPDATE(funworld)
166160{
167161   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
src/mame/video/csk.c
r2454r2455
4141   cpk_palette2[offset] = data;
4242
4343   newword = cpk_palette[offset] + 256 * cpk_palette2[offset];
44   palette_set_color_rgb(Machine,offset,pal5bit(newword >> 0),pal5bit(newword >> 5),pal5bit(newword >> 10));
44   palette_set_color_rgb(machine,offset,pal5bit(newword >> 0),pal5bit(newword >> 5),pal5bit(newword >> 10));
4545}
4646
4747/* Video handling */
src/mame/video/runaway.c
r2454r2455
55****************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98
109
1110static tilemap *bg_tilemap;
r2454r2455
3433      0x47 * ((~data >> 0) & 1) +
3534      0x97 * ((~data >> 1) & 1);
3635
37   palette_set_color(Machine, offset, MAKE_RGB(R, G, B));
36   palette_set_color(machine, offset, MAKE_RGB(R, G, B));
3837}
3938
4039
src/mame/video/taito_z.c
r2454r2455
11#include "driver.h"
2#include "deprecat.h"
32#include "video/taitoic.h"
43
54#define TC0100SCN_GFX_NUM 1
r2454r2455
831830   if (ACCESSING_BITS_0_7)
832831   {
833832      /* bit 0 = reset sub CPU */
834      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
833      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
835834
836835      /* bits 1-3 n.c. */
837836
src/mame/video/playch10.c
r2454r2455
1010extern int pc10_game_mode;
1111extern int pc10_dispmask_old;
1212
13/* from romload.c */
14extern int system_bios;
13static int pc10_bios;
1514
1615static tilemap *bg_tilemap;
1716
r2454r2455
9897
9998VIDEO_START( playch10 )
10099{
100   const UINT8 *bios = memory_region(REGION_CPU1);
101   pc10_bios = (bios[3] == 0x2a) ? 1 : 2;
102
101103   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
102104       8, 8, 32, 32);
103105
r2454r2455
113115VIDEO_UPDATE( playch10 )
114116{
115117   /* Dual monitor version */
116   if(system_bios == 1)
118   if (pc10_bios == 1)
117119   {
118120      const device_config *top_screen = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "top");
119121
src/mame/video/lockon.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "lockon.h"
109#include "video/resnet.h"
1110#include "cpu/nec/nec.h"
r2454r2455
170169         b = compute_res_net( (p1 & 0x1f), 2, &lockon_pd_net_info );
171170      }
172171
173      palette_set_color(Machine, i, MAKE_RGB(r, g, b));
172      palette_set_color(machine, i, MAKE_RGB(r, g, b));
174173   }
175174}
176175
r2454r2455
330329
331330static TIMER_CALLBACK( bufend_callback )
332331{
333   cpunum_set_input_line_and_vector(Machine, GROUND_CPU, 0, HOLD_LINE, 0xff);
334   cpunum_set_input_line(Machine, OBJECT_CPU, NEC_INPUT_LINE_POLL, ASSERT_LINE);
332   cpunum_set_input_line_and_vector(machine, GROUND_CPU, 0, HOLD_LINE, 0xff);
333   cpunum_set_input_line(machine, OBJECT_CPU, NEC_INPUT_LINE_POLL, ASSERT_LINE);
335334}
336335
337336/* Get data for a each 8x8x3 ground tile */
r2454r2455
659658
660659READ16_HANDLER( lockon_obj_4000_r )
661660{
662   cpunum_set_input_line(Machine, OBJECT_CPU, NEC_INPUT_LINE_POLL, CLEAR_LINE);
661   cpunum_set_input_line(machine, OBJECT_CPU, NEC_INPUT_LINE_POLL, CLEAR_LINE);
663662   return 0xffff;
664663}
665664
r2454r2455
695694{
696695   rgb_t color;
697696
698   color = palette_get_color(Machine, 0x300 + (data & 0xff));
699   palette_set_color(Machine, 0x400 + offset, color);
697   color = palette_get_color(machine, 0x300 + (data & 0xff));
698   palette_set_color(machine, 0x400 + offset, color);
700699}
701700
702701/* Rotation control register */
src/mame/video/rastan.c
r2454r2455
129129
130130   PC090OJ_draw_sprites(screen->machine,bitmap,cliprect,1);
131131
132//  if (input_port_5_word_r(0,0xffff))
132//  if (input_port_read_indexed(machine,5))
133133
134//  popmessage("%d %d",input_port_5_word_r(0,0xffff),input_port_6_word_r(0,0xffff));
134//  popmessage("%d %d",input_port_read_indexed(machine,5),input_port_read_indexed(machine,6));
135135
136136   return 0;
137137}
src/mame/video/tigeroad.c
r2454r2455
166166
167167VIDEO_EOF( tigeroad )
168168{
169   buffer_spriteram16_w(machine,0,0,0);
169   buffer_spriteram16_w(machine,0,0,0xffff);
170170}
src/mame/video/psikyosh.c
r2454r2455
11451145
11461146VIDEO_EOF( psikyosh )
11471147{
1148   buffer_spriteram32_w(machine,0,0,0);
1148   buffer_spriteram32_w(machine,0,0,0xffffffff);
11491149}
11501150
11511151/*popmessage   ("Regs %08x %08x %08x\n     %08x %08x %08x",
src/mame/video/quizdna.c
r2454r2455
1010******************************************************************************/
1111
1212#include "driver.h"
13#include "deprecat.h"
1413
1514static UINT8 *quizdna_bg_ram;
1615static UINT8 *quizdna_fg_ram;
r2454r2455
133132   g = ((d0 >> 3) & 0x1e) | ((d1 >> 5) & 1);
134133   b = ((d0 << 1) & 0x1e) | ((d1 >> 6) & 1);
135134
136   palette_set_color_rgb(Machine,offs/2,pal5bit(r),pal5bit(g),pal5bit(b));
135   palette_set_color_rgb(machine,offs/2,pal5bit(r),pal5bit(g),pal5bit(b));
137136}
138137
139138static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
src/mame/video/decocass.c
r2454r2455
55 ***********************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "machine/decocass.h"
109
1110static INT32 watchdog_count;
r2454r2455
209208     * (ME/ input on 1st paletteram, inverter -> ME/ on 2nd)
210209     */
211210   offset = (offset & 31) ^ 16;
212   colortable_palette_set_color(Machine->colortable, offset, MAKE_RGB(pal3bit(~data >> 0), pal3bit(~data >> 3), pal2bit(~data >> 6)));
211   colortable_palette_set_color(machine->colortable, offset, MAKE_RGB(pal3bit(~data >> 0), pal3bit(~data >> 3), pal2bit(~data >> 6)));
213212}
214213
215214WRITE8_HANDLER( decocass_charram_w )
r2454r2455
608607   int scrollx, scrolly_l, scrolly_r;
609608   rectangle clip;
610609
611   if (0xc0 != (input_port_2_r(screen->machine, 0) & 0xc0))  /* coin slots assert an NMI */
610   if (0xc0 != (input_port_read_indexed(screen->machine, 2) & 0xc0))  /* coin slots assert an NMI */
612611      cpunum_set_input_line(screen->machine, 0, INPUT_LINE_NMI, ASSERT_LINE);
613612
614613   if (0 == (watchdog_flip & 0x04))
src/mame/video/fromance.c
r2454r2455
88******************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1211#include "fromance.h"
1312
1413
r2454r2455
212211
213212   /* compute R,G,B */
214213   palword = (local_paletteram[offset | 1] << 8) | local_paletteram[offset & ~1];
215   palette_set_color_rgb(Machine, offset / 2, pal5bit(palword >> 10), pal5bit(palword >> 5), pal5bit(palword >> 0));
214   palette_set_color_rgb(machine, offset / 2, pal5bit(palword >> 10), pal5bit(palword >> 5), pal5bit(palword >> 0));
216215}
217216
218217
src/mame/video/irobot.c
r2454r2455
7676    g = 12 * bits * intensity;
7777    bits = (color >> 7) & 0x03;
7878    r = 12 * bits * intensity;
79    palette_set_color(Machine,(offset >> 1) & 0x3F,MAKE_RGB(r,g,b));
79    palette_set_color(machine,(offset >> 1) & 0x3F,MAKE_RGB(r,g,b));
8080}
8181
8282
src/mame/video/neogeo.c
r2454r2455
807807   UINT16 ret;
808808
809809   /* accessing the LSB only is not mapped */
810   if (mem_mask == 0xff00)
811      ret = neogeo_unmapped_r(machine, 0, 0) & 0x00ff;
810   if (mem_mask == 0x00ff)
811      ret = neogeo_unmapped_r(machine, 0, 0xffff) & 0x00ff;
812812   else
813813   {
814814      switch (offset)
r2454r2455
828828WRITE16_HANDLER( neogeo_video_register_w )
829829{
830830   /* accessing the LSB only is not mapped */
831   if (mem_mask != 0xff00)
831   if (mem_mask != 0x00ff)
832832   {
833833      /* accessing the MSB only stores same data in MSB and LSB */
834      if (mem_mask == 0x00ff)
834      if (mem_mask == 0xff00)
835835         data = (data & 0xff00) | (data >> 8);
836836
837837      switch (offset)
src/mame/video/snookr10.c
r0r2455
1/**********************************************************************************
2
3
4    SNOOKER 10 / SANDII'
5
6    Driver by Roberto Fresca.
7
8
9    Games running on this hardware:
10
11    * Snooker 10 (Ver 1.11), Sandii', 1998.
12    * Apple 10 (Ver 1.21),   Sandii', 1998.
13    * Ten Balls (Ver 1.05),  unknown, 1997.
14
15
16**********************************************************************************/
17
18#include "driver.h"
19#include "video/resnet.h"
20
21static tilemap *bg_tilemap;
22
23
24PALETTE_INIT( snookr10 )
25{
26   int i;
27
28   /* RRRBBBGG */
29   if (color_prom == 0) return;
30
31   for (i = 0;i < machine->config->total_colors;i++)
32   {
33      int bit0,bit1,bit2,r,g,b;
34
35      /* red component */
36      bit0 = (color_prom[i] >> 0) & 0x01;
37      bit1 = (color_prom[i] >> 1) & 0x01;
38      bit2 = (color_prom[i] >> 2) & 0x01;
39      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
40      /* blue component */
41      bit0 = (color_prom[i] >> 3) & 0x01;
42      bit1 = (color_prom[i] >> 4) & 0x01;
43      bit2 = (color_prom[i] >> 5) & 0x01;
44      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
45      /* green component */
46      bit0 = 0;
47      bit1 = (color_prom[i] >> 6) & 0x01;
48      bit2 = (color_prom[i] >> 7) & 0x01;
49      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
50
51      palette_set_color(machine,i,MAKE_RGB(r,g,b));
52   }
53}
54
55WRITE8_HANDLER( snookr10_videoram_w )
56{
57   videoram[offset] = data;
58   tilemap_mark_tile_dirty(bg_tilemap, offset);
59}
60
61WRITE8_HANDLER( snookr10_colorram_w )
62{
63   colorram[offset] = data;
64   tilemap_mark_tile_dirty(bg_tilemap, offset);
65}
66
67/**** normal hardware limit ****
68    - bits -
69    7654 3210
70    xxxx xx--   tiles color.
71    xxx- x-xx   tiles color (title).
72    xxxx -xxx   tiles color (background).
73*/
74
75static TILE_GET_INFO( get_bg_tile_info )
76{
77/*  - bits -
78    7654 3210
79    xxxx ----   tiles color.
80    ---- xxxx   unused.
81*/
82   int offs = tile_index;
83   int attr = videoram[offs] + (colorram[offs] << 8);
84   int code = attr & 0xfff;
85   int color = colorram[offs] >> 4;   /* 4 bits for color */
86
87   SET_TILE_INFO(0, code, color, 0);
88}
89
90VIDEO_START( snookr10 )
91{
92   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 4, 8, 128, 32);
93}
94
95VIDEO_UPDATE( snookr10 )
96{
97   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
98   return 0;
99}
src/mame/video/konamigx.c
r2454r2455
44 */
55
66#include "driver.h"
7#include "deprecat.h"
87#include "video/konamiic.h"
98#include "machine/konamigx.h"
109
src/mame/video/combatsc.c
r2454r2455
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110#include "video/konamiic.h"
1211
1312static tilemap *bg_tilemap[2];
src/mame/video/starshp1.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "includes/starshp1.h"
109
1110UINT8 *starshp1_playfield_ram;
src/mame/video/gottlieb.c
r2454r2455
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110
1211UINT8 *gottlieb_charram;
1312
r2454r2455
8685
8786   b = 0x10 * bit0 + 0x21 * bit1 + 0x46 * bit2 + 0x88 * bit3;
8887
89   palette_set_color(Machine, offset / 2, MAKE_RGB(r, g, b));
88   palette_set_color(machine, offset / 2, MAKE_RGB(r, g, b));
9089}
9190
9291WRITE8_HANDLER( gottlieb_video_outputs_w )
r2454r2455
142141   {
143142      gottlieb_charram[offset] = data;
144143
145      decodechar(Machine->gfx[0], offset / 32, gottlieb_charram);
144      decodechar(machine->gfx[0], offset / 32, gottlieb_charram);
146145
147146      tilemap_mark_all_tiles_dirty(bg_tilemap);
148147   }
src/mame/video/tubep.c
r2454r2455
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110#include "includes/tubep.h"
1211#include "video/resnet.h"
1312
r2454r2455
557556            /SINT line will be reasserted in XSize * YSize cycles (RH0 signal cycles)
558557            */
559558         /* 1.clear the /SINT interrupt line */
560         cpunum_set_input_line(Machine, 3,0,CLEAR_LINE);
559         cpunum_set_input_line(machine, 3,0,CLEAR_LINE);
561560
562561         /* 2.assert /SINT again after this time */
563562         timer_set( attotime_mul(ATTOTIME_IN_HZ(19968000/8), (XSize+1)*(YSize+1)), NULL, 0, sprite_timer_callback);
src/mame/video/exidy.c
r2454r2455
102102READ8_HANDLER( exidy_interrupt_r )
103103{
104104   /* clear any interrupts */
105   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
105   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
106106
107107   /* return the latched condition */
108108   return int_condition;
src/mame/video/gladiatr.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98
109UINT8 *gladiatr_videoram, *gladiatr_colorram, *gladiatr_textram;
1110
r2454r2455
118117   g = (g << 1) + ((paletteram[offset + 0x400] >> 5) & 0x01);
119118   b = (b << 1) + ((paletteram[offset + 0x400] >> 6) & 0x01);
120119
121   palette_set_color_rgb(Machine,offset,pal5bit(r),pal5bit(g),pal5bit(b));
120   palette_set_color_rgb(machine,offset,pal5bit(r),pal5bit(g),pal5bit(b));
122121}
123122
124123
src/mame/video/groundfx.c
r2454r2455
261261        it's contents the usual way.
262262
263263    */
264   if (TC0100SCN_long_r(screen->machine,0x4090/4,0) || TC0480SCP_long_r(screen->machine,0x20/4,0)==0x240866) { /* Anything in text layer - really stupid hack */
264   if (TC0100SCN_long_r(screen->machine,0x4090/4,0xffffffff) || TC0480SCP_long_r(screen->machine,0x20/4,0xffffffff)==0x240866) { /* Anything in text layer - really stupid hack */
265265      TC0480SCP_tilemap_draw(bitmap,cliprect,layer[1],0,2);
266266      TC0480SCP_tilemap_draw(bitmap,cliprect,layer[2],0,4);
267267      TC0480SCP_tilemap_draw(bitmap,cliprect,layer[3],0,8);
268268//      TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,pivlayer[2],0,0);
269      if (TC0480SCP_long_r(screen->machine,0x20/4,0)!=0x240866) /* Stupid hack for start of race */
269      if (TC0480SCP_long_r(screen->machine,0x20/4,0xffffffff)!=0x240866) /* Stupid hack for start of race */
270270         TC0480SCP_tilemap_draw(bitmap,&hack_cliprect,layer[0],0,0);
271271      draw_sprites(screen->machine,bitmap,cliprect,1,44,-574);
272272   } else {
src/mame/video/kangaroo.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "kangaroo.h"
109
1110
src/mame/video/cidelsa.c
r2454r2455
182182   cidelsa_prd_changed,
183183};
184184
185static const cdp1869_interface draco_cdp1869_intf =
185static CDP1869_INTERFACE( draco_cdp1869_intf )
186186{
187187   SCREEN_TAG,
188188   DRACO_CHR2,
src/mame/video/m92.c
r2454r2455
9393   /* Sprite buffer - the data written doesn't matter (confirmed by several games) */
9494   if (offset==4)
9595   {
96         buffer_spriteram16_w(machine,0,0,0);
96         buffer_spriteram16_w(machine,0,0,0xffff);
9797      m92_sprite_buffer_busy = 0;
9898
9999      /* Pixel clock is 26.6666 MHz, we have 0x800 bytes, or 0x400 words
src/mame/video/m58.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "m58.h"
109#include "video/resnet.h"
1110
src/mame/video/shangha3.c
r2454r2455
5959***************************************************************************/
6060
6161#include "driver.h"
62#include "deprecat.h"
6362#include "profiler.h"
6463
6564
r2454r2455
212211                  if (flipy) dy = sy + sizey-15 - dy;
213212                  else dy = sy + dy;
214213
215                  drawgfx(rawbitmap,Machine->gfx[0],
214                  drawgfx(rawbitmap,machine->gfx[0],
216215                        (tile & 0x0fff) | (code & 0xf000),
217216                        (tile >> 12) | (color & 0x70),
218217                        flipx,flipy,
r2454r2455
226225            int w;
227226
228227if (zoomx <= 1 && zoomy <= 1)
229   drawgfxzoom(rawbitmap,Machine->gfx[0],
228   drawgfxzoom(rawbitmap,machine->gfx[0],
230229         code,
231230         color,
232231         flipx,flipy,
r2454r2455
239238
240239            for (x = 0;x < w;x++)
241240            {
242               drawgfxzoom(rawbitmap,Machine->gfx[0],
241               drawgfxzoom(rawbitmap,machine->gfx[0],
243242                     code,
244243                     color,
245244                     flipx,flipy,
src/mame/video/taito_f3.c
r2454r2455
813813      b = (paletteram32[offset] >> 0) & 0xff;
814814   }
815815
816   palette_set_color(Machine,offset,MAKE_RGB(r,g,b));
816   palette_set_color(machine,offset,MAKE_RGB(r,g,b));
817817}
818818
819819/******************************************************************************/
r2454r2455
13571357   } \
13581358}
13591359
1360#define UPDATE_PIXMAP_SP(pf_num) \
1361   if(cx>=clip_als && cx<clip_ars && !(cx>=clip_bls && cx<clip_brs)) \
1362   { \
1363      sprite_pri=sprite[pf_num]&pval; \
1364      if(sprite_pri) \
1365      { \
1366         if(sprite[pf_num]&0x100) break; \
1367         if(!dpix_sp[sprite_pri]) \
1368         { \
1369            if(!(pval&0xf0)) break; \
1370            else {dpix_1_sprite(*dsti);*dsti=dval;break;} \
1371         } \
1372         if(dpix_sp[sprite_pri][pval>>4](*dsti)) {*dsti=dval;break;} \
1373      } \
1374   }
1375
1376#define UPDATE_PIXMAP_LP(pf_num) \
1377   if (cx>=clip_al##pf_num && cx<clip_ar##pf_num && !(cx>=clip_bl##pf_num && cx<clip_br##pf_num)) \
1378   { \
1379      tval=*tsrc##pf_num; \
1380      if(tval&0xf0) \
1381         if(dpix_lp[pf_num][pval>>4](clut[*src##pf_num])) {*dsti=dval;break;} \
1382   }
1383
1384
13601385/*============================================================================*/
13611386
13621387INLINE void draw_scanlines(running_machine *machine,
r2454r2455
13721397
13731398   const int x=46;
13741399
1375   UINT32 sprite_noalp_0=sprite[0]&0x100;
1376   UINT32 sprite_noalp_1=sprite[1]&0x100;
1377   UINT32 sprite_noalp_2=sprite[2]&0x100;
1378   UINT32 sprite_noalp_3=sprite[3]&0x100;
1379   UINT32 sprite_noalp_4=sprite[4]&0x100;
1380   UINT32 sprite_noalp_5=sprite[5]&0x100;
1381
13821400   static UINT16 *src0=0,*src_s0=0,*src_e0=0,clip_al0=0,clip_ar0=0,clip_bl0=0,clip_br0=0;
13831401   static UINT8 *tsrc0=0,*tsrc_s0=0;
13841402   static UINT32 x_count0=0,x_zoom0=0;
r2454r2455
14571475               UINT8 sprite_pri;
14581476               switch(skip_layer_num)
14591477               {
1460                  case 0: if(cx>=clip_als && cx<clip_ars && !(cx>=clip_bls && cx<clip_brs) && (sprite_pri=sprite[0]&pval))
1461                        {
1462                           if(sprite_noalp_0) break;
1463                           if(!dpix_sp[sprite_pri]) break;
1464                           if(dpix_sp[sprite_pri][pval>>4](*dsti)) {*dsti=dval;break;}
1465                        }
1466                        if (cx>=clip_al0 && cx<clip_ar0 && !(cx>=clip_bl0 && cx<clip_br0)) {tval=*tsrc0;if(tval&0xf0) if(dpix_lp[0][pval>>4](clut[*src0])) {*dsti=dval;break;}}
1467                  case 1: if(cx>=clip_als && cx<clip_ars && !(cx>=clip_bls && cx<clip_brs) && (sprite_pri=sprite[1]&pval))
1468                        {
1469                           if(sprite_noalp_1) break;
1470                           if(!dpix_sp[sprite_pri])
1471                           {
1472                              if(!(pval&0xf0)) break;
1473                              else {dpix_1_sprite(*dsti);*dsti=dval;break;}
1474                           }
1475                           if(dpix_sp[sprite_pri][pval>>4](*dsti)) {*dsti=dval;break;}
1476                        }
1477                        if (cx>=clip_al1 && cx<clip_ar1 && !(cx>=clip_bl1 && cx<clip_br1)) {tval=*tsrc1;if(tval&0xf0) if(dpix_lp[1][pval>>4](clut[*src1])) {*dsti=dval;break;}}
1478                  case 2: if(cx>=clip_als && cx<clip_ars && !(cx>=clip_bls && cx<clip_brs) && (sprite_pri=sprite[2]&pval))
1479                        {
1480                           if(sprite_noalp_2) break;
1481                           if(!dpix_sp[sprite_pri])
1482                           {
1483                              if(!(pval&0xf0)) break;
1484                              else {dpix_1_sprite(*dsti);*dsti=dval;break;}
1485                           }
1486                           if(dpix_sp[sprite_pri][pval>>4](*dsti)) {*dsti=dval;break;}
1487                        }
1488                        if (cx>=clip_al2 && cx<clip_ar2 && !(cx>=clip_bl2 && cx<clip_br2)) {tval=*tsrc2;if(tval&0xf0) if(dpix_lp[2][pval>>4](clut[*src2])) {*dsti=dval;break;}}
1489                  case 3: if(cx>=clip_als && cx<clip_ars && !(cx>=clip_bls && cx<clip_brs) && (sprite_pri=sprite[3]&pval))
1490                        {
1491                           if(sprite_noalp_3) break;
1492                           if(!dpix_sp[sprite_pri])
1493                           {
1494                              if(!(pval&0xf0)) break;
1495                              else {dpix_1_sprite(*dsti);*dsti=dval;break;}
1496                           }
1497                           if(dpix_sp[sprite_pri][pval>>4](*dsti)) {*dsti=dval;break;}
1498                        }
1499                        if (cx>=clip_al3 && cx<clip_ar3 && !(cx>=clip_bl3 && cx<clip_br3)) {tval=*tsrc3;if(tval&0xf0) if(dpix_lp[3][pval>>4](clut[*src3])) {*dsti=dval;break;}}
1500
1501                  case 4: if(cx>=clip_als && cx<clip_ars && !(cx>=clip_bls && cx<clip_brs) && (sprite_pri=sprite[4]&pval))
1502                        {
1503                           if(sprite_noalp_4) break;
1504                           if(!dpix_sp[sprite_pri])
1505                           {
1506                              if(!(pval&0xf0)) break;
1507                              else {dpix_1_sprite(*dsti);*dsti=dval;break;}
1508                           }
1509                           if(dpix_sp[sprite_pri][pval>>4](*dsti)) {*dsti=dval;break;}
1510                        }
1511                        if (cx>=clip_al4 && cx<clip_ar4 && !(cx>=clip_bl4 && cx<clip_br4)) {
1512                           tval=*tsrc4;
1513                           if(tval&0xf0)
1514                           {
1515                              if(dpix_lp[4][pval>>4](clut[*src4]))
1516                              {
1517                                 *dsti=dval;
1518                                 break;
1519                              }
1520                           }
1521                        }
1522
1523
1524                  case 5: if(cx>=clip_als && cx<clip_ars && !(cx>=clip_bls && cx<clip_brs) && (sprite_pri=sprite[5]&pval))
1525                        {
1526                           if(sprite_noalp_5) break;
1527                           if(!dpix_sp[sprite_pri])
1528                           {
1529                              if(!(pval&0xf0)) break;
1530                              else {dpix_1_sprite(*dsti);*dsti=dval;break;}
1531                           }
1532                           if(dpix_sp[sprite_pri][pval>>4](*dsti)) {*dsti=dval;break;}
1533                        }
1478                  case 0: UPDATE_PIXMAP_SP(0) UPDATE_PIXMAP_LP(0)
1479                  case 1: UPDATE_PIXMAP_SP(1) UPDATE_PIXMAP_LP(1)
1480                  case 2: UPDATE_PIXMAP_SP(2) UPDATE_PIXMAP_LP(2)
1481                  case 3: UPDATE_PIXMAP_SP(3) UPDATE_PIXMAP_LP(3)
1482                  case 4: UPDATE_PIXMAP_SP(4) UPDATE_PIXMAP_LP(4)
1483                  case 5: UPDATE_PIXMAP_SP(5)
15341484                        if(!bgcolor) {if(!(pval&0xf0)) {*dsti=0;break;}}
15351485                        else dpix_bg(bgcolor);
15361486                        *dsti=dval;
r2454r2455
15881538   int opaque_all;
15891539   int total_elements;
15901540
1591   if(!(alpha_mode=line_t->alpha_mode[line])) return;
1541   alpha_mode=line_t->alpha_mode[line];
1542   if(!alpha_mode) return;
15921543
15931544   total_elements=machine->gfx[1]->total_elements;
15941545
src/mame/video/gaelco2.c
r2454r2455
7777***************************************************************************/
7878
7979#include "driver.h"
80#include "deprecat.h"
8180
8281UINT16 *gaelco2_vregs;
8382static UINT16 *gaelco2_videoram;
r2454r2455
241240   b = pal5bit(b);
242241
243242   /* update game palette */
244   palette_set_color(Machine, 4096*0 + offset, MAKE_RGB(r, g, b));
243   palette_set_color(machine, 4096*0 + offset, MAKE_RGB(r, g, b));
245244
246245   /* update shadow/highligh palettes */
247246   for (i = 1; i < 16; i++){
r2454r2455
253252      auxg = ADJUST_COLOR(g + pen_color_adjust[i]);
254253      auxb = ADJUST_COLOR(b + pen_color_adjust[i]);
255254
256      palette_set_color(Machine, 4096*i + offset, MAKE_RGB(auxr, auxg, auxb));
255      palette_set_color(machine, 4096*i + offset, MAKE_RGB(auxr, auxg, auxb));
257256   }
258257}
259258
r2454r2455
510509VIDEO_EOF( gaelco2 )
511510{
512511   /* sprites are one frame ahead */
513   buffer_spriteram16_w(machine, 0, 0, 0);
512   buffer_spriteram16_w(machine, 0, 0, 0xffff);
514513}
src/mame/video/homerun.c
r2454r2455
11#include "driver.h"
2#include "deprecat.h"
32
43static int homerun_gfx_ctrl;
54static int homerun_gc_up,homerun_gc_down;
r2454r2455
4847   bit1 = (data >> 6) & 0x01;
4948   bit2 = (data >> 7) & 0x01;
5049   b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
51   palette_set_color(Machine,offset,MAKE_RGB(r,g,b));
50   palette_set_color(machine,offset,MAKE_RGB(r,g,b));
5251}
5352
5453static TILE_GET_INFO( get_homerun_tile_info )
src/mame/video/ssozumo.c
r2454r2455
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1211
1312UINT8 *ssozumo_videoram2;
1413UINT8 *ssozumo_colorram2;
r2454r2455
9998   bit3 = (val >> 3) & 0x01;
10099   b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
101100
102   palette_set_color(Machine, offs2 + 64, MAKE_RGB(r, g, b));
101   palette_set_color(machine, offs2 + 64, MAKE_RGB(r, g, b));
103102}
104103
105104WRITE8_HANDLER( ssozumo_scroll_w )
src/mame/video/matmania.c
r2454r2455
1313***************************************************************************/
1414
1515#include "driver.h"
16#include "deprecat.h"
1716
1817
1918
r2454r2455
114113   bit3 = (val >> 3) & 0x01;
115114   b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
116115
117   palette_set_color(Machine,offs2 + 64,MAKE_RGB(r,g,b));
116   palette_set_color(machine,offs2 + 64,MAKE_RGB(r,g,b));
118117}
119118
120119
src/mame/video/arkanoid.c
r2454r2455
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110#include "includes/arkanoid.h"
1211
1312static UINT8 gfxbank, palettebank;
r2454r2455
6867     which resets itself).  This bit is the likely candidate as it is flipped
6968     early in bootup just prior to accessing the MCU for the first time. */
7069   if (cpu_gettotalcpu()>1) // Bootlegs don't have the MCU but still set this bit
71      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
70      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
7271}
7372
7473static TILE_GET_INFO( get_bg_tile_info )
src/mame/video/twin16.c
r2454r2455
1414*/
1515
1616#include "driver.h"
17#include "deprecat.h"
1817
1918extern UINT16 twin16_custom_video;
2019extern UINT16 *twin16_gfx_rom;
r2454r2455
5049   offset &= ~1;
5150
5251   data = ((paletteram16[offset] & 0xff) << 8) | (paletteram16[offset + 1] & 0xff);
53   palette_set_color_rgb(Machine, offset / 2, pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
52   palette_set_color_rgb(machine, offset / 2, pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
5453}
5554
5655WRITE16_HANDLER( fround_gfx_bank_w )
r2454r2455
440439
441440   need_process_spriteram = 1;
442441
443   buffer_spriteram16_w(machine,0,0,0);
442   buffer_spriteram16_w(machine,0,0,0xffff);
444443}
445444
446445VIDEO_UPDATE( twin16 )
src/mame/video/megasys1.c
r2454r2455
192192***************************************************************************/
193193
194194#include "driver.h"
195#include "deprecat.h"
196195#include "megasys1.h"
197196
198197/* Variables defined here, that have to be shared: */
r2454r2455
455454                        cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
456455                     break;
457456
458      case 0x308/2   :   soundlatch_word_w(machine,0,new_data,0);
457      case 0x308/2   :   soundlatch_word_w(machine,0,new_data,0xffff);
459458                     cpunum_set_input_line(machine, 1,4,HOLD_LINE);
460459                     break;
461460
r2454r2455
472471{
473472   switch (offset)
474473   {
475      case 0x8000/2:   return soundlatch2_word_r(machine,0,0);
474      case 0x8000/2:   return soundlatch2_word_r(machine,0,0xffff);
476475      default:      return megasys1_vregs[offset];
477476   }
478477}
r2454r2455
507506                     break;
508507
509508      case 0x8000/2   :   /* Cybattler reads sound latch on irq 2 */
510                     soundlatch_word_w(machine,0,new_data,0);
509                     soundlatch_word_w(machine,0,new_data,0xffff);
511510                     cpunum_set_input_line(machine, 1,2,HOLD_LINE);
512511                     break;
513512
src/mame/video/crshrace.c
r2454r2455
215215
216216VIDEO_EOF( crshrace )
217217{
218   buffer_spriteram16_w(machine,0,0,0);
219   buffer_spriteram16_2_w(machine,0,0,0);
218   buffer_spriteram16_w(machine,0,0,0xffff);
219   buffer_spriteram16_2_w(machine,0,0,0xffff);
220220}
src/mame/video/pacman.c
r2454r2455
1717**************************************************************************/
1818
1919#include "driver.h"
20#include "deprecat.h"
2120#include "includes/pacman.h"
2221#include "video/resnet.h"
2322
r2454r2455
354353WRITE8_HANDLER( vanvan_bgcolor_w )
355354{
356355   int c = 0xaa * (data & 1);
357   palette_set_color(Machine,0,MAKE_RGB(c,c,c));
356   palette_set_color(machine,0,MAKE_RGB(c,c,c));
358357}
359358
360359
src/mame/video/dcheese.c
r2454r2455
300300         break;
301301
302302      default:
303         logerror("%06X:write to %06X = %04X & %04x\n", activecpu_get_pc(), 0x2a0000 + 2 * offset, data, mem_mask ^ 0xffff);
303         logerror("%06X:write to %06X = %04X & %04x\n", activecpu_get_pc(), 0x2a0000 + 2 * offset, data, mem_mask);
304304         break;
305305   }
306306}
r2454r2455
309309WRITE16_HANDLER( madmax_blitter_unknown_w )
310310{
311311   /* written to just before the blitter command register is written */
312  logerror("%06X:write to %06X = %04X & %04X\n", activecpu_get_pc(), 0x300000 + 2 * offset, data, mem_mask ^ 0xffff);
312  logerror("%06X:write to %06X = %04X & %04X\n", activecpu_get_pc(), 0x300000 + 2 * offset, data, mem_mask);
313313}
314314
315315
src/mame/video/bwing.c
r2454r2455
99// Directives
1010
1111#include "driver.h"
12#include "deprecat.h"
1312
1413#define BW_DEBUG 0
1514
r2454r2455
154153      if (b > 0xff) b = 0xff;
155154   }
156155
157   palette_set_color(Machine, offset, MAKE_RGB(r, g, b));
156   palette_set_color(machine, offset, MAKE_RGB(r, g, b));
158157
159158   #if BW_DEBUG
160159      paletteram[offset+0x40] = palatch;
r2454r2455
218217   fgfx = machine->gfx[2];
219218   bgfx = machine->gfx[3];
220219
221   if ((dwptr = fgfx->pen_usage))
220   dwptr = fgfx->pen_usage;
221   if (dwptr)
222222   {
223223      dwptr[0] = 0;
224224      for(i=1; i<BW_NTILES; i++) dwptr[i] = -1;
src/mame/video/cave.c
r2454r2455
368368
369369INLINE void vram_w(UINT16 *VRAM, tilemap *TILEMAP, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask)
370370{
371   if ((VRAM[offset] & ~mem_mask)==(data & ~mem_mask)) return;
371   if ((VRAM[offset] & mem_mask)==(data & mem_mask)) return;
372372   COMBINE_DATA(&VRAM[offset]);
373373   offset /= 2;
374374   if          ( offset < 0x1000/4 )   // 16x16 tilemap
r2454r2455
391391INLINE void vram_8x8_w(UINT16 *VRAM, tilemap *TILEMAP,ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask)
392392{
393393   offset %= 0x4000/2;
394   if ((VRAM[offset] & ~mem_mask)==(data & ~mem_mask)) return;
394   if ((VRAM[offset] & mem_mask)==(data & mem_mask)) return;
395395   COMBINE_DATA(&VRAM[offset + 0x0000/2]);
396396   COMBINE_DATA(&VRAM[offset + 0x4000/2]);
397397   tilemap_mark_tile_dirty(TILEMAP,offset/2);
src/mame/video/dooyong.c
r2454r2455
908908
909909VIDEO_EOF( rshark )
910910{
911   buffer_spriteram16_w(machine, 0, 0, 0);
911   buffer_spriteram16_w(machine, 0, 0, 0xffff);
912912}
src/mame/video/williams.c
r2454r2455
9292***************************************************************************/
9393
9494#include "driver.h"
95#include "deprecat.h"
9695#include "video/resnet.h"
9796#include "williams.h"
9897
r2454r2455
379378   b = ((entry_hi >> 0) & 15) * i;
380379   g = ((entry_lo >> 4) & 15) * i;
381380   r = ((entry_lo >> 0) & 15) * i;
382   palette_set_color(Machine, offset / 2, MAKE_RGB(r, g, b));
381   palette_set_color(machine, offset / 2, MAKE_RGB(r, g, b));
383382}
384383
385384
src/mame/video/dec8.c
r2454r2455
4141***************************************************************************/
4242
4343#include "driver.h"
44#include "deprecat.h"
4544
4645//static int scroll1[4];
4746static int scroll2[4];
r2454r2455
196195   scroll2[2]=(data>>6)&1;
197196
198197   if (data&0x80)
199      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
198      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
200199   else
201      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
200      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
202201}
203202
204203WRITE8_HANDLER( shackled_control_w )
src/mame/video/battlane.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98
109UINT8 *battlane_spriteram;
1110UINT8 *battlane_tileram;
r2454r2455
5150   bit2 = (~data >> 7) & 0x01;
5251   b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
5352
54   palette_set_color(Machine, offset, MAKE_RGB(r, g, b));
53   palette_set_color(machine, offset, MAKE_RGB(r, g, b));
5554}
5655
5756WRITE8_HANDLER( battlane_scrollx_w )
src/mame/video/genesis.c
r2454r2455
370370   {
371371      case 0x00:   /* Write data */
372372      case 0x01:
373         if (mem_mask)
373         if (mem_mask != 0xffff)
374374         {
375            data &= ~mem_mask;
375            data &= mem_mask;
376376             if (ACCESSING_BITS_8_15)
377377                data |= data >> 8;
378378             else
r2454r2455
383383
384384      case 0x02:   /* Control Write */
385385      case 0x03:
386         if (mem_mask)
386         if (mem_mask != 0xffff)
387387         {
388            data &= ~mem_mask;
388            data &= mem_mask;
389389             if (ACCESSING_BITS_8_15)
390390                data |= data >> 8;
391391             else
src/mame/video/thepit.c
r2454r2455
219219       horizontal flip switch. (This is how the real PCB does it) */
220220   if (thepit_flip_screen_x)
221221   {
222      return input_port_3_r(machine,offset);
222      return input_port_read_indexed(machine, 3);
223223   }
224224   else
225225   {
226      return input_port_0_r(machine,offset);
226      return input_port_read_indexed(machine, 0);
227227   }
228228}
229229
src/mame/video/rpunch.c
r2454r2455
77****************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110
1211
1312#define BITMAP_WIDTH   304
src/mame/video/cloud9.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "cloud9.h"
109#include "video/resnet.h"
1110
r2454r2455
112111   bit2 = (~b >> 2) & 0x01;
113112   b = combine_3_weights(bweights, bit0, bit1, bit2);
114113
115   palette_set_color(Machine, offset & 0x3f, MAKE_RGB(r, g, b));
114   palette_set_color(machine, offset & 0x3f, MAKE_RGB(r, g, b));
116115}
117116
118117
src/mame/video/changela.c
r2454r2455
1212***************************************************************************/
1313
1414#include "driver.h"
15#include "deprecat.h"
1615
1716
1817extern UINT8 changela_tree0_col;
r2454r2455
785784   g = color_table[(c >> 3) & 0x07];
786785   b = color_table[(c >> 6) & 0x07];
787786
788   palette_set_color_rgb(Machine,color_index,r,g,b);
787   palette_set_color_rgb(machine,color_index,r,g,b);
789788}
790789
791790
src/mame/video/subs.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "subs.h"
109#include "sound/discrete.h"
1110
r2454r2455
1312{
1413   if ((offset & 0x01) == 1)
1514   {
16      palette_set_color(Machine, 0, MAKE_RGB(0x00, 0x00, 0x00));
17      palette_set_color(Machine, 1, MAKE_RGB(0xFF, 0xFF, 0xFF));
15      palette_set_color(machine, 0, MAKE_RGB(0x00, 0x00, 0x00));
16      palette_set_color(machine, 1, MAKE_RGB(0xFF, 0xFF, 0xFF));
1817   }
1918   else
2019   {
21      palette_set_color(Machine, 1, MAKE_RGB(0x00, 0x00, 0x00));
22      palette_set_color(Machine, 0, MAKE_RGB(0xFF, 0xFF, 0xFF));
20      palette_set_color(machine, 1, MAKE_RGB(0x00, 0x00, 0x00));
21      palette_set_color(machine, 0, MAKE_RGB(0xFF, 0xFF, 0xFF));
2322   }
2423}
2524
r2454r2455
2726{
2827   if ((offset & 0x01) == 1)
2928   {
30      palette_set_color(Machine, 2, MAKE_RGB(0x00, 0x00, 0x00));
31      palette_set_color(Machine, 3, MAKE_RGB(0xFF, 0xFF, 0xFF));
29      palette_set_color(machine, 2, MAKE_RGB(0x00, 0x00, 0x00));
30      palette_set_color(machine, 3, MAKE_RGB(0xFF, 0xFF, 0xFF));
3231   }
3332   else
3433   {
35      palette_set_color(Machine, 3, MAKE_RGB(0x00, 0x00, 0x00));
36      palette_set_color(Machine, 2, MAKE_RGB(0xFF, 0xFF, 0xFF));
34      palette_set_color(machine, 3, MAKE_RGB(0x00, 0x00, 0x00));
35      palette_set_color(machine, 2, MAKE_RGB(0xFF, 0xFF, 0xFF));
3736   }
3837}
3938
src/mame/video/funybubl.c
r2454r2455
66
77
88#include "driver.h"
9#include "deprecat.h"
109
1110UINT8* funybubl_banked_videoram;
1211UINT8 *funybubl_paletteram;
r2454r2455
2423
2524   coldat = funybubl_paletteram[colchanged*4] | (funybubl_paletteram[colchanged*4+1] << 8) | (funybubl_paletteram[colchanged*4+2] << 16) | (funybubl_paletteram[colchanged*4+3] << 24);
2625
27   palette_set_color_rgb(Machine,colchanged,pal6bit(coldat >> 12),pal6bit(coldat >> 0),pal6bit(coldat >> 6));
26   palette_set_color_rgb(machine,colchanged,pal6bit(coldat >> 12),pal6bit(coldat >> 0),pal6bit(coldat >> 6));
2827}
2928
3029
src/mame/video/shisen.c
r2454r2455
11#include "driver.h"
2#include "deprecat.h"
32
43static int gfxbank;
54
r2454r2455
4140
4241   offset &= 0xff;
4342
44   palette_set_color_rgb(Machine, offset, pal5bit(paletteram[offset + 0x000]), pal5bit(paletteram[offset + 0x100]), pal5bit(paletteram[offset + 0x200]));
43   palette_set_color_rgb(machine, offset, pal5bit(paletteram[offset + 0x000]), pal5bit(paletteram[offset + 0x100]), pal5bit(paletteram[offset + 0x200]));
4544}
4645
4746static TILE_GET_INFO( get_bg_tile_info )
src/mame/video/m10.c
r2454r2455
6767
6868WRITE8_HANDLER( m15_chargen_w )
6969{
70   m10_state *state = Machine->driver_data;
70   m10_state *state = machine->driver_data;
7171
7272   if (state->chargen[offset] != data)
7373   {
7474      state->chargen[offset] = data;
7575      /* not very effective ... dirty would be better */
76      decodechar(Machine->gfx[0],offset >> 3,state->chargen);
76      decodechar(machine->gfx[0],offset >> 3,state->chargen);
7777   }
7878}
7979
src/mame/drivers/bfcobra.c
r2454r2455
711711         if (*count == 0)
712712         {
713713            rgb_t color;
714            color = palette_get_color(Machine, ramdac.addr_r);
714            color = palette_get_color(machine, ramdac.addr_r);
715715
716716            ramdac.color_r[0] = RGB_RED(color);
717717            ramdac.color_r[1] = RGB_GREEN(color);
r2454r2455
755755         ramdac.color_w[ramdac.count_w] = pal6bit(data);
756756         if (++ramdac.count_w == 3)
757757         {
758            palette_set_color_rgb(Machine, ramdac.addr_w, ramdac.color_w[0], ramdac.color_w[1], ramdac.color_w[2]);
758            palette_set_color_rgb(machine, ramdac.addr_w, ramdac.color_w[0], ramdac.color_w[1], ramdac.color_w[2]);
759759            ramdac.count_w = 0;
760760            ramdac.addr_w++;
761761         }
r2454r2455
12921292
12931293   for (pal = 0; pal < 256; ++pal)
12941294   {
1295      palette_set_color_rgb(Machine, pal, pal3bit((pal>>5)&7), pal3bit((pal>>2)&7), pal2bit(pal&3));
1295      palette_set_color_rgb(machine, pal, pal3bit((pal>>5)&7), pal3bit((pal>>2)&7), pal2bit(pal&3));
12961296   }
12971297
12981298   bank[0] = 1;
r2454r2455
13801380      if (changed & (1 << i))
13811381      {
13821382         Mechmtr_update(i, cycles, data & (1 << i) );
1383         cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, PULSE_LINE );
1383         cpunum_set_input_line(machine, 1, M6809_FIRQ_LINE, PULSE_LINE );
13841384      }
13851385    }
13861386}
src/mame/drivers/rcasino.c
r2454r2455
285285
286286static const struct AY8910interface ay8910_interface =
287287{
288   AY8910_LEGACY_OUTPUT,
289   AY8910_DEFAULT_LOADS,
288290   input_port_2_r,   // DSW1
289291   input_port_3_r,   // DSW2
290292   0,
src/mame/drivers/nycaptor.c
r2454r2455
192192
193193static WRITE8_HANDLER( sub_cpu_halt_w )
194194{
195   cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, (data )? ASSERT_LINE : CLEAR_LINE);
195   cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, (data )? ASSERT_LINE : CLEAR_LINE);
196196}
197197
198198static UINT8 snd_data;
r2454r2455
240240
241241static WRITE8_HANDLER( sound_cpu_reset_w )
242242{
243   cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data&1 )? ASSERT_LINE : CLEAR_LINE);
243   cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (data&1 )? ASSERT_LINE : CLEAR_LINE);
244244}
245245
246246static int vol_ctrl[16];
r2454r2455
284284   sound_nmi_enable = 1;
285285   if (pending_nmi)
286286   {
287      cpunum_set_input_line(Machine, 2,INPUT_LINE_NMI,PULSE_LINE);
287      cpunum_set_input_line(machine, 2,INPUT_LINE_NMI,PULSE_LINE);
288288      pending_nmi = 0;
289289   }
290290}
r2454r2455
296296
297297static const struct AY8910interface ay8910_interface =
298298{
299   0,
300   0,
299   AY8910_LEGACY_OUTPUT,
300   AY8910_DEFAULT_LOADS,
301   NULL,
302   NULL,
301303   unk_w,
302304   unk_w
303305};
src/mame/drivers/rainbow.c
r2454r2455
268268   if (ACCESSING_BITS_0_7)
269269   {
270270      jumping_latch = data & 0xff; /*M68000 writes .b to $400007*/
271      cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
271      cpunum_set_input_line(machine, 1,0,HOLD_LINE);
272272   }
273273}
274274
src/mame/drivers/blktiger.c
r2454r2455
236236
237237static const struct YM2203interface ym2203_interface =
238238{
239   0,
240   0,
241   0,
242   0,
239   {
240         AY8910_LEGACY_OUTPUT,
241         AY8910_DEFAULT_LOADS,
242         NULL, NULL, NULL, NULL,
243   },
243244   irqhandler
244245};
245246
src/mame/drivers/deco_mlc.c
r2454r2455
143143
144144static WRITE32_HANDLER( avengrs_eprom_w )
145145{
146   if (mem_mask==0xffff00ff) {
146   if (ACCESSING_BITS_8_15) {
147147      UINT8 ebyte=(data>>8)&0xff;
148148//      if (ebyte&0x80) {
149149         EEPROM_set_clock_line((ebyte & 0x2) ? ASSERT_LINE : CLEAR_LINE);
r2454r2455
151151         EEPROM_set_cs_line((ebyte & 0x4) ? CLEAR_LINE : ASSERT_LINE);
152152//      }
153153   }
154   else if (mem_mask==0xffffff00) {
154   else if (ACCESSING_BITS_0_7) {
155155      //volume control todo
156156   }
157157   else
r2454r2455
162162{
163163   COMBINE_DATA(&paletteram32[offset]);
164164   /* x bbbbb ggggg rrrrr */
165   palette_set_color_rgb(Machine,offset,pal5bit(paletteram32[offset] >> 0),pal5bit(paletteram32[offset] >> 5),pal5bit(paletteram32[offset] >> 10));
165   palette_set_color_rgb(machine,offset,pal5bit(paletteram32[offset] >> 0),pal5bit(paletteram32[offset] >> 5),pal5bit(paletteram32[offset] >> 10));
166166}
167167
168168static READ32_HANDLER( avengrs_sound_r )
169169{
170   if (mem_mask==0x00ffffff) {
170   if (ACCESSING_BITS_24_31) {
171171      return YMZ280B_status_0_r(machine,0)<<24;
172172   } else {
173173      logerror("%08x:  non-byte read from sound mask %08x\n",activecpu_get_pc(),mem_mask);
r2454r2455
178178
179179static WRITE32_HANDLER( avengrs_sound_w )
180180{
181   if (mem_mask==0x00ffffff) {
181   if (ACCESSING_BITS_24_31) {
182182      if (offset)
183183         YMZ280B_data_0_w(machine,0,data>>24);
184184      else
r2454r2455
218218   switch (offset*4)
219219   {
220220   case 0x10: /* IRQ ack.  Value written doesn't matter */
221      cpunum_set_input_line(Machine, 0, mainCpuIsArm ? ARM_IRQ_LINE : 1, CLEAR_LINE);
221      cpunum_set_input_line(machine, 0, mainCpuIsArm ? ARM_IRQ_LINE : 1, CLEAR_LINE);
222222      return;
223223      break;
224224   case 0x14: /* Prepare scanline interrupt */
src/mame/drivers/tryout.c
r2454r2455
3030
3131static WRITE8_HANDLER( tryout_nmi_ack_w )
3232{
33   cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE );
33   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE );
3434}
3535
3636static WRITE8_HANDLER( tryout_sound_w )
src/mame/drivers/pasha2.c
r2454r2455
7272*********************************************************************/
7373
7474#include "driver.h"
75#include "deprecat.h"
7675#include "machine/eeprom.h"
7776#include "sound/okim6295.h"
7877
r2454r2455
114113   offset &= 0xff;
115114
116115   color = (paletteram16[offset] >> 8) | (paletteram16[offset+0x100] & 0xff00);
117   palette_set_color_rgb(Machine,offset*2+0,pal5bit(color),pal5bit(color >> 5),pal5bit(color >> 10));
116   palette_set_color_rgb(machine,offset*2+0,pal5bit(color),pal5bit(color >> 5),pal5bit(color >> 10));
118117
119118   color = (paletteram16[offset] & 0xff) | ((paletteram16[offset+0x100] & 0xff) << 8);
120   palette_set_color_rgb(Machine,offset*2+1,pal5bit(color),pal5bit(color >> 5),pal5bit(color >> 10));
119   palette_set_color_rgb(machine,offset*2+1,pal5bit(color),pal5bit(color >> 5),pal5bit(color >> 10));
121120}
122121
123122static WRITE16_HANDLER( vbuffer_set_w )
r2454r2455
140139   // handle overlapping pixels without writing them
141140   switch(mem_mask)
142141   {
143      case 0:
144         bitmap_1_w(machine,offset,data,0x00ff);
142      case 0xffff:
145143         bitmap_1_w(machine,offset,data,0xff00);
144         bitmap_1_w(machine,offset,data,0x00ff);
146145         return;
147146
148      case 0x00ff:
147      case 0xff00:
149148         if((data & 0xff00) == 0xff00)
150149            return;
151150      break;
152151
153      case 0xff00:
152      case 0x00ff:
154153         if((data & 0x00ff) == 0x00ff)
155154            return;
156155      break;
src/mame/drivers/rungun.c
r2454r2455
3636*/
3737
3838#include "driver.h"
39#include "deprecat.h"
4039
4140#include "video/konamiic.h"
4241#include "cpu/m68000/m68000.h"
r2454r2455
119118                bit8 : freeze
120119                bit9 : joysticks layout(auto detect???)
121120            */
122         return(input_port_0_word_r(machine, 0, 0));
121         return input_port_read_indexed(machine, 0);
123122      break;
124123
125124      case 0x06/2:
r2454r2455
163162         }
164163
165164         if (!(data & 0x40))
166            cpunum_set_input_line(Machine, 0, MC68000_IRQ_5, CLEAR_LINE);
165            cpunum_set_input_line(machine, 0, MC68000_IRQ_5, CLEAR_LINE);
167166      break;
168167
169168      case 0x0c/2:
r2454r2455
193192static WRITE16_HANDLER( sound_irq_w )
194193{
195194   if (ACCESSING_BITS_8_15)
196      cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
195      cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
197196}
198197
199198static READ16_HANDLER( sound_status_msb_r )
r2454r2455
266265   memory_set_bankptr(2, memory_region(REGION_CPU2) + 0x10000 + (data & 0x07) * 0x4000);
267266
268267   if (data & 0x10)
269      cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
268      cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
270269}
271270
272271static INTERRUPT_GEN(audio_interrupt)
src/mame/drivers/crystal.c
r2454r2455
168168
169169static WRITE32_HANDLER(FlipCount_w)
170170{
171   if((~mem_mask)&0x00ff0000)
171   if(mem_mask&0x00ff0000)
172172   {
173173      int fc=(data>>16)&0xff;
174174      if(fc==1)
r2454r2455
200200static WRITE32_HANDLER(IntAck_w)
201201{
202202   UINT32 IntPend=program_read_dword_32le(0x01800c0c);
203   if((~mem_mask)&0xff)
203   if(mem_mask&0xff)
204204   {
205205      IntPend&=~(1<<(data&0x1f));
206206      program_write_dword_32le(0x01800c0c,IntPend);
207207      if(!IntPend)
208208         cpunum_set_input_line(machine, 0,SE3208_INT,CLEAR_LINE);
209209   }
210   if((~mem_mask)&0xff00)
210   if(mem_mask&0xff00)
211211      IntHigh=(data>>8)&7;
212212}
213213
src/mame/drivers/tempest.c
r2454r2455
304304
305305static WRITE8_HANDLER( wdclr_w )
306306{
307   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
307   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
308308   watchdog_reset(Machine);
309309}
310310
src/mame/drivers/bublbobl.c
r2454r2455
325325#if 0 // doesn't work for some reason
326326static WRITE8_HANDLER(soundcpu_reset_w)
327327{
328   cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 0x01) ? ASSERT_LINE : CLEAR_LINE);
328   cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (data & 0x01) ? ASSERT_LINE : CLEAR_LINE);
329329}
330330#endif
331331
r2454r2455
723723
724724static const struct YM2203interface ym2203_interface =
725725{
726   0,
727   0,
728   0,
729   0,
726   {
727      AY8910_LEGACY_OUTPUT,
728      AY8910_DEFAULT_LOADS,
729      NULL, NULL, NULL, NULL
730   },
730731   irqhandler
731732};
732733
src/mame/drivers/chinsan.c
r2454r2455
9797
9898static const struct YM2203interface ym2203_interface =
9999{
100   input_port_0_r,
101   input_port_1_r,
102   ym_port_w1,
103   ym_port_w2
100   {
101      AY8910_LEGACY_OUTPUT,
102      AY8910_DEFAULT_LOADS,
103      input_port_0_r,
104      input_port_1_r,
105      ym_port_w1,
106      ym_port_w2
107   },
104108};
105109
106110static WRITE8_HANDLER( chinsan_port00_w )
src/mame/drivers/cshooter.c
r2454r2455
242242{
243243   paletteram[offset]=data;
244244   offset&=0xff;
245   palette_set_color_rgb(Machine, offset, pal4bit(paletteram[offset] >> 4), pal4bit(paletteram[offset]), pal4bit(paletteram[offset+0x100]));
245   palette_set_color_rgb(machine, offset, pal4bit(paletteram[offset] >> 4), pal4bit(paletteram[offset]), pal4bit(paletteram[offset+0x100]));
246246}
247247
248248static WRITE8_HANDLER(pal2_w)
249249{
250250   paletteram[offset]=data;
251251   offset&=0x1ff;
252   palette_set_color_rgb(Machine, offset, pal4bit(paletteram[offset] >> 4), pal4bit(paletteram[offset]), pal4bit(paletteram[offset+0x200]));
252   palette_set_color_rgb(machine, offset, pal4bit(paletteram[offset] >> 4), pal4bit(paletteram[offset]), pal4bit(paletteram[offset+0x200]));
253253}
254254
255255static READ8_HANDLER(pal_r)
src/mame/drivers/aerofgt.c
r2454r2455
9999VIDEO_UPDATE( turbofrc );
100100VIDEO_UPDATE( aerofgt );
101101VIDEO_UPDATE( aerfboot );
102VIDEO_UPDATE( aerfboo2 );
102103VIDEO_START( wbbc97 );
103104VIDEO_UPDATE( wbbc97 );
104105
r2454r2455
362363   AM_RANGE(0x0e0000, 0x0e3fff) AM_RAM AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size)
363364   AM_RANGE(0x0e4000, 0x0e7fff) AM_RAM AM_BASE(&aerofgt_spriteram2) AM_SIZE(&aerofgt_spriteram2_size)
364365   AM_RANGE(0x0f8000, 0x0fbfff) AM_RAM   /* work RAM */
365   AM_RANGE(0x0fc000, 0x0fc7ff) AM_RAM //AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
366   AM_RANGE(0x0fc000, 0x0fc7ff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
366367   AM_RANGE(0x0fd000, 0x0fd7ff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
367368   AM_RANGE(0x0fe000, 0x0fe001) AM_READ(input_port_0_word_r)
368369   AM_RANGE(0x0fe002, 0x0fe003) AM_READ(input_port_1_word_r)
r2454r2455
377378   AM_RANGE(0x0fe400, 0x0fe401) AM_WRITENOP
378379   AM_RANGE(0x0fe402, 0x0fe403) AM_WRITENOP
379380   AM_RANGE(0x0ff000, 0x0fffff) AM_RAM AM_BASE(&aerofgt_rasterram)   /* used only for the scroll registers */
380   AM_RANGE(0x108000, 0x10bfff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
381381ADDRESS_MAP_END
382382
383383static ADDRESS_MAP_START( wbbc97_map, ADDRESS_SPACE_PROGRAM, 16 )
r2454r2455
16871687   MDRV_PALETTE_LENGTH(1024)
16881688
16891689   MDRV_VIDEO_START(turbofrc)
1690   MDRV_VIDEO_UPDATE(aerfboot)
1690   MDRV_VIDEO_UPDATE(aerfboo2)
16911691
16921692   /* sound hardware */
16931693   MDRV_SPEAKER_STANDARD_MONO("mono")
r2454r2455
24592459GAME( 1992, aerofgtc, aerofgt,  aerofgtb, aerofgtb, 0, ROT270, "Video System Co.", "Aero Fighters (Turbo Force hardware set 2)", GAME_NO_COCKTAIL )
24602460GAME( 1992, sonicwi,  aerofgt,  aerofgtb, aerofgtb, 0, ROT270, "Video System Co.", "Sonic Wings (Japan)", GAME_NO_COCKTAIL )
24612461GAME( 1992, aerfboot, aerofgt,  aerfboot, aerofgtb, 0, ROT270, "bootleg",          "Aero Fighters (bootleg set 1)", GAME_NO_COCKTAIL | GAME_NO_SOUND )
2462GAME( 1992, aerfboo2, aerofgt,  aerfboo2, aerofgtb, 0, ROT270, "bootleg",          "Aero Fighters (bootleg set 2)", GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_NOT_WORKING)
2462GAME( 1992, aerfboo2, aerofgt,  aerfboo2, aerofgtb, 0, ROT270, "bootleg",          "Aero Fighters (bootleg set 2)", GAME_NO_COCKTAIL | GAME_NO_SOUND )
24632463GAME( 1997, wbbc97,   0,        wbbc97,   wbbc97,   0, ROT0,   "Comad",            "Beach Festival World Championship 1997", GAME_NO_COCKTAIL )
src/mame/drivers/fgoal.c
r2454r2455
1717***************************************************************************/
1818
1919#include "driver.h"
20#include "deprecat.h"
2120#include "includes/fgoal.h"
2221
2322UINT8* fgoal_video_ram;
r2454r2455
129128
130129static READ8_HANDLER( fgoal_nmi_reset_r )
131130{
132   cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
131   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
133132
134133   return 0;
135134}
r2454r2455
137136
138137static READ8_HANDLER( fgoal_irq_reset_r )
139138{
140   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
139   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
141140
142141   return 0;
143142}
src/mame/drivers/coinmstr.c
r2454r2455
621621
622622static const struct AY8910interface ay8912_interface =
623623{
624   input_port_4_r
624   AY8910_LEGACY_OUTPUT,
625   AY8910_DEFAULT_LOADS,
626   input_port_4_r,
627   NULL,
628   NULL,
629   NULL
625630};
626631
627632static MACHINE_DRIVER_START( coinmstr )
src/mame/drivers/expro02.c
r2454r2455
223223static WRITE16_HANDLER( galsnew_paletteram_w )
224224{
225225   data = COMBINE_DATA(&paletteram16[offset]);
226   palette_set_color_rgb(Machine,offset,pal5bit(data >> 6),pal5bit(data >> 11),pal5bit(data >> 1));
226   palette_set_color_rgb(machine,offset,pal5bit(data >> 6),pal5bit(data >> 11),pal5bit(data >> 1));
227227}
228228
229229static WRITE16_HANDLER( galsnew_6295_bankswitch_w )
src/mame/drivers/ultrsprt.c
r2454r2455
143143static WRITE16_HANDLER( K056800_68k_w )
144144{
145145   if (ACCESSING_BITS_8_15)
146      K056800_sound_w(machine, (offset*2)+0, (data >> 8) & 0xff, 0xffff);
146      K056800_sound_w(machine, (offset*2)+0, (data >> 8) & 0xff, 0x00ff);
147147
148148   if (ACCESSING_BITS_0_7)
149      K056800_sound_w(machine, (offset*2)+1, (data >> 0) & 0xff, 0xffff);
149      K056800_sound_w(machine, (offset*2)+1, (data >> 0) & 0xff, 0x00ff);
150150}
151151
152152static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 16 )
src/mame/drivers/mainsnk.c
r2454r2455
7171*/
7272
7373#include "driver.h"
74#include "deprecat.h"
7574#include "sound/ay8910.h"
7675#include "sound/namco.h"
7776
r2454r2455
10099   sound_fetched = 0;
101100   sound_command = data;
102101   sound_cpu_ready = 0;
103   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
102   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
104103}
105104
106105static READ8_HANDLER( sound_command_r )
r2454r2455
117116
118117static READ8_HANDLER( mainsnk_port_0_r )
119118{
120   int result = input_port_0_r( machine, 0 );
119   int result = input_port_read_indexed( machine, 0 );
121120   if( !sound_cpu_ready ) result |= 0x20;
122121   return result;
123122}
src/mame/drivers/senjyo.c
r2454r2455
6969***************************************************************************/
7070
7171#include "driver.h"
72#include "deprecat.h"
7372#include "machine/z80ctc.h"
7473#include "machine/z80pio.h"
7574#include "sound/sn76496.h"
r2454r2455
155154   b = (data >> 2) & 0x0c;
156155   if (b) b |= i;
157156
158   palette_set_color_rgb(Machine,offset,pal4bit(r),pal4bit(g),pal4bit(b));
157   palette_set_color_rgb(machine,offset,pal4bit(r),pal4bit(g),pal4bit(b));
159158}
160159
161160
src/mame/drivers/segaxbd.c
r2454r2455
352352            */
353353         if (((oldval ^ data) & 0x40) && !(data & 0x40)) watchdog_reset_w(machine,0,0);
354354         segaic16_set_display_enable(data & 0x20);
355         cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
355         cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
356356         return;
357357
358358      case 3:
r2454r2455
482482
483483static WRITE16_HANDLER( smgp_excs_w )
484484{
485   logerror("%06X:smgp_excs_w(%04X) = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask ^ 0xffff);
485   logerror("%06X:smgp_excs_w(%04X) = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask);
486486}
487487
488488
src/mame/drivers/sonson.c
r2454r2455
7171   if (last == 0 && data == 1)
7272   {
7373      /* setting bit 0 low then high triggers IRQ on the sound CPU */
74      cpunum_set_input_line(Machine, 1,M6809_FIRQ_LINE,HOLD_LINE);
74      cpunum_set_input_line(machine, 1,M6809_FIRQ_LINE,HOLD_LINE);
7575   }
7676
7777   last = data;
src/mame/drivers/sslam.c
r2454r2455
8181
8282
8383#include "driver.h"
84#include "deprecat.h"
8584#include "cpu/i8051/i8051.h"
8685#include "sound/okim6295.h"
8786
src/mame/drivers/simpl156.c
r2454r2455
9191extern void decrypt156(void);
9292
9393#include "driver.h"
94#include "deprecat.h"
9594#include "decocrpt.h"
9695#include "deco32.h"
9796#include "cpu/arm/arm.h"
r2454r2455
164163   color = offset;
165164
166165   dat = paletteram16[offset]&0xffff;
167   palette_set_color_rgb(Machine,color,pal5bit(dat >> 0),pal5bit(dat >> 5),pal5bit(dat >> 10));
166   palette_set_color_rgb(machine,color,pal5bit(dat >> 0),pal5bit(dat >> 5),pal5bit(dat >> 10));
168167}
169168
170169
src/mame/drivers/hcastle.c
r2454r2455
3838
3939static WRITE8_HANDLER( hcastle_soundirq_w )
4040{
41   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE );
41   cpunum_set_input_line(machine, 1, 0, HOLD_LINE );
4242}
4343
4444static WRITE8_HANDLER( hcastle_coin_w )
src/mame/drivers/cliffhgr.c
r2454r2455
190190static READ8_HANDLER( cliff_irq_ack_r )
191191{
192192   /* deassert IRQ on the CPU */
193   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
193   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
194194
195195   return 0x00;
196196}
src/mame/drivers/cntsteer.c
r2454r2455
282282static WRITE8_HANDLER( gekitsui_int_w )
283283{
284284//  if (errorlog) fprintf(errorlog,"%04x: CPU 2 causes NMI\n",cpu_get_pc());
285   cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, ASSERT_LINE);
285   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE);
286286}
287287static WRITE8_HANDLER( gekitsui_int2_w ) // not used..
288288{
289289//  if (errorlog) fprintf(errorlog,"%04x: CPU 1 causes IRQ\n",cpu_get_pc());
290   cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, ASSERT_LINE);
290   cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, ASSERT_LINE);
291291}
292292#endif
293293
294294static WRITE8_HANDLER( gekitsui_sub_irq_ack )
295295{
296   cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, CLEAR_LINE);
296   cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, CLEAR_LINE);
297297}
298298
299299#if 0
300300static WRITE8_HANDLER( cntsteer_int_w )
301301{
302   cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, ASSERT_LINE);
302   cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, ASSERT_LINE);
303303}
304304#endif
305305
r2454r2455
311311static WRITE8_HANDLER( zerotrgt_ctrl_w )
312312{
313313   logerror("CTRL: %04x: %04x: %04x\n",activecpu_get_pc(),offset,data);
314//  if (offset==0) cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
314//  if (offset==0) cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
315315
316316   // Wrong - bits 0 & 1 used on this
317   if (offset==1) cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, ASSERT_LINE);
318//  if (offset==2) cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
317   if (offset==1) cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, ASSERT_LINE);
318//  if (offset==2) cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
319319}
320320
321321#if 0
src/mame/drivers/bking.c
r2454r2455
1616***************************************************************************/
1717
1818#include "driver.h"
19#include "deprecat.h"
2019#include "cpu/m6805/m6805.h"
2120#include "sound/ay8910.h"
2221#include "sound/dac.h"
r2454r2455
214213   if (~data & 0x02)
215214   {
216215      portA_in = from_main;
217      if (main_sent) cpunum_set_input_line(Machine, 2,0,CLEAR_LINE);
216      if (main_sent) cpunum_set_input_line(machine, 2,0,CLEAR_LINE);
218217      main_sent = 0;
219218   }
220219
r2454r2455
432431
433432static const struct AY8910interface ay8910_interface =
434433{
435   0,
436   0,
434   AY8910_LEGACY_OUTPUT,
435   AY8910_DEFAULT_LOADS,
436   NULL,
437   NULL,
437438   DAC_0_signed_data_w,
438439   portb_w
439440};
src/mame/drivers/battlnts.c
r2454r2455
1111***************************************************************************/
1212
1313#include "driver.h"
14#include "deprecat.h"
1514#include "cpu/hd6309/hd6309.h"
1615#include "cpu/z80/z80.h"
1716#include "video/konamiic.h"
r2454r2455
3029
3130static WRITE8_HANDLER( battlnts_sh_irqtrigger_w )
3231{
33   cpunum_set_input_line_and_vector(Machine, 1, 0, HOLD_LINE, 0xff);
32   cpunum_set_input_line_and_vector(machine, 1, 0, HOLD_LINE, 0xff);
3433}
3534
3635static WRITE8_HANDLER( battlnts_bankswitch_w )
src/mame/drivers/dblewing.c
r2454r2455
282282   if ((offset*2)==0x104) { dblwings_104_data = data; return; } // p1 inputs select screen  OK
283283   if ((offset*2)==0x200) { dblwings_200_data = data; return; }
284284   if ((offset*2)==0x28c) { dblwings_28c_data = data; return; }
285   if ((offset*2)==0x380) { soundlatch_w(machine,0,data&0xff);   /*cpunum_set_input_line(Machine, 1,0,HOLD_LINE);*/ return; } // sound write
285   if ((offset*2)==0x380) { soundlatch_w(machine,0,data&0xff);   /*cpunum_set_input_line(machine, 1,0,HOLD_LINE);*/ return; } // sound write
286286   if ((offset*2)==0x38e) { dblwings_38e_data = data; return; }
287287   if ((offset*2)==0x406) { dblwings_406_data = data; return; } // p2 inputs select screen  OK
288288   if ((offset*2)==0x408) { dblwings_408_data = data; return; } // 3rd player 1st level?
src/mame/drivers/arabian.c
r2454r2455
332332
333333static const struct AY8910interface ay8910_interface =
334334{
335   0,
336   0,
335   AY8910_LEGACY_OUTPUT,
336   AY8910_DEFAULT_LOADS,
337   NULL,
338   NULL,
337339   ay8910_porta_w,
338340   ay8910_portb_w
339341};
src/mame/drivers/labyrunr.c
r2454r2455
224224
225225static const struct YM2203interface ym2203_interface_1 =
226226{
227   input_port_0_r,
228   input_port_1_r
227   {
228      AY8910_LEGACY_OUTPUT,
229      AY8910_DEFAULT_LOADS,
230      input_port_0_r,
231      input_port_1_r,
232      NULL,
233      NULL
234   },
235   NULL
229236};
230237
231238static const struct YM2203interface ym2203_interface_2 =
232239{
233   0,
234   input_port_2_r
240   {
241      AY8910_LEGACY_OUTPUT,
242      AY8910_DEFAULT_LOADS,
243      NULL,
244      input_port_2_r,
245      NULL,
246      NULL
247   },
248   NULL
235249};
236250
237251
src/mame/drivers/shougi.c
r2454r2455
8282
8383
8484#include "driver.h"
85#include "deprecat.h"
8685#include "cpu/z80/z80.h"
8786#include "sound/ay8910.h"
8887#include "video/resnet.h"
r2454r2455
221220static WRITE8_HANDLER( shougi_mcu_halt_off_w )
222221{
223222   /* logerror("mcu HALT OFF"); */
224   cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, CLEAR_LINE);
223   cpunum_set_input_line(machine, 2, INPUT_LINE_HALT, CLEAR_LINE);
225224}
226225
227226static WRITE8_HANDLER( shougi_mcu_halt_on_w )
228227{
229228   /* logerror("mcu HALT ON"); */
230   cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT,ASSERT_LINE);
229   cpunum_set_input_line(machine, 2, INPUT_LINE_HALT,ASSERT_LINE);
231230}
232231
233232
r2454r2455
238237   nmi_enabled = 0; /* disable NMIs */
239238
240239   /* NMI lines are tied together on both CPUs and connected to the LS74 /Q output */
241   cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
242   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
240   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
241   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
243242}
244243
245244static WRITE8_HANDLER( nmi_enable_w )
src/mame/drivers/hornet.c
r2454r2455
416416      }
417417      else if (offset >= 0x18000/4)
418418      {
419         update_palette_color(Machine, chip, 0x18000, offset - (0x18000/4));
419         update_palette_color(machine, chip, 0x18000, offset - (0x18000/4));
420420      }
421421   }
422422   else
423423   {
424424      if (offset < 0x8000/4)
425425      {
426         update_palette_color(Machine, chip, 0, offset);
426         update_palette_color(machine, chip, 0, offset);
427427      }
428428      else if (offset >= 0x8000/4 && offset < 0x18000/4)
429429      {
r2454r2455
643643      {
644644         if (data & 0x80)   /* CG Board 1 IRQ Ack */
645645         {
646            cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ1, CLEAR_LINE);
646            cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ1, CLEAR_LINE);
647647         }
648648         if (data & 0x40)   /* CG Board 0 IRQ Ack */
649649         {
650            cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, CLEAR_LINE);
650            cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, CLEAR_LINE);
651651         }
652652         set_cgboard_id((data >> 4) & 0x3);
653653      }
src/mame/drivers/pipedrm.c
r2454r2455
201201static WRITE8_HANDLER( pending_command_clear_w )
202202{
203203   pending_command = 0;
204   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
204   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
205205}
206206
207207
r2454r2455
533533
534534static const struct YM2608interface ym2608_interface =
535535{
536   0,0,0,0,irqhandler,
536   {
537      AY8910_LEGACY_OUTPUT,
538      AY8910_DEFAULT_LOADS,
539      NULL, NULL, NULL, NULL
540   },
541   irqhandler,
537542   REGION_SOUND1
538543};
539544
src/mame/drivers/ccastles.c
r2454r2455
120120***************************************************************************/
121121
122122#include "driver.h"
123#include "deprecat.h"
124123#include "sound/pokey.h"
125124#include "ccastles.h"
126125
r2454r2455
265264{
266265   if (irq_state)
267266   {
268      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
267      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
269268      irq_state = 0;
270269   }
271270}
src/mame/drivers/exterm.c
r2454r2455
6161****************************************************************************/
6262
6363#include "driver.h"
64#include "deprecat.h"
6564#include "cpu/tms34010/tms34010.h"
6665#include "cpu/m6502/m6502.h"
6766#include "sound/dac.h"
r2454r2455
156155   aimpos[which] = (aimpos[which] + trackball_diff) & 0x3f;
157156
158157   /* Combine it with the standard input bits */
159   port = which ? input_port_1_word_r(machine, 0, mem_mask) :
160               input_port_0_word_r(machine, 0, mem_mask);
158   port = which ? input_port_read_indexed(machine,1) : input_port_read_indexed(machine,0);
161159
162160   return (port & 0xc0ff) | (aimpos[which] << 8);
163161}
r2454r2455
200198   {
201199      /* Bit 13 = Resets the slave CPU */
202200      if ((data & 0x2000) && !(last & 0x2000))
203         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE);
201         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, PULSE_LINE);
204202
205203      /* Bits 14-15 = Coin counters */
206204      coin_counter_w(0, data & 0x8000);
r2454r2455
265263static READ8_HANDLER( sound_master_latch_r )
266264{
267265   /* read latch and clear interrupt */
268   cpunum_set_input_line(Machine, 2, M6502_IRQ_LINE, CLEAR_LINE);
266   cpunum_set_input_line(machine, 2, M6502_IRQ_LINE, CLEAR_LINE);
269267   return master_sound_latch;
270268}
271269
r2454r2455
273271static READ8_HANDLER( sound_slave_latch_r )
274272{
275273   /* read latch and clear interrupt */
276   cpunum_set_input_line(Machine, 3, M6502_IRQ_LINE, CLEAR_LINE);
274   cpunum_set_input_line(machine, 3, M6502_IRQ_LINE, CLEAR_LINE);
277275   return slave_sound_latch;
278276}
279277
r2454r2455
289287static READ8_HANDLER( sound_nmi_to_slave_r )
290288{
291289   /* a read from here triggers an NMI pulse to the slave */
292   cpunum_set_input_line(Machine, 3, INPUT_LINE_NMI, PULSE_LINE);
290   cpunum_set_input_line(machine, 3, INPUT_LINE_NMI, PULSE_LINE);
293291   return 0xff;
294292}
295293
src/mame/drivers/discoboy.c
r2454r2455
202202static WRITE8_HANDLER( discoboy_port_03_w ) // sfx? (to sound cpu)
203203{
204204//  printf("unk discoboy_port_03_w %02x\n",data);
205//  cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,HOLD_LINE);
205//  cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,HOLD_LINE);
206206   soundlatch_w(machine,0,data);
207207   cpunum_set_input_line(machine, 1,0,HOLD_LINE);
208208}
src/mame/drivers/ambush.c
r2454r2455
161161
162162static const struct AY8910interface ay8910_interface_1 =
163163{
164   input_port_0_r
164   AY8910_LEGACY_OUTPUT,
165   AY8910_DEFAULT_LOADS,
166   input_port_0_r,
167   NULL,
168   NULL,
169   NULL
165170};
166171
167172static const struct AY8910interface ay8910_interface_2 =
168173{
169   input_port_1_r
174   AY8910_LEGACY_OUTPUT,
175   AY8910_DEFAULT_LOADS,
176   input_port_1_r,
177   NULL,
178   NULL,
179   NULL
170180};
171181
172182
src/mame/drivers/policetr.c
r2454r2455
188188   /* toggling BSMT off then on causes a reset */
189189   if (!(old & 0x80000000) && (control_data & 0x80000000))
190190   {
191      BSMT2000_data_0_w(machine, bsmt_data_bank, 0, 0);
191      BSMT2000_data_0_w(machine, bsmt_data_bank, 0, 0xffff);
192192      sndti_reset(SOUND_BSMT2000, 0);
193193   }
194194
195195   /* log any unknown bits */
196196   if (data & 0x4f1fffff)
197      logerror("%08X: control_w = %08X & %08X\n", activecpu_get_previouspc(), data, ~mem_mask);
197      logerror("%08X: control_w = %08X & %08X\n", activecpu_get_previouspc(), data, mem_mask);
198198}
199199
200200
r2454r2455
208208static WRITE32_HANDLER( bsmt2000_reg_w )
209209{
210210   if (control_data & 0x80000000)
211      BSMT2000_data_0_w(machine, bsmt_reg, data & 0xffff, mem_mask | 0xffff0000);
211      BSMT2000_data_0_w(machine, bsmt_reg, data & 0xffff, mem_mask & 0xffff);
212212   else
213213      COMBINE_DATA(&bsmt_data_offset);
214214}
src/mame/drivers/seibuspi.c
r2454r2455
841841
842842static READ32_HANDLER( spi_int_r )
843843{
844   cpunum_set_input_line(Machine, 0, 0,CLEAR_LINE );
844   cpunum_set_input_line(machine, 0, 0,CLEAR_LINE );
845845   return 0xffffffff;
846846}
847847
r2454r2455
913913   if( ACCESSING_BITS_0_7 ) {
914914      if( data & 0x1 ) {
915915         z80_prg_fifo_pos = 0;
916         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE );
916         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE );
917917      } else {
918         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE );
918         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE );
919919      }
920920   }
921921}
r2454r2455
10081008   UINT8 *sound = (UINT8*)memory_region(REGION_USER2);
10091009   UINT16 *sound16 = (UINT16*)memory_region(REGION_USER2);
10101010
1011   if (mem_mask == 0xffffff00)
1011   if (mem_mask == 0x000000ff)
10121012   {
10131013      return sound[offset];
10141014   }
1015   else if (mem_mask == 0x00000000)
1015   else if (mem_mask == 0xffffffff)
10161016   {
10171017      if (offset < 0x100000)
10181018      {
src/mame/drivers/coolpool.c
r2454r2455
2525***************************************************************************/
2626
2727#include "driver.h"
28#include "deprecat.h"
2928#include "cpu/tms34010/tms34010.h"
3029#include "cpu/tms34010/34010ops.h"
3130#include "cpu/tms32025/tms32025.h"
r2454r2455
221220   coin_counter_w(0, ~data & 0x0001);
222221   coin_counter_w(1, ~data & 0x0002);
223222
224   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x0400) ? ASSERT_LINE : CLEAR_LINE);
223   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 0x0400) ? ASSERT_LINE : CLEAR_LINE);
225224
226225   /* bits 10-15 are counted down over time */
227226   if (data & 0x0400) amerdart_iop_echo = 1;
r2454r2455
298297   coin_counter_w(0, ~data & 0x0001);
299298   coin_counter_w(1, ~data & 0x0002);
300299
301   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x0400) ? ASSERT_LINE : CLEAR_LINE);
300   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 0x0400) ? ASSERT_LINE : CLEAR_LINE);
302301}
303302
304303
r2454r2455
331330static READ16_HANDLER( coolpool_iop_r )
332331{
333332   logerror("%08x:IOP read %04x\n",activecpu_get_pc(),iop_answer);
334   cpunum_set_input_line(Machine, 0, 1, CLEAR_LINE);
333   cpunum_set_input_line(machine, 0, 1, CLEAR_LINE);
335334
336335   return iop_answer;
337336}
r2454r2455
357356{
358357   logerror("%08x:IOP answer %04x\n",activecpu_get_pc(),data);
359358   iop_answer = data;
360   cpunum_set_input_line(Machine, 0, 1, ASSERT_LINE);
359   cpunum_set_input_line(machine, 0, 1, ASSERT_LINE);
361360}
362361
363362
src/mame/drivers/mwarr.c
r2454r2455
3939*/
4040
4141#include "driver.h"
42#include "deprecat.h"
4342#include "sound/okim6295.h"
4443
4544static tilemap *bg_tilemap, *mlow_tilemap, *mhigh_tilemap, *tx_tilemap;
r2454r2455
124123   brightness = (double)(data & 0xff);
125124   for (i=0;i<0x800;i++)
126125   {
127      palette_set_brightness(Machine, i, brightness/255);
126      palette_set_brightness(machine, i, brightness/255);
128127   }
129128}
130129
src/mame/drivers/gaplus.c
r2454r2455
150150***************************************************************************/
151151
152152#include "driver.h"
153#include "deprecat.h"
154153#include "machine/namcoio.h"
155154#include "sound/namco.h"
156155#include "sound/samples.h"
r2454r2455
275274   int bit = !BIT(offset,11);
276275   cpu_interrupt_enable(0,bit);
277276   if (!bit)
278      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
277      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
279278}
280279
281280static WRITE8_HANDLER( gaplus_irq_3_ctrl_w )
r2454r2455
283282   int bit = !BIT(offset,13);
284283   cpu_interrupt_enable(2,bit);
285284   if (!bit)
286      cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE);
285      cpunum_set_input_line(machine, 2, 0, CLEAR_LINE);
287286}
288287
289288static WRITE8_HANDLER( gaplus_irq_2_ctrl_w )
r2454r2455
291290   int bit = offset & 1;
292291   cpu_interrupt_enable(1,bit);
293292   if (!bit)
294      cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
293      cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
295294}
296295
297296static WRITE8_HANDLER( gaplus_sreset_w )
298297{
299298   int bit = !BIT(offset,11);
300    cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
301    cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
299    cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
300    cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
302301   mappy_sound_enable(bit);
303302}
304303
src/mame/drivers/vroulet.c
r2454r2455
3535*/
3636
3737#include "driver.h"
38#include "deprecat.h"
3938#include "machine/8255ppi.h"
4039#include "sound/ay8910.h"
4140
r2454r2455
5958      {
6059         a=paletteram[((i*8+j)*2)&0xff ];
6160         b=paletteram[((i*8+j)*2+1)&0xff ];
62         palette_set_color_rgb(Machine,i*16+j,pal4bit(b),pal4bit(b>>4),pal4bit(a));
61         palette_set_color_rgb(machine,i*16+j,pal4bit(b),pal4bit(b>>4),pal4bit(a));
6362      }
6463   }
6564}
r2454r2455
116115   ADDRESS_MAP_GLOBAL_MASK(0xff)
117116   AM_RANGE(0x00, 0x00) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
118117   AM_RANGE(0x01, 0x01) AM_WRITE(AY8910_control_port_0_w)
119   AM_RANGE(0x10, 0x13) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
120   AM_RANGE(0x80, 0x83) AM_READWRITE(ppi8255_1_r, ppi8255_1_w)
118   AM_RANGE(0x10, 0x13) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
119   AM_RANGE(0x80, 0x83) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
121120ADDRESS_MAP_END
122121
123122/* Input Ports */
r2454r2455
221220
222221static const struct AY8910interface ay8910_interface =
223222{
224 input_port_3_r,// DSWA
225 input_port_4_r,// DSWB
226 0,
227 0
223   AY8910_LEGACY_OUTPUT,
224   AY8910_DEFAULT_LOADS,
225   input_port_3_r,// DSWA
226   input_port_4_r,// DSWB
227   NULL,
228   NULL
228229};
229230
230231/* PPI8255 Interface */
r2454r2455
233234static WRITE8_HANDLER( ppi8255_b_w ){}// lamps ?
234235static WRITE8_HANDLER( ppi8255_c_w ){}
235236
236static const ppi8255_interface ppi8255_intf =
237static const ppi8255_interface ppi8255_intf[2] =
237238{
238   2,                              // 2 chips
239   { input_port_0_r,   NULL },           // Port A read
240   { input_port_1_r,   NULL },         // Port B read
241   { input_port_2_r,   NULL },         // Port C read
242   { NULL,            ppi8255_a_w },  // Port A write
243   { NULL,            ppi8255_b_w },  // Port B write
244   { NULL,            ppi8255_c_w },  // Port C write
239   {
240      input_port_0_r,           // Port A read
241      input_port_1_r,         // Port B read
242      input_port_2_r,         // Port C read
243      NULL,               // Port A write
244      NULL,               // Port B write
245      NULL               // Port C write
246   },
247   {
248      NULL,               // Port A read
249      NULL,               // Port B read
250      NULL,               // Port C read
251      ppi8255_a_w,         // Port A write
252      ppi8255_b_w,         // Port B write
253      ppi8255_c_w            // Port C write
254   }
245255};
246256
247/* Machine Initialization */
248
249static MACHINE_RESET( vroulet )
250{
251   ppi8255_init(&ppi8255_intf);
252}
253
254257/* Machine Driver */
255258
256259static MACHINE_DRIVER_START( vroulet )
r2454r2455
260263   MDRV_CPU_IO_MAP(vroulet_io_map, 0)
261264   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
262265
263   MDRV_MACHINE_RESET(vroulet)
264
265266   MDRV_NVRAM_HANDLER(generic_1fill)
266267
268   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
269   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
270
271   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
272   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
273
267274   // video hardware
268275
269276   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/twins.c
r2454r2455
159159
160160static const struct AY8910interface ay8910_interface =
161161{
162   AY8910_LEGACY_OUTPUT,
163   AY8910_DEFAULT_LOADS,
162164   input_port_0_r,
163165   input_port_1_r
164166};
src/mame/drivers/powerins.c
r2454r2455
340340
341341static const struct YM2203interface ym2203_interface =
342342{
343   0, 0, 0, 0,
343   {
344         AY8910_LEGACY_OUTPUT,
345         AY8910_DEFAULT_LOADS,
346         NULL, NULL, NULL, NULL,
347   },
344348   irqhandler
345349};
346350
src/mame/drivers/jedi.c
r2454r2455
111111***************************************************************************/
112112
113113#include "driver.h"
114#include "deprecat.h"
115114#include "cpu/m6502/m6502.h"
116115#include "jedi.h"
117116
r2454r2455
142141
143142static WRITE8_HANDLER( main_irq_ack_w )
144143{
145   cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, CLEAR_LINE);
144   cpunum_set_input_line(machine, 0, M6502_IRQ_LINE, CLEAR_LINE);
146145}
147146
148147
src/mame/drivers/bfm_sc2.c
r2454r2455
620620         }
621621       }
622622    }
623   if ( data & 0x1F ) cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, ASSERT_LINE );
623   if ( data & 0x1F ) cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, ASSERT_LINE );
624624}
625625
626626///////////////////////////////////////////////////////////////////////////
r2454r2455
894894
895895static READ8_HANDLER( coin_input_r )
896896{
897   return input_port_0_r(machine, 0);
897   return input_port_read_indexed(machine, 0);
898898}
899899
900900///////////////////////////////////////////////////////////////////////////
r2454r2455
10721072
10731073static WRITE8_HANDLER( vid_uart_tx_w )
10741074{
1075   send_to_adder(Machine, data);
1075   send_to_adder(machine, data);
10761076}
10771077
10781078///////////////////////////////////////////////////////////////////////////
src/mame/drivers/witch.c
r2454r2455
190190*/
191191
192192#include "driver.h"
193#include "deprecat.h"
194193#include "sound/es8712.h"
195194#include "sound/2203intf.h"
196195
r2454r2455
366365   break;
367366
368367   case 0x08: //A008
369          cpunum_set_input_line(Machine, cpu_getactivecpu(),0,CLEAR_LINE);
368          cpunum_set_input_line(machine, cpu_getactivecpu(),0,CLEAR_LINE);
370369       break;
371370  }
372371}
r2454r2455
416415
417416static const struct YM2203interface ym2203_interface_0 =
418417{
419   portA_r,
420   portB_r,
421   NULL,
418   {
419      AY8910_LEGACY_OUTPUT,
420      AY8910_DEFAULT_LOADS,
421      portA_r,
422      portB_r,
423      NULL,
424      NULL
425   },
422426   NULL
423427};
424428
425429static const struct YM2203interface ym2203_interface_1 =
426430{
427   NULL,
428   NULL,
429   xscroll_w,
430   yscroll_w
431   {
432      AY8910_LEGACY_OUTPUT,
433      AY8910_DEFAULT_LOADS,
434      NULL,
435      NULL,
436      xscroll_w,
437      yscroll_w
438   },
439   NULL
431440};
432441
433442static ADDRESS_MAP_START( map_main, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/flkatck.c
r2454r2455
1111***************************************************************************/
1212
1313#include "driver.h"
14#include "deprecat.h"
1514#include "cpu/z80/z80.h"
1615#include "cpu/hd6309/hd6309.h"
1716#include "sound/2151intf.h"
src/mame/drivers/dynax.c
r2454r2455
331331      int r = BITSWAP8((x >>  0) & 0x1f, 7,6,5, 0,1,2,3,4 );
332332      int g = BITSWAP8((x >>  5) & 0x1f, 7,6,5, 0,1,2,3,4 );
333333      int b = BITSWAP8((x >> 10) & 0x1f, 7,6,5, 0,1,2,3,4 );
334      palette_set_color_rgb(Machine,256*palbank + offset,pal5bit(r),pal5bit(g),pal5bit(b));
334      palette_set_color_rgb(machine,256*palbank + offset,pal5bit(r),pal5bit(g),pal5bit(b));
335335   }
336336}
337337
r2454r2455
386386      int r = br & 0x1f;
387387      int g = bg & 0x1f;
388388      int b = ((bg & 0xc0)>>3) | ((br & 0xe0)>>5);
389      palette_set_color_rgb(Machine,256*palbank + offset,pal5bit(r),pal5bit(g),pal5bit(b));
389      palette_set_color_rgb(machine,256*palbank + offset,pal5bit(r),pal5bit(g),pal5bit(b));
390390   }
391391}
392392
r2454r2455
12631263      int r = br & 0x1f;
12641264      int g = bg & 0x1f;
12651265      int b = ((bg & 0xc0)>>3) | ((br & 0xe0)>>5);
1266      palette_set_color_rgb(Machine, 256*palbank + ((offset&0xf)|((offset&0x1e0)>>1)) ,pal5bit(r),pal5bit(g),pal5bit(b));
1266      palette_set_color_rgb(machine, 256*palbank + ((offset&0xf)|((offset&0x1e0)>>1)) ,pal5bit(r),pal5bit(g),pal5bit(b));
12671267   }
12681268}
12691269
r2454r2455
35833583
35843584static const struct YM2203interface hanamai_ym2203_interface =
35853585{
3586   input_port_1_r,            /* Port A Read: DSW */
3587   input_port_0_r,            /* Port B Read: DSW */
3588   0,                     /* Port A Write */
3589   0,                     /* Port B Write */
3586   {
3587      AY8910_LEGACY_OUTPUT,
3588      AY8910_DEFAULT_LOADS,
3589      input_port_1_r,            /* Port A Read: DSW */
3590      input_port_0_r,            /* Port B Read: DSW */
3591      NULL,                     /* Port A Write */
3592      NULL,                     /* Port B Write */
3593   },
35903594   sprtmtch_sound_callback      /* IRQ handler */
35913595};
35923596
r2454r2455
36503654
36513655static const struct AY8910interface hnoridur_ay8910_interface =
36523656{
3657   AY8910_LEGACY_OUTPUT,
3658   AY8910_DEFAULT_LOADS,
36533659   input_port_0_r      /* Port A Read: DSW */
36543660};
36553661
r2454r2455
37003706
37013707static const struct YM2203interface sprtmtch_ym2203_interface =
37023708{
3703   input_port_3_r,            /* Port A Read: DSW */
3704   input_port_4_r,            /* Port B Read: DSW */
3705   0,                     /* Port A Write */
3706   0,                     /* Port B Write */
3709   {
3710      AY8910_LEGACY_OUTPUT,
3711      AY8910_DEFAULT_LOADS,
3712      input_port_3_r,            /* Port A Read: DSW */
3713      input_port_4_r,            /* Port B Read: DSW */
3714      NULL,                  /* Port A Write */
3715      NULL,                  /* Port B Write */
3716   },
37073717   sprtmtch_sound_callback,   /* IRQ handler */
37083718};
37093719
r2454r2455
38713881
38723882static const struct YM2203interface jantouki_ym2203_interface =
38733883{
3874   0,                     /* Port A Read: DSW */
3875   0,                     /* Port B Read: DSW */
3876   0,                     /* Port A Write */
3877   0,                     /* Port B Write */
3884   {
3885      AY8910_LEGACY_OUTPUT,
3886      AY8910_DEFAULT_LOADS,
3887      NULL, NULL, NULL, NULL
3888   },
38783889   jantouki_sound_callback      /* IRQ handler */
38793890};
38803891
r2454r2455
40424053
40434054static const struct AY8910interface htengoku_ay8910_interface =
40444055{
4056   AY8910_LEGACY_OUTPUT,
4057   AY8910_DEFAULT_LOADS,
40454058   // A            B
40464059   htengoku_dsw_r,   0,               // R
40474060   0,            htengoku_dsw_w      // W
r2454r2455
41004113
41014114static const struct AY8910interface tenkai_ay8910_interface =
41024115{
4116   AY8910_LEGACY_OUTPUT,
4117   AY8910_DEFAULT_LOADS,
41034118   // A                // B
41044119   tenkai_dsw_r,      0,            // Read
41054120   0,               tenkai_dswsel_w   // Write
src/mame/drivers/shootout.c
r2454r2455
275275
276276static const struct YM2203interface ym2203_interface =
277277{
278   0,0,0,0,shootout_snd_irq
278   {
279      AY8910_LEGACY_OUTPUT,
280      AY8910_DEFAULT_LOADS,
281      NULL, NULL, NULL, NULL
282   },
283   shootout_snd_irq
279284};
280285
281286static const struct YM2203interface ym2203_interface2 =
282287{
283   0,
284   0,
285   shootout_bankswitch_w,
286   shootout_flipscreen_w,
288   {
289      AY8910_LEGACY_OUTPUT,
290      AY8910_DEFAULT_LOADS,
291      NULL,
292      NULL,
293      shootout_bankswitch_w,
294      shootout_flipscreen_w
295   },
287296   shootout_snd2_irq
288297};
289298
src/mame/drivers/contra.c
r2454r2455
1414***************************************************************************/
1515
1616#include "driver.h"
17#include "deprecat.h"
1817#include "cpu/m6809/m6809.h"
1918#include "sound/2151intf.h"
2019
r2454r2455
5049
5150static WRITE8_HANDLER( contra_sh_irqtrigger_w )
5251{
53   cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,HOLD_LINE);
52   cpunum_set_input_line(machine, 1,M6809_IRQ_LINE,HOLD_LINE);
5453}
5554
5655static WRITE8_HANDLER( contra_coin_counter_w )
src/mame/drivers/zn.c
r2454r2455
11941194
11951195static WRITE32_HANDLER( taitofx1a_ymsound_w )
11961196{
1197   if (mem_mask == 0xffff0000)
1197   if (mem_mask == 0x0000ffff)
11981198   {
11991199      taitosound_port_w(machine, 0, data&0xff);
12001200   }
r2454r2455
16781678   n_size <<= 2;
16791679   while( n_size > 0 )
16801680   {
1681      psxwritebyte( n_address, ide_controller32_r( ide, 0x1f0 / 4, 0xffffff00 ) );
1681      psxwritebyte( n_address, ide_controller32_r( ide, 0x1f0 / 4, 0x000000ff ) );
16821682      n_address++;
16831683      n_size--;
16841684   }
r2454r2455
21322132   int shift = 0;
21332133   int ret;
21342134
2135   if (mem_mask == 0xff00ffff)
2135   if (mem_mask == 0x00ff0000)
21362136   {
21372137      shift = 16;
21382138      reg++;
21392139   }
2140   else if (mem_mask == 0xffff0000)   // code sometimes reads shorts from the DATA register
2140   else if (mem_mask == 0x0000ffff)   // code sometimes reads shorts from the DATA register
21412141   {
21422142      if (reg != 0)
21432143      {
r2454r2455
21562156{
21572157   int reg = offset*2;
21582158
2159   if (mem_mask == 0xff00ffff)
2159   if (mem_mask == 0x00ff0000)
21602160   {
21612161      data >>= 16;
21622162      reg++;
src/mame/drivers/volfied.c
r2454r2455
222222
223223static const struct YM2203interface ym2203_interface =
224224{
225   input_port_0_r,    /* DSW A */
226   input_port_1_r,    /* DSW B */
227   0,
228   0,
225   {
226      AY8910_LEGACY_OUTPUT,
227      AY8910_DEFAULT_LOADS,
228      input_port_0_r,    /* DSW A */
229      input_port_1_r,    /* DSW B */
230      NULL,
231      NULL,
232   },
229233   irqhandler
230234};
231235
src/mame/drivers/dribling.c
r2454r2455
2626***************************************************************************/
2727
2828#include "driver.h"
29#include "deprecat.h"
3029#include "machine/8255ppi.h"
3130#include "dribling.h"
3231
r2454r2455
9998   /* bit 7 = di */
10099   di = (data >> 7) & 1;
101100   if (!di)
102      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
101      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
103102
104103   /* bit 6 = parata */
105104
r2454r2455
159158static READ8_HANDLER( ioread )
160159{
161160   if (offset & 0x08)
162      return ppi8255_0_r(machine, offset & 3);
161      return ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), offset & 3);
163162   else if (offset & 0x10)
164      return ppi8255_1_r(machine, offset & 3);
163      return ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset & 3);
165164   return 0xff;
166165}
167166
r2454r2455
169168static WRITE8_HANDLER( iowrite )
170169{
171170   if (offset & 0x08)
172      ppi8255_0_w(machine, offset & 3, data);
171      ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), offset & 3, data);
173172   else if (offset & 0x10)
174      ppi8255_1_w(machine, offset & 3, data);
173      ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset & 3, data);
175174   else if (offset & 0x40)
176175   {
177176      dr = ds;
r2454r2455
187186 *
188187 *************************************/
189188
190static const ppi8255_interface ppi8255_intf =
189static const ppi8255_interface ppi8255_intf[2] =
191190{
192   2,
193   { dsr_r,        NULL           },
194   { input_mux0_r, NULL           },
195   { NULL,         input_port_3_r },
196   { NULL,         sound_w        },
197   { NULL,         pb_w           },
198   { misc_w,       shr_w          }
191   {
192      dsr_r,
193      input_mux0_r,
194      NULL,
195      NULL,
196      NULL,
197      misc_w
198   },
199   {
200      NULL,
201      NULL,
202      input_port_3_r,
203      sound_w,
204      pb_w,
205      shr_w
206   }
199207};
200208
201static MACHINE_RESET( dribling )
202{
203   ppi8255_init(&ppi8255_intf);
204}
205209
206210
207
208211/*************************************
209212 *
210213 *  Main CPU memory handlers
r2454r2455
303306   MDRV_CPU_IO_MAP(readport,writeport)
304307   MDRV_CPU_VBLANK_INT("main", dribling_irq_gen)
305308
306   MDRV_MACHINE_RESET(dribling)
309   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
310   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
307311
312   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
313   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
314
308315   /* video hardware */
309316   MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
310317
src/mame/drivers/megadriv.c
r2454r2455
66Thanks to:
77Charles Macdonald for much useful information (cgfm2.emuviews.com)
88
9Long Decription names mostly taken from the Good Gen database
9Long Decription names mostly taken from the GoodGen database
1010
1111ToDo:
1212
r2454r2455
5353
5454#define MEGADRIV_VDP_VRAM(address) megadrive_vdp_vram[(address)&0x7fff]
5555
56#ifdef MESS
57extern void setup_megadriv_custom_mappers(running_machine *);
58#endif
59
6056/* the same on all systems? */
6157#define MASTER_CLOCK      53693100
6258/* timing details */
r2454r2455
22662262      {
22672263         //logerror("%06x: 68000 request z80 Bus (byte MSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
22682264         genz80.z80_has_bus=0;
2269         cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_HALT, ASSERT_LINE);
2265         cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_HALT, ASSERT_LINE);
22702266      }
22712267      else
22722268      {
22732269         //logerror("%06x: 68000 return z80 Bus (byte MSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
22742270         genz80.z80_has_bus=1;
2275         cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_HALT, CLEAR_LINE);
2271         cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_HALT, CLEAR_LINE);
22762272
22772273      }
22782274   }
r2454r2455
22822278      {
22832279         //logerror("%06x: 68000 request z80 Bus (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
22842280         genz80.z80_has_bus=0;
2285         cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_HALT, ASSERT_LINE);
2281         cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_HALT, ASSERT_LINE);
22862282      }
22872283      else
22882284      {
22892285         //logerror("%06x: 68000 return z80 Bus (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
22902286         genz80.z80_has_bus=1;
2291         cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_HALT, CLEAR_LINE);
2287         cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_HALT, CLEAR_LINE);
22922288      }
22932289   }
22942290   else // word access
r2454r2455
22972293      {
22982294         //logerror("%06x: 68000 request z80 Bus (word access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
22992295         genz80.z80_has_bus=0;
2300         cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_HALT, ASSERT_LINE);
2296         cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_HALT, ASSERT_LINE);
23012297      }
23022298      else
23032299      {
23042300         //logerror("%06x: 68000 return z80 Bus (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
23052301         genz80.z80_has_bus=1;
2306         cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_HALT, CLEAR_LINE);
2302         cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_HALT, CLEAR_LINE);
23072303      }
23082304   }
23092305}
r2454r2455
23162312      {
23172313         //logerror("%06x: 68000 clear z80 reset (byte MSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
23182314         genz80.z80_is_reset=0;
2319         cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_RESET, CLEAR_LINE);
2315         cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_RESET, CLEAR_LINE);
23202316      }
23212317      else
23222318      {
23232319         //logerror("%06x: 68000 start z80 reset (byte MSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
23242320         genz80.z80_is_reset=1;
2325         cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_RESET, ASSERT_LINE);
2321         cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_RESET, ASSERT_LINE);
23262322         sndti_reset(SOUND_YM2612, 0);
23272323      }
23282324   }
r2454r2455
23322328      {
23332329         //logerror("%06x: 68000 clear z80 reset (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
23342330         genz80.z80_is_reset=0;
2335         cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_RESET, CLEAR_LINE);
2331         cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_RESET, CLEAR_LINE);
23362332      }
23372333      else
23382334      {
23392335         //logerror("%06x: 68000 start z80 reset (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
23402336         genz80.z80_is_reset=1;
2341         cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_RESET, ASSERT_LINE);
2337         cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_RESET, ASSERT_LINE);
23422338         sndti_reset(SOUND_YM2612, 0);
23432339
23442340      }
r2454r2455
23492345      {
23502346         //logerror("%06x: 68000 clear z80 reset (word access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
23512347         genz80.z80_is_reset=0;
2352         cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_RESET, CLEAR_LINE );
2348         cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_RESET, CLEAR_LINE );
23532349      }
23542350      else
23552351      {
23562352         //logerror("%06x: 68000 start z80 reset (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask);
23572353         genz80.z80_is_reset=1;
2358         cpunum_set_input_line(Machine, genz80.z80_cpunum, INPUT_LINE_RESET, ASSERT_LINE);
2354         cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_RESET, ASSERT_LINE);
23592355         sndti_reset(SOUND_YM2612, 0);
23602356      }
23612357   }
r2454r2455
48204816
48214817   memset(megadrive_ram,0x00,0x10000);
48224818
4823#ifdef MESS
4824   setup_megadriv_custom_mappers(machine);
4825#endif
4819
48264820}
48274821
48284822void megadriv_stop_scanline_timer(void)
src/mame/drivers/itech32.c
r2454r2455
563563
564564static READ8_HANDLER( sound_data_r )
565565{
566   cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, CLEAR_LINE);
566   cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, CLEAR_LINE);
567567   sound_int_state = 0;
568568   return sound_data;
569569}
r2454r2455
669669
670670static WRITE8_HANDLER( firq_clear_w )
671671{
672   cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, CLEAR_LINE);
672   cpunum_set_input_line(machine, 1, M6809_FIRQ_LINE, CLEAR_LINE);
673673}
674674
675675
r2454r2455
682682
683683static WRITE32_HANDLER( tms_reset_assert_w )
684684{
685   cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, ASSERT_LINE);
686   cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, ASSERT_LINE);
685   cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, ASSERT_LINE);
686   cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, ASSERT_LINE);
687687}
688688
689689
r2454r2455
692692   /* kludge to prevent crash on first boot */
693693   if ((tms1_ram[0] & 0xff000000) == 0)
694694   {
695      cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, CLEAR_LINE);
696      STOP_TMS_SPINNING(Machine, 0);
695      cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, CLEAR_LINE);
696      STOP_TMS_SPINNING(machine, 0);
697697   }
698698   if ((tms2_ram[0] & 0xff000000) == 0)
699699   {
700      cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, CLEAR_LINE);
701      STOP_TMS_SPINNING(Machine, 1);
700      cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, CLEAR_LINE);
701      STOP_TMS_SPINNING(machine, 1);
702702   }
703703}
704704
r2454r2455
707707{
708708   COMBINE_DATA(&tms1_ram[offset]);
709709   if (offset == 0) COMBINE_DATA(tms1_boot);
710   if (offset == 0x382 && tms_spinning[0]) STOP_TMS_SPINNING(Machine, 0);
710   if (offset == 0x382 && tms_spinning[0]) STOP_TMS_SPINNING(machine, 0);
711711   if (!tms_spinning[0])
712712      cpu_boost_interleave(ATTOTIME_IN_HZ(CPU020_CLOCK/256), ATTOTIME_IN_USEC(20));
713713}
r2454r2455
716716static WRITE32_HANDLER( tms2_68k_ram_w )
717717{
718718   COMBINE_DATA(&tms2_ram[offset]);
719   if (offset == 0x382 && tms_spinning[1]) STOP_TMS_SPINNING(Machine, 1);
719   if (offset == 0x382 && tms_spinning[1]) STOP_TMS_SPINNING(machine, 1);
720720   if (!tms_spinning[1])
721721      cpu_boost_interleave(ATTOTIME_IN_HZ(CPU020_CLOCK/256), ATTOTIME_IN_USEC(20));
722722}
r2454r2455
757757 *
758758 *************************************/
759759
760static READ32_HANDLER( input_port_0_msw_r )
761{
762   return input_port_0_word_r(machine,offset,0) << 16;
763}
764
765static READ32_HANDLER( input_port_1_msw_r )
766{
767   return input_port_1_word_r(machine,offset,0) << 16;
768}
769
770static READ32_HANDLER( input_port_2_msw_r )
771{
772   return input_port_2_word_r(machine,offset,0) << 16;
773}
774
775static READ32_HANDLER( input_port_3_msw_r )
776{
777   return input_port_3_word_r(machine,offset,0) << 16;
778}
779
780static READ32_HANDLER( input_port_4_msw_r )
781{
782   return special_port4_r(machine,offset,0) << 16;
783}
784
785760static WRITE32_HANDLER( int1_ack32_w )
786761{
787762   int1_ack_w(machine, offset, data, mem_mask);
r2454r2455
931906AM_RANGE(0x000c00, 0x007fff) AM_MIRROR(0x40000) AM_READWRITE(test2_r, test2_w)
932907#endif
933908   AM_RANGE(0x000000, 0x03ffff) AM_MIRROR(0x40000) AM_RAM AM_BASE((UINT32 **)&main_ram) AM_SIZE(&main_ram_size)
934   AM_RANGE(0x080000, 0x080003) AM_READ(input_port_3_msw_r)
935   AM_RANGE(0x082000, 0x082003) AM_READ(input_port_4_msw_r)
909   AM_RANGE(0x080000, 0x080003) AM_READ16(input_port_3_word_r, 0xffff0000)
910   AM_RANGE(0x082000, 0x082003) AM_READ16(special_port4_r, 0xffff0000)
936911   AM_RANGE(0x084000, 0x084003) AM_READWRITE(sound_data32_r, sound_data32_w)
937912//  AM_RANGE(0x086000, 0x08623f) AM_RAM -- networking -- first 0x40 bytes = our data, next 0x40*8 bytes = their data, r/w on IRQ2
938913   AM_RANGE(0x088000, 0x088003) AM_READ(drivedge_steering_r)
939914   AM_RANGE(0x08a000, 0x08a003) AM_READWRITE(drivedge_gas_r, SMH_NOP)
940   AM_RANGE(0x08c000, 0x08c003) AM_READWRITE(input_port_0_msw_r, SMH_NOP)
941   AM_RANGE(0x08e000, 0x08e003) AM_READWRITE(input_port_1_msw_r, SMH_NOP)
915   AM_RANGE(0x08c000, 0x08c003) AM_READ16(input_port_0_word_r, 0xffff0000) AM_WRITENOP
916   AM_RANGE(0x08e000, 0x08e003) AM_READ16(input_port_1_word_r, 0xffff0000) AM_WRITENOP
942917   AM_RANGE(0x100000, 0x10000f) AM_WRITE(drivedge_zbuf_control_w) AM_BASE(&drivedge_zbuf_control)
943918   AM_RANGE(0x180000, 0x180003) AM_WRITE(drivedge_color0_w)
944919   AM_RANGE(0x1a0000, 0x1bffff) AM_RAM_WRITE(drivedge_paletteram_w) AM_BASE(&paletteram32)
r2454r2455
946921   AM_RANGE(0x1e0000, 0x1e0113) AM_READWRITE(itech020_video_r, itech020_video_w) AM_BASE((UINT32 **)&itech32_video)
947922   AM_RANGE(0x1e4000, 0x1e4003) AM_WRITE(tms_reset_assert_w)
948923   AM_RANGE(0x1ec000, 0x1ec003) AM_WRITE(tms_reset_clear_w)
949   AM_RANGE(0x200000, 0x200003) AM_READ(input_port_2_msw_r)
924   AM_RANGE(0x200000, 0x200003) AM_READ16(input_port_2_word_r, 0xffff0000)
950925   AM_RANGE(0x280000, 0x280fff) AM_RAM_WRITE(tms1_68k_ram_w) AM_SHARE(1)
951926   AM_RANGE(0x300000, 0x300fff) AM_RAM_WRITE(tms2_68k_ram_w) AM_SHARE(2)
952927   AM_RANGE(0x380000, 0x380003) AM_WRITENOP // AM_WRITE(watchdog_reset16_w)
r2454r2455
968943/*------ 68EC020-based memory layout ------*/
969944static ADDRESS_MAP_START( itech020_map, ADDRESS_SPACE_PROGRAM, 32 )
970945   AM_RANGE(0x000000, 0x007fff) AM_RAM AM_BASE((UINT32 **)&main_ram) AM_SIZE(&main_ram_size)
971   AM_RANGE(0x080000, 0x080003) AM_READWRITE(input_port_0_msw_r, int1_ack32_w)
972   AM_RANGE(0x100000, 0x100003) AM_READ(input_port_1_msw_r)
973   AM_RANGE(0x180000, 0x180003) AM_READ(input_port_2_msw_r)
974   AM_RANGE(0x200000, 0x200003) AM_READ(input_port_3_msw_r)
975   AM_RANGE(0x280000, 0x280003) AM_READ(input_port_4_msw_r)
946   AM_RANGE(0x080000, 0x080003) AM_READ16(input_port_0_word_r, 0xffff0000) AM_WRITE(int1_ack32_w)
947   AM_RANGE(0x100000, 0x100003) AM_READ16(input_port_1_word_r, 0xffff0000)
948   AM_RANGE(0x180000, 0x180003) AM_READ16(input_port_2_word_r, 0xffff0000)
949   AM_RANGE(0x200000, 0x200003) AM_READ16(input_port_3_word_r, 0xffff0000)
950   AM_RANGE(0x280000, 0x280003) AM_READ16(special_port4_r, 0xffff0000)
976951   AM_RANGE(0x300000, 0x300003) AM_WRITE(itech020_color1_w)
977952   AM_RANGE(0x380000, 0x380003) AM_WRITE(itech020_color2_w)
978953   AM_RANGE(0x400000, 0x400003) AM_WRITE(watchdog_reset32_w)
src/mame/drivers/mexico86.c
r2454r2455
372372
373373static const struct YM2203interface ym2203_interface =
374374{
375   input_port_3_r,
376   input_port_4_r
375   {
376      AY8910_LEGACY_OUTPUT,
377      AY8910_DEFAULT_LOADS,
378      input_port_3_r,
379      input_port_4_r,
380      NULL,
381      NULL
382   },
383   NULL
377384};
378385
379386
src/mame/drivers/chaknpop.c
r2454r2455
108108
109109static const struct AY8910interface ay8910_interface_1 =
110110{
111   AY8910_LEGACY_OUTPUT,
112   AY8910_DEFAULT_LOADS,
111113   input_port_5_r,      // DSW A
112   input_port_4_r      // DSW B
114   input_port_4_r,      // DSW B
115   NULL,
116   NULL
113117};
114118
115119static const struct AY8910interface ay8910_interface_2 =
116120{
117   0,
118   0,
121   AY8910_LEGACY_OUTPUT,
122   AY8910_DEFAULT_LOADS,
123   NULL,
124   NULL,
119125   unknown_port_1_w,   // ??
120126   unknown_port_2_w   // ??
121127};
src/mame/drivers/sspeedr.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98
109#include "sspeedr.lh"
1110
r2454r2455
5655
5756static WRITE8_HANDLER( sspeedr_int_ack_w )
5857{
59   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
58   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
6059}
6160
6261
src/mame/drivers/filetto.c
r2454r2455
374374static WRITE8_HANDLER( nmi_enable_w )
375375{
376376   //if(data & 0x80)
377      //cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI,ASSERT_LINE);
377      //cpunum_set_input_line(machine, 0, INPUT_LINE_NMI,ASSERT_LINE);
378378   //if(!(data & 0x80))
379      //cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI,CLEAR_LINE);
379      //cpunum_set_input_line(machine, 0, INPUT_LINE_NMI,CLEAR_LINE);
380380}
381381
382382static READ8_HANDLER( kludge_r )
r2454r2455
437437   }
438438   else//keyboard emulation
439439   {
440      cpunum_set_input_line(Machine, 0,1,PULSE_LINE);
440      cpunum_set_input_line(machine, 0,1,PULSE_LINE);
441441      return 0x00;//Keyboard is disconnected
442442      //return 0xaa;//Keyboard code
443443   }
r2454r2455
470470
471471static WRITE8_HANDLER( sys_reset_w )
472472{
473   cpunum_set_input_line(Machine, 0,INPUT_LINE_RESET,PULSE_LINE);
473   cpunum_set_input_line(machine, 0,INPUT_LINE_RESET,PULSE_LINE);
474474}
475475
476476
477static const ppi8255_interface filetto_ppi8255_intf =
477static const ppi8255_interface filetto_ppi8255_intf[2] =
478478{
479   2,                      /* 2 chips */
480   { port_a_r,NULL },         /* Port A read */
481   { port_b_r,NULL },         /* Port B read */
482   { port_c_r,NULL },        /* Port C read */
483   { NULL     ,wss_1_w },      /* Port A write */
484   { port_b_w,wss_2_w },      /* Port B write */
485   { NULL     ,sys_reset_w },   /* Port C write */
479   {
480      port_a_r,         /* Port A read */
481      port_b_r,         /* Port B read */
482      port_c_r,           /* Port C read */
483      NULL,            /* Port A write */
484      port_b_w,            /* Port B write */
485      NULL            /* Port C write */
486   },
487   {
488      NULL,            /* Port A read */
489      NULL,            /* Port B read */
490      NULL,            /* Port C read */
491      wss_1_w,         /* Port A write */
492      wss_2_w,         /* Port B write */
493      sys_reset_w         /* Port C write */
494   }
486495};
487496
488497static UINT8 irq_data[2];
r2454r2455
546555   AM_RANGE(0x0000, 0x000f) AM_RAM //AM_READWRITE(dma8237_0_r,dma8237_0_w) //8237 DMA Controller
547556   AM_RANGE(0x0020, 0x0021) AM_READWRITE(irq_ctrl_8259_r,irq_ctrl_8259_w)//AM_READWRITE(pic8259_0_r,pic8259_0_w) //8259 Interrupt control
548557   AM_RANGE(0x0040, 0x0043) AM_READ(kludge_r) //AM_READWRITE(pit8253_0_r,pit8253_0_w) //8253 PIT
549   AM_RANGE(0x0060, 0x0063) AM_READWRITE(ppi8255_0_r,ppi8255_0_w) //PPI 8255
550   AM_RANGE(0x0064, 0x0066) AM_READWRITE(ppi8255_1_r,ppi8255_1_w) //PPI 8255
558   AM_RANGE(0x0060, 0x0063) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r,ppi8255_w) //PPI 8255
559   AM_RANGE(0x0064, 0x0066) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r,ppi8255_w) //PPI 8255
551560   AM_RANGE(0x0073, 0x0073) AM_READ(undefined_r)
552561   AM_RANGE(0x0080, 0x0087) AM_RAM //AM_READWRITE(dma_page_select_r,dma_page_select_w)
553562   AM_RANGE(0x00a0, 0x00a0) AM_WRITE(nmi_enable_w)
r2454r2455
650659GFXDECODE_END
651660
652661
653static MACHINE_RESET(filetto)
654{
655   ppi8255_init(&filetto_ppi8255_intf);
656}
657
658662/*
659663BLACK = 0
660664BLUE = 1
r2454r2455
740744   MDRV_DEVICE_ADD( "pit8253", PIT8253 )
741745   MDRV_DEVICE_CONFIG( pc_pit8253_config )
742746
747   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
748   MDRV_DEVICE_CONFIG( filetto_ppi8255_intf[0] )
749
750   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
751   MDRV_DEVICE_CONFIG( filetto_ppi8255_intf[1] )
752
743753   MDRV_GFXDECODE(filetto)
744754
745755   MDRV_SCREEN_ADD("main", RASTER)
r2454r2455
751761
752762   MDRV_PALETTE_LENGTH(0x100)
753763
754   MDRV_MACHINE_RESET(filetto)
755764   MDRV_PALETTE_INIT(filetto)
756765
757766   MDRV_VIDEO_START(filetto)
src/mame/drivers/ashnojoe.c
r2454r2455
320320
321321static const struct YM2203interface ym2203_interface =
322322{
323   0,
324   0,
325   writeA,
326   writeB,
323   {
324      AY8910_LEGACY_OUTPUT,
325      AY8910_DEFAULT_LOADS,
326      NULL,
327      NULL,
328      writeA,
329      writeB,
330   },
327331   irqhandler
328332};
329333
src/mame/drivers/findout.c
r2454r2455
6666
6767static READ8_HANDLER( port1_r )
6868{
69   return input_port_1_r(machine, 0) | (ticket_dispenser_0_r(machine, 0) >> 5);
69   return input_port_read_indexed(machine, 1) | (ticket_dispenser_0_r(machine, 0) >> 5);
7070}
7171
7272static WRITE8_HANDLER( lamps_w )
r2454r2455
102102//  popmessage("%02x",data);
103103}
104104
105static const ppi8255_interface ppi8255_intf =
105static const ppi8255_interface ppi8255_intf[2] =
106106{
107   2,                            /* 2 chips */
108   { input_port_0_r, input_port_2_r },   /* Port A read */
109   { port1_r,    NULL },         /* Port B read */
110   { NULL,      portC_r },      /* Port C read */
111   { NULL,      NULL },         /* Port A write */
112   { NULL,      lamps_w },      /* Port B write */
113   { sound_w,   NULL },         /* Port C write */
107   {
108      input_port_0_r,            /* Port A read */
109      port1_r,               /* Port B read */
110      NULL,                  /* Port C read */
111      NULL,                  /* Port A write */
112      NULL,                  /* Port B write */
113      sound_w,               /* Port C write */
114   },
115   {
116      input_port_2_r,            /* Port A read */
117      NULL,                  /* Port B read */
118      portC_r,               /* Port C read */
119      NULL,                  /* Port A write */
120      lamps_w,               /* Port B write */
121      NULL                  /* Port C write */
122   }
114123};
115124
116125static MACHINE_RESET( findout )
117126{
118   ppi8255_init(&ppi8255_intf);
119
120127   ticket_dispenser_init(100, 1, 1);
121128}
122129
r2454r2455
183190static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
184191   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
185192   AM_RANGE(0x4000, 0x47ff) AM_READ(SMH_RAM)
186   AM_RANGE(0x4800, 0x4803) AM_READ(ppi8255_0_r)
187   AM_RANGE(0x5000, 0x5003) AM_READ(ppi8255_1_r)
193   AM_RANGE(0x4800, 0x4803) AM_DEVREAD(PPI8255, "ppi8255_0", ppi8255_r)
194   AM_RANGE(0x5000, 0x5003) AM_DEVREAD(PPI8255, "ppi8255_1", ppi8255_r)
188195   AM_RANGE(0x6400, 0x6400) AM_READ(signature_r)
189196   AM_RANGE(0x7800, 0x7fff) AM_READ(SMH_ROM)
190197   AM_RANGE(0x8000, 0xffff) AM_READ(SMH_BANK1)
r2454r2455
194201static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
195202   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
196203   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM) AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
197   AM_RANGE(0x4800, 0x4803) AM_WRITE(ppi8255_0_w)
198   AM_RANGE(0x5000, 0x5003) AM_WRITE(ppi8255_1_w)
204   AM_RANGE(0x4800, 0x4803) AM_DEVWRITE(PPI8255, "ppi8255_0", ppi8255_w)
205   AM_RANGE(0x5000, 0x5003) AM_DEVWRITE(PPI8255, "ppi8255_1", ppi8255_w)
199206   /* banked ROMs are enabled by low 6 bits of the address */
200207   AM_RANGE(0x603e, 0x603e) AM_WRITE(banksel_1_w)
201208   AM_RANGE(0x603d, 0x603d) AM_WRITE(banksel_2_w)
r2454r2455
464471   MDRV_VIDEO_START(generic_bitmapped)
465472   MDRV_VIDEO_UPDATE(generic_bitmapped)
466473
474   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
475   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
476
477   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
478   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
479
467480   /* sound hardware */
468481   MDRV_SPEAKER_STANDARD_MONO("mono")
469482
src/mame/drivers/mouser.c
r2454r2455
4646static WRITE8_HANDLER( mouser_sound_interrupt_w )
4747{
4848   mouser_sound_byte = data;
49   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
49   cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
5050}
5151
5252static READ8_HANDLER( mouser_sound_byte_r )
src/mame/drivers/undrfire.c
r2454r2455
187187***************************************************************************/
188188
189189#include "driver.h"
190#include "deprecat.h"
191190#include "cpu/m68000/m68000.h"
192191#include "video/taitoic.h"
193192#include "audio/taitosnd.h"
r2454r2455
226225      g = (a &0xff00) >> 8;
227226      b = (a &0xff);
228227
229      palette_set_color(Machine,offset,MAKE_RGB(r,g,b));
228      palette_set_color(machine,offset,MAKE_RGB(r,g,b));
230229   }
231230}
232231
r2454r2455
292291   {
293292      case 0x00:
294293      {
295         return (input_port_0_word_r(machine,0,0) << 16) | input_port_1_word_r(machine,0,0) |
294         return (input_port_read_indexed(machine,0) << 16) | input_port_read_indexed(machine,1) |
296295              (EEPROM_read_bit() << 7) | frame_counter;
297296      }
298297
299298      case 0x01:
300299      {
301         return input_port_2_word_r(machine,0,0) | (coin_word << 16);
300         return input_port_read_indexed(machine,2) | (coin_word << 16);
302301      }
303302    }
304303
r2454r2455
406405
407406      case 0x00:   /* P1 */
408407      {
409         x = input_port_3_word_r(machine,0,0) << 6;
410         y = input_port_4_word_r(machine,0,0) << 6;
408         x = input_port_read_indexed(machine,3) << 6;
409         y = input_port_read_indexed(machine,4) << 6;
411410
412411         return ((x << 24) &0xff000000) | ((x << 8) &0xff0000)
413412             | ((y << 8) &0xff00) | ((y >> 8) &0xff) ;
r2454r2455
415414
416415      case 0x01:   /* P2 */
417416      {
418         x = input_port_5_word_r(machine,0,0) << 6;
419         y = input_port_6_word_r(machine,0,0) << 6;
417         x = input_port_read_indexed(machine,5) << 6;
418         y = input_port_read_indexed(machine,6) << 6;
420419
421420         return ((x << 24) &0xff000000) | ((x << 8) &0xff0000)
422421             | ((y << 8) &0xff00) | ((y >> 8) &0xff) ;
src/mame/drivers/deco32.c
r2454r2455
263263
264264   switch (offset) {
265265   case 2: /* Raster IRQ ACK - value read is not used */
266      cpunum_set_input_line(Machine, 0, ARM_IRQ_LINE, CLEAR_LINE);
266      cpunum_set_input_line(machine, 0, ARM_IRQ_LINE, CLEAR_LINE);
267267      return 0;
268268
269269   case 3: /* Irq controller
r2454r2455
492492   UINT8 *eeprom=EEPROM_get_data_pointer(0);
493493
494494   /* Eprom in low byte */
495   if (mem_mask==0xffffff00) { /* Byte write to low byte only (different from word writing including low byte) */
495   if (mem_mask==0x000000ff) { /* Byte write to low byte only (different from word writing including low byte) */
496496      /*
497497            The Tattoo Assassins eprom seems strange...  It's 1024 bytes in size, and 8 bit
498498            in width, but offers a 'multiple read' mode where a bit stream can be read
r2454r2455
597597   }
598598
599599   /* Volume in high byte */
600   if (mem_mask==0xffff00ff) {
600   if (mem_mask==0x0000ff00) {
601601      //TODO:  volume attenuation == ((data>>8)&0xff);
602602      return;
603603   }
604604
605605   /* Playfield control - Only written in full word memory accesses */
606   deco32_pri_w(machine,0,data&0x3,0); /* Bit 0 - layer priority toggle, Bit 1 - BG2/3 Joint mode (8bpp) */
606   deco32_pri_w(machine,0,data&0x3,0xffffffff); /* Bit 0 - layer priority toggle, Bit 1 - BG2/3 Joint mode (8bpp) */
607607
608608   /* Sound board reset control */
609609   if (data&0x80)
610      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
610      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
611611   else
612      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
612      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
613613
614614   /* bit 0x4 fade cancel? */
615615   /* bit 0x8 ?? */
r2454r2455
641641      EEPROM_write_bit(data & 0x10);
642642      EEPROM_set_cs_line((data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
643643
644      deco32_pri_w(machine,0,data&0x3,0); /* Bit 0 - layer priority toggle, Bit 1 - BG2/3 Joint mode (8bpp) */
644      deco32_pri_w(machine,0,data&0x3,0xffffffff); /* Bit 0 - layer priority toggle, Bit 1 - BG2/3 Joint mode (8bpp) */
645645   }
646646}
647647
r2454r2455
11331133
11341134static WRITE8_HANDLER(deco32_bsmt1_w)
11351135{
1136   BSMT2000_data_0_w(machine, offset^ 0xff, ((bsmt_latch<<8)|data), 0);
1136   BSMT2000_data_0_w(machine, offset^ 0xff, ((bsmt_latch<<8)|data), 0xffff);
11371137   cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, HOLD_LINE); /* BSMT is ready */
11381138}
11391139
src/mame/drivers/grchamp.c
r2454r2455
452452
453453static const struct AY8910interface ay8910_interface_1 =
454454{
455   0,
456   0,
455   AY8910_LEGACY_OUTPUT,
456   AY8910_DEFAULT_LOADS,
457   NULL,
458   NULL,
457459   grchamp_portA_0_w,
458460   grchamp_portB_0_w
459461};
460462
461463static const struct AY8910interface ay8910_interface_3 =
462464{
463   0,
464   0,
465   AY8910_LEGACY_OUTPUT,
466   AY8910_DEFAULT_LOADS,
467   NULL,
468   NULL,
465469   grchamp_portA_2_w,
466470   grchamp_portB_2_w
467471};
src/mame/drivers/argus.c
r2454r2455
178178
179179static const struct YM2203interface ym2203_interface =
180180{
181   0,
182   0,
183   0,
184   0,
181   {
182      AY8910_LEGACY_OUTPUT,
183      AY8910_DEFAULT_LOADS,
184      NULL, NULL, NULL, NULL
185   },
185186   irqhandler
186187};
187188
src/mame/drivers/lkage.c
r2454r2455
7676   sound_nmi_enable = 1;
7777   if (pending_nmi)
7878   { /* probably wrong but commands may go lost otherwise */
79      cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE);
79      cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
8080      pending_nmi = 0;
8181   }
8282}
r2454r2455
316316
317317static const struct YM2203interface ym2203_interface =
318318{
319   0,
320   0,
321   0,
322   0,
319   {
320      AY8910_LEGACY_OUTPUT,
321      AY8910_DEFAULT_LOADS,
322      NULL, NULL, NULL, NULL
323   },
323324   irqhandler
324325};
325326
src/mame/drivers/superdq.c
r2454r2455
2222
2323#include "driver.h"
2424#include "render.h"
25#include "deprecat.h"
2625#include "sound/sn76496.h"
2726#include "sound/custom.h"
2827#include "machine/laserdsc.h"
r2454r2455
179178   static const UINT8 black_color_entries[] = {7,15,16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};
180179
181180   if ( data & 0x40 ) /* bit 6 = irqack */
182      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
181      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
183182
184183   coin_counter_w( 0, data & 0x08 );
185184   coin_counter_w( 1, data & 0x04 );
src/mame/drivers/gaiden.c
r2454r2455
964964
965965static const struct YM2203interface ym2203_interface =
966966{
967   0,0,0,0,irqhandler
967   {
968      AY8910_LEGACY_OUTPUT,
969      AY8910_DEFAULT_LOADS,
970      NULL, NULL, NULL, NULL
971   },
972   irqhandler
968973};
969974
970975static MACHINE_DRIVER_START( shadoww )
src/mame/drivers/zaxxon.c
r2454r2455
305305***************************************************************************/
306306
307307#include "driver.h"
308#include "deprecat.h"
309308#include "machine/segacrpt.h"
310309#include "machine/8255ppi.h"
311310#include "audio/segasnd.h"
r2454r2455
374373{
375374   int_enabled = data & 1;
376375   if (!int_enabled)
377      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
376      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
378377}
379378
380379
r2454r2455
485484   AM_RANGE(0xc000, 0xc002) AM_MIRROR(0x18f8) AM_WRITE(zaxxon_coin_lockout_w)
486485   AM_RANGE(0xc003, 0xc004) AM_MIRROR(0x18f8) AM_WRITE(zaxxon_coin_counter_w)
487486   AM_RANGE(0xc006, 0xc006) AM_MIRROR(0x18f8) AM_WRITE(zaxxon_flipscreen_w)
488   AM_RANGE(0xe03c, 0xe03f) AM_MIRROR(0x1f00) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
487   AM_RANGE(0xe03c, 0xe03f) AM_MIRROR(0x1f00) AM_DEVREADWRITE(PPI8255, "ppi8255", ppi8255_r, ppi8255_w)
489488   AM_RANGE(0xe0f0, 0xe0f0) AM_MIRROR(0x1f00) AM_WRITE(int_enable_w)
490489   AM_RANGE(0xe0f1, 0xe0f1) AM_MIRROR(0x1f00) AM_WRITE(zaxxon_fg_color_w)
491490   AM_RANGE(0xe0f8, 0xe0f9) AM_MIRROR(0x1f00) AM_WRITE(zaxxon_bg_position_w)
r2454r2455
525524   AM_RANGE(0x0000, 0x1fff) AM_ROM
526525   AM_RANGE(0x4000, 0x47ff) AM_MIRROR(0x1800) AM_RAM
527526   AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x1fff) AM_WRITE(SN76496_0_w)
528   AM_RANGE(0x8000, 0x8003) AM_MIRROR(0x1ffc) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
527   AM_RANGE(0x8000, 0x8003) AM_MIRROR(0x1ffc) AM_DEVREADWRITE(PPI8255, "ppi8255", ppi8255_r, ppi8255_w)
529528   AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1fff) AM_WRITE(SN76496_1_w)
530529ADDRESS_MAP_END
531530
r2454r2455
892891
893892/*************************************
894893 *
894 * PPI8255 configurations
895 *
896 *************************************/
897
898static const ppi8255_interface zaxxon_ppi_intf =
899{
900   NULL,
901   NULL,
902   NULL,
903   zaxxon_sound_a_w,
904   zaxxon_sound_b_w,
905   zaxxon_sound_c_w
906};
907
908
909static const ppi8255_interface congo_ppi_intf =
910{
911   soundlatch_r,
912   NULL,
913   NULL,
914   NULL,
915   congo_sound_b_w,
916   congo_sound_c_w
917};
918
919
920/*************************************
921 *
895922 *  Graphics definitions
896923 *
897924 *************************************/
r2454r2455
936963
937964   MDRV_MACHINE_START(zaxxon)
938965
966   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
967   MDRV_DEVICE_CONFIG( zaxxon_ppi_intf )
968
939969   /* video hardware */
940970   MDRV_GFXDECODE(zaxxon)
941971   MDRV_PALETTE_LENGTH(256)
r2454r2455
9921022   MDRV_CPU_MODIFY("main")
9931023   MDRV_CPU_PROGRAM_MAP(congo_map, 0)
9941024
1025   MDRV_DEVICE_MODIFY( "ppi8255", PPI8255 )
1026   MDRV_DEVICE_CONFIG( congo_ppi_intf )
1027
9951028   MDRV_CPU_ADD(Z80, SOUND_CLOCK)
9961029   MDRV_CPU_PROGRAM_MAP(congo_sound_map,0)
9971030   MDRV_CPU_PERIODIC_INT(irq0_line_hold, (double)SOUND_CLOCK/16/16/16/4)
r2454r2455
14131446 *
14141447 *************************************/
14151448
1416static DRIVER_INIT( zaxxon )
1417{
1418   static const ppi8255_interface ppi_intf =
1419   {
1420      1,
1421      { 0 },
1422      { 0 },
1423      { 0 },
1424      { zaxxon_sound_a_w },
1425      { zaxxon_sound_b_w },
1426      { zaxxon_sound_c_w }
1427   };
1428
1429   ppi8255_init(&ppi_intf);
1430}
1431
1432
14331449static DRIVER_INIT( zaxxonb )
14341450{
14351451   zaxxonb_decode();
1436   DRIVER_INIT_CALL(zaxxon);
14371452}
14381453
14391454
14401455static DRIVER_INIT( szaxxon )
14411456{
14421457   szaxxon_decode();
1443   DRIVER_INIT_CALL(zaxxon);
14441458}
14451459
14461460
14471461static DRIVER_INIT( futspy )
14481462{
14491463   futspy_decode();
1450   DRIVER_INIT_CALL(zaxxon);
14511464}
14521465
14531466
14541467static DRIVER_INIT( razmataz )
14551468{
14561469   nprinces_decode();
1457   DRIVER_INIT_CALL(zaxxon);
14581470
14591471   /* additional input ports are wired */
14601472   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc004, 0xc004, 0, 0x18f3, port_tag_to_handler8("SW04"));
r2454r2455
14761488static DRIVER_INIT( ixion )
14771489{
14781490   szaxxon_decode();
1479   DRIVER_INIT_CALL(zaxxon);
14801491
14811492   /* connect the universal sound board */
14821493   memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe03c, 0xe03c, 0, 0x1f00, sega_usb_status_r, sega_usb_data_w);
14831494}
14841495
14851496
1486static DRIVER_INIT( congo )
1487{
1488   static const ppi8255_interface ppi_intf =
1489   {
1490      1,
1491      { soundlatch_r },
1492      { 0 },
1493      { 0 },
1494      { 0 },
1495      { congo_sound_b_w },
1496      { congo_sound_c_w }
1497   };
1498   ppi8255_init(&ppi_intf);
1499}
15001497
1501
1502
15031498/*************************************
15041499 *
15051500 *  Game drivers
r2454r2455
15071502 *************************************/
15081503
15091504/* these games run on standard Zaxxon hardware */
1510GAME( 1982, zaxxon,   0,      zaxxon,   zaxxon,   zaxxon,   ROT90,  "Sega",    "Zaxxon (set 1)", GAME_SUPPORTS_SAVE )
1511GAME( 1982, zaxxon2,  zaxxon, zaxxon,   zaxxon,   zaxxon,   ROT90,  "Sega",    "Zaxxon (set 2)", GAME_SUPPORTS_SAVE )
1505GAME( 1982, zaxxon,   0,      zaxxon,   zaxxon,   0,        ROT90,  "Sega",    "Zaxxon (set 1)", GAME_SUPPORTS_SAVE )
1506GAME( 1982, zaxxon2,  zaxxon, zaxxon,   zaxxon,   0,        ROT90,  "Sega",    "Zaxxon (set 2)", GAME_SUPPORTS_SAVE )
15121507GAME( 1982, zaxxonb,  zaxxon, zaxxon,   zaxxon,   zaxxonb,  ROT90,  "bootleg", "Jackson", GAME_SUPPORTS_SAVE )
15131508GAME( 1982, szaxxon,  0,      zaxxon,   szaxxon,  szaxxon,  ROT90,  "Sega",    "Super Zaxxon", GAME_SUPPORTS_SAVE )
15141509GAME( 1984, futspy,   0,      futspy,   futspy,   futspy,   ROT90,  "Sega",    "Future Spy", GAME_SUPPORTS_SAVE )
r2454r2455
15201515
15211516/* these games run on a slightly newer Zaxxon hardware with more ROM space and a */
15221517/* custom sprite DMA chip */
1523GAME( 1983, congo,    0,      congo,    congo,    congo,    ROT90,  "Sega",    "Congo Bongo", GAME_SUPPORTS_SAVE )
1524GAME( 1983, tiptop,   congo,  congo,    congo,    congo,    ROT90,  "Sega",    "Tip Top", GAME_SUPPORTS_SAVE )
1518GAME( 1983, congo,    0,      congo,    congo,    0,        ROT90,  "Sega",    "Congo Bongo", GAME_SUPPORTS_SAVE )
1519GAME( 1983, tiptop,   congo,  congo,    congo,    0,        ROT90,  "Sega",    "Tip Top", GAME_SUPPORTS_SAVE )
src/mame/drivers/shangkid.c
r2454r2455
4949*/
5050
5151#include "driver.h"
52#include "deprecat.h"
5352#include "cpu/z80/z80.h"
5453#include "sound/ay8910.h"
5554#include "sound/dac.h"
r2454r2455
8079
8180static WRITE8_HANDLER( shangkid_bbx_enable_w )
8281{
83   cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, data?0:1 );
82   cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, data?0:1 );
8483}
8584
8685static WRITE8_HANDLER( shangkid_cpu_reset_w )
8786{
8887   if( data == 0 )
8988   {
90      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE);
89      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, PULSE_LINE);
9190   }
9291   else if( data == 1 )
9392   {
94      cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, PULSE_LINE);
93      cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE);
9594   }
9695}
9796
r2454r2455
115114      {
116115         if( data == 0x01 )
117116            /* 0->1 transition triggers interrupt on Sound CPU */
118            cpunum_set_input_line(Machine, 2, 0, HOLD_LINE );
117            cpunum_set_input_line(machine, 2, 0, HOLD_LINE );
119118      }
120119      break;
121120
r2454r2455
138137      {
139138         if( data == 0x01 )
140139            /* 0->1 transition triggers interrupt on Sound CPU */
141            cpunum_set_input_line(Machine, 2, 0, HOLD_LINE );
140            cpunum_set_input_line(machine, 2, 0, HOLD_LINE );
142141      }
143142      else
144143         memory_set_bank(2, data ? 0 : 1);
src/mame/drivers/karnov.c
r2454r2455
288288         break;
289289
290290      case 4: /* DM (DMA to buffer spriteram) */
291         buffer_spriteram16_w(machine,0,0,0);
291         buffer_spriteram16_w(machine,0,0,0xffff);
292292         break;
293293
294294      case 6: /* SECREQ (Interrupt & Data to i8751) */
r2454r2455
315315         break;
316316
317317      case 0xe: /* INTCLR (Interrupt ack for Level 7 vbl interrupt) */
318         cpunum_set_input_line(Machine, 0,7,CLEAR_LINE);
318         cpunum_set_input_line(machine, 0,7,CLEAR_LINE);
319319         break;
320320   }
321321}
src/mame/drivers/maxaflex.c
r2454r2455
7979
8080   /* clear coin interrupt */
8181   if (data & 0x04)
82      cpunum_set_input_line(Machine, 1, M6805_IRQ_LINE, CLEAR_LINE );
82      cpunum_set_input_line(machine, 1, M6805_IRQ_LINE, CLEAR_LINE );
8383
8484   /* AUDMUTE */
8585   sound_global_enable((data >> 5) & 1);
8686
8787   /* RES600 */
8888   if (diff & 0x10)
89      cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
89      cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
9090
9191   /* latch for lamps */
9292   if ((diff & 0x40) && !(data & 0x40))
src/mame/drivers/punchout.c
r2454r2455
104104***************************************************************************/
105105
106106#include "driver.h"
107#include "deprecat.h"
108107#include "cpu/m6502/m6502.h"
109108#include "sound/vlm5030.h"
110109#include "sound/nes_apu.h"
r2454r2455
142141
143142static READ8_HANDLER( punchout_input_3_r )
144143{
145   int data = input_port_3_r(machine, offset);
144   int data = input_port_read_indexed(machine,3);
146145   /* bit 4 is busy pin level */
147146   if( VLM5030_BSY() ) data &= ~0x10;
148147   else data |= 0x10;
r2454r2455
167166static WRITE8_HANDLER( punchout_2a03_reset_w )
168167{
169168   if (data & 1)
170      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
169      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
171170   else
172      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
171      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
173172}
174173
175174static int prot_mode_sel = -1; /* Mode selector */
src/mame/drivers/vegas.c
r2454r2455
637637   {
638638      COMBINE_DATA(&timekeeper_nvram[offset]);
639639      if (offset*4 >= 0x7ff0)
640         if (LOG_TIMEKEEPER) logerror("timekeeper_w(%04X & %08X) = %08X\n", offset*4, ~mem_mask, data);
640         if (LOG_TIMEKEEPER) logerror("timekeeper_w(%04X & %08X) = %08X\n", offset*4, mem_mask, data);
641641      cmos_unlocked = 0;
642642   }
643643   else
644      logerror("%08X:timekeeper_w(%04X,%08X & %08X) without CMOS unlocked\n", activecpu_get_pc(), offset, data, ~mem_mask);
644      logerror("%08X:timekeeper_w(%04X,%08X & %08X) without CMOS unlocked\n", activecpu_get_pc(), offset, data, mem_mask);
645645}
646646
647647
r2454r2455
660660   {
661661      /* get the time */
662662      mame_system_time systime;
663      mame_get_base_datetime(Machine, &systime);
663      mame_get_base_datetime(machine, &systime);
664664
665665      /* return portions thereof */
666666      switch (offset*4)
r2454r2455
11111111   {
11121112      case NREG_CPUSTAT+0:   /* CPU status */
11131113      case NREG_CPUSTAT+1:   /* CPU status */
1114         if (LOG_NILE) logerror("%08X:NILE WRITE: CPU status(%03X) = %08X & %08X\n", activecpu_get_pc(), offset*4, data, ~mem_mask);
1114         if (LOG_NILE) logerror("%08X:NILE WRITE: CPU status(%03X) = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask);
11151115         logit = 0;
11161116         break;
11171117
11181118      case NREG_INTCTRL+0:   /* Interrupt control */
11191119      case NREG_INTCTRL+1:   /* Interrupt control */
1120         if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt control(%03X) = %08X & %08X\n", activecpu_get_pc(), offset*4, data, ~mem_mask);
1120         if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt control(%03X) = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask);
11211121         logit = 0;
11221122         update_nile_irqs();
11231123         break;
11241124
11251125      case NREG_INTSTAT0+0:   /* Interrupt status 0 */
11261126      case NREG_INTSTAT0+1:   /* Interrupt status 0 */
1127         if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt status 0(%03X) = %08X & %08X\n", activecpu_get_pc(), offset*4, data, ~mem_mask);
1127         if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt status 0(%03X) = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask);
11281128         logit = 0;
11291129         update_nile_irqs();
11301130         break;
11311131
11321132      case NREG_INTSTAT1+0:   /* Interrupt status 1 */
11331133      case NREG_INTSTAT1+1:   /* Interrupt status 1 */
1134         if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt status 1/enable(%03X) = %08X & %08X\n", activecpu_get_pc(), offset*4, data, ~mem_mask);
1134         if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt status 1/enable(%03X) = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask);
11351135         logit = 0;
11361136         update_nile_irqs();
11371137         break;
11381138
11391139      case NREG_INTCLR+0:      /* Interrupt clear */
11401140      case NREG_INTCLR+1:      /* Interrupt clear */
1141         if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt clear(%03X) = %08X & %08X\n", activecpu_get_pc(), offset*4, data, ~mem_mask);
1141         if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt clear(%03X) = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask);
11421142         logit = 0;
11431143         nile_irq_state &= ~(nile_regs[offset] & ~0xf00);
11441144         update_nile_irqs();
r2454r2455
11461146
11471147      case NREG_INTPPES+0:   /* PCI Interrupt control */
11481148      case NREG_INTPPES+1:   /* PCI Interrupt control */
1149         if (LOG_NILE) logerror("%08X:NILE WRITE: PCI interrupt control(%03X) = %08X & %08X\n", activecpu_get_pc(), offset*4, data, ~mem_mask);
1149         if (LOG_NILE) logerror("%08X:NILE WRITE: PCI interrupt control(%03X) = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask);
11501150         logit = 0;
11511151         break;
11521152
r2454r2455
11711171      case NREG_T2CTRL+1:      /* general purpose timer control (control bits) */
11721172      case NREG_T3CTRL+1:      /* watchdog timer control (control bits) */
11731173         which = (offset - NREG_T0CTRL) / 4;
1174         if (LOG_NILE) logerror("%08X:NILE WRITE: timer %d control(%03X) = %08X & %08X\n", activecpu_get_pc(), which, offset*4, data, ~mem_mask);
1174         if (LOG_NILE) logerror("%08X:NILE WRITE: timer %d control(%03X) = %08X & %08X\n", activecpu_get_pc(), which, offset*4, data, mem_mask);
11751175         logit = 0;
11761176
11771177         /* timer just enabled? */
r2454r2455
12001200      case NREG_T2CNTR:      /* general purpose timer control (counter) */
12011201      case NREG_T3CNTR:      /* watchdog timer control (counter) */
12021202         which = (offset - NREG_T0CTRL) / 4;
1203         if (LOG_TIMERS) logerror("%08X:NILE WRITE: timer %d counter(%03X) = %08X & %08X\n", activecpu_get_pc(), which, offset*4, data, ~mem_mask);
1203         if (LOG_TIMERS) logerror("%08X:NILE WRITE: timer %d counter(%03X) = %08X & %08X\n", activecpu_get_pc(), which, offset*4, data, mem_mask);
12041204         logit = 0;
12051205
12061206         if (nile_regs[offset - 1] & 1)
r2454r2455
12551255   }
12561256
12571257   if (LOG_NILE && logit)
1258      logerror("%06X:nile write to offset %03X = %08X & %08X\n", activecpu_get_pc(), offset*4, data, ~mem_mask);
1258      logerror("%06X:nile write to offset %03X = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask);
12591259}
12601260
12611261
src/mame/drivers/tecmo.c
r2454r2455
665665
666666ROM_START( rygar2 )
667667   ROM_REGION( 0x18000, REGION_CPU1, 0 )
668   ROM_LOAD( "5p.bin",        0x00000, 0x08000, CRC(151ffc0b) SHA1(0eb877f2c68d3d1f52d7b12d0a8ad08c9932c054) ) /* code */
669   ROM_LOAD( "cpu_5m.bin",   0x08000, 0x04000, CRC(7ac5191b) SHA1(305f39d974f906f9bc24e9fe2ca58e647925ab63) ) /* code */
670   ROM_LOAD( "cpu_5j.bin",   0x10000, 0x08000, CRC(ed76d606) SHA1(39c8a07e9a1f218ad088d00a2c9dfc993efafb6b) ) /* banked at f000-f7ff */
671
672   ROM_REGION( 0x10000, REGION_CPU2, 0 )
673   ROM_LOAD( "cpu_4h.bin",   0x0000, 0x2000, CRC(e4a2fa87) SHA1(ed58187dbbcf59358496a98ffd6c227a87d6c433) )
674
675   ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
676   ROM_LOAD( "cpu_8k.bin",   0x00000, 0x08000, CRC(4d482fb6) SHA1(57ad838b6d30b49dbd2d0ec425f33cfb15a67918) )   /* characters */
677
678   ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE )
679   ROM_LOAD( "vid_6k.bin",   0x00000, 0x08000, CRC(aba6db9e) SHA1(43eb6f4f92afb5fbc11adc7e2ab04878ab56cb17) )   /* sprites */
680   ROM_LOAD( "vid_6j.bin",   0x08000, 0x08000, CRC(ae1f2ed6) SHA1(6e6a33e665ba0884b7f57e9ad69d3f51e41d9e7b) )   /* sprites */
681   ROM_LOAD( "vid_6h.bin",   0x10000, 0x08000, CRC(46d9e7df) SHA1(a24e0bea310a03636af704a0ad3f1a9cc4aafe12) )   /* sprites */
682   ROM_LOAD( "vid_6g.bin",   0x18000, 0x08000, CRC(45839c9a) SHA1(eaee5767d8b0b62b991c089ef51b922e89850b79) )   /* sprites */
683
684   ROM_REGION( 0x20000, REGION_GFX3, ROMREGION_DISPOSE )
685   ROM_LOAD( "vid_6p.bin",   0x00000, 0x08000, CRC(9eae5f8e) SHA1(ed83b608ca57b9bf69fa866d9b8f55d16b7cff63) )
686   ROM_LOAD( "vid_6o.bin",   0x08000, 0x08000, CRC(5a10a396) SHA1(12ebed3952ff35a2c275cb27c915f82183048cd4) )
687   ROM_LOAD( "vid_6n.bin",   0x10000, 0x08000, CRC(7b12cf3f) SHA1(6b9d8cad6e15317df01bab0591fab09199ca6d40) )
688   ROM_LOAD( "vid_6l.bin",   0x18000, 0x08000, CRC(3cea7eaa) SHA1(1dd194d5672dfe71c2b27d2d7b76f5a611cff76f) )
689
690   ROM_REGION( 0x20000, REGION_GFX4, ROMREGION_DISPOSE )
691   ROM_LOAD( "vid_6f.bin",   0x00000, 0x08000, CRC(9840edd8) SHA1(f19a1a1d932214037144c533ad07ed81256c34e7) )
692   ROM_LOAD( "vid_6e.bin",   0x08000, 0x08000, CRC(ff65e074) SHA1(513c1bad336ef5d871f15d6ba8943020f98d1f4a) )
693   ROM_LOAD( "vid_6c.bin",   0x10000, 0x08000, CRC(89868c85) SHA1(f21550f40e7a177e95c40f2726c651f85ca8edce) )
694   ROM_LOAD( "vid_6b.bin",   0x18000, 0x08000, CRC(35389a7b) SHA1(a887a89f9bbb5979bb589468d80efba1f243690b) )
695
696   ROM_REGION( 0x4000, REGION_SOUND1, 0 )   /* ADPCM samples */
697   ROM_LOAD( "cpu_1f.bin",   0x0000, 0x4000, CRC(3cc98c5a) SHA1(ea1035be939ed1a994f3273b33412c85dda0973e) )
698ROM_END
699
700ROM_START( rygar3 )
701   ROM_REGION( 0x18000, REGION_CPU1, 0 )
668702   ROM_LOAD( "cpu_5p.bin",   0x00000, 0x08000, CRC(e79c054a) SHA1(1aaffa53d121d5c55899bf18e85c42333fe0df54) ) /* code */
669703   ROM_LOAD( "cpu_5m.bin",   0x08000, 0x04000, CRC(7ac5191b) SHA1(305f39d974f906f9bc24e9fe2ca58e647925ab63) ) /* code */
670704   ROM_LOAD( "cpu_5j.bin",   0x10000, 0x08000, CRC(ed76d606) SHA1(39c8a07e9a1f218ad088d00a2c9dfc993efafb6b) ) /* banked at f000-f7ff */
r2454r2455
845879
846880GAME( 1986, rygar,    0,        rygar,    rygar,    rygar,    ROT0,  "Tecmo", "Rygar (US set 1)", 0 )
847881GAME( 1986, rygar2,   rygar,    rygar,    rygar,    rygar,    ROT0,  "Tecmo", "Rygar (US set 2)", 0 )
882GAME( 1986, rygar3,   rygar,    rygar,    rygar,    rygar,    ROT0,  "Tecmo", "Rygar (US set 3 Old Version)", 0 )
848883GAME( 1986, rygarj,   rygar,    rygar,    rygar,    rygar,    ROT0,  "Tecmo", "Argus no Senshi (Japan)", 0 )
849884GAME( 1987, gemini,   0,        gemini,   gemini,   gemini,   ROT90, "Tecmo", "Gemini Wing", 0 )
850885GAME( 1988, silkworm, 0,        silkworm, silkworm, silkworm, ROT0,  "Tecmo", "Silk Worm (set 1)", 0 )
src/mame/drivers/finalizr.c
r2454r2455
5151
5252static WRITE8_HANDLER( finalizr_i8039_irq_w )
5353{
54   cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE);
54   cpunum_set_input_line(machine, 1, 0, ASSERT_LINE);
5555}
5656
5757static WRITE8_HANDLER( i8039_irqen_w )
r2454r2455
6262    */
6363
6464   if ((data & 0x80) == 0)
65      cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
65      cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
6666}
6767
6868static READ8_HANDLER( i8039_T1_r )
src/mame/drivers/segaybd.c
r2454r2455
315315            */
316316         segaic16_set_display_enable(data & 0x80);
317317         if (((old ^ data) & 0x20) && !(data & 0x20)) watchdog_reset_w(machine,0,0);
318         cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
319         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
320         cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 0x04) ? ASSERT_LINE : CLEAR_LINE);
318         cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
319         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
320         cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (data & 0x04) ? ASSERT_LINE : CLEAR_LINE);
321321         break;
322322
323323      /* mute */
src/mame/drivers/cclimber.c
r2454r2455
189189***************************************************************************/
190190
191191#include "driver.h"
192#include "deprecat.h"
193192#include "machine/segacrpt.h"
194193#include "sound/ay8910.h"
195194#include "sound/samples.h"
src/mame/drivers/speedspn.c
r2454r2455
2121******************************************************************************/
2222
2323#include "driver.h"
24#include "deprecat.h"
2524#include "sound/okim6295.h"
2625
2726/*** README INFO **************************************************************
src/mame/drivers/enigma2.c
r2454r2455
348348   if (!(data & 0x04) && (last_sound_data & 0x04))
349349      sound_latch = (sound_latch << 1) | (~data & 0x01);
350350
351   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, (data & 0x02) ? ASSERT_LINE : CLEAR_LINE);
351   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, (data & 0x02) ? ASSERT_LINE : CLEAR_LINE);
352352
353353   last_sound_data = data;
354354}
r2454r2455
391391
392392static const struct AY8910interface ay8910_interface =
393393{
394   AY8910_LEGACY_OUTPUT,
395   AY8910_DEFAULT_LOADS,
394396   sound_latch_r,
395397   0,
396398   0,
src/mame/drivers/cowrace.c
r2454r2455
77*************************************************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110#include "sound/okim6295.h"
1211#include "sound/2203intf.h"
1312
r2454r2455
5049static WRITE8_HANDLER( cowrace_soundlatch_w )
5150{
5251   soundlatch_w(0, data);
53   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
52   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
5453}
5554#endif
5655
r2454r2455
152151
153152static const struct YM2203interface ym2203_interface_1 =
154153{
155   soundlatch_r,   OKIM6295_status_0_r,   // read  A,B
156   0,            OKIM6295_data_0_w,      // write A,B
157   0
154   {
155      AY8910_LEGACY_OUTPUT,
156      AY8910_DEFAULT_LOADS,
157      soundlatch_r,   OKIM6295_status_0_r,   // read  A,B
158      NULL,         OKIM6295_data_0_w,      // write A,B
159   },
160   NULL
158161};
159162
160163
src/mame/drivers/segaorun.c
r2454r2455
7979
8080static const ppi8255_interface single_ppi_intf =
8181{
82   1,
83   { unknown_porta_r },
84   { unknown_portb_r },
85   { unknown_portc_r },
86   { unknown_porta_w },
87   { unknown_portb_w },
88   { video_control_w }
82   unknown_porta_r,
83   unknown_portb_r,
84   unknown_portc_r,
85   unknown_porta_w,
86   unknown_portb_w,
87   video_control_w
8988};
9089
9190
r2454r2455
156155   /* init the FD1094 */
157156   fd1094_driver_init(segaic16_memory_mapper_set_decrypted);
158157
159   /* configure the 8255 interface */
160   ppi8255_init(&single_ppi_intf);
161
162158   /* reset the custom handlers and other pointers */
163159   custom_io_r = NULL;
164160   custom_io_w = NULL;
r2454r2455
364360   if (custom_io_r)
365361      return custom_io_r(machine, offset, mem_mask);
366362   logerror("%06X:misc_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2);
367   return segaic16_open_bus_r(machine,0,0);
363   return segaic16_open_bus_r(machine,0,mem_mask);
368364}
369365
370366
r2454r2455
375371      custom_io_w(machine, offset, data, mem_mask);
376372      return;
377373   }
378   logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask ^ 0xffff);
374   logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask);
379375}
380376
381377
r2454r2455
385381   switch (offset & 0x70/2)
386382   {
387383      case 0x00/2:
388         return ppi8255_0_r(machine, offset & 3);
384         return ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), offset & 3);
389385
390386      case 0x10/2:
391387         return input_port_read_indexed(machine, offset & 3);
r2454r2455
401397   }
402398
403399   logerror("%06X:outrun_custom_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2);
404   return segaic16_open_bus_r(machine,0,0);
400   return segaic16_open_bus_r(machine,0,mem_mask);
405401}
406402
407403
r2454r2455
412408   {
413409      case 0x00/2:
414410         if (ACCESSING_BITS_0_7)
415            ppi8255_0_w(machine, offset & 3, data);
411            ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), offset & 3, data);
416412         return;
417413
418414      case 0x20/2:
r2454r2455
438434         segaic16_sprites_draw_0_w(machine, offset, data, mem_mask);
439435         return;
440436   }
441   logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask ^ 0xffff);
437   logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask);
442438}
443439
444440
r2454r2455
460456      }
461457   }
462458   logerror("%06X:misc_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2);
463   return segaic16_open_bus_r(machine,0,0);
459   return segaic16_open_bus_r(machine,0,mem_mask);
464460}
465461
466462
r2454r2455
493489         /* ADC trigger */
494490         return;
495491   }
496   logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask ^ 0xffff);
492   logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask);
497493}
498494
499495
r2454r2455
829825   MDRV_MACHINE_RESET(outrun)
830826   MDRV_INTERLEAVE(100)
831827
828   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
829   MDRV_DEVICE_CONFIG( single_ppi_intf )
830
832831   /* video hardware */
833832   MDRV_GFXDECODE(segaorun)
834833   MDRV_PALETTE_LENGTH(4096*3)
src/mame/drivers/koikoi.c
r2454r2455
7373   if(inputcnt<0){      return 0;   }
7474   if(!inputcnt)
7575   {
76      int key=input_port_2_word_r(machine,0,0);
76      int key=input_port_read_indexed(machine,2);
7777      int keyval=0; //we must return 0 (0x2 in 2nd read) to clear 4 bit at $6600 and allow next read
7878
7979      if(key)
r2454r2455
240240
241241static const struct AY8910interface ay8910_interface =
242242{
243   0,             input_r,
244   unknown_w, 0
243   AY8910_LEGACY_OUTPUT,
244   AY8910_DEFAULT_LOADS,
245   NULL,       input_r,
246   unknown_w,    NULL
245247};
246248
247249#define KOIKOI_CRYSTAL 15468000
src/mame/drivers/hexa.c
r2454r2455
123123
124124static const struct AY8910interface ay8910_interface =
125125{
126   AY8910_LEGACY_OUTPUT,
127   AY8910_DEFAULT_LOADS,
126128   input_port_0_r,
127129   input_port_1_r,
130   NULL,
131   NULL
128132};
129133
130134
src/mame/drivers/gticlub.c
r2454r2455
7474{
7575   COMBINE_DATA(&paletteram32[offset]);
7676   data = paletteram32[offset];
77   palette_set_color_rgb(Machine, offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
77   palette_set_color_rgb(machine, offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
7878}
7979
8080static void voodoo_vblank_0(int param)
r2454r2455
349349      {
350350         if (data & 0x80000000)   /* CG Board 1 IRQ Ack */
351351         {
352            cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ1, CLEAR_LINE);
352            cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ1, CLEAR_LINE);
353353         }
354354         if (data & 0x40000000)   /* CG Board 0 IRQ Ack */
355355         {
356            cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, CLEAR_LINE);
356            cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, CLEAR_LINE);
357357         }
358358
359359         adc1038_di_w((data >> 24) & 1);
src/mame/drivers/cloak.c
r2454r2455
146146
147147static WRITE8_HANDLER( cloak_irq_reset_0_w )
148148{
149   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
149   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
150150}
151151
152152static WRITE8_HANDLER( cloak_irq_reset_1_w )
153153{
154   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
154   cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
155155}
156156
157157static WRITE8_HANDLER( cloak_nvram_enable_w )
src/mame/drivers/mazerbla.c
r2454r2455
3636****************************************************************************/
3737
3838#include "driver.h"
39#include "deprecat.h"
4039#include "sound/ay8910.h"
4140
4241static UINT8 *cfb_ram;
r2454r2455
284283{
285284   zpu_int_vector &= ~2;   /* clear D1 on INTA (interrupt acknowledge) */
286285
287   cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE);   /* main cpu interrupt (comes from CFB (generated at the start of INT routine on CFB) - vblank?) */
286   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);   /* main cpu interrupt (comes from CFB (generated at the start of INT routine on CFB) - vblank?) */
288287}
289288
290289static READ8_HANDLER( cfb_zpu_int_req_clr )
r2454r2455
293292
294293   /* clear the INT line when there are no more interrupt requests */
295294   if (zpu_int_vector==0xff)
296      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
295      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
297296
298297   return 0;
299298}
r2454r2455
584583      bit0 = (data >> 0) & 0x01;
585584      b = combine_3_weights(weights_b, bit0, bit1, bit2);
586585
587      palette_set_color(Machine, 255, MAKE_RGB(r, g, b));
586      palette_set_color(machine, 255, MAKE_RGB(r, g, b));
588587      //logerror("background color (port 01) write=%02x\n",data);
589588   }
590589}
r2454r2455
977976                  b = combine_3_weights(weights_b, bit0, bit1, bit2);
978977
979978                  if ((x+y*16)<255)//keep color 255 free for use as background color
980                     palette_set_color(Machine, x+y*16, MAKE_RGB(r, g, b));
979                     palette_set_color(machine, x+y*16, MAKE_RGB(r, g, b));
981980
982981                  lookup_RAM[ lookup_offs + x + y*16 ] = colour;
983982               }
r2454r2455
11141113
11151114static WRITE8_HANDLER( sound_int_clear_w )
11161115{
1117   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
1116   cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
11181117}
11191118static WRITE8_HANDLER( sound_nmi_clear_w )
11201119{
1121   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
1120   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
11221121}
11231122
11241123static WRITE8_HANDLER( gg_led_ctrl_w )
r2454r2455
14711470/* only Great Guns */
14721471static const struct AY8910interface ay8912_interface_1 =
14731472{
1474   0,
1475   soundcommand_r
1473   AY8910_LEGACY_OUTPUT,
1474   AY8910_DEFAULT_LOADS,
1475   NULL,
1476   soundcommand_r,
1477   NULL,
1478   NULL
14761479};
14771480
14781481static const struct AY8910interface ay8912_interface_2 =
14791482{
1480   0,
1481   0,
1482   0,
1483   AY8910_LEGACY_OUTPUT,
1484   AY8910_DEFAULT_LOADS,
1485   NULL,
1486   NULL,
1487   NULL,
14831488   gg_led_ctrl_w
14841489};
14851490
src/mame/drivers/foodf.c
r2454r2455
180180      /* bit 1 = UPDATE */
181181
182182      if (!(data & 0x04))
183         atarigen_scanline_int_ack_w(machine,0,0,0);
183         atarigen_scanline_int_ack_w(machine,0,0,0xffff);
184184      if (!(data & 0x08))
185         atarigen_video_int_ack_w(machine,0,0,0);
185         atarigen_video_int_ack_w(machine,0,0,0xffff);
186186
187187      output_set_led_value(0, (data >> 4) & 1);
188188      output_set_led_value(1, (data >> 5) & 1);
src/mame/drivers/namcona1.c
r2454r2455
835835   }
836836   if( dest>=0xf00000 && dest<=0xf02000 )
837837   {
838      namcona1_paletteram_w( machine, (dest-0xf00000)/2, data, 0x0000 );
838      namcona1_paletteram_w( machine, (dest-0xf00000)/2, data, 0xffff );
839839   }
840840   else if( dest>=0xf40000 && dest<=0xf80000 )
841841   {
842      namcona1_gfxram_w( machine, (dest-0xf40000)/2, data, 0x0000 );
842      namcona1_gfxram_w( machine, (dest-0xf40000)/2, data, 0xffff );
843843   }
844844   else if( dest>=0xff0000 && dest<0xff8000 )
845845   {
846      namcona1_videoram_w( machine, (dest-0xff0000)/2, data, 0x0000 );
846      namcona1_videoram_w( machine, (dest-0xff0000)/2, data, 0xffff );
847847   }
848848   else if( dest>=0xff8000 && dest<=0xffdfff )
849849   {
r2454r2455
11111111
11121112static WRITE16_HANDLER( na1mcu_shared_w )
11131113{
1114   mem_mask = ((mem_mask>>8)&0xff) | ((mem_mask<<8)&0xff00);
1115   data = ((data>>8)&0xff) | ((data<<8)&0xff00);
1114   mem_mask = FLIPENDIAN_INT16(mem_mask);
1115   data = FLIPENDIAN_INT16(data);
11161116
11171117   COMBINE_DATA(&namcona1_workram[offset]);
11181118}
src/mame/drivers/armedf.c
r2454r2455
226226      int i;
227227      for (i = 0; i < 0x1000; i++)
228228      {
229         armedf_text_videoram_w(machine,i, ' ', 0);
229         armedf_text_videoram_w(machine,i, ' ', 0xffff);
230230      }
231231   }
232232}
src/mame/drivers/hanaroku.c
r2454r2455
230230
231231static const struct AY8910interface ay8910_interface =
232232{
233   AY8910_LEGACY_OUTPUT,
234   AY8910_DEFAULT_LOADS,
233235   input_port_3_r,
234   input_port_4_r
236   input_port_4_r,
237   NULL,
238   NULL
235239};
236240
237241
src/mame/drivers/metlclsh.c
r2454r2455
6464
6565static WRITE8_HANDLER( metlclsh_cause_irq )
6666{
67   cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,ASSERT_LINE);
67   cpunum_set_input_line(machine, 1,M6809_IRQ_LINE,ASSERT_LINE);
6868}
6969
7070static WRITE8_HANDLER( metlclsh_ack_nmi )
7171{
72   cpunum_set_input_line(Machine, 0,INPUT_LINE_NMI,CLEAR_LINE);
72   cpunum_set_input_line(machine, 0,INPUT_LINE_NMI,CLEAR_LINE);
7373}
7474
7575static ADDRESS_MAP_START( metlclsh_readmem, ADDRESS_SPACE_PROGRAM, 8 )
r2454r2455
115115
116116static WRITE8_HANDLER( metlclsh_cause_nmi2 )
117117{
118   cpunum_set_input_line(Machine, 0,INPUT_LINE_NMI,ASSERT_LINE);
118   cpunum_set_input_line(machine, 0,INPUT_LINE_NMI,ASSERT_LINE);
119119}
120120
121121static WRITE8_HANDLER( metlclsh_ack_irq2 )
122122{
123   cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,CLEAR_LINE);
123   cpunum_set_input_line(machine, 1,M6809_IRQ_LINE,CLEAR_LINE);
124124}
125125
126126static WRITE8_HANDLER( metlclsh_ack_nmi2 )
127127{
128   cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,CLEAR_LINE);
128   cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,CLEAR_LINE);
129129}
130130
131131static WRITE8_HANDLER( metlclsh_flipscreen_w )
src/mame/drivers/aliens.c
r2454r2455
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1211#include "cpu/konami/konami.h" /* for the callback and the firq irq definition */
1312#include "video/konamiic.h"
1413#include "sound/k007232.h"
src/mame/drivers/88games.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "cpu/konami/konami.h"
109#include "cpu/z80/z80.h"
1110#include "video/konamiic.h"
r2454r2455
6867
6968static WRITE8_HANDLER( k88games_sh_irqtrigger_w )
7069{
71   cpunum_set_input_line_and_vector(Machine, 1, 0, HOLD_LINE, 0xff);
70   cpunum_set_input_line_and_vector(machine, 1, 0, HOLD_LINE, 0xff);
7271}
7372
7473/* handle fake button for speed cheat for players 1 and 2 */
src/mame/drivers/ddenlovr.c
r2454r2455
65556555
65566556static const struct AY8910interface quiz365_ay8910_interface =
65576557{
6558   AY8910_LEGACY_OUTPUT,
6559   AY8910_DEFAULT_LOADS,
65586560   quiz365_input_r,
65596561   0,
65606562   0,
r2454r2455
68936895
68946896static const struct AY8910interface mjmyster_ay8910_interface =
68956897{
6898   AY8910_LEGACY_OUTPUT,
6899   AY8910_DEFAULT_LOADS,
68966900   0,
68976901   0,
68986902   0,
r2454r2455
69416945
69426946static const struct AY8910interface hginga_ay8910_interface =
69436947{
6948   AY8910_LEGACY_OUTPUT,
6949   AY8910_DEFAULT_LOADS,
69446950   // A            B
69456951   hginga_dsw_r,   0,               // R
69466952   0,            ddenlovr_select_w      // W
src/mame/drivers/chinagat.c
r2454r2455
142142
143143static WRITE8_HANDLER( chinagat_sub_IRQ_w )
144144{
145   cpunum_set_input_line(Machine, 1, sprite_irq, (sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE );
145   cpunum_set_input_line(machine, 1, sprite_irq, (sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE );
146146}
147147
148148static WRITE8_HANDLER( chinagat_cpu_sound_cmd_w )
r2454r2455
483483/* This is only on the second bootleg board */
484484static const struct YM2203interface ym2203_interface =
485485{
486   0,
487   0,
488   0,
489   0,
486   {
487      AY8910_LEGACY_OUTPUT,
488      AY8910_DEFAULT_LOADS,
489      NULL, NULL, NULL, NULL
490   },
490491   chinagat_irq_handler
491492};
492493
src/mame/drivers/kaneko16.c
r2454r2455
16491649
16501650static const struct AY8910interface ay8910_intf_dsw =
16511651{
1652   AY8910_LEGACY_OUTPUT,
1653   AY8910_DEFAULT_LOADS,
16521654   input_port_4_r,   /* input A: DSW 1 */
1653   input_port_5_r   /* input B: DSW 2 */
1655   input_port_5_r,   /* input B: DSW 2 */
1656   NULL,
1657   NULL,
16541658};
16551659
16561660static const struct AY8910interface ay8910_intf_eeprom =
16571661{
1662   AY8910_LEGACY_OUTPUT,
1663   AY8910_DEFAULT_LOADS,
16581664   kaneko16_eeprom_r,      /* inputs  A:  0,EEPROM bit read */
1659   0,                  /* inputs  B */
1660   0,                  /* outputs A */
1665   NULL,                  /* inputs  B */
1666   NULL,                  /* outputs A */
16611667   kaneko16_eeprom_reset_w   /* outputs B:  0,EEPROM reset */
16621668};
16631669
src/mame/drivers/goldstar.c
r2454r2455
275275
276276static const struct AY8910interface ay8910_interface =
277277{
278 input_port_7_r,   /* DSW 4 */
279 input_port_6_r,   /* DSW 3 */
280 0,
281 0
278   AY8910_LEGACY_OUTPUT,
279   AY8910_DEFAULT_LOADS,
280   input_port_7_r,   /* DSW 4 */
281   input_port_6_r,   /* DSW 3 */
282   NULL,
283   NULL
282284};
283285
284286static MACHINE_DRIVER_START( goldstar )
src/mame/drivers/dbz.c
r2454r2455
135135
136136static WRITE16_HANDLER( dbz_sound_cause_nmi )
137137{
138   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
138   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
139139}
140140
141141static void dbz_sound_irq(int irq)
src/mame/drivers/cybertnk.c
r2454r2455
302302      case 0:
303303         // sound data
304304         if (ACCESSING_BITS_0_7)
305            cpunum_set_input_line(Machine, 2, 0, HOLD_LINE);
305            cpunum_set_input_line(machine, 2, 0, HOLD_LINE);
306306         else
307307            LOG_UNKNOWN_WRITE
308308         break;
src/mame/drivers/wc90.c
r2454r2455
309309
310310static const struct YM2608interface ym2608_interface =
311311{
312   0,0,0,0,irqhandler,
312   {
313      AY8910_LEGACY_OUTPUT,
314      AY8910_DEFAULT_LOADS,
315      NULL, NULL, NULL, NULL
316   },
317   irqhandler,
313318   REGION_SOUND1
314319};
315320
src/mame/drivers/ms32.c
r2454r2455
289289
290290static WRITE32_HANDLER( reset_sub_w )
291291{
292   if(data) cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); // 0 too ?
292   if(data) cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, PULSE_LINE); // 0 too ?
293293}
294294
295295
src/mame/drivers/skylncr.c
r2454r2455
99*************************************************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1312#include "sound/ay8910.h"
1413
1514static tilemap *tmap, *tmap2;
r2454r2455
123122      paletteram[color] = data;
124123      r = paletteram[(color/3*3)+0];   g = paletteram[(color/3*3)+1];   b = paletteram[(color/3*3)+2];
125124      r = (r << 2) | (r >> 4);      g = (g << 2) | (g >> 4);      b = (b << 2) | (b >> 4);
126      palette_set_color(Machine,color/3,MAKE_RGB(r,g,b));
125      palette_set_color(machine,color/3,MAKE_RGB(r,g,b));
127126      color = (color + 1) % (0x100*3);
128127   }
129128}
r2454r2455
142141      paletteram_2[color] = data;
143142      r = paletteram_2[(color/3*3)+0];   g = paletteram_2[(color/3*3)+1];   b = paletteram_2[(color/3*3)+2];
144143      r = (r << 2) | (r >> 4);         g = (g << 2) | (g >> 4);         b = (b << 2) | (b >> 4);
145      palette_set_color(Machine,0x100 + color/3,MAKE_RGB(r,g,b));
144      palette_set_color(machine,0x100 + color/3,MAKE_RGB(r,g,b));
146145      color = (color + 1) % (0x100*3);
147146   }
148147}
r2454r2455
412411
413412static const struct AY8910interface ay8910_interface =
414413{
415   input_port_6_r,   input_port_7_r,
416   0,            0
414   AY8910_LEGACY_OUTPUT,
415   AY8910_DEFAULT_LOADS,
416   input_port_6_r,
417   input_port_7_r,
418   NULL,
419   NULL
417420};
418421
419422
src/mame/drivers/darkseal.c
r2454r2455
3838{
3939   switch (offset<<1) {
4040    case 6: /* DMA flag */
41      buffer_spriteram16_w(machine,0,0,0);
41      buffer_spriteram16_w(machine,0,0,0xffff);
4242      return;
4343    case 8: /* Sound CPU write */
4444      soundlatch_w(machine,0,data & 0xff);
src/mame/drivers/seicross.c
r2454r2455
4343***************************************************************************/
4444
4545#include "driver.h"
46#include "deprecat.h"
4746#include "sound/ay8910.h"
4847#include "sound/dac.h"
4948
r2454r2455
107106   if (((portb & 4) == 0) && (data & 4))
108107   {
109108      /* reset and start the protection mcu */
110      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE);
111      cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
109      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, PULSE_LINE);
110      cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
112111   }
113112
114113   /* other bits unknown */
r2454r2455
391390
392391static const struct AY8910interface ay8910_interface =
393392{
394   0,
393   AY8910_LEGACY_OUTPUT,
394   AY8910_DEFAULT_LOADS,
395   NULL,
395396   friskyt_portB_r,
396   0,
397   NULL,
397398   friskyt_portB_w
398399};
399400
src/mame/drivers/system16.c
r2454r2455
12051205}
12061206static READ16_HANDLER( ga_io_service_r )
12071207{
1208   return (input_port_2_word_r(machine,0,0) << 8) | (sys16_workingram[0x2c96/2] & 0x00ff);
1208   return (input_port_read_indexed(machine,2) << 8) | (sys16_workingram[0x2c96/2] & 0x00ff);
12091209}
12101210
12111211static ADDRESS_MAP_START( goldnaxe_readmem, ADDRESS_SPACE_PROGRAM, 16 )
r2454r2455
12311231   if( ACCESSING_BITS_8_15 )
12321232{
12331233      soundlatch_w( machine,0,data>>8 );
1234      cpunum_set_input_line(Machine, 1, 0, HOLD_LINE );
1234      cpunum_set_input_line(machine, 1, 0, HOLD_LINE );
12351235   }
12361236}
12371237
r2454r2455
14001400
14011401static READ16_HANDLER( passht4b_service_r )
14021402{
1403   UINT16 val=input_port_2_word_r(machine,offset,0);
1403   UINT16 val=input_port_read_indexed(machine,2);
14041404   if(!(input_port_read_indexed(machine, 0) & 0x40)) val&=0xef;
14051405   if(!(input_port_read_indexed(machine, 1) & 0x40)) val&=0xdf;
14061406   if(!(input_port_read_indexed(machine, 5) & 0x40)) val&=0xbf;
r2454r2455
19081908/***************************************************************************/
19091909
19101910static READ16_HANDLER( tt_io_player1_r )
1911{ return input_port_0_r( machine, offset ) << 8; }
1911{ return input_port_read_indexed(machine,0) << 8; }
19121912static READ16_HANDLER( tt_io_player2_r )
1913{ return input_port_1_r( machine, offset ) << 8; }
1913{ return input_port_read_indexed(machine,1) << 8; }
19141914static READ16_HANDLER( tt_io_service_r )
1915{ return input_port_2_r( machine, offset ) << 8; }
1915{ return input_port_read_indexed(machine,2) << 8; }
19161916
19171917
19181918
src/mame/drivers/nyny.c
r2454r2455
138138   /* update the different PIA pins from the input ports */
139139
140140   /* CA1 - copy of PA0 (COIN1) */
141   pia_1_ca1_w(machine, 0, input_port_0_r(machine, 0) & 0x01);
141   pia_1_ca1_w(machine, 0, input_port_read_indexed(machine, 0) & 0x01);
142142
143143   /* CA2 - copy of PA1 (SERVICE1) */
144   pia_1_ca2_w(machine, 0, input_port_0_r(machine, 0) & 0x02);
144   pia_1_ca2_w(machine, 0, input_port_read_indexed(machine, 0) & 0x02);
145145
146146   /* CB1 - (crosshatch) */
147   pia_1_cb1_w(machine, 0, input_port_5_r(machine, 0));
147   pia_1_cb1_w(machine, 0, input_port_read_indexed(machine, 5));
148148
149149   /* CB2 - NOT CONNECTED */
150150}
r2454r2455
461461
462462static const struct AY8910interface ay8910_37_interface =
463463{
464   0,
465   0,
464   AY8910_LEGACY_OUTPUT,
465   AY8910_DEFAULT_LOADS,
466   NULL,
467   NULL,
466468   nyny_ay8910_37_port_a_w,
467469   nyny_ay8910_37_port_b_w
468470};
r2454r2455
470472
471473static const struct AY8910interface ay8910_64_interface =
472474{
475   AY8910_LEGACY_OUTPUT,
476   AY8910_DEFAULT_LOADS,
473477   input_port_3_r,
474   input_port_2_r
478   input_port_2_r,
479   NULL,
480   NULL
475481};
476482
477483
src/mame/drivers/limenko.c
r2454r2455
2424*/
2525
2626#include "driver.h"
27#include "deprecat.h"
2827#include "sound/okim6295.h"
2928#include "machine/eeprom.h"
3029
r2454r2455
6463   if(ACCESSING_BITS_0_15)
6564   {
6665      paldata = paletteram32[offset] & 0x7fff;
67      palette_set_color_rgb(Machine, offset * 2 + 1, pal5bit(paldata >> 0), pal5bit(paldata >> 5), pal5bit(paldata >> 10));
66      palette_set_color_rgb(machine, offset * 2 + 1, pal5bit(paldata >> 0), pal5bit(paldata >> 5), pal5bit(paldata >> 10));
6867   }
6968
7069   if(ACCESSING_BITS_16_31)
7170   {
7271      paldata = (paletteram32[offset] >> 16) & 0x7fff;
73      palette_set_color_rgb(Machine, offset * 2 + 0, pal5bit(paldata >> 0), pal5bit(paldata >> 5), pal5bit(paldata >> 10));
72      palette_set_color_rgb(machine, offset * 2 + 0, pal5bit(paldata >> 0), pal5bit(paldata >> 5), pal5bit(paldata >> 10));
7473   }
7574}
7675
src/mame/drivers/redalert.c
r2454r2455
6868****************************************************************************/
6969
7070#include "driver.h"
71#include "deprecat.h"
7271#include "cpu/m6502/m6502.h"
7372#include "redalert.h"
7473
r2454r2455
9695
9796static READ8_HANDLER( redalert_interrupt_clear_r )
9897{
99   cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, CLEAR_LINE);
98   cpunum_set_input_line(machine, 0, M6502_IRQ_LINE, CLEAR_LINE);
10099
101100   /* the result never seems to be actually used */
102101   return video_screen_get_vpos(machine->primary_screen);
src/mame/drivers/pipeline.c
r2454r2455
187187       if(offset<0x300)
188188       {
189189          offset&=0xff;
190          palette_set_color_rgb(Machine, offset, pal6bit(palram[offset]), pal6bit(palram[offset+0x100]), pal6bit(palram[offset+0x200]));
190          palette_set_color_rgb(machine, offset, pal6bit(palram[offset]), pal6bit(palram[offset+0x100]), pal6bit(palram[offset+0x200]));
191191       }
192192   }
193193}
r2454r2455
219219   AM_RANGE(0x8000, 0x87ff) AM_RAM
220220   AM_RANGE(0x8800, 0x97ff) AM_RAM_WRITE(vram1_w) AM_BASE(&vram1)
221221   AM_RANGE(0x9800, 0xa7ff) AM_RAM_WRITE(vram2_w) AM_BASE(&vram2)
222   AM_RANGE(0xb800, 0xb803) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
223   AM_RANGE(0xb810, 0xb813) AM_READWRITE(ppi8255_1_r, ppi8255_1_w)
222   AM_RANGE(0xb800, 0xb803) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
223   AM_RANGE(0xb810, 0xb813) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
224224   AM_RANGE(0xb830, 0xb830) AM_NOP
225225   AM_RANGE(0xb840, 0xb840) AM_NOP
226226ADDRESS_MAP_END
r2454r2455
228228static ADDRESS_MAP_START( cpu1_mem, ADDRESS_SPACE_PROGRAM, 8 )
229229   AM_RANGE(0x0000, 0x7fff) AM_ROM
230230   AM_RANGE(0xc000, 0xc7ff) AM_RAM
231   AM_RANGE(0xe000, 0xe003) AM_READWRITE(ppi8255_2_r, ppi8255_2_w)
231   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE(PPI8255, "ppi8255_2", ppi8255_r, ppi8255_w)
232232ADDRESS_MAP_END
233233
234234static ADDRESS_MAP_START( sound_port, ADDRESS_SPACE_IO, 8 )
r2454r2455
307307   { 0, 0, 0, 0, -1 }      /* end mark */
308308};
309309
310static const ppi8255_interface ppi8255_intf =
310static const ppi8255_interface ppi8255_intf[3] =
311311{
312   3,
313   { input_port_0_r, input_port_1_r, NULL },   /* Port A read */
314   { NULL,           input_port_2_r, NULL },   /* Port B read */
315   { NULL,           protection_r,     NULL },   /* Port C read */
316   { NULL,           NULL,             NULL },   /* Port A write */
317   { NULL,           NULL,           NULL },   /* Port B write */
318   { vidctrl_w,      protection_w,   NULL },   /* Port C write */
312   {
313      input_port_0_r,            /* Port A read */
314      NULL,                  /* Port B read */
315      NULL,                  /* Port C read */
316      NULL,                  /* Port A write */
317      NULL,                  /* Port B write */
318      vidctrl_w               /* Port C write */
319   },
320   {
321      input_port_1_r,            /* Port A read */
322      input_port_2_r,            /* Port B read */
323      protection_r,            /* Port C read */
324      NULL,                  /* Port A write */
325      NULL,                  /* Port B write */
326      protection_w            /* Port C write */
327   },
328   {
329      NULL,                  /* Port A read */
330      NULL,                  /* Port B read */
331      NULL,                  /* Port C read */
332      NULL,                  /* Port A write */
333      NULL,                  /* Port B write */
334      NULL                  /* Port C write */
335   }
319336};
320337
321338static const struct YM2203interface ym2203_interface =
322339{
323   0,
324   0,
325   0,
326   0
340   {
341      AY8910_LEGACY_OUTPUT,
342      AY8910_DEFAULT_LOADS,
343      NULL, NULL, NULL, NULL
344   },
345   NULL
327346};
328347
329348static PALETTE_INIT(pipeline)
r2454r2455
349368{
350369   ctc_intf.baseclock = cpunum_get_clock(0);
351370   z80ctc_init(0, &ctc_intf);
352   ppi8255_init(&ppi8255_intf);
353371}
354372
355373static MACHINE_DRIVER_START( pipeline )
r2454r2455
367385   MDRV_CPU_ADD(M68705, 7372800/2)
368386   MDRV_CPU_PROGRAM_MAP(mcu_mem, 0)
369387
388   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
389   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
390
391   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
392   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
393
394   MDRV_DEVICE_ADD( "ppi8255_2", PPI8255 )
395   MDRV_DEVICE_CONFIG( ppi8255_intf[2] )
396
370397   /* video hardware */
371398   MDRV_SCREEN_ADD("main", RASTER)
372399   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/prehisle.c
r2454r2455
357357
358358/******************************************************************************/
359359
360static READ16_HANDLER( world_cycle_r )
361{
362   int pc=activecpu_get_pc();
363   int ret=prehisle_ram16[0x12];
364360
365   if ((ret&0x8000) && (pc==0x260c || pc==0x268a || pc==0x2b0a || pc==0x34a8 || pc==0x6ae4 || pc==0x83ac || pc==0x25ce || pc==0x29c4)) {
366      cpu_spinuntil_int();
367      return ret&0x7fff;
368   }
369   return ret;
370}
371
372static DRIVER_INIT( prehisle )
373{
374   memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x70024, 0x70025, 0, 0, world_cycle_r);
375}
376
377static READ16_HANDLER( usa_cycle_r )
378{
379   int pc=activecpu_get_pc();
380   int ret=prehisle_ram16[0x12];
381
382   if ((ret&0x8000) && (pc==0x281e || pc==0x28a6 || pc==0x295a || pc==0x2868 || pc==0x8f98 || pc==0x3b1e)) {
383      cpu_spinuntil_int();
384      return ret&0x7fff;
385   }
386   return ret;
387}
388
389static DRIVER_INIT( prehislu )
390{
391   memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x70024, 0x70025, 0, 0, usa_cycle_r);
392}
393
394static READ16_HANDLER( jap_cycle_r )
395{
396   int pc=activecpu_get_pc();
397   int ret=prehisle_ram16[0x12];
398
399   if ((ret&0x8000) && (pc==0x34b6 /* Todo! */ )) {
400      cpu_spinuntil_int();
401      return ret&0x7fff;
402   }
403   return ret;
404}
405
406static DRIVER_INIT( gensitou )
407{
408   memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x70024, 0x70025, 0, 0, jap_cycle_r);
409}
410
411/******************************************************************************/
412
413GAME( 1989, prehisle, 0,      prehisle, prehisle, prehisle, ROT0, "SNK", "Prehistoric Isle in 1930 (World)", GAME_SUPPORTS_SAVE )
414GAME( 1989, prehislu, prehisle, prehisle, prehisle, prehislu, ROT0, "SNK of America", "Prehistoric Isle in 1930 (US)", GAME_SUPPORTS_SAVE )
415GAME( 1989, gensitou, prehisle, prehisle, prehisle, gensitou, ROT0, "SNK", "Genshi-Tou 1930's", GAME_SUPPORTS_SAVE )
361GAME( 1989, prehisle, 0,      prehisle, prehisle, 0, ROT0, "SNK", "Prehistoric Isle in 1930 (World)", GAME_SUPPORTS_SAVE )
362GAME( 1989, prehislu, prehisle, prehisle, prehisle, 0, ROT0, "SNK of America", "Prehistoric Isle in 1930 (US)", GAME_SUPPORTS_SAVE )
363GAME( 1989, gensitou, prehisle, prehisle, prehisle, 0, ROT0, "SNK", "Genshi-Tou 1930's", GAME_SUPPORTS_SAVE )
src/mame/drivers/simpsons.c
r2454r2455
8585static WRITE8_HANDLER( z80_arm_nmi_w )
8686{
8787//  sound_nmi_enabled = 1;
88   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
88   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
8989   timer_set(ATTOTIME_IN_USEC(25), NULL,0,nmi_callback);   /* kludge until the K053260 is emulated correctly */
9090}
9191
src/mame/drivers/wwfsstar.c
r2454r2455
141141static WRITE16_HANDLER( wwfsstar_irqack_w )
142142{
143143   if(offset == 0)
144      cpunum_set_input_line(Machine, 0, 6, CLEAR_LINE);
144      cpunum_set_input_line(machine, 0, 6, CLEAR_LINE);
145145
146146   else
147      cpunum_set_input_line(Machine, 0, 5, CLEAR_LINE);
147      cpunum_set_input_line(machine, 0, 5, CLEAR_LINE);
148148}
149149
150150/*
src/mame/drivers/model1.c
r2454r2455
880880   if (fifo_wptr >= FIFO_SIZE) fifo_wptr = 0;
881881
882882   // signal the 68000 that there's data waiting
883   cpunum_set_input_line(Machine, 1, 2, HOLD_LINE);
883   cpunum_set_input_line(machine, 1, 2, HOLD_LINE);
884884   // give the 68k time to reply
885885   cpu_spinuntil_time(ATTOTIME_IN_USEC(40));
886886}
src/mame/drivers/polepos.c
r2454r2455
373373
374374   cpu_interrupt_enable(which,data);
375375   if (!data)
376      cpunum_set_input_line(Machine, which, 0, CLEAR_LINE);
376      cpunum_set_input_line(machine, which, 0, CLEAR_LINE);
377377}
378378
379379
src/mame/drivers/taito_b.c
r2454r2455
328328
329329static READ16_HANDLER( tracky1_hi_r )
330330{
331   return input_port_5_word_r(machine,0,0);
331   return input_port_read_indexed(machine,5);
332332}
333333static READ16_HANDLER( tracky1_lo_r )
334334{
335   return (input_port_5_word_r(machine,0,0) & 0xff) <<8;
335   return (input_port_read_indexed(machine,5) & 0xff) <<8;
336336}
337337static READ16_HANDLER( trackx1_hi_r )
338338{
339   return input_port_6_word_r(machine,0,0);
339   return input_port_read_indexed(machine,6);
340340}
341341static READ16_HANDLER( trackx1_lo_r )
342342{
343   return (input_port_6_word_r(machine,0,0) & 0xff) <<8;
343   return (input_port_read_indexed(machine,6) & 0xff) <<8;
344344}
345345static READ16_HANDLER( tracky2_hi_r )
346346{
347   return input_port_7_word_r(machine,0,0);
347   return input_port_read_indexed(machine,7);
348348}
349349static READ16_HANDLER( tracky2_lo_r )
350350{
351   return (input_port_7_word_r(machine,0,0) & 0xff) <<8;
351   return (input_port_read_indexed(machine,7) & 0xff) <<8;
352352}
353353static READ16_HANDLER( trackx2_hi_r )
354354{
355   return input_port_8_word_r(machine,0,0);
355   return input_port_read_indexed(machine,8);
356356}
357357static READ16_HANDLER( trackx2_lo_r )
358358{
359   return (input_port_8_word_r(machine,0,0) & 0xff) <<8;
359   return (input_port_read_indexed(machine,8) & 0xff) <<8;
360360}
361361
362362
r2454r2455
413413   int res;
414414
415415   res = (EEPROM_read_bit() & 0x01);
416   res |= input_port_1_word_r(machine,0,0) & 0xfe; /* coin inputs */
416   res |= input_port_read_indexed(machine,1) & 0xfe; /* coin inputs */
417417
418418   return res;
419419}
r2454r2455
25872587
25882588static const struct YM2203interface ym2203_interface =
25892589{
2590   0,
2591   0,
2592   bankswitch_w,
2593   0,
2590   {
2591      AY8910_LEGACY_OUTPUT,
2592      AY8910_DEFAULT_LOADS,
2593      NULL,
2594      NULL,
2595      bankswitch_w,
2596      NULL,
2597   },
25942598   irqhandler
25952599};
25962600
src/mame/drivers/mw8080bw.c
r2454r2455
141141****************************************************************************/
142142
143143#include "driver.h"
144#include "deprecat.h"
145144#include "rendlay.h"
146145#include "rescap.h"
147146#include "mw8080bw.h"
src/mame/drivers/namcos86.c
r2454r2455
175175*******************************************************************/
176176
177177#include "driver.h"
178#include "deprecat.h"
179178#include "cpu/m6800/m6800.h"
180179#include "sound/2151intf.h"
181180#include "sound/namco.h"
r2454r2455
266265
267266static WRITE8_HANDLER( int_ack1_w )
268267{
269   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
268   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
270269}
271270
272271static WRITE8_HANDLER( int_ack2_w )
273272{
274   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
273   cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
275274}
276275
277276
src/mame/drivers/suna8.c
r2454r2455
15341534
15351535static const struct AY8910interface hardhead_ay8910_interface =
15361536{
1537   0,
1538   0,
1537   AY8910_LEGACY_OUTPUT,
1538   AY8910_DEFAULT_LOADS,
1539   NULL,
1540   NULL,
15391541   suna8_play_samples_w,
15401542   suna8_samples_number_w
15411543};
r2454r2455
17571759
17581760static const struct AY8910interface starfigh_ay8910_interface =
17591761{
1760   0,
1761   0,
1762   AY8910_LEGACY_OUTPUT,
1763   AY8910_DEFAULT_LOADS,
1764   NULL,
1765   NULL,
17621766   suna8_play_samples_w,
17631767   suna8_samples_number_w
17641768};
src/mame/drivers/qdrmfgp.c
r2454r2455
4747static READ16_HANDLER( i_port1_r )
4848{
4949   if (control & 0x0080)
50      return input_port_0_word_r(machine,0,0);
50      return input_port_read_indexed(machine,0);
5151   else
52      return input_port_1_word_r(machine,0,0);
52      return input_port_read_indexed(machine,1);
5353}
5454
5555static READ16_HANDLER( i_port2_r )
5656{
5757   /* bit 0-1  battery power sensor: 3=good, 2=low, other=bad */
58   return (input_port_2_word_r(machine,0,0) & 0xfffc) | 0x0003;
58   return (input_port_read_indexed(machine,2) & 0xfffc) | 0x0003;
5959}
6060
6161
r2454r2455
214214static READ16_DEVICE_HANDLER( ide_std_r )
215215{
216216   if (offset & 0x01)
217      return ide_controller16_r(device, IDE_STD_OFFSET + offset/2, 0x00ff) >> 8;
217      return ide_controller16_r(device, IDE_STD_OFFSET + offset/2, 0xff00) >> 8;
218218   else
219      return ide_controller16_r(device, IDE_STD_OFFSET + offset/2, 0x0000);
219      return ide_controller16_r(device, IDE_STD_OFFSET + offset/2, 0xffff);
220220}
221221
222222static WRITE16_DEVICE_HANDLER( ide_std_w )
223223{
224224   if (offset & 0x01)
225      ide_controller16_w(device, IDE_STD_OFFSET + offset/2, data << 8, 0x00ff);
225      ide_controller16_w(device, IDE_STD_OFFSET + offset/2, data << 8, 0xff00);
226226   else
227      ide_controller16_w(device, IDE_STD_OFFSET + offset/2, data, 0x0000);
227      ide_controller16_w(device, IDE_STD_OFFSET + offset/2, data, 0xffff);
228228}
229229
230230static READ16_DEVICE_HANDLER( ide_alt_r )
231231{
232232   if (offset == 0)
233      return ide_controller16_r(device, IDE_ALT_OFFSET, 0xff00);
233      return ide_controller16_r(device, IDE_ALT_OFFSET, 0x00ff);
234234
235235   return 0;
236236}
r2454r2455
238238static WRITE16_DEVICE_HANDLER( ide_alt_w )
239239{
240240   if (offset == 0)
241      ide_controller16_w(device, IDE_ALT_OFFSET, data, 0xff00);
241      ide_controller16_w(device, IDE_ALT_OFFSET, data, 0x00ff);
242242}
243243
244244
r2454r2455
260260               break;
261261         }
262262      }
263      return ide_controller16_r(device, IDE_STD_OFFSET + offset/2, 0x00ff) >> 8;
263      return ide_controller16_r(device, IDE_STD_OFFSET + offset/2, 0xff00) >> 8;
264264   } else {
265      return ide_controller16_r(device, IDE_STD_OFFSET + offset/2, 0x0000);
265      return ide_controller16_r(device, IDE_STD_OFFSET + offset/2, 0xffff);
266266   }
267267}
268268
src/mame/drivers/cps1.c
r2454r2455
161161
162162#include "cps1.h"       /* External CPS1 definitions */
163163
164READ16_HANDLER( cps1_input_r )
164READ16_HANDLER( cps1_dsw_r )
165165{
166166   static const char *const dswname[] = { "IN0", "DSWA", "DSWB", "DSWC" };
167167   int in = input_port_read(machine, dswname[offset]);
168   return in << 8;
168   return (in << 8) | 0xff;
169169}
170170
171171READ16_HANDLER( cps1_in1_r )
172172{
173   int buttons = input_port_read(machine, "IN1");
174   return buttons;
173   return input_port_read(machine, "IN1");
175174}
176175
177176READ16_HANDLER( cps1_in2_r )
r2454r2455
213212static WRITE8_HANDLER( cps1_snd_bankswitch_w )
214213{
215214   UINT8 *RAM = memory_region(REGION_CPU2);
216   int length = memory_region_length(REGION_CPU2) - 0x10000;
217215   int bankaddr;
218216
219   bankaddr = (data * 0x4000) & (length-1);
217   bankaddr = ((data & 1) * 0x4000);
220218   memory_set_bankptr(1,&RAM[0x10000 + bankaddr]);
221
222   if (data & 0xfe) logerror("%04x: write %02x to f004\n",activecpu_get_pc(),data);
223219}
224220
225221static WRITE8_HANDLER( cps1_oki_pin7_w )
226222{
227   logerror("%04x: write %02x to f006 (Oki Pin 7)\n",activecpu_get_pc(),data);
228223   OKIM6295_set_pin7(0, (data & 1));
229224}
230225
r2454r2455
242237
243238WRITE16_HANDLER( cps1_coinctrl_w )
244239{
245//  popmessage("coinctrl %04x",data);
246
247240   if (ACCESSING_BITS_8_15)
248241   {
249242      coin_counter_w(0,data & 0x0100);
r2454r2455
253246
254247      // bit 15 = CPS-A custom reset?
255248   }
256
257   // there's no trace of this in the Forgotten Worlds schematics
258   if (ACCESSING_BITS_0_7)
259   {
260      /* mercs sets bit 0 */
261      set_led_status(0,data & 0x02);
262      set_led_status(1,data & 0x04);
263      set_led_status(2,data & 0x08);
264   }
265249}
266250
267251static WRITE16_HANDLER( cpsq_coinctrl2_w )
r2454r2455
278262INTERRUPT_GEN( cps1_interrupt )
279263{
280264   /* Strider also has a IRQ4 handler. It is input port related, but the game */
281   /* works without it (maybe it's used to multiplex controls). It is the */
282   /* *only* game to have that. */
265   /* works without it. It is the *only* CPS1 game to have that. */
283266   cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
284267}
285268
r2454r2455
432415
433416
434417
418/*
419PAL PRG1 (16P8B @ 12H):
420
421I0 = AS
422I1 = /BGACKB
423I2 = A23
424I3 = A22
425I4 = A21
426I5 = A20
427I6 = A19
428I7 = A18
429I8 = A17
430I9 = A16
431
432n.c.      = pin19 =   ( !I0 &  I1 )
433n.c.      = pin18 =   ( !I0 &  I1 )
434n.c.      = pin17 = ! (  I0 &  I1 & (!I2 | !I3 | !I4 | !I5 | !I6 | !I7) )
435n.c.      = pin16 = ! (  I2 &  I3 &  I4 &  I5 &  I6 &  I7 )
436/IOCS     = pin15 = ! (  I0 &  I1 &  I2 & !I3 & !I4 & !I5 )
437/ONE WAIT = pin14 = ! (  I0 &  I1 & ((!I2 & !I3) | ( I2 & !I3) | ( I2 &  I3)) )
438/databus  = pin13 = ! (  I0 &  I1 & (!I2 | !I3 | !I4 | !I5 | !I6 | !I7) )
439/workram  = pin12 = ! (  I0 &  I1 &  I2 &  I3 &  I4 &  I5 &  I6 &  I7 )
440
441
442PAL IOA1 (16P8B @ 12F):
443
444I0 = /IOCS
445I1 = /RDB
446I2 = /UDSWR
447I3 = /LDSWR
448I4 = AB8
449I5 = AB7
450I6 = AB6
451I7 = AB5
452I8 = AB4
453I9 = AB3
454
455player input      = pin19 = ! ( !I0 & !I1 & !I4 & !I5 & !I6 & !I7 & !I8 & !I9 )
456system input/dips = pin18 = ! ( !I0 & !I1 & !I4 & !I5 & !I6 & !I7 &  I8 &  I9 )
457outputs           = pin17 = ! ( !I0 & !I2 & !I4 & !I5 & !I6 &  I7 &  I8 & !I9 )
458sound 1B          = pin16 = ! ( !I0 & !I3 &  I4 &  I5 & !I6 & !I7 & !I8 &  I9 )
459sound 0B          = pin15 = ! ( !I0 & !I3 &  I4 &  I5 & !I6 & !I7 & !I8 & !I9 )
460n.c.              = pin14 =   ( !I1 & !I2 )
461/PPU1             = pin13 = ! ( !I0 &  I4 & !I5 & !I6 )
462n.c.              = pin12 =   ( !I1 & !I2 )
463
464
465PAL BUF1 (16P8B @ 16H):
466
467I0 = A23 (all address lines can come both from 68000 and CPS-A custom)
468I1 = A22
469I2 = A21
470I3 = A20
471I4 = A19
472I5 = A18
473I6 = A17
474I7 = A16
475I8 = ASB
476
477BUF0 = pin19 = ! ( I0 & !I1 & !I2 &  I3 & !I4 & !I5 & !I6 & !I7 )
478BUF1 = pin18 = ! ( I0 & !I1 & !I2 &  I3 & !I4 & !I5 & !I6 &  I7 )
479BUF2 = pin17 = ! ( I0 & !I1 & !I2 &  I3 & !I4 & !I5 &  I6 & !I7 )
480BUF3 = pin16 = ! ( I0 & !I1 & !I2 &  I3 & !I4 & !I5 &  I6 &  I7 )
481BUF4 = pin15 = ! ( I0 & !I1 & !I2 &  I3 & !I4 &  I5 & !I6 & !I7 )
482BUF5 = pin14 = ! ( I0 & !I1 & !I2 &  I3 & !I4 &  I5 & !I6 &  I7 )
483BUF6 = pin13 = ! ( I0 & !I1 & !I2 &  I3 & !I4 &  I5 &  I6 & !I7 )
484/RDB = pin12 =   ( I0 & !I1 & !I2 &  I3 & !I8 )
485
486BUF0-BUF2 are gfxram on A-board. BUF3-BUF6 go to B-board (provision for expansion, never used)
487
488
489PAL ROM1 (16P8B @ 15H):
490
491I0 = A23 (all address lines can come both from 68000 and CPS-A custom)
492I1 = A22
493I2 = A21
494I3 = A20
495I4 = A19
496I5 = A18
497I6 = A17
498I7 = A16
499I8 = ASB
500
501PRG0 = pin17 = ! ( !I8 & !I0 & !I1 & !I2 & !I3 & !I4 & !I5 )
502PRG1 = pin16 = ! ( !I8 & !I0 & !I1 & !I2 & !I3 & !I4 &  I5 )
503PRG2 = pin15 = ! ( !I8 & !I0 & !I1 & !I2 & !I3 &  I4 & !I5 )
504PRG3 = pin14 = ! ( !I8 & !I0 & !I1 & !I2 & !I3 &  I4 &  I5 )
505PRG4 = pin19 = ! ( !I8 & !I0 & !I1 & !I2 &  I3 & !I4 )
506PRG5 = pin18 = ! ( !I8 & !I0 & !I1 & !I2 &  I3 &  I4 )
507PRG6 = pin13 = ! ( !I8 & !I0 & !I1 &  I2 & !I3 & !I4 )
508/RDB = pin12 =   ( !I8 & !I0 & !I1 )
509
510All PRGx go to B-board. Provision for up to 4MB of ROM space, which was never used in full.
511
512*/
513
435514static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
436   AM_RANGE(0x000000, 0x1fffff) AM_ROM
437   AM_RANGE(0x800000, 0x800001) AM_READ(cps1_in1_r)            /* Player input ports */
438   AM_RANGE(0x800010, 0x800011) AM_READ(cps1_in1_r)            /* mirror? */
439   AM_RANGE(0x800018, 0x80001f) AM_READ(cps1_input_r)          /* System input ports / Dip Switches */
440   AM_RANGE(0x800020, 0x800021) AM_READNOP                     /* ? Used by Rockman ? */
441   AM_RANGE(0x800030, 0x800031) AM_WRITE(cps1_coinctrl_w)
442   AM_RANGE(0x800040, 0x800041) AM_WRITE(forgottn_dial_0_reset_w)
443   AM_RANGE(0x800048, 0x800049) AM_WRITE(forgottn_dial_1_reset_w)
444   AM_RANGE(0x800052, 0x800055) AM_READ(forgottn_dial_0_r)     /* Forgotten Worlds */
445   AM_RANGE(0x80005a, 0x80005d) AM_READ(forgottn_dial_1_r)     /* Forgotten Worlds */
446   AM_RANGE(0x800176, 0x800177) AM_READ(cps1_in2_r)            /* Extra input ports (on C-board) */
447   AM_RANGE(0x800178, 0x800179) AM_READ(cps1_in3_r)            /* Player 4 controls (on C-board) ("Captain Commando") */
515   AM_RANGE(0x000000, 0x3fffff) AM_ROM
516   AM_RANGE(0x800000, 0x800007) AM_READ(cps1_in1_r)            /* Player input ports */
517   /* forgottn, willow, cawing, nemo, varth read from 800010. Probably debug input leftover from development */
518   AM_RANGE(0x800018, 0x80001f) AM_READ(cps1_dsw_r)            /* System input ports / Dip Switches */
519   AM_RANGE(0x800020, 0x800021) AM_READNOP                     /* ? Used by Rockman ? not mapped according to PAL */
520   AM_RANGE(0x800030, 0x800037) AM_WRITE(cps1_coinctrl_w)
521   /* Forgotten Worlds has dial controls on B-board mapped at 800040-80005f. See DRIVER_INIT */
522   AM_RANGE(0x800100, 0x80013f) AM_WRITE(cps1_cps_a_w) AM_BASE(&cps1_cps_a_regs)   /* CPS-A custom */
523   AM_RANGE(0x800140, 0x80017f) AM_READWRITE(cps1_cps_b_r, cps1_cps_b_w) AM_BASE(&cps1_cps_b_regs)   /* CPS-B custom */
448524   AM_RANGE(0x800180, 0x800187) AM_WRITE(cps1_soundlatch_w)    /* Sound command */
449525   AM_RANGE(0x800188, 0x80018f) AM_WRITE(cps1_soundlatch2_w)   /* Sound timer fade */
450   AM_RANGE(0x8001fc, 0x8001fd) AM_READ(cps1_in2_r)            /* Extra input ports ("SF Rev E") */
451   AM_RANGE(0x800100, 0x8001ff) AM_READWRITE(cps1_output_r, cps1_output_w) AM_BASE(&cps1_output) AM_SIZE(&cps1_output_size)  /* CPS-B custom */
526   AM_RANGE(0x8001c0, 0x8001ff) AM_READWRITE(cps1_cps_b_r, cps1_cps_b_w)   /* mirror (SF2 revision "E" US 910228) */
452527   AM_RANGE(0x900000, 0x92ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_BASE(&cps1_gfxram) AM_SIZE(&cps1_gfxram_size)   /* SF2CE executes code from here */
453528   AM_RANGE(0xff0000, 0xffffff) AM_RAM
454529ADDRESS_MAP_END
455530
531/*
532PAL SOU1 (16P8 @ 13E):
533
534I0 = /MREQ
535I1 = A15
536I2 = A14
537I3 = A13
538I4 = A12
539I5 = bank latch
540I6 = /RD
541I7 = /WR
542I8 = /BANK
543
544bank latch = pin19 = ! ( !I0 & !I7 & !I8 )
545/SWR       = pin18 = ! ( !I0 & !I7 )
546/SRD       = pin17 = ! ( !I0 & !I6 )
547ls138      = pin16 = ! ( !I0 &  I1 &  I2 &  I3 &  I4 )
548workram    = pin15 = ! ( !I0 &  I1 &  I2 & !I3 &  I4 )
549SOUNDA14   = pin14 = ! ( !I0 & ((!I1 & !I2) | ( I1 & !I2 & !I5)) )
550SOUNDA15   = pin13 =   (  I1 )
551/SOUNDCE   = pin12 = ! ( !I0 & (!I1 | ( I1 & !I2)) )
552*/
553
456554static ADDRESS_MAP_START( sub_map, ADDRESS_SPACE_PROGRAM, 8 )
457555   AM_RANGE(0x0000, 0x7fff) AM_ROM
458556   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1)
r2454r2455
469567
470568static ADDRESS_MAP_START( qsound_main_map, ADDRESS_SPACE_PROGRAM, 16 )
471569   AM_RANGE(0x000000, 0x1fffff) AM_ROM
472   AM_RANGE(0x800000, 0x800001) AM_READ(cps1_in1_r)            /* Player input ports */
473   AM_RANGE(0x800010, 0x800011) AM_READ(cps1_in1_r)            /* mirror? */
474   AM_RANGE(0x800018, 0x80001f) AM_READ(cps1_input_r)          /* System input ports / Dip Switches */
475   AM_RANGE(0x800030, 0x800031) AM_WRITE(cps1_coinctrl_w)
476   AM_RANGE(0x800100, 0x8001ff) AM_READWRITE(cps1_output_r, cps1_output_w) AM_BASE(&cps1_output) AM_SIZE(&cps1_output_size)  /* CPS-B custom */
570   AM_RANGE(0x800000, 0x800007) AM_READ(cps1_in1_r)            /* Player input ports */
571   AM_RANGE(0x800018, 0x80001f) AM_READ(cps1_dsw_r)            /* System input ports / Dip Switches */
572   AM_RANGE(0x800030, 0x800037) AM_WRITE(cps1_coinctrl_w)
573   AM_RANGE(0x800100, 0x80013f) AM_WRITE(cps1_cps_a_w) AM_BASE(&cps1_cps_a_regs)   /* CPS-A custom */
574   AM_RANGE(0x800140, 0x80017f) AM_READWRITE(cps1_cps_b_r, cps1_cps_b_w) AM_BASE(&cps1_cps_b_regs)   /* CPS-B custom */
477575   AM_RANGE(0x900000, 0x92ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_BASE(&cps1_gfxram) AM_SIZE(&cps1_gfxram_size)   /* SF2CE executes code from here */
478576   AM_RANGE(0xf00000, 0xf0ffff) AM_READ(qsound_rom_r)      /* Slammasters protection */
479577   AM_RANGE(0xf18000, 0xf19fff) AM_READWRITE(qsound_sharedram1_r, qsound_sharedram1_w)  /* Q RAM */
r2454r2455
35173615
35183616***************************************************************************/
35193617
3520#define CODE_SIZE 0x200000
3618#define CODE_SIZE 0x400000
35213619
35223620ROM_START( forgottn )
35233621   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )
r2454r2455
35253623   ROM_LOAD16_BYTE( "lwu15a",        0x00001, 0x20000, CRC(f7ce2097) SHA1(44c06fabdb6de7d8afc2164458c90b0be9cf945d) )
35263624   ROM_LOAD16_BYTE( "lwu10a",        0x40000, 0x20000, CRC(8cb38c81) SHA1(1d36cab7d17ff778ee7dfcd9606a3a87f6906f21) )
35273625   ROM_LOAD16_BYTE( "lwu14a",        0x40001, 0x20000, CRC(d70ef9fd) SHA1(b393aa2a7bea440fdcf057ffc6ff233fc0d35d4b) )
3528   ROM_LOAD16_WORD_SWAP( "lw-07",         0x80000, 0x80000, CRC(fd252a26) SHA1(5cfb097984912a5167a8c7ec4c2e119b642f9970) )
3626   ROM_LOAD16_WORD_SWAP( "lw-07",    0x80000, 0x80000, CRC(fd252a26) SHA1(5cfb097984912a5167a8c7ec4c2e119b642f9970) )
35293627
35303628   ROM_REGION( 0x400000, REGION_GFX1, 0 )
35313629   ROMX_LOAD( "lw-01",         0x000000, 0x80000, CRC(0318f298) SHA1(178ffd6da7bf845e30abf1bfc38a469cd319a73f) , ROM_GROUPWORD | ROM_SKIP(6) )
r2454r2455
35643662   ROM_LOAD16_BYTE( "lw-15c.14g",    0x00001, 0x20000, CRC(402e2a46) SHA1(cbb7017e75a425706505717bf83c2615f53309f9) )
35653663   ROM_LOAD16_BYTE( "lw-10c.13f",    0x40000, 0x20000, CRC(c46479d7) SHA1(84fd9ef33ae7d0af2110e8dc299de25c0f039cee) )
35663664   ROM_LOAD16_BYTE( "lw-14c.13g",    0x40001, 0x20000, CRC(97670f4a) SHA1(f249977c814abdff85007216d7fa57db5684be0f) )
3567   ROM_LOAD16_WORD_SWAP( "lw-07",         0x80000, 0x80000, CRC(fd252a26) SHA1(5cfb097984912a5167a8c7ec4c2e119b642f9970) )
3665   ROM_LOAD16_WORD_SWAP( "lw-07",    0x80000, 0x80000, CRC(fd252a26) SHA1(5cfb097984912a5167a8c7ec4c2e119b642f9970) )
35683666
35693667   ROM_REGION( 0x400000, REGION_GFX1, 0 )
35703668   ROMX_LOAD( "lw-01",         0x000000, 0x80000, CRC(0318f298) SHA1(178ffd6da7bf845e30abf1bfc38a469cd319a73f) , ROM_GROUPWORD | ROM_SKIP(6) )
r2454r2455
37043802
37053803ROM_START( strider )
37063804   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
3707   ROM_LOAD16_BYTE( "strider.30",   0x00000, 0x20000, CRC(da997474) SHA1(3e4ac98f9a6967d61899281b31c7de779723397b) )
3708   ROM_LOAD16_BYTE( "strider.35",   0x00001, 0x20000, CRC(5463aaa3) SHA1(e2d07ec2d818e9a2e2d7a77ff0309ae4011c0083) )
3709   ROM_LOAD16_BYTE( "strider.31",   0x40000, 0x20000, CRC(d20786db) SHA1(c9c75488e6bb37cfd0d56073faf87ff5713bc9a0) )
3710   ROM_LOAD16_BYTE( "strider.36",   0x40001, 0x20000, CRC(21aa2863) SHA1(446dc9280630318deb423531210a4eedfb4adfa6) )
3805   ROM_LOAD16_BYTE( "strider.30",        0x00000, 0x20000, CRC(da997474) SHA1(3e4ac98f9a6967d61899281b31c7de779723397b) )
3806   ROM_LOAD16_BYTE( "strider.35",        0x00001, 0x20000, CRC(5463aaa3) SHA1(e2d07ec2d818e9a2e2d7a77ff0309ae4011c0083) )
3807   ROM_LOAD16_BYTE( "strider.31",        0x40000, 0x20000, CRC(d20786db) SHA1(c9c75488e6bb37cfd0d56073faf87ff5713bc9a0) )
3808   ROM_LOAD16_BYTE( "strider.36",        0x40001, 0x20000, CRC(21aa2863) SHA1(446dc9280630318deb423531210a4eedfb4adfa6) )
37113809   ROM_LOAD16_WORD_SWAP( "strider.32",   0x80000, 0x80000, CRC(9b3cfc08) SHA1(a7d7f270a097437affa845d80bed82a1fa874878) )
37123810
37133811   ROM_REGION( 0x400000, REGION_GFX1, 0 )
r2454r2455
37343832
37353833ROM_START( stridrua )
37363834   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
3737   ROM_LOAD16_BYTE( "strid.30",     0x00000, 0x20000, CRC(66aec273) SHA1(576b1e9062874e68d68f8725949c151509eb6d56) )
3738   ROM_LOAD16_BYTE( "strid.35",     0x00001, 0x20000, CRC(50e0e865) SHA1(201ef385c228c124ed9412002233a501ea514efd) )
3739   ROM_LOAD16_BYTE( "strid.31",     0x40000, 0x20000, CRC(eae93bd1) SHA1(b320a00b67ea3c7fffc6c37d57863163975f7b80) )
3740   ROM_LOAD16_BYTE( "strid.36",     0x40001, 0x20000, CRC(b904a31d) SHA1(5509d1024151eb8548fd1b29e6c0c95775c61364) )
3835   ROM_LOAD16_BYTE( "strid.30",          0x00000, 0x20000, CRC(66aec273) SHA1(576b1e9062874e68d68f8725949c151509eb6d56) )
3836   ROM_LOAD16_BYTE( "strid.35",          0x00001, 0x20000, CRC(50e0e865) SHA1(201ef385c228c124ed9412002233a501ea514efd) )
3837   ROM_LOAD16_BYTE( "strid.31",          0x40000, 0x20000, CRC(eae93bd1) SHA1(b320a00b67ea3c7fffc6c37d57863163975f7b80) )
3838   ROM_LOAD16_BYTE( "strid.36",          0x40001, 0x20000, CRC(b904a31d) SHA1(5509d1024151eb8548fd1b29e6c0c95775c61364) )
37413839   ROM_LOAD16_WORD_SWAP( "strider.32",   0x80000, 0x80000, CRC(9b3cfc08) SHA1(a7d7f270a097437affa845d80bed82a1fa874878) )
37423840
37433841   ROM_REGION( 0x400000, REGION_GFX1, 0 )
r2454r2455
38413939   ROM_COPY( REGION_GFX1, 0x000000, 0x000000, 0x8000 ) /* stars */
38423940
38433941   ROM_REGION( 0x18000, REGION_CPU2, 0 ) /* 64k for the audio CPU (+banks) */
3844   ROM_LOAD( "tke17.12b",        0x00000, 0x08000, CRC(b3b79d4f) SHA1(2b960545741d3b9a53ffbf3ed83030392aa02698) )
3942   ROM_LOAD( "tke17.12b",     0x00000, 0x08000, CRC(b3b79d4f) SHA1(2b960545741d3b9a53ffbf3ed83030392aa02698) )
38453943   ROM_CONTINUE(              0x10000, 0x08000 )
38463944
38473945   ROM_REGION( 0x40000, REGION_SOUND1, 0 ) /* Samples */
3946   ROM_LOAD( "tke18.11c",  0x00000, 0x20000, CRC(ac6e307d) SHA1(b490ce625bb7ce0904b0fd121fbfbd5252790f7a) )
38483947   ROM_LOAD( "tke19.12c",  0x20000, 0x20000, CRC(068741db) SHA1(ab48aff639a7ac218b7d5304145e10e92d61fd9f) )
3849   ROM_LOAD( "tke18.11c",  0x00000, 0x20000, CRC(ac6e307d) SHA1(b490ce625bb7ce0904b0fd121fbfbd5252790f7a) )
38503948ROM_END
38513949
38523950/* the content of the smaller roms in this set is 99% identical, just japanese program roms
r2454r2455
39104008
39114009ROM_START( willow )
39124010   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
3913   ROM_LOAD16_BYTE( "wlu_30.rom",   0x00000, 0x20000, CRC(d604dbb1) SHA1(b5d78871011ff11a67f1a0cad147cd4de8d67f35) )
3914   ROM_LOAD16_BYTE( "willow-u.35",  0x00001, 0x20000, CRC(7a791e77) SHA1(fe1429588b7eceab1d369abe03f2cad8de727f71) )
3915   ROM_LOAD16_BYTE( "wlu_31.rom",   0x40000, 0x20000, CRC(0eb48a83) SHA1(28c40c4b5d767f88922cd899e948abf11a85a864) )
3916   ROM_LOAD16_BYTE( "wlu_36.rom",   0x40001, 0x20000, CRC(36100209) SHA1(63c9338e71dba8b52daffba50b4bca31aaa10d9e) )
4011   ROM_LOAD16_BYTE( "wlu_30.rom",        0x00000, 0x20000, CRC(d604dbb1) SHA1(b5d78871011ff11a67f1a0cad147cd4de8d67f35) )
4012   ROM_LOAD16_BYTE( "willow-u.35",       0x00001, 0x20000, CRC(7a791e77) SHA1(fe1429588b7eceab1d369abe03f2cad8de727f71) )
4013   ROM_LOAD16_BYTE( "wlu_31.rom",        0x40000, 0x20000, CRC(0eb48a83) SHA1(28c40c4b5d767f88922cd899e948abf11a85a864) )
4014   ROM_LOAD16_BYTE( "wlu_36.rom",        0x40001, 0x20000, CRC(36100209) SHA1(63c9338e71dba8b52daffba50b4bca31aaa10d9e) )
39174015   ROM_LOAD16_WORD_SWAP( "wl_32.rom",    0x80000, 0x80000, CRC(dfd9f643) SHA1(9c760c30af593a87e7fd39fb213a4c73c68ca440) )
39184016
39194017   ROM_REGION( 0x400000, REGION_GFX1, 0 )
r2454r2455
39444042
39454043ROM_START( willowj )
39464044   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
3947   ROM_LOAD16_BYTE( "wl36.bin",     0x00000, 0x20000, CRC(2b0d7cbc) SHA1(58172b4fdf856efa8d77abbde76738de2424f712) )
3948   ROM_LOAD16_BYTE( "wl42.bin",     0x00001, 0x20000, CRC(1ac39615) SHA1(c9fa6d20418b9bdc5a08df1fb86368b40709280a) )
3949   ROM_LOAD16_BYTE( "wl37.bin",     0x40000, 0x20000, CRC(30a717fa) SHA1(cb815e9ee2691761925898e3932b502f8f399cb4) )
3950   ROM_LOAD16_BYTE( "wl43.bin",     0x40001, 0x20000, CRC(d0dddc9e) SHA1(1176b9a43b3355a5ba44e59abde01ee7eaa89c25) )
4045   ROM_LOAD16_BYTE( "wl36.bin",          0x00000, 0x20000, CRC(2b0d7cbc) SHA1(58172b4fdf856efa8d77abbde76738de2424f712) )
4046   ROM_LOAD16_BYTE( "wl42.bin",          0x00001, 0x20000, CRC(1ac39615) SHA1(c9fa6d20418b9bdc5a08df1fb86368b40709280a) )
4047   ROM_LOAD16_BYTE( "wl37.bin",          0x40000, 0x20000, CRC(30a717fa) SHA1(cb815e9ee2691761925898e3932b502f8f399cb4) )
4048   ROM_LOAD16_BYTE( "wl43.bin",          0x40001, 0x20000, CRC(d0dddc9e) SHA1(1176b9a43b3355a5ba44e59abde01ee7eaa89c25) )
39514049   ROM_LOAD16_WORD_SWAP( "wl_32.rom",    0x80000, 0x80000, CRC(dfd9f643) SHA1(9c760c30af593a87e7fd39fb213a4c73c68ca440) )
39524050
39534051   ROM_REGION( 0x400000, REGION_GFX1, 0 )
r2454r2455
39784076
39794077ROM_START( willowje )
39804078   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
3981   ROM_LOAD16_BYTE( "wlu_30.rom",   0x00000, 0x20000, CRC(d604dbb1) SHA1(b5d78871011ff11a67f1a0cad147cd4de8d67f35) )
3982   ROM_LOAD16_BYTE( "wlu_35.rom",   0x00001, 0x20000, CRC(daee72fe) SHA1(2ec62f44394fac2887821881f56b6f24d05234b3) )
3983   ROM_LOAD16_BYTE( "wlu_31.rom",   0x40000, 0x20000, CRC(0eb48a83) SHA1(28c40c4b5d767f88922cd899e948abf11a85a864) )
3984   ROM_LOAD16_BYTE( "wlu_36.rom",   0x40001, 0x20000, CRC(36100209) SHA1(63c9338e71dba8b52daffba50b4bca31aaa10d9e) )
4079   ROM_LOAD16_BYTE( "wlu_30.rom",        0x00000, 0x20000, CRC(d604dbb1) SHA1(b5d78871011ff11a67f1a0cad147cd4de8d67f35) )
4080   ROM_LOAD16_BYTE( "wlu_35.rom",        0x00001, 0x20000, CRC(daee72fe) SHA1(2ec62f44394fac2887821881f56b6f24d05234b3) )
4081   ROM_LOAD16_BYTE( "wlu_31.rom",        0x40000, 0x20000, CRC(0eb48a83) SHA1(28c40c4b5d767f88922cd899e948abf11a85a864) )
4082   ROM_LOAD16_BYTE( "wlu_36.rom",        0x40001, 0x20000, CRC(36100209) SHA1(63c9338e71dba8b52daffba50b4bca31aaa10d9e) )
39854083   ROM_LOAD16_WORD_SWAP( "wl_32.rom",    0x80000, 0x80000, CRC(dfd9f643) SHA1(9c760c30af593a87e7fd39fb213a4c73c68ca440) )
39864084
39874085   ROM_REGION( 0x400000, REGION_GFX1, 0 )
r2454r2455
40124110
40134111ROM_START( unsquad )
40144112   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4015   ROM_LOAD16_BYTE( "unsquad.30",   0x00000, 0x20000, CRC(24d8f88d) SHA1(9c39aa1140e92307d6d9c0ca198003282bf78c78) )
4016   ROM_LOAD16_BYTE( "unsquad.35",   0x00001, 0x20000, CRC(8b954b59) SHA1(33114f1417d48f60c6da3e14a094be7c0f0fd979) )
4017   ROM_LOAD16_BYTE( "unsquad.31",   0x40000, 0x20000, CRC(33e9694b) SHA1(90db3052ac2ff859ede8473dd13e0f5be148590c) )
4018   ROM_LOAD16_BYTE( "unsquad.36",   0x40001, 0x20000, CRC(7cc8fb9e) SHA1(f70118d1a368fd4795d9953c55d283305d1f9630) )
4113   ROM_LOAD16_BYTE( "unsquad.30",        0x00000, 0x20000, CRC(24d8f88d) SHA1(9c39aa1140e92307d6d9c0ca198003282bf78c78) )
4114   ROM_LOAD16_BYTE( "unsquad.35",        0x00001, 0x20000, CRC(8b954b59) SHA1(33114f1417d48f60c6da3e14a094be7c0f0fd979) )
4115   ROM_LOAD16_BYTE( "unsquad.31",        0x40000, 0x20000, CRC(33e9694b) SHA1(90db3052ac2ff859ede8473dd13e0f5be148590c) )
4116   ROM_LOAD16_BYTE( "unsquad.36",        0x40001, 0x20000, CRC(7cc8fb9e) SHA1(f70118d1a368fd4795d9953c55d283305d1f9630) )
40194117   ROM_LOAD16_WORD_SWAP( "unsquad.32",   0x80000, 0x80000, CRC(ae1d7fb0) SHA1(bb51e77574db5e2d807c4ca8e85a5d9661f5d3b3) )
40204118
40214119   ROM_REGION( 0x200000, REGION_GFX1, 0 )
r2454r2455
40314129   ROM_LOAD( "unsquad.09",    0x00000, 0x08000, CRC(f3dd1367) SHA1(09eef72e862ac6b1a5cce5a45938b45bf4e456ad) )
40324130   ROM_CONTINUE(              0x10000, 0x08000 )
40334131
4034   ROM_REGION( 0x20000, REGION_SOUND1, 0 )   /* Samples */
4132   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
40354133   ROM_LOAD( "unsquad.18",   0x00000, 0x20000, CRC(584b43a9) SHA1(7820815c8c67d484baf2fdad7e55d8c14b98b860) )
4134   /* 20000-3ffff empty */
40364135ROM_END
40374136
40384137ROM_START( area88 )
40394138   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4040   ROM_LOAD16_BYTE( "ar36.bin",     0x00000, 0x20000, CRC(65030392) SHA1(d9dea5cfde28345716b0e519ee033c475be0454b) )
4041   ROM_LOAD16_BYTE( "ar42.bin",     0x00001, 0x20000, CRC(c48170de) SHA1(e968522dbdd217dd8e4cd6aaeaef801c63488c1d) )
4042   ROM_LOAD16_BYTE( "unsquad.31",   0x40000, 0x20000, CRC(33e9694b) SHA1(90db3052ac2ff859ede8473dd13e0f5be148590c) )
4043   ROM_LOAD16_BYTE( "unsquad.36",   0x40001, 0x20000, CRC(7cc8fb9e) SHA1(f70118d1a368fd4795d9953c55d283305d1f9630) )
4139   ROM_LOAD16_BYTE( "ar36.bin",          0x00000, 0x20000, CRC(65030392) SHA1(d9dea5cfde28345716b0e519ee033c475be0454b) )
4140   ROM_LOAD16_BYTE( "ar42.bin",          0x00001, 0x20000, CRC(c48170de) SHA1(e968522dbdd217dd8e4cd6aaeaef801c63488c1d) )
4141   ROM_LOAD16_BYTE( "unsquad.31",        0x40000, 0x20000, CRC(33e9694b) SHA1(90db3052ac2ff859ede8473dd13e0f5be148590c) )
4142   ROM_LOAD16_BYTE( "unsquad.36",        0x40001, 0x20000, CRC(7cc8fb9e) SHA1(f70118d1a368fd4795d9953c55d283305d1f9630) )
40444143   ROM_LOAD16_WORD_SWAP( "unsquad.32",   0x80000, 0x80000, CRC(ae1d7fb0) SHA1(bb51e77574db5e2d807c4ca8e85a5d9661f5d3b3) )
40454144
40464145   ROM_REGION( 0x200000, REGION_GFX1, 0 )
r2454r2455
40564155   ROM_LOAD( "unsquad.09",    0x00000, 0x08000, CRC(f3dd1367) SHA1(09eef72e862ac6b1a5cce5a45938b45bf4e456ad) )
40574156   ROM_CONTINUE(              0x10000, 0x08000 )
40584157
4059   ROM_REGION( 0x20000, REGION_SOUND1, 0 )   /* Samples */
4158   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
40604159   ROM_LOAD( "unsquad.18",   0x00000, 0x20000, CRC(584b43a9) SHA1(7820815c8c67d484baf2fdad7e55d8c14b98b860) )
4160   /* 20000-3ffff empty */
40614161ROM_END
40624162
40634163ROM_START( ffight )
40644164   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4065   ROM_LOAD16_BYTE( "ff30-36.bin",  0x00000, 0x20000, CRC(f9a5ce83) SHA1(0756ae576a1f6d5b8b22f8630dca40ef38567ea6) )
4066   ROM_LOAD16_BYTE( "ff35-42.bin",  0x00001, 0x20000, CRC(65f11215) SHA1(5045a467f3e228c02b4a355b52f58263ffa90113) )
4067   ROM_LOAD16_BYTE( "ff31-37.bin",  0x40000, 0x20000, CRC(e1033784) SHA1(38f44434c8befd623953ae23d6e5ff4e201d6627) )
4068   ROM_LOAD16_BYTE( "ff36-43.bin",  0x40001, 0x20000, CRC(995e968a) SHA1(de16873d1639ac1738be0937270b108a9914f263) )
4165   ROM_LOAD16_BYTE( "ff30-36.bin",       0x00000, 0x20000, CRC(f9a5ce83) SHA1(0756ae576a1f6d5b8b22f8630dca40ef38567ea6) )
4166   ROM_LOAD16_BYTE( "ff35-42.bin",       0x00001, 0x20000, CRC(65f11215) SHA1(5045a467f3e228c02b4a355b52f58263ffa90113) )
4167   ROM_LOAD16_BYTE( "ff31-37.bin",       0x40000, 0x20000, CRC(e1033784) SHA1(38f44434c8befd623953ae23d6e5ff4e201d6627) )
4168   ROM_LOAD16_BYTE( "ff36-43.bin",       0x40001, 0x20000, CRC(995e968a) SHA1(de16873d1639ac1738be0937270b108a9914f263) )
40694169   ROM_LOAD16_WORD_SWAP( "ff32-32m.bin", 0x80000, 0x80000, CRC(c747696e) SHA1(d3362dadded31ccb7eaf71ef282d698d18edd722) )
40704170
40714171   ROM_REGION( 0x200000, REGION_GFX1, 0 )
r2454r2455
40884188
40894189ROM_START( ffightu )
40904190   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4091   ROM_LOAD16_BYTE( "ff30-36.bin",  0x00000, 0x20000, CRC(f9a5ce83) SHA1(0756ae576a1f6d5b8b22f8630dca40ef38567ea6) )
4092   ROM_LOAD16_BYTE( "ff35-42.bin",  0x00001, 0x20000, CRC(65f11215) SHA1(5045a467f3e228c02b4a355b52f58263ffa90113) )
4093   ROM_LOAD16_BYTE( "ff31-37.bin",  0x40000, 0x20000, CRC(e1033784) SHA1(38f44434c8befd623953ae23d6e5ff4e201d6627) )
4094   ROM_LOAD16_BYTE( "ff43.rom",  0x40001, 0x20000, CRC(4ca65947) SHA1(74ffe00df96273770a24d9a46f13e53ea8812670) )
4191   ROM_LOAD16_BYTE( "ff30-36.bin",       0x00000, 0x20000, CRC(f9a5ce83) SHA1(0756ae576a1f6d5b8b22f8630dca40ef38567ea6) )
4192   ROM_LOAD16_BYTE( "ff35-42.bin",       0x00001, 0x20000, CRC(65f11215) SHA1(5045a467f3e228c02b4a355b52f58263ffa90113) )
4193   ROM_LOAD16_BYTE( "ff31-37.bin",       0x40000, 0x20000, CRC(e1033784) SHA1(38f44434c8befd623953ae23d6e5ff4e201d6627) )
4194   ROM_LOAD16_BYTE( "ff43.rom",          0x40001, 0x20000, CRC(4ca65947) SHA1(74ffe00df96273770a24d9a46f13e53ea8812670) )
40954195   ROM_LOAD16_WORD_SWAP( "ff32-32m.bin", 0x80000, 0x80000, CRC(c747696e) SHA1(d3362dadded31ccb7eaf71ef282d698d18edd722) )
40964196
40974197   ROM_REGION( 0x200000, REGION_GFX1, 0 )
r2454r2455
41144214
41154215ROM_START( ffightua )
41164216   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4117   ROM_LOAD16_BYTE( "36",           0x00000, 0x20000, CRC(e2a48af9) SHA1(11e06f95bdf575af396dded2b84d858f6c7388f1) )
4118   ROM_LOAD16_BYTE( "42",           0x00001, 0x20000, CRC(f4bb480e) SHA1(32114df1d2f4f98a4a2280a330c7b6af8ab4d862) )
4119   ROM_LOAD16_BYTE( "37",           0x40000, 0x20000, CRC(c371c667) SHA1(633977c91a8ff09b7fe83128eced7c4dee9aee1d) )
4120   ROM_LOAD16_BYTE( "43",           0x40001, 0x20000, CRC(2f5771f9) SHA1(fb532402bc00b5619a23dfa7e4525f1717020303) )
4217   ROM_LOAD16_BYTE( "36",                0x00000, 0x20000, CRC(e2a48af9) SHA1(11e06f95bdf575af396dded2b84d858f6c7388f1) )
4218   ROM_LOAD16_BYTE( "42",                0x00001, 0x20000, CRC(f4bb480e) SHA1(32114df1d2f4f98a4a2280a330c7b6af8ab4d862) )
4219   ROM_LOAD16_BYTE( "37",                0x40000, 0x20000, CRC(c371c667) SHA1(633977c91a8ff09b7fe83128eced7c4dee9aee1d) )
4220   ROM_LOAD16_BYTE( "43",                0x40001, 0x20000, CRC(2f5771f9) SHA1(fb532402bc00b5619a23dfa7e4525f1717020303) )
41214221   ROM_LOAD16_WORD_SWAP( "ff32-32m.bin", 0x80000, 0x80000, CRC(c747696e) SHA1(d3362dadded31ccb7eaf71ef282d698d18edd722) )
41224222
41234223   /* Note: the gfx ROMs were missing from this set. I used the ones from */
r2454r2455
41434243
41444244ROM_START( ffightub )
41454245   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4146   ROM_LOAD16_BYTE( "30_2da0.010",  0x00000, 0x20000, CRC(ed988977) SHA1(c718e989206bd2b68832c8fcb5667397d500ebac) )
4147   ROM_LOAD16_BYTE( "35_46ff.010",  0x00001, 0x20000, CRC(07bf1c21) SHA1(f21a939fd92607c7f54816dedbcb3c5818cf4183) )
4148   ROM_LOAD16_BYTE( "31_c933.010",  0x40000, 0x20000, CRC(dba5a476) SHA1(2f0176dd050f9630b914f1c1ca5d96215bcf567f) )
4149   ROM_LOAD16_BYTE( "36_0ace.010",  0x40001, 0x20000, CRC(4d89f542) SHA1(0b7d483a2c5759715f99f287cbd8a36165b59de7) )
4246   ROM_LOAD16_BYTE( "30_2da0.010",       0x00000, 0x20000, CRC(ed988977) SHA1(c718e989206bd2b68832c8fcb5667397d500ebac) )
4247   ROM_LOAD16_BYTE( "35_46ff.010",       0x00001, 0x20000, CRC(07bf1c21) SHA1(f21a939fd92607c7f54816dedbcb3c5818cf4183) )
4248   ROM_LOAD16_BYTE( "31_c933.010",       0x40000, 0x20000, CRC(dba5a476) SHA1(2f0176dd050f9630b914f1c1ca5d96215bcf567f) )
4249   ROM_LOAD16_BYTE( "36_0ace.010",       0x40001, 0x20000, CRC(4d89f542) SHA1(0b7d483a2c5759715f99f287cbd8a36165b59de7) )
41504250   ROM_LOAD16_WORD_SWAP( "ff32-32m.bin", 0x80000, 0x80000, CRC(c747696e) SHA1(d3362dadded31ccb7eaf71ef282d698d18edd722) )
41514251
41524252   ROM_REGION( 0x200000, REGION_GFX1, 0 )
r2454r2455
41834283
41844284ROM_START( ffightj )
41854285   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4186   ROM_LOAD16_BYTE( "ff30-36.bin",  0x00000, 0x20000, CRC(f9a5ce83) SHA1(0756ae576a1f6d5b8b22f8630dca40ef38567ea6) )
4187   ROM_LOAD16_BYTE( "ff35-42.bin",  0x00001, 0x20000, CRC(65f11215) SHA1(5045a467f3e228c02b4a355b52f58263ffa90113) )
4188   ROM_LOAD16_BYTE( "ff31-37.bin",  0x40000, 0x20000, CRC(e1033784) SHA1(38f44434c8befd623953ae23d6e5ff4e201d6627) )
4189   ROM_LOAD16_BYTE( "ff43.bin",     0x40001, 0x20000, CRC(b6dee1c3) SHA1(3a85312a2e9d8e06259b73d91ccb5e66a6bad62d) )
4286   ROM_LOAD16_BYTE( "ff30-36.bin",       0x00000, 0x20000, CRC(f9a5ce83) SHA1(0756ae576a1f6d5b8b22f8630dca40ef38567ea6) )
4287   ROM_LOAD16_BYTE( "ff35-42.bin",       0x00001, 0x20000, CRC(65f11215) SHA1(5045a467f3e228c02b4a355b52f58263ffa90113) )
4288   ROM_LOAD16_BYTE( "ff31-37.bin",       0x40000, 0x20000, CRC(e1033784) SHA1(38f44434c8befd623953ae23d6e5ff4e201d6627) )
4289   ROM_LOAD16_BYTE( "ff43.bin",          0x40001, 0x20000, CRC(b6dee1c3) SHA1(3a85312a2e9d8e06259b73d91ccb5e66a6bad62d) )
41904290   ROM_LOAD16_WORD_SWAP( "ff32-32m.bin", 0x80000, 0x80000, CRC(c747696e) SHA1(d3362dadded31ccb7eaf71ef282d698d18edd722) )
41914291
41924292   ROM_REGION( 0x200000, REGION_GFX1, 0 )
r2454r2455
42214321
42224322ROM_START( ffightj1 )
42234323   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4224   ROM_LOAD16_BYTE( "ff30-36.rom",  0x00000, 0x20000, CRC(088ed1c9) SHA1(7b96cd45f4d3d2c0fe94904882652814b7790869) )
4225   ROM_LOAD16_BYTE( "ff35-42.rom",  0x00001, 0x20000, CRC(c4c491e6) SHA1(d0e34d7b94f67c33615710ea721da8fefe832e3a) )
4226   ROM_LOAD16_BYTE( "ff31-37.rom",  0x40000, 0x20000, CRC(708557ff) SHA1(89e56bfd9486623a18fdbf984a72bb52054ca0e6) )
4227   ROM_LOAD16_BYTE( "ff36-43.rom",  0x40001, 0x20000, CRC(c004004a) SHA1(10ccf27972591f65645a8dd2bb65989176ac07d5) )
4324   ROM_LOAD16_BYTE( "ff30-36.rom",       0x00000, 0x20000, CRC(088ed1c9) SHA1(7b96cd45f4d3d2c0fe94904882652814b7790869) )
4325   ROM_LOAD16_BYTE( "ff35-42.rom",       0x00001, 0x20000, CRC(c4c491e6) SHA1(d0e34d7b94f67c33615710ea721da8fefe832e3a) )
4326   ROM_LOAD16_BYTE( "ff31-37.rom",       0x40000, 0x20000, CRC(708557ff) SHA1(89e56bfd9486623a18fdbf984a72bb52054ca0e6) )
4327   ROM_LOAD16_BYTE( "ff36-43.rom",       0x40001, 0x20000, CRC(c004004a) SHA1(10ccf27972591f65645a8dd2bb65989176ac07d5) )
42284328   ROM_LOAD16_WORD_SWAP( "ff32-32m.bin", 0x80000, 0x80000, CRC(c747696e) SHA1(d3362dadded31ccb7eaf71ef282d698d18edd722) )
42294329
42304330   ROM_REGION( 0x200000, REGION_GFX1, 0 )
r2454r2455
42594359
42604360ROM_START( 1941 )
42614361   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4262   ROM_LOAD16_BYTE( "41e_30.rom",   0x00000, 0x20000, CRC(9deb1e75) SHA1(68d9f91bef6a5c9e1bcbf286629aed6b37b4acb9) )
4263   ROM_LOAD16_BYTE( "41e_35.rom",   0x00001, 0x20000, CRC(d63942b3) SHA1(b4bc7d06dcefbc075d316f2d31abbd4c7a99dbae) )
4264   ROM_LOAD16_BYTE( "41e_31.rom",   0x40000, 0x20000, CRC(df201112) SHA1(d84f63bffeb9255cbabc02f23d7511f9b3c6a96c) )
4265   ROM_LOAD16_BYTE( "41e_36.rom",   0x40001, 0x20000, CRC(816a818f) SHA1(3e491a30352b71ddd775142f3a80cdde480b669f) )
4362   ROM_LOAD16_BYTE( "41e_30.rom",        0x00000, 0x20000, CRC(9deb1e75) SHA1(68d9f91bef6a5c9e1bcbf286629aed6b37b4acb9) )
4363   ROM_LOAD16_BYTE( "41e_35.rom",        0x00001, 0x20000, CRC(d63942b3) SHA1(b4bc7d06dcefbc075d316f2d31abbd4c7a99dbae) )
4364   ROM_LOAD16_BYTE( "41e_31.rom",        0x40000, 0x20000, CRC(df201112) SHA1(d84f63bffeb9255cbabc02f23d7511f9b3c6a96c) )
4365   ROM_LOAD16_BYTE( "41e_36.rom",        0x40001, 0x20000, CRC(816a818f) SHA1(3e491a30352b71ddd775142f3a80cdde480b669f) )
42664366   ROM_LOAD16_WORD_SWAP( "41_32.rom",    0x80000, 0x80000, CRC(4e9648ca) SHA1(d8e67e6e3a6dc79053e4f56cfd83431385ea7611) )
42674367
42684368   ROM_REGION( 0x200000, REGION_GFX1, 0 )
r2454r2455
42854385
42864386ROM_START( 1941j )
42874387   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4288   ROM_LOAD16_BYTE( "4136.bin",     0x00000, 0x20000, CRC(7fbd42ab) SHA1(4e52a599e3099bf3cccabb89152c69f216fde79e) )
4289   ROM_LOAD16_BYTE( "4142.bin",     0x00001, 0x20000, CRC(c7781f89) SHA1(7e99c433de0c903791ae153a3cc8632042b0a90d) )
4290   ROM_LOAD16_BYTE( "4137.bin",     0x40000, 0x20000, CRC(c6464b0b) SHA1(abef422d891d32334a858d49599f1ef7cf0db45d) )
4291   ROM_LOAD16_BYTE( "4143.bin",     0x40001, 0x20000, CRC(440fc0b5) SHA1(e725535533c25a2c80a45a2200bbfd0dcda5ed97) )
4388   ROM_LOAD16_BYTE( "4136.bin",          0x00000, 0x20000, CRC(7fbd42ab) SHA1(4e52a599e3099bf3cccabb89152c69f216fde79e) )
4389   ROM_LOAD16_BYTE( "4142.bin",          0x00001, 0x20000, CRC(c7781f89) SHA1(7e99c433de0c903791ae153a3cc8632042b0a90d) )
4390   ROM_LOAD16_BYTE( "4137.bin",          0x40000, 0x20000, CRC(c6464b0b) SHA1(abef422d891d32334a858d49599f1ef7cf0db45d) )
4391   ROM_LOAD16_BYTE( "4143.bin",          0x40001, 0x20000, CRC(440fc0b5) SHA1(e725535533c25a2c80a45a2200bbfd0dcda5ed97) )
42924392   ROM_LOAD16_WORD_SWAP( "41_32.rom",    0x80000, 0x80000, CRC(4e9648ca) SHA1(d8e67e6e3a6dc79053e4f56cfd83431385ea7611) )
42934393
42944394   ROM_REGION( 0x200000, REGION_GFX1, 0 )
r2454r2455
43114411
43124412ROM_START( mercs )
43134413   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4314   ROM_LOAD16_BYTE( "so2_30e.rom",  0x00000, 0x20000, CRC(e17f9bf7) SHA1(f44bb378de428b429c97a21f74829182d3187ace) )
4315   ROM_LOAD16_BYTE( "so2_35e.rom",  0x00001, 0x20000, CRC(78e63575) SHA1(5776de0daaaedd0dec2cec8d088a0fd8bb3d4dbe) )
4316   ROM_LOAD16_BYTE( "so2_31e.rom",  0x40000, 0x20000, CRC(51204d36) SHA1(af288fc369d092f38ea73be967705aacade06f28) )
4317   ROM_LOAD16_BYTE( "so2_36e.rom",  0x40001, 0x20000, CRC(9cfba8b4) SHA1(df8ee5e3a68f056f68f096c46fdb548f63d29446) )
4414   ROM_LOAD16_BYTE( "so2_30e.rom",       0x00000, 0x20000, CRC(e17f9bf7) SHA1(f44bb378de428b429c97a21f74829182d3187ace) )
4415   ROM_LOAD16_BYTE( "so2_35e.rom",       0x00001, 0x20000, CRC(78e63575) SHA1(5776de0daaaedd0dec2cec8d088a0fd8bb3d4dbe) )
4416   ROM_LOAD16_BYTE( "so2_31e.rom",       0x40000, 0x20000, CRC(51204d36) SHA1(af288fc369d092f38ea73be967705aacade06f28) )
4417   ROM_LOAD16_BYTE( "so2_36e.rom",       0x40001, 0x20000, CRC(9cfba8b4) SHA1(df8ee5e3a68f056f68f096c46fdb548f63d29446) )
43184418   ROM_LOAD16_WORD_SWAP( "so2_32.rom",   0x80000, 0x80000, CRC(2eb5cf0c) SHA1(e0d765fb6957d156ffd40cabf51ba6098cbbeb19) )
43194419
43204420   ROM_REGION( 0x400000, REGION_GFX1, 0 )
r2454r2455
43454445
43464446ROM_START( mercsu )
43474447   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4348   ROM_LOAD16_BYTE( "so2_30e.rom",  0x00000, 0x20000, CRC(e17f9bf7) SHA1(f44bb378de428b429c97a21f74829182d3187ace) )
4349   ROM_LOAD16_BYTE( "s02-35",       0x00001, 0x20000, CRC(4477df61) SHA1(e9b42357c7073c098e8fde7e7d0e4a6e3062fd0d) )
4350   ROM_LOAD16_BYTE( "so2_31e.rom",  0x40000, 0x20000, CRC(51204d36) SHA1(af288fc369d092f38ea73be967705aacade06f28) )
4351   ROM_LOAD16_BYTE( "so2_36e.rom",  0x40001, 0x20000, CRC(9cfba8b4) SHA1(df8ee5e3a68f056f68f096c46fdb548f63d29446) )
4448   ROM_LOAD16_BYTE( "so2_30e.rom",       0x00000, 0x20000, CRC(e17f9bf7) SHA1(f44bb378de428b429c97a21f74829182d3187ace) )
4449   ROM_LOAD16_BYTE( "s02-35",            0x00001, 0x20000, CRC(4477df61) SHA1(e9b42357c7073c098e8fde7e7d0e4a6e3062fd0d) )
4450   ROM_LOAD16_BYTE( "so2_31e.rom",       0x40000, 0x20000, CRC(51204d36) SHA1(af288fc369d092f38ea73be967705aacade06f28) )
4451   ROM_LOAD16_BYTE( "so2_36e.rom",       0x40001, 0x20000, CRC(9cfba8b4) SHA1(df8ee5e3a68f056f68f096c46fdb548f63d29446) )
43524452   ROM_LOAD16_WORD_SWAP( "so2_32.rom",   0x80000, 0x80000, CRC(2eb5cf0c) SHA1(e0d765fb6957d156ffd40cabf51ba6098cbbeb19) )
43534453
43544454   ROM_REGION( 0x400000, REGION_GFX1, 0 )
r2454r2455
43794479
43804480ROM_START( mercsua )
43814481   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4382   ROM_LOAD16_BYTE( "so2.30a",       0x00000, 0x20000, CRC(e4e725d7) SHA1(b0454dedeb741a7dd4ceb18bac958417ca74a7e6) )
4383   ROM_LOAD16_BYTE( "so2.35a",      0x00001, 0x20000, CRC(e7843445) SHA1(192c85ced637e05b37ed889246ebb73e792e984b) )
4384   ROM_LOAD16_BYTE( "so2.31a",       0x40000, 0x20000, CRC(c0b91dea) SHA1(5c1d086ae09e4f66384a03994b3c5e12d80582ff) )
4385   ROM_LOAD16_BYTE( "so2.36a",      0x40001, 0x20000, CRC(591edf6c) SHA1(68d77e21fe32e0b95d2fabe40bc1cadd419ab0bd) )
4482   ROM_LOAD16_BYTE( "so2.30a",           0x00000, 0x20000, CRC(e4e725d7) SHA1(b0454dedeb741a7dd4ceb18bac958417ca74a7e6) )
4483   ROM_LOAD16_BYTE( "so2.35a",           0x00001, 0x20000, CRC(e7843445) SHA1(192c85ced637e05b37ed889246ebb73e792e984b) )
4484   ROM_LOAD16_BYTE( "so2.31a",           0x40000, 0x20000, CRC(c0b91dea) SHA1(5c1d086ae09e4f66384a03994b3c5e12d80582ff) )
4485   ROM_LOAD16_BYTE( "so2.36a",           0x40001, 0x20000, CRC(591edf6c) SHA1(68d77e21fe32e0b95d2fabe40bc1cadd419ab0bd) )
43864486   ROM_LOAD16_WORD_SWAP( "so2_32.rom",   0x80000, 0x80000, CRC(2eb5cf0c) SHA1(e0d765fb6957d156ffd40cabf51ba6098cbbeb19) )
43874487
43884488   ROM_REGION( 0x400000, REGION_GFX1, 0 )
r2454r2455
44134513
44144514ROM_START( mercsj )
44154515   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4416   ROM_LOAD16_BYTE( "so2_30e.rom",  0x00000, 0x20000, CRC(e17f9bf7) SHA1(f44bb378de428b429c97a21f74829182d3187ace) )
4417   ROM_LOAD16_BYTE( "so2_42.bin",   0x00001, 0x20000, CRC(2c3884c6) SHA1(98c3e93741d2344fe0a699aacdc5038bdd9007a0) )
4418   ROM_LOAD16_BYTE( "so2_31e.rom",  0x40000, 0x20000, CRC(51204d36) SHA1(af288fc369d092f38ea73be967705aacade06f28) )
4419   ROM_LOAD16_BYTE( "so2_36e.rom",  0x40001, 0x20000, CRC(9cfba8b4) SHA1(df8ee5e3a68f056f68f096c46fdb548f63d29446) )
4516   ROM_LOAD16_BYTE( "so2_30e.rom",       0x00000, 0x20000, CRC(e17f9bf7) SHA1(f44bb378de428b429c97a21f74829182d3187ace) )
4517   ROM_LOAD16_BYTE( "so2_42.bin",        0x00001, 0x20000, CRC(2c3884c6) SHA1(98c3e93741d2344fe0a699aacdc5038bdd9007a0) )
4518   ROM_LOAD16_BYTE( "so2_31e.rom",       0x40000, 0x20000, CRC(51204d36) SHA1(af288fc369d092f38ea73be967705aacade06f28) )
4519   ROM_LOAD16_BYTE( "so2_36e.rom",       0x40001, 0x20000, CRC(9cfba8b4) SHA1(df8ee5e3a68f056f68f096c46fdb548f63d29446) )
44204520   ROM_LOAD16_WORD_SWAP( "so2_32.rom",   0x80000, 0x80000, CRC(2eb5cf0c) SHA1(e0d765fb6957d156ffd40cabf51ba6098cbbeb19) )
44214521
44224522   ROM_REGION( 0x400000, REGION_GFX1, 0 )
r2454r2455
44474547
44484548ROM_START( mtwins )
44494549   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4450   ROM_LOAD16_BYTE( "che_30.rom",   0x00000, 0x20000, CRC(9a2a2db1) SHA1(57524e76311afc8ab5d5affa76c85cb1be5a1faf) )
4451   ROM_LOAD16_BYTE( "che_35.rom",   0x00001, 0x20000, CRC(a7f96b02) SHA1(b5fda02e5069f9e1cdafbacf98334510e9af8fcd) )
4452   ROM_LOAD16_BYTE( "che_31.rom",   0x40000, 0x20000, CRC(bbff8a99) SHA1(1f931fad9f43a1494f3b8dbcf910156d5b0bd458) )
4453   ROM_LOAD16_BYTE( "che_36.rom",   0x40001, 0x20000, CRC(0fa00c39) SHA1(6404d91590c5c521c8fe944a0aa7091e35b664ae) )
4550   ROM_LOAD16_BYTE( "che_30.rom",        0x00000, 0x20000, CRC(9a2a2db1) SHA1(57524e76311afc8ab5d5affa76c85cb1be5a1faf) )
4551   ROM_LOAD16_BYTE( "che_35.rom",        0x00001, 0x20000, CRC(a7f96b02) SHA1(b5fda02e5069f9e1cdafbacf98334510e9af8fcd) )
4552   ROM_LOAD16_BYTE( "che_31.rom",        0x40000, 0x20000, CRC(bbff8a99) SHA1(1f931fad9f43a1494f3b8dbcf910156d5b0bd458) )
4553   ROM_LOAD16_BYTE( "che_36.rom",        0x40001, 0x20000, CRC(0fa00c39) SHA1(6404d91590c5c521c8fe944a0aa7091e35b664ae) )
44544554   ROM_LOAD16_WORD_SWAP( "ch_32.rom",    0x80000, 0x80000, CRC(9b70bd41) SHA1(28ec37d9d0ace5b9fd212fdc02e0f13dc280c068) )
44554555
44564556   ROM_REGION( 0x200000, REGION_GFX1, 0 )
r2454r2455
44734573
44744574ROM_START( chikij )
44754575   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4476   ROM_LOAD16_BYTE( "chj36a.bin",   0x00000, 0x20000, CRC(ec1328d8) SHA1(a7111f9c264c56d1c6474ec3ad90e394a32a86f6) )
4477   ROM_LOAD16_BYTE( "chj42a.bin",   0x00001, 0x20000, CRC(4ae13503) SHA1(c47db0445e107ad4fb62b74e277a7dc2b4d9b7ea) )
4478   ROM_LOAD16_BYTE( "chj37a.bin",   0x40000, 0x20000, CRC(46d2cf7b) SHA1(5cb7ed3003d89a08882d4dcd326c8fd9430f0eac) )
4479   ROM_LOAD16_BYTE( "chj43a.bin",   0x40001, 0x20000, CRC(8d387fe8) SHA1(7832ecd487b5ef4e49b5ea78e80e52f8e2dcaa17) )
4576   ROM_LOAD16_BYTE( "chj36a.bin",        0x00000, 0x20000, CRC(ec1328d8) SHA1(a7111f9c264c56d1c6474ec3ad90e394a32a86f6) )
4577   ROM_LOAD16_BYTE( "chj42a.bin",        0x00001, 0x20000, CRC(4ae13503) SHA1(c47db0445e107ad4fb62b74e277a7dc2b4d9b7ea) )
4578   ROM_LOAD16_BYTE( "chj37a.bin",        0x40000, 0x20000, CRC(46d2cf7b) SHA1(5cb7ed3003d89a08882d4dcd326c8fd9430f0eac) )
4579   ROM_LOAD16_BYTE( "chj43a.bin",        0x40001, 0x20000, CRC(8d387fe8) SHA1(7832ecd487b5ef4e49b5ea78e80e52f8e2dcaa17) )
44804580   ROM_LOAD16_WORD_SWAP( "ch_32.rom",    0x80000, 0x80000, CRC(9b70bd41) SHA1(28ec37d9d0ace5b9fd212fdc02e0f13dc280c068) )
44814581
44824582   ROM_REGION( 0x200000, REGION_GFX1, 0 )
r2454r2455
44994599
45004600ROM_START( msword )
45014601   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4502   ROM_LOAD16_BYTE( "mse_30.rom",   0x00000, 0x20000, CRC(03fc8dbc) SHA1(a9e4e8a06e2d170faeae75a8b17fd65e6e5fecd4) )
4503   ROM_LOAD16_BYTE( "mse_35.rom",   0x00001, 0x20000, CRC(d5bf66cd) SHA1(37c5bc4deafd7037ec5cf09c88bb89f35ea3d95c) )
4504   ROM_LOAD16_BYTE( "mse_31.rom",   0x40000, 0x20000, CRC(30332bcf) SHA1(1c77c06028b77473276cb5dde5ecf414b43a7b78) )
4505   ROM_LOAD16_BYTE( "mse_36.rom",   0x40001, 0x20000, CRC(8f7d6ce9) SHA1(7694c940023c12520663593f973ddb4168a6bfa5) )
4602   ROM_LOAD16_BYTE( "mse_30.rom",        0x00000, 0x20000, CRC(03fc8dbc) SHA1(a9e4e8a06e2d170faeae75a8b17fd65e6e5fecd4) )
4603   ROM_LOAD16_BYTE( "mse_35.rom",        0x00001, 0x20000, CRC(d5bf66cd) SHA1(37c5bc4deafd7037ec5cf09c88bb89f35ea3d95c) )
4604   ROM_LOAD16_BYTE( "mse_31.rom",        0x40000, 0x20000, CRC(30332bcf) SHA1(1c77c06028b77473276cb5dde5ecf414b43a7b78) )
4605   ROM_LOAD16_BYTE( "mse_36.rom",        0x40001, 0x20000, CRC(8f7d6ce9) SHA1(7694c940023c12520663593f973ddb4168a6bfa5) )
45064606   ROM_LOAD16_WORD_SWAP( "ms_32.rom",    0x80000, 0x80000, CRC(2475ddfc) SHA1(cc34dfae8124aa781320be6870a1929495eee456) )
45074607
45084608   ROM_REGION( 0x200000, REGION_GFX1, 0 )
r2454r2455
45254625
45264626ROM_START( mswordr1 )
45274627   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4528   ROM_LOAD16_BYTE( "ms30.11f",   0x00000, 0x20000, CRC(21c1f078) SHA1(f32bd3b462cc84466244b362a66510b9d40ac2fd) )
4529   ROM_LOAD16_BYTE( "ms35.11h",   0x00001, 0x20000, CRC(a540a73a) SHA1(1c91241ba0d17d13adaa68e231b95dfd49d93b6d) )
4530   ROM_LOAD16_BYTE( "ms31.12f",   0x40000, 0x20000, CRC(d7e762b5) SHA1(6977130e9c0cd36d8a67e242c132df38f7aea5b7) )
4531   ROM_LOAD16_BYTE( "ms36.12h",   0x40001, 0x20000, CRC(66f2dcdb) SHA1(287508b1c96762d0048a10272cf2cbd39a7fba5c) )
4628   ROM_LOAD16_BYTE( "ms30.11f",          0x00000, 0x20000, CRC(21c1f078) SHA1(f32bd3b462cc84466244b362a66510b9d40ac2fd) )
4629   ROM_LOAD16_BYTE( "ms35.11h",          0x00001, 0x20000, CRC(a540a73a) SHA1(1c91241ba0d17d13adaa68e231b95dfd49d93b6d) )
4630   ROM_LOAD16_BYTE( "ms31.12f",          0x40000, 0x20000, CRC(d7e762b5) SHA1(6977130e9c0cd36d8a67e242c132df38f7aea5b7) )
4631   ROM_LOAD16_BYTE( "ms36.12h",          0x40001, 0x20000, CRC(66f2dcdb) SHA1(287508b1c96762d0048a10272cf2cbd39a7fba5c) )
45324632   ROM_LOAD16_WORD_SWAP( "ms_32.rom",    0x80000, 0x80000, CRC(2475ddfc) SHA1(cc34dfae8124aa781320be6870a1929495eee456) )
45334633
45344634   ROM_REGION( 0x200000, REGION_GFX1, 0 )
r2454r2455
45514651
45524652ROM_START( mswordu )
45534653   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4554   ROM_LOAD16_BYTE( "msu30",   0x00000, 0x20000, CRC(d963c816) SHA1(e23844a60ddfc0a8a98c0ada9c3d58fce71c5484) )
4555   ROM_LOAD16_BYTE( "msu35",   0x00001, 0x20000, CRC(72f179b3) SHA1(8d31cdc84b02fc345fc78e8f231410adeb834c28) )
4556   ROM_LOAD16_BYTE( "msu31",   0x40000, 0x20000, CRC(20cd7904) SHA1(cea2db01be97f69dc10e9da80f3b46f6ddaa953a) )
4557   ROM_LOAD16_BYTE( "msu36",   0x40001, 0x20000, CRC(bf88c080) SHA1(b8cd0b127fd3e1afc45402e667ff4b4b01602384) )
4654   ROM_LOAD16_BYTE( "msu30",             0x00000, 0x20000, CRC(d963c816) SHA1(e23844a60ddfc0a8a98c0ada9c3d58fce71c5484) )
4655   ROM_LOAD16_BYTE( "msu35",             0x00001, 0x20000, CRC(72f179b3) SHA1(8d31cdc84b02fc345fc78e8f231410adeb834c28) )
4656   ROM_LOAD16_BYTE( "msu31",             0x40000, 0x20000, CRC(20cd7904) SHA1(cea2db01be97f69dc10e9da80f3b46f6ddaa953a) )
4657   ROM_LOAD16_BYTE( "msu36",             0x40001, 0x20000, CRC(bf88c080) SHA1(b8cd0b127fd3e1afc45402e667ff4b4b01602384) )
45584658   ROM_LOAD16_WORD_SWAP( "ms_32.rom",    0x80000, 0x80000, CRC(2475ddfc) SHA1(cc34dfae8124aa781320be6870a1929495eee456) )
45594659
45604660   ROM_REGION( 0x200000, REGION_GFX1, 0 )
r2454r2455
45774677
45784678ROM_START( mswordj )
45794679   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4580   ROM_LOAD16_BYTE( "msj_36.bin",   0x00000, 0x20000, CRC(04f0ef50) SHA1(76dac695732ade1873bb6da51834ef90c6595689) )
4581   ROM_LOAD16_BYTE( "msj_42.bin",   0x00001, 0x20000, CRC(9fcbb9cd) SHA1(bfbf805ddecd3fa9e209a658526e1430ad9e459a) )
4582   ROM_LOAD16_BYTE( "msj_37.bin",   0x40000, 0x20000, CRC(6c060d70) SHA1(7fe56f125bc11156955bf0defc956fe7c18a1c72) )
4583   ROM_LOAD16_BYTE( "msj_43.bin",   0x40001, 0x20000, CRC(aec77787) SHA1(3260f9a80b67394dd90dbabdd544c9b8b31e5817) )
4680   ROM_LOAD16_BYTE( "msj_36.bin",        0x00000, 0x20000, CRC(04f0ef50) SHA1(76dac695732ade1873bb6da51834ef90c6595689) )
4681   ROM_LOAD16_BYTE( "msj_42.bin",        0x00001, 0x20000, CRC(9fcbb9cd) SHA1(bfbf805ddecd3fa9e209a658526e1430ad9e459a) )
4682   ROM_LOAD16_BYTE( "msj_37.bin",        0x40000, 0x20000, CRC(6c060d70) SHA1(7fe56f125bc11156955bf0defc956fe7c18a1c72) )
4683   ROM_LOAD16_BYTE( "msj_43.bin",        0x40001, 0x20000, CRC(aec77787) SHA1(3260f9a80b67394dd90dbabdd544c9b8b31e5817) )
45844684   ROM_LOAD16_WORD_SWAP( "ms_32.rom",    0x80000, 0x80000, CRC(2475ddfc) SHA1(cc34dfae8124aa781320be6870a1929495eee456) )
45854685
45864686   ROM_REGION( 0x200000, REGION_GFX1, 0 )
r2454r2455
46034703
46044704ROM_START( cawing )
46054705   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4606   ROM_LOAD16_BYTE( "cae_30a.rom",  0x00000, 0x20000, CRC(91fceacd) SHA1(4845999a96fee829264346ca399fdd64a8408001) )
4607   ROM_LOAD16_BYTE( "cae_35a.rom",  0x00001, 0x20000, CRC(3ef03083) SHA1(297dfc9ec1e0f07d6083bf5efaa0de8d0fb361fa) )
4608   ROM_LOAD16_BYTE( "cae_31a.rom",  0x40000, 0x20000, CRC(e5b75caf) SHA1(4d04220c78620867b7598deea5685bbe88298ae6) )
4609   ROM_LOAD16_BYTE( "cae_36a.rom",  0x40001, 0x20000, CRC(c73fd713) SHA1(fa202c252b2cc5972d42d634c466d89cf8b5d178) )
4706   ROM_LOAD16_BYTE( "cae_30a.rom",    0x00000, 0x20000, CRC(91fceacd) SHA1(4845999a96fee829264346ca399fdd64a8408001) )
4707   ROM_LOAD16_BYTE( "cae_35a.rom",    0x00001, 0x20000, CRC(3ef03083) SHA1(297dfc9ec1e0f07d6083bf5efaa0de8d0fb361fa) )
4708   ROM_LOAD16_BYTE( "cae_31a.rom",    0x40000, 0x20000, CRC(e5b75caf) SHA1(4d04220c78620867b7598deea5685bbe88298ae6) )
4709   ROM_LOAD16_BYTE( "cae_36a.rom",    0x40001, 0x20000, CRC(c73fd713) SHA1(fa202c252b2cc5972d42d634c466d89cf8b5d178) )
46104710   ROM_LOAD16_WORD_SWAP( "ca_32.rom", 0x80000, 0x80000, CRC(0c4837d4) SHA1(1c61958b43066b59d86eb4bae0b52c3109be4b07) )
46114711
46124712   ROM_REGION( 0x200000, REGION_GFX1, 0 )
r2454r2455
46294729
46304730ROM_START( cawingr1 )
46314731   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4632   ROM_LOAD16_BYTE( "cae_30.11f",  0x00000, 0x20000, CRC(23305cd5) SHA1(59cbcb79c171b433f278e128c73cdd3635876370) )
4633   ROM_LOAD16_BYTE( "cae_35.11h",  0x00001, 0x20000, CRC(69419113) SHA1(cfbb6dbbe224ffaf7747fd70b65a7dbd4f696fe9) )
4634   ROM_LOAD16_BYTE( "cae_31.12f",  0x40000, 0x20000, CRC(9008dfb3) SHA1(81fdd21606caabe9e0df773fc33377c958ab80f6) )
4635   ROM_LOAD16_BYTE( "cae_36.12h",  0x40001, 0x20000, CRC(4dbf6f8e) SHA1(a2da49dce72c2366381bd8bea8ce4eba0b70d78c) )
4732   ROM_LOAD16_BYTE( "cae_30.11f",     0x00000, 0x20000, CRC(23305cd5) SHA1(59cbcb79c171b433f278e128c73cdd3635876370) )
4733   ROM_LOAD16_BYTE( "cae_35.11h",     0x00001, 0x20000, CRC(69419113) SHA1(cfbb6dbbe224ffaf7747fd70b65a7dbd4f696fe9) )
4734   ROM_LOAD16_BYTE( "cae_31.12f",     0x40000, 0x20000, CRC(9008dfb3) SHA1(81fdd21606caabe9e0df773fc33377c958ab80f6) )
4735   ROM_LOAD16_BYTE( "cae_36.12h",     0x40001, 0x20000, CRC(4dbf6f8e) SHA1(a2da49dce72c2366381bd8bea8ce4eba0b70d78c) )
46364736   ROM_LOAD16_WORD_SWAP( "ca_32.rom", 0x80000, 0x80000, CRC(0c4837d4) SHA1(1c61958b43066b59d86eb4bae0b52c3109be4b07) )
46374737
46384738   ROM_REGION( 0x200000, REGION_GFX1, 0 )
r2454r2455
46554755
46564756ROM_START( cawingu )
46574757   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4658   ROM_LOAD16_BYTE( "cae_30a.rom",  0x00000, 0x20000, CRC(91fceacd) SHA1(4845999a96fee829264346ca399fdd64a8408001) )
4659   ROM_LOAD16_BYTE( "cau_35a.rom",  0x00001, 0x20000, CRC(f090d9b2) SHA1(261dc4ac79507299a7f9a1ad5edb8425345db06c) )
4660   ROM_LOAD16_BYTE( "cae_31a.rom",  0x40000, 0x20000, CRC(e5b75caf) SHA1(4d04220c78620867b7598deea5685bbe88298ae6) )
4661   ROM_LOAD16_BYTE( "cae_36a.rom",  0x40001, 0x20000, CRC(c73fd713) SHA1(fa202c252b2cc5972d42d634c466d89cf8b5d178) )
4758   ROM_LOAD16_BYTE( "cae_30a.rom",    0x00000, 0x20000, CRC(91fceacd) SHA1(4845999a96fee829264346ca399fdd64a8408001) )
4759   ROM_LOAD16_BYTE( "cau_35a.rom",    0x00001, 0x20000, CRC(f090d9b2) SHA1(261dc4ac79507299a7f9a1ad5edb8425345db06c) )
4760   ROM_LOAD16_BYTE( "cae_31a.rom",    0x40000, 0x20000, CRC(e5b75caf) SHA1(4d04220c78620867b7598deea5685bbe88298ae6) )
4761   ROM_LOAD16_BYTE( "cae_36a.rom",    0x40001, 0x20000, CRC(c73fd713) SHA1(fa202c252b2cc5972d42d634c466d89cf8b5d178) )
46624762   ROM_LOAD16_WORD_SWAP( "ca_32.rom", 0x80000, 0x80000, CRC(0c4837d4) SHA1(1c61958b43066b59d86eb4bae0b52c3109be4b07) )
46634763
46644764   ROM_REGION( 0x200000, REGION_GFX1, 0 )
r2454r2455
47224822
47234823ROM_START( nemo )
47244824   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4725   ROM_LOAD16_BYTE( "nme_30a.rom",  0x00000, 0x20000, CRC(d2c03e56) SHA1(df468e3b5deba01a6825b742f1cc87bfb26c1981) )
4726   ROM_LOAD16_BYTE( "nme_35a.rom",  0x00001, 0x20000, CRC(5fd31661) SHA1(12f92a7255e8cae6975452db956670cf72d51768) )
4727   ROM_LOAD16_BYTE( "nme_31a.rom",  0x40000, 0x20000, CRC(b2bd4f6f) SHA1(82a59b5f36cb4c23dca05297e2a643842fc12609) )
4728   ROM_LOAD16_BYTE( "nme_36a.rom",  0x40001, 0x20000, CRC(ee9450e3) SHA1(a5454268ef58533e71fe07167b4c3fd263363f77) )
4825   ROM_LOAD16_BYTE( "nme_30a.rom",       0x00000, 0x20000, CRC(d2c03e56) SHA1(df468e3b5deba01a6825b742f1cc87bfb26c1981) )
4826   ROM_LOAD16_BYTE( "nme_35a.rom",       0x00001, 0x20000, CRC(5fd31661) SHA1(12f92a7255e8cae6975452db956670cf72d51768) )
4827   ROM_LOAD16_BYTE( "nme_31a.rom",       0x40000, 0x20000, CRC(b2bd4f6f) SHA1(82a59b5f36cb4c23dca05297e2a643842fc12609) )
4828   ROM_LOAD16_BYTE( "nme_36a.rom",       0x40001, 0x20000, CRC(ee9450e3) SHA1(a5454268ef58533e71fe07167b4c3fd263363f77) )
47294829   ROM_LOAD16_WORD_SWAP( "nm_32.rom",    0x80000, 0x80000, CRC(d6d1add3) SHA1(61c3013d322dbb7622cca032adcd020ba318e885) )
47304830
47314831   ROM_REGION( 0x200000, REGION_GFX1, 0 )
r2454r2455
47484848
47494849ROM_START( nemoj )
47504850   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4751   ROM_LOAD16_BYTE( "nm36.bin",     0x00000, 0x20000, CRC(daeceabb) SHA1(ebd44922be9d07a3d3411af52edee8a60cb11dad) )
4752   ROM_LOAD16_BYTE( "nm42.bin",     0x00001, 0x20000, CRC(55024740) SHA1(4bacbd191bb435de5dc548ac7fa16ed286bd2d3b) )
4753   ROM_LOAD16_BYTE( "nm37.bin",     0x40000, 0x20000, CRC(619068b6) SHA1(2507c6f77a06a80f913c848dcb6816bcbf4bba8a) )
4754   ROM_LOAD16_BYTE( "nm43.bin",     0x40001, 0x20000, CRC(a948a53b) SHA1(65c2abf321cf8b171bbfbb51ed57bc99eb552ca9) )
4851   ROM_LOAD16_BYTE( "nm36.bin",          0x00000, 0x20000, CRC(daeceabb) SHA1(ebd44922be9d07a3d3411af52edee8a60cb11dad) )
4852   ROM_LOAD16_BYTE( "nm42.bin",          0x00001, 0x20000, CRC(55024740) SHA1(4bacbd191bb435de5dc548ac7fa16ed286bd2d3b) )
4853   ROM_LOAD16_BYTE( "nm37.bin",          0x40000, 0x20000, CRC(619068b6) SHA1(2507c6f77a06a80f913c848dcb6816bcbf4bba8a) )
4854   ROM_LOAD16_BYTE( "nm43.bin",          0x40001, 0x20000, CRC(a948a53b) SHA1(65c2abf321cf8b171bbfbb51ed57bc99eb552ca9) )
47554855   ROM_LOAD16_WORD_SWAP( "nm_32.rom",    0x80000, 0x80000, CRC(d6d1add3) SHA1(61c3013d322dbb7622cca032adcd020ba318e885) )
47564856
47574857   ROM_REGION( 0x200000, REGION_GFX1, 0 )
r2454r2455
48054905   ROM_CONTINUE(              0x10000, 0x08000 )
48064906
48074907   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
4808   ROM_LOAD( "sf2_18.bin",       0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
4809   ROM_LOAD( "sf2_19.bin",       0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
4908   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
4909   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
48104910ROM_END
48114911
48124912ROM_START( sf2eb )
r2454r2455
48424942   ROM_CONTINUE(              0x10000, 0x08000 )
48434943
48444944   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
4845   ROM_LOAD( "sf2_18.bin",       0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
4846   ROM_LOAD( "sf2_19.bin",       0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
4945   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
4946   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
48474947ROM_END
48484948
48494949ROM_START( sf2ua )
r2454r2455
48794979   ROM_CONTINUE(              0x10000, 0x08000 )
48804980
48814981   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
4882   ROM_LOAD( "sf2_18.bin",       0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
4883   ROM_LOAD( "sf2_19.bin",       0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
4982   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
4983   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
48844984ROM_END
48854985
48864986ROM_START( sf2ub )
r2454r2455
49165016   ROM_CONTINUE(              0x10000, 0x08000 )
49175017
49185018   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
4919   ROM_LOAD( "sf2_18.bin",       0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
4920   ROM_LOAD( "sf2_19.bin",       0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
5019   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
5020   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
49215021ROM_END
49225022
49235023ROM_START( sf2ud )
49245024   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
4925   ROM_LOAD16_BYTE( "sf2u.30d",   0x00000, 0x20000, CRC(4bb2657c) SHA1(b2d077296b77be7db371f953b7fc446a67d8a9d6) )
4926   ROM_LOAD16_BYTE( "sf2u.37d",   0x00001, 0x20000, CRC(b33b42f2) SHA1(2e0babc8734c79dc2b51a6be64433bb2411c3da5) )
4927   ROM_LOAD16_BYTE( "sf2u.31d",   0x40000, 0x20000, CRC(d57b67d7) SHA1(43d0b47c9fada8d9b445caa4b96ac8493061aa8b) )
4928   ROM_LOAD16_BYTE( "sf2u.38d",   0x40001, 0x20000, CRC(9c8916ef) SHA1(a4629356a816454bcc1d7b41e70e147d4769a682) )
4929   ROM_LOAD16_BYTE( "sf2u.28d",   0x80000, 0x20000, CRC(175819d1) SHA1(c98b6b7af4e57735dbfb3d1e61ba1bfb9f145d33) )
4930   ROM_LOAD16_BYTE( "sf2u.35d",   0x80001, 0x20000, CRC(82060da4) SHA1(7487cfc28cce3d76772ece657aef83b56034011e) )
5025   ROM_LOAD16_BYTE( "sf2u.30d",      0x00000, 0x20000, CRC(4bb2657c) SHA1(b2d077296b77be7db371f953b7fc446a67d8a9d6) )
5026   ROM_LOAD16_BYTE( "sf2u.37d",      0x00001, 0x20000, CRC(b33b42f2) SHA1(2e0babc8734c79dc2b51a6be64433bb2411c3da5) )
5027   ROM_LOAD16_BYTE( "sf2u.31d",      0x40000, 0x20000, CRC(d57b67d7) SHA1(43d0b47c9fada8d9b445caa4b96ac8493061aa8b) )
5028   ROM_LOAD16_BYTE( "sf2u.38d",      0x40001, 0x20000, CRC(9c8916ef) SHA1(a4629356a816454bcc1d7b41e70e147d4769a682) )
5029   ROM_LOAD16_BYTE( "sf2u.28d",      0x80000, 0x20000, CRC(175819d1) SHA1(c98b6b7af4e57735dbfb3d1e61ba1bfb9f145d33) )
5030   ROM_LOAD16_BYTE( "sf2u.35d",      0x80001, 0x20000, CRC(82060da4) SHA1(7487cfc28cce3d76772ece657aef83b56034011e) )
49315031   ROM_LOAD16_BYTE( "sf2_29a.bin",   0xc0000, 0x20000, CRC(bb4af315) SHA1(75f0827f4f7e9f292add46467f8d4fe19b2514c9) )
49325032   ROM_LOAD16_BYTE( "sf2_36a.bin",   0xc0001, 0x20000, CRC(c02a13eb) SHA1(b807cc495bff3f95d03b061fc629c95f965cb6d8) )
49335033
r2454r2455
49535053   ROM_CONTINUE(              0x10000, 0x08000 )
49545054
49555055   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
4956   ROM_LOAD( "sf2_18.bin",       0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
4957   ROM_LOAD( "sf2_19.bin",       0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
5056   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
5057   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
49585058ROM_END
49595059
49605060ROM_START( sf2ue )
r2454r2455
49905090   ROM_CONTINUE(              0x10000, 0x08000 )
49915091
49925092   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
4993   ROM_LOAD( "sf2_18.bin",       0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
4994   ROM_LOAD( "sf2_19.bin",       0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
5093   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
5094   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
49955095ROM_END
49965096
49975097ROM_START( sf2uf )
r2454r2455
50275127   ROM_CONTINUE(              0x10000, 0x08000 )
50285128
50295129   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
5030   ROM_LOAD( "sf2_18.bin",       0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
5031   ROM_LOAD( "sf2_19.bin",       0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
5130   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
5131   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
50325132ROM_END
50335133
50345134ROM_START( sf2ui )
r2454r2455
50645164   ROM_CONTINUE(              0x10000, 0x08000 )
50655165
50665166   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
5067   ROM_LOAD( "sf2_18.bin",       0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
5068   ROM_LOAD( "sf2_19.bin",       0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
5167   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
5168   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
50695169ROM_END
50705170
50715171ROM_START( sf2uk )
r2454r2455
51015201   ROM_CONTINUE(              0x10000, 0x08000 )
51025202
51035203   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
5104   ROM_LOAD( "sf2_18.bin",       0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
5105   ROM_LOAD( "sf2_19.bin",       0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
5204   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
5205   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
51065206ROM_END
51075207
51085208ROM_START( sf2j )
r2454r2455
51385238   ROM_CONTINUE(              0x10000, 0x08000 )
51395239
51405240   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
5141   ROM_LOAD( "sf2_18.bin",       0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
5142   ROM_LOAD( "sf2_19.bin",       0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
5241   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
5242   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
51435243ROM_END
51445244
51455245ROM_START( sf2ja )
r2454r2455
51755275   ROM_CONTINUE(              0x10000, 0x08000 )
51765276
51775277   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
5178   ROM_LOAD( "sf2_18.bin",       0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
5179   ROM_LOAD( "sf2_19.bin",       0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
5278   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
5279   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
51805280ROM_END
51815281
51825282ROM_START( sf2jc )
r2454r2455
52125312   ROM_CONTINUE(              0x10000, 0x08000 )
52135313
52145314   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
5215   ROM_LOAD( "sf2_18.bin",       0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
5216   ROM_LOAD( "sf2_19.bin",       0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
5315   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
5316   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
52175317ROM_END
52185318
52195319ROM_START( 3wonders )
r2454r2455
52455345   ROM_CONTINUE(              0x10000, 0x08000 )
52465346
52475347   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
5248   ROM_LOAD( "3wonders.18",  0x00000, 0x20000, CRC(26b211ab) SHA1(0ea03fdd9edff41eacfc52aa9e0421c10968356b) )
5249   ROM_LOAD( "3wonders.19",  0x20000, 0x20000, CRC(dbe64ad0) SHA1(09f2ad522fe75d7bcca094b8c6696c3733b539d5) )
5348   ROM_LOAD( "3wonders.18",   0x00000, 0x20000, CRC(26b211ab) SHA1(0ea03fdd9edff41eacfc52aa9e0421c10968356b) )
5349   ROM_LOAD( "3wonders.19",   0x20000, 0x20000, CRC(dbe64ad0) SHA1(09f2ad522fe75d7bcca094b8c6696c3733b539d5) )
52505350ROM_END
52515351
52525352ROM_START( 3wonderu )
r2454r2455
52785378   ROM_CONTINUE(              0x10000, 0x08000 )
52795379
52805380   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
5281   ROM_LOAD( "3wonders.18",  0x00000, 0x20000, CRC(26b211ab) SHA1(0ea03fdd9edff41eacfc52aa9e0421c10968356b) )
5282   ROM_LOAD( "3wonders.19",  0x20000, 0x20000, CRC(dbe64ad0) SHA1(09f2ad522fe75d7bcca094b8c6696c3733b539d5) )
5381   ROM_LOAD( "3wonders.18",   0x00000, 0x20000, CRC(26b211ab) SHA1(0ea03fdd9edff41eacfc52aa9e0421c10968356b) )
5382   ROM_LOAD( "3wonders.19",   0x20000, 0x20000, CRC(dbe64ad0) SHA1(09f2ad522fe75d7bcca094b8c6696c3733b539d5) )
52835383ROM_END
52845384
52855385ROM_START( wonder3 )
r2454r2455
52885388   ROM_LOAD16_BYTE( "rtj42.bin",    0x00001, 0x20000, CRC(b4baa117) SHA1(44486b3d50f9b0a8c32c2c2dc5f1a046aface7b6) )
52895389   ROM_LOAD16_BYTE( "rtj37.bin",    0x40000, 0x20000, CRC(a1f677b0) SHA1(e1511ea0fa4a689d1355119ac37c075192880dde) )
52905390   ROM_LOAD16_BYTE( "rtj43.bin",    0x40001, 0x20000, CRC(85337a47) SHA1(0a247aa56c5cc17b1e888df7b502f65e88715469) )
5291
52925391   ROM_LOAD16_BYTE( "3wonders.28",  0x80000, 0x20000, CRC(054137c8) SHA1(e4c406e0a32198323a5931093fbaa6836510b8ad) )
52935392   ROM_LOAD16_BYTE( "3wonders.33",  0x80001, 0x20000, CRC(7264cb1b) SHA1(b367acb9f6579569321ecaa98a14e29dd775b9db) )
52945393   ROM_LOAD16_BYTE( "rtj35.bin",    0xc0000, 0x20000, CRC(e72f9ea3) SHA1(c63df200416bd61af73e8589204f7daef743041e) )
r2454r2455
53125411   ROM_CONTINUE(              0x10000, 0x08000 )                /* (compare with US version, */
53135412                                          /* which is verified to be correct) */
53145413   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
5315   ROM_LOAD( "3wonders.18",  0x00000, 0x20000, CRC(26b211ab) SHA1(0ea03fdd9edff41eacfc52aa9e0421c10968356b) )
5316   ROM_LOAD( "3wonders.19",  0x20000, 0x20000, CRC(dbe64ad0) SHA1(09f2ad522fe75d7bcca094b8c6696c3733b539d5) )
5414   ROM_LOAD( "3wonders.18",   0x00000, 0x20000, CRC(26b211ab) SHA1(0ea03fdd9edff41eacfc52aa9e0421c10968356b) )
5415   ROM_LOAD( "3wonders.19",   0x20000, 0x20000, CRC(dbe64ad0) SHA1(09f2ad522fe75d7bcca094b8c6696c3733b539d5) )
53175416ROM_END
53185417
53195418ROM_START( kod )
r2454r2455
53455444   ROM_CONTINUE(              0x10000, 0x08000 )
53465445
53475446   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
5348   ROM_LOAD( "kod18.rom",    0x00000, 0x20000, CRC(69ecb2c8) SHA1(fadf266b6b20bd6329a3e638918c5a3106413476) )
5349   ROM_LOAD( "kod19.rom",    0x20000, 0x20000, CRC(02d851c1) SHA1(c959a6fc3e7d893557f319debae91f28471f4be2) )
5447   ROM_LOAD( "kod18.rom",     0x00000, 0x20000, CRC(69ecb2c8) SHA1(fadf266b6b20bd6329a3e638918c5a3106413476) )
5448   ROM_LOAD( "kod19.rom",     0x20000, 0x20000, CRC(02d851c1) SHA1(c959a6fc3e7d893557f319debae91f28471f4be2) )
53505449ROM_END
53515450
53525451ROM_START( kodu )
r2454r2455
53785477   ROM_CONTINUE(              0x10000, 0x08000 )
53795478
53805479   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
5381   ROM_LOAD( "kd18.bin",    0x00000, 0x20000, CRC(4c63181d) SHA1(270f27534a95cb0be3ff3f9ca71c502320d8090b) )
5382   ROM_LOAD( "kd19.bin",    0x20000, 0x20000, CRC(92941b80) SHA1(5fa7c2793e6febee54a83042d118ddd4f2b7d127) )
5480   ROM_LOAD( "kd18.bin",      0x00000, 0x20000, CRC(4c63181d) SHA1(270f27534a95cb0be3ff3f9ca71c502320d8090b) )
5481   ROM_LOAD( "kd19.bin",      0x20000, 0x20000, CRC(92941b80) SHA1(5fa7c2793e6febee54a83042d118ddd4f2b7d127) )
53835482ROM_END
53845483
53855484ROM_START( kodj )
53865485   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
5387   ROM_LOAD16_BYTE( "kd30.bin",    0x00000, 0x20000, CRC(ebc788ad) SHA1(f4a297e409fcdbb2c15a13b39a16e4a83e7e060b) )
5388   ROM_LOAD16_BYTE( "kd37.bin",    0x00001, 0x20000, CRC(e55c3529) SHA1(a5254895499a53b4fbaac6fd50464b9e08175b8d) )
5389   ROM_LOAD16_BYTE( "kd31.bin",    0x40000, 0x20000, CRC(c710d722) SHA1(a2e9b84d3e7d835a910ab9f584bdc64c2559995a) )
5390   ROM_LOAD16_BYTE( "kd38.bin",    0x40001, 0x20000, CRC(57d6ed3a) SHA1(a47da5068723c8e16ed458fbfa3e3db57b32d87d) )
5486   ROM_LOAD16_BYTE( "kd30.bin",     0x00000, 0x20000, CRC(ebc788ad) SHA1(f4a297e409fcdbb2c15a13b39a16e4a83e7e060b) )
5487   ROM_LOAD16_BYTE( "kd37.bin",     0x00001, 0x20000, CRC(e55c3529) SHA1(a5254895499a53b4fbaac6fd50464b9e08175b8d) )
5488   ROM_LOAD16_BYTE( "kd31.bin",     0x40000, 0x20000, CRC(c710d722) SHA1(a2e9b84d3e7d835a910ab9f584bdc64c2559995a) )
5489   ROM_LOAD16_BYTE( "kd38.bin",     0x40001, 0x20000, CRC(57d6ed3a) SHA1(a47da5068723c8e16ed458fbfa3e3db57b32d87d) )
53915490   ROM_LOAD16_WORD_SWAP("kd33.bin", 0x80000, 0x80000, CRC(9bd7ad4b) SHA1(7bece5d408fd13116bd5518014b632ecc9a2feaa) )
53925491
53935492   ROM_REGION( 0x400000, REGION_GFX1, 0 )
r2454r2455
54085507   ROM_CONTINUE(              0x10000, 0x08000 )
54095508
54105509   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
5411   ROM_LOAD( "kd18.bin",    0x00000, 0x20000, CRC(4c63181d) SHA1(270f27534a95cb0be3ff3f9ca71c502320d8090b) )
5412   ROM_LOAD( "kd19.bin",    0x20000, 0x20000, CRC(92941b80) SHA1(5fa7c2793e6febee54a83042d118ddd4f2b7d127) )
5510   ROM_LOAD( "kd18.bin",      0x00000, 0x20000, CRC(4c63181d) SHA1(270f27534a95cb0be3ff3f9ca71c502320d8090b) )
5511   ROM_LOAD( "kd19.bin",      0x20000, 0x20000, CRC(92941b80) SHA1(5fa7c2793e6febee54a83042d118ddd4f2b7d127) )
54135512ROM_END
54145513
54155514ROM_START( kodb )
r2454r2455
54355534   ROM_CONTINUE(              0x10000, 0x08000 )
54365535
54375536   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
5438   ROM_LOAD( "kd18.bin",    0x00000, 0x20000, CRC(4c63181d) SHA1(270f27534a95cb0be3ff3f9ca71c502320d8090b) )
5439   ROM_LOAD( "kd19.bin",    0x20000, 0x20000, CRC(92941b80) SHA1(5fa7c2793e6febee54a83042d118ddd4f2b7d127) )
5537   ROM_LOAD( "kd18.bin",      0x00000, 0x20000, CRC(4c63181d) SHA1(270f27534a95cb0be3ff3f9ca71c502320d8090b) )
5538   ROM_LOAD( "kd19.bin",      0x20000, 0x20000, CRC(92941b80) SHA1(5fa7c2793e6febee54a83042d118ddd4f2b7d127) )
54405539ROM_END
54415540
54425541ROM_START( captcomm )
r2454r2455
54645563   ROM_CONTINUE(              0x10000, 0x08000 )
54655564
54665565   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
5467   ROM_LOAD( "cc_18.rom",    0x00000, 0x20000, CRC(6de2c2db) SHA1(9a1eaba8d104f59a5e61f89679bb5de0c0c64364) )
5468   ROM_LOAD( "cc_19.rom",    0x20000, 0x20000, CRC(b99091ae) SHA1(b19197c7ad3aeaf5f41c26bf853b0c9b502ecfca) )
5566   ROM_LOAD( "cc_18.rom",     0x00000, 0x20000, CRC(6de2c2db) SHA1(9a1eaba8d104f59a5e61f89679bb5de0c0c64364) )
5567   ROM_LOAD( "cc_19.rom",     0x20000, 0x20000, CRC(b99091ae) SHA1(b19197c7ad3aeaf5f41c26bf853b0c9b502ecfca) )
54695568ROM_END
54705569
54715570ROM_START( captcomu )
r2454r2455
54935592   ROM_CONTINUE(              0x10000, 0x08000 )
54945593
54955594   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
5496   ROM_LOAD( "cc_18.rom",    0x00000, 0x20000, CRC(6de2c2db) SHA1(9a1eaba8d104f59a5e61f89679bb5de0c0c64364) )
5497   ROM_LOAD( "cc_19.rom",    0x20000, 0x20000, CRC(b99091ae) SHA1(b19197c7ad3aeaf5f41c26bf853b0c9b502ecfca) )
5595   ROM_LOAD( "cc_18.rom",     0x00000, 0x20000, CRC(6de2c2db) SHA1(9a1eaba8d104f59a5e61f89679bb5de0c0c64364) )
5596   ROM_LOAD( "cc_19.rom",     0x20000, 0x20000, CRC(b99091ae) SHA1(b19197c7ad3aeaf5f41c26bf853b0c9b502ecfca) )
54985597ROM_END
54995598
55005599ROM_START( captcomj )
r2454r2455
55225621   ROM_CONTINUE(              0x10000, 0x08000 )
55235622
55245623   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
5525   ROM_LOAD( "cc_18.rom",    0x00000, 0x20000, CRC(6de2c2db) SHA1(9a1eaba8d104f59a5e61f89679bb5de0c0c64364) )
5526   ROM_LOAD( "cc_19.rom",    0x20000, 0x20000, CRC(b99091ae) SHA1(b19197c7ad3aeaf5f41c26bf853b0c9b502ecfca) )
5624   ROM_LOAD( "cc_18.rom",     0x00000, 0x20000, CRC(6de2c2db) SHA1(9a1eaba8d104f59a5e61f89679bb5de0c0c64364) )
5625   ROM_LOAD( "cc_19.rom",     0x20000, 0x20000, CRC(b99091ae) SHA1(b19197c7ad3aeaf5f41c26bf853b0c9b502ecfca) )
55275626ROM_END
55285627
55295628ROM_START( knights )
r2454r2455
55495648   ROM_CONTINUE(              0x10000, 0x08000 )
55505649
55515650   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
5552   ROM_LOAD( "kr_18.rom",    0x00000, 0x20000, CRC(da69d15f) SHA1(9616207e693bae85705f786cef60b9f6951b5067) )
5553   ROM_LOAD( "kr_19.rom",    0x20000, 0x20000, CRC(bfc654e9) SHA1(01b3d92e4dedf55ea3933d387c7ddb9ba2549773) )
5651   ROM_LOAD( "kr_18.rom",     0x00000, 0x20000, CRC(da69d15f) SHA1(9616207e693bae85705f786cef60b9f6951b5067) )
5652   ROM_LOAD( "kr_19.rom",     0x20000, 0x20000, CRC(bfc654e9) SHA1(01b3d92e4dedf55ea3933d387c7ddb9ba2549773) )
55545653ROM_END
55555654
55565655ROM_START( knightsu )
r2454r2455
55765675   ROM_CONTINUE(              0x10000, 0x08000 )
55775676
55785677   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
5579   ROM_LOAD( "kr_18.rom",    0x00000, 0x20000, CRC(da69d15f) SHA1(9616207e693bae85705f786cef60b9f6951b5067) )
5580   ROM_LOAD( "kr_19.rom",    0x20000, 0x20000, CRC(bfc654e9) SHA1(01b3d92e4dedf55ea3933d387c7ddb9ba2549773) )
5678   ROM_LOAD( "kr_18.rom",     0x00000, 0x20000, CRC(da69d15f) SHA1(9616207e693bae85705f786cef60b9f6951b5067) )
5679   ROM_LOAD( "kr_19.rom",     0x20000, 0x20000, CRC(bfc654e9) SHA1(01b3d92e4dedf55ea3933d387c7ddb9ba2549773) )
55815680ROM_END
55825681
55835682ROM_START( knightsj )
55845683   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
5585   ROM_LOAD16_BYTE( "krj30.bin",   0x00000, 0x20000, CRC(ad3d1a8e) SHA1(327f9e818f1500836fc549afeffbb2a3c5aafe8c) )
5586   ROM_LOAD16_BYTE( "krj37.bin",   0x00001, 0x20000, CRC(e694a491) SHA1(5a4d27c879c10032c49880019501de3e45ab1b35) )
5587   ROM_LOAD16_BYTE( "krj31.bin",   0x40000, 0x20000, CRC(85596094) SHA1(74ad294de63aa6b60aa8b885c45c3d41a07ce19a) )
5588   ROM_LOAD16_BYTE( "krj38.bin",   0x40001, 0x20000, CRC(9198bf8f) SHA1(aa3610600286ab25ce81705ea1319d42e7cc7f6c) )
5684   ROM_LOAD16_BYTE( "krj30.bin",         0x00000, 0x20000, CRC(ad3d1a8e) SHA1(327f9e818f1500836fc549afeffbb2a3c5aafe8c) )
5685   ROM_LOAD16_BYTE( "krj37.bin",         0x00001, 0x20000, CRC(e694a491) SHA1(5a4d27c879c10032c49880019501de3e45ab1b35) )
5686   ROM_LOAD16_BYTE( "krj31.bin",         0x40000, 0x20000, CRC(85596094) SHA1(74ad294de63aa6b60aa8b885c45c3d41a07ce19a) )
5687   ROM_LOAD16_BYTE( "krj38.bin",         0x40001, 0x20000, CRC(9198bf8f) SHA1(aa3610600286ab25ce81705ea1319d42e7cc7f6c) )
55895688   ROM_LOAD16_WORD_SWAP( "kr_22.rom",    0x80000, 0x80000, CRC(d0b671a9) SHA1(9865472c5fc3f617345e23b5de5a9ba177945b5a) )
55905689
55915690   ROM_REGION( 0x400000, REGION_GFX1, 0 )
r2454r2455
56065705   ROM_CONTINUE(              0x10000, 0x08000 )
56075706
56085707   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
5609   ROM_LOAD( "kr_18.rom",    0x00000, 0x20000, CRC(da69d15f) SHA1(9616207e693bae85705f786cef60b9f6951b5067) )
5610   ROM_LOAD( "kr_19.rom",    0x20000, 0x20000, CRC(bfc654e9) SHA1(01b3d92e4dedf55ea3933d387c7ddb9ba2549773) )
5708   ROM_LOAD( "kr_18.rom",     0x00000, 0x20000, CRC(da69d15f) SHA1(9616207e693bae85705f786cef60b9f6951b5067) )
5709   ROM_LOAD( "kr_19.rom",     0x20000, 0x20000, CRC(bfc654e9) SHA1(01b3d92e4dedf55ea3933d387c7ddb9ba2549773) )
56115710ROM_END
56125711
56135712ROM_START( sf2ce )
r2454r2455
57725871
57735872ROM_START( sf2rb )
57745873   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
5775   ROM_LOAD16_WORD( "sf2d__23.rom", 0x000000, 0x80000, CRC(450532b0) SHA1(14d5ff44ce97247ef4c42147157856d16c5fb4b8) )
5776   ROM_LOAD16_WORD( "sf2d__22.rom", 0x080000, 0x80000, CRC(fe9d9cf5) SHA1(91afb25d8c0fd1a721f982cebf8fdf563fe11760) )
5874   ROM_LOAD16_WORD( "sf2d__23.rom",      0x000000, 0x80000, CRC(450532b0) SHA1(14d5ff44ce97247ef4c42147157856d16c5fb4b8) )
5875   ROM_LOAD16_WORD( "sf2d__22.rom",      0x080000, 0x80000, CRC(fe9d9cf5) SHA1(91afb25d8c0fd1a721f982cebf8fdf563fe11760) )
57775876   ROM_LOAD16_WORD_SWAP( "s92_21a.bin",  0x100000, 0x80000, CRC(925a7877) SHA1(1960dca35f0ca6f2b399a9fccfbc0132ac6425d1) )
57785877
57795878   ROM_REGION( 0x600000, REGION_GFX1, 0 )
r2454r2455
58045903
58055904ROM_START( sf2rb2 )
58065905   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
5807   ROM_LOAD16_BYTE( "27.bin",    0x000000, 0x20000, CRC(40296ecd) SHA1(6006b9bc7e2e8ccec47f87b51791d3c0512620df) )
5808   ROM_LOAD16_BYTE( "31.bin",    0x000001, 0x20000, CRC(87954a41) SHA1(67225f180e1f954f0bebba49b618f793a973af14) )
5809   ROM_LOAD16_BYTE( "26.bin",    0x040000, 0x20000, CRC(a6974195) SHA1(f7e0fd43bd75229d49d5c330820bdc5c3b11ab03) )
5810   ROM_LOAD16_BYTE( "30.bin",    0x040001, 0x20000, CRC(8141fe32) SHA1(e6ea1ee331f674c64e63a776ad4e428f6081c79c) )
5811   ROM_LOAD16_BYTE( "25.bin",    0x080000, 0x20000, CRC(9ef8f772) SHA1(3ee271413521cc2d6ac9544e401ff38eff8a1347) )
5812   ROM_LOAD16_BYTE( "29.bin",    0x080001, 0x20000, CRC(7d9c479c) SHA1(a1195444caac5230a1f74f3444b024ceaf1d0667) )
5813   ROM_LOAD16_BYTE( "24.bin",    0x0c0000, 0x20000, CRC(93579684) SHA1(9052b46f635cae7843e9d37a601db0189a89e0f9) )
5814   ROM_LOAD16_BYTE( "28.bin",    0x0c0001, 0x20000, CRC(ff728865) SHA1(ad4522294ff2e02b594d960b45940a3e57a5d1ec) )
5815   ROM_LOAD16_WORD_SWAP( "s92_21a.bin",     0x100000, 0x80000, CRC(925a7877) SHA1(1960dca35f0ca6f2b399a9fccfbc0132ac6425d1) )
5906   ROM_LOAD16_BYTE( "27.bin",            0x000000, 0x20000, CRC(40296ecd) SHA1(6006b9bc7e2e8ccec47f87b51791d3c0512620df) )
5907   ROM_LOAD16_BYTE( "31.bin",            0x000001, 0x20000, CRC(87954a41) SHA1(67225f180e1f954f0bebba49b618f793a973af14) )
5908   ROM_LOAD16_BYTE( "26.bin",            0x040000, 0x20000, CRC(a6974195) SHA1(f7e0fd43bd75229d49d5c330820bdc5c3b11ab03) )
5909   ROM_LOAD16_BYTE( "30.bin",            0x040001, 0x20000, CRC(8141fe32) SHA1(e6ea1ee331f674c64e63a776ad4e428f6081c79c) )
5910   ROM_LOAD16_BYTE( "25.bin",            0x080000, 0x20000, CRC(9ef8f772) SHA1(3ee271413521cc2d6ac9544e401ff38eff8a1347) )
5911   ROM_LOAD16_BYTE( "29.bin",            0x080001, 0x20000, CRC(7d9c479c) SHA1(a1195444caac5230a1f74f3444b024ceaf1d0667) )
5912   ROM_LOAD16_BYTE( "24.bin",            0x0c0000, 0x20000, CRC(93579684) SHA1(9052b46f635cae7843e9d37a601db0189a89e0f9) )
5913   ROM_LOAD16_BYTE( "28.bin",            0x0c0001, 0x20000, CRC(ff728865) SHA1(ad4522294ff2e02b594d960b45940a3e57a5d1ec) )
5914   ROM_LOAD16_WORD_SWAP( "s92_21a.bin",  0x100000, 0x80000, CRC(925a7877) SHA1(1960dca35f0ca6f2b399a9fccfbc0132ac6425d1) )
58165915
58175916   ROM_REGION( 0x600000, REGION_GFX1, 0 )
58185917   ROMX_LOAD( "s92_01.bin",   0x000000, 0x80000, CRC(03b0d852) SHA1(f370f25c96ad2b94f8c53d6b7139100285a25bef) , ROM_GROUPWORD | ROM_SKIP(6) )
r2454r2455
59406039
59416040ROM_START( sf2m1 )
59426041   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
5943   ROM_LOAD16_BYTE( "222e", 0x000000, 0x80000, CRC(1e20d0a3) SHA1(5e05b52fd938aff5190bca7e178705d7236aef66) )
5944   ROM_LOAD16_BYTE( "196e", 0x000001, 0x80000, CRC(88cc38a3) SHA1(6049962f943bd37748a9531cc3254e8b59326eac) )
6042   ROM_LOAD16_BYTE( "222e",              0x000000, 0x80000, CRC(1e20d0a3) SHA1(5e05b52fd938aff5190bca7e178705d7236aef66) )
6043   ROM_LOAD16_BYTE( "196e",              0x000001, 0x80000, CRC(88cc38a3) SHA1(6049962f943bd37748a9531cc3254e8b59326eac) )
59456044   ROM_LOAD16_WORD_SWAP( "s92_21a.bin",  0x100000, 0x80000, CRC(925a7877) SHA1(1960dca35f0ca6f2b399a9fccfbc0132ac6425d1) )
59466045
59476046   ROM_REGION( 0x600000, REGION_GFX1, 0 )
r2454r2455
59726071
59736072ROM_START( sf2m2 )
59746073   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
5975   ROM_LOAD16_BYTE( "ch222esp", 0x000000, 0x80000, CRC(9e6d058a) SHA1(8c9adca7b65dc929c325c0a62304d24dc0902c08) )
5976   ROM_LOAD16_BYTE( "ch196esp", 0x000001, 0x80000, CRC(ed2ff437) SHA1(e76fc2953b6c800d5955c8fb442b80142e40e375) )
6074   ROM_LOAD16_BYTE( "ch222esp",          0x000000, 0x80000, CRC(9e6d058a) SHA1(8c9adca7b65dc929c325c0a62304d24dc0902c08) )
6075   ROM_LOAD16_BYTE( "ch196esp",          0x000001, 0x80000, CRC(ed2ff437) SHA1(e76fc2953b6c800d5955c8fb442b80142e40e375) )
59776076   ROM_LOAD16_WORD_SWAP( "s92_21a.bin",  0x100000, 0x80000, CRC(925a7877) SHA1(1960dca35f0ca6f2b399a9fccfbc0132ac6425d1) )
59786077
59796078   ROM_REGION( 0x600000, REGION_GFX1, 0 )
r2454r2455
60046103
60056104ROM_START( sf2m3 )
60066105   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
6007   ROM_LOAD16_BYTE( "u222chp", 0x000000, 0x80000, CRC(db567b66) SHA1(315bfbf2786ef67a95afb87de836ab348523dbbe) )
6008   ROM_LOAD16_BYTE( "u196chp", 0x000001, 0x80000, CRC(95ea597e) SHA1(5eb82feaa1de5611a96888e4670744bbb7d90393) )
6106   ROM_LOAD16_BYTE( "u222chp",           0x000000, 0x80000, CRC(db567b66) SHA1(315bfbf2786ef67a95afb87de836ab348523dbbe) )
6107   ROM_LOAD16_BYTE( "u196chp",           0x000001, 0x80000, CRC(95ea597e) SHA1(5eb82feaa1de5611a96888e4670744bbb7d90393) )
60096108   ROM_LOAD16_WORD_SWAP( "s92_21a.bin",  0x100000, 0x80000, CRC(925a7877) SHA1(1960dca35f0ca6f2b399a9fccfbc0132ac6425d1) )
60106109
60116110   ROM_REGION( 0x600000, REGION_GFX1, 0 )
r2454r2455
60366135
60376136ROM_START( sf2m4 )
60386137   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
6039   ROM_LOAD16_BYTE( "u222ne", 0x000000, 0x80000, CRC(7133489e) SHA1(036ef100c64c6e912c911340b32eea0da0b6f6d9) )
6040   ROM_LOAD16_BYTE( "u196ne", 0x000001, 0x80000, CRC(b07a4f90) SHA1(7a4a800bddc43cfa60f9097723b44a05c9d290ae) )
6138   ROM_LOAD16_BYTE( "u222ne",            0x000000, 0x80000, CRC(7133489e) SHA1(036ef100c64c6e912c911340b32eea0da0b6f6d9) )
6139   ROM_LOAD16_BYTE( "u196ne",            0x000001, 0x80000, CRC(b07a4f90) SHA1(7a4a800bddc43cfa60f9097723b44a05c9d290ae) )
60416140   ROM_LOAD16_WORD_SWAP( "s92_21a.bin",  0x100000, 0x80000, CRC(925a7877) SHA1(1960dca35f0ca6f2b399a9fccfbc0132ac6425d1) )
60426141
60436142   ROM_REGION( 0x600000, REGION_GFX1, 0 )
r2454r2455
60686167
60696168ROM_START( sf2m5 )
60706169   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
6071   ROM_LOAD16_BYTE( "u222", 0x000000, 0x80000, CRC(03991fba) SHA1(6c42bf15248640fdb3e98fb01b0a870649deb410) )
6072   ROM_LOAD16_BYTE( "u196", 0x000001, 0x80000, CRC(39f15a1e) SHA1(901c4fea76bf5bff7330ed07ffde54cdccdaa680) )
6170   ROM_LOAD16_BYTE( "u222",              0x000000, 0x80000, CRC(03991fba) SHA1(6c42bf15248640fdb3e98fb01b0a870649deb410) )
6171   ROM_LOAD16_BYTE( "u196",              0x000001, 0x80000, CRC(39f15a1e) SHA1(901c4fea76bf5bff7330ed07ffde54cdccdaa680) )
60736172   ROM_LOAD16_WORD_SWAP( "s92_21a.bin",  0x100000, 0x80000, CRC(925a7877) SHA1(1960dca35f0ca6f2b399a9fccfbc0132ac6425d1) )
60746173
60756174   ROM_REGION( 0x600000, REGION_GFX1, 0 )
r2454r2455
61006199
61016200ROM_START( sf2m6 )
61026201   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
6103   ROM_LOAD16_BYTE( "u222-6b", 0x000000, 0x80000, CRC(0a3692be) SHA1(7b937b7b0130e460b5f12188b19f464c55b507c9) )
6104   ROM_LOAD16_BYTE( "u196-6b", 0x000001, 0x80000, CRC(80454da7) SHA1(64f6dba14d342c9933ce632aa7ca126b34b4ee8b) )
6202   ROM_LOAD16_BYTE( "u222-6b",           0x000000, 0x80000, CRC(0a3692be) SHA1(7b937b7b0130e460b5f12188b19f464c55b507c9) )
6203   ROM_LOAD16_BYTE( "u196-6b",           0x000001, 0x80000, CRC(80454da7) SHA1(64f6dba14d342c9933ce632aa7ca126b34b4ee8b) )
61056204   ROM_LOAD16_WORD_SWAP( "s92_21a.bin",  0x100000, 0x80000, CRC(925a7877) SHA1(1960dca35f0ca6f2b399a9fccfbc0132ac6425d1) )
61066205
61076206   ROM_REGION( 0x600000, REGION_GFX1, 0 )
r2454r2455
61326231
61336232ROM_START( sf2m7 )
61346233   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
6135   ROM_LOAD16_BYTE( "u222-2i", 0x000000, 0x40000, CRC(1ca7adbd) SHA1(45e9dc05766ad156edcfc9e59a9804f74f90dc68) )
6136   ROM_LOAD16_BYTE( "u196-2i", 0x000001, 0x40000, CRC(f758408c) SHA1(aac44a7287bb3b7ba35d68aff279e265dbd3f6d3) )
6137   ROM_LOAD16_BYTE( "u222-2s", 0x080000, 0x40000, CRC(720cea3e) SHA1(ec4f22159d44a8abc40643b986b88a4f947d6aea) )
6138   ROM_LOAD16_BYTE( "u196-2s", 0x080001, 0x40000, CRC(9932832c) SHA1(0da0f5ebab91b0759c5fc00902cfe4b12a856466) )
6234   ROM_LOAD16_BYTE( "u222-2i",           0x000000, 0x40000, CRC(1ca7adbd) SHA1(45e9dc05766ad156edcfc9e59a9804f74f90dc68) )
6235   ROM_LOAD16_BYTE( "u196-2i",           0x000001, 0x40000, CRC(f758408c) SHA1(aac44a7287bb3b7ba35d68aff279e265dbd3f6d3) )
6236   ROM_LOAD16_BYTE( "u222-2s",           0x080000, 0x40000, CRC(720cea3e) SHA1(ec4f22159d44a8abc40643b986b88a4f947d6aea) )
6237   ROM_LOAD16_BYTE( "u196-2s",           0x080001, 0x40000, CRC(9932832c) SHA1(0da0f5ebab91b0759c5fc00902cfe4b12a856466) )
61396238   ROM_LOAD16_WORD_SWAP( "s92_21a.bin",  0x100000, 0x80000, CRC(925a7877) SHA1(1960dca35f0ca6f2b399a9fccfbc0132ac6425d1) )
61406239
61416240   ROM_REGION( 0x600000, REGION_GFX1, 0 )
r2454r2455
61696268   ROM_LOAD16_BYTE( "b12.rom", 0x000000, 0x80000, CRC(8f742fd5) SHA1(a78a00e686856481011d8b5f5e60ed18197a5225) )
61706269   ROM_LOAD16_BYTE( "b14.rom", 0x000001, 0x80000, CRC(8831ec7f) SHA1(0293ff189cbacf90098e734fb31fcbf3c3165e6b) )
61716270   ROM_LOAD16_BYTE( "b11.rom", 0x100000, 0x20000, CRC(94a46525) SHA1(2712b979ce2bfd87e74da3369e0fceaae2a0654c) )
6172   ROM_RELOAD ( 0x140000, 0x20000 )
6271   ROM_RELOAD(                0x140000, 0x20000 )
61736272   ROM_LOAD16_BYTE( "b13.rom", 0x100001, 0x20000, CRC(8fb3dd47) SHA1(ebf30ad7ae60eeda446e23bd74f6e2d98dde4158) )
6174   ROM_RELOAD ( 0x140001, 0x20000 )
6273   ROM_RELOAD(                0x140001, 0x20000 )
61756274
61766275   ROM_REGION( 0x600000, REGION_GFX1, 0 )
61776276   ROMX_LOAD( "s92_01.bin",   0x000000, 0x80000, CRC(03b0d852) SHA1(f370f25c96ad2b94f8c53d6b7139100285a25bef) , ROM_GROUPWORD | ROM_SKIP(6) )
r2454r2455
62576356   ROM_CONTINUE(              0x10000, 0x08000 )
62586357
62596358   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
6260   ROM_LOAD( "va_18.rom",    0x00000, 0x20000, CRC(de30510e) SHA1(8e878696192606b76a3a0e53553e638d9621cff7) )
6261   ROM_LOAD( "va_19.rom",    0x20000, 0x20000, CRC(0610a4ac) SHA1(3da02ea6a7a56c85de898806d2a1cf6bc526c1b3) )
6359   ROM_LOAD( "va_18.rom",     0x00000, 0x20000, CRC(de30510e) SHA1(8e878696192606b76a3a0e53553e638d9621cff7) )
6360   ROM_LOAD( "va_19.rom",     0x20000, 0x20000, CRC(0610a4ac) SHA1(3da02ea6a7a56c85de898806d2a1cf6bc526c1b3) )
62626361ROM_END
62636362
62646363ROM_START( varthr1 )
r2454r2455
62866385   ROM_CONTINUE(              0x10000, 0x08000 )
62876386
62886387   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
6289   ROM_LOAD( "va_18.rom",    0x00000, 0x20000, CRC(de30510e) SHA1(8e878696192606b76a3a0e53553e638d9621cff7) )
6290   ROM_LOAD( "va_19.rom",    0x20000, 0x20000, CRC(0610a4ac) SHA1(3da02ea6a7a56c85de898806d2a1cf6bc526c1b3) )
6388   ROM_LOAD( "va_18.rom",     0x00000, 0x20000, CRC(de30510e) SHA1(8e878696192606b76a3a0e53553e638d9621cff7) )
6389   ROM_LOAD( "va_19.rom",     0x20000, 0x20000, CRC(0610a4ac) SHA1(3da02ea6a7a56c85de898806d2a1cf6bc526c1b3) )
62916390ROM_END
62926391
62936392ROM_START( varthu )
62946393   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
62956394   ROM_LOAD16_WORD_SWAP( "vau23a.bin",  0x00000, 0x80000, CRC(fbe68726) SHA1(68917d366551d2203400adc3261355dd3b332bcb) )
6296   ROM_LOAD16_BYTE( "vae_28a.rom",  0x80000, 0x20000, CRC(7a0e0d25) SHA1(203692ef1daeef7ba08b154cf029cc07a2e0e23d) )
6297   ROM_LOAD16_BYTE( "vae_33a.rom",  0x80001, 0x20000, CRC(f2365922) SHA1(efb2221033e4b46fedaf3d8c850e208f849e6af0) )
6298   ROM_LOAD16_BYTE( "vae_29a.rom",  0xc0000, 0x20000, CRC(5e2cd2c3) SHA1(eff955c7dc0d8ae215e7188cc4865726104c7777) )
6299   ROM_LOAD16_BYTE( "vae_34a.rom",  0xc0001, 0x20000, CRC(3d9bdf83) SHA1(d655803a6f07b90e44aacaa3e6059ac330ef2ec6) )
6395   ROM_LOAD16_BYTE( "vae_28a.rom",      0x80000, 0x20000, CRC(7a0e0d25) SHA1(203692ef1daeef7ba08b154cf029cc07a2e0e23d) )
6396   ROM_LOAD16_BYTE( "vae_33a.rom",      0x80001, 0x20000, CRC(f2365922) SHA1(efb2221033e4b46fedaf3d8c850e208f849e6af0) )
6397   ROM_LOAD16_BYTE( "vae_29a.rom",      0xc0000, 0x20000, CRC(5e2cd2c3) SHA1(eff955c7dc0d8ae215e7188cc4865726104c7777) )
6398   ROM_LOAD16_BYTE( "vae_34a.rom",      0xc0001, 0x20000, CRC(3d9bdf83) SHA1(d655803a6f07b90e44aacaa3e6059ac330ef2ec6) )
63006399
63016400   ROM_REGION( 0x200000, REGION_GFX1, 0 )
63026401   ROMX_LOAD( "va_gfx5.rom",  0x000000, 0x80000, CRC(b1fb726e) SHA1(5ac0876b6c49d0a99710dda68653664f4d8c1167) , ROM_GROUPWORD | ROM_SKIP(6) )
r2454r2455
63126411   ROM_CONTINUE(              0x10000, 0x08000 )
63136412
63146413   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
6315   ROM_LOAD( "va_18.rom",    0x00000, 0x20000, CRC(de30510e) SHA1(8e878696192606b76a3a0e53553e638d9621cff7) )
6316   ROM_LOAD( "va_19.rom",    0x20000, 0x20000, CRC(0610a4ac) SHA1(3da02ea6a7a56c85de898806d2a1cf6bc526c1b3) )
6414   ROM_LOAD( "va_18.rom",     0x00000, 0x20000, CRC(de30510e) SHA1(8e878696192606b76a3a0e53553e638d9621cff7) )
6415   ROM_LOAD( "va_19.rom",     0x20000, 0x20000, CRC(0610a4ac) SHA1(3da02ea6a7a56c85de898806d2a1cf6bc526c1b3) )
63176416ROM_END
63186417
63196418ROM_START( varthj )
r2454r2455
63416440   ROM_CONTINUE(              0x10000, 0x08000 )
63426441
63436442   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
6344   ROM_LOAD( "va_18.rom",    0x00000, 0x20000, CRC(de30510e) SHA1(8e878696192606b76a3a0e53553e638d9621cff7) )
6345   ROM_LOAD( "va_19.rom",    0x20000, 0x20000, CRC(0610a4ac) SHA1(3da02ea6a7a56c85de898806d2a1cf6bc526c1b3) )
6443   ROM_LOAD( "va_18.rom",     0x00000, 0x20000, CRC(de30510e) SHA1(8e878696192606b76a3a0e53553e638d9621cff7) )
6444   ROM_LOAD( "va_19.rom",     0x20000, 0x20000, CRC(0610a4ac) SHA1(3da02ea6a7a56c85de898806d2a1cf6bc526c1b3) )
63466445ROM_END
63476446
63486447ROM_START( cworld2j )
r2454r2455
63826481   ROM_CONTINUE(              0x10000, 0x08000 )
63836482
63846483   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
6385   ROM_LOAD( "q530.bin",       0x00000, 0x20000, CRC(d10c1b68) SHA1(2423241f3340d8ab1b6bf9514ca8c3bba1273873) )
6386   ROM_LOAD( "q531.bin",       0x20000, 0x20000, CRC(7d17e496) SHA1(a274b94ec4f042dddc239ecb9ac2e1e2375f5eb2) )
6484   ROM_LOAD( "q530.bin",      0x00000, 0x20000, CRC(d10c1b68) SHA1(2423241f3340d8ab1b6bf9514ca8c3bba1273873) )
6485   ROM_LOAD( "q531.bin",      0x20000, 0x20000, CRC(7d17e496) SHA1(a274b94ec4f042dddc239ecb9ac2e1e2375f5eb2) )
63876486ROM_END
63886487
63896488ROM_START( wof )
r2454r2455
70467145   ROM_CONTINUE(              0x10000, 0x08000 )
70477146
70487147   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
7049   ROM_LOAD( "pnij24.bin",   0x00000, 0x20000, CRC(5092257d) SHA1(95dc9d10940653b2fb37baf5c1ed27145b02104e) )
7050   ROM_LOAD( "pnij25.bin",   0x20000, 0x20000, CRC(22109aaa) SHA1(cf21e75674d81b2daae2083d02f9f4b6e52722c6) )
7148   ROM_LOAD( "pnij24.bin",    0x00000, 0x20000, CRC(5092257d) SHA1(95dc9d10940653b2fb37baf5c1ed27145b02104e) )
7149   ROM_LOAD( "pnij25.bin",    0x20000, 0x20000, CRC(22109aaa) SHA1(cf21e75674d81b2daae2083d02f9f4b6e52722c6) )
70517150ROM_END
70527151
70537152ROM_START( qad )
r2454r2455
70757174   ROM_CONTINUE(              0x10000, 0x08000 )
70767175
70777176   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
7078   ROM_LOAD( "qdu_30.rom",  0x00000, 0x20000, CRC(f190da84) SHA1(d5cd4c69b5d135a2f2fea8ca9631251c9da79e70) )
7079   ROM_LOAD( "qdu_31.rom",  0x20000, 0x20000, CRC(b7583f73) SHA1(3896e0fcf375e9e5d9ba70cc1ed001cd702f9ff7) )
7177   ROM_LOAD( "qdu_30.rom",    0x00000, 0x20000, CRC(f190da84) SHA1(d5cd4c69b5d135a2f2fea8ca9631251c9da79e70) )
7178   ROM_LOAD( "qdu_31.rom",    0x20000, 0x20000, CRC(b7583f73) SHA1(3896e0fcf375e9e5d9ba70cc1ed001cd702f9ff7) )
70807179ROM_END
70817180
70827181ROM_START( qadj )
r2454r2455
70987197   ROM_CONTINUE(              0x10000, 0x08000 )
70997198
71007199   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
7101   ROM_LOAD( "qad18.bin",   0x00000, 0x20000, CRC(2bfe6f6a) SHA1(b2a98ac034c65b7ac8167431f05f35d4799032ea) )
7102   ROM_LOAD( "qad19.bin",   0x20000, 0x20000, CRC(13d3236b) SHA1(785d49de484e9ac6971eaceebebfecb8e58563f6) )
7200   ROM_LOAD( "qad18.bin",     0x00000, 0x20000, CRC(2bfe6f6a) SHA1(b2a98ac034c65b7ac8167431f05f35d4799032ea) )
7201   ROM_LOAD( "qad19.bin",     0x20000, 0x20000, CRC(13d3236b) SHA1(785d49de484e9ac6971eaceebebfecb8e58563f6) )
71037202ROM_END
71047203
71057204ROM_START( qtono2 )
r2454r2455
71307229   ROM_LOAD( "tn2j-09.12a",   0x00000, 0x08000, CRC(6d8edcef) SHA1(9ec2d64278b30cc4316238c3efee663a8bbb255e) )
71317230
71327231   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
7133   ROM_LOAD( "tn2j-18.11c",  0x00000, 0x20000, CRC(a40bf9a7) SHA1(07cb1076262a281e31a621cbcc10be0cae883175) )
7134   ROM_LOAD( "tn2j-19.12c",  0x20000, 0x20000, CRC(5b3b931e) SHA1(cf28891f84814cbfaa3adaade8bb08b1e0546a3d) )
7232   ROM_LOAD( "tn2j-18.11c",   0x00000, 0x20000, CRC(a40bf9a7) SHA1(07cb1076262a281e31a621cbcc10be0cae883175) )
7233   ROM_LOAD( "tn2j-19.12c",   0x20000, 0x20000, CRC(5b3b931e) SHA1(cf28891f84814cbfaa3adaade8bb08b1e0546a3d) )
71357234ROM_END
71367235
71377236ROM_START( pang3 )
r2454r2455
72077306
72087307   ROM_REGION( 0x28000, REGION_CPU2, 0 ) /* 64k for the audio CPU (+banks) */
72097308   ROM_LOAD( "rcm_09.rom",    0x00000, 0x08000, CRC(9632d6ef) SHA1(2bcb6f17005ffbc9ef8fa4478a814f24b2e6e0b6) )
7210   ROM_CONTINUE(              0x10000, 0x18000 )
7309   ROM_CONTINUE(              0x10000, 0x18000 )   // second half of ROM is empty, not mapped in memory
72117310
72127311   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
72137312   ROM_LOAD( "rcm_18.rom",    0x00000, 0x20000, CRC(80f1f8aa) SHA1(4a5b7b2a6941ad68da7472c63362c7bcd353fa54) )
r2454r2455
72437342
72447343   ROM_REGION( 0x28000, REGION_CPU2, 0 ) /* 64k for the audio CPU (+banks) */
72457344   ROM_LOAD( "rcm_09.rom",    0x00000, 0x08000, CRC(9632d6ef) SHA1(2bcb6f17005ffbc9ef8fa4478a814f24b2e6e0b6) )
7246   ROM_CONTINUE(              0x10000, 0x18000 )
7345   ROM_CONTINUE(              0x10000, 0x18000 )   // second half of ROM is empty, not mapped in memory
72477346
72487347   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* Samples */
72497348   ROM_LOAD( "rcm_18.rom",    0x00000, 0x20000, CRC(80f1f8aa) SHA1(4a5b7b2a6941ad68da7472c63362c7bcd353fa54) )
r2454r2455
72527351
72537352
72547353#ifndef MESS
7354
7355static DRIVER_INIT( forgottn )
7356{
7357   /* Forgotten Worlds has extra inputs on the B-board CN-MOWS connector for the dial controls. */
7358   memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x800040, 0x800041, 0, 0, forgottn_dial_0_reset_w);
7359   memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x800048, 0x800049, 0, 0, forgottn_dial_1_reset_w);
7360   memory_install_read16_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x800052, 0x800055, 0, 0, forgottn_dial_0_r);
7361   memory_install_read16_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x80005a, 0x80005d, 0, 0, forgottn_dial_1_r);
7362
7363   DRIVER_INIT_CALL(cps1);
7364}
7365
72557366static DRIVER_INIT( wof )
72567367{
72577368   wof_decode();
r2454r2455
72787389
72797390static DRIVER_INIT( pang3 )
72807391{
7281   /* Pang 3 EEPROM interface is at a different address */
7392   /* Pang 3 is the only non-QSound game to have an EEPROM. */
7393   /* It is mapped in the CPS-B address range so probably is on the C-board. */
72827394   memory_install_readwrite16_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x80017a, 0x80017b, 0, 0, cps1_eeprom_port_r, cps1_eeprom_port_w);
72837395
72847396   DRIVER_INIT_CALL(cps1);
r2454r2455
73107422#endif
73117423
73127424
7313GAME( 1988, forgottn, 0,        cps1_10MHz, forgottn, cps1,     ROT0,   "Capcom", "Forgotten Worlds (US)", 0 )
7314GAME( 1988, lostwrld, forgottn, cps1_10MHz, forgottn, cps1,     ROT0,   "Capcom", "Lost Worlds (Japan)", 0 )
7425GAME( 1988, forgottn, 0,        cps1_10MHz, forgottn, forgottn, ROT0,   "Capcom", "Forgotten Worlds (US)", 0 )
7426GAME( 1988, lostwrld, forgottn, cps1_10MHz, forgottn, forgottn, ROT0,   "Capcom", "Lost Worlds (Japan)", 0 )
73157427GAME( 1988, ghouls,   0,        cps1_10MHz, ghouls,   cps1,     ROT0,   "Capcom", "Ghouls'n Ghosts (World)" , 0)                  // Wed.26.10.1988 in the ROMS
73167428GAME( 1988, ghoulsu,  ghouls,   cps1_10MHz, ghoulsu,  cps1,     ROT0,   "Capcom", "Ghouls'n Ghosts (US)" , 0)                  // Wed.26.10.1988 in the ROMS
73177429GAME( 1988, daimakai, ghouls,   cps1_10MHz, daimakai, cps1,     ROT0,   "Capcom", "Dai Makai-Mura (Japan)" , 0)                  // Wed.26.10.1988 in the ROMS
r2454r2455
73507462GAME( 1990, cawingj,  cawing,   cps1_10MHz, cawing,   cps1,     ROT0,   "Capcom", "U.S. Navy (Japan 901012)", 0 )
73517463GAME( 1990, nemo,     0,        cps1_10MHz, nemo,     cps1,     ROT0,   "Capcom", "Nemo (World 901130)" , 0)                  // "ETC"
73527464GAME( 1990, nemoj,    nemo,     cps1_10MHz, nemo,     cps1,     ROT0,   "Capcom", "Nemo (Japan 901120)", 0 )
7353GAME( 1991, sf2,      0,        cps1_12MHz, sf2,      cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (World 910522)" , 0)   // "ETC"
7354GAME( 1991, sf2eb,    sf2,      cps1_12MHz, sf2,      cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (World 910214)" , 0)   // "ETC"
7355GAME( 1991, sf2ua,    sf2,      cps1_12MHz, sf2,      cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (US 910206)", 0 )
7356GAME( 1991, sf2ub,    sf2,      cps1_12MHz, sf2,      cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (US 910214)", 0 )
7357GAME( 1991, sf2ud,    sf2,      cps1_12MHz, sf2,      cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (US 910318)", 0 )
7358GAME( 1991, sf2ue,    sf2,      cps1_12MHz, sf2,      cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (US 910228)", 0 )
7359GAME( 1991, sf2uf,    sf2,      cps1_12MHz, sf2,      cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (US 910411)", 0 )
7360GAME( 1991, sf2ui,    sf2,      cps1_12MHz, sf2,      cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (US 910522)", 0 )
7361GAME( 1991, sf2uk,    sf2,      cps1_12MHz, sf2,      cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (US 911101)", 0 )
7362GAME( 1991, sf2j,     sf2,      cps1_12MHz, sf2j,     cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (Japan 911210)", 0 )
7363GAME( 1991, sf2ja,    sf2,      cps1_12MHz, sf2j,     cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (Japan 910214)", 0 )
7364GAME( 1991, sf2jc,    sf2,      cps1_12MHz, sf2j,     cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (Japan 910306)", 0 )
7465GAME( 1991, sf2,      0,        cps1_10MHz, sf2,      cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (World 910522)" , 0)   // "ETC"
7466GAME( 1991, sf2eb,    sf2,      cps1_10MHz, sf2,      cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (World 910214)" , 0)   // "ETC"
7467GAME( 1991, sf2ua,    sf2,      cps1_10MHz, sf2,      cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (US 910206)", 0 )
7468GAME( 1991, sf2ub,    sf2,      cps1_10MHz, sf2,      cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (US 910214)", 0 )
7469GAME( 1991, sf2ud,    sf2,      cps1_10MHz, sf2,      cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (US 910318)", 0 )
7470GAME( 1991, sf2ue,    sf2,      cps1_10MHz, sf2,      cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (US 910228)", 0 )
7471GAME( 1991, sf2uf,    sf2,      cps1_10MHz, sf2,      cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (US 910411)", 0 )
7472GAME( 1991, sf2ui,    sf2,      cps1_10MHz, sf2,      cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (US 910522)", 0 )
7473GAME( 1991, sf2uk,    sf2,      cps1_10MHz, sf2,      cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (US 911101)", 0 )
7474GAME( 1991, sf2j,     sf2,      cps1_10MHz, sf2j,     cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (Japan 911210)", 0 )
7475GAME( 1991, sf2ja,    sf2,      cps1_10MHz, sf2j,     cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (Japan 910214)", 0 )
7476GAME( 1991, sf2jc,    sf2,      cps1_10MHz, sf2j,     cps1,     ROT0,   "Capcom", "Street Fighter II - The World Warrior (Japan 910306)", 0 )
73657477GAME( 1991, 3wonders, 0,        cps1_10MHz, 3wonders, cps1,     ROT0,   "Capcom", "Three Wonders (World 910520)" , 0)               // "ETC"
73667478GAME( 1991, 3wonderu, 3wonders, cps1_10MHz, 3wonders, cps1,     ROT0,   "Capcom", "Three Wonders (US 910520)", 0 )
73677479GAME( 1991, wonder3,  3wonders, cps1_10MHz, 3wonders, cps1,     ROT0,   "Capcom", "Wonder 3 (Japan 910520)", 0 )
r2454r2455
73947506GAME( 1992, sf2m7,    sf2ce,    cps1_12MHz, sf2,      cps1,     ROT0,   "bootleg","Street Fighter II' - Champion Edition (M7)", 0 )
73957507GAME( 1992, sf2yyc,   sf2ce,    cps1_12MHz, sf2,      cps1,     ROT0,   "bootleg","Street Fighter II' - Champion Edition (YYC)", 0 )
73967508GAME( 1992, sf2koryu, sf2ce,    cps1_12MHz, sf2,      cps1,     ROT0,   "bootleg","Street Fighter II' - Champion Edition (Kouryu)", 0 )
7397GAME( 1992, varth,    0,        cps1_10MHz, varth,    cps1,     ROT270, "Capcom", "Varth - Operation Thunderstorm (World 920714)" , 0)      // "ETC"
7398GAME( 1992, varthr1,  varth,    cps1_10MHz, varth,    cps1,     ROT270, "Capcom", "Varth - Operation Thunderstorm (World 920612)" , 0)      // "ETC"
7399GAME( 1992, varthu,   varth,    cps1_10MHz, varth,    cps1,     ROT270, "Capcom (Romstar license)", "Varth - Operation Thunderstorm (US 920612)", 0 )
7400GAME( 1992, varthj,   varth,    cps1_10MHz, varth,    cps1,     ROT270, "Capcom", "Varth - Operation Thunderstorm (Japan 920714)", 0 )
7509GAME( 1992, varth,    0,        cps1_12MHz, varth,    cps1,     ROT270, "Capcom", "Varth - Operation Thunderstorm (World 920714)" , 0)      // "ETC"    12MHz not verified but game slows down at 10MHz
7510GAME( 1992, varthr1,  varth,    cps1_12MHz, varth,    cps1,     ROT270, "Capcom", "Varth - Operation Thunderstorm (World 920612)" , 0)      // "ETC"
7511GAME( 1992, varthu,   varth,    cps1_12MHz, varth,    cps1,     ROT270, "Capcom (Romstar license)", "Varth - Operation Thunderstorm (US 920612)", 0 )
7512GAME( 1992, varthj,   varth,    cps1_12MHz, varth,    cps1,     ROT270, "Capcom", "Varth - Operation Thunderstorm (Japan 920714)", 0 )
74017513GAME( 1992, cworld2j, 0,        cps1_10MHz, cworld2j, cps1,     ROT0,   "Capcom", "Capcom World 2 (Japan 920611)", 0 )
74027514GAME( 1992, sf2hf,    sf2ce,    cps1_12MHz, sf2,      cps1,     ROT0,   "Capcom", "Street Fighter II' - Hyper Fighting (World 921209)", 0 )
74037515GAME( 1992, sf2t,     sf2ce,    cps1_12MHz, sf2,      cps1,     ROT0,   "Capcom", "Street Fighter II' - Hyper Fighting (US 921209)", 0 )
r2454r2455
74217533GAME( 1993, slammast, 0,        qsound,     slammast, slammast, ROT0,   "Capcom", "Saturday Night Slam Masters (World 930713)" , 0)      // "ETC"
74227534GAME( 1993, slammasu, slammast, qsound,     slammast, slammast, ROT0,   "Capcom", "Saturday Night Slam Masters (US 930713)", 0 )
74237535GAME( 1993, mbomberj, slammast, qsound,     slammast, slammast, ROT0,   "Capcom", "Muscle Bomber - The Body Explosion (Japan 930713)", 0 )
7424GAME( 1993, mbombrd,  slammast, qsound,     slammast, slammast, ROT0,   "Capcom", "Muscle Bomber Duo - Ultimate Team Battle (World 931206)" , 0)  // "ETC"
7425GAME( 1993, mbombrdj, slammast, qsound,     slammast, slammast, ROT0,   "Capcom", "Muscle Bomber Duo - Heat Up Warriors (Japan 931206)", 0 )
7536GAME( 1993, mbombrd,  0,        qsound,     slammast, slammast, ROT0,   "Capcom", "Muscle Bomber Duo - Ultimate Team Battle (World 931206)" , 0)  // "ETC"
7537GAME( 1993, mbombrdj, mbombrd,  qsound,     slammast, slammast, ROT0,   "Capcom", "Muscle Bomber Duo - Heat Up Warriors (Japan 931206)", 0 )
74267538
74277539GAME( 1994, pnickj,   0,        cps1_10MHz, pnickj,   cps1,     ROT0,   "Compile (Capcom license)", "Pnickies (Japan 940608)", 0 )
74287540/* Japanese version of Pang 3 is encrypted, Euro version is not */
src/mame/drivers/nova2001.c
r2454r2455
653653
654654static const struct AY8910interface nova2001_ay8910_interface_1 =
655655{
656   0,
657   0,
656   AY8910_LEGACY_OUTPUT,
657   AY8910_DEFAULT_LOADS,
658   NULL,
659   NULL,
658660   nova2001_scroll_x_w,
659661   nova2001_scroll_y_w
660662};
661663
662664static const struct AY8910interface nova2001_ay8910_interface_2 =
663665{
666   AY8910_LEGACY_OUTPUT,
667   AY8910_DEFAULT_LOADS,
664668   input_port_3_r,
665   input_port_4_r
669   input_port_4_r,
670   NULL,
671   NULL
666672};
667673
668674static const struct AY8910interface pkunwar_ay8910_interface_1 =
669675{
676   AY8910_LEGACY_OUTPUT,
677   AY8910_DEFAULT_LOADS,
670678   input_port_0_r,
671   input_port_1_r
679   input_port_1_r,
680   NULL,
681   NULL
672682};
673683
674684static const struct AY8910interface pkunwar_ay8910_interface_2 =
675685{
686   AY8910_LEGACY_OUTPUT,
687   AY8910_DEFAULT_LOADS,
676688   input_port_2_r,
677   input_port_3_r
689   input_port_3_r,
690   NULL,
691   NULL
678692};
679693
680694
src/mame/drivers/scobra.c
r2454r2455
8484
8585static const struct AY8910interface hustler_ay8910_interface =
8686{
87   AY8910_LEGACY_OUTPUT,
88   AY8910_DEFAULT_LOADS,
8789   soundlatch_r,
88   frogger_portB_r
90   frogger_portB_r,
91   NULL,
92   NULL
8993};
9094
91static READ8_HANDLER(scobra_type2_ppi8255_0_r)
95static READ8_DEVICE_HANDLER(scobra_type2_ppi8255_r)
9296{
93   return ppi8255_0_r(machine, offset >> 2);
97   return ppi8255_r(device, offset >> 2);
9498}
9599
96static READ8_HANDLER(scobra_type2_ppi8255_1_r)
100static WRITE8_DEVICE_HANDLER(scobra_type2_ppi8255_w)
97101{
98   return ppi8255_1_r(machine, offset >> 2);
102   ppi8255_w(device, offset >> 2, data);
99103}
100104
101static WRITE8_HANDLER(scobra_type2_ppi8255_0_w)
105static READ8_DEVICE_HANDLER(hustler_ppi8255_r)
102106{
103   ppi8255_0_w(machine, offset >> 2, data);
107   return ppi8255_r(device, offset >> 3);
104108}
105109
106static WRITE8_HANDLER(scobra_type2_ppi8255_1_w)
110static WRITE8_DEVICE_HANDLER(hustler_ppi8255_w)
107111{
108   ppi8255_1_w(machine, offset >> 2, data);
112   ppi8255_w(device, offset >> 3, data);
109113}
110114
111static READ8_HANDLER(hustler_ppi8255_0_r)
112{
113   return ppi8255_0_r(machine, offset >> 3);
114}
115
116static READ8_HANDLER(hustler_ppi8255_1_r)
117{
118   return ppi8255_1_r(machine, offset >> 3);
119}
120
121static WRITE8_HANDLER(hustler_ppi8255_0_w)
122{
123   ppi8255_0_w(machine, offset >> 3, data);
124}
125
126static WRITE8_HANDLER(hustler_ppi8255_1_w)
127{
128   ppi8255_1_w(machine, offset >> 3, data);
129}
130
131115static ADDRESS_MAP_START( type1_readmem, ADDRESS_SPACE_PROGRAM, 8 )
132116   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
133117   AM_RANGE(0x8000, 0x8bff) AM_READ(SMH_RAM)
134118   AM_RANGE(0x8c00, 0x8fff) AM_READ(galaxold_videoram_r)   /* mirror */
135119   AM_RANGE(0x9000, 0x90ff) AM_READ(SMH_RAM)
136   AM_RANGE(0x9800, 0x9803) AM_READ(ppi8255_0_r)
137   AM_RANGE(0xa000, 0xa003) AM_READ(ppi8255_1_r)
120   AM_RANGE(0x9800, 0x9803) AM_DEVREAD(PPI8255, "ppi8255_0", ppi8255_r)
121   AM_RANGE(0xa000, 0xa003) AM_DEVREAD(PPI8255, "ppi8255_1", ppi8255_r)
138122   AM_RANGE(0xb000, 0xb000) AM_READ(watchdog_reset_r)
139123ADDRESS_MAP_END
140124
r2454r2455
147131   AM_RANGE(0x9040, 0x905f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
148132   AM_RANGE(0x9060, 0x907f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
149133   AM_RANGE(0x9080, 0x90ff) AM_WRITE(SMH_RAM)
150   AM_RANGE(0x9800, 0x9803) AM_WRITE(ppi8255_0_w)
151   AM_RANGE(0xa000, 0xa003) AM_WRITE(ppi8255_1_w)
134   AM_RANGE(0x9800, 0x9803) AM_DEVWRITE(PPI8255, "ppi8255_0", ppi8255_w)
135   AM_RANGE(0xa000, 0xa003) AM_DEVWRITE(PPI8255, "ppi8255_1", ppi8255_w)
152136   AM_RANGE(0xa801, 0xa801) AM_WRITE(galaxold_nmi_enable_w)
153137   AM_RANGE(0xa802, 0xa802) AM_WRITE(galaxold_coin_counter_w)
154138   AM_RANGE(0xa804, 0xa804) AM_WRITE(galaxold_stars_enable_w)
r2454r2455
162146   AM_RANGE(0x9000, 0x93ff) AM_READ(SMH_RAM)
163147   AM_RANGE(0x9400, 0x97ff) AM_READ(galaxold_videoram_r)   /* mirror */
164148   AM_RANGE(0x9800, 0x9800) AM_READ(watchdog_reset_r)
165   AM_RANGE(0xa000, 0xa00f) AM_READ(scobra_type2_ppi8255_0_r)
166   AM_RANGE(0xa800, 0xa80f) AM_READ(scobra_type2_ppi8255_1_r)
149   AM_RANGE(0xa000, 0xa00f) AM_DEVREAD(PPI8255, "ppi8255_0", scobra_type2_ppi8255_r)
150   AM_RANGE(0xa800, 0xa80f) AM_DEVREAD(PPI8255, "ppi8255_1", scobra_type2_ppi8255_r)
167151ADDRESS_MAP_END
168152
169153static ADDRESS_MAP_START( type2_writemem, ADDRESS_SPACE_PROGRAM, 8 )
r2454r2455
175159   AM_RANGE(0x8880, 0x88ff) AM_WRITE(SMH_RAM)
176160   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
177161   AM_RANGE(0x9400, 0x97ff) AM_WRITE(galaxold_videoram_w)   /* mirror */
178   AM_RANGE(0xa000, 0xa00f) AM_WRITE(scobra_type2_ppi8255_0_w)
179   AM_RANGE(0xa800, 0xa80f) AM_WRITE(scobra_type2_ppi8255_1_w)
162   AM_RANGE(0xa000, 0xa00f) AM_DEVWRITE(PPI8255, "ppi8255_0", scobra_type2_ppi8255_w)
163   AM_RANGE(0xa800, 0xa80f) AM_DEVWRITE(PPI8255, "ppi8255_1", scobra_type2_ppi8255_w)
180164   AM_RANGE(0xb000, 0xb000) AM_WRITE(galaxold_stars_enable_w)
181165   AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxold_nmi_enable_w)
182166   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxold_coin_counter_0_w)
r2454r2455
190174   AM_RANGE(0x8000, 0x8bff) AM_READ(SMH_RAM)
191175   AM_RANGE(0x9000, 0x90ff) AM_READ(SMH_RAM)
192176   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
193   AM_RANGE(0xd000, 0xd01f) AM_READ(hustler_ppi8255_0_r)
194   AM_RANGE(0xe000, 0xe01f) AM_READ(hustler_ppi8255_1_r)
177   AM_RANGE(0xd000, 0xd01f) AM_DEVREAD(PPI8255, "ppi8255_0", hustler_ppi8255_r)
178   AM_RANGE(0xe000, 0xe01f) AM_DEVREAD(PPI8255, "ppi8255_1", hustler_ppi8255_r)
195179ADDRESS_MAP_END
196180
197181static ADDRESS_MAP_START( hustler_writemem, ADDRESS_SPACE_PROGRAM, 8 )
r2454r2455
206190   AM_RANGE(0xa804, 0xa804) AM_WRITE(galaxold_nmi_enable_w)
207191   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_y_w)
208192   AM_RANGE(0xa80e, 0xa80e) AM_WRITE(SMH_NOP)   /* coin counters */
209   AM_RANGE(0xd000, 0xd01f) AM_WRITE(hustler_ppi8255_0_w)
210   AM_RANGE(0xe000, 0xe01f) AM_WRITE(hustler_ppi8255_1_w)
193   AM_RANGE(0xd000, 0xd01f) AM_DEVWRITE(PPI8255, "ppi8255_0", hustler_ppi8255_w)
194   AM_RANGE(0xe000, 0xe01f) AM_DEVWRITE(PPI8255, "ppi8255_1", hustler_ppi8255_w)
211195ADDRESS_MAP_END
212196
213197static ADDRESS_MAP_START( hustlerb_readmem, ADDRESS_SPACE_PROGRAM, 8 )
r2454r2455
215199   AM_RANGE(0x8000, 0x8bff) AM_READ(SMH_RAM)
216200   AM_RANGE(0x9000, 0x90ff) AM_READ(SMH_RAM)
217201   AM_RANGE(0xb000, 0xb000) AM_READ(watchdog_reset_r)
218   AM_RANGE(0xc100, 0xc103) AM_READ(ppi8255_0_r)
219   AM_RANGE(0xc200, 0xc203) AM_READ(ppi8255_1_r)
202   AM_RANGE(0xc100, 0xc103) AM_DEVREAD(PPI8255, "ppi8255_0", ppi8255_r)
203   AM_RANGE(0xc200, 0xc203) AM_DEVREAD(PPI8255, "ppi8255_1", ppi8255_r)
220204ADDRESS_MAP_END
221205
222206static ADDRESS_MAP_START( hustlerb_writemem, ADDRESS_SPACE_PROGRAM, 8 )
r2454r2455
231215   AM_RANGE(0xa802, 0xa802) AM_WRITE(SMH_NOP)   /* coin counters */
232216   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_y_w)
233217   AM_RANGE(0xa807, 0xa807) AM_WRITE(galaxold_flip_screen_x_w)
234   AM_RANGE(0xc100, 0xc103) AM_WRITE(ppi8255_0_w)
235   AM_RANGE(0xc200, 0xc203) AM_WRITE(ppi8255_1_w)
218   AM_RANGE(0xc100, 0xc103) AM_DEVWRITE(PPI8255, "ppi8255_0", ppi8255_w)
219   AM_RANGE(0xc200, 0xc203) AM_DEVWRITE(PPI8255, "ppi8255_1", ppi8255_w)
236220ADDRESS_MAP_END
237221
238222static ADDRESS_MAP_START( mimonkey_readmem, ADDRESS_SPACE_PROGRAM, 8 )
r2454r2455
240224   AM_RANGE(0x8000, 0x8bff) AM_READ(SMH_RAM)
241225   AM_RANGE(0x8c00, 0x8fff) AM_READ(galaxold_videoram_r)   /* mirror */
242226   AM_RANGE(0x9000, 0x90ff) AM_READ(SMH_RAM)
243   AM_RANGE(0x9800, 0x9803) AM_READ(ppi8255_0_r)
244   AM_RANGE(0xa000, 0xa003) AM_READ(ppi8255_1_r)
227   AM_RANGE(0x9800, 0x9803) AM_DEVREAD(PPI8255, "ppi8255_0", ppi8255_r)
228   AM_RANGE(0xa000, 0xa003) AM_DEVREAD(PPI8255, "ppi8255_1", ppi8255_r)
245229   AM_RANGE(0xb000, 0xb000) AM_READ(watchdog_reset_r)
246230   AM_RANGE(0xc000, 0xffff) AM_READ(SMH_ROM)
247231ADDRESS_MAP_END
r2454r2455
255239   AM_RANGE(0x9040, 0x905f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
256240   AM_RANGE(0x9060, 0x907f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
257241   AM_RANGE(0x9080, 0x90ff) AM_WRITE(SMH_RAM)
258   AM_RANGE(0x9800, 0x9803) AM_WRITE(ppi8255_0_w)
259   AM_RANGE(0xa000, 0xa003) AM_WRITE(ppi8255_1_w)
242   AM_RANGE(0x9800, 0x9803) AM_DEVWRITE(PPI8255, "ppi8255_0", ppi8255_w)
243   AM_RANGE(0xa000, 0xa003) AM_DEVWRITE(PPI8255, "ppi8255_1", ppi8255_w)
260244   AM_RANGE(0xa801, 0xa801) AM_WRITE(galaxold_nmi_enable_w)
261245   AM_RANGE(0xa800, 0xa802) AM_WRITE(galaxold_gfxbank_w)
262246   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_x_w)
r2454r2455
265249ADDRESS_MAP_END
266250
267251
268static READ8_HANDLER( anteatg_ppi8255_0_reg0_r )
252static READ8_DEVICE_HANDLER( anteatg_ppi8255_0_reg0_r )
269253{
270   return ppi8255_0_r(machine, 0);
254   return ppi8255_r(device, 0);
271255}
272256
273static READ8_HANDLER( anteatg_ppi8255_0_reg1_r )
257static READ8_DEVICE_HANDLER( anteatg_ppi8255_0_reg1_r )
274258{
275   return ppi8255_0_r(machine, 1);
259   return ppi8255_r(device, 1);
276260}
277261
278static READ8_HANDLER( anteatg_ppi8255_0_reg2_r )
262static READ8_DEVICE_HANDLER( anteatg_ppi8255_0_reg2_r )
279263{
280   return ppi8255_0_r(machine, 2);
264   return ppi8255_r(device, 2);
281265}
282266
283static READ8_HANDLER( anteatg_ppi8255_0_reg3_r )
267static READ8_DEVICE_HANDLER( anteatg_ppi8255_0_reg3_r )
284268{
285   return ppi8255_0_r(machine, 3);
269   return ppi8255_r(device, 3);
286270}
287271
288static WRITE8_HANDLER( anteatg_ppi8255_0_reg0_w )
272static WRITE8_DEVICE_HANDLER( anteatg_ppi8255_0_reg0_w )
289273{
290   ppi8255_0_w(machine, 0, data);
274   ppi8255_w(device, 0, data);
291275}
292276
293static WRITE8_HANDLER( anteatg_ppi8255_0_reg1_w )
277static WRITE8_DEVICE_HANDLER( anteatg_ppi8255_0_reg1_w )
294278{
295   ppi8255_0_w(machine, 1, data);
279   ppi8255_w(device, 1, data);
296280}
297281
298static WRITE8_HANDLER( anteatg_ppi8255_0_reg2_w )
282static WRITE8_DEVICE_HANDLER( anteatg_ppi8255_0_reg2_w )
299283{
300   ppi8255_0_w(machine, 2, data);
284   ppi8255_w(device, 2, data);
301285}
302286
303static WRITE8_HANDLER( anteatg_ppi8255_0_reg3_w )
287static WRITE8_DEVICE_HANDLER( anteatg_ppi8255_0_reg3_w )
304288{
305   ppi8255_0_w(machine, 3, data);
289   ppi8255_w(device, 3, data);
306290}
307291
308static WRITE8_HANDLER( anteatg_ppi8255_1_reg0_w )
292static WRITE8_DEVICE_HANDLER( anteatg_ppi8255_1_reg0_w )
309293{
310   ppi8255_1_w(machine, 0, data);
294   ppi8255_w(device, 0, data);
311295}
312296
313static WRITE8_HANDLER( anteatg_ppi8255_1_reg1_w )
297static WRITE8_DEVICE_HANDLER( anteatg_ppi8255_1_reg1_w )
314298{
315   ppi8255_1_w(machine, 1, data);
299   ppi8255_w(device, 1, data);
316300}
317301
318static WRITE8_HANDLER( anteatg_ppi8255_1_reg3_w )
302static WRITE8_DEVICE_HANDLER( anteatg_ppi8255_1_reg3_w )
319303{
320   ppi8255_1_w(machine, 3, data);
304   ppi8255_w(device, 3, data);
321305}
322306
323307static ADDRESS_MAP_START( anteatg_readmem, ADDRESS_SPACE_PROGRAM, 8 )
r2454r2455
330314   AM_RANGE(0x8300, 0x98ff) AM_READ(SMH_ROM)
331315   AM_RANGE(0xa300, 0xa7ff) AM_READ(SMH_ROM)
332316   AM_RANGE(0xf521, 0xf521) AM_READ(watchdog_reset_r)
333   AM_RANGE(0xf612, 0xf612) AM_READ(anteatg_ppi8255_0_reg0_r)
334   AM_RANGE(0xf631, 0xf631) AM_READ(anteatg_ppi8255_0_reg1_r)
335   AM_RANGE(0xf710, 0xf710) AM_READ(anteatg_ppi8255_0_reg2_r)
336   AM_RANGE(0xf753, 0xf753) AM_READ(anteatg_ppi8255_0_reg3_r)
317   AM_RANGE(0xf612, 0xf612) AM_DEVREAD(PPI8255, "ppi8255_0", anteatg_ppi8255_0_reg0_r)
318   AM_RANGE(0xf631, 0xf631) AM_DEVREAD(PPI8255, "ppi8255_0", anteatg_ppi8255_0_reg1_r)
319   AM_RANGE(0xf710, 0xf710) AM_DEVREAD(PPI8255, "ppi8255_0", anteatg_ppi8255_0_reg2_r)
320   AM_RANGE(0xf753, 0xf753) AM_DEVREAD(PPI8255, "ppi8255_0", anteatg_ppi8255_0_reg3_r)
337321ADDRESS_MAP_END
338322
339323static ADDRESS_MAP_START( anteatg_writemem, ADDRESS_SPACE_PROGRAM, 8 )
r2454r2455
344328   AM_RANGE(0x2040, 0x205f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
345329   AM_RANGE(0x2060, 0x207f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
346330   AM_RANGE(0x2080, 0x20ff) AM_WRITE(SMH_RAM)
347   AM_RANGE(0x2423, 0x2423) AM_WRITE(anteatg_ppi8255_1_reg3_w)
348   AM_RANGE(0x2450, 0x2450) AM_WRITE(anteatg_ppi8255_1_reg0_w)
349   AM_RANGE(0x2511, 0x2511) AM_WRITE(anteatg_ppi8255_1_reg1_w)
331   AM_RANGE(0x2423, 0x2423) AM_DEVWRITE(PPI8255, "ppi8255_1", anteatg_ppi8255_1_reg3_w)
332   AM_RANGE(0x2450, 0x2450) AM_DEVWRITE(PPI8255, "ppi8255_1", anteatg_ppi8255_1_reg0_w)
333   AM_RANGE(0x2511, 0x2511) AM_DEVWRITE(PPI8255, "ppi8255_1", anteatg_ppi8255_1_reg1_w)
350334   AM_RANGE(0x2621, 0x2621) AM_WRITE(galaxold_nmi_enable_w)
351335   AM_RANGE(0x2624, 0x2624) AM_WRITE(galaxold_stars_enable_w)
352336   AM_RANGE(0x2647, 0x2647) AM_WRITE(galaxold_flip_screen_y_w)
r2454r2455
358342   AM_RANGE(0x7c00, 0x7fff) AM_WRITE(galaxold_videoram_w)   /* mirror */
359343   AM_RANGE(0x8300, 0x98ff) AM_WRITE(SMH_ROM)
360344   AM_RANGE(0xa300, 0xa7ff) AM_WRITE(SMH_ROM)
361   AM_RANGE(0xf612, 0xf612) AM_WRITE(anteatg_ppi8255_0_reg0_w)
362   AM_RANGE(0xf631, 0xf631) AM_WRITE(anteatg_ppi8255_0_reg1_w)
363   AM_RANGE(0xf710, 0xf710) AM_WRITE(anteatg_ppi8255_0_reg2_w)
364   AM_RANGE(0xf753, 0xf753) AM_WRITE(anteatg_ppi8255_0_reg3_w)
345   AM_RANGE(0xf612, 0xf612) AM_DEVWRITE(PPI8255, "ppi8255_0", anteatg_ppi8255_0_reg0_w)
346   AM_RANGE(0xf631, 0xf631) AM_DEVWRITE(PPI8255, "ppi8255_0", anteatg_ppi8255_0_reg1_w)
347   AM_RANGE(0xf710, 0xf710) AM_DEVWRITE(PPI8255, "ppi8255_0", anteatg_ppi8255_0_reg2_w)
348   AM_RANGE(0xf753, 0xf753) AM_DEVWRITE(PPI8255, "ppi8255_0", anteatg_ppi8255_0_reg3_w)
365349ADDRESS_MAP_END
366350
367351static ADDRESS_MAP_START( anteatgb_readmem, ADDRESS_SPACE_PROGRAM, 8 )
r2454r2455
373357   AM_RANGE(0x6400, 0x7aff) AM_READ(SMH_ROM)
374358   AM_RANGE(0x8300, 0x98ff) AM_READ(SMH_ROM)
375359   AM_RANGE(0xa300, 0xa7ff) AM_READ(SMH_ROM)
376   AM_RANGE(0xf300, 0xf303) AM_READ(ppi8255_0_r)
377   AM_RANGE(0xfe00, 0xfe03) AM_READ(ppi8255_1_r)
360   AM_RANGE(0xf300, 0xf303) AM_DEVREAD(PPI8255, "ppi8255_0", ppi8255_r)
361   AM_RANGE(0xfe00, 0xfe03) AM_DEVREAD(PPI8255, "ppi8255_1", ppi8255_r)
378362ADDRESS_MAP_END
379363
380364static ADDRESS_MAP_START( anteatgb_writemem, ADDRESS_SPACE_PROGRAM, 8 )
r2454r2455
395379   AM_RANGE(0x6400, 0x7aff) AM_WRITE(SMH_ROM)
396380   AM_RANGE(0x8300, 0x98ff) AM_WRITE(SMH_ROM)
397381   AM_RANGE(0xa300, 0xa7ff) AM_WRITE(SMH_ROM)
398   AM_RANGE(0xf300, 0xf303) AM_WRITE(ppi8255_0_w)
399   AM_RANGE(0xfe00, 0xfe03) AM_WRITE(ppi8255_1_w)
382   AM_RANGE(0xf300, 0xf303) AM_DEVWRITE(PPI8255, "ppi8255_0", ppi8255_w)
383   AM_RANGE(0xfe00, 0xfe03) AM_DEVWRITE(PPI8255, "ppi8255_1", ppi8255_w)
400384ADDRESS_MAP_END
401385
402386static UINT8 *scobra_soundram;
r2454r2455
13751359
13761360static const struct AY8910interface scobra_ay8910_interface_2 =
13771361{
1362   AY8910_LEGACY_OUTPUT,
1363   AY8910_DEFAULT_LOADS,
13781364   soundlatch_r,
1379   scramble_portB_r
1365   scramble_portB_r,
1366   NULL,
1367   NULL
13801368};
13811369
13821370
r2454r2455
13931381
13941382   MDRV_MACHINE_RESET(scramble)
13951383
1384   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
1385   MDRV_DEVICE_CONFIG( scramble_ppi_ppi8255_intf[0] )
1386
1387   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
1388   MDRV_DEVICE_CONFIG( scramble_ppi_ppi8255_intf[1] )
1389
13961390   /* video hardware */
13971391   MDRV_SCREEN_ADD("main", RASTER)
13981392   MDRV_SCREEN_REFRESH_RATE(16000.0/132/2)
r2454r2455
14191413MACHINE_DRIVER_END
14201414
14211415
1416static MACHINE_DRIVER_START( superbon )
1417   /* basic machine hardware */
1418   MDRV_IMPORT_FROM(type1)
1419
1420   /* device config overrides */
1421   MDRV_DEVICE_MODIFY( "ppi8255_0", PPI8255 )
1422   MDRV_DEVICE_CONFIG( scramble_ppi8255_intf[0] )
1423
1424   MDRV_DEVICE_MODIFY( "ppi8255_1", PPI8255 )
1425   MDRV_DEVICE_CONFIG( scramble_ppi8255_intf[1] )
1426MACHINE_DRIVER_END
1427
14221428/* same as regular type 1, the only difference that it has long bullets */
14231429static MACHINE_DRIVER_START( armorcar )
14241430
r2454r2455
14391445   /* basic machine hardware */
14401446   MDRV_IMPORT_FROM(type1)
14411447
1448   /* device config overrides */
1449   MDRV_DEVICE_MODIFY( "ppi8255_0", PPI8255 )
1450   MDRV_DEVICE_CONFIG( moonwar_ppi8255_intf[0] )
1451
1452   MDRV_DEVICE_MODIFY( "ppi8255_1", PPI8255 )
1453   MDRV_DEVICE_CONFIG( moonwar_ppi8255_intf[1] )
1454
14421455   /* video hardware */
14431456   MDRV_PALETTE_LENGTH(32+64+2+1)   /* 32 for characters, 64 for stars, 2 for bullets, 1 for bg */
14441457
r2454r2455
15161529   /* basic machine hardware */
15171530   MDRV_IMPORT_FROM(type2)
15181531
1532   /* device config overrides */
1533   MDRV_DEVICE_MODIFY( "ppi8255_0", PPI8255 )
1534   MDRV_DEVICE_CONFIG( stratgyx_ppi8255_intf[0] )
1535
1536   MDRV_DEVICE_MODIFY( "ppi8255_1", PPI8255 )
1537   MDRV_DEVICE_CONFIG( stratgyx_ppi8255_intf[1] )
1538
15191539   /* video hardware */
15201540   MDRV_PALETTE_LENGTH(32+64+2+8)   /* 32 for characters, 64 for stars, 2 for bullets, 8 for background */
15211541
r2454r2455
15291549   /* basic machine hardware */
15301550   MDRV_IMPORT_FROM(type2)
15311551
1552   /* device config overrides */
1553   MDRV_DEVICE_MODIFY( "ppi8255_0", PPI8255 )
1554   MDRV_DEVICE_CONFIG( darkplnt_ppi8255_intf[0] )
1555
1556   MDRV_DEVICE_MODIFY( "ppi8255_1", PPI8255 )
1557   MDRV_DEVICE_CONFIG( darkplnt_ppi8255_intf[1] )
1558
15321559   /* video hardware */
15331560   MDRV_PALETTE_LENGTH(32+64+2) /* 32 for characters, 64 (buffer) for stars, 2 for bullets */
15341561
r2454r2455
15501577
15511578   MDRV_MACHINE_RESET(scramble)
15521579
1580   /* device config overrides */
1581   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
1582   MDRV_DEVICE_CONFIG( scramble_ppi_ppi8255_intf[0] )
1583
1584   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
1585   MDRV_DEVICE_CONFIG( scramble_ppi_ppi8255_intf[1] )
1586
15531587   /* video hardware */
15541588   MDRV_SCREEN_ADD("main", RASTER)
15551589   MDRV_SCREEN_REFRESH_RATE(16000.0/132/2)
src/mame/drivers/gaelco3d.c
r2454r2455
250250
251251static WRITE16_HANDLER( irq_ack_w )
252252{
253   cpunum_set_input_line(Machine, 0, 2, CLEAR_LINE);
253   cpunum_set_input_line(machine, 0, 2, CLEAR_LINE);
254254}
255255
256256
r2454r2455
309309
310310static WRITE16_HANDLER( sound_data_w )
311311{
312   logerror("%06X:sound_data_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
312   logerror("%06X:sound_data_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask);
313313   if (ACCESSING_BITS_0_7)
314314      timer_call_after_resynch(NULL, data & 0xff, delayed_sound_w);
315315}
r2454r2455
367367      }
368368   }
369369   else
370      logerror("%06X:analog_port_clock_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
370      logerror("%06X:analog_port_clock_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask);
371371}
372372
373373
r2454r2455
385385      }
386386   }
387387   else
388      logerror("%06X:analog_port_latch_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
388      logerror("%06X:analog_port_latch_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask);
389389}
390390
391391
r2454r2455
427427{
428428   /* this is set to 0 while data is uploaded, then set to $ffff after it is done */
429429   /* it does not ever appear to be touched after that */
430   logerror("%06X:tms_reset_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
430   logerror("%06X:tms_reset_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask);
431431      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data == 0xffff) ? CLEAR_LINE : ASSERT_LINE);
432432}
433433
r2454r2455
436436{
437437   /* this is written twice, 0,1, in quick succession */
438438   /* done after uploading, and after modifying the comm area */
439   logerror("%06X:tms_irq_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
439   logerror("%06X:tms_irq_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask);
440440   if (ACCESSING_BITS_0_7)
441441      cpunum_set_input_line(machine, 1, 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
442442}
r2454r2455
444444
445445static WRITE16_HANDLER( tms_control3_w )
446446{
447   logerror("%06X:tms_control3_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
447   logerror("%06X:tms_control3_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask);
448448}
449449
450450
451451static WRITE16_HANDLER( tms_comm_w )
452452{
453453   COMBINE_DATA(&tms_comm_base[offset ^ tms_offset_xor]);
454   logerror("%06X:tms_comm_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset*2, data, ~mem_mask);
454   logerror("%06X:tms_comm_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset*2, data, mem_mask);
455455}
456456
457457
r2454r2455
650650   if (ACCESSING_BITS_0_7)
651651      logerror("%06X:unknown_107_w = %02X\n", activecpu_get_pc(), data & 0xff);
652652   else
653      logerror("%06X:unknown_107_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
653      logerror("%06X:unknown_107_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask);
654654}
655655
656656static WRITE32_HANDLER( unknown_127_w )
r2454r2455
659659   if (ACCESSING_BITS_0_7)
660660      logerror("%06X:unknown_127_w = %02X\n", activecpu_get_pc(), data & 0xff);
661661   else
662      logerror("%06X:unknown_127_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
662      logerror("%06X:unknown_127_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask);
663663}
664664
665665static WRITE32_HANDLER( unknown_137_w )
r2454r2455
668668   if (ACCESSING_BITS_0_7)
669669      logerror("%06X:unknown_137_w = %02X\n", activecpu_get_pc(), data & 0xff);
670670   else
671      logerror("%06X:unknown_137_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
671      logerror("%06X:unknown_137_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask);
672672}
673673
674674static WRITE32_HANDLER( unknown_13a_w )
r2454r2455
677677   if (ACCESSING_BITS_0_15)
678678      logerror("%06X:unknown_13a_w = %04X\n", activecpu_get_pc(), data & 0xffff);
679679   else
680      logerror("%06X:unknown_13a_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
680      logerror("%06X:unknown_13a_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask);
681681}
682682
683683
src/mame/drivers/itech8.c
r2454r2455
592592static WRITE8_HANDLER( itech8_nmi_ack_w )
593593{
594594/* doesn't seem to hold for every game (e.g., hstennis) */
595/*  cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);*/
595/*  cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE);*/
596596}
597597
598598
r2454r2455
803803
804804static READ8_HANDLER( sound_data_r )
805805{
806   cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, CLEAR_LINE);
806   cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, CLEAR_LINE);
807807   return sound_data;
808808}
809809
r2454r2455
16831683
16841684static const struct YM2203interface ym2203_interface =
16851685{
1686   0,
1687   0,
1688   0,
1689   ym2203_portb_out,
1686   {
1687      AY8910_LEGACY_OUTPUT,
1688      AY8910_DEFAULT_LOADS,
1689      NULL,
1690      NULL,
1691      NULL,
1692      ym2203_portb_out,
1693   },
16901694   generate_sound_irq
16911695};
16921696
src/mame/drivers/galaxian.c
r2454r2455
281281
282282static WRITE8_HANDLER( konami_ay8910_w )
283283{
284   /* the decoding here is very simplistic, and you can address all four simultaneously */
285   if (offset & 0x10) AY8910_control_port_0_w(machine, 0, data);
286   if (offset & 0x20) AY8910_write_port_0_w(machine, 0, data);
287   if (offset & 0x40) AY8910_control_port_1_w(machine, 0, data);
288   if (offset & 0x80) AY8910_write_port_1_w(machine, 0, data);
284   /* the decoding here is very simplistic, and you can address two simultaneously */
285   if (offset & 0x10)
286      AY8910_control_port_0_w(machine, 0, data);
287   else if (offset & 0x20)
288      AY8910_write_port_0_w(machine, 0, data);
289
290   if (offset & 0x40)
291      AY8910_control_port_1_w(machine, 0, data);
292   else if (offset & 0x80)
293      AY8910_write_port_1_w(machine, 0, data);
289294}
290295
291296
r2454r2455
352357
353358            /* low bit goes to 0.22uF capacitor = 220000pF  */
354359            /* high bit goes to 0.047uF capacitor = 47000pF */
355            discrete_sound_w(machine, NODE(3 * which + chan + 11), bits);
360            discrete_sound_w(machine, NODE(3 * (1-which) + chan + 11), bits);
356361         }
357362}
358363
r2454r2455
397402}
398403
399404
400static const ppi8255_interface konami_ppi8255_intf =
405static const ppi8255_interface konami_ppi8255_intf[2] =
401406{
402   2,
403   { konami_porta_0_r, NULL },            /* Port A read */
404   { konami_portb_0_r, NULL },            /* Port B read */
405   { konami_portc_0_r, konami_portc_1_r },   /* Port C read */
406   { NULL, soundlatch_w },               /* Port A write */
407   { NULL, konami_sound_control_w },      /* Port B write */
408   { konami_portc_0_w, konami_portc_1_w }, /* Port C write */
407   {
408      konami_porta_0_r,            /* Port A read */
409      konami_portb_0_r,            /* Port B read */
410      konami_portc_0_r,            /* Port C read */
411      NULL,                     /* Port A write */
412      NULL,                     /* Port B write */
413      konami_portc_0_w            /* Port C write */
414   },
415   {
416      NULL,                     /* Port A read */
417      NULL,                     /* Port B read */
418      konami_portc_1_r,            /* Port C read */
419      soundlatch_w,               /* Port A write */
420      konami_sound_control_w,         /* Port B write */
421      konami_portc_1_w            /* Port C write */
422   }
409423};
410424
411425
r2454r2455
420434{
421435   /* the decoding here is very simplistic, and you can address both simultaneously */
422436   UINT8 result = 0xff;
423   if (offset & 0x0100) result &= ppi8255_0_r(machine, offset & 3);
424   if (offset & 0x0200) result &= ppi8255_1_r(machine, offset & 3);
437   if (offset & 0x0100) result &= ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), offset & 3);
438   if (offset & 0x0200) result &= ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset & 3);
425439   return result;
426440}
427441
r2454r2455
429443static WRITE8_HANDLER( theend_ppi8255_w )
430444{
431445   /* the decoding here is very simplistic, and you can address both simultaneously */
432   if (offset & 0x0100) ppi8255_0_w(machine, offset & 3, data);
433   if (offset & 0x0200) ppi8255_1_w(machine, offset & 3, data);
446   if (offset & 0x0100) ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), offset & 3, data);
447   if (offset & 0x0200) ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset & 3, data);
434448}
435449
436450
r2454r2455
440454}
441455
442456
457static const ppi8255_interface theend_ppi8255_intf[2] =
458{
459   {
460      konami_porta_0_r,            /* Port A read */
461      konami_portb_0_r,            /* Port B read */
462      konami_portc_0_r,            /* Port C read */
463      NULL,                     /* Port A write */
464      NULL,                     /* Port B write */
465      theend_coin_counter_w         /* Port C write */
466   },
467   {
468      NULL,                     /* Port A read */
469      NULL,                     /* Port B read */
470      konami_portc_1_r,            /* Port C read */
471      soundlatch_w,               /* Port A write */
472      konami_sound_control_w,         /* Port B write */
473      konami_portc_1_w            /* Port C write */
474   }
475};
443476
477
478
444479/*************************************
445480 *
446481 *  Scramble I/O
r2454r2455
488523}
489524
490525
526static const ppi8255_interface scramble_ppi8255_intf[2] =
527{
528   {
529      konami_porta_0_r,            /* Port A read */
530      konami_portb_0_r,            /* Port B read */
531      konami_portc_0_r,            /* Port C read */
532      NULL,                     /* Port A write */
533      NULL,                     /* Port B write */
534      konami_portc_0_w            /* Port C write */
535   },
536   {
537      NULL,                     /* Port A read */
538      NULL,                     /* Port B read */
539      scramble_protection_r,         /* Port C read */
540      soundlatch_w,               /* Port A write */
541      konami_sound_control_w,         /* Port B write */
542      scramble_protection_w         /* Port C write */
543   }
544};
491545
546
492547/*************************************
493548 *
494549 *  Explorer I/O
r2454r2455
519574{
520575   /* the decoding here is very simplistic, and you can address both simultaneously */
521576   UINT8 result = 0xff;
522   if (offset & 0x04) result &= ppi8255_2_r(machine, offset & 3);
577   if (offset & 0x04) result &= ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_2" ), offset & 3);
523578   return result;
524579}
525580
r2454r2455
527582static WRITE8_HANDLER( sfx_sample_io_w )
528583{
529584   /* the decoding here is very simplistic, and you can address both simultaneously */
530   if (offset & 0x04) ppi8255_2_w(machine, offset & 3, data);
585   if (offset & 0x04) ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_2" ), offset & 3, data);
531586   if (offset & 0x10) DAC_0_signed_data_w(machine, offset, data);
532587}
533588
r2454r2455
544599}
545600
546601
547static const ppi8255_interface sfx_ppi8255_intf =
602static const ppi8255_interface sfx_ppi8255_intf[3] =
548603{
549   3,
550   { konami_porta_0_r, NULL, soundlatch2_r },      /* Port A read */
551   { konami_portb_0_r, NULL, NULL },            /* Port B read */
552   { konami_portc_0_r, konami_portc_1_r, NULL },   /* Port C read */
553   { NULL, soundlatch_w, NULL },               /* Port A write */
554   { NULL, konami_sound_control_w, NULL },         /* Port B write */
555   { konami_portc_0_w, konami_portc_1_w, NULL },   /* Port C write */
604   {
605      konami_porta_0_r,            /* Port A read */
606      konami_portb_0_r,            /* Port B read */
607      konami_portc_0_r,            /* Port C read */
608      NULL,                     /* Port A write */
609      NULL,                     /* Port B write */
610      konami_portc_0_w            /* Port C write */
611   },
612   {
613      NULL,                     /* Port A read */
614      NULL,                     /* Port B read */
615      konami_portc_1_r,            /* Port C read */
616      soundlatch_w,               /* Port A write */
617      konami_sound_control_w,         /* Port B write */
618      konami_portc_1_w            /* Port C write */
619   },
620   {
621      soundlatch2_r,               /* Port A read */
622      NULL,                     /* Port B read */
623      NULL,                     /* Port C read */
624      NULL,                     /* Port A write */
625      NULL,                     /* Port B write */
626      NULL                     /* Port C write */
627   }
556628};
557629
558630
r2454r2455
567639{
568640   /* the decoding here is very simplistic, and you can address both simultaneously */
569641   UINT8 result = 0xff;
570   if (offset & 0x1000) result &= ppi8255_1_r(machine, (offset >> 1) & 3);
571   if (offset & 0x2000) result &= ppi8255_0_r(machine, (offset >> 1) & 3);
642   if (offset & 0x1000) result &= ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), (offset >> 1) & 3);
643   if (offset & 0x2000) result &= ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), (offset >> 1) & 3);
572644   return result;
573645}
574646
r2454r2455
576648static WRITE8_HANDLER( frogger_ppi8255_w )
577649{
578650   /* the decoding here is very simplistic, and you can address both simultaneously */
579   if (offset & 0x1000) ppi8255_1_w(machine, (offset >> 1) & 3, data);
580   if (offset & 0x2000) ppi8255_0_w(machine, (offset >> 1) & 3, data);
651   if (offset & 0x1000) ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), (offset >> 1) & 3, data);
652   if (offset & 0x2000) ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), (offset >> 1) & 3, data);
581653}
582654
583655
r2454r2455
592664
593665static WRITE8_HANDLER( frogger_ay8910_w )
594666{
595   /* the decoding here is very simplistic, and you can address both simultaneously */
596   if (offset & 0x80) AY8910_control_port_0_w(machine, 0, data);
597   if (offset & 0x40) AY8910_write_port_0_w(machine, 0, data);
667   /* the decoding here is very simplistic */
668   if (offset & 0x40)
669      AY8910_write_port_0_w(machine, 0, data);
670   else if (offset & 0x80)
671      AY8910_control_port_0_w(machine, 0, data);
598672}
599673
600674
r2454r2455
623697{
624698   /* the decoding here is very simplistic, and you can address both simultaneously */
625699   UINT8 result = 0xff;
626   if (offset & 0x1000) result &= ppi8255_0_r(machine, (offset >> 3) & 3);
627   if (offset & 0x2000) result &= ppi8255_1_r(machine, (offset >> 3) & 3);
700   if (offset & 0x1000) result &= ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), (offset >> 3) & 3);
701   if (offset & 0x2000) result &= ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), (offset >> 3) & 3);
628702   return result;
629703}
630704
r2454r2455
632706static WRITE8_HANDLER( frogf_ppi8255_w )
633707{
634708   /* the decoding here is very simplistic, and you can address both simultaneously */
635   if (offset & 0x1000) ppi8255_0_w(machine, (offset >> 3) & 3, data);
636   if (offset & 0x2000) ppi8255_1_w(machine, (offset >> 3) & 3, data);
709   if (offset & 0x1000) ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), (offset >> 3) & 3, data);
710   if (offset & 0x2000) ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), (offset >> 3) & 3, data);
637711}
638712
639713
r2454r2455
644718 *
645719 *************************************/
646720
647static READ8_HANDLER( turtles_ppi8255_0_r ) { return ppi8255_0_r(machine, (offset >> 4) & 3); }
648static READ8_HANDLER( turtles_ppi8255_1_r ) { return ppi8255_1_r(machine, (offset >> 4) & 3); }
649static WRITE8_HANDLER( turtles_ppi8255_0_w ) { ppi8255_0_w(machine, (offset >> 4) & 3, data); }
650static WRITE8_HANDLER( turtles_ppi8255_1_w ) { ppi8255_1_w(machine, (offset >> 4) & 3, data); }
721static READ8_HANDLER( turtles_ppi8255_0_r ) { return ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), (offset >> 4) & 3); }
722static READ8_HANDLER( turtles_ppi8255_1_r ) { return ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), (offset >> 4) & 3); }
723static WRITE8_HANDLER( turtles_ppi8255_0_w ) { ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), (offset >> 4) & 3, data); }
724static WRITE8_HANDLER( turtles_ppi8255_1_w ) { ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), (offset >> 4) & 3, data); }
651725
652726
653727
r2454r2455
732806}
733807
734808
809static const ppi8255_interface scorpion_ppi8255_intf[2] =
810{
811   {
812      konami_porta_0_r,            /* Port A read */
813      konami_portb_0_r,            /* Port B read */
814      konami_portc_0_r,            /* Port C read */
815      NULL,                     /* Port A write */
816      NULL,                     /* Port B write */
817      konami_portc_0_w            /* Port C write */
818   },
819   {
820      NULL,                     /* Port A read */
821      NULL,                     /* Port B read */
822      scorpion_protection_r,         /* Port C read */
823      soundlatch_w,               /* Port A write */
824      konami_sound_control_w,         /* Port B write */
825      scorpion_protection_w         /* Port C write */
826   }
827};
735828
829
830
736831/*************************************
737832 *
738833 *  Ghostmuncher Galaxian I/O
r2454r2455
11481243   AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x4000) AM_RAM
11491244   AM_RANGE(0x8800, 0x8bff) AM_MIRROR(0x4400) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(&videoram)
11501245   AM_RANGE(0x9000, 0x90ff) AM_MIRROR(0x4700) AM_RAM_WRITE(galaxian_objram_w) AM_BASE(&spriteram)
1151   AM_RANGE(0x9800, 0x9803) AM_MIRROR(0x47fc) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
1152   AM_RANGE(0xa000, 0xa003) AM_MIRROR(0x47fc) AM_READWRITE(ppi8255_1_r, ppi8255_1_w)
1246   AM_RANGE(0x9800, 0x9803) AM_MIRROR(0x47fc) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
1247   AM_RANGE(0xa000, 0xa003) AM_MIRROR(0x47fc) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
11531248   AM_RANGE(0xa801, 0xa801) AM_MIRROR(0x47f8) AM_WRITE(irq_enable_w)
11541249   AM_RANGE(0xa802, 0xa802) AM_MIRROR(0x47f8) AM_WRITE(coin_count_0_w)
11551250   AM_RANGE(0xa803, 0xa803) AM_MIRROR(0x47f8) AM_WRITE(scramble_background_enable_w)
r2454r2455
14481543
14491544static struct AY8910interface frogger_ay8910_interface =
14501545{
1546   AY8910_DISCRETE_OUTPUT,
1547   {RES_K(5.1), RES_K(5.1), RES_K(5.1)},
14511548   soundlatch_r,
1452   frogger_sound_timer_r
1549   frogger_sound_timer_r,
1550   NULL,
1551   NULL
14531552};
14541553
1455static struct AY8910interface konami_ay8910_interface =
1554static struct AY8910interface konami_ay8910_interface_1 =
14561555{
1556   AY8910_DISCRETE_OUTPUT,
1557   {RES_K(5.1), RES_K(5.1), RES_K(5.1)},
1558   NULL,
1559   NULL,
1560   NULL,
1561   NULL
1562};
1563
1564static struct AY8910interface konami_ay8910_interface_2 =
1565{
1566   AY8910_DISCRETE_OUTPUT,
1567   {RES_K(5.1), RES_K(5.1), RES_K(5.1)},
14571568   soundlatch_r,
1458   konami_sound_timer_r
1569   konami_sound_timer_r,
1570   NULL,
1571   NULL
14591572};
14601573
14611574static struct AY8910interface explorer_ay8910_interface_1 =
14621575{
1463   konami_sound_timer_r
1576   AY8910_LEGACY_OUTPUT,
1577   AY8910_DEFAULT_LOADS,
1578   konami_sound_timer_r,
1579   NULL,
1580   NULL,
1581   NULL
14641582};
14651583
14661584static struct AY8910interface explorer_ay8910_interface_2 =
14671585{
1468   explorer_sound_latch_r
1586   AY8910_LEGACY_OUTPUT,
1587   AY8910_DEFAULT_LOADS,
1588   explorer_sound_latch_r,
1589   NULL,
1590   NULL,
1591   NULL
14691592};
14701593
14711594static struct AY8910interface sfx_ay8910_interface =
14721595{
1473   0,
1474   0,
1596   AY8910_LEGACY_OUTPUT,
1597   AY8910_DEFAULT_LOADS,
1598   NULL,
1599   NULL,
14751600   soundlatch2_w,
14761601   sfx_sample_control_w
14771602};
14781603
14791604static struct AY8910interface scorpion_ay8910_interface =
14801605{
1481   0,
1482   0,
1606   AY8910_LEGACY_OUTPUT,
1607   AY8910_DEFAULT_LOADS,
1608   NULL,
1609   NULL,
14831610   scorpion_sound_data_w,
14841611   scorpion_sound_control_w,
14851612};
14861613
14871614static struct AY8910interface checkmaj_ay8910_interface =
14881615{
1489   soundlatch_r
1616   AY8910_LEGACY_OUTPUT,
1617   AY8910_DEFAULT_LOADS,
1618   soundlatch_r,
1619   NULL,
1620   NULL,
1621   NULL
14901622};
14911623
14921624
14931625static const discrete_mixer_desc konami_sound_mixer_desc =
1494   {DISC_MIXER_IS_RESISTOR,
1626   {DISC_MIXER_IS_OP_AMP,
14951627      {RES_K(5.1), RES_K(5.1), RES_K(5.1), RES_K(5.1), RES_K(5.1), RES_K(5.1)},
14961628      {0,0,0,0,0,0},   /* no variable resistors   */
14971629      {0,0,0,0,0,0},  /* no node capacitors      */
1498      0, RES_K(200),  /* actually after an opamp */
1630      0, RES_K(2.2),
14991631      0,
15001632      CAP_U(0.15),
15011633      0, 1};
r2454r2455
15181650   DISCRETE_INPUT_DATA(NODE_15)
15191651   DISCRETE_INPUT_DATA(NODE_16)
15201652
1521   DISCRETE_RCFILTER_SW(NODE_21, 1, NODE_01, NODE_11, 1000, CAP_U(0.22), CAP_U(0.047), 0, 0)
1522   DISCRETE_RCFILTER_SW(NODE_22, 1, NODE_02, NODE_12, 1000, CAP_U(0.22), CAP_U(0.047), 0, 0)
1523   DISCRETE_RCFILTER_SW(NODE_23, 1, NODE_03, NODE_13, 1000, CAP_U(0.22), CAP_U(0.047), 0, 0)
1653   DISCRETE_RCFILTER_SW(NODE_21, 1, NODE_01, NODE_11, AY8910_INTERNAL_RESISTANCE+1000, CAP_U(0.22), CAP_U(0.047), 0, 0)
1654   DISCRETE_RCFILTER_SW(NODE_22, 1, NODE_02, NODE_12, AY8910_INTERNAL_RESISTANCE+1000, CAP_U(0.22), CAP_U(0.047), 0, 0)
1655   DISCRETE_RCFILTER_SW(NODE_23, 1, NODE_03, NODE_13, AY8910_INTERNAL_RESISTANCE+1000, CAP_U(0.22), CAP_U(0.047), 0, 0)
15241656
1525   DISCRETE_RCFILTER_SW(NODE_24, 1, NODE_04, NODE_14, 1000, CAP_U(0.22), CAP_U(0.047), 0, 0)
1526   DISCRETE_RCFILTER_SW(NODE_25, 1, NODE_05, NODE_15, 1000, CAP_U(0.22), CAP_U(0.047), 0, 0)
1527   DISCRETE_RCFILTER_SW(NODE_26, 1, NODE_06, NODE_16, 1000, CAP_U(0.22), CAP_U(0.047), 0, 0)
1657   DISCRETE_RCFILTER_SW(NODE_24, 1, NODE_04, NODE_14, AY8910_INTERNAL_RESISTANCE+1000, CAP_U(0.22), CAP_U(0.047), 0, 0)
1658   DISCRETE_RCFILTER_SW(NODE_25, 1, NODE_05, NODE_15, AY8910_INTERNAL_RESISTANCE+1000, CAP_U(0.22), CAP_U(0.047), 0, 0)
1659   DISCRETE_RCFILTER_SW(NODE_26, 1, NODE_06, NODE_16, AY8910_INTERNAL_RESISTANCE+1000, CAP_U(0.22), CAP_U(0.047), 0, 0)
15281660
15291661   DISCRETE_MIXER6(NODE_30, 1, NODE_21, NODE_22, NODE_23, NODE_24, NODE_25, NODE_26, &konami_sound_mixer_desc)
15301662
r2454r2455
15321664   /* This is handled with sound_global_enable but    */
15331665   /* belongs here.                                   */
15341666
1535   DISCRETE_OUTPUT(NODE_30, 5.0 )
1667   DISCRETE_OUTPUT(NODE_30, 12.0 )
15361668
15371669DISCRETE_SOUND_END
15381670
r2454r2455
15821714MACHINE_DRIVER_END
15831715
15841716
1717static MACHINE_DRIVER_START( konami_base )
1718   MDRV_IMPORT_FROM( galaxian_base )
1719
1720   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
1721   MDRV_DEVICE_CONFIG( konami_ppi8255_intf[0] )
1722
1723   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
1724   MDRV_DEVICE_CONFIG( konami_ppi8255_intf[1] )
1725MACHINE_DRIVER_END
1726
1727
15851728static MACHINE_DRIVER_START( konami_sound_1x_ay8910 )
15861729
15871730   /* 2nd CPU to drive sound */
r2454r2455
15921735   /* sound hardware */
15931736   MDRV_SOUND_ADD_TAG("8910.0", AY8910, KONAMI_SOUND_CLOCK/8)
15941737   MDRV_SOUND_CONFIG(frogger_ay8910_interface)
1595   MDRV_SOUND_ROUTE_EX(0, "konami", 1.0, 0)
1596   MDRV_SOUND_ROUTE_EX(1, "konami", 1.0, 1)
1597   MDRV_SOUND_ROUTE_EX(2, "konami", 1.0, 2)
1738   MDRV_SOUND_ROUTE_EX(0, "konami", 1.0, 3)
1739   MDRV_SOUND_ROUTE_EX(1, "konami", 1.0, 4)
1740   MDRV_SOUND_ROUTE_EX(2, "konami", 1.0, 5)
15981741
15991742   MDRV_SOUND_ADD_TAG("konami", DISCRETE, 0)
16001743   MDRV_SOUND_CONFIG_DISCRETE(konami_sound)
r2454r2455
16111754
16121755   /* sound hardware */
16131756   MDRV_SOUND_ADD_TAG("8910.0", AY8910, KONAMI_SOUND_CLOCK/8)
1757   MDRV_SOUND_CONFIG(konami_ay8910_interface_1)
16141758   MDRV_SOUND_ROUTE_EX(0, "konami", 1.0, 0)
16151759   MDRV_SOUND_ROUTE_EX(1, "konami", 1.0, 1)
16161760   MDRV_SOUND_ROUTE_EX(2, "konami", 1.0, 2)
16171761
16181762   MDRV_SOUND_ADD_TAG("8910.1", AY8910, KONAMI_SOUND_CLOCK/8)
1619   MDRV_SOUND_CONFIG(konami_ay8910_interface)
1763   MDRV_SOUND_CONFIG(konami_ay8910_interface_2)
16201764   MDRV_SOUND_ROUTE_EX(0, "konami", 1.0, 3)
16211765   MDRV_SOUND_ROUTE_EX(1, "konami", 1.0, 4)
16221766   MDRV_SOUND_ROUTE_EX(2, "konami", 1.0, 5)
r2454r2455
17581902
17591903
17601904static MACHINE_DRIVER_START( frogger )
1761   MDRV_IMPORT_FROM(galaxian_base)
1905   MDRV_IMPORT_FROM(konami_base)
17621906   MDRV_IMPORT_FROM(konami_sound_1x_ay8910)
17631907
17641908   /* alternate memory map */
r2454r2455
17781922
17791923
17801924static MACHINE_DRIVER_START( froggers )
1781   MDRV_IMPORT_FROM(galaxian_base)
1925   MDRV_IMPORT_FROM(konami_base)
17821926   MDRV_IMPORT_FROM(konami_sound_1x_ay8910)
17831927
17841928   /* alternate memory map */
r2454r2455
17881932
17891933
17901934static MACHINE_DRIVER_START( frogf )
1791   MDRV_IMPORT_FROM(galaxian_base)
1935   MDRV_IMPORT_FROM(konami_base)
17921936   MDRV_IMPORT_FROM(konami_sound_1x_ay8910)
17931937
17941938   /* alternate memory map */
r2454r2455
17981942
17991943
18001944static MACHINE_DRIVER_START( turtles )
1801   MDRV_IMPORT_FROM(galaxian_base)
1945   MDRV_IMPORT_FROM(konami_base)
18021946   MDRV_IMPORT_FROM(konami_sound_2x_ay8910)
18031947
18041948   /* alternate memory map */
r2454r2455
18141958   /* alternate memory map */
18151959   MDRV_CPU_MODIFY("main")
18161960   MDRV_CPU_PROGRAM_MAP(theend_map,0)
1961
1962   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
1963   MDRV_DEVICE_CONFIG( theend_ppi8255_intf[0] )
1964
1965   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
1966   MDRV_DEVICE_CONFIG( theend_ppi8255_intf[1] )
18171967MACHINE_DRIVER_END
18181968
18191969
1820static MACHINE_DRIVER_START( explorer )
1970static MACHINE_DRIVER_START( scramble )
18211971   MDRV_IMPORT_FROM(galaxian_base)
1972   MDRV_IMPORT_FROM(konami_sound_2x_ay8910)
18221973
18231974   /* alternate memory map */
18241975   MDRV_CPU_MODIFY("main")
18251976   MDRV_CPU_PROGRAM_MAP(theend_map,0)
18261977
1978   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
1979   MDRV_DEVICE_CONFIG( scramble_ppi8255_intf[0] )
1980
1981   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
1982   MDRV_DEVICE_CONFIG( scramble_ppi8255_intf[1] )
1983MACHINE_DRIVER_END
1984
1985
1986static MACHINE_DRIVER_START( explorer )
1987   MDRV_IMPORT_FROM(konami_base)
1988
1989   /* alternate memory map */
1990   MDRV_CPU_MODIFY("main")
1991   MDRV_CPU_PROGRAM_MAP(theend_map,0)
1992
18271993   /* 2nd CPU to drive sound */
18281994   MDRV_CPU_ADD(Z80,KONAMI_SOUND_CLOCK/8)
18291995   MDRV_CPU_PROGRAM_MAP(konami_sound_map,0)
r2454r2455
18432009static MACHINE_DRIVER_START( scorpion )
18442010   MDRV_IMPORT_FROM(theend)
18452011
2012   MDRV_DEVICE_MODIFY( "ppi8255_0", PPI8255 )
2013   MDRV_DEVICE_CONFIG( scorpion_ppi8255_intf[0] )
2014
2015   MDRV_DEVICE_MODIFY( "ppi8255_1", PPI8255 )
2016   MDRV_DEVICE_CONFIG( scorpion_ppi8255_intf[1] )
2017
18462018   /* extra AY8910 with I/O ports */
18472019   MDRV_SOUND_ADD_TAG("8910.2", AY8910, KONAMI_SOUND_CLOCK/8)
18482020   MDRV_SOUND_CONFIG(scorpion_ay8910_interface)
r2454r2455
18652037   MDRV_CPU_PROGRAM_MAP(sfx_sample_map,0)
18662038   MDRV_CPU_IO_MAP(sfx_sample_portmap,0)
18672039
2040   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
2041   MDRV_DEVICE_CONFIG( sfx_ppi8255_intf[0] )
2042
2043   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
2044   MDRV_DEVICE_CONFIG( sfx_ppi8255_intf[1] )
2045
2046   MDRV_DEVICE_ADD( "ppi8255_2", PPI8255 )
2047   MDRV_DEVICE_CONFIG( sfx_ppi8255_intf[2] )
2048
18682049   /* port on 1st 8910 is used for communication */
18692050   MDRV_SOUND_MODIFY("8910.0")
18702051   MDRV_SOUND_CONFIG(sfx_ay8910_interface)
r2454r2455
18762057
18772058
18782059static MACHINE_DRIVER_START( scobra )
1879   MDRV_IMPORT_FROM(galaxian_base)
2060   MDRV_IMPORT_FROM(konami_base)
18802061   MDRV_IMPORT_FROM(konami_sound_2x_ay8910)
18812062
18822063   /* alternate memory map */
r2454r2455
20822263}
20832264
20842265
2085static void konami_common_init(
2086   running_machine *machine,
2087   galaxian_draw_bullet_func draw_bullet,
2088   galaxian_draw_background_func draw_background,
2089   galaxian_extend_tile_info_func extend_tile_info,
2090   galaxian_extend_sprite_info_func extend_sprite_info)
2091{
2092   /* basic configuration */
2093   common_init(machine, draw_bullet, draw_background, extend_tile_info, extend_sprite_info);
2094
2095   /* configure Konami sound */
2096   ppi8255_init(&konami_ppi8255_intf);
2097}
2098
2099
21002266static void unmap_galaxian_sound(running_machine *machine, offs_t base)
21012267{
21022268   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, base + 0x0004, base + 0x0007, 0, 0x07f8, SMH_UNMAP);
r2454r2455
24412607static DRIVER_INIT( theend )
24422608{
24432609   /* video extensions */
2444   konami_common_init(machine, theend_draw_bullet, galaxian_draw_background, NULL, NULL);
2610   common_init(machine, theend_draw_bullet, galaxian_draw_background, NULL, NULL);
24452611
24462612   /* coin counter on the upper bit of port C */
24472613   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6802, 0x6802, 0, 0x7f8, SMH_UNMAP);
2448   ppi8255_set_portCwrite(0, theend_coin_counter_w);
24492614}
24502615
24512616
24522617static DRIVER_INIT( scramble )
24532618{
24542619   /* video extensions */
2455   konami_common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
2456
2457   /* configure protection */
2458   ppi8255_set_portCread (1, scramble_protection_r);
2459   ppi8255_set_portCwrite(1, scramble_protection_w);
2620   common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
24602621}
24612622
24622623
24632624static DRIVER_INIT( explorer )
24642625{
24652626   /* video extensions */
2466   konami_common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
2627   common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
24672628
24682629   /* watchdog works for writes as well? (or is it just disabled?) */
24692630   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7000, 0, 0x7ff, watchdog_reset_w);
r2454r2455
24852646   common_init(machine, scramble_draw_bullet, scramble_draw_background, upper_extend_tile_info, NULL);
24862647   galaxian_sfx_tilemap = TRUE;
24872648
2488   /* sfx uses 3 x 8255, so we need a non-standard interface */
2489   ppi8255_init(&sfx_ppi8255_intf);
2490
24912649   /* sound board has space for extra ROM */
24922650   memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1);
24932651   memory_set_bankptr(1, memory_region(REGION_CPU2));
r2454r2455
24972655static DRIVER_INIT( atlantis )
24982656{
24992657   /* video extensions */
2500   konami_common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
2658   common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
25012659
25022660   /* watchdog is at $7800? (or is it just disabled?) */
25032661   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7000, 0, 0x7ff, SMH_UNMAP);
r2454r2455
25082666static DRIVER_INIT( scobra )
25092667{
25102668   /* video extensions */
2511   konami_common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
2669   common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
25122670}
25132671
25142672
25152673static DRIVER_INIT( losttomb )
25162674{
25172675   /* video extensions */
2518   konami_common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
2676   common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
25192677
25202678   /* decrypt */
25212679   decode_losttomb_gfx();
r2454r2455
25252683static DRIVER_INIT( frogger )
25262684{
25272685   /* video extensions */
2528   konami_common_init(machine, NULL, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info);
2686   common_init(machine, NULL, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info);
25292687   galaxian_frogger_adjust = TRUE;
25302688
25312689   /* decrypt */
r2454r2455
25542712static DRIVER_INIT( froggers )
25552713{
25562714   /* video extensions */
2557   konami_common_init(machine, NULL, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info);
2715   common_init(machine, NULL, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info);
25582716
25592717   /* decrypt */
25602718   decode_frogger_sound();
r2454r2455
25642722static DRIVER_INIT( turtles )
25652723{
25662724   /* video extensions */
2567   konami_common_init(machine, NULL, turtles_draw_background, NULL, NULL);
2725   common_init(machine, NULL, turtles_draw_background, NULL, NULL);
25682726}
25692727
25702728
r2454r2455
25732731{
25742732   /* no existing amidar sets run on Amidar hardware as described by Amidar schematics! */
25752733   /* video extensions */
2576   konami_common_init(machine, scramble_draw_bullet, amidar_draw_background, NULL, NULL);
2734   common_init(machine, scramble_draw_bullet, amidar_draw_background, NULL, NULL);
25772735}
25782736#endif
25792737
25802738
25812739static DRIVER_INIT( scorpion )
25822740{
2583   konami_common_init(machine, scramble_draw_bullet, scramble_draw_background, batman2_extend_tile_info, upper_extend_sprite_info);
2741   common_init(machine, scramble_draw_bullet, scramble_draw_background, batman2_extend_tile_info, upper_extend_sprite_info);
25842742
25852743   /* hook up AY8910 */
25862744   memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_IO, 0x00, 0xff, 0, 0, scorpion_ay8910_r, scorpion_ay8910_w);
25872745
2588   /* configure protection */
2589   ppi8255_set_portCwrite(1, scorpion_protection_w);
2590   ppi8255_set_portCread(1, scorpion_protection_r);
2591
25922746   /* extra ROM */
25932747   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5800, 0x67ff, 0, 0, SMH_BANK1);
25942748   memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x5800);
r2454r2455
26202774static DRIVER_INIT( anteater )
26212775{
26222776   /* video extensions */
2623   konami_common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
2777   common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
26242778
26252779   /* decode graphics */
26262780   decode_anteater_gfx();
src/mame/drivers/othldrby.c
r2454r2455
6868{
6969   mame_system_time systime;
7070
71   mame_get_base_datetime(Machine, &systime);
71   mame_get_base_datetime(machine, &systime);
7272
7373   switch (offset)
7474   {
src/mame/drivers/bbusters.c
r2454r2455
673673
674674static const struct YM2608interface ym2608_interface =
675675{
676   0,0,0,0,sound_irq,
676   {
677      AY8910_LEGACY_OUTPUT,
678      AY8910_DEFAULT_LOADS,
679      NULL, NULL, NULL, NULL
680   },
681   sound_irq,
677682   REGION_SOUND1
678683};
679684
r2454r2455
709714
710715static VIDEO_EOF( bbuster )
711716{
712   buffer_spriteram16_w(machine,0,0,0);
713   buffer_spriteram16_2_w(machine,0,0,0);
717   buffer_spriteram16_w(machine,0,0,0xffff);
718   buffer_spriteram16_2_w(machine,0,0,0xffff);
714719}
715720
716721static VIDEO_EOF( mechatt )
717722{
718   buffer_spriteram16_w(machine,0,0,0);
723   buffer_spriteram16_w(machine,0,0,0xffff);
719724}
720725
721726static MACHINE_DRIVER_START( bbusters )
r2454r2455
756761
757762   MDRV_SOUND_ADD(YM2610, 8000000)
758763   MDRV_SOUND_CONFIG(ym2610_interface)
759   MDRV_SOUND_ROUTE(0, "left",  0.60)
760   MDRV_SOUND_ROUTE(0, "right", 0.60)
761   MDRV_SOUND_ROUTE(1, "left",  0.20)
762   MDRV_SOUND_ROUTE(2, "right", 0.20)
764   MDRV_SOUND_ROUTE(0, "left",  3.0)
765   MDRV_SOUND_ROUTE(0, "right", 3.0)
766   MDRV_SOUND_ROUTE(1, "left",  1.0)
767   MDRV_SOUND_ROUTE(2, "right", 1.0)
763768MACHINE_DRIVER_END
764769
765770static MACHINE_DRIVER_START( mechatt )
src/mame/drivers/snk.c
r2454r2455
320320   switch( snk_io[which] ){
321321      case SNK_INP0:
322322      {
323         int value = input_port_0_r( machine,0 );
323         int value = input_port_read_indexed( machine,0 );
324324         if( (snk_sound_register & 0x04) == 0 ) value &= ~snk_sound_busy_bit;
325325         return value;
326326      }
src/mame/drivers/hyprduel.c
r2454r2455
128128      {
129129         if (pc != 0x95f2)
130130         {
131            cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
131            cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
132132            subcpu_resetline = 1;
133133         } else {
134            cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
134            cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
135135            subcpu_resetline = -1;
136136         }
137137      }
138138   } else {
139139      if (subcpu_resetline == 1 && (data != 0x0c))
140140      {
141         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
141         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
142142         subcpu_resetline = 0;
143143         if (pc == 0xbb0 || pc == 0x9d30 || pc == 0xb19c)
144144            cpu_spinuntil_time(ATTOTIME_IN_USEC(15000));      /* sync semaphore */
145145      }
146146      else if (subcpu_resetline == -1)
147147      {
148         cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
148         cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
149149         subcpu_resetline = 0;
150150      }
151151   }
src/mame/drivers/namconb1.c
r2454r2455
691691{
692692   if (offset < 0xb0)
693693   {
694      if (mem_mask == 0x0000ffff)
694      if (mem_mask == 0xffff0000)
695695      {
696696         namcoc7x_sound_write16((data>>16), offset*2);
697697      }
698      else if (mem_mask == 0xffff0000)
698      else if (mem_mask == 0x0000ffff)
699699      {
700700         namcoc7x_sound_write16((data&0xffff), (offset*2)+1);
701701      }
src/mame/drivers/flstory.c
r2454r2455
104104   sound_nmi_enable = 1;
105105   if (pending_nmi)
106106   {
107      cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE);
107      cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
108108      pending_nmi = 0;
109109   }
110110}
r2454r2455
672672
673673static const struct AY8910interface ay8910_interface =
674674{
675   0,
676   0,
675   AY8910_LEGACY_OUTPUT,
676   AY8910_DEFAULT_LOADS,
677   NULL,
678   NULL,
677679   sound_control_2_w,
678680   sound_control_3_w
679681};
src/mame/drivers/fcrash.c
r2454r2455
44
55Final Crash is a bootleg of Final Fight
66
7Final Fight is by Capcom and runs on CPS1 hardawre
7Final Fight is by Capcom and runs on CPS1 hardware
88The bootleg was manufactured by Playmark of Italy
99
1010this driver depends heavily on cps1.c, but has been
1111kept apart in an attempt to keep cps1.c clutter free
1212
13todo:
14Add Sound (very different to CPS1)
13Sound is very different from CPS1.
1514
1615---
1716
r2454r2455
3635#include "driver.h"
3736#include "cpu/m68000/m68kmame.h"
3837#include "cps1.h"
38#include "sound/2203intf.h"
39#include "sound/msm5205.h"
3940
41
42static int sample_buffer1, sample_buffer2;
43static int sample_select1, sample_select2;
44
45static WRITE16_HANDLER( fcrash_soundlatch_w )
46{
47   if (ACCESSING_BITS_0_7)
48   {
49      soundlatch_w(machine,0,data & 0xff);
50      cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
51   }
52}
53
54static WRITE8_HANDLER( fcrash_snd_bankswitch_w )
55{
56   UINT8 *RAM = memory_region(REGION_CPU2);
57   int bankaddr;
58
59   sndti_set_output_gain(SOUND_MSM5205, 0, 0, (data & 0x08) ? 0.0 : 1.0);
60   sndti_set_output_gain(SOUND_MSM5205, 1, 0, (data & 0x10) ? 0.0 : 1.0);
61
62   bankaddr = ((data & 7) * 0x4000);
63   memory_set_bankptr(1,&RAM[0x10000 + bankaddr]);
64}
65
66static void m5205_int1(int data)
67{
68   MSM5205_data_w(0, sample_buffer1 & 0x0F);
69   sample_buffer1 >>= 4;
70   sample_select1 ^= 1;
71   if (sample_select1 == 0)
72      cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
73}
74
75static void m5205_int2(int data)
76{
77   MSM5205_data_w(1, sample_buffer2 & 0x0F);
78   sample_buffer2 >>= 4;
79   sample_select2 ^= 1;
80}
81
82
83static WRITE8_HANDLER( fcrash_msm5205_0_data_w )
84{
85    sample_buffer1 = data;
86}
87
88static WRITE8_HANDLER( fcrash_msm5205_1_data_w )
89{
90    sample_buffer2 = data;
91}
92
93
94
4095/* not verified */
41#define CPS1_ROWSCROLL_OFFS     0x20    /* base of row scroll offsets in other RAM */
96#define CPS1_ROWSCROLL_OFFS     (0x20/2)    /* base of row scroll offsets in other RAM */
4297
4398static void fcrash_update_transmasks(void)
4499{
45100   int i;
46101   int priority[4];
47102
48   priority[0]=0x66;
49   priority[1]=0x70;
50   priority[2]=0x68;
51   priority[3]=0x72;
103   priority[0]=0x26;
104   priority[1]=0x30;
105   priority[2]=0x28;
106   priority[3]=0x32;
52107
53108   for (i = 0;i < 4;i++)
54109   {
r2454r2455
56111
57112      /* Get transparency registers */
58113      if (priority[i])
59         mask = cps1_port(priority[i]) ^ 0xffff;
114         mask = cps1_cps_b_regs[priority[i]/2] ^ 0xffff;
60115      else mask = 0xffff;   /* completely transparent if priority masks not defined (mercs, qad) */
61116
62117      tilemap_set_transmask(cps1_bg_tilemap[0],i,mask,0x8000);
r2454r2455
80135
81136      tileno = cps1_gfxram[base+pos];
82137      xpos   = cps1_gfxram[base+pos+2];
83      ypos   = cps1_gfxram[base+pos-1];
138      ypos   = cps1_gfxram[base+pos-1]&0xff;
84139      flipx  = cps1_gfxram[base+pos+1]&0x20;
85140      flipy  = cps1_gfxram[base+pos+1]&0x40;
86141      colour = cps1_gfxram[base+pos+1]&0x1f;
r2454r2455
146201
147202static VIDEO_UPDATE( fcrash )
148203{
149      int layercontrol,l0,l1,l2,l3;
150   int videocontrol=cps1_port(0x22);
204   int layercontrol,l0,l1,l2,l3;
205   int videocontrol=cps1_cps_a_regs[0x22/2];
151206
152207
153208   flip_screen_set(videocontrol & 0x8000);
154209
155    layercontrol = cps1_output[0x60/2];
210    layercontrol = cps1_cps_b_regs[0x20/2];
156211
157212   /* Get video memory base registers */
158213   cps1_get_video_base();
r2454r2455
172227
173228      tilemap_set_scroll_rows(cps1_bg_tilemap[1],1024);
174229
175      otheroffs = cps1_port(CPS1_ROWSCROLL_OFFS);
230      otheroffs = cps1_cps_a_regs[CPS1_ROWSCROLL_OFFS];
176231
177232      for (i = 0;i < 256;i++)
178233         tilemap_set_scrollx(cps1_bg_tilemap[1],(i - scrly) & 0x3ff,cps1_scroll2x + cps1_other[(i + otheroffs) & 0x3ff]);
r2454r2455
215270}
216271
217272
218static ADDRESS_MAP_START( fcrash_readmem, ADDRESS_SPACE_PROGRAM, 16 )
219   AM_RANGE(0x000000, 0x1fffff) AM_READ(SMH_ROM)             /* 68000 ROM */
220   AM_RANGE(0x880000, 0x880001) AM_READ(cps1_in1_r)            /* Player input ports */
221   AM_RANGE(0x880008, 0x88000f) AM_READ(cps1_input_r)          /* System input ports / Dip Switches */
222   AM_RANGE(0x800100, 0x8001ff) AM_READ(cps1_output_r)         /* Output ports */
223   AM_RANGE(0x900000, 0x92ffff) AM_READ(SMH_RAM)               /* SF2CE executes code from here */
224   AM_RANGE(0xf1c000, 0xf1c001) AM_READ(cps1_in2_r)
225   AM_RANGE(0xf1c002, 0xf1c003) AM_READ(cps1_in3_r)
226   AM_RANGE(0xff0000, 0xffffff) AM_READ(SMH_RAM)             /* RAM */
227ADDRESS_MAP_END
228273
229static ADDRESS_MAP_START( fcrash_writemem, ADDRESS_SPACE_PROGRAM, 16 )
230   AM_RANGE(0x000000, 0x1fffff) AM_WRITE(SMH_ROM)            /* ROM */
274static ADDRESS_MAP_START( fcrash_map, ADDRESS_SPACE_PROGRAM, 16 )
275   AM_RANGE(0x000000, 0x1fffff) AM_ROM
231276   AM_RANGE(0x800030, 0x800031) AM_WRITE(cps1_coinctrl_w)
232   AM_RANGE(0x800100, 0x8001ff) AM_WRITE(cps1_output_w) AM_BASE(&cps1_output) AM_SIZE(&cps1_output_size)  /* Output ports */
233   AM_RANGE(0x900000, 0x92ffff) AM_WRITE(cps1_gfxram_w) AM_BASE(&cps1_gfxram) AM_SIZE(&cps1_gfxram_size)
234   AM_RANGE(0xff0000, 0xffffff) AM_WRITE(SMH_RAM)            /* RAM */
277   AM_RANGE(0x800100, 0x80013f) AM_RAM AM_BASE(&cps1_cps_a_regs)   /* CPS-A custom */
278   AM_RANGE(0x800140, 0x80017f) AM_RAM AM_BASE(&cps1_cps_b_regs)   /* CPS-B custom */
279   AM_RANGE(0x880000, 0x880001) AM_READ(cps1_in1_r)          /* Player input ports */
280   AM_RANGE(0x880006, 0x880007) AM_WRITE(fcrash_soundlatch_w)    /* Sound command */
281   AM_RANGE(0x880008, 0x88000f) AM_READ(cps1_dsw_r)          /* System input ports / Dip Switches */
282   AM_RANGE(0x890000, 0x890001) AM_WRITENOP   // palette related?
283   AM_RANGE(0x900000, 0x92ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_BASE(&cps1_gfxram) AM_SIZE(&cps1_gfxram_size)
284   AM_RANGE(0xff0000, 0xffffff) AM_RAM
235285ADDRESS_MAP_END
236286
287static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
288   AM_RANGE(0x0000, 0x7fff) AM_ROM
289   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1)
290   AM_RANGE(0xd000, 0xd7ff) AM_RAM
291   AM_RANGE(0xd800, 0xd800) AM_READWRITE(YM2203_status_port_0_r, YM2203_control_port_0_w)
292   AM_RANGE(0xd801, 0xd801) AM_READWRITE(YM2203_read_port_0_r, YM2203_write_port_0_w)
293   AM_RANGE(0xdc00, 0xdc00) AM_READWRITE(YM2203_status_port_0_r, YM2203_control_port_0_w)
294   AM_RANGE(0xdc01, 0xdc01) AM_READWRITE(YM2203_read_port_0_r, YM2203_write_port_0_w)
295   AM_RANGE(0xe000, 0xe000) AM_WRITE(fcrash_snd_bankswitch_w)
296   AM_RANGE(0xe400, 0xe400) AM_READ(soundlatch_r)
297   AM_RANGE(0xe800, 0xe800) AM_WRITE(fcrash_msm5205_0_data_w)
298   AM_RANGE(0xec00, 0xec00) AM_WRITE(fcrash_msm5205_1_data_w)
299ADDRESS_MAP_END
237300
301
238302#define CPS1_COINAGE_1 \
239303   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) \
240304   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) ) \
r2454r2455
340404INPUT_PORTS_END
341405
342406
407
408static const struct MSM5205interface msm5205_interface1 =
409{
410   m5205_int1,   /* interrupt function */
411   MSM5205_S96_4B      /* 4KHz 4-bit */
412};
413
414static const struct MSM5205interface msm5205_interface2 =
415{
416   m5205_int2,   /* interrupt function */
417   MSM5205_S96_4B      /* 4KHz 4-bit */
418};
419
420
343421static MACHINE_DRIVER_START( fcrash )
344422
345423   /* basic machine hardware */
346424   MDRV_CPU_ADD_TAG("main", M68000, 10000000)
347   MDRV_CPU_PROGRAM_MAP(fcrash_readmem,fcrash_writemem)
425   MDRV_CPU_PROGRAM_MAP(fcrash_map,0)
348426   MDRV_CPU_VBLANK_INT("main", cps1_interrupt)
349427
350//  MDRV_CPU_ADD_TAG("sound", Z80, 4000000) /* ???? */
351//  /* audio CPU */
352//  MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
428   MDRV_CPU_ADD_TAG("sound", Z80, 24000000/6) /* ? */
429   MDRV_CPU_PROGRAM_MAP(sound_map,0)
353430
354431   /* video hardware */
355432   MDRV_SCREEN_ADD("main", RASTER)
r2454r2455
365442   MDRV_VIDEO_START(cps1)
366443   MDRV_VIDEO_EOF(cps1)
367444   MDRV_VIDEO_UPDATE(fcrash)
445
446   // sound hardware
447   MDRV_SPEAKER_STANDARD_MONO("mono")
448
449   MDRV_SOUND_ADD(YM2203, 24000000/6)   /* ? */
450   MDRV_SOUND_ROUTE(0, "mono", 0.10)
451   MDRV_SOUND_ROUTE(1, "mono", 0.10)
452   MDRV_SOUND_ROUTE(2, "mono", 0.10)
453   MDRV_SOUND_ROUTE(3, "mono", 1.0)
454
455   MDRV_SOUND_ADD(YM2203, 24000000/6)   /* ? */
456   MDRV_SOUND_ROUTE(0, "mono", 0.10)
457   MDRV_SOUND_ROUTE(1, "mono", 0.10)
458   MDRV_SOUND_ROUTE(2, "mono", 0.10)
459   MDRV_SOUND_ROUTE(3, "mono", 1.0)
460
461   MDRV_SOUND_ADD(MSM5205, 24000000/64)   /* ? */
462   MDRV_SOUND_CONFIG(msm5205_interface1)
463   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
464
465   MDRV_SOUND_ADD(MSM5205, 24000000/64)   /* ? */
466   MDRV_SOUND_CONFIG(msm5205_interface2)
467   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
368468MACHINE_DRIVER_END
369469
370470
r2454r2455
405505   ROM_RELOAD(          0x10000, 0x20000 )
406506ROM_END
407507
408GAME( 1990, fcrash,   ffight,  fcrash,     fcrash,   cps1,     ROT0,   "Playmark, bootleg [Capcom]", "Final Crash (World, bootleg)",GAME_NO_SOUND )
508GAME( 1990, fcrash,   ffight,  fcrash,     fcrash,   cps1,     ROT0,   "Playmark, bootleg [Capcom]", "Final Crash (World, bootleg)", 0 )
src/mame/drivers/f-32.c
r2454r2455
9898   if ((activecpu_get_pc() == 0x000379de) ||
9999       (activecpu_get_pc() == 0x000379cc) ) activecpu_adjust_icount(-100);
100100   //else printf("PC %08x\n", activecpu_get_pc() );
101   return input_port_1_dword_r(machine, 0, 0);
101   return input_port_read_indexed(machine, 1);
102102}
103103
104104
src/mame/drivers/atetris.c
r2454r2455
4848
4949
5050#include "driver.h"
51#include "deprecat.h"
5251#include "cpu/m6502/m6502.h"
5352#include "slapstic.h"
5453#include "atetris.h"
r2454r2455
9392
9493static WRITE8_HANDLER( irq_ack_w )
9594{
96   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
95   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
9796}
9897
9998
src/mame/drivers/dgpix.c
r2454r2455
142142{
143143   UINT32 *dest = &vram[offset+(0x40000/4)*vbuffer];
144144
145   if (mem_mask == 0)
145   if (mem_mask == 0xffffffff)
146146   {
147147      if (~data & 0x80000000)
148148         *dest = (*dest & 0x0000ffff) | (data & 0xffff0000);
r2454r2455
150150      if (~data & 0x00008000)
151151         *dest = (*dest & 0xffff0000) | (data & 0x0000ffff);
152152   }
153   else if (((mem_mask == 0x0000ffff) && (~data & 0x80000000)) ||
154           ((mem_mask == 0xffff0000) && (~data & 0x00008000)))
153   else if (((mem_mask == 0xffff0000) && (~data & 0x80000000)) ||
154           ((mem_mask == 0x0000ffff) && (~data & 0x00008000)))
155155      COMBINE_DATA(dest);
156156}
157157
r2454r2455
182182{
183183   /* burn a bunch of cycles because this is polled frequently during busy loops */
184184   activecpu_adjust_icount(-100);
185   return input_port_0_dword_r(machine, offset, 0);
185   return input_port_read_indexed(machine, 0);
186186}
187187
188188static ADDRESS_MAP_START( cpu_map, ADDRESS_SPACE_PROGRAM, 32 )
src/mame/drivers/model2.c
r2454r2455
924924
925925static READ32_HANDLER( model2_serial_r )
926926{
927   if ((offset == 0) && (mem_mask == 0x0000ffff))
927   if ((offset == 0) && (mem_mask == 0xffff0000))
928928   {
929929      return 0x00070000;   // TxRdy RxRdy (zeroguna also needs bit 4 set)
930930   }
r2454r2455
934934
935935static WRITE32_HANDLER( model2o_serial_w )
936936{
937   if (mem_mask == 0xffff0000)
937   if (mem_mask == 0x0000ffff)
938938   {
939939      snd_latch_to_68k_w(data&0xff);
940940   }
r2454r2455
10071007
10081008static WRITE32_HANDLER( model2_prot_w )
10091009{
1010   if (mem_mask == 0xffff)
1010   if (mem_mask == 0xffff0000)
10111011   {
10121012      data >>= 16;
10131013   }
r2454r2455
10851085   if (offset <= 0x1f/4)
10861086   {
10871087      // special
1088      if (mem_mask == 0x0000ffff)
1088      if (mem_mask == 0xffff0000)
10891089      {
10901090         // 16-bit protection reads
10911091         model2_maxxstate++;
r2454r2455
11061106            }
11071107         }
11081108      }
1109      else if (mem_mask == 0)
1109      else if (mem_mask == 0xffffffff)
11101110      {
11111111         // 32-bit read
11121112         if (offset == 0x22/4)
r2454r2455
11271127
11281128static READ32_HANDLER( network_r )
11291129{
1130   if ((mem_mask == 0) || (mem_mask == 0xffff0000) || (mem_mask == 0x0000ffff))
1130   if ((mem_mask == 0xffffffff) || (mem_mask == 0x0000ffff) || (mem_mask == 0xffff0000))
11311131   {
11321132      return 0xffffffff;
11331133   }
r2454r2455
11371137      return model2_netram[offset];
11381138   }
11391139
1140   if (mem_mask == 0xff00ffff)
1140   if (mem_mask == 0x00ff0000)
11411141   {
11421142      return sysres<<16;
11431143   }
1144   else if (mem_mask == 0xffffff00)
1144   else if (mem_mask == 0x000000ff)
11451145   {
11461146      return zflagi;
11471147   }
r2454r2455
11511151
11521152static WRITE32_HANDLER( network_w )
11531153{
1154   if ((mem_mask == 0) || (mem_mask == 0xffff0000) || (mem_mask == 0x0000ffff))
1154   if ((mem_mask == 0xffffffff) || (mem_mask == 0x0000ffff) || (mem_mask == 0xffff0000))
11551155   {
11561156      COMBINE_DATA(&model2_netram[offset+0x4000/4]);
11571157      return;
r2454r2455
11631163      return;
11641164   }
11651165
1166   if (mem_mask == 0xff00ffff)
1166   if (mem_mask == 0x00ff0000)
11671167   {
11681168      sysres = data>>16;
11691169   }
1170   else if (mem_mask == 0xffffff00)
1170   else if (mem_mask == 0x000000ff)
11711171   {
11721172      zflagi = data;
11731173      zflag = 0;
src/mame/drivers/bmcbowl.c
r2454r2455
203203static WRITE16_HANDLER( bmc_RAMDAC_color_w )
204204{
205205      colorram[clr_offset]=data;
206      palette_set_color_rgb(Machine,clr_offset/3,pal6bit(colorram[(clr_offset/3)*3]),pal6bit(colorram[(clr_offset/3)*3+1]),pal6bit(colorram[(clr_offset/3)*3+2]));
206      palette_set_color_rgb(machine,clr_offset/3,pal6bit(colorram[(clr_offset/3)*3]),pal6bit(colorram[(clr_offset/3)*3+1]),pal6bit(colorram[(clr_offset/3)*3+2]));
207207      clr_offset=(clr_offset+1)%768;
208208}
209209
r2454r2455
463463
464464static const struct AY8910interface ay8910_interface =
465465{
466   AY8910_LEGACY_OUTPUT,
467   AY8910_DEFAULT_LOADS,
466468   dips1_r,
467   0,
468   0,
469   NULL,
470   NULL,
469471   input_mux_w
470472};
471473
src/mame/drivers/sshangha.c
r2454r2455
8383
8484   if (offset == (0x260 >> 1)) {
8585      //soundlatch_w(0,data&0xff);
86      //cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
86      //cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
8787   }
8888}
8989
r2454r2455
142142         orientation when entering the "test mode"
143143         (check the game code from 0x0006b8 to 0x0006f0).
144144       I can't tell however if this is accurate or not. */
145   sshangha_control_0_w(machine, 0, 0x10, 0xff00);
145   sshangha_control_0_w(machine, 0, 0x10, 0x00ff);
146146}
147147
148148/******************************************************************************/
r2454r2455
334334
335335static const struct YM2203interface ym2203_interface =
336336{
337   0,0,0,0,irqhandler
337   {
338      AY8910_LEGACY_OUTPUT,
339      AY8910_DEFAULT_LOADS,
340      NULL, NULL, NULL, NULL
341   },
342   irqhandler
338343};
339344
340345static MACHINE_DRIVER_START( sshangha )
src/mame/drivers/wiping.c
r2454r2455
3434
3535***************************************************************************/
3636#include "driver.h"
37#include "deprecat.h"
3837#include "cpu/z80/z80.h"
3938#include "sound/custom.h"
4039
r2454r2455
8786static WRITE8_HANDLER( subcpu_reset_w )
8887{
8988   if (data & 1)
90      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
89      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
9190   else
92      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
91      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
9392}
9493
9594
src/mame/drivers/kyugo.c
r2454r2455
4646
4747WRITE8_HANDLER( kyugo_sub_cpu_control_w )
4848{
49   cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, data ? CLEAR_LINE : ASSERT_LINE);
49   cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, data ? CLEAR_LINE : ASSERT_LINE);
5050}
5151
5252
r2454r2455
479479
480480static const struct AY8910interface ay8910_interface =
481481{
482   AY8910_LEGACY_OUTPUT,
483   AY8910_DEFAULT_LOADS,
482484   input_port_0_r,
483   input_port_1_r
485   input_port_1_r,
486   NULL,
487   NULL
484488};
485489
486490
r2454r2455
493497static MACHINE_DRIVER_START( gyrodine )
494498
495499   /* basic machine hardware */
496   MDRV_CPU_ADD_TAG("main", Z80, 18432000 / 4)   /* 18.432 MHz crystal */
500   MDRV_CPU_ADD_TAG("main", Z80, XTAL_18_432MHz/6)   /* verified on pcb */
497501   MDRV_CPU_PROGRAM_MAP(main_map,0)
498502   MDRV_CPU_IO_MAP(0,gyrodine_portmap)
499503   MDRV_CPU_VBLANK_INT("main", nmi_line_pulse)
500504
501   MDRV_CPU_ADD_TAG("sub", Z80, 18432000 / 4)   /* 18.432 MHz crystal */
505   MDRV_CPU_ADD_TAG("sub", Z80, XTAL_18_432MHz/6)   /* verified on pcb */
502506   MDRV_CPU_PROGRAM_MAP(gyrodine_sub_map,0)
503507   MDRV_CPU_IO_MAP(gyrodine_sub_portmap,0)
504508   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4)
r2454r2455
525529   /* sound hardware */
526530   MDRV_SPEAKER_STANDARD_MONO("mono")
527531
528   MDRV_SOUND_ADD(AY8910, 1500000)
532   MDRV_SOUND_ADD(AY8910, XTAL_18_432MHz/12)  /* verified on pcb */
529533   MDRV_SOUND_CONFIG(ay8910_interface)
530534   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
531535
532   MDRV_SOUND_ADD(AY8910, 1500000)
536   MDRV_SOUND_ADD(AY8910, XTAL_18_432MHz/12)  /* verified on pcb */
533537   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
534538MACHINE_DRIVER_END
535539
src/mame/drivers/leland.c
r2454r2455
681681
682682static const struct AY8910interface ay8910_interface =
683683{
684    leland_sound_port_r,
684   AY8910_LEGACY_OUTPUT,
685   AY8910_DEFAULT_LOADS,
686   leland_sound_port_r,
685687   0,
686    leland_sound_port_w,
688   leland_sound_port_w,
687689   0
688690};
689691
src/mame/drivers/mjsiyoub.c
r2454r2455
6767
6868static const struct AY8910interface ay8910_interface =
6969{
70   0,            /* Input A: DSW 2 */
71   0,            /* Input B: DSW 1 */
70   AY8910_LEGACY_OUTPUT,
71   AY8910_DEFAULT_LOADS,
72   NULL,            /* Input A: DSW 2 */
73   NULL,            /* Input B: DSW 1 */
74   NULL,
75   NULL
7276};
7377
7478static const struct MSM5205interface msm5205_interface =
src/mame/drivers/popeye.c
r2454r2455
463463   int res;
464464
465465
466   res = input_port_3_r(machine,offset);
467   res |= (input_port_4_r(machine,offset) << (7-dswbit)) & 0x80;
466   res = input_port_read_indexed(machine,3);
467   res |= (input_port_read_indexed(machine,4) << (7-dswbit)) & 0x80;
468468
469469   return res;
470470}
471471
472472static const struct AY8910interface ay8910_interface =
473473{
474   AY8910_LEGACY_OUTPUT,
475   AY8910_DEFAULT_LOADS,
474476   popeye_portA_r,
475   0,
476   0,
477   NULL,
478   NULL,
477479   popeye_portB_w
478480};
479481
src/mame/drivers/gstream.c
r2454r2455
9595*********************************************************************/
9696
9797#include "driver.h"
98#include "deprecat.h"
9998#include "sound/okim6295.h"
10099
101100static UINT32 *gstream_vram;
r2454r2455
112111{
113112   COMBINE_DATA(&paletteram32[offset]);
114113
115   palette_set_color_rgb(Machine,offset*2,pal5bit(paletteram32[offset] >> (0+16)),
114   palette_set_color_rgb(machine,offset*2,pal5bit(paletteram32[offset] >> (0+16)),
116115                                   pal5bit(paletteram32[offset] >> (6+16)),
117116                            pal5bit(paletteram32[offset] >> (11+16)));
118117
119118
120   palette_set_color_rgb(Machine,offset*2+1,pal5bit(paletteram32[offset] >> (0)),
119   palette_set_color_rgb(machine,offset*2+1,pal5bit(paletteram32[offset] >> (0)),
121120                                   pal5bit(paletteram32[offset] >> (6)),
122121                            pal5bit(paletteram32[offset] >> (11)));
123122}
src/mame/drivers/taxidrvr.c
r2454r2455
9393}
9494
9595
96static const ppi8255_interface ppi8255_intf =
96static const ppi8255_interface ppi8255_intf[5] =
9797{
98   5,                               /* 5 chips */
99   { p0a_r, NULL,  NULL,  NULL,  NULL  },   /* Port A read */
100   { NULL,  p1b_r, NULL,  NULL,  NULL  },   /* Port B read */
101   { p0c_r, p1c_r, NULL,  NULL,  NULL  },   /* Port C read */
102   { NULL,  p1a_w, p2a_w, p3a_w, p4a_w },   /* Port A write */
103   { p0b_w, NULL,  p2b_w, p3b_w, p4b_w },   /* Port B write */
104   { p0c_w, p1c_w, p2c_w, p3c_w, p4c_w }   /* Port C write */
98   {
99      p0a_r,      /* Port A read */
100      NULL,      /* Port B read */
101      p0c_r,      /* Port C read */
102      NULL,      /* Port A write */
103      p0b_w,      /* Port B write */
104      p0c_w      /* Port C write */
105   },
106   {
107      NULL,      /* Port A read */
108      p1b_r,      /* Port B read */
109      p1c_r,      /* Port C read */
110      p1a_w,      /* Port A write */
111      NULL,      /* Port B write */
112      p1c_w      /* Port C write */
113   },
114   {
115      NULL,      /* Port A read */
116      NULL,      /* Port B read */
117      NULL,      /* Port C read */
118      p2a_w,      /* Port A write */
119      p2b_w,      /* Port B write */
120      p2c_w      /* Port C write */
121   },
122   {
123      NULL,      /* Port A read */
124      NULL,      /* Port B read */
125      NULL,      /* Port C read */
126      p3a_w,      /* Port A write */
127      p3b_w,      /* Port B write */
128      p3c_w      /* Port C write */
129   },
130   {
131      NULL,      /* Port A read */
132      NULL,      /* Port B read */
133      NULL,      /* Port C read */
134      p4a_w,      /* Port A write */
135      p4b_w,      /* Port B write */
136      p4c_w      /* Port C write */
137   }
105138};
106139
107static MACHINE_RESET( taxidrvr )
108{
109   ppi8255_init(&ppi8255_intf);
110}
111140
112
113
114141static ADDRESS_MAP_START( readmem1, ADDRESS_SPACE_PROGRAM, 8 )
115142   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
116143   AM_RANGE(0x8000, 0x8fff) AM_READ(SMH_RAM)
r2454r2455
120147   AM_RANGE(0xc000, 0xc7ff) AM_READ(SMH_RAM)
121148   AM_RANGE(0xd800, 0xdfff) AM_READ(SMH_RAM)
122149   AM_RANGE(0xe000, 0xf3ff) AM_READ(SMH_RAM)
123   AM_RANGE(0xf400, 0xf403) AM_READ(ppi8255_0_r)
124   AM_RANGE(0xf480, 0xf483) AM_READ(ppi8255_2_r)
125   AM_RANGE(0xf500, 0xf503) AM_READ(ppi8255_3_r)
126   AM_RANGE(0xf580, 0xf583) AM_READ(ppi8255_4_r)
150   AM_RANGE(0xf400, 0xf403) AM_DEVREAD(PPI8255, "ppi8255_0", ppi8255_r)
151   AM_RANGE(0xf480, 0xf483) AM_DEVREAD(PPI8255, "ppi8255_2", ppi8255_r)
152   AM_RANGE(0xf500, 0xf503) AM_DEVREAD(PPI8255, "ppi8255_3", ppi8255_r)
153   AM_RANGE(0xf580, 0xf583) AM_DEVREAD(PPI8255, "ppi8255_4", ppi8255_r)
127154   AM_RANGE(0xf800, 0xffff) AM_READ(SMH_RAM)
128155ADDRESS_MAP_END
129156
r2454r2455
141168   AM_RANGE(0xe400, 0xebff) AM_WRITE(SMH_RAM) AM_BASE(&taxidrvr_vram2)   /* bg1 tilemap */
142169   AM_RANGE(0xec00, 0xefff) AM_WRITE(SMH_RAM) AM_BASE(&taxidrvr_vram0)   /* fg tilemap */
143170   AM_RANGE(0xf000, 0xf3ff) AM_WRITE(SMH_RAM) AM_BASE(&taxidrvr_vram3)   /* bg2 tilemap */
144   AM_RANGE(0xf400, 0xf403) AM_WRITE(ppi8255_0_w)
145   AM_RANGE(0xf480, 0xf483) AM_WRITE(ppi8255_2_w)   /* "sprite1" placement */
146   AM_RANGE(0xf500, 0xf503) AM_WRITE(ppi8255_3_w)   /* "sprite2" placement */
147   AM_RANGE(0xf580, 0xf583) AM_WRITE(ppi8255_4_w)   /* "sprite3" placement */
171   AM_RANGE(0xf400, 0xf403) AM_DEVWRITE(PPI8255, "ppi8255_0", ppi8255_w)
172   AM_RANGE(0xf480, 0xf483) AM_DEVWRITE(PPI8255, "ppi8255_2", ppi8255_w)   /* "sprite1" placement */
173   AM_RANGE(0xf500, 0xf503) AM_DEVWRITE(PPI8255, "ppi8255_3", ppi8255_w)   /* "sprite2" placement */
174   AM_RANGE(0xf580, 0xf583) AM_DEVWRITE(PPI8255, "ppi8255_4", ppi8255_w)   /* "sprite3" placement */
148175//  AM_RANGE(0xf780, 0xf781) AM_WRITE(SMH_RAM)     /* more scroll registers? */
149176   AM_RANGE(0xf782, 0xf787) AM_WRITE(SMH_RAM) AM_BASE(&taxidrvr_scroll)   /* bg scroll (three copies always identical) */
150177   AM_RANGE(0xf800, 0xffff) AM_WRITE(SMH_RAM)
r2454r2455
154181   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
155182   AM_RANGE(0x6000, 0x67ff) AM_READ(SMH_RAM)
156183   AM_RANGE(0x8000, 0x87ff) AM_READ(SMH_RAM)
157   AM_RANGE(0xa000, 0xa003) AM_READ(ppi8255_1_r)
184   AM_RANGE(0xa000, 0xa003) AM_DEVREAD(PPI8255, "ppi8255_1", ppi8255_r)
158185   AM_RANGE(0xe000, 0xe000) AM_READ(input_port_0_r)
159186   AM_RANGE(0xe001, 0xe001) AM_READ(input_port_1_r)
160187   AM_RANGE(0xe002, 0xe002) AM_READ(input_port_2_r)
r2454r2455
166193   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
167194   AM_RANGE(0x6000, 0x67ff) AM_WRITE(SMH_RAM)
168195   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM)
169   AM_RANGE(0xa000, 0xa003) AM_WRITE(ppi8255_1_w)
196   AM_RANGE(0xa000, 0xa003) AM_DEVWRITE(PPI8255, "ppi8255_1", ppi8255_w)
170197ADDRESS_MAP_END
171198
172199static ADDRESS_MAP_START( readmem3, ADDRESS_SPACE_PROGRAM, 8 )
r2454r2455
344371
345372static const struct AY8910interface ay8910_interface_1 =
346373{
374   AY8910_LEGACY_OUTPUT,
375   AY8910_DEFAULT_LOADS,
347376   p8910_0a_r,
348   0,
349   0,
377   NULL,
378   NULL,
350379   p8910_0b_w
351380};
352381
353382static const struct AY8910interface ay8910_interface_2 =
354383{
355   p8910_1a_r
384   AY8910_LEGACY_OUTPUT,
385   AY8910_DEFAULT_LOADS,
386   p8910_1a_r,
387   NULL,
388   NULL,
389   NULL
356390};
357391
358392
r2454r2455
375409
376410   MDRV_INTERLEAVE(100)   /* 100 CPU slices per frame - an high value to ensure proper */
377411                     /* synchronization of the CPUs */
378   MDRV_MACHINE_RESET(taxidrvr)
379412
413   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
414   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
415
416   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
417   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
418
419   MDRV_DEVICE_ADD( "ppi8255_2", PPI8255 )
420   MDRV_DEVICE_CONFIG( ppi8255_intf[2] )
421
422   MDRV_DEVICE_ADD( "ppi8255_3", PPI8255 )
423   MDRV_DEVICE_CONFIG( ppi8255_intf[3] )
424
425   MDRV_DEVICE_ADD( "ppi8255_4", PPI8255 )
426   MDRV_DEVICE_CONFIG( ppi8255_intf[4] )
427
380428   /* video hardware */
381429   MDRV_SCREEN_ADD("main", RASTER)
382430   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/compgolf.c
r2454r2455
201201
202202static const struct YM2203interface ym2203_interface =
203203{
204   0,
205   0,
206   compgolf_scrollx_lo_w,
207   compgolf_scrolly_lo_w,
204   {
205         AY8910_LEGACY_OUTPUT,
206         AY8910_DEFAULT_LOADS,
207         NULL,
208         NULL,
209         compgolf_scrollx_lo_w,
210         compgolf_scrolly_lo_w,
211   },
208212   sound_irq
209213};
210214
src/mame/drivers/cps2.c
r2454r2455
646646   }
647647   scancount++;
648648
649   if(cps1_output[0x50/2] & 0x8000)
650      cps1_output[0x50/2] = cps1_output[0x50/2] & 0x1ff;
651   if(cps1_output[0x52/2] & 0x8000)
652      cps1_output[0x52/2] = cps1_output[0x52/2] & 0x1ff;
649   if (cps1_cps_b_regs[0x10/2] & 0x8000)
650      cps1_cps_b_regs[0x10/2] = cps1_cps_b_regs[0x10/2] & 0x1ff;
651   if (cps1_cps_b_regs[0x12/2] & 0x8000)
652      cps1_cps_b_regs[0x12/2] = cps1_cps_b_regs[0x12/2] & 0x1ff;
653653
654//  popmessage("%04x %04x - %04x %04x",cps1_scanline1,cps1_scanline2,cps1_output[0x50/2],cps1_output[0x52/2]);
654//  popmessage("%04x %04x - %04x %04x",cps1_scanline1,cps1_scanline2,cps1_cps_b_regs[0x10/2],cps1_cps_b_regs[0x12/2]);
655655
656656   /* raster effects */
657657   if(cps1_scanline1 == scancount || (cps1_scanline1 < scancount && !cps1_scancalls))
658658   {
659      cps1_output[0x50/2] = 0;
659      cps1_cps_b_regs[0x10/2] = 0;
660660      cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
661661      cps2_set_sprite_priorities();
662662      video_screen_update_partial(machine->primary_screen, 16 - 10 + scancount);   /* visarea.min_y - [first visible line?] + scancount */
r2454r2455
667667   /* raster effects */
668668   if(cps1_scanline2 == scancount || (cps1_scanline2 < scancount && !cps1_scancalls))
669669   {
670      cps1_output[0x52/2] = 0;
670      cps1_cps_b_regs[0x12/2] = 0;
671671      cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
672672      cps2_set_sprite_priorities();
673673      video_screen_update_partial(machine->primary_screen, 16 - 10 + scancount);   /* visarea.min_y - [first visible line?] + scancount */
r2454r2455
677677
678678   if(scancount == 256)  /* VBlank */
679679   {
680      cps1_output[0x50/2] = cps1_scanline1;
681      cps1_output[0x52/2] = cps1_scanline2;
680      cps1_cps_b_regs[0x10/2] = cps1_scanline1;
681      cps1_cps_b_regs[0x12/2] = cps1_scanline2;
682682      cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
683683      if(cps1_scancalls)
684684      {
r2454r2455
863863static ADDRESS_MAP_START( cps2_readmem, ADDRESS_SPACE_PROGRAM, 16 )
864864   AM_RANGE(0x000000, 0x3fffff) AM_READ(SMH_ROM)                   /* 68000 ROM */
865865   AM_RANGE(0x400000, 0x40000b) AM_READ(SMH_RAM)                   /* CPS2 object output */
866   AM_RANGE(0x618000, 0x619fff) AM_READ(qsound_sharedram1_r)         /* Q RAM */
866   AM_RANGE(0x618000, 0x619fff) AM_READ(qsound_sharedram1_r)       /* Q RAM */
867867   AM_RANGE(0x662000, 0x662001) AM_READ(SMH_RAM)                   /* Network adapter related, accessed in SSF2TB */
868868   AM_RANGE(0x662008, 0x662009) AM_READ(SMH_RAM)                   /* Network adapter related, accessed in SSF2TB */
869869   AM_RANGE(0x662020, 0x662021) AM_READ(SMH_RAM)                   /* Network adapter related, accessed in SSF2TB */
870870   AM_RANGE(0x660000, 0x663fff) AM_READ(SMH_RAM)                   /* When bit 14 of 0x804030 equals 0 this space is available. Many games store highscores and other info here if available. */
871871   AM_RANGE(0x664000, 0x664001) AM_READ(SMH_RAM)                   /* Unknown - Only used if 0x660000-0x663fff available (could be RAM enable?) */
872   AM_RANGE(0x708000, 0x709fff) AM_READ(cps2_objram2_r)              /* Object RAM */
873   AM_RANGE(0x70a000, 0x70bfff) AM_READ(cps2_objram2_r)              /* mirror */
874   AM_RANGE(0x70c000, 0x70dfff) AM_READ(cps2_objram2_r)              /* mirror */
875   AM_RANGE(0x70e000, 0x70ffff) AM_READ(cps2_objram2_r)              /* mirror */
876   AM_RANGE(0x800100, 0x8001ff) AM_READ(cps1_output_r)               /* Output ports mirror (sfa) */
877   AM_RANGE(0x804000, 0x804001) AM_READ_PORT("IN0")                  /* IN0 */
878   AM_RANGE(0x804010, 0x804011) AM_READ_PORT("IN1")                  /* IN1 */
879   AM_RANGE(0x804020, 0x804021) AM_READ_PORT("IN2")                  /* IN2 + EEPROM */
880   AM_RANGE(0x804030, 0x804031) AM_READ(cps2_qsound_volume_r)        /* Master volume. Also when bit 14=0 addon memory is present, when bit 15=0 network adapter present. */
881   AM_RANGE(0x8040b0, 0x8040b3) AM_READ(kludge_r)                    /* unknown (xmcotaj hangs if this is 0) */
882   AM_RANGE(0x804100, 0x8041ff) AM_READ(cps1_output_r)               /* CPS1 Output ports */
872   AM_RANGE(0x708000, 0x709fff) AM_READ(cps2_objram2_r)            /* Object RAM */
873   AM_RANGE(0x70a000, 0x70bfff) AM_READ(cps2_objram2_r)            /* mirror */
874   AM_RANGE(0x70c000, 0x70dfff) AM_READ(cps2_objram2_r)            /* mirror */
875   AM_RANGE(0x70e000, 0x70ffff) AM_READ(cps2_objram2_r)            /* mirror */
876   AM_RANGE(0x800140, 0x80017f) AM_READ(cps1_cps_b_r)              /* mirror (sfa) */
877   AM_RANGE(0x804000, 0x804001) AM_READ_PORT("IN0")                /* IN0 */
878   AM_RANGE(0x804010, 0x804011) AM_READ_PORT("IN1")                /* IN1 */
879   AM_RANGE(0x804020, 0x804021) AM_READ_PORT("IN2")                /* IN2 + EEPROM */
880   AM_RANGE(0x804030, 0x804031) AM_READ(cps2_qsound_volume_r)      /* Master volume. Also when bit 14=0 addon memory is present, when bit 15=0 network adapter present. */
881   AM_RANGE(0x8040b0, 0x8040b3) AM_READ(kludge_r)                  /* unknown (xmcotaj hangs if this is 0) */
882   AM_RANGE(0x804140, 0x80417f) AM_READ(cps1_cps_b_r)              /* CPS-B custom */
883883   AM_RANGE(0x900000, 0x92ffff) AM_READ(SMH_RAM)                   /* Video RAM */
884884   AM_RANGE(0xff0000, 0xffffff) AM_READ(SMH_RAM)                   /* RAM */
885885ADDRESS_MAP_END
r2454r2455
898898   AM_RANGE(0x70a000, 0x70bfff) AM_WRITE(cps2_objram2_w)             /* mirror */
899899   AM_RANGE(0x70c000, 0x70dfff) AM_WRITE(cps2_objram2_w)             /* mirror */
900900   AM_RANGE(0x70e000, 0x70ffff) AM_WRITE(cps2_objram2_w)             /* mirror */
901   AM_RANGE(0x800100, 0x8001ff) AM_WRITE(cps1_output_w)              /* Output ports mirror (sfa) */
901   AM_RANGE(0x800100, 0x80013f) AM_WRITE(cps1_cps_a_w) AM_BASE(&cps1_cps_a_regs)   /* mirror (sfa) */
902   AM_RANGE(0x800140, 0x80017f) AM_WRITE(cps1_cps_b_w) AM_BASE(&cps1_cps_b_regs)   /* mirror (sfa) */
902903   AM_RANGE(0x804040, 0x804041) AM_WRITE(cps2_eeprom_port_w)         /* EEPROM */
903904   AM_RANGE(0x8040a0, 0x8040a1) AM_WRITE(SMH_NOP)                  /* Unknown (reset once on startup) */
904905   AM_RANGE(0x8040e0, 0x8040e1) AM_WRITE(cps2_objram_bank_w)         /* bit 0 = Object ram bank swap */
905   AM_RANGE(0x804100, 0x8041ff) AM_WRITE(cps1_output_w) AM_BASE(&cps1_output) AM_SIZE(&cps1_output_size)     /* Output ports */
906   AM_RANGE(0x804100, 0x80413f) AM_WRITE(cps1_cps_a_w) AM_BASE(&cps1_cps_a_regs)   /* CPS-A custom */
907   AM_RANGE(0x804140, 0x80417f) AM_WRITE(cps1_cps_b_w) AM_BASE(&cps1_cps_b_regs)   /* CPS-B custom */
906908   AM_RANGE(0x900000, 0x92ffff) AM_WRITE(cps1_gfxram_w) AM_BASE(&cps1_gfxram) AM_SIZE(&cps1_gfxram_size)
907909   AM_RANGE(0xff0000, 0xffffff) AM_WRITE(SMH_RAM)                  /* RAM */
908910ADDRESS_MAP_END
r2454r2455
71757177GAME( 1993, ssf2tb,   ssf2,     cps2, cps2_2p6b, ssf2tb,   ROT0,   "Capcom", "Super Street Fighter II: The Tournament Battle (World 931119)", 0 )   // works, but not in tournament mode
71767178GAME( 1993, ssf2tbr1, ssf2,     cps2, cps2_2p6b, ssf2tb,   ROT0,   "Capcom", "Super Street Fighter II: The Tournament Battle (World 930911)", 0 )   // works, but not in tournament mode
71777179GAME( 1993, ssf2tbj,  ssf2,     cps2, cps2_2p6b, ssf2tb,   ROT0,   "Capcom", "Super Street Fighter II: The Tournament Battle (Japan 930911)", 0 )   // works, but not in tournament mode
7180GAME( 1993, ecofghtr, 0,        cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Eco Fighters (World 931203)", 0 )
7181GAME( 1993, ecofghtu, ecofghtr, cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Eco Fighters (USA 940215)", 0 )
7182GAME( 1993, ecofgtu1, ecofghtr, cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Eco Fighters (USA 931203)", 0 )
7183GAME( 1993, uecology, ecofghtr, cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Ultimate Ecology (Japan 931203)", 0 )
7184GAME( 1993, ecofghta, ecofghtr, cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Eco Fighters (Asia 931203)", 0 )
71787185GAME( 1993, ddtod,    0,        cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Euro 940412)", 0 )
71797186GAME( 1993, ddtodr1,  ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Euro 940113)", 0 )
71807187GAME( 1993, ddtodu,   ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (USA 940125)", 0 )
r2454r2455
71847191GAME( 1993, ddtodjr2, ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Japan 940113)", 0 )
71857192GAME( 1993, ddtoda,   ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Asia 940113)", 0 )
71867193GAME( 1993, ddtodh,   ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Hispanic 940125)", 0 )
7187GAME( 1993, ecofghtr, 0,        cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Eco Fighters (World 931203)", 0 )
7188GAME( 1993, ecofghtu, ecofghtr, cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Eco Fighters (USA 940215)", 0 )
7189GAME( 1993, ecofgtu1, ecofghtr, cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Eco Fighters (USA 931203)", 0 )
7190GAME( 1993, uecology, ecofghtr, cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Ultimate Ecology (Japan 931203)", 0 )
7191GAME( 1993, ecofghta, ecofghtr, cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Eco Fighters (Asia 931203)", 0 )
71927194GAME( 1994, ssf2t,    ssf2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Super Street Fighter II Turbo (World 940223)", 0 )
71937195GAME( 1994, ssf2ta,   ssf2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Super Street Fighter II Turbo (Asia 940223)", 0 )
71947196GAME( 1994, ssf2tu,   ssf2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Super Street Fighter II Turbo (USA 940323)", 0 )
71957197GAME( 1994, ssf2tur1, ssf2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Super Street Fighter II Turbo (USA 940223)", 0 )
71967198GAME( 1994, ssf2xj,   ssf2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Super Street Fighter II X: Grand Master Challenge (Japan 940223)", 0 )
7197GAME( 1994, xmcota,   0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (Euro 950105)", 0 )
7198GAME( 1994, xmcotau,  xmcota,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (USA 950105)", 0 )
7199GAME( 1994, xmcotah,  xmcota,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (Hispanic 950331)", 0 )
7200GAME( 1994, xmcotaj,  xmcota,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (Japan 941222)", 0 )
7201GAME( 1994, xmcotaj1, xmcota,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (Japan 941219)", 0 )
7202GAME( 1994, xmcotaj2, xmcota,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (Japan 941217)", 0 )
7203GAME( 1994, xmcotajr, xmcota,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (Japan 941208 rent version)", 0 )
7204GAME( 1994, xmcotaa,  xmcota,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (Asia 941217)", 0 )
7205GAME( 1994, armwar,   0,        cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Armored Warriors (Euro 941024)", 0 )
7206GAME( 1994, armwarr1, armwar,   cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Armored Warriors (Euro 941011)", 0 )
7207GAME( 1994, armwaru,  armwar,   cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Armored Warriors (USA 941024)", 0 )
7208GAME( 1994, pgear,    armwar,   cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Powered Gear: Strategic Variant Armor Equipment (Japan 941024)", 0 )
7209GAME( 1994, pgearr1,  armwar,   cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Powered Gear: Strategic Variant Armor Equipment (Japan 940916)", 0 )
7210GAME( 1994, armwara,  armwar,   cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Armored Warriors (Asia 940920)", 0 )
72117199GAME( 1994, avsp,     0,        cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Alien vs. Predator (Euro 940520)", 0 )
72127200GAME( 1994, avspu,    avsp,     cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Alien vs. Predator (USA 940520)", 0 )
72137201GAME( 1994, avspj,    avsp,     cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Alien vs. Predator (Japan 940520)", 0 )
r2454r2455
72237211GAME( 1994, ringdest, 0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Ring of Destruction: Slammasters II (Euro 940902)", 0 )
72247212GAME( 1994, smbomb,   ringdest, cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Super Muscle Bomber: The International Blowout (Japan 940831)", 0 )
72257213GAME( 1994, smbombr1, ringdest, cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Super Muscle Bomber: The International Blowout (Japan 940808)", 0 )
7226GAME( 1995, cybots,   0,        cps2, cybots,    cps2,     ROT0,   "Capcom", "Cyberbots: Fullmetal Madness (Euro 950424)", 0 )
7227GAME( 1995, cybotsu,  cybots,   cps2, cybots,    cps2,     ROT0,   "Capcom", "Cyberbots: Fullmetal Madness (USA 950424)", 0 )
7228GAME( 1995, cybotsj,  cybots,   cps2, cybots,    cps2,     ROT0,   "Capcom", "Cyberbots: Fullmetal Madness (Japan 950420)", 0 )
7229GAME( 1995, msh,      0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes (Euro 951024)", 0 )
7230GAME( 1995, mshu,     msh,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes (USA 951024)", 0 )
7231GAME( 1995, mshj,     msh,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes (Japan 951117)", 0 )
7232GAME( 1995, mshjr1,   msh,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes (Japan 951024)", 0 )
7233GAME( 1995, msha,     msh,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes (Asia 951024)", 0 )
7234GAME( 1995, mshh,     msh,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes (Hispanic 951117)", 0 )
7235GAME( 1995, mshb,     msh,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes (Brazil 951117)", 0 )
7214GAME( 1994, armwar,   0,        cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Armored Warriors (Euro 941024)", 0 )
7215GAME( 1994, armwarr1, armwar,   cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Armored Warriors (Euro 941011)", 0 )
7216GAME( 1994, armwaru,  armwar,   cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Armored Warriors (USA 941024)", 0 )
7217GAME( 1994, pgear,    armwar,   cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Powered Gear: Strategic Variant Armor Equipment (Japan 941024)", 0 )
7218GAME( 1994, pgearr1,  armwar,   cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Powered Gear: Strategic Variant Armor Equipment (Japan 940916)", 0 )
7219GAME( 1994, armwara,  armwar,   cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Armored Warriors (Asia 940920)", 0 )
7220GAME( 1994, xmcota,   0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (Euro 950105)", 0 )
7221GAME( 1994, xmcotau,  xmcota,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (USA 950105)", 0 )
7222GAME( 1994, xmcotah,  xmcota,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (Hispanic 950331)", 0 )
7223GAME( 1994, xmcotaj,  xmcota,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (Japan 941222)", 0 )
7224GAME( 1994, xmcotaj1, xmcota,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (Japan 941219)", 0 )
7225GAME( 1994, xmcotaj2, xmcota,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (Japan 941217)", 0 )
7226GAME( 1994, xmcotajr, xmcota,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (Japan 941208 rent version)", 0 )
7227GAME( 1994, xmcotaa,  xmcota,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (Asia 941217)", 0 )
72367228GAME( 1995, nwarr,    0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Night Warriors: Darkstalkers' Revenge (Euro 950316)", 0 )
72377229GAME( 1995, nwarru,   nwarr,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Night Warriors: Darkstalkers' Revenge (USA 950406)", 0 )
72387230GAME( 1995, nwarrh,   nwarr,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Night Warriors: Darkstalkers' Revenge (Hispanic 950403)", 0 )
r2454r2455
72407232GAME( 1995, vhuntj,   nwarr,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Hunter: Darkstalkers' Revenge (Japan 950316)", 0 )
72417233GAME( 1995, vhuntjr1, nwarr,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Hunter: Darkstalkers' Revenge (Japan 950307)", 0 )
72427234GAME( 1995, vhuntjr2, nwarr,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Hunter: Darkstalkers' Revenge (Japan 950302)", 0 )
7235GAME( 1995, cybots,   0,        cps2, cybots,    cps2,     ROT0,   "Capcom", "Cyberbots: Fullmetal Madness (Euro 950424)", 0 )
7236GAME( 1995, cybotsu,  cybots,   cps2, cybots,    cps2,     ROT0,   "Capcom", "Cyberbots: Fullmetal Madness (USA 950424)", 0 )
7237GAME( 1995, cybotsj,  cybots,   cps2, cybots,    cps2,     ROT0,   "Capcom", "Cyberbots: Fullmetal Madness (Japan 950420)", 0 )
72437238GAME( 1995, sfa,      0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Alpha: Warriors' Dreams (Euro 950727)", 0 )
72447239GAME( 1995, sfar1,    sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Alpha: Warriors' Dreams (Euro 950718)", 0 )
72457240GAME( 1995, sfar2,    sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Alpha: Warriors' Dreams (Euro 950627)", 0 )
r2454r2455
72547249GAME( 1995, sfzbr1,   sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero (Brazil 950727)", 0 )
72557250GAME( 1995, mmancp2u, megaman,  cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Mega Man - The Power Battle (CPS2, USA 951006, SAMPLE Version)", 0 )
72567251GAME( 1995, rmancp2j, megaman,  cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Rockman: The Power Battle (CPS2, Japan 950922)", 0 )
7252GAME( 1995, msh,      0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes (Euro 951024)", 0 )
7253GAME( 1995, mshu,     msh,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes (USA 951024)", 0 )
7254GAME( 1995, mshj,     msh,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes (Japan 951117)", 0 )
7255GAME( 1995, mshjr1,   msh,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes (Japan 951024)", 0 )
7256GAME( 1995, msha,     msh,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes (Asia 951024)", 0 )
7257GAME( 1995, mshh,     msh,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes (Hispanic 951117)", 0 )
7258GAME( 1995, mshb,     msh,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes (Brazil 951117)", 0 )
72577259GAME( 1996, 19xx,     0,        cps2, cps2_2p2b, cps2,     ROT270, "Capcom", "19XX: The War Against Destiny (USA 951207)", 0 )
72587260GAME( 1996, 19xxa,    19xx,     cps2, cps2_2p2b, cps2,     ROT270, "Capcom", "19XX: The War Against Destiny (Asia 951207)", 0 )
72597261GAME( 1996, 19xxj,    19xx,     cps2, cps2_2p2b, cps2,     ROT270, "Capcom", "19XX: The War Against Destiny (Japan 951225)", 0 )
r2454r2455
72707272GAME( 1996, ddsomjr1, ddsom,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (Japan 960206)", 0 )
72717273GAME( 1996, ddsoma,   ddsom,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (Asia 960619)", 0 )
72727274GAME( 1996, ddsomb,   ddsom,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (Brazil 960223)", 0 )
7273GAME( 1996, megaman2, 0,        cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Mega Man 2: The Power Fighters (USA 960708)", 0 )
7274GAME( 1996, megamn2a, megaman2, cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Mega Man 2: The Power Fighters (Asia 960708)", 0 )
7275GAME( 1996, rckman2j, megaman2, cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Rockman 2: The Power Fighters (Japan 960708)", 0 )
7276GAME( 1996, qndream,  0,        cps2, qndream,   cps2,     ROT0,   "Capcom", "Quiz Nanairo Dreams: Nijiirochou no Kiseki (Japan 960826)", 0 )
72777275GAME( 1996, sfa2,     0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Alpha 2 (USA 960306)", 0 )
72787276GAME( 1996, sfz2j,    sfa2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero 2 (Japan 960227)", 0 )
72797277GAME( 1996, sfz2a,    sfa2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero 2 (Asia 960227)", 0 )
r2454r2455
72887286GAME( 1996, spf2t,    0,        cps2, cps2_2p2b, cps2,     ROT0,   "Capcom", "Super Puzzle Fighter II Turbo (USA 960620)", 0 )
72897287GAME( 1996, spf2xj,   spf2t,    cps2, cps2_2p2b, cps2,     ROT0,   "Capcom", "Super Puzzle Fighter II X (Japan 960531)", 0 )
72907288GAME( 1996, spf2ta,   spf2t,    cps2, cps2_2p2b, cps2,     ROT0,   "Capcom", "Super Puzzle Fighter II Turbo (Asia 960529)", 0 )
7289GAME( 1996, megaman2, 0,        cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Mega Man 2: The Power Fighters (USA 960708)", 0 )
7290GAME( 1996, megamn2a, megaman2, cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Mega Man 2: The Power Fighters (Asia 960708)", 0 )
7291GAME( 1996, rckman2j, megaman2, cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Rockman 2: The Power Fighters (Japan 960708)", 0 )
7292GAME( 1996, qndream,  0,        cps2, qndream,   cps2,     ROT0,   "Capcom", "Quiz Nanairo Dreams: Nijiirochou no Kiseki (Japan 960826)", 0 )
72917293GAME( 1996, xmvsf,    0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men Vs. Street Fighter (Euro 961004)", 0 )
72927294GAME( 1996, xmvsfr1,  xmvsf,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men Vs. Street Fighter (Euro 960910)", 0 )
72937295GAME( 1996, xmvsfu,   xmvsf,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men Vs. Street Fighter (USA 961023)", 0 )
r2454r2455
73027304GAME( 1997, batcir,   0,        cps2, cps2_4p2b, cps2,     ROT0,   "Capcom", "Battle Circuit (Euro 970319)", 0 )
73037305GAME( 1997, batcira,  batcir,   cps2, cps2_4p2b, cps2,     ROT0,   "Capcom", "Battle Circuit (Asia 970319)", 0 )
73047306GAME( 1997, batcirj,  batcir,   cps2, cps2_4p2b, cps2,     ROT0,   "Capcom", "Battle Circuit (Japan 970319)", 0 )
7305GAME( 1997, csclub,   0,        cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Capcom Sports Club (Euro 970722)", 0 )
7306GAME( 1997, cscluba,  csclub,   cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Capcom Sports Club (Asia 970722)", 0 )
7307GAME( 1997, csclubj,  csclub,   cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Capcom Sports Club (Japan 970722)", 0 )
7308GAME( 1997, csclubh,  csclub,   cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Capcom Sports Club (Hispanic 970722)", 0 )
7307GAME( 1997, vsav,     0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Savior: The Lord of Vampire (Euro 970519)", 0 )
7308GAME( 1997, vsavu,    vsav,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Savior: The Lord of Vampire (USA 970519)", 0 )
7309GAME( 1997, vsavj,    vsav,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Savior: The Lord of Vampire (Japan 970519)", 0 )
7310GAME( 1997, vsava,    vsav,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Savior: The Lord of Vampire (Asia 970519)", 0 )
7311GAME( 1997, vsavh,    vsav,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Savior: The Lord of Vampire (Hispanic 970519)", 0 )
73097312GAME( 1997, mshvsf,   0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Euro 970625)", 0 )
73107313GAME( 1997, mshvsfu,  mshvsf,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (USA 970827)", 0 )
73117314GAME( 1997, mshvsfu1, mshvsf,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (USA 970625)", 0 )
r2454r2455
73177320GAME( 1997, mshvsfa1, mshvsf,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Asia 970620)", 0 )
73187321GAME( 1997, mshvsfb,  mshvsf,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Brazil 970827)", 0 )
73197322GAME( 1997, mshvsfb1, mshvsf,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Brazil 970625)", 0 )
7323GAME( 1997, csclub,   0,        cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Capcom Sports Club (Euro 970722)", 0 )
7324GAME( 1997, cscluba,  csclub,   cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Capcom Sports Club (Asia 970722)", 0 )
7325GAME( 1997, csclubj,  csclub,   cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Capcom Sports Club (Japan 970722)", 0 )
7326GAME( 1997, csclubh,  csclub,   cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Capcom Sports Club (Hispanic 970722)", 0 )
73207327GAME( 1997, sgemf,    0,        cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Super Gem Fighter Mini Mix (USA 970904)", 0 )
73217328GAME( 1997, pfghtj,   sgemf,    cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Pocket Fighter (Japan 970904)", 0 )
73227329GAME( 1997, sgemfa,   sgemf,    cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Super Gem Fighter: Mini Mix (Asia 970904)", 0 )
73237330GAME( 1997, sgemfh,   sgemf,    cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Super Gem Fighter: Mini Mix (Hispanic 970904)", 0 )
73247331GAME( 1997, vhunt2,   0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Hunter 2: Darkstalkers Revenge (Japan 970929)", 0 )
73257332GAME( 1997, vhunt2r1, vhunt2,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Hunter 2: Darkstalkers Revenge (Japan 970913)", 0 )
7326GAME( 1997, vsav,     0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Savior: The Lord of Vampire (Euro 970519)", 0 )
7327GAME( 1997, vsavu,    vsav,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Savior: The Lord of Vampire (USA 970519)", 0 )
7328GAME( 1997, vsavj,    vsav,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Savior: The Lord of Vampire (Japan 970519)", 0 )
7329GAME( 1997, vsava,    vsav,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Savior: The Lord of Vampire (Asia 970519)", 0 )
7330GAME( 1997, vsavh,    vsav,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Savior: The Lord of Vampire (Hispanic 970519)", 0 )
73317333GAME( 1997, vsav2,    0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Savior 2: The Lord of Vampire (Japan 970913)", 0 )
73327334GAME( 1998, mvsc,     0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Euro 980112)", 0 )
73337335GAME( 1998, mvscu,    mvsc,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (USA 980123)", 0 )
src/mame/drivers/lordgun.c
r2454r2455
152152//  popmessage("PR: %04x", data);
153153}
154154
155static READ16_HANDLER( lordgun_ppi8255_0_r )   {   return ppi8255_0_r(machine, offset);   }
156static READ16_HANDLER( lordgun_ppi8255_1_r )   {   return ppi8255_1_r(machine, offset);   }
155static READ16_DEVICE_HANDLER( lordgun_ppi8255_r )   {   return ppi8255_r(device, offset);   }
157156
158static WRITE16_HANDLER( lordgun_ppi8255_0_w )   {   ppi8255_0_w(machine, offset, data & 0xff);   }
159static WRITE16_HANDLER( lordgun_ppi8255_1_w )   {   ppi8255_1_w(machine, offset, data & 0xff);   }
157static WRITE16_DEVICE_HANDLER( lordgun_ppi8255_w )   {   ppi8255_w(device, offset, data & 0xff);   }
160158
161159static READ16_HANDLER( lordgun_gun_0_x_r )      { return lordgun_gun[0].hw_x; }
162160static READ16_HANDLER( lordgun_gun_0_y_r )      { return lordgun_gun[0].hw_y; }
r2454r2455
197195   AM_RANGE(0x503c00, 0x503c01) AM_READ(lordgun_gun_0_y_r)
198196   AM_RANGE(0x503e00, 0x503e01) AM_READ(lordgun_gun_1_y_r)
199197   AM_RANGE(0x504000, 0x504001) AM_WRITE(lordgun_soundlatch_w)
200   AM_RANGE(0x506000, 0x506007) AM_READWRITE(lordgun_ppi8255_0_r, lordgun_ppi8255_0_w)
201   AM_RANGE(0x508000, 0x508007) AM_READWRITE(lordgun_ppi8255_1_r, lordgun_ppi8255_1_w)
198   AM_RANGE(0x506000, 0x506007) AM_DEVREADWRITE(PPI8255, "ppi8255_0", lordgun_ppi8255_r, lordgun_ppi8255_w)
199   AM_RANGE(0x508000, 0x508007) AM_DEVREADWRITE(PPI8255, "ppi8255_1", lordgun_ppi8255_r, lordgun_ppi8255_w)
202200   AM_RANGE(0x50a900, 0x50a9ff) AM_RAM   // protection
203201ADDRESS_MAP_END
204202
r2454r2455
224222   AM_RANGE(0x502e00, 0x502e01) AM_WRITE(SMH_RAM) AM_BASE(&lordgun_scroll_y_3)
225223   AM_RANGE(0x503000, 0x503001) AM_WRITE(lordgun_priority_w)
226224   AM_RANGE(0x504000, 0x504001) AM_WRITE(lordgun_soundlatch_w)
227   AM_RANGE(0x506000, 0x506007) AM_READWRITE(lordgun_ppi8255_0_r, lordgun_ppi8255_0_w)
228   AM_RANGE(0x508000, 0x508007) AM_READWRITE(lordgun_ppi8255_1_r, lordgun_ppi8255_1_w)
225   AM_RANGE(0x506000, 0x506007) AM_DEVREADWRITE(PPI8255, "ppi8255_0", lordgun_ppi8255_r, lordgun_ppi8255_w)
226   AM_RANGE(0x508000, 0x508007) AM_DEVREADWRITE(PPI8255, "ppi8255_1", lordgun_ppi8255_r, lordgun_ppi8255_w)
229227   AM_RANGE(0x50b900, 0x50b9ff) AM_RAM   // protection
230228ADDRESS_MAP_END
231229
r2454r2455
409407
410408***************************************************************************/
411409
412static const ppi8255_interface ppi8255_intf =
410static const ppi8255_interface ppi8255_intf[2] =
413411{
414   2,   // 2 chips
415   { lordgun_eeprom_r,      input_port_1_r },      // Port A read
416   { 0,               input_port_2_r },      // Port B read
417   { input_port_3_r,      input_port_4_r },      // Port C read
418   { fake_w,            fake_w },            // Port A write
419   { lordgun_eeprom_w,      fake_w },            // Port B write
420   { fake2_w,            fake_w },            // Port C write
412   {
413      lordgun_eeprom_r,         // Port A read
414      NULL,                  // Port B read
415      input_port_3_r,            // Port C read
416      fake_w,                  // Port A write
417      lordgun_eeprom_w,         // Port B write
418      fake2_w                  // Port C write
419   },
420   {
421      input_port_1_r,            // Port A read
422      input_port_2_r,            // Port B read
423      input_port_4_r,            // Port C read
424      fake_w,                  // Port A write
425      fake_w,                  // Port B write
426      fake_w                  // Port C write
427   }
421428};
422429
423static MACHINE_RESET( lordgun )
424{
425   ppi8255_init(&ppi8255_intf);
426}
427
428430static void soundirq(int state)
429431{
430432   cpunum_set_input_line(Machine, 1, 0, state);
r2454r2455
444446   MDRV_CPU_PROGRAM_MAP(lordgun_soundmem_map,0)
445447   MDRV_CPU_IO_MAP(lordgun_soundio_map,0)
446448
447   MDRV_MACHINE_RESET(lordgun)
449   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
450   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
448451
452   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
453   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
454
449455   MDRV_NVRAM_HANDLER(93C46)
450456
451457   MDRV_GFXDECODE(lordgun)
src/mame/drivers/lemmings.c
r2454r2455
6969   g = (paletteram16[offset+1] >> 8) & 0xff;
7070   r = (paletteram16[offset+1] >> 0) & 0xff;
7171
72   palette_set_color(Machine,offset/2,MAKE_RGB(r,g,b));
72   palette_set_color(machine,offset/2,MAKE_RGB(r,g,b));
7373}
7474
7575static WRITE16_HANDLER( lemmings_sound_w )
r2454r2455
8080
8181static WRITE8_HANDLER( lemmings_sound_ack_w )
8282{
83   cpunum_set_input_line(Machine, 1,1,CLEAR_LINE);
83   cpunum_set_input_line(machine, 1,1,CLEAR_LINE);
8484}
8585
8686/******************************************************************************/
src/mame/drivers/pushman.c
r2454r2455
6363
6464   if (offset==1)
6565   {
66        cpunum_set_input_line(Machine, 2,M68705_IRQ_LINE,HOLD_LINE);
66        cpunum_set_input_line(machine, 2,M68705_IRQ_LINE,HOLD_LINE);
6767      cpu_spin();
6868      new_latch=0;
6969   }
r2454r2455
426426
427427static const struct YM2203interface ym2203_interface =
428428{
429   0,0,0,0,irqhandler
429   {
430         AY8910_LEGACY_OUTPUT,
431         AY8910_DEFAULT_LOADS,
432         NULL, NULL, NULL, NULL,
433   },
434   irqhandler
430435};
431436
432437
src/mame/drivers/zerozone.c
r2454r2455
2727
2828***************************************************************************/
2929#include "driver.h"
30#include "deprecat.h"
3130#include "sound/okim6295.h"
3231
3332VIDEO_START( zerozone );
src/mame/drivers/segag80r.c
r2454r2455
300300 *
301301 *************************************/
302302
303static READ8_HANDLER( sindbadm_portb_r )
304{
305   return input_port_read(machine, "FC");
306}
307
308
303309static WRITE8_HANDLER( sindbadm_soundport_w )
304310{
305311   soundlatch_w(machine,0,data);
r2454r2455
331337
332338/*************************************
333339 *
340 *  PPI 8255 configurations
341 *
342 *************************************/
343
344static const ppi8255_interface sindbadm_ppi_intf =
345{
346   NULL,
347   sindbadm_portb_r,
348   NULL,
349   sindbadm_soundport_w,
350   NULL,
351   sindbadm_misc_w
352};
353
354
355
356/*************************************
357 *
334358 *  Main CPU memory handlers
335359 *
336360 *************************************/
r2454r2455
355379ADDRESS_MAP_END
356380
357381
382static ADDRESS_MAP_START( main_ppi8255_portmap, ADDRESS_SPACE_IO, 8 )
383   ADDRESS_MAP_GLOBAL_MASK(0xff)
384   AM_RANGE(0x0c, 0x0f) AM_DEVREADWRITE(PPI8255, "ppi8255", ppi8255_r, ppi8255_w)
385   AM_RANGE(0xbe, 0xbf) AM_READWRITE(segag80r_video_port_r, segag80r_video_port_w)
386   AM_RANGE(0xf9, 0xf9) AM_MIRROR(0x04) AM_WRITE(coin_count_w)
387   AM_RANGE(0xf8, 0xfb) AM_READ(mangled_ports_r)
388   AM_RANGE(0xfc, 0xfc) AM_READ_PORT("FC")
389ADDRESS_MAP_END
390
391
358392static ADDRESS_MAP_START( sindbadm_portmap, ADDRESS_SPACE_IO, 8 )
359393   ADDRESS_MAP_GLOBAL_MASK(0xff)
360394   AM_RANGE(0x42, 0x43) AM_READWRITE(segag80r_video_port_r, segag80r_video_port_w)
395   AM_RANGE(0x80, 0x83) AM_DEVREADWRITE(PPI8255, "ppi8255", ppi8255_r, ppi8255_w)
361396   AM_RANGE(0xf8, 0xfb) AM_READ(mangled_ports_r)
362397ADDRESS_MAP_END
363398
r2454r2455
854889   /* basic machine hardware */
855890   MDRV_IMPORT_FROM(g80r_base)
856891
892   MDRV_CPU_MODIFY("main")
893   MDRV_CPU_IO_MAP(main_ppi8255_portmap,0)
894
857895   /* sound boards */
858896   MDRV_IMPORT_FROM(005_sound_board)
859897MACHINE_DRIVER_END
r2454r2455
881919   /* basic machine hardware */
882920   MDRV_IMPORT_FROM(g80r_base)
883921
922   MDRV_CPU_MODIFY("main")
923   MDRV_CPU_IO_MAP(main_ppi8255_portmap,0)
924
884925   /* background board changes */
885926   MDRV_GFXDECODE(monsterb)
886927   MDRV_PALETTE_LENGTH(64+64)
r2454r2455
913954   MDRV_CPU_IO_MAP(sindbadm_portmap,0)
914955   MDRV_CPU_VBLANK_INT("main", sindbadm_vblank_start)
915956
957   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
958   MDRV_DEVICE_CONFIG( sindbadm_ppi_intf )
959
916960   /* video hardware */
917961   MDRV_GFXDECODE(monsterb)
918962   MDRV_PALETTE_LENGTH(64+64)
r2454r2455
14141458
14151459   /* configure video */
14161460   segag80r_background_pcb = G80_BACKGROUND_NONE;
1417
1418   /* install the 8255 PPI for the sound board */
1419   memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, ppi8255_0_r, ppi8255_0_w);
14201461}
14211462
14221463
r2454r2455
14521493   /* install background board handlers */
14531494   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xb8, 0xbd, 0, 0, monsterb_back_port_w);
14541495   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, monsterb_vidram_w);
1455
1456   /* install Monster Bash sound board */
1457   memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, ppi8255_0_r, ppi8255_0_w);
14581496}
14591497
14601498
r2454r2455
14721510   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xb4, 0xb5, 0, 0, pignewt_back_color_w);
14731511   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xb8, 0xbd, 0, 0, pignewt_back_port_w);
14741512   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, pignewt_vidram_w);
1475
1476   /* install Monster Bash sound board */
1477   memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, ppi8255_0_r, ppi8255_0_w);
14781513}
14791514
14801515
r2454r2455
15001535
15011536static DRIVER_INIT( sindbadm )
15021537{
1503   static ppi8255_interface ppi_intf =
1504   {
1505      1,
1506      { 0 },
1507      { 0 },
1508      { 0 },
1509      { sindbadm_soundport_w },
1510      { 0 },
1511      { sindbadm_misc_w }
1512   };
1513
15141538   /* configure the encrypted Z80 */
15151539   sindbadm_decode();
15161540   sega_security(0);
r2454r2455
15211545   /* install background board handlers */
15221546   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x40, 0x41, 0, 0, sindbadm_back_port_w);
15231547   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, sindbadm_vidram_w);
1524
1525   /* install the 8255 PPI for the sound board */
1526   memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x80, 0x83, 0, 0, ppi8255_0_r, ppi8255_0_w);
1527   ppi_intf.portBread[0] = port_tag_to_handler8("FC");
1528   ppi8255_init(&ppi_intf);
15291548}
15301549
15311550
src/mame/drivers/magic10.c
r2454r2455
1818*/
1919
2020#include "driver.h"
21#include "deprecat.h"
2221#include "sound/okim6295.h"
2322
2423static tilemap *layer0_tilemap, *layer1_tilemap, *layer2_tilemap;
r2454r2455
4645static WRITE16_HANDLER( paletteram_w )
4746{
4847   data = COMBINE_DATA(&paletteram16[offset]);
49   palette_set_color_rgb( Machine, offset, pal4bit(data >> 4), pal4bit(data >> 0), pal4bit(data >> 8));
48   palette_set_color_rgb( machine, offset, pal4bit(data >> 4), pal4bit(data >> 0), pal4bit(data >> 8));
5049}
5150
5251static WRITE16_HANDLER( magic10_misc_w )
src/mame/drivers/hnayayoi.c
r2454r2455
604604
605605static const struct YM2203interface ym2203_interface =
606606{
607   input_port_0_r,
608   input_port_1_r,
609   0,
610   0,
607   {
608      AY8910_LEGACY_OUTPUT,
609      AY8910_DEFAULT_LOADS,
610      input_port_0_r,
611      input_port_1_r,
612      NULL,
613      NULL,
614   },
611615   irqhandler
612616};
613617
src/mame/drivers/shanghai.c
r2454r2455
972972
973973static const struct YM2203interface sh_ym2203_interface =
974974{
975   input_port_3_r,
976   input_port_4_r
975   {
976      AY8910_LEGACY_OUTPUT,
977      AY8910_DEFAULT_LOADS,
978      input_port_3_r,
979      input_port_4_r,
980      NULL,
981      NULL
982   },
983   NULL
977984};
978985
979986
src/mame/drivers/tmnt.c
r2454r2455
358358static WRITE8_HANDLER( sound_arm_nmi_w )
359359{
360360//  sound_nmi_enabled = 1;
361   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
361   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
362362   timer_set(ATTOTIME_IN_USEC(50), NULL,0,nmi_callback);   /* kludge until the K053260 is emulated correctly */
363363}
364364
r2454r2455
436436         {
437437            if ((program_read_word(0x180006 + 128*i) >> 8) == logical_pri)
438438            {
439               K053245_word_w(machine,8*i,hardware_pri,0xff00);
439               K053245_word_w(machine,8*i,hardware_pri,0x00ff);
440440               hardware_pri++;
441441            }
442442         }
r2454r2455
491491
492492   /* bit 3 is service button */
493493   /* bit 6 is ??? VBLANK? OBJMPX? */
494   res = input_port_2_word_r(machine,0,0);
494   res = input_port_read_indexed(machine,2);
495495   if (init_eeprom_count)
496496   {
497497      init_eeprom_count--;
r2454r2455
507507
508508   /* bit 0 is EEPROM data */
509509   /* bit 1 is EEPROM ready */
510   res = EEPROM_read_bit() | input_port_3_word_r(machine,0,0);
510   res = EEPROM_read_bit() | input_port_read_indexed(machine,3);
511511   return res;
512512}
513513
r2454r2455
520520   /* bit 1 is EEPROM ready */
521521   /* bit 2 is VBLANK (???) */
522522   /* bit 7 is service button */
523   res = EEPROM_read_bit() | input_port_3_word_r(machine,0,0);
523   res = EEPROM_read_bit() | input_port_read_indexed(machine,3);
524524   if (init_eeprom_count)
525525   {
526526      init_eeprom_count--;
r2454r2455
539539   /* bit 1 is EEPROM ready */
540540   /* bit 2 is VBLANK (???) */
541541   /* bit 3 is service button */
542   res = EEPROM_read_bit() | input_port_3_word_r(machine,0,0);
542   res = EEPROM_read_bit() | input_port_read_indexed(machine,3);
543543   if (init_eeprom_count)
544544   {
545545      init_eeprom_count--;
r2454r2455
598598{
599599   int res;
600600
601   res = input_port_0_word_r(machine,0,0);
601   res = input_port_read_indexed(machine,0);
602602   if (init_eeprom_count)
603603   {
604604      init_eeprom_count--;
r2454r2455
616616   /* bit 1 is EEPROM ready */
617617   /* bit 3 is VBLANK (???) */
618618   /* bit 7 is service button */
619   res = (EEPROM_read_bit() << 8) | input_port_1_word_r(machine,0,0);
619   res = (EEPROM_read_bit() << 8) | input_port_read_indexed(machine,1);
620620   toggle ^= 0x0800;
621621   return (res ^ toggle);
622622}
r2454r2455
636636
637637      /* bit 5 triggers IRQ on sound cpu */
638638      if (last == 0 && (data & 0x20) != 0)
639         cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
639         cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);
640640      last = data & 0x20;
641641
642642      /* bit 6 = enable char ROM reading through the video RAM */
r2454r2455
650650   /* bit 9 is service button */
651651   int res;
652652
653   res = input_port_0_word_r(machine,0,0);
653   res = input_port_read_indexed(machine,0);
654654   if (init_eeprom_count)
655655   {
656656      init_eeprom_count--;
r2454r2455
663663{
664664   /* bit 8 is EEPROM data */
665665   /* bit 9 is EEPROM ready */
666   return (EEPROM_read_bit() << 8) | input_port_1_word_r(machine,0,0);
666   return (EEPROM_read_bit() << 8) | input_port_read_indexed(machine,1);
667667}
668668
669669static WRITE16_HANDLER( prmrsocr_eeprom_w )
r2454r2455
824824static WRITE16_HANDLER( ssriders_soundkludge_w )
825825{
826826   /* I think this is more than just a trigger */
827   cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
827   cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);
828828}
829829
830830static ADDRESS_MAP_START( blswhstl_main_map, ADDRESS_SPACE_PROGRAM, 16 )
r2454r2455
916916      if (!(offs & 0x0031))
917917      {
918918         offs = ((offs & 0x000e) >> 1) | ((offs & 0x1fc0) >> 3);
919         K053245_word_w(machine, offs, data, 0);
919         K053245_word_w(machine, offs, data, 0xffff);
920920      }
921921   }
922922   else if (addr >= 0x104000/2 && addr <= 0x107fff/2) sunset_104000[addr-0x104000/2] = data;
src/mame/drivers/namcos12.c
r2454r2455
12071207static MACHINE_RESET( namcos12 )
12081208{
12091209   psx_machine_init();
1210   bankoffset_w(machine,0,0,0);
1210   bankoffset_w(machine,0,0,0xffffffff);
12111211
12121212   if( strcmp( machine->gamedrv->name, "tektagt" ) == 0 ||
12131213      strcmp( machine->gamedrv->name, "tektagta" ) == 0 ||
src/mame/drivers/raiden2.c
r2454r2455
1/* raiden 2 board test note 17/04/08 (based on test by dox)
2
3 rom banking is at 6c9, bit 0x80
4  -- the game only writes this directly at startup, must be written indirectly by
5     one of the protection commands? or mirrored?
6  value of 0x80 puts 0x00000-0x1ffff at 0x20000 - 0x3ffff
7  value of 0x00 puts 0x20000-0x3ffff at 0x20000 - 0x3ffff
8
9*/
10
111/*
2
312Raiden 2 Hardware
413
514Games on this PCB / Similar PCBs
r2454r2455
610619   COMBINE_DATA(&mainram[offset]);
611620   switch(offset) {
612621   default:
613      logerror("io_w %04x, %04x & %04x (%x)\n", offset*2, data, mem_mask ^ 0xffff, activecpu_get_pc());
622      logerror("io_w %04x, %04x & %04x (%x)\n", offset*2, data, mem_mask, activecpu_get_pc());
614623   }
615624}
616625
r2454r2455
638647         offset != 0x444/2 && offset != 0x6de/2 && offset != 0x47e/2 &&
639648         offset != 0x4a0/2 && offset != 0x620/2 && offset != 0x6c6/2 &&
640649         offset != 0x628/2 && offset != 0x62a/2)
641         logerror("mainram_w %04x, %04x & %04x (%x)\n", offset*2, data, mem_mask ^ 0xffff, activecpu_get_pc());
650         logerror("mainram_w %04x, %04x & %04x (%x)\n", offset*2, data, mem_mask, activecpu_get_pc());
642651   }
643652
644653   if(0 && c_w[offset]>1000 && !c_r[offset]) {
645654      if(offset != 0x4c0/2 && (offset<0x500/2 || offset > 0x503/2))
646         logerror("mainram_w %04x, %04x & %04x [%d.%d] (%x)\n", offset*2, data, mem_mask ^ 0xffff, c_w[offset], c_r[offset], activecpu_get_pc());
655         logerror("mainram_w %04x, %04x & %04x [%d.%d] (%x)\n", offset*2, data, mem_mask, c_w[offset], c_r[offset], activecpu_get_pc());
647656   }
648657
649658   //  if(offset == 0x471 || (offset >= 0xb146 && offset < 0xb156))
r2454r2455
654663   //  show = offset == 0x704 || offset == 0x710 || offset == 0x71c;
655664
656665   if(show)
657      logerror("mainram_w %04x, %04x & %04x (%x)\n", offset*2, data, mem_mask ^ 0xffff, activecpu_get_pc());
666      logerror("mainram_w %04x, %04x & %04x (%x)\n", offset*2, data, mem_mask, activecpu_get_pc());
658667
659668   //  if(offset == 0x700)
660669   //      cpu_setbank(2, memory_region(REGION_USER1)+0x20000*data);
r2454r2455
666675{
667676   COMBINE_DATA(&w1ram[offset]);
668677   if(0 && offset < 0x800/2)
669      logerror("w1x %05x, %04x & %04x (%05x)\n", offset*2+0x10000, data, mem_mask ^ 0xffff, activecpu_get_pc());
678      logerror("w1x %05x, %04x & %04x (%05x)\n", offset*2+0x10000, data, mem_mask, activecpu_get_pc());
670679}
671680
672681#ifdef UNUSED_FUNCTION
src/mame/drivers/scramble.c
r2454r2455
4141   AM_RANGE(0x5000, 0x50ff) AM_READ(SMH_RAM)
4242   AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
4343   AM_RANGE(0x7800, 0x7800) AM_READ(watchdog_reset_r)
44   AM_RANGE(0x8100, 0x8103) AM_READ(ppi8255_0_r)
45   AM_RANGE(0x8110, 0x8113) AM_READ(ppi8255_0_r)  /* mirror for Frog */
46   AM_RANGE(0x8200, 0x8203) AM_READ(ppi8255_1_r)
44   AM_RANGE(0x8100, 0x8103) AM_DEVREAD(PPI8255, "ppi8255_0", ppi8255_r)
45   AM_RANGE(0x8110, 0x8113) AM_DEVREAD(PPI8255, "ppi8255_0", ppi8255_r)  /* mirror for Frog */
46   AM_RANGE(0x8200, 0x8203) AM_DEVREAD(PPI8255, "ppi8255_1", ppi8255_r)
4747ADDRESS_MAP_END
4848
4949static ADDRESS_MAP_START( scramble_writemem, ADDRESS_SPACE_PROGRAM, 8 )
r2454r2455
6060   AM_RANGE(0x6804, 0x6804) AM_WRITE(galaxold_stars_enable_w)
6161   AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxold_flip_screen_x_w)
6262   AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxold_flip_screen_y_w)
63   AM_RANGE(0x8100, 0x8103) AM_WRITE(ppi8255_0_w)
64   AM_RANGE(0x8200, 0x8203) AM_WRITE(ppi8255_1_w)
63   AM_RANGE(0x8100, 0x8103) AM_DEVWRITE(PPI8255, "ppi8255_0", ppi8255_w)
64   AM_RANGE(0x8200, 0x8203) AM_DEVWRITE(PPI8255, "ppi8255_1", ppi8255_w)
6565ADDRESS_MAP_END
6666
6767
r2454r2455
142142static ADDRESS_MAP_START( ckongs_readmem, ADDRESS_SPACE_PROGRAM, 8 )
143143   AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM)
144144   AM_RANGE(0x6000, 0x6bff) AM_READ(SMH_RAM)
145   AM_RANGE(0x7000, 0x7003) AM_READ(ppi8255_0_r)
146   AM_RANGE(0x7800, 0x7803) AM_READ(ppi8255_1_r)
145   AM_RANGE(0x7000, 0x7003) AM_DEVREAD(PPI8255, "ppi8255_0", ppi8255_r)
146   AM_RANGE(0x7800, 0x7803) AM_DEVREAD(PPI8255, "ppi8255_1", ppi8255_r)
147147   AM_RANGE(0x9000, 0x93ff) AM_READ(SMH_RAM)
148148   AM_RANGE(0x9800, 0x98ff) AM_READ(SMH_RAM)
149149   AM_RANGE(0xb000, 0xb000) AM_READ(watchdog_reset_r)
r2454r2455
152152static ADDRESS_MAP_START( ckongs_writemem, ADDRESS_SPACE_PROGRAM, 8 )
153153   AM_RANGE(0x0000, 0x5fff) AM_WRITE(SMH_ROM)
154154   AM_RANGE(0x6000, 0x6bff) AM_WRITE(SMH_RAM)
155   AM_RANGE(0x7000, 0x7003) AM_WRITE(ppi8255_0_w)
156   AM_RANGE(0x7800, 0x7803) AM_WRITE(ppi8255_1_w)
155   AM_RANGE(0x7000, 0x7003) AM_DEVWRITE(PPI8255, "ppi8255_0", ppi8255_w)
156   AM_RANGE(0x7800, 0x7803) AM_DEVWRITE(PPI8255, "ppi8255_1", ppi8255_w)
157157   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
158158   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
159159   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
r2454r2455
166166ADDRESS_MAP_END
167167
168168
169static READ8_HANDLER(mars_ppi8255_0_r)
169static READ8_DEVICE_HANDLER(mars_ppi8255_r)
170170{
171   return ppi8255_0_r(machine, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01));
171   return ppi8255_r(device, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01));
172172}
173173
174static READ8_HANDLER(mars_ppi8255_1_r)
174static WRITE8_DEVICE_HANDLER(mars_ppi8255_w)
175175{
176   return ppi8255_1_r(machine, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01));
176   ppi8255_w(device, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01), data);
177177}
178178
179static WRITE8_HANDLER(mars_ppi8255_0_w)
180{
181   ppi8255_0_w(machine, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01), data);
182}
183179
184static WRITE8_HANDLER(mars_ppi8255_1_w)
185{
186   ppi8255_1_w(machine, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01), data);
187}
188
189
190180static ADDRESS_MAP_START( mars_readmem, ADDRESS_SPACE_PROGRAM, 8 )
191181   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
192182   AM_RANGE(0x4000, 0x4bff) AM_READ(SMH_RAM)
r2454r2455
194184   AM_RANGE(0x5000, 0x50ff) AM_READ(SMH_RAM)
195185   AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
196186   AM_RANGE(0x7000, 0x7000) AM_READ(SMH_NOP)
197   AM_RANGE(0x8100, 0x810f) AM_READ(mars_ppi8255_0_r)
198   AM_RANGE(0x8200, 0x820f) AM_READ(mars_ppi8255_1_r)
187   AM_RANGE(0x8100, 0x810f) AM_DEVREAD(PPI8255, "ppi8255_0", mars_ppi8255_r)
188   AM_RANGE(0x8200, 0x820f) AM_DEVREAD(PPI8255, "ppi8255_1", mars_ppi8255_r)
199189ADDRESS_MAP_END
200190
201191static ADDRESS_MAP_START( mars_writemem, ADDRESS_SPACE_PROGRAM, 8 )
r2454r2455
212202   AM_RANGE(0x6808, 0x6808) AM_WRITE(galaxold_coin_counter_0_w)
213203   AM_RANGE(0x6809, 0x6809) AM_WRITE(galaxold_flip_screen_x_w)
214204   AM_RANGE(0x680b, 0x680b) AM_WRITE(galaxold_flip_screen_y_w)
215   AM_RANGE(0x8100, 0x810f) AM_WRITE(mars_ppi8255_0_w)
216   AM_RANGE(0x8200, 0x820f) AM_WRITE(mars_ppi8255_1_w)
205   AM_RANGE(0x8100, 0x810f) AM_DEVWRITE(PPI8255, "ppi8255_0", mars_ppi8255_w)
206   AM_RANGE(0x8200, 0x820f) AM_DEVWRITE(PPI8255, "ppi8255_1", mars_ppi8255_w)
217207ADDRESS_MAP_END
218208
219209
r2454r2455
223213   AM_RANGE(0x4c00, 0x4fff) AM_READ(galaxold_videoram_r)
224214   AM_RANGE(0x5000, 0x50ff) AM_READ(SMH_RAM)
225215   AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
226   AM_RANGE(0x8200, 0x820f) AM_READ(mars_ppi8255_1_r)
216   AM_RANGE(0x8200, 0x820f) AM_DEVREAD(PPI8255, "ppi8255_1", mars_ppi8255_r)
227217   AM_RANGE(0xa000, 0xafff) AM_READ(SMH_ROM)
228   AM_RANGE(0xc100, 0xc10f) AM_READ(mars_ppi8255_0_r)
218   AM_RANGE(0xc100, 0xc10f) AM_DEVREAD(PPI8255, "ppi8255_0", mars_ppi8255_r)
229219ADDRESS_MAP_END
230220
231221static ADDRESS_MAP_START( newsin7_writemem, ADDRESS_SPACE_PROGRAM, 8 )
r2454r2455
242232   AM_RANGE(0x6808, 0x6808) AM_WRITE(galaxold_coin_counter_0_w)
243233   AM_RANGE(0x6809, 0x6809) AM_WRITE(galaxold_flip_screen_x_w)
244234   AM_RANGE(0x680b, 0x680b) AM_WRITE(galaxold_flip_screen_y_w)
245   AM_RANGE(0x8200, 0x820f) AM_WRITE(mars_ppi8255_1_w)
235   AM_RANGE(0x8200, 0x820f) AM_DEVWRITE(PPI8255, "ppi8255_1", mars_ppi8255_w)
246236   AM_RANGE(0xa000, 0xafff) AM_WRITE(SMH_ROM)
247   AM_RANGE(0xc100, 0xc10f) AM_WRITE(mars_ppi8255_0_w)
237   AM_RANGE(0xc100, 0xc10f) AM_DEVWRITE(PPI8255, "ppi8255_0", mars_ppi8255_w)
248238ADDRESS_MAP_END
249239
250240
r2454r2455
262252   AM_RANGE(0x6808, 0x6808) AM_WRITE(galaxold_coin_counter_0_w)
263253   AM_RANGE(0x6809, 0x6809) AM_WRITE(galaxold_flip_screen_x_w)
264254   AM_RANGE(0x680b, 0x680b) AM_WRITE(galaxold_flip_screen_y_w)
265   AM_RANGE(0x8100, 0x810f) AM_WRITE(mars_ppi8255_0_w)
266   AM_RANGE(0x8200, 0x820f) AM_WRITE(mars_ppi8255_1_w)
255   AM_RANGE(0x8100, 0x810f) AM_DEVWRITE(PPI8255, "ppi8255_0", mars_ppi8255_w)
256   AM_RANGE(0x8200, 0x820f) AM_DEVWRITE(PPI8255, "ppi8255_1", mars_ppi8255_w)
267257ADDRESS_MAP_END
268258
269259
r2454r2455
300290
301291static ADDRESS_MAP_START( hunchbks_readmem, ADDRESS_SPACE_PROGRAM, 8 )
302292   AM_RANGE(0x0000, 0x0fff) AM_READ(SMH_ROM)
303   AM_RANGE(0x1210, 0x1213) AM_READ(ppi8255_1_r)
293   AM_RANGE(0x1210, 0x1213) AM_DEVREAD(PPI8255, "ppi8255_1", ppi8255_r)
304294   AM_RANGE(0x1400, 0x14ff) AM_READ(SMH_RAM)
305   AM_RANGE(0x1500, 0x1503) AM_READ(ppi8255_0_r)
295   AM_RANGE(0x1500, 0x1503) AM_DEVREAD(PPI8255, "ppi8255_0", ppi8255_r)
306296   AM_RANGE(0x1680, 0x1680) AM_READ(watchdog_reset_r)
307297   AM_RANGE(0x1780, 0x1780) AM_READ(watchdog_reset_r)
308298   AM_RANGE(0x1800, 0x1fff) AM_READ(SMH_RAM)
r2454r2455
316306
317307static ADDRESS_MAP_START( hunchbks_writemem, ADDRESS_SPACE_PROGRAM, 8 )
318308   AM_RANGE(0x0000, 0x0fff) AM_WRITE(SMH_ROM)
319   AM_RANGE(0x1210, 0x1213) AM_WRITE(ppi8255_1_w)
309   AM_RANGE(0x1210, 0x1213) AM_DEVWRITE(PPI8255, "ppi8255_1", ppi8255_w)
320310   AM_RANGE(0x1400, 0x143f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
321311   AM_RANGE(0x1440, 0x145f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
322312   AM_RANGE(0x1460, 0x147f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
323313   AM_RANGE(0x1480, 0x14ff) AM_WRITE(SMH_RAM)
324   AM_RANGE(0x1500, 0x1503) AM_WRITE(ppi8255_0_w)
314   AM_RANGE(0x1500, 0x1503) AM_DEVWRITE(PPI8255, "ppi8255_0", ppi8255_w)
325315   AM_RANGE(0x1606, 0x1606) AM_WRITE(galaxold_flip_screen_x_w)
326316   AM_RANGE(0x1607, 0x1607) AM_WRITE(galaxold_flip_screen_y_w)
327317   AM_RANGE(0x1800, 0x1bff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
r2454r2455
341331   AM_RANGE(0x4400, 0x4bff) AM_READ(SMH_RAM)
342332   AM_RANGE(0x5000, 0x50ff) AM_READ(SMH_RAM)
343333   AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
344   AM_RANGE(0x8100, 0x8103) AM_READ(ppi8255_0_r)
345   AM_RANGE(0x8200, 0x8203) AM_READ(ppi8255_1_r)
334   AM_RANGE(0x8100, 0x8103) AM_DEVREAD(PPI8255, "ppi8255_0", ppi8255_r)
335   AM_RANGE(0x8200, 0x8203) AM_DEVREAD(PPI8255, "ppi8255_1", ppi8255_r)
346336   AM_RANGE(0xc000, 0xffff) AM_READ(SMH_ROM)
347337ADDRESS_MAP_END
348338
r2454r2455
359349   AM_RANGE(0x6800, 0x6802) AM_WRITE(galaxold_gfxbank_w)
360350   AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxold_flip_screen_x_w)
361351   AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxold_flip_screen_y_w)
362   AM_RANGE(0x8100, 0x8103) AM_WRITE(ppi8255_0_w)
363   AM_RANGE(0x8200, 0x8203) AM_WRITE(ppi8255_1_w)
352   AM_RANGE(0x8100, 0x8103) AM_DEVWRITE(PPI8255, "ppi8255_0", ppi8255_w)
353   AM_RANGE(0x8200, 0x8203) AM_DEVWRITE(PPI8255, "ppi8255_1", ppi8255_w)
364354   AM_RANGE(0xc000, 0xffff) AM_WRITE(SMH_ROM)
365355ADDRESS_MAP_END
366356
367357
368static READ8_HANDLER(frogf_ppi8255_0_r)
358static READ8_DEVICE_HANDLER(frogf_ppi8255_r)
369359{
370   return ppi8255_0_r(machine, offset >> 3);
360   return ppi8255_r(device, offset >> 3);
371361}
372362
373static READ8_HANDLER(frogf_ppi8255_1_r)
363static WRITE8_DEVICE_HANDLER(frogf_ppi8255_w)
374364{
375   return ppi8255_1_r(machine, offset >> 3);
365   ppi8255_w(device, offset >> 3, data);
376366}
377367
378static WRITE8_HANDLER(frogf_ppi8255_0_w)
379{
380   ppi8255_0_w(machine, offset >> 3, data);
381}
382
383static WRITE8_HANDLER(frogf_ppi8255_1_w)
384{
385   ppi8255_1_w(machine, offset >> 3, data);
386}
387
388368static ADDRESS_MAP_START( frogf_map, ADDRESS_SPACE_PROGRAM, 8 )
389369   AM_RANGE(0x0000, 0x2fff) AM_ROM
390370   AM_RANGE(0x8000, 0x87ff) AM_RAM
r2454r2455
398378   AM_RANGE(0xa808, 0xa808) AM_WRITE(galaxold_coin_counter_1_w)
399379   AM_RANGE(0xa80e, 0xa80e) AM_WRITE(galaxold_coin_counter_0_w)
400380   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
401   AM_RANGE(0xd000, 0xd018) AM_READWRITE(frogf_ppi8255_0_r, frogf_ppi8255_0_w)
402   AM_RANGE(0xe000, 0xe018) AM_READWRITE(frogf_ppi8255_1_r, frogf_ppi8255_1_w)
381   AM_RANGE(0xd000, 0xd018) AM_DEVREADWRITE(PPI8255, "ppi8255_0", frogf_ppi8255_r, frogf_ppi8255_w)
382   AM_RANGE(0xe000, 0xe018) AM_DEVREADWRITE(PPI8255, "ppi8255_1", frogf_ppi8255_r, frogf_ppi8255_w)
403383ADDRESS_MAP_END
404384
405385static ADDRESS_MAP_START( ad2083_map, ADDRESS_SPACE_PROGRAM, 8 )
r2454r2455
17371717
17381718static const struct AY8910interface scramble_ay8910_interface_2 =
17391719{
1720   AY8910_LEGACY_OUTPUT,
1721   AY8910_DEFAULT_LOADS,
17401722   soundlatch_r,
1741   scramble_portB_r
1723   scramble_portB_r,
1724   NULL,
1725   NULL
17421726};
17431727
17441728static const struct AY8910interface sfx_ay8910_interface_1 =
17451729{
1746   0,
1747   0,
1730   AY8910_LEGACY_OUTPUT,
1731   AY8910_DEFAULT_LOADS,
1732   NULL,
1733   NULL,
17481734   soundlatch2_w,
17491735   sfx_sh_irqtrigger_w
17501736};
17511737
17521738static const struct AY8910interface explorer_ay8910_interface_1 =
17531739{
1754   scramble_portB_r
1740   AY8910_LEGACY_OUTPUT,
1741   AY8910_DEFAULT_LOADS,
1742   scramble_portB_r,
1743   NULL,
1744   NULL,
1745   NULL
17551746};
17561747
17571748static const struct AY8910interface explorer_ay8910_interface_2 =
17581749{
1759   hotshock_soundlatch_r
1750   AY8910_LEGACY_OUTPUT,
1751   AY8910_DEFAULT_LOADS,
1752   hotshock_soundlatch_r,
1753   NULL,
1754   NULL,
1755   NULL
17601756};
17611757
17621758static const struct AY8910interface hotshock_ay8910_interface_2 =
17631759{
1760   AY8910_LEGACY_OUTPUT,
1761   AY8910_DEFAULT_LOADS,
17641762   hotshock_soundlatch_r,
1765   scramble_portB_r
1763   scramble_portB_r,
1764   NULL,
1765   NULL
17661766};
17671767
17681768static const struct AY8910interface scorpion_ay8910_interface_1 =
17691769{
1770   0,
1771   0,
1770   AY8910_LEGACY_OUTPUT,
1771   AY8910_DEFAULT_LOADS,
1772   NULL,
1773   NULL,
17721774   scorpion_extra_sound_w,
17731775   scorpion_sound_cmd_w,
17741776};
r2454r2455
18601862
18611863   MDRV_MACHINE_RESET(scramble)
18621864
1865   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
1866   MDRV_DEVICE_CONFIG( scramble_ppi_ppi8255_intf[0] )
1867
1868   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
1869   MDRV_DEVICE_CONFIG( scramble_ppi_ppi8255_intf[1] )
1870
18631871   /* video hardware */
18641872   MDRV_SCREEN_ADD("main", RASTER)
18651873   MDRV_SCREEN_REFRESH_RATE(16000.0/132/2)
r2454r2455
19541962   MDRV_CPU_MODIFY("main")
19551963   MDRV_CPU_PROGRAM_MAP(mars_readmem,mars_writemem)
19561964
1965   MDRV_DEVICE_MODIFY( "ppi8255_0", PPI8255 )
1966   MDRV_DEVICE_CONFIG( mars_ppi8255_intf[0] )
1967
1968   MDRV_DEVICE_MODIFY( "ppi8255_1", PPI8255 )
1969   MDRV_DEVICE_CONFIG( mars_ppi8255_intf[1] )
1970
19571971   /* video hardware */
19581972   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
19591973   MDRV_PALETTE_INIT(galaxold)
r2454r2455
19791993   MDRV_CPU_MODIFY("main")
19801994   MDRV_CPU_PROGRAM_MAP(newsin7_readmem,newsin7_writemem)
19811995
1996   MDRV_DEVICE_MODIFY( "ppi8255_0", PPI8255 )
1997   MDRV_DEVICE_CONFIG( mars_ppi8255_intf[0] )
1998
1999   MDRV_DEVICE_MODIFY( "ppi8255_1", PPI8255 )
2000   MDRV_DEVICE_CONFIG( mars_ppi8255_intf[1] )
2001
19822002   /* video hardware */
19832003   MDRV_GFXDECODE(newsin7)
19842004   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
r2454r2455
19932013   MDRV_CPU_MODIFY("main")
19942014   MDRV_CPU_PROGRAM_MAP(mars_readmem,mrkougar_writemem)
19952015
2016   MDRV_DEVICE_MODIFY( "ppi8255_0", PPI8255 )
2017   MDRV_DEVICE_CONFIG( mrkougar_ppi8255_intf[0] )
2018
2019   MDRV_DEVICE_MODIFY( "ppi8255_1", PPI8255 )
2020   MDRV_DEVICE_CONFIG( mrkougar_ppi8255_intf[1] )
2021
19962022   /* video hardware */
19972023   MDRV_GFXDECODE(mrkougar)
19982024   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
r2454r2455
20062032   MDRV_CPU_MODIFY("main")
20072033   MDRV_CPU_PROGRAM_MAP(mars_readmem,mrkougar_writemem)
20082034
2035   MDRV_DEVICE_MODIFY( "ppi8255_0", PPI8255 )
2036   MDRV_DEVICE_CONFIG( mrkougar_ppi8255_intf[0] )
2037
2038   MDRV_DEVICE_MODIFY( "ppi8255_1", PPI8255 )
2039   MDRV_DEVICE_CONFIG( mrkougar_ppi8255_intf[1] )
2040
20092041   /* video hardware */
20102042   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
20112043   MDRV_PALETTE_INIT(galaxold)
r2454r2455
20182050   MDRV_CPU_MODIFY("main")
20192051   MDRV_CPU_PROGRAM_MAP(ckongs_readmem,ckongs_writemem)
20202052
2053   MDRV_DEVICE_MODIFY( "ppi8255_0", PPI8255 )
2054   MDRV_DEVICE_CONFIG( ckongs_ppi8255_intf[0] )
2055
2056   MDRV_DEVICE_MODIFY( "ppi8255_1", PPI8255 )
2057   MDRV_DEVICE_CONFIG( ckongs_ppi8255_intf[1] )
2058
20212059   /* video hardware */
20222060   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
20232061   MDRV_PALETTE_INIT(galaxold)
r2454r2455
20312069   MDRV_CPU_MODIFY("main")
20322070   MDRV_CPU_PROGRAM_MAP(hotshock_readmem,hotshock_writemem)
20332071
2072   MDRV_DEVICE_REMOVE( "ppi8255_0", PPI8255 )
2073   MDRV_DEVICE_REMOVE( "ppi8255_1", PPI8255 )
2074
20342075   MDRV_CPU_MODIFY("audio")
20352076   MDRV_CPU_IO_MAP(hotshock_sound_readport,hotshock_sound_writeport)
20362077
r2454r2455
21972238   MDRV_IMPORT_FROM(scramble)
21982239   MDRV_CPU_MODIFY("main")
21992240   MDRV_CPU_PROGRAM_MAP(turpins_readmem,turpins_writemem)
2241
22002242MACHINE_DRIVER_END
22012243
22022244/***************************************************************************
src/mame/drivers/taitojc.c
r2454r2455
408408   g = (color >> 16) & 0xff;
409409   b = (color >>  0) & 0xff;
410410
411   palette_set_color(Machine,offset, MAKE_RGB(r, g, b));
411   palette_set_color(machine,offset, MAKE_RGB(r, g, b));
412412}
413413
414414static READ32_HANDLER ( jc_control_r )
r2454r2455
776776      {
777777         if (!first_dsp_reset)
778778         {
779            cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, CLEAR_LINE);
779            cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, CLEAR_LINE);
780780         }
781781         first_dsp_reset = 0;
782782      }
783783      else
784784      {
785         cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, ASSERT_LINE);
785         cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, ASSERT_LINE);
786786      }
787787   }
788788}
r2454r2455
13331333   ROM_FILL( 0x0000, 0x0080, 0 )
13341334
13351335   ROM_REGION( 0x1800000, REGION_GFX1, 0 )
1336   ROM_LOAD32_WORD( "e23-05.009",  0x0800002, 0x200000, BAD_DUMP CRC(9aa0d956) SHA1(bd146e3db7c2a53701eca6b43f903899ed15623a) )
1337   ROM_LOAD32_WORD( "e23-12.022",  0x0800000, 0x200000, BAD_DUMP CRC(c93fab09) SHA1(1ed292b11bf6bf09d1783d247f3de0c899e4df28) )
1338   ROM_LOAD32_WORD( "e23-06.010",  0x0c00002, 0x200000, BAD_DUMP CRC(2077ac3a) SHA1(894e1bbfef8a693bda50aa8681e8f283c0d6b6cf) )
1339   ROM_LOAD32_WORD( "e23-13.023",  0x0c00000, 0x200000, BAD_DUMP CRC(985f6785) SHA1(81cd33957b943f4bb33323fbf491ace344f8245b) )
1340   ROM_LOAD32_WORD( "e23-07.012",  0x1400002, 0x200000, BAD_DUMP CRC(bf1cd99d) SHA1(f98e1dacb485c7e40b0b2277a690d74ae020c9d9) )
1341   ROM_LOAD32_WORD( "e23-14.025",  0x1400000, 0x200000, BAD_DUMP CRC(9d54eac7) SHA1(4f97b388a0fd0529d26e1cc31491a0e2ce6c381d) )
1336   ROM_LOAD32_WORD( "e23-05.009",  0x0800002, 0x200000, CRC(6e5d11ec) SHA1(e5c39d80577bf8ae9fc6162dc54571c6c8421160) )
1337   ROM_LOAD32_WORD( "e23-12.022",  0x0800000, 0x200000, CRC(7365333c) SHA1(4f7b75088799ea37f714bc7e5c5b276a7e5d933f) )
1338   ROM_LOAD32_WORD( "e23-06.010",  0x0c00002, 0x200000, CRC(ffcfd153) SHA1(65fa486cf0156e2988bd6e7060d66f87f765a123) )
1339   ROM_LOAD32_WORD( "e23-13.023",  0x0c00000, 0x200000, CRC(16982d37) SHA1(134370f7dfadb1886f1e5e5dd16f8b72ad08fc68) )
1340   ROM_LOAD32_WORD( "e23-07.012",  0x1400002, 0x200000, CRC(90f2a87c) SHA1(770bb89fa42cb2a1d5a58525b8d72ed7df3f93ed) )
1341   ROM_LOAD32_WORD( "e23-14.025",  0x1400000, 0x200000, CRC(1bc5a914) SHA1(92f82a4e2fbac73dbb3293726fc09022bd11a8fe) )
13421342
13431343   ROM_REGION( 0x1000000, REGION_GFX2, 0 )      /* only accessible to the TMS */
1344   ROM_LOAD( "e23-01.005",  0x0000000, 0x200000, BAD_DUMP CRC(c5018242) SHA1(d1a45aa6899d9a95b32aeba0f9a4520714d5f5a3) )
1345   ROM_LOAD( "e23-02.006",  0x0200000, 0x200000, BAD_DUMP CRC(dbf24766) SHA1(2ee0bdb9f912f31bdf962a1af53ad1a6e3121a05) )
1346   ROM_LOAD( "e23-03.007",  0x0400000, 0x200000, BAD_DUMP CRC(3ab59dd0) SHA1(39e93d306a59017bef0f2fdadc69f96aecbffca6) )
1347   ROM_LOAD( "e23-04.008",  0x0600000, 0x200000, BAD_DUMP CRC(5060119c) SHA1(c8c5c33bd37121d222961ecfcdb79bbe6cbdf821) )
1348   ROM_LOAD( "e23-08.018",  0x0800000, 0x200000, BAD_DUMP CRC(04738f5b) SHA1(0ebc8c61d87f10822148f3b272612dc10ac4652c) )
1349   ROM_LOAD( "e23-09.019",  0x0a00000, 0x200000, BAD_DUMP CRC(089fac53) SHA1(3af008c65f4b60ae221b90fdb52d4e6fe552e5a8) )
1350   ROM_LOAD( "e23-10.020",  0x0c00000, 0x200000, BAD_DUMP CRC(dccb19ed) SHA1(35749c823ad9a30f471367750c087435b678b42f) )
1351   ROM_LOAD( "e23-11.021",  0x0e00000, 0x200000, BAD_DUMP CRC(6981a46f) SHA1(262bf821275413c70a1a8374185df64c697d8b04) )
1344   ROM_LOAD( "e23-01.005",  0x0000000, 0x200000, CRC(2cbe4bbd) SHA1(ed6fe4344c86d50914b5ddbc720dd15544f4d07f) )
1345   ROM_LOAD( "e23-02.006",  0x0200000, 0x200000, CRC(7ebada03) SHA1(d75c992aa33dd7f71de6a6d09aac471012b0daa3) )
1346   ROM_LOAD( "e23-03.007",  0x0400000, 0x200000, CRC(5bf1f30b) SHA1(6e0c07b9f92962eec55ee444732a10ac78f8b050) )
1347   ROM_LOAD( "e23-04.008",  0x0600000, 0x200000, CRC(0f860fb5) SHA1(47c0db4ec6d02e10d8abfacd1fa332f7af3976dd) )
1348   ROM_LOAD( "e23-08.018",  0x0800000, 0x200000, CRC(bceea63e) SHA1(eeec1e2306aa37431c5ba69bdb9c5524ab7b7ba4) )
1349   ROM_LOAD( "e23-09.019",  0x0a00000, 0x200000, CRC(3917c12f) SHA1(e3a568f638bb6b0cd6237c9fee5fc350983ea1e7) )
1350   ROM_LOAD( "e23-10.020",  0x0c00000, 0x200000, CRC(038370d9) SHA1(c02f68a25121d2d5aae62c419522b25cd6ec32b6) )
1351   ROM_LOAD( "e23-11.021",  0x0e00000, 0x200000, CRC(91fab03d) SHA1(1865d8b679faa6f2b3c14db2c6c461c00afd547c) )
13521352
13531353   ROM_REGION16_BE( 0x1000000, REGION_SOUND1, ROMREGION_ERASE00  )
1354   ROM_LOAD16_BYTE( "e23-15.32",  0x000000, 0x200000, CRC(8955b7c7) SHA1(767626bd5cf6810b0368ee85e487c12ef7e8a23d))
1355   ROM_LOAD16_BYTE( "e23-16.33",  0x400000, 0x200000, CRC(1d63d785) SHA1(0cf74bb433e9c453e35f7a552fdf9e22084b2f49) )
1356   ROM_LOAD16_BYTE( "e23-17.34",  0x800000, 0x200000, CRC(1c54021a) SHA1(a1efbdb02d23a5d32ebd25cb8e99dface3178ebd) )
1357   ROM_LOAD16_BYTE( "e23-18.35",  0xc00000, 0x200000, CRC(1816f38a) SHA1(6451bdb4b4297aaf4987451bc0ddd97b0072e113) )
1354   ROM_LOAD16_BYTE( "e23-15.032",  0x000000, 0x200000, CRC(8955b7c7) SHA1(767626bd5cf6810b0368ee85e487c12ef7e8a23d))
1355   ROM_LOAD16_BYTE( "e23-16.033",  0x400000, 0x200000, CRC(1d63d785) SHA1(0cf74bb433e9c453e35f7a552fdf9e22084b2f49) )
1356   ROM_LOAD16_BYTE( "e23-17.034",  0x800000, 0x200000, CRC(1c54021a) SHA1(a1efbdb02d23a5d32ebd25cb8e99dface3178ebd) )
1357   ROM_LOAD16_BYTE( "e23-18.035",  0xc00000, 0x200000, CRC(1816f38a) SHA1(6451bdb4b4297aaf4987451bc0ddd97b0072e113) )
13581358ROM_END
13591359
13601360ROM_START( sidebs2 )
r2454r2455
17851785ROM_END
17861786
17871787
1788GAME( 1996, dendeg,   0,       taitojc, dendeg,   taitojc,  ROT0, "Taito", "Densya De Go", GAME_NOT_WORKING )
1789GAME( 1996, dendegx,  dendeg,  taitojc, dendeg,   taitojc,  ROT0, "Taito", "Densya De Go Ex", GAME_NOT_WORKING )
1790GAME( 1998, dendeg2,  0,       taitojc, dendeg,   taitojc,  ROT0, "Taito", "Densya De Go 2", GAME_NOT_WORKING )
1791GAME( 1998, dendeg2x, dendeg2, taitojc, dendeg,   taitojc,  ROT0, "Taito", "Densya De Go 2 Ex", GAME_NOT_WORKING )
1792GAME( 1996, sidebs,   0,       taitojc, sidebs,   taitojc,  ROT0, "Taito", "Side By Side", GAME_NOT_WORKING )
1793GAME( 1997, sidebs2,  0,       taitojc, sidebs,   taitojc,  ROT0, "Taito", "Side By Side 2", GAME_IMPERFECT_GRAPHICS )
1788GAME( 1996, dendeg,   0,       taitojc, dendeg,   taitojc,  ROT0, "Taito", "Densya De Go (Japan)", GAME_NOT_WORKING )
1789GAME( 1996, dendegx,  dendeg,  taitojc, dendeg,   taitojc,  ROT0, "Taito", "Densya De Go Ex (Japan)", GAME_NOT_WORKING )
1790GAME( 1998, dendeg2,  0,       taitojc, dendeg,   taitojc,  ROT0, "Taito", "Densya De Go 2 (Japan)", GAME_NOT_WORKING )
1791GAME( 1998, dendeg2x, dendeg2, taitojc, dendeg,   taitojc,  ROT0, "Taito", "Densya De Go 2 Ex (Japan)", GAME_NOT_WORKING )
1792GAME( 1996, sidebs,   0,       taitojc, sidebs,   taitojc,  ROT0, "Taito", "Side By Side (Japan)", GAME_IMPERFECT_GRAPHICS )
1793GAME( 1997, sidebs2,  0,       taitojc, sidebs,   taitojc,  ROT0, "Taito", "Side By Side 2 (North/South America)", GAME_IMPERFECT_GRAPHICS )
17941794GAME( 1997, sidebs2j, sidebs2, taitojc, sidebs,   taitojc,  ROT0, "Taito", "Side By Side 2 (Japan)", GAME_IMPERFECT_GRAPHICS )
17951795GAME( 1995, landgear, 0,       taitojc, landgear, taitojc,  ROT0, "Taito", "Landing Gear", GAME_NOT_WORKING )
17961796GAME( 1995, dangcurv, 0,       taitojc, dangcurv, taitojc,  ROT0, "Taito", "Dangerous Curves", GAME_NOT_WORKING )
src/mame/drivers/pitnrun.c
r2454r2455
273273
274274static const struct AY8910interface ay8910_interface =
275275{
276   AY8910_LEGACY_OUTPUT,
277   AY8910_DEFAULT_LOADS,
276278   soundlatch_r,
277   soundlatch_r
279   soundlatch_r,
280   NULL,
281   NULL
278282};
279283
280284static GFXDECODE_START( pitnrun )
src/mame/drivers/tehkanwc.c
r2454r2455
9595***************************************************************************/
9696
9797#include "driver.h"
98#include "deprecat.h"
9998#include "cpu/z80/z80.h"
10099#include "sound/ay8910.h"
101100#include "sound/msm5205.h"
r2454r2455
120119static WRITE8_HANDLER( sub_cpu_halt_w )
121120{
122121   if (data)
123      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
122      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
124123   else
125      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
124      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
126125}
127126
128127
r2454r2455
638637
639638static const struct AY8910interface ay8910_interface_1 =
640639{
641   0,
642   0,
640   AY8910_LEGACY_OUTPUT,
641   AY8910_DEFAULT_LOADS,
642   NULL,
643   NULL,
643644   tehkanwc_portA_w,
644645   tehkanwc_portB_w
645646};
646647
647648static const struct AY8910interface ay8910_interface_2 =
648649{
650   AY8910_LEGACY_OUTPUT,
651   AY8910_DEFAULT_LOADS,
649652   tehkanwc_portA_r,
650   tehkanwc_portB_r
653   tehkanwc_portB_r,
654   NULL,
655   NULL
651656};
652657
653658static const struct MSM5205interface msm5205_interface =
src/mame/drivers/citycon.c
r2454r2455
198198
199199static const struct YM2203interface ym2203_interface =
200200{
201   soundlatch_r,
202   soundlatch2_r,
201   {
202      AY8910_LEGACY_OUTPUT,
203      AY8910_DEFAULT_LOADS,
204      soundlatch_r,
205      soundlatch2_r,
206      NULL,
207      NULL
208   },
209   NULL
203210};
204211
205212
src/mame/drivers/suprridr.c
r2454r2455
8080***************************************************************************/
8181
8282#include "driver.h"
83#include "deprecat.h"
8483#include "suprridr.h"
8584#include "sound/ay8910.h"
8685
r2454r2455
136135
137136static WRITE8_HANDLER( sound_irq_ack_w )
138137{
139   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
138   cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
140139}
141140
142141
r2454r2455
338337
339338static const struct AY8910interface ay8910_interface =
340339{
341   sound_data_r
340   AY8910_LEGACY_OUTPUT,
341   AY8910_DEFAULT_LOADS,
342   sound_data_r,
343   NULL,
344   NULL,
345   NULL
342346};
343347
344348
src/mame/drivers/spy.c
r2454r2455
333333
334334static WRITE8_HANDLER( spy_sh_irqtrigger_w )
335335{
336   cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
336   cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);
337337}
338338
339339static WRITE8_HANDLER( sound_bank_w )
src/mame/drivers/psikyo.c
r2454r2455
226226   // Accesses are always bytes, so resolve it
227227   int suboff;
228228   for(suboff=0; suboff < 3; suboff++)
229      if(!((0xff << (8*suboff)) & mem_mask))
229      if((0xff << (8*suboff)) & mem_mask)
230230         break;
231231   data >>= 8*suboff;
232232   offset = offset*4+4+(3-suboff);
r2454r2455
381381
382382static WRITE8_HANDLER( psikyo_clear_nmi_w )
383383{
384   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
384   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
385385   z80_nmi = 0;
386386}
387387
src/mame/drivers/ampoker2.c
r2454r2455
845845
846846static const struct AY8910interface ay8910_interface =
847847{
8480, 0, 0, 0   /* no ports used */
848   AY8910_LEGACY_OUTPUT,
849   AY8910_DEFAULT_LOADS,
850   NULL, NULL, NULL, NULL   /* no ports used */
849851};
850852
851853
src/mame/drivers/dacholer.c
r2454r2455
1212******************************************************************************/
1313
1414#include "driver.h"
15#include "deprecat.h"
1615
1716static UINT8 *bgvideoram,*fgvideoram;
1817static int bg_bank = 0;
r2454r2455
5453static WRITE8_HANDLER( snd_irq_w )
5554{
5655   if(data == 1)
57      cpunum_set_input_line_and_vector(Machine, 1, 0, ASSERT_LINE, 0x38);
56      cpunum_set_input_line_and_vector(machine, 1, 0, ASSERT_LINE, 0x38);
5857   else
59      cpunum_set_input_line_and_vector(Machine, 1, 0, CLEAR_LINE, 0x38);
58      cpunum_set_input_line_and_vector(machine, 1, 0, CLEAR_LINE, 0x38);
6059}
6160
6261static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/model3.c
r2454r2455
13231323   model3_irq_state &= ~0x40;
13241324
13251325   // serial configuration writes
1326   if ((mem_mask == U64(0x00ffffffffffffff)) && (offset == 0))
1326   if ((mem_mask == U64(0xff00000000000000)) && (offset == 0))
13271327   {
13281328      SCSP_MidiIn(machine, 0, (data>>56)&0xff, 0);
13291329
src/mame/drivers/namcos21.c
r2454r2455
12441244   if( data )
12451245   {
12461246      winrun_flushpoly();
1247      cpunum_set_input_line(Machine, 4, INPUT_LINE_RESET, PULSE_LINE);
1247      cpunum_set_input_line(machine, 4, INPUT_LINE_RESET, PULSE_LINE);
12481248      namcos21_ClearPolyFrameBuffer();
12491249   }
12501250}
src/mame/drivers/pgm.c
r2454r2455
345345#ifdef PGMARM7SPEEDHACK
346346//  cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
347347   if (data!=0xaa) cpu_spinuntil_trigger(1000);
348   cpu_trigger(Machine, 1002);
348   cpu_trigger(machine, 1002);
349349#else
350350   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
351351   cpu_spinuntil_time(ATTOTIME_IN_CYCLES(100, 0));
r2454r2455
376376   COMBINE_DATA(&arm7_latch);
377377
378378#ifdef PGMARM7SPEEDHACK
379   cpu_trigger(Machine, 1000);
379   cpu_trigger(machine, 1000);
380380   timer_set(ATTOTIME_IN_USEC(50), NULL, 0, arm_irq); // i don't know how long..
381381   cpu_spinuntil_trigger(1002);
382382#else
383   cpunum_set_input_line(Machine, 2, ARM7_FIRQ_LINE, PULSE_LINE);
383   cpunum_set_input_line(machine, 2, ARM7_FIRQ_LINE, PULSE_LINE);
384384   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(200));
385385   cpu_spinuntil_time(ATTOTIME_IN_CYCLES(200, 2)); // give the arm time to respond (just boosting the interleave doesn't help
386386#endif
r2454r2455
419419
420420   if(data == 0x5050) {
421421      sndti_reset(SOUND_ICS2115, 0);
422      cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
423      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE);
422      cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
423      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, PULSE_LINE);
424424      if(0) {
425425         FILE *out;
426426         out = fopen("z80ram.bin", "wb");
r2454r2455
432432   {
433433      /* this might not be 100% correct, but several of the games (ddp2, puzzli2 etc. expect the z80 to be turned
434434           off during data uploads, they write here before the upload */
435      cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
435      cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
436436   }
437437}
438438
r2454r2455
487487{
488488   static mame_system_time systime;
489489
490   mame_get_base_datetime(Machine, &systime);
490   mame_get_base_datetime(machine, &systime);
491491
492492   // initialize the time, otherwise it crashes
493493   if( !systime.time )
494      mame_get_base_datetime(Machine, &systime);
494      mame_get_base_datetime(machine, &systime);
495495
496496   CalCom <<= 1;
497497   CalCom |= data & 1;
r2454r2455
540540            break;
541541
542542         case 0xf:  //Load Date
543            mame_get_base_datetime(Machine, &systime);
543            mame_get_base_datetime(machine, &systime);
544544            break;
545545      }
546546   }
src/mame/drivers/iqblock.c
r2454r2455
8383
8484static WRITE8_HANDLER( iqblock_irqack_w )
8585{
86   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
86   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
8787}
8888
8989static READ8_HANDLER( iqblock_irqack_r )
9090{
91   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
91   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
9292   return 0;
9393}
9494
r2454r2455
113113
114114static const ppi8255_interface ppi8255_intf =
115115{
116   1,                      /* 1 chip */
117   { input_port_0_r },         /* Port A read */
118   { input_port_1_r },         /* Port B read */
119   { input_port_2_r },         /* Port C read */
120   { 0 },                  /* Port A write */
121   { 0 },                  /* Port B write */
122   { port_C_w },            /* Port C write */
116   input_port_0_r,         /* Port A read */
117   input_port_1_r,         /* Port B read */
118   input_port_2_r,         /* Port C read */
119   NULL,               /* Port A write */
120   NULL,               /* Port B write */
121   port_C_w            /* Port C write */
123122};
124123
125static MACHINE_RESET( iqblock )
126{
127   ppi8255_init(&ppi8255_intf);
128}
129124
130
131
132125static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
133126   AM_RANGE(0x0000, 0xefff) AM_ROM
134127   AM_RANGE(0xf000, 0xffff) AM_RAM AM_BASE(&rambase)
r2454r2455
141134   AM_RANGE(0x6000, 0x603f) AM_WRITE(iqblock_fgscroll_w)
142135   AM_RANGE(0x6800, 0x69ff) AM_WRITE(iqblock_fgvideoram_w)   /* initialized up to 6fff... bug or larger tilemap? */
143136   AM_RANGE(0x7000, 0x7fff) AM_WRITE(iqblock_bgvideoram_w)
144   AM_RANGE(0x5080, 0x5083) AM_WRITE(ppi8255_0_w)
145   AM_RANGE(0x5080, 0x5083) AM_READ(ppi8255_0_r)
137   AM_RANGE(0x5080, 0x5083) AM_DEVWRITE(PPI8255, "ppi8255", ppi8255_w)
138   AM_RANGE(0x5080, 0x5083) AM_DEVREAD(PPI8255, "ppi8255", ppi8255_r)
146139   AM_RANGE(0x5090, 0x5090) AM_READ(input_port_3_r)
147140   AM_RANGE(0x50a0, 0x50a0) AM_READ(input_port_4_r)
148141   AM_RANGE(0x50b0, 0x50b0) AM_WRITE(YM2413_register_port_0_w) // UM3567_register_port_0_w
r2454r2455
158151//  AM_RANGE(0x6000, 0x603f) AM_WRITE(iqblock_fgscroll_w)
159152//  AM_RANGE(0x6800, 0x69ff) AM_WRITE(iqblock_fgvideoram_w)
160153   AM_RANGE(0x7000, 0x7fff) AM_WRITE(iqblock_bgvideoram_w)
161   AM_RANGE(0x5080, 0x5083) AM_WRITE(ppi8255_0_w)
162   AM_RANGE(0x5080, 0x5083) AM_READ(ppi8255_0_r)
154   AM_RANGE(0x5080, 0x5083) AM_DEVWRITE(PPI8255, "ppi8255", ppi8255_w)
155   AM_RANGE(0x5080, 0x5083) AM_DEVREAD(PPI8255, "ppi8255", ppi8255_r)
163156   AM_RANGE(0x5090, 0x5090) AM_READ(input_port_3_r) AM_WRITENOP
164157   AM_RANGE(0x5091, 0x5091) AM_READNOP AM_WRITENOP
165158   AM_RANGE(0x50a0, 0x50a0) AM_READ(input_port_4_r)
r2454r2455
308301   MDRV_CPU_IO_MAP(main_portmap,0)
309302   MDRV_CPU_VBLANK_INT_HACK(iqblock_interrupt,16)
310303
311   MDRV_MACHINE_RESET(iqblock)
304   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
305   MDRV_DEVICE_CONFIG( ppi8255_intf )
312306
313307   /* video hardware */
314308   MDRV_SCREEN_ADD("main", RASTER)
r2454r2455
339333   MDRV_CPU_IO_MAP(main_portmap,0)
340334   MDRV_CPU_VBLANK_INT_HACK(iqblock_interrupt,16)
341335
342   MDRV_MACHINE_RESET(iqblock)
336   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
337   MDRV_DEVICE_CONFIG( ppi8255_intf )
343338
344339   /* video hardware */
345340   MDRV_SCREEN_ADD("main", RASTER)
r2454r2455
370365   MDRV_CPU_IO_MAP(pokerigs_portmap,0)
371366   MDRV_CPU_VBLANK_INT_HACK(iqblock_interrupt,16)
372367
373   MDRV_MACHINE_RESET(iqblock)
368   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
369   MDRV_DEVICE_CONFIG( ppi8255_intf )
374370
375371   /* video hardware */
376372   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/gameplan.c
r2454r2455
11601160
11611161static const struct AY8910interface ay8910_interface =
11621162{
1163   AY8910_LEGACY_OUTPUT,
1164   AY8910_DEFAULT_LOADS,
11631165   input_port_6_r,
11641166   input_port_7_r,
11651167};
src/mame/drivers/capbowl.c
r2454r2455
163163
164164static READ8_HANDLER( track_0_r )
165165{
166   return (input_port_0_r(machine, offset) & 0xf0) | ((input_port_2_r(machine, offset) - last_trackball_val[0]) & 0x0f);
166   return (input_port_read_indexed(machine, 0) & 0xf0) | ((input_port_read_indexed(machine, 2) - last_trackball_val[0]) & 0x0f);
167167}
168168
169169
170170static READ8_HANDLER( track_1_r )
171171{
172   return (input_port_1_r(machine, offset) & 0xf0) | ((input_port_3_r(machine, offset) - last_trackball_val[1]) & 0x0f);
172   return (input_port_read_indexed(machine, 1) & 0xf0) | ((input_port_read_indexed(machine, 3) - last_trackball_val[1]) & 0x0f);
173173}
174174
175175
176176static WRITE8_HANDLER( track_reset_w )
177177{
178178   /* reset the trackball counters */
179   last_trackball_val[0] = input_port_2_r(machine, offset);
180   last_trackball_val[1] = input_port_3_r(machine, offset);
179   last_trackball_val[0] = input_port_read_indexed(machine, 2);
180   last_trackball_val[1] = input_port_read_indexed(machine, 3);
181181
182182   watchdog_reset_w(machine, offset, data);
183183}
r2454r2455
332332
333333static const struct YM2203interface ym2203_interface =
334334{
335   ticket_dispenser_r,
336   0,
337   0,
338   ticket_dispenser_w,  /* Also a status LED. See memory map above */
335   {
336      AY8910_LEGACY_OUTPUT,
337      AY8910_DEFAULT_LOADS,
338      ticket_dispenser_r,
339      NULL,
340      NULL,
341      ticket_dispenser_w,  /* Also a status LED. See memory map above */
342   },
339343   firqhandler
340344};
341345
src/mame/drivers/darius.c
r2454r2455
189189         return (taitosound_comm_r(machine,0) & 0xff);   /* sound interface read */
190190
191191      case 0x04:
192         return input_port_0_word_r(machine,0,mem_mask);   /* IN0 */
192         return input_port_read_indexed(machine,0);   /* IN0 */
193193
194194      case 0x05:
195         return input_port_1_word_r(machine,0,mem_mask);   /* IN1 */
195         return input_port_read_indexed(machine,1);   /* IN1 */
196196
197197      case 0x06:
198         return input_port_2_word_r(machine,0,mem_mask);   /* IN2 */
198         return input_port_read_indexed(machine,2);   /* IN2 */
199199
200200      case 0x07:
201201         return coin_word;   /* bits 3&4 coin lockouts, must return zero */
202202
203203      case 0x08:
204         return input_port_3_word_r(machine,0,mem_mask);   /* DSW */
204         return input_port_read_indexed(machine,3);   /* DSW */
205205   }
206206
207207logerror("CPU #0 PC %06x: warning - read unmapped ioc offset %06x\n",activecpu_get_pc(),offset);
r2454r2455
808808
809809static const struct YM2203interface ym2203_interface_1 =
810810{
811   0,      /* portA read */
812   0,
813   darius_write_portA0,   /* portA write */
814   darius_write_portB0,   /* portB write */
811   {
812      AY8910_LEGACY_OUTPUT,
813      AY8910_DEFAULT_LOADS,
814      NULL,               /* portA read */
815      NULL,
816      darius_write_portA0,   /* portA write */
817      darius_write_portB0,   /* portB write */
818   },
815819   irqhandler
816820};
817821
818822static const struct YM2203interface ym2203_interface_2 =
819823{
820   0,      /* portA read */
821   0,
822   darius_write_portA1,   /* portA write */
823   darius_write_portB1      /* portB write */
824   {
825      AY8910_LEGACY_OUTPUT,
826      AY8910_DEFAULT_LOADS,
827      NULL,               /* portA read */
828      NULL,
829      darius_write_portA1,   /* portA write */
830      darius_write_portB1      /* portB write */
831   },
824832};
825833
826834
src/mame/drivers/kinst.c
r2454r2455
129129***************************************************************************/
130130
131131#include "driver.h"
132#include "deprecat.h"
133132#include "cpu/mips/mips3.h"
134133#include "cpu/adsp2100/adsp2100.h"
135134#include "machine/idectrl.h"
r2454r2455
311310
312311static READ32_DEVICE_HANDLER( kinst_ide_extra_r )
313312{
314   return ide_controller32_r(device, 0x3f6/4, 0xff00ffff) >> 16;
313   return ide_controller32_r(device, 0x3f6/4, 0x00ff0000) >> 16;
315314}
316315
317316
318317static WRITE32_DEVICE_HANDLER( kinst_ide_extra_w )
319318{
320   ide_controller32_w(device, 0x3f6/4, data << 16, 0xff00ffff);
319   ide_controller32_w(device, 0x3f6/4, data << 16, 0x00ff0000);
321320}
322321
323322
src/mame/drivers/beathead.c
r2454r2455
248248{
249249   if (eeprom_enabled)
250250   {
251      mem_mask |= 0xffffff00;
251      mem_mask &= 0x000000ff;
252252      COMBINE_DATA(generic_nvram32 + offset);
253253      eeprom_enabled = 0;
254254   }
r2454r2455
304304
305305static READ32_HANDLER( sound_data_r )
306306{
307   return atarigen_sound_r(machine,offset,0);
307   return atarigen_sound_r(machine,offset,0xffff);
308308}
309309
310310
src/mame/drivers/sbasketb.c
r2454r2455
1616***************************************************************************/
1717
1818#include "driver.h"
19#include "deprecat.h"
2019#include "cpu/m6809/m6809.h"
2120#include "sound/vlm5030.h"
2221#include "sound/dac.h"
r2454r2455
4544
4645static WRITE8_HANDLER( sbasketb_sh_irqtrigger_w )
4746{
48   cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
47   cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);
4948}
5049
5150static WRITE8_HANDLER( sbasketb_coin_counter_w )
src/mame/drivers/smstrv.c
r2454r2455
188188
189189static ADDRESS_MAP_START( smstrv_map, ADDRESS_SPACE_PROGRAM, 8 )
190190   AM_RANGE(0x00000, 0x007ff) AM_RAM
191   AM_RANGE(0x00800, 0x00803) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
191   AM_RANGE(0x00800, 0x00803) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
192192   AM_RANGE(0x01000, 0x01005) AM_RAM
193   AM_RANGE(0x01800, 0x01803) AM_READWRITE(ppi8255_1_r, ppi8255_1_w)
193   AM_RANGE(0x01800, 0x01803) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
194194   AM_RANGE(0x08000, 0x0ffff) AM_ROM
195195   AM_RANGE(0xf8000, 0xfffff) AM_ROM // mirror for vectors
196196ADDRESS_MAP_END
r2454r2455
205205   return 0;
206206}
207207
208static const ppi8255_interface ppi8255_intf =
208static const ppi8255_interface ppi8255_intf[2] =
209209{
210   2,                /* 2 chips */
211   { r1, r4 },         /* Port A read */
212   { r2, r5 },         /* Port B read */
213   { r3, r6 },         /* Port C read */
214   { w1, w4 },         /* Port A write */
215   { w2, w5 },         /* Port B write */
216   { w3, w6 },         /* Port C write */
210   {
211      r1,         /* Port A read */
212      r2,         /* Port B read */
213      r3,         /* Port C read */
214      w1,         /* Port A write */
215      w2,         /* Port B write */
216      w3         /* Port C write */
217   },
218   {
219      r4,         /* Port A read */
220      r5,         /* Port B read */
221      r6,         /* Port C read */
222      w4,         /* Port A write */
223      w5,         /* Port B write */
224      w6         /* Port C write */
225   }
217226};
218227
219228
220static MACHINE_RESET( smstrv )
221{
222   ppi8255_init(&ppi8255_intf);
223}
224
225
226229static MACHINE_DRIVER_START( smstrv )
227230   MDRV_CPU_ADD(I8088,24000000/2)
228231   MDRV_CPU_PROGRAM_MAP(smstrv_map,0)
r2454r2455
230233   MDRV_CPU_VBLANK_INT("main", nmi_line_pulse)
231234
232235//  MDRV_NVRAM_HANDLER(generic_0fill)
233   MDRV_MACHINE_RESET(smstrv)
234236
237   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
238   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
239
240   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
241   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
242
235243   /* video hardware */
236244   MDRV_SCREEN_ADD("main", RASTER)
237245   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/ksayakyu.c
r2454r2455
182182
183183static const struct AY8910interface ay8910_interface_1 =
184184{
185   AY8910_LEGACY_OUTPUT,
186   AY8910_DEFAULT_LOADS,
185187   soundlatch_r,
186   0,
187   0,
188   NULL,
189   NULL,
188190   dummy_w
189191};
190192
191193static const struct AY8910interface ay8910_interface_2 =
192194{
193   0,
194   0,
195   AY8910_LEGACY_OUTPUT,
196   AY8910_DEFAULT_LOADS,
197   NULL,
198   NULL,
195199   dummy_w,
196200   dummy_w
197201};
src/mame/drivers/suprgolf.c
r2454r2455
264264
265265static const struct YM2203interface ym2203_interface =
266266{
267   input_port_5_r,
268   input_port_6_r,
269   suprgolf_writeA,
270   suprgolf_writeB,
267   {
268      AY8910_LEGACY_OUTPUT,
269      AY8910_DEFAULT_LOADS,
270      input_port_5_r,
271      input_port_6_r,
272      suprgolf_writeA,
273      suprgolf_writeB,
274   },
271275   irqhandler
272276};
273277static const gfx_layout gfxlayout =
src/mame/drivers/xexex.c
r2454r2455
207207   /* bit 0 is EEPROM data */
208208   /* bit 1 is EEPROM ready */
209209   /* bit 3 is service button */
210   res = EEPROM_read_bit() | input_port_1_r(machine, 0);
210   res = EEPROM_read_bit() | input_port_read_indexed(machine,1);
211211
212212   if (init_eeprom_count)
213213   {
src/mame/drivers/ironhors.c
r2454r2455
4242
4343static WRITE8_HANDLER( ironhors_sh_irqtrigger_w )
4444{
45   cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
45   cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);
4646}
4747
4848static WRITE8_HANDLER( ironhors_filter_w )
r2454r2455
402402
403403static DISCRETE_SOUND_START( ironhors )
404404
405   DISCRETE_INPUTX_STREAM(NODE_01, 0, 1.0, 0)
406   DISCRETE_INPUTX_STREAM(NODE_02, 1, 1.0, 0)
407   DISCRETE_INPUTX_STREAM(NODE_03, 2, 1.0, 0)
405   DISCRETE_INPUTX_STREAM(NODE_01, 0, 5.0, 0)
406   DISCRETE_INPUTX_STREAM(NODE_02, 1, 5.0, 0)
407   DISCRETE_INPUTX_STREAM(NODE_03, 2, 5.0, 0)
408408
409409   DISCRETE_INPUTX_STREAM(NODE_04, 3, 1.0, 0)
410410
r2454r2455
427427
428428static const struct YM2203interface ym2203_interface =
429429{
430   0,
431   0,
432   ironhors_filter_w,
433   0
430   {
431      AY8910_LEGACY_OUTPUT,
432      AY8910_DEFAULT_LOADS,
433      NULL,
434      NULL,
435      ironhors_filter_w,
436      NULL
437   },
438   NULL
434439};
435440
436441
src/mame/drivers/konamigq.c
r2454r2455
4646*/
4747
4848#include "driver.h"
49#include "deprecat.h"
5049#include "cpu/mips/psx.h"
5150#include "includes/psx.h"
5251#include "machine/konamigx.h"
r2454r2455
6766      sndto000[ ( offset << 1 ) + 1 ] = data >> 16;
6867      if( offset == 3 )
6968      {
70         cpunum_set_input_line(Machine, 1, 1, HOLD_LINE );
69         cpunum_set_input_line(machine, 1, 1, HOLD_LINE );
7170      }
7271   }
7372   if( ACCESSING_BITS_0_15 )
r2454r2455
141140   EEPROM_write_bit( ( data & 0x01 ) ? 1 : 0 );
142141   EEPROM_set_clock_line( ( data & 0x04 ) ? ASSERT_LINE : CLEAR_LINE );
143142   EEPROM_set_cs_line( ( data & 0x02 ) ? CLEAR_LINE : ASSERT_LINE );
144   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ( data & 0x40 ) ? CLEAR_LINE : ASSERT_LINE );
143   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ( data & 0x40 ) ? CLEAR_LINE : ASSERT_LINE );
145144}
146145
147146static CUSTOM_INPUT( eeprom_bit_r )
src/mame/drivers/epos.c
r2454r2455
109109
110110static ADDRESS_MAP_START( dealer_readport, ADDRESS_SPACE_IO, 8 )
111111   ADDRESS_MAP_GLOBAL_MASK(0xff)
112   AM_RANGE(0x10, 0x13) AM_READ(ppi8255_0_r)
112   AM_RANGE(0x10, 0x13) AM_DEVREAD(PPI8255, "ppi8255", ppi8255_r)
113113   AM_RANGE(0x38, 0x38) AM_READ(input_port_0_r)
114114ADDRESS_MAP_END
115115
116116static ADDRESS_MAP_START( dealer_writeport, ADDRESS_SPACE_IO, 8 )
117117   ADDRESS_MAP_GLOBAL_MASK(0xff)
118   AM_RANGE(0x10, 0x13) AM_WRITE(ppi8255_0_w)
118   AM_RANGE(0x10, 0x13) AM_DEVWRITE(PPI8255, "ppi8255", ppi8255_w)
119119   AM_RANGE(0x20, 0x24) AM_WRITE(dealer_decrypt_rom)
120120//  AM_RANGE(0x40, 0x40) AM_WRITE(watchdog_reset_w)
121121ADDRESS_MAP_END
122122
123123static const ppi8255_interface ppi8255_intf =
124124{
125   1,                /* 1 chip */
126   { input_port_2_r },   /* Port A read */
127   { NULL },         /* Port B read */
128   { NULL },         /* Port C read */
129   { NULL },         /* Port A write */
130   { NULL },         /* Port B write */
131   { NULL },         /* Port C write */
125   input_port_2_r,   /* Port A read */
126   NULL,         /* Port B read */
127   NULL,         /* Port C read */
128   NULL,         /* Port A write */
129   NULL,         /* Port B write */
130   NULL,         /* Port C write */
132131};
133132
134133/*************************************
r2454r2455
376375   MDRV_CPU_IO_MAP(dealer_readport,dealer_writeport)
377376   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
378377
378   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
379   MDRV_DEVICE_CONFIG( ppi8255_intf )
380
379381   /* video hardware */
380382   MDRV_VIDEO_UPDATE(epos)
381383
r2454r2455
558560static MACHINE_RESET( dealer )
559561{
560562   memory_set_bankptr(1, memory_region(REGION_CPU1));
561
562   ppi8255_init(&ppi8255_intf);
563563}
564564
565565static DRIVER_INIT( dealer )
src/mame/drivers/mrflea.c
r2454r2455
127127static WRITE8_HANDLER( mrflea_io_w ){
128128   mrflea_status |= 0x08; // pending command to IO CPU
129129   mrflea_io = data;
130   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE );
130   cpunum_set_input_line(machine, 1, 0, HOLD_LINE );
131131}
132132
133133static READ8_HANDLER( mrflea_main_r ){
src/mame/drivers/glass.c
r2454r2455
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1312#include "cpu/m68000/m68000.h"
1413#include "sound/okim6295.h"
1514
r2454r2455
4039static INTERRUPT_GEN( glass_interrupt )
4140{
4241   if (cause_interrupt){
43      cpunum_set_input_line(Machine, 0, 6, HOLD_LINE);
42      cpunum_set_input_line(machine, 0, 6, HOLD_LINE);
4443      cause_interrupt = 0;
4544   }
4645}
src/mame/drivers/spiders.c
r2454r2455
272272   /* update the different PIA pins from the input ports */
273273
274274   /* CA1 - copy of PA1 (COIN1) */
275   pia_1_ca1_w(machine, 0, input_port_0_r(machine, 0) & 0x02);
275   pia_1_ca1_w(machine, 0, input_port_read_indexed(machine,0) & 0x02);
276276
277277   /* CA2 - copy of PA0 (SERVICE1) */
278   pia_1_ca2_w(machine, 0, input_port_0_r(machine, 0) & 0x01);
278   pia_1_ca2_w(machine, 0, input_port_read_indexed(machine,0) & 0x01);
279279
280280   /* CB1 - (crosshatch) */
281   pia_1_cb1_w(machine, 0, input_port_5_r(machine, 0));
281   pia_1_cb1_w(machine, 0, input_port_read_indexed(machine,5));
282282
283283   /* CB2 - NOT CONNECTED */
284284}
src/mame/drivers/toaplan2.c
r2454r2455
684684
685685      #if USE_V25
686686      /* only the ram-based V25 based games access the following bits */
687      //cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x0020) ? CLEAR_LINE : ASSERT_LINE );
688      cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT,  (data & 0x0010) ? CLEAR_LINE : ASSERT_LINE);
687      //cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 0x0020) ? CLEAR_LINE : ASSERT_LINE );
688      cpunum_set_input_line(machine, 1, INPUT_LINE_HALT,  (data & 0x0010) ? CLEAR_LINE : ASSERT_LINE);
689689      #endif
690690
691691   }
r2454r2455
12381238{
12391239   // not sure whether this is correct
12401240   // the 68K writes here during the sound IRQ handler, and nowhere else...
1241   cpunum_set_input_line(Machine, 0, raizing_sndirq_line, CLEAR_LINE);
1241   cpunum_set_input_line(machine, 0, raizing_sndirq_line, CLEAR_LINE);
12421242}
12431243
12441244
12451245static WRITE8_HANDLER( raizing_sndirq_w )
12461246{
12471247   // if raizing_clear_sndirq_w() is correct, should this be ASSERT_LINE?
1248   cpunum_set_input_line(Machine, 0, raizing_sndirq_line, HOLD_LINE);
1248   cpunum_set_input_line(machine, 0, raizing_sndirq_line, HOLD_LINE);
12491249}
12501250
12511251
12521252static WRITE8_HANDLER( raizing_clear_nmi_w )
12531253{
1254   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
1254   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
12551255}
12561256
12571257
r2454r2455
15771577WRITE16_HANDLER( fixeight_subcpu_ctrl )
15781578{
15791579   /* 0x18 used */
1580   cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT,  (data & 0x0010) ? CLEAR_LINE : ASSERT_LINE);
1580   cpunum_set_input_line(machine, 1, INPUT_LINE_HALT,  (data & 0x0010) ? CLEAR_LINE : ASSERT_LINE);
15811581}
15821582#endif
15831583
src/mame/drivers/jchan.c
r2454r2455
480480{
481481   COMBINE_DATA(&main2sub_cmd);
482482   logerror("cpu #%d (PC=%06X): write cmd %04x to subcpu\n", cpu_getactivecpu(), activecpu_get_previouspc(), main2sub_cmd);
483   cpunum_set_input_line(Machine, 1, 4, HOLD_LINE);
483   cpunum_set_input_line(machine, 1, 4, HOLD_LINE);
484484}
485485static READ16_HANDLER ( main2sub_status_r )
486486{
r2454r2455
513513{
514514   COMBINE_DATA(&sub2main_cmd);
515515   logerror("cpu #%d (PC=%06X): write cmd %04x to maincpu\n", cpu_getactivecpu(), activecpu_get_previouspc(), sub2main_cmd);
516   cpunum_set_input_line(Machine, 0, 3, HOLD_LINE);
516   cpunum_set_input_line(machine, 0, 3, HOLD_LINE);
517517}
518518static READ16_HANDLER ( sub2main_cmd_r )
519519{
src/mame/drivers/couple.c
r2454r2455
125125};
126126#endif
127127
128static const ppi8255_interface ppi8255_intf =
128static const ppi8255_interface ppi8255_intf[2] =
129129{
130   2,
131   { input_port_0_r,   input_port_1_r },   /* Port A read */
132   { input_port_2_r,   input_port_3_r },   /* Port B read */
133   { NULL,            input_port_4_r },   /* Port C read */
134   { NULL,            NULL           },   /* Port A write */
135   { NULL,            NULL           },   /* Port B write */
136   { NULL,            NULL           },   /* Port C write */
130   {
131      input_port_0_r,            /* Port A read */
132      input_port_2_r,            /* Port B read */
133      NULL,                  /* Port C read */
134      NULL,                  /* Port A write */
135      NULL,                  /* Port B write */
136      NULL                  /* Port C write */
137   },
138   {
139      input_port_1_r,            /* Port A read */
140      input_port_3_r,            /* Port B read */
141      input_port_4_r,            /* Port C read */
142      NULL,                  /* Port A write */
143      NULL,                  /* Port B write */
144      NULL                  /* Port C write */
145   }
137146};
138147
139148static ADDRESS_MAP_START( merit_mem, ADDRESS_SPACE_PROGRAM, 8 )
140149   AM_RANGE( 0x0000, 0x7fff ) AM_ROM
141150   AM_RANGE( 0x8000, 0x9fff ) AM_ROMBANK(1)
142151   AM_RANGE( 0xa000, 0xbfff ) AM_RAM AM_BASE(&backup_ram)
143   AM_RANGE( 0xc004, 0xc007 ) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
144   AM_RANGE( 0xc008, 0xc00a ) AM_READWRITE(ppi8255_1_r, ppi8255_1_w)
152   AM_RANGE( 0xc004, 0xc007 ) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
153   AM_RANGE( 0xc008, 0xc00a ) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
145154   AM_RANGE( 0xc00b, 0xc00b ) AM_WRITE(merit_prot_w)
146155//  AM_RANGE( 0xc000, 0xc00f ) AM_READ(dummy_inputs_r)
147156//  AM_RANGE( 0xc008, 0xc008 ) AM_READ(input_port_0_r)
r2454r2455
159168   AM_RANGE(0xc10c, 0xc10c) AM_WRITE(AY8910_write_port_0_w)
160169ADDRESS_MAP_END
161170
162static MACHINE_RESET( couple )
163{
164   ppi8255_init(&ppi8255_intf);
165}
166
167171static PALETTE_INIT( couple )
168172{
169173   int i;
r2454r2455
435439   MDRV_CPU_IO_MAP(merit_io,0)
436440   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
437441
438   MDRV_MACHINE_RESET(couple)
442   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
443   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
439444
445   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
446   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
447
440448   /* video hardware */
441449   MDRV_SCREEN_ADD("main", RASTER)
442450   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/sgladiat.c
r2454r2455
2020*/
2121
2222#include "driver.h"
23#include "deprecat.h"
2423#include "cpu/z80/z80.h"
2524#include "snk.h"
2625#include "sound/ay8910.h"
r2454r2455
7574
7675static READ8_HANDLER( sgladiat_sound_nmi_ack_r )
7776{
78//  cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, CLEAR_LINE);
77//  cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, CLEAR_LINE);
7978   return 0;
8079}
8180
src/mame/drivers/mlanding.c
r2454r2455
7878{
7979   //wrong
8080   if(activecpu_get_pc()==0x822)
81      cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, PULSE_LINE);
81      cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, PULSE_LINE);
8282}
8383
8484static WRITE8_HANDLER( sound_bankswitch_w )
src/mame/drivers/gaelco.c
r2454r2455
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110#include "cpu/m6809/m6809.h"
1211#include "cpu/m68000/m68000.h"
1312#include "sound/okim6295.h"
src/mame/drivers/tankbust.c
r2454r2455
360360
361361static const struct AY8910interface ay8910_interface =
362362{
363   AY8910_LEGACY_OUTPUT,
364   AY8910_DEFAULT_LOADS,
363365   tankbust_soundlatch_r,
364   tankbust_soundtimer_r
366   tankbust_soundtimer_r,
367   NULL,
368   NULL
365369};
366370
367371static MACHINE_DRIVER_START( tankbust )
src/mame/drivers/wecleman.c
r2454r2455
372372
373373      // Bit 0 : SUBINT
374374      if ( (wecleman_irqctrl & 1) && (!(data & 1)) )   // 1->0 transition
375         cpunum_set_input_line(Machine, 1,4,HOLD_LINE);
375         cpunum_set_input_line(machine, 1,4,HOLD_LINE);
376376
377377      // Bit 1 : NSUBRST
378      if (data & 2)   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE  );
379      else                    cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE );
378      if (data & 2)   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE  );
379      else                    cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE );
380380
381381      // Bit 2 : SOUND-ON
382382      // Bit 3 : SOUNDRST
r2454r2455
408408{
409409   switch ( (wecleman_selected_ip >> 5) & 3 )
410410   {                                    // From WEC Le Mans Schems:
411      case 0:  return input_port_4_r(machine, offset);      // Accel - Schems: Accelevr
411      case 0:  return input_port_read_indexed(machine,4);      // Accel - Schems: Accelevr
412412      case 1:  return ~0;                     // ????? - Schems: Not Used
413      case 2:  return input_port_5_r(machine, offset);      // Wheel - Schems: Handlevr
413      case 2:  return input_port_read_indexed(machine,5);      // Wheel - Schems: Handlevr
414414      case 3:  return ~0;                     // Table - Schems: Turnvr
415415
416416      default: return ~0;
src/mame/drivers/pastelg.c
r2454r2455
193193
194194static const struct AY8910interface ay8910_interface =
195195{
196   AY8910_LEGACY_OUTPUT,
197   AY8910_DEFAULT_LOADS,
196198   input_port_1_r,
197   input_port_0_r
199   input_port_0_r,
200   NULL,
201   NULL
198202};
199203
200204
src/mame/drivers/seattle.c
r2454r2455
659659
660660   /* VBLANK: clear anything pending on the old IRQ */
661661   if (vblank_irq_num != 0)
662      cpunum_set_input_line(Machine, 0, vblank_irq_num, CLEAR_LINE);
662      cpunum_set_input_line(machine, 0, vblank_irq_num, CLEAR_LINE);
663663
664664   /* VBLANK: compute the new IRQ vector */
665665   irq = (*interrupt_config >> (2*VBLANK_IRQ_SHIFT)) & 3;
r2454r2455
670670   {
671671      /* Widget: clear anything pending on the old IRQ */
672672      if (widget.irq_num != 0)
673         cpunum_set_input_line(Machine, 0, widget.irq_num, CLEAR_LINE);
673         cpunum_set_input_line(machine, 0, widget.irq_num, CLEAR_LINE);
674674
675675      /* Widget: compute the new IRQ vector */
676676      irq = (*interrupt_config >> (2*WIDGET_IRQ_SHIFT)) & 3;
r2454r2455
682682   {
683683      /* Ethernet: clear anything pending on the old IRQ */
684684      if (ethernet_irq_num != 0)
685         cpunum_set_input_line(Machine, 0, ethernet_irq_num, CLEAR_LINE);
685         cpunum_set_input_line(machine, 0, ethernet_irq_num, CLEAR_LINE);
686686
687687      /* Ethernet: compute the new IRQ vector */
688688      irq = (*interrupt_config >> (2*ETHERNET_IRQ_SHIFT)) & 3;
r2454r2455
10181018            }
10191019
10201020            /* write the data and advance */
1021            voodoo_0_w(machine, (dstaddr & 0xffffff) / 4, program_read_dword(srcaddr), 0);
1021            voodoo_0_w(machine, (dstaddr & 0xffffff) / 4, program_read_dword(srcaddr), 0xffffffff);
10221022            srcaddr += srcinc;
10231023            dstaddr += dstinc;
10241024            bytesleft -= 4;
r2454r2455
11691169         int which = offset % 4;
11701170
11711171         if (LOG_DMA)
1172            logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", activecpu_get_pc(), offset*4, data, ~mem_mask);
1172            logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask);
11731173
11741174         /* keep the read only activity bit */
11751175         galileo.reg[offset] &= ~0x4000;
r2454r2455
12401240
12411241      case GREG_INT_STATE:
12421242         if (LOG_GALILEO)
1243            logerror("%08X:Galileo write to IRQ clear = %08X & %08X\n", offset*4, data, ~mem_mask);
1243            logerror("%08X:Galileo write to IRQ clear = %08X & %08X\n", offset*4, data, mem_mask);
12441244         galileo.reg[offset] = oldata & data;
12451245         update_galileo_irqs();
12461246         break;
r2454r2455
12781278      case GREG_CONFIG_ADDRESS:
12791279      case GREG_INT_MASK:
12801280         if (LOG_GALILEO)
1281            logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", activecpu_get_pc(), offset*4, data, ~mem_mask);
1281            logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask);
12821282         break;
12831283
12841284      default:
1285         logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", activecpu_get_pc(), offset*4, data, ~mem_mask);
1285         logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask);
12861286         break;
12871287   }
12881288}
r2454r2455
14671467static READ32_HANDLER( ethernet_r )
14681468{
14691469   if (!(offset & 8))
1470      return smc91c94_r(machine, offset & 7, mem_mask | 0x0000);
1470      return smc91c94_r(machine, offset & 7, mem_mask & 0xffff);
14711471   else
1472      return smc91c94_r(machine, offset & 7, mem_mask | 0xff00);
1472      return smc91c94_r(machine, offset & 7, mem_mask & 0x00ff);
14731473}
14741474
14751475
14761476static WRITE32_HANDLER( ethernet_w )
14771477{
14781478   if (!(offset & 8))
1479      smc91c94_w(machine, offset & 7, data & 0xffff, mem_mask | 0x0000);
1479      smc91c94_w(machine, offset & 7, data & 0xffff, mem_mask | 0xffff);
14801480   else
1481      smc91c94_w(machine, offset & 7, data & 0x00ff, mem_mask | 0xff00);
1481      smc91c94_w(machine, offset & 7, data & 0x00ff, mem_mask | 0x00ff);
14821482}
14831483
14841484
r2454r2455
15351535   }
15361536
15371537   if (LOG_WIDGET)
1538      logerror("Widget read (%02X) = %08X & %08X\n", offset*4, result, ~mem_mask);
1538      logerror("Widget read (%02X) = %08X & %08X\n", offset*4, result, mem_mask);
15391539   return result;
15401540}
15411541
r2454r2455
15431543static WRITE32_HANDLER( widget_w )
15441544{
15451545   if (LOG_WIDGET)
1546      logerror("Widget write (%02X) = %08X & %08X\n", offset*4, data, ~mem_mask);
1546      logerror("Widget write (%02X) = %08X & %08X\n", offset*4, data, mem_mask);
15471547
15481548   switch (offset)
15491549   {
src/mame/drivers/munchmo.c
r2454r2455
6464
6565static WRITE8_HANDLER( sound_nmi_ack_w )
6666{
67   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
67   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
6868}
6969
7070static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/funkybee.c
r2454r2455
9494static READ8_HANDLER( funkybee_input_port_0_r )
9595{
9696   watchdog_reset_r(machine,0);
97   return input_port_0_r(machine,offset);
97   return input_port_read_indexed(machine,0);
9898}
9999
100100static WRITE8_HANDLER( funkybee_coin_counter_w )
r2454r2455
298298
299299static const struct AY8910interface ay8910_interface =
300300{
301   input_port_3_r
301   AY8910_LEGACY_OUTPUT,
302   AY8910_DEFAULT_LOADS,
303   input_port_3_r,
304   NULL,
305   NULL,
306   NULL
302307};
303308
304309
src/mame/drivers/btoads.c
r2454r2455
77**************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110#include "cpu/tms34010/tms34010.h"
1211#include "video/tlc34076.h"
1312#include "btoads.h"
r2454r2455
150149      sndti_reset(SOUND_BSMT2000, 0);
151150
152151   /* also clears interrupts */
153   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
152   cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
154153   sound_int_state = data;
155154}
156155
r2454r2455
172171{
173172   UINT16 reg = offset >> 8;
174173   UINT16 val = ((offset & 0xff) << 8) | data;
175   BSMT2000_data_0_w(machine, reg, val, 0);
174   BSMT2000_data_0_w(machine, reg, val, 0xffff);
176175}
177176
178177
src/mame/drivers/tetrisp2.c
r2454r2455
157215723.3 /
15731573(actual label is "Cawaii 1 Ver1.1" & "Cawaii 3 Ver1.1")
15741574
1575MR97006-01.2 (42pin mask ROM, read as 32M byte mode)
1575MR97006-01.2 (42pin mask ROM, read as 16M, byte mode)
15761576MR97006-02.5 (same as above)
15771577MR97001-01.6 (same as above)
15781578MR96017-04.9 (same as above, samples)
15791579
1580MR97006-04.8 (32pin mask ROM, read as 534000)
1580MR97006-04.8 (32pin mask ROM, read as 8M)
15811581
15821582
15831583dumped by sayu
src/mame/drivers/lastduel.c
r2454r2455
239239
240240static const struct YM2203interface ym2203_interface =
241241{
242   0,0,0,0,irqhandler
242   {
243         AY8910_LEGACY_OUTPUT,
244         AY8910_DEFAULT_LOADS,
245         NULL, NULL, NULL, NULL,
246   },
247   irqhandler
243248};
244249
245250static INTERRUPT_GEN( lastduel_interrupt )
src/mame/drivers/alpha68k.c
r2454r2455
19511951
19521952static const struct AY8910interface ay8910_interface =
19531953{
1954   AY8910_LEGACY_OUTPUT,
1955   AY8910_DEFAULT_LOADS,
19541956   soundlatch_r
19551957};
19561958
19571959static const struct YM2203interface ym2203_interface =
19581960{
1959   soundlatch_r
1961   {
1962      AY8910_LEGACY_OUTPUT,
1963      AY8910_DEFAULT_LOADS,
1964      soundlatch_r
1965   }
19601966};
19611967
19621968static void YM3812_irq(int param)
src/mame/drivers/lucky8.c
r2454r2455
346346
347347static const struct AY8910interface ay8910_interface =
348348{
349input_port_7_r,   // DSW3
350input_port_8_r,   // DSW4
3510,
3520
349   AY8910_LEGACY_OUTPUT,
350   AY8910_DEFAULT_LOADS,
351   input_port_7_r,   // DSW3
352   input_port_8_r,   // DSW4
353   NULL,
354   NULL
353355};
354356
355357static MACHINE_DRIVER_START( lucky8 )
src/mame/drivers/boxer.c
r2454r2455
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1312
1413extern UINT8* boxer_tile_ram;
1514extern UINT8* boxer_sprite_ram;
r2454r2455
147146
148147   pot_latch = data & 0x3f;
149148
150   cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
149   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
151150}
152151
153152
154153static WRITE8_HANDLER( boxer_irq_reset_w )
155154{
156   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
155   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
157156}
158157
159158
src/mame/drivers/tmaster.c
r2454r2455
22
33                      -= Touch Master / Galaxy Games =-
44
5                    driver by   Luca Elia (l.elia@tin.it)
5         driver by Luca Elia (l.elia@tin.it) and Mariusz Wojcieszek
66
77
88CPU:    68000
r2454r2455
1111
1212[Touch Master]
1313
14Input:  Pressure sensitive touch screen
14Input:  Microtouch touch screen
1515Other:  Dallas NVRAM + optional RTC
1616To Do:
1717
18- Proper touchscreen controller emulation. Currently it's flakey and
19  tends to stop registering user input (try coining up in that case)
20- Protection in tm4k and later games
18- Protection in tm4k and later games (where is DS1204 mapped?)
2119- Coin optics
22- RTC emulation (there's code to check the upper bytes of NVRAM to see if
23  the real time clock is present, and to only use it in that case)
20- Is sound banking correct?
2421
2522To be dumped and added:
2623
r2454r2455
3027Touch Master 8000 *(?)
3128
3229* There is a reported "Minnesota" version with modifications due to legal issues
33  Touch Master 5000 is labeled "DOMESTIC" (AKA "Standard"), is there an EXPORT version?
30  Touch Master (current set) is a Euro version, all other sets are "DOMESTIC" (AKA "Standard").
3431  Is there a Touch Master 6000?  TM5K is version 7.10, then TM7K is version 8, TM8K is version 9.04
3532  Starting with Touch Master 2000, each later version is a chipswap for the mainboard.
3633   IE: Touch Master 8000 chips can update any Touch Master mainboard 2000 through 7000
34  Each version (IE: 2000, 3000, 7000 ect) has different girls for Strip Poker ;-)
3735
3836Touch Master 8000 part lists:
3937
r2454r2455
4846A-5343-60194-9  U41 Graphics
4947A-21657-007     Security Key
5048
49Known Versions not dumped:
50  Touch Master 7000 V8.04
51  Touch Master 8000 V9.04 (from service bulletin)
52
5153******************************************************************
5254
5355[Galaxy Games]
r2454r2455
6466#include "deprecat.h"
6567#include "sound/okim6295.h"
6668#include "machine/eeprom.h"
69#include "machine/microtch.h"
70#include "machine/68681.h"
6771
6872/***************************************************************************
6973
r2454r2455
8993
9094/***************************************************************************
9195
92                 Touch Screen Controller - PRELIMINARY
96    68681 DUART <-> Microtouch touch screen controller communication
9397
9498***************************************************************************/
9599
96static int touchscreen;
97
98static void show_touchscreen(running_machine *machine)
100static void duart_irq_handler(UINT8 vector)
99101{
100#ifdef MAME_DEBUG
101   popmessage("% d] %03x %03x - %d",touchscreen,input_port_read(machine, "TSCREEN_X")&0x1ff,input_port_read(machine, "TSCREEN_Y"),okibank);
102#endif
103}
102   cpunum_set_input_line_and_vector(Machine, 0, 4, HOLD_LINE, vector);
103};
104104
105static WRITE16_HANDLER( tmaster_tscreen_reset_w )
105static void duart_tx(int channel, UINT8 data)
106106{
107   if (ACCESSING_BITS_0_7 && data == 0x05)
107   if ( channel == 0 )
108108   {
109      touchscreen = 0;
110      show_touchscreen(machine);
109      //logerror( "duart->microtouch: %02x %c\n", data, (char)data);
110      microtouch_rx(1, &data);
111111   }
112}
112};
113113
114static READ16_HANDLER( tmaster_tscreen_next_r )
114static void microtouch_tx(UINT8 data)
115115{
116   if (touchscreen != -1)
117      touchscreen++;
118   if (touchscreen == 6)
119      touchscreen = -1;
120   show_touchscreen(machine);
121
122   return 0;
116   //logerror( "microtouch->duart: %02x %c\n", data, (char)data);
117   duart_68681_rx_data(0, data);
123118}
124119
125static READ16_HANDLER( tmaster_tscreen_x_hi_r )
120
121/***************************************************************************
122
123  DS1644 RTC
124
125***************************************************************************/
126
127static UINT8 rtc_ram[8];
128
129static UINT8 binary_to_BCD(UINT8 data)
126130{
127   switch (touchscreen)
128   {
129      case -1:   return 0xf1;
130   }
131   return 0x01;
131   data %= 100;
132
133   return ((data / 10) << 4) | (data %10);
132134}
133135
134static READ16_HANDLER( tmaster_tscreen_x_lo_r )
136static READ16_HANDLER(rtc_r)
135137{
136   UINT16 val = 0;
138   mame_system_time systime;
137139
138   int press1 = input_port_read(machine, "TSCREEN_X") & 0x4000;
139   int press2 = input_port_read(machine, "TSCREEN_X") & 0x8000;
140   if (press1)   press2 = 1;
140   mame_get_current_datetime(Machine, &systime);
141   rtc_ram[0x1] = binary_to_BCD(systime.local_time.second);
142   rtc_ram[0x2] = binary_to_BCD(systime.local_time.minute);
143   rtc_ram[0x3] = binary_to_BCD(systime.local_time.hour);
144   rtc_ram[0x4] = binary_to_BCD(systime.local_time.weekday+1);
145   rtc_ram[0x5] = binary_to_BCD(systime.local_time.mday);
146   rtc_ram[0x6] = binary_to_BCD(systime.local_time.month+1);
147   rtc_ram[0x7] = binary_to_BCD(systime.local_time.year % 100);
141148
142   switch (touchscreen)
143   {
144      case 1:   val = press1 ? 0 : 1<<6;   break;   // press
145      case 2:   val = input_port_read(machine, "TSCREEN_X") & 0x003;   break;
146      case 3:   val = (input_port_read(machine, "TSCREEN_X") >> 2) & 0x7f;   break;
147      case 4:   val = 0;   break;
148      case 5:   val = ((input_port_read(machine, "TSCREEN_Y")^0xff) >> 1) & 0x7f;   break;
149   return rtc_ram[offset];
150}
149151
150      default:
151         return 0;
152static WRITE16_HANDLER(rtc_w)
153{
154   if ( offset == 0 )
155   {
156      rtc_ram[0x0] = data & 0xff;
152157   }
153   return val | (press2 ? 0x80 : 0);   // away : hover
154158}
155159
156static READ16_HANDLER( tmaster_tscreen_y_hi_r )   {   return 0x01;   }
157static READ16_HANDLER( tmaster_tscreen_y_lo_r )   {   return 0x00;   }
158160
159
160
161161/***************************************************************************
162162
163163                                Video & Blitter
r2454r2455
362362   {
363363      case 0x0e:
364364         tmaster_draw();
365         cpunum_set_input_line(Machine, 0, 2, HOLD_LINE);
365         cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
366366         break;
367367   }
368368}
r2454r2455
390390static ADDRESS_MAP_START( tmaster_map, ADDRESS_SPACE_PROGRAM, 16 )
391391   AM_RANGE( 0x000000, 0x1fffff ) AM_ROM
392392   AM_RANGE( 0x200000, 0x27ffff ) AM_RAM
393   AM_RANGE( 0x280000, 0x28ffff ) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size)
393   AM_RANGE( 0x280000, 0x28ffef ) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size)
394   AM_RANGE( 0x28fff0, 0x28ffff ) AM_READWRITE( rtc_r, rtc_w )
394395
395396   AM_RANGE( 0x300010, 0x300011 ) AM_READ( tmaster_coins_r )
396397
397   AM_RANGE( 0x300022, 0x300023 ) AM_READ ( tmaster_tscreen_x_hi_r )
398   AM_RANGE( 0x300024, 0x300025 ) AM_WRITE( tmaster_tscreen_reset_w )
399   AM_RANGE( 0x300026, 0x300027 ) AM_READ ( tmaster_tscreen_x_lo_r )
400   AM_RANGE( 0x300028, 0x300029 ) AM_READ ( tmaster_tscreen_next_r )
401   AM_RANGE( 0x300032, 0x300033 ) AM_READ ( tmaster_tscreen_y_hi_r )
402   AM_RANGE( 0x300036, 0x300037 ) AM_READ ( tmaster_tscreen_y_lo_r )
398   AM_RANGE( 0x300020, 0x30003f ) AM_READWRITE( duart_68681_r, duart_68681_w )
403399
404400   AM_RANGE( 0x300040, 0x300041 ) AM_WRITE( tmaster_oki_bank_w )
405401
r2454r2455
488484      palette_data[palette_index] = data & 0xff;
489485      if (++palette_index == 3)
490486      {
491         palette_set_color(Machine, palette_offset, MAKE_RGB(palette_data[0], palette_data[1], palette_data[2]));
487         palette_set_color(machine, palette_offset, MAKE_RGB(palette_data[0], palette_data[1], palette_data[2]));
492488         palette_index = 0;
493489         palette_offset++;
494490      }
r2454r2455
603599                                Input Ports
604600
605601***************************************************************************/
602static INPUT_PORTS_START( tm )
603   PORT_INCLUDE(microtouch)
606604
605   PORT_START_TAG("COIN") // IN3
606   PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_UNKNOWN   ) // m. coin 1 (coin optics?)
607   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_UNKNOWN   ) // m. coin 2 (coin optics?)
608   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_UNKNOWN   ) // dbv input (coin optics?)
609   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
610   PORT_BIT( 0x0010, IP_ACTIVE_LOW,  IPT_COIN1      )   // (service coin?)
611   PORT_SERVICE_NO_TOGGLE( 0x0020, IP_ACTIVE_LOW   )
612   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_SERVICE1   )   // calibrate
613   PORT_BIT( 0x0080, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
614   PORT_BIT( 0x0100, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
615   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
616   PORT_BIT( 0x0400, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
617   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_SPECIAL   )
618   PORT_BIT( 0x1000, IP_ACTIVE_LOW,  IPT_COIN1      )   PORT_IMPULSE(2) // e. coin 1
619   PORT_BIT( 0x2000, IP_ACTIVE_LOW,  IPT_UNKNOWN   )   // e. coin 2
620   PORT_BIT( 0x4000, IP_ACTIVE_LOW,  IPT_UNKNOWN   )   // e. coin 3
621   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_UNKNOWN   )   // e. coin 4
622INPUT_PORTS_END
623
607624static INPUT_PORTS_START( tmaster )
608   PORT_START_TAG("TSCREEN_X")
609   PORT_BIT( 0x01ff, 0x100, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1, 0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(3) PORT_PLAYER(1)
610   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON1 )   PORT_IMPULSE(5)   // press
611   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON2 )               // hover
625   PORT_INCLUDE(microtouch)
612626
613   PORT_START_TAG("TSCREEN_Y")
614   PORT_BIT( 0x0ff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1, 0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(3) PORT_PLAYER(1)
615
616627   PORT_START_TAG("COIN") // IN3
617628   PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_COIN1      )   PORT_IMPULSE(2)   // m. coin 1 (coin optics?)
618   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_COIN1      )   PORT_IMPULSE(4)   // m. coin 2 (coin optics?)
619   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_COIN1      )   PORT_IMPULSE(6)   // dbv input (coin optics?)
629   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_UNKNOWN   ) // m. coin 2 (coin optics?)
630   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_UNKNOWN   ) // dbv input (coin optics?)
620631   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
621632   PORT_BIT( 0x0010, IP_ACTIVE_LOW,  IPT_COIN1      )   // (service coin?)
622633   PORT_SERVICE_NO_TOGGLE( 0x0020, IP_ACTIVE_LOW   )
r2454r2455
626637   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
627638   PORT_BIT( 0x0400, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
628639   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_SPECIAL   )
629   PORT_BIT( 0x1000, IP_ACTIVE_LOW,  IPT_COIN1      )   // e. coin 1
630   PORT_BIT( 0x2000, IP_ACTIVE_LOW,  IPT_COIN2      )   // e. coin 2
631   PORT_BIT( 0x4000, IP_ACTIVE_LOW,  IPT_COIN3      )   // e. coin 3
632   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_COIN4      )   // e. coin 4
640   PORT_BIT( 0x1000, IP_ACTIVE_LOW,  IPT_UNKNOWN   )   // e. coin 1
641   PORT_BIT( 0x2000, IP_ACTIVE_LOW,  IPT_UNKNOWN   )   // e. coin 2
642   PORT_BIT( 0x4000, IP_ACTIVE_LOW,  IPT_UNKNOWN   )   // e. coin 3
643   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_UNKNOWN   )   // e. coin 4
633644INPUT_PORTS_END
634645
635646static INPUT_PORTS_START( galgames )
r2454r2455
684695
685696***************************************************************************/
686697
687static MACHINE_RESET( tmaster )
698static MACHINE_START( tmaster )
688699{
689   touchscreen = -1;
700   duart_68681_init(0, duart_irq_handler, duart_tx);
701   microtouch_init(microtouch_tx, 0);
690702}
691703
692704static INTERRUPT_GEN( tm3k_interrupt )
r2454r2455
695707   {
696708      case 0:      cpunum_set_input_line(machine, 0, 2, HOLD_LINE);   break;
697709      case 1:      cpunum_set_input_line(machine, 0, 3, HOLD_LINE);   break;
698
699      case 2:
700      case 3:
701      case 4:
702      case 5:
703      case 6:      cpunum_set_input_line_and_vector(machine, 0, 4, HOLD_LINE, 0x100/4);   break;   // touch screen controller
704
705710      default:   cpunum_set_input_line(machine, 0, 1, HOLD_LINE);   break;
706711   }
707712}
r2454r2455
709714static MACHINE_DRIVER_START( tm3k )
710715   MDRV_CPU_ADD_TAG("main", M68000, 12000000)
711716   MDRV_CPU_PROGRAM_MAP(tmaster_map,0)
712   MDRV_CPU_VBLANK_INT_HACK(tm3k_interrupt,2+5+20) // ??
717   MDRV_CPU_VBLANK_INT_HACK(tm3k_interrupt,2+20) // ??
713718
714   MDRV_MACHINE_RESET(tmaster)
719   MDRV_MACHINE_START(tmaster)
715720   MDRV_NVRAM_HANDLER(generic_0fill)
716721
717722
r2454r2455
735740MACHINE_DRIVER_END
736741
737742
738static INTERRUPT_GEN( tm_interrupt )
739{
740   switch (cpu_getiloops())
741   {
742      case 0:      cpunum_set_input_line(machine, 0, 2, HOLD_LINE);   break;
743      case 1:      cpunum_set_input_line(machine, 0, 3, HOLD_LINE);   break;
744      case 2:      cpunum_set_input_line_and_vector(machine, 0, 4, HOLD_LINE, 0x100/4);   break;   // touch screen controller
745      default:   cpunum_set_input_line(machine, 0, 1, HOLD_LINE);   break;
746   }
747}
748
749743static MACHINE_DRIVER_START( tm )
750744   MDRV_IMPORT_FROM(tm3k)
751   MDRV_CPU_MODIFY("main")
752   MDRV_CPU_VBLANK_INT_HACK(tm_interrupt,3+20) // ??
753745
754746   MDRV_SOUND_REPLACE("OKI",OKIM6295, 1122000)
755747   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified
r2454r2455
831823
832824ROM_START( tm )
833825   ROM_REGION( 0x200000, REGION_CPU1, 0 ) // 68000 Code
834   ROM_LOAD16_BYTE( "tmaster.u51", 0x000000, 0x080000, CRC(edaa5874) SHA1(48b99bc7f5a6453def265967ca7d8eefdf9dc97b) )
835   ROM_LOAD16_BYTE( "tmaster.u52", 0x000001, 0x080000, CRC(e9fd30fc) SHA1(d91ea05d5f574603883336729fb9df705688945d) )
826   ROM_LOAD16_BYTE( "tmaster.u51", 0x000000, 0x080000, CRC(edaa5874) SHA1(48b99bc7f5a6453def265967ca7d8eefdf9dc97b) ) /* Ver: 3.00 Euro 11-25-96 */
827   ROM_LOAD16_BYTE( "tmaster.u52", 0x000001, 0x080000, CRC(e9fd30fc) SHA1(d91ea05d5f574603883336729fb9df705688945d) ) /* Ver: 3.00 Euro 11-25-96 */
836828
837829   ROM_REGION( 0x400000, REGION_GFX1, ROMREGION_ERASE )   // Blitter gfx
838830   ROM_LOAD16_BYTE( "tmaster.u38", 0x100000, 0x080000, CRC(68885ef6) SHA1(010602b59c33c3e490491a296ddaf8952e315b83) )
r2454r2455
868860TM3K_u40.bin               5.0  Video Images & Graphics         ccb4
869861TM3K_u41.bin               5.0  Video Images & Graphics         54a7
870862u62 (NOT INCLUDED)         N/A  Battery Memory Module           N/A
871J12 DALLAS DS1204V         N/A  Security Key (required for this Version) - Labeled A-21657-002
863J12 DALLAS DS1204V         N/A  Security Key (required for this Version???) - Labeled A-21657-002
872864-----------------------------------------------------------------------------------
873865
874866SCN68681c1n40
r2454r2455
10841076   // RAM, filled by the 68000 and fed to the OKI
10851077ROM_END
10861078
1087static DRIVER_INIT( tm3k )
1088{
1089   // try this if you need to calibrate
1090#if 0
1091   UINT16 *ROM = (UINT16 *)memory_region( REGION_CPU1 );
1092   // tscreen test
1093   ROM[0x75e3c/2] = 0x4ef9;
1094   ROM[0x75e3e/2] = 0x0007;
1095   ROM[0x75e40/2] = 0x5e4a;
10961079
1097   // tscreen test
1098   ROM[0x765ca/2] = 0x7001;
1099#endif
1100}
1101
11021080static DRIVER_INIT( tm4k )
11031081{
11041082   UINT16 *ROM = (UINT16 *)memory_region( REGION_CPU1 );
r2454r2455
11761154   memory_configure_bank(4, 0, 1, memory_region(REGION_CPU1)+0x200000, 0x40000);
11771155}
11781156
1179GAME( 1996, tm,       0, tm,       tmaster,  0,        ROT0, "Midway",                         "Touchmaster",               GAME_NOT_WORKING )
1180GAME( 1997, tm3k,     0, tm3k,     tmaster,  tm3k,     ROT0, "Midway",                         "Touchmaster 3000 (v5.01)",  GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS)   // imp. graphics due to bad dump
1181GAME( 1998, tm4k,     0, tm3k,     tmaster,  tm4k,     ROT0, "Midway",                         "Touchmaster 4000 (v6.02)",  GAME_NOT_WORKING )
1182GAME( 1998, tm5k,     0, tm3k,     tmaster,  tm5k,     ROT0, "Midway",                         "Touchmaster 5000 (v7.10)",  GAME_NOT_WORKING )
1183GAME( 1999, tm7k,     0, tm3k,     tmaster,  tm7k,     ROT0, "Midway",                         "Touchmaster 7000 (v8.00)",  GAME_NOT_WORKING )
1157GAME( 1996, tm,       0, tm,       tm,       0,        ROT0, "Midway",                         "Touchmaster (v3.00 Euro)",           0 )
1158GAME( 1997, tm3k,     0, tm3k,     tmaster,  0,        ROT0, "Midway",                         "Touchmaster 3000 (v5.01 Standard)",  GAME_IMPERFECT_GRAPHICS)   // imp. graphics due to bad dump
1159GAME( 1998, tm4k,     0, tm3k,     tmaster,  tm4k,     ROT0, "Midway",                         "Touchmaster 4000 (v6.02 Standard)",  0 )
1160GAME( 1998, tm5k,     0, tm3k,     tmaster,  tm5k,     ROT0, "Midway",                         "Touchmaster 5000 (v7.10 Standard)",  0 )
1161GAME( 1999, tm7k,     0, tm3k,     tmaster,  tm7k,     ROT0, "Midway",                         "Touchmaster 7000 (v8.00 Standard)",  0 )
11841162GAME( 1998, galgbios, 0, galgames, galgames, galgames, ROT0, "Creative Electonics & Software", "Galaxy Games (BIOS v1.90)", GAME_IS_BIOS_ROOT )
src/mame/drivers/tcl.c
r2454r2455
8686   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout2,     0, 16 ) /* wrong */
8787GFXDECODE_END
8888
89static const ppi8255_interface ppi8255_intf =
89static const ppi8255_interface ppi8255_intf[2] =
9090{
91   2,
92   { NULL, NULL },
93   { NULL, NULL },
94   { NULL, NULL },
95   { NULL, NULL },
96   { NULL, NULL },
97   { NULL, NULL },
91   {
92      NULL,
93      NULL,
94      NULL,
95      NULL,
96      NULL,
97      NULL
98   },
99   {
100      NULL,
101      NULL,
102      NULL,
103      NULL,
104      NULL,
105      NULL
106   }
98107};
99108
100static MACHINE_RESET( tcl )
101{
102   ppi8255_init(&ppi8255_intf);
103}
104109
105
106110static MACHINE_DRIVER_START( tcl )
107111
108112   /* basic machine hardware */
r2454r2455
123127   MDRV_VIDEO_START(tcl)
124128   MDRV_VIDEO_UPDATE(tcl)
125129
126   MDRV_MACHINE_RESET(tcl)
130   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
131   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
127132
133   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
134   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
135
128136   /* sound hardware */
129137   MDRV_SPEAKER_STANDARD_MONO("mono")
130138
src/mame/drivers/freekick.c
r2454r2455
221221   AM_RANGE(0xd000, 0xdfff) AM_READ(SMH_RAM)
222222   AM_RANGE(0xe000, 0xe7ff) AM_READ(SMH_RAM)   // tilemap
223223   AM_RANGE(0xe800, 0xe8ff) AM_READ(SMH_RAM)   // sprites
224   AM_RANGE(0xec00, 0xec03) AM_READ(ppi8255_0_r)
225   AM_RANGE(0xf000, 0xf003) AM_READ(ppi8255_1_r)
224   AM_RANGE(0xec00, 0xec03) AM_DEVREAD(PPI8255, "ppi8255_0", ppi8255_r)
225   AM_RANGE(0xf000, 0xf003) AM_DEVREAD(PPI8255, "ppi8255_1", ppi8255_r)
226226   AM_RANGE(0xf800, 0xf800) AM_READ(input_port_3_r)
227227   AM_RANGE(0xf801, 0xf801) AM_READ(input_port_4_r)
228228   AM_RANGE(0xf802, 0xf802) AM_READ(SMH_NOP)   //MUST return bit 0 = 0, otherwise game resets
r2454r2455
234234   AM_RANGE(0xd000, 0xdfff) AM_WRITE(SMH_RAM)
235235   AM_RANGE(0xe000, 0xe7ff) AM_WRITE(freek_videoram_w) AM_BASE(&freek_videoram)
236236   AM_RANGE(0xe800, 0xe8ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
237   AM_RANGE(0xec00, 0xec03) AM_WRITE(ppi8255_0_w)
238   AM_RANGE(0xf000, 0xf003) AM_WRITE(ppi8255_1_w)
237   AM_RANGE(0xec00, 0xec03) AM_DEVWRITE(PPI8255, "ppi8255_0", ppi8255_w)
238   AM_RANGE(0xf000, 0xf003) AM_DEVWRITE(PPI8255, "ppi8255_1", ppi8255_w)
239239   AM_RANGE(0xf800, 0xf801) AM_WRITE(flipscreen_w)
240240   AM_RANGE(0xf802, 0xf803) AM_WRITE(coin_w)
241241   AM_RANGE(0xf804, 0xf804) AM_WRITE(nmi_enable_w)
r2454r2455
597597   return memory_region(REGION_USER1)[romaddr & 0x7fff];
598598}
599599
600static const ppi8255_interface ppi8255_intf =
600static const ppi8255_interface ppi8255_intf[2] =
601601{
602   2,                               /* 1 chips */
603   { NULL,             input_port_0_r },   /* Port A read */
604   { NULL,             input_port_1_r },   /* Port B read */
605   { snd_rom_r,        input_port_2_r },   /* Port C read */
606   { snd_rom_addr_l_w, NULL },            /* Port A write */
607   { snd_rom_addr_h_w, NULL },            /* Port B write */
608   { NULL,             NULL },            /* Port C write */
602   {
603      NULL,                     /* Port A read */
604      NULL,                     /* Port B read */
605      snd_rom_r,                  /* Port C read */
606      snd_rom_addr_l_w,            /* Port A write */
607      snd_rom_addr_h_w,            /* Port B write */
608      NULL                     /* Port C write */
609   },
610   {
611      input_port_0_r,               /* Port A read */
612      input_port_1_r,               /* Port B read */
613      input_port_2_r,               /* Port C read */
614      NULL,                     /* Port A write */
615      NULL,                     /* Port B write */
616      NULL                     /* Port C write */
617   }
609618};
610619
611static MACHINE_RESET( freekckb )
612{
613   ppi8255_init(&ppi8255_intf);
614}
615620
616621
617
618622/*************************************
619623 *
620624 *  Graphics definitions
r2454r2455
709713   MDRV_CPU_PROGRAM_MAP(freekckb_readmem,freekckb_writemem)
710714   MDRV_CPU_IO_MAP(freekckb_readport,freekckb_writeport)
711715
712   MDRV_MACHINE_RESET(freekckb)
716   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
717   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
713718
719   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
720   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
721
714722   MDRV_VIDEO_UPDATE(freekick)
715723MACHINE_DRIVER_END
716724
src/mame/drivers/cischeat.c
r2454r2455
232232   int b = pal5bit(((word >> 3 ) & 0x1E ) | ((word >> 1) & 0x01));
233233
234234   // Scroll 0
235   if ( (offset >= 0x0e00/2) && (offset <= 0x0fff/2) ) { palette_set_color(Machine, 0x000 + offset - 0x0e00/2, MAKE_RGB(r,g,b) ); return;}
235   if ( (offset >= 0x0e00/2) && (offset <= 0x0fff/2) ) { palette_set_color(machine, 0x000 + offset - 0x0e00/2, MAKE_RGB(r,g,b) ); return;}
236236   // Scroll 1
237   if ( (offset >= 0x1600/2) && (offset <= 0x17ff/2) ) { palette_set_color(Machine, 0x100 + offset - 0x1600/2, MAKE_RGB(r,g,b) ); return;}
237   if ( (offset >= 0x1600/2) && (offset <= 0x17ff/2) ) { palette_set_color(machine, 0x100 + offset - 0x1600/2, MAKE_RGB(r,g,b) ); return;}
238238   // Road 0
239   if ( (offset >= 0x1800/2) && (offset <= 0x1fff/2) ) { palette_set_color(Machine, 0x200 + offset - 0x1800/2, MAKE_RGB(r,g,b) ); return;}
239   if ( (offset >= 0x1800/2) && (offset <= 0x1fff/2) ) { palette_set_color(machine, 0x200 + offset - 0x1800/2, MAKE_RGB(r,g,b) ); return;}
240240   // Road 1
241   if ( (offset >= 0x2000/2) && (offset <= 0x27ff/2) ) { palette_set_color(Machine, 0x600 + offset - 0x2000/2, MAKE_RGB(r,g,b) ); return;}
241   if ( (offset >= 0x2000/2) && (offset <= 0x27ff/2) ) { palette_set_color(machine, 0x600 + offset - 0x2000/2, MAKE_RGB(r,g,b) ); return;}
242242   // Sprites
243   if ( (offset >= 0x2800/2) && (offset <= 0x2fff/2) ) { palette_set_color(Machine, 0xa00 + offset - 0x2800/2, MAKE_RGB(r,g,b) ); return;}
243   if ( (offset >= 0x2800/2) && (offset <= 0x2fff/2) ) { palette_set_color(machine, 0xa00 + offset - 0x2800/2, MAKE_RGB(r,g,b) ); return;}
244244   // Scroll 2
245   if ( (offset >= 0x3600/2) && (offset <= 0x37ff/2) ) { palette_set_color(Machine, 0xe00 + offset - 0x3600/2, MAKE_RGB(r,g,b) ); return;}
245   if ( (offset >= 0x3600/2) && (offset <= 0x37ff/2) ) { palette_set_color(machine, 0xe00 + offset - 0x3600/2, MAKE_RGB(r,g,b) ); return;}
246246}
247247
248248static ADDRESS_MAP_START( bigrun_readmem, ADDRESS_SPACE_PROGRAM, 16 )
r2454r2455
304304   int b = pal5bit(((word >> 3 ) & 0x1E ) | ((word >> 1) & 0x01));
305305
306306   // Scroll 0
307   if ( (offset >= 0x1c00/2) && (offset <= 0x1fff/2) ) { palette_set_color(Machine, 0x000 + offset - 0x1c00/2, MAKE_RGB(r,g,b) ); return;}
307   if ( (offset >= 0x1c00/2) && (offset <= 0x1fff/2) ) { palette_set_color(machine, 0x000 + offset - 0x1c00/2, MAKE_RGB(r,g,b) ); return;}
308308   // Scroll 1
309   if ( (offset >= 0x2c00/2) && (offset <= 0x2fff/2) ) { palette_set_color(Machine, 0x200 + offset - 0x2c00/2, MAKE_RGB(r,g,b) ); return;}
309   if ( (offset >= 0x2c00/2) && (offset <= 0x2fff/2) ) { palette_set_color(machine, 0x200 + offset - 0x2c00/2, MAKE_RGB(r,g,b) ); return;}
310310   // Scroll 2
311   if ( (offset >= 0x6c00/2) && (offset <= 0x6fff/2) ) { palette_set_color(Machine, 0x400 + offset - 0x6c00/2, MAKE_RGB(r,g,b) ); return;}
311   if ( (offset >= 0x6c00/2) && (offset <= 0x6fff/2) ) { palette_set_color(machine, 0x400 + offset - 0x6c00/2, MAKE_RGB(r,g,b) ); return;}
312312   // Road 0
313   if ( (offset >= 0x3800/2) && (offset <= 0x3fff/2) ) { palette_set_color(Machine, 0x600 + offset - 0x3800/2, MAKE_RGB(r,g,b) ); return;}
313   if ( (offset >= 0x3800/2) && (offset <= 0x3fff/2) ) { palette_set_color(machine, 0x600 + offset - 0x3800/2, MAKE_RGB(r,g,b) ); return;}
314314   // Road 1
315   if ( (offset >= 0x4800/2) && (offset <= 0x4fff/2) ) { palette_set_color(Machine, 0xa00 + offset - 0x4800/2, MAKE_RGB(r,g,b) ); return;}
315   if ( (offset >= 0x4800/2) && (offset <= 0x4fff/2) ) { palette_set_color(machine, 0xa00 + offset - 0x4800/2, MAKE_RGB(r,g,b) ); return;}
316316   // Sprites
317   if ( (offset >= 0x5000/2) && (offset <= 0x5fff/2) ) { palette_set_color(Machine, 0xe00 + offset - 0x5000/2, MAKE_RGB(r,g,b) ); return;}
317   if ( (offset >= 0x5000/2) && (offset <= 0x5fff/2) ) { palette_set_color(machine, 0xe00 + offset - 0x5000/2, MAKE_RGB(r,g,b) ); return;}
318318}
319319
320320static ADDRESS_MAP_START( cischeat_readmem, ADDRESS_SPACE_PROGRAM, 16 )
r2454r2455
372372   int b = pal5bit(((word >> 3 ) & 0x1E ) | ((word >> 1) & 0x01));
373373
374374   // Scroll 0
375   if ( (offset >= 0x1e00/2) && (offset <= 0x1fff/2) ) { palette_set_color(Machine, 0x000 + offset - 0x1e00/2, MAKE_RGB(r,g,b) ); return;}
375   if ( (offset >= 0x1e00/2) && (offset <= 0x1fff/2) ) { palette_set_color(machine, 0x000 + offset - 0x1e00/2, MAKE_RGB(r,g,b) ); return;}
376376   // Scroll 1
377   if ( (offset >= 0x2e00/2) && (offset <= 0x2fff/2) ) { palette_set_color(Machine, 0x100 + offset - 0x2e00/2, MAKE_RGB(r,g,b) ); return;}
377   if ( (offset >= 0x2e00/2) && (offset <= 0x2fff/2) ) { palette_set_color(machine, 0x100 + offset - 0x2e00/2, MAKE_RGB(r,g,b) ); return;}
378378   // Scroll 2
379   if ( (offset >= 0x6e00/2) && (offset <= 0x6fff/2) ) { palette_set_color(Machine, 0x200 + offset - 0x6e00/2, MAKE_RGB(r,g,b) ); return;}
379   if ( (offset >= 0x6e00/2) && (offset <= 0x6fff/2) ) { palette_set_color(machine, 0x200 + offset - 0x6e00/2, MAKE_RGB(r,g,b) ); return;}
380380   // Road 0
381   if ( (offset >= 0x3800/2) && (offset <= 0x3fff/2) ) { palette_set_color(Machine, 0x300 + offset - 0x3800/2, MAKE_RGB(r,g,b) ); return;}
381   if ( (offset >= 0x3800/2) && (offset <= 0x3fff/2) ) { palette_set_color(machine, 0x300 + offset - 0x3800/2, MAKE_RGB(r,g,b) ); return;}
382382   // Road 1
383   if ( (offset >= 0x4800/2) && (offset <= 0x4fff/2) ) { palette_set_color(Machine, 0x700 + offset - 0x4800/2, MAKE_RGB(r,g,b) ); return;}
383   if ( (offset >= 0x4800/2) && (offset <= 0x4fff/2) ) { palette_set_color(machine, 0x700 + offset - 0x4800/2, MAKE_RGB(r,g,b) ); return;}
384384   // Sprites
385   if ( (offset >= 0x5000/2) && (offset <= 0x5fff/2) ) { palette_set_color(Machine, 0xb00 + offset - 0x5000/2, MAKE_RGB(r,g,b) ); return;}
385   if ( (offset >= 0x5000/2) && (offset <= 0x5fff/2) ) { palette_set_color(machine, 0xb00 + offset - 0x5000/2, MAKE_RGB(r,g,b) ); return;}
386386}
387387
388388/*  F1 GP Star tests:
r2454r2455
485485   int b = pal5bit(((newword >> 3 ) & 0x1E ) | ((newword >> 1) & 0x01));
486486
487487   // Scroll 0
488   if ( (offset >= 0x1e00/2) && (offset <= 0x1fff/2) ) { palette_set_color(Machine, 0x000 + offset - 0x1e00/2, MAKE_RGB(r,g,b) ); return;}
488   if ( (offset >= 0x1e00/2) && (offset <= 0x1fff/2) ) { palette_set_color(machine, 0x000 + offset - 0x1e00/2, MAKE_RGB(r,g,b) ); return;}
489489   // Scroll 2
490   if ( (offset >= 0x4e00/2) && (offset <= 0x4fff/2) ) { palette_set_color(Machine, 0x100 + offset - 0x4e00/2, MAKE_RGB(r,g,b) ); return;}
490   if ( (offset >= 0x4e00/2) && (offset <= 0x4fff/2) ) { palette_set_color(machine, 0x100 + offset - 0x4e00/2, MAKE_RGB(r,g,b) ); return;}
491491   // Sprites
492   if ( (offset >= 0x3000/2) && (offset <= 0x3fff/2) ) { palette_set_color(Machine, 0x200 + offset - 0x3000/2, MAKE_RGB(r,g,b) ); return;}
492   if ( (offset >= 0x3000/2) && (offset <= 0x3fff/2) ) { palette_set_color(machine, 0x200 + offset - 0x3000/2, MAKE_RGB(r,g,b) ); return;}
493493}
494494
495495
src/mame/drivers/namcos22.c
r2454r2455
11481148      int i;
11491149      for( i=0; i<4; i++ )
11501150      {
1151         if( (mask&0xff000000)==0 )
1151         if( (mask&0xff000000)!=0 )
11521152         {
11531153            int offs = offset*4+i;
11541154            if(offs<4 || offs>=8)
r2454r2455
11661166
11671167   if( mbSuperSystem22 )
11681168   {
1169      if (offset == 0x14/4 && mem_mask == 0xffff00ff)
1169      if (offset == 0x14/4 && mem_mask == 0x0000ff00)
11701170      { /* SUBCPU enable for Super System 22 */
11711171         if (data)
11721172         {
r2454r2455
11801180   }
11811181   else
11821182   {
1183      if (offset == 0x18/4 && mem_mask == 0xffff00ff)
1183      if (offset == 0x18/4 && mem_mask == 0x0000ff00)
11841184      { /* SUBCPU enable on System 22 (guessed, but too early crashes Rave Racer so it's a good test) */
11851185         if (data == 0xff00)
11861186         {
src/mame/drivers/redclash.c
r2454r2455
2121***************************************************************************/
2222
2323#include "driver.h"
24#include "deprecat.h"
2524
2625
2726extern WRITE8_HANDLER( redclash_videoram_w );
r2454r2455
5352
5453static WRITE8_HANDLER( irqack_w )
5554{
56   cpunum_set_input_line(Machine, 0,0,CLEAR_LINE);
55   cpunum_set_input_line(machine, 0,0,CLEAR_LINE);
5756}
5857
5958
src/mame/drivers/vicdual.c
r2454r2455
5252****************************************************************************/
5353
5454#include "driver.h"
55#include "deprecat.h"
5655#include "vicdual.h"
5756
5857
r2454r2455
6867#define COIN_PORT_TAG      "COIN"
6968
7069static UINT32 coin_status;
71static UINT32 last_coin_input;
7270
7371
7472static TIMER_CALLBACK( clear_coin_status )
r2454r2455
8583
8684static CUSTOM_INPUT( vicdual_read_coin_status )
8785{
88   UINT32 coin_input = input_port_read(machine, COIN_PORT_TAG);
86   return coin_status;
87}
8988
90   if (coin_input && !last_coin_input)
89
90static INPUT_CHANGED( coin_changed )
91{
92   if (newval && !oldval)
9193   {
9294      /* increment the coin counter */
9395      coin_counter_w(0, 1);
r2454r2455
98100      /* simulate the coin switch being closed for a while */
99101      timer_set(double_to_attotime(4 * attotime_to_double(video_screen_get_frame_period(machine->primary_screen))), NULL, 0, clear_coin_status);
100102   }
101
102   last_coin_input = coin_input;
103
104   return coin_status;
105103}
106104
107105
108106#define PORT_COIN                           \
109107   PORT_START_TAG(COIN_PORT_TAG)               \
110   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )      \
108   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_changed, NULL) \
111109   PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
112110
113111
r2454r2455
270268{
271269   UINT8 ret = 0;
272270
273   if (offset & 0x01)  ret = input_port_0_r(machine, 0);
274   if (offset & 0x08)  ret = input_port_1_r(machine, 0);
271   if (offset & 0x01)  ret = input_port_read_indexed(machine, 0);
272   if (offset & 0x08)  ret = input_port_read_indexed(machine, 1);
275273
276274   return ret;
277275}
r2454r2455
555553{
556554   UINT8 ret = 0;
557555
558   if (offset & 0x01)  ret = input_port_0_r(machine, 0);
559   if (offset & 0x04)  ret = input_port_1_r(machine, 0);
560   if (offset & 0x08)  ret = input_port_2_r(machine, 0);
556   if (offset & 0x01)  ret = input_port_read_indexed(machine,0);
557   if (offset & 0x04)  ret = input_port_read_indexed(machine,1);
558   if (offset & 0x08)  ret = input_port_read_indexed(machine,2);
561559
562560   return ret;
563561}
r2454r2455
744742{
745743   UINT8 ret = 0;
746744
747   if (offset & 0x01)  ret = input_port_0_r(machine, 0);
745   if (offset & 0x01)  ret = input_port_read_indexed(machine,0);
748746    if (offset & 0x02)  /* schematics show this as in input port, but never read from */
749   if (offset & 0x04)  ret = input_port_1_r(machine, 0);
750   if (offset & 0x08)  ret = input_port_2_r(machine, 0);
747   if (offset & 0x04)  ret = input_port_read_indexed(machine,1);
748   if (offset & 0x08)  ret = input_port_read_indexed(machine,2);
751749   if (offset & 0x12)  logerror("********* Read from port %x\n", offset);
752750
753751   return ret;
src/mame/drivers/galaxold.c
r2454r2455
348348***************************************************************************/
349349
350350#include "driver.h"
351#include "deprecat.h"
352351#include "cpu/z80/z80.h"
353352#include "cpu/s2650/s2650.h"
354353#include "galaxold.h"
r2454r2455
23222321
23232322static const struct AY8910interface checkmaj_ay8910_interface =
23242323{
2325   soundlatch_r
2324   AY8910_LEGACY_OUTPUT,
2325   AY8910_DEFAULT_LOADS,
2326   soundlatch_r,
2327   NULL,
2328   NULL,
2329   NULL
23262330};
23272331
23282332static const struct AY8910interface bongo_ay8910_interface =
23292333{
2330   input_port_3_r
2334   AY8910_LEGACY_OUTPUT,
2335   AY8910_DEFAULT_LOADS,
2336   input_port_3_r,
2337   NULL,
2338   NULL,
2339   NULL
23312340};
23322341
23332342
src/mame/drivers/centiped.c
r2454r2455
478478
479479static WRITE8_HANDLER( irq_ack_w )
480480{
481   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
481   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
482482}
483483
484484
r2454r2455
15831583
15841584static const struct AY8910interface centipdb_ay8910_interface =
15851585{
1586   AY8910_LEGACY_OUTPUT,
1587   AY8910_DEFAULT_LOADS,
15861588   caterplr_rand_r
15871589};
15881590
src/mame/drivers/turbosub.c
r2454r2455
4545***********************************************************************/
4646
4747#include "driver.h"
48#include "deprecat.h"
4948#include "cpu/m6809/m6809.h"
5049
5150/* Set to 1 to display test results and skip on errors */
r2454r2455
126125   bankaddress = 0x10000 + (data & 0x03) * 0x10000;
127126   memory_set_bankptr(1,&ROM[bankaddress]);
128127
129        cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, (data&0x80) ? ASSERT_LINE : CLEAR_LINE);
130        cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, (data&0x80) ? ASSERT_LINE : CLEAR_LINE);
128        cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, (data&0x80) ? ASSERT_LINE : CLEAR_LINE);
129        cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, (data&0x80) ? ASSERT_LINE : CLEAR_LINE);
131130}
132131
133132/*
r2454r2455
256255*/
257256
258257static ADDRESS_MAP_START( game_cpu_map, ADDRESS_SPACE_PROGRAM, 8 )
259        AM_RANGE(0x0000, 0x3fff) AM_RAM AM_SHARE(1)
260        AM_RANGE(0x40ff, 0x40ff) AM_RAM                                 /* W */
261        AM_RANGE(0x41ff, 0x41ff) AM_RAM                                 /* W */
262        AM_RANGE(0x42ff, 0x4300) AM_RAM                                 /* W */
263        AM_RANGE(0x4800, 0x4800) AM_READWRITE(G_STATUS_R, G_STATUS_W)   /* Status port */
264        AM_RANGE(0x4C00, 0x4C00) AM_RAM                          /* R/W - An input device? (doesn't enter auto mode depending on read) */
265        AM_RANGE(0x5000, 0x5000) AM_RAM                           /* Write - related to 4C00. Bit 8 = ? bits0..3 =????  */
266        AM_RANGE(0x5400, 0x54ff) AM_RAM                                 /* UART buffer? */
267        AM_RANGE(0x5c00, 0x5c01) AM_READWRITE(UART_R, UART_W)           /* i8251A USART */
268        AM_RANGE(0x6000, 0xdfff) AM_READWRITE(SMH_BANK1, SMH_ROM)     /* Bank switched ROMs */
269        AM_RANGE(0xe000, 0xffff) AM_ROM
258   AM_RANGE(0x0000, 0x3fff) AM_RAM AM_SHARE(1)
259   AM_RANGE(0x40ff, 0x40ff) AM_RAM                           /* W */
260   AM_RANGE(0x41ff, 0x41ff) AM_RAM                           /* W */
261   AM_RANGE(0x42ff, 0x4300) AM_RAM                           /* W */
262   AM_RANGE(0x4800, 0x4800) AM_READWRITE(G_STATUS_R, G_STATUS_W)   /* Status port */
263   AM_RANGE(0x4C00, 0x4C00) AM_RAM                           /* R/W - An input device? (doesn't enter auto mode depending on read) */
264   AM_RANGE(0x5000, 0x5000) AM_RAM                           /* Write - related to 4C00. Bit 8 = ? bits0..3 =????  */
265   AM_RANGE(0x5400, 0x54ff) AM_RAM                           /* UART buffer? */
266   AM_RANGE(0x5c00, 0x5c01) AM_READWRITE(UART_R, UART_W)         /* i8251A USART */
267   AM_RANGE(0x6000, 0xdfff) AM_READWRITE(SMH_BANK1, SMH_ROM)      /* Bank switched ROMs */
268   AM_RANGE(0xe000, 0xffff) AM_ROM
270269ADDRESS_MAP_END
271270
272271/*
r2454r2455
283282*/
284283
285284static ADDRESS_MAP_START( frame_cpu_map, ADDRESS_SPACE_PROGRAM, 8 )
286        AM_RANGE(0x0000, 0x3fff) AM_RAM AM_SHARE(1)         /* 16kB RAM: Shared with game CPU */
287        AM_RANGE(0x4000, 0x4fff) AM_READWRITE(FDT_R, FDT_W)      /* 8kB RAM: Frame Drive Table (banked) */
288        AM_RANGE(0x6000, 0x6000) AM_READWRITE(F_STATUS_R, F_STATUS_W)   /* Status port */
289        AM_RANGE(0x8000, 0x8000) AM_WRITE(FRAME)
285   AM_RANGE(0x0000, 0x3fff) AM_RAM AM_SHARE(1)            /* 16kB RAM: Shared with game CPU */
286   AM_RANGE(0x4000, 0x4fff) AM_READWRITE(FDT_R, FDT_W)      /* 8kB RAM: Frame Drive Table (banked) */
287   AM_RANGE(0x6000, 0x6000) AM_READWRITE(F_STATUS_R, F_STATUS_W)   /* Status port */
288   AM_RANGE(0x8000, 0x8000) AM_WRITE(FRAME)
290289   AM_RANGE(0xc000, 0xffff) AM_ROM
291290ADDRESS_MAP_END
292291
r2454r2455
312311/* Sound CPU */
313312
314313static ADDRESS_MAP_START( sound_cpu_map, ADDRESS_SPACE_PROGRAM, 8 )
315        AM_RANGE(0x0000, 0x07ff) AM_RAM
314   AM_RANGE(0x0000, 0x07ff) AM_RAM
316315   AM_RANGE(0x2008, 0x2008) AM_RAM      /* R=status line? D7 0=Ready? 1=Not ready? */
317   AM_RANGE(0x2009, 0x2009) AM_RAM         /* W (only written once - with value read from 2008) */
318   AM_RANGE(0x200a, 0x200b) AM_RAM         /* W 16-bit value during FIRQ */
319        AM_RANGE(0x200c, 0x200c) AM_RAM         /* W */
320        AM_RANGE(0x200d, 0x200d) AM_RAM         /* W - 03 */
321        AM_RANGE(0x200e, 0x200e) AM_RAM         /* R/W - communication with game processor */
322   AM_RANGE(0x200f, 0x200f) AM_RAM         /* R/W - communication with game processor */
323        AM_RANGE(0x2020, 0x2020) AM_RAM      /* W - 42 */
324        AM_RANGE(0x2021, 0x2021) AM_RAM      /* W - 42,1 and R during FIRQ? */
325        AM_RANGE(0x2022, 0x2023) AM_RAM      /* R/W rarely */
326        AM_RANGE(0x2024, 0x2025) AM_RAM      /* R/W rarely */
327        AM_RANGE(0x8000, 0x8006) AM_RAM      /* R */
316   AM_RANGE(0x2009, 0x2009) AM_RAM      /* W (only written once - with value read from 2008) */
317   AM_RANGE(0x200a, 0x200b) AM_RAM      /* W 16-bit value during FIRQ */
318   AM_RANGE(0x200c, 0x200c) AM_RAM      /* W */
319   AM_RANGE(0x200d, 0x200d) AM_RAM      /* W - 03 */
320   AM_RANGE(0x200e, 0x200e) AM_RAM      /* R/W - communication with game processor */
321   AM_RANGE(0x200f, 0x200f) AM_RAM      /* R/W - communication with game processor */
322   AM_RANGE(0x2020, 0x2020) AM_RAM      /* W - 42 */
323   AM_RANGE(0x2021, 0x2021) AM_RAM      /* W - 42,1 and R during FIRQ? */
324   AM_RANGE(0x2022, 0x2023) AM_RAM      /* R/W rarely */
325   AM_RANGE(0x2024, 0x2025) AM_RAM      /* R/W rarely */
326   AM_RANGE(0x8000, 0x8006) AM_RAM      /* R */
328327   AM_RANGE(0xc000, 0xffff) AM_ROM
329328ADDRESS_MAP_END
330329
r2454r2455
350349   MDRV_SCREEN_VISIBLE_AREA(0*8, 34*8-1, 0, 34*8-1)
351350
352351   MDRV_PALETTE_LENGTH(512)
353        MDRV_MACHINE_RESET( turbosub )
354        MDRV_INTERLEAVE(100)
352   MDRV_MACHINE_RESET( turbosub )
353   MDRV_INTERLEAVE(100)
355354
356355   MDRV_VIDEO_START(turbosub)
357356   MDRV_VIDEO_UPDATE(turbosub)
r2454r2455
363362
364363   ROM_REGION( 0x48000, REGION_CPU1, 0 ) /* Bankswitched 6809 code */
365364   ROM_LOAD( "turbosub.u82",    0x10000, 0x2000, CRC(de32eb6f) SHA1(90bf31a5adf261d47b4f52e93b5e97f343b7ebf0) )
366        ROM_CONTINUE(                0x20000, 0x2000 )
365      ROM_CONTINUE(                0x20000, 0x2000 )
367366   ROM_LOAD( "turbosub.u81",    0x12000, 0x2000, CRC(9ae09613) SHA1(9b5ada4a21473b30be98bcc461129b6ed4e0bb11) )
368        ROM_CONTINUE(                0x22000, 0x2000 )
367      ROM_CONTINUE(                0x22000, 0x2000 )
369368   ROM_LOAD( "turbosub.u87",    0x14000, 0x2000, CRC(ad2284f7) SHA1(8e11b8ad0a98dd1fe6ec8f7ea9e6e4f4a45d8a1b) )
370        ROM_CONTINUE(                0x24000, 0x2000 )
369      ROM_CONTINUE(                0x24000, 0x2000 )
371370   ROM_LOAD( "turbosub.u86",    0x16000, 0x2000, CRC(4f51e6fd) SHA1(8f51ac6412aace29279ce7b02cad45ed681c2065) )
372        ROM_CONTINUE(                0x26000, 0x2000 )
371      ROM_CONTINUE(                0x26000, 0x2000 )
373372
374373   ROM_LOAD( "turbosub.u80",    0x30000, 0x2000, CRC(ff2e2870) SHA1(45f91d63ad91585482c9dd05290b204b007e3f44) )
375        ROM_CONTINUE(                0x40000, 0x2000 )
376        ROM_LOAD( "turbosub.u79",    0x32000, 0x2000, CRC(13680923) SHA1(14e3daa2178853cef1fd96a68305420c11fceb96) )
377        ROM_CONTINUE(                0x42000, 0x2000 )
374      ROM_CONTINUE(                0x40000, 0x2000 )
375   ROM_LOAD( "turbosub.u79",    0x32000, 0x2000, CRC(13680923) SHA1(14e3daa2178853cef1fd96a68305420c11fceb96) )
376      ROM_CONTINUE(                0x42000, 0x2000 )
378377   ROM_LOAD( "turbosub.u84",    0x34000, 0x2000, CRC(7059842d) SHA1(c20a8accd3fc23bc4476e1d08798d7a80915d37c) )
379        ROM_CONTINUE(                0x44000, 0x2000 )
378      ROM_CONTINUE(                0x44000, 0x2000 )
380379   ROM_LOAD( "turbosub.u83",    0x36000, 0x2000, CRC(31b86fc6) SHA1(8e56e8a75f653c3c4da2c9f31f739894beb194db) )
381        ROM_CONTINUE(                0x46000, 0x2000 )
380      ROM_CONTINUE(                0x46000, 0x2000 )
382381
383        /* e000 - ffff = Upper half of U85 (lower half is blank) */
382   /* e000 - ffff = Upper half of U85 (lower half is blank) */
384383   ROM_COPY( REGION_USER1, 0x18000+0x2000, 0xe000, 0x2000 )
385384
386385   ROM_REGION( 0x10000, REGION_CPU2, 0 )
r2454r2455
389388   ROM_REGION( 0x10000, REGION_CPU3, 0 )
390389   ROM_LOAD( "turbosub.u66",   0xc000, 0x4000, CRC(5091bf3d) SHA1(7ab872cef1562a45f7533c16bbbae8772673465b) )
391390
392          ROM_REGION( 0xc0000, REGION_USER2, 0) /* Unknown */
391   ROM_REGION( 0xc0000, REGION_USER2, 0) /* Unknown */
393392   ROM_LOAD( "turbosub.u67",    0x00000, 0x4000, CRC(f8ae82e9) SHA1(fd27b9fe7872c3c680a1f71a4a5d5eeaa12e4a19) )
394393   ROM_LOAD( "turbosub.u68",    0x04000, 0x4000, CRC(72e3d09b) SHA1(eefdfcd0c4c32e465f18d40f46cb5bc022c22bfd) )
395394   ROM_LOAD( "turbosub.u69",    0x00000, 0x4000, CRC(ad04193b) SHA1(2f660302e60a7e68e079a8dd13266a77c077f939) )
src/mame/drivers/sprint8.c
r2454r2455
9797   collision_reset = !(data & 1);
9898
9999   if (collision_reset)
100      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
100      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
101101}
102102
103103
src/mame/drivers/getrivia.c
r2454r2455
121121
122122static READ8_HANDLER( port1_r )
123123{
124   return input_port_1_r(machine, 0) | (ticket_dispenser_0_r(machine, 0) >> 5);
124   return input_port_read_indexed(machine, 1) | (ticket_dispenser_0_r(machine, 0) >> 5);
125125}
126126
127127static WRITE8_HANDLER( lamps_w )
r2454r2455
233233   AM_RANGE(0x0000, 0x1fff) AM_ROM
234234   AM_RANGE(0x2000, 0x3fff) AM_ROMBANK(1)
235235   AM_RANGE(0x4000, 0x47ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
236   AM_RANGE(0x4800, 0x4803) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
237   AM_RANGE(0x5000, 0x5003) AM_READWRITE(ppi8255_1_r, ppi8255_1_w)
236   AM_RANGE(0x4800, 0x4803) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
237   AM_RANGE(0x5000, 0x5003) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
238238   AM_RANGE(0x600f, 0x600f) AM_WRITE(banksel_5_1_w)
239239   AM_RANGE(0x6017, 0x6017) AM_WRITE(banksel_4_1_w)
240240   AM_RANGE(0x601b, 0x601b) AM_WRITE(banksel_3_1_w)
r2454r2455
259259   AM_RANGE(0x4401, 0x4401) AM_WRITE(banksel_1_2_w)
260260   AM_RANGE(0x4402, 0x4402) AM_WRITE(banksel_2_1_w)
261261   AM_RANGE(0x4403, 0x4403) AM_WRITE(banksel_2_2_w)
262   AM_RANGE(0x4800, 0x4803) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
263   AM_RANGE(0x5000, 0x5003) AM_READWRITE(ppi8255_1_r, ppi8255_1_w)
262   AM_RANGE(0x4800, 0x4803) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
263   AM_RANGE(0x5000, 0x5003) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
264264   AM_RANGE(0x8000, 0x8002) AM_WRITE(SMH_RAM) AM_BASE(&drawctrl)
265265   AM_RANGE(0xc000, 0xffff) AM_RAM_WRITE(getrivia_bitmap_w) AM_BASE(&videoram)
266266ADDRESS_MAP_END
r2454r2455
270270   AM_RANGE(0x0000, 0x1fff) AM_ROM
271271   AM_RANGE(0x2000, 0x3fff) AM_ROMBANK(1)
272272   AM_RANGE(0x4000, 0x47ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
273   AM_RANGE(0x4800, 0x4803) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
274   AM_RANGE(0x5000, 0x5003) AM_READWRITE(ppi8255_1_r, ppi8255_1_w)
273   AM_RANGE(0x4800, 0x4803) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
274   AM_RANGE(0x5000, 0x5003) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
275275   AM_RANGE(0x606f, 0x606f) AM_WRITE(banksel_5_1_w)
276276   AM_RANGE(0x6077, 0x6077) AM_WRITE(banksel_4_1_w)
277277   AM_RANGE(0x607b, 0x607b) AM_WRITE(banksel_3_1_w)
r2454r2455
286286   AM_RANGE(0x0000, 0x1fff) AM_ROM
287287   AM_RANGE(0x2000, 0x3fff) AM_ROMBANK(1)
288288   AM_RANGE(0x4000, 0x47ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
289   AM_RANGE(0x4800, 0x4803) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
290   AM_RANGE(0x5000, 0x5003) AM_READWRITE(ppi8255_1_r, ppi8255_1_w)
289   AM_RANGE(0x4800, 0x4803) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
290   AM_RANGE(0x5000, 0x5003) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
291291   AM_RANGE(0x60ef, 0x60ef) AM_WRITE(banksel_3_1_w)
292292   AM_RANGE(0x60f7, 0x60f7) AM_WRITE(banksel_2_2_w)
293293   AM_RANGE(0x60fb, 0x60fb) AM_WRITE(banksel_2_1_w)
r2454r2455
418418
419419
420420
421static const ppi8255_interface getrivia_ppi8255_intf =
421static const ppi8255_interface getrivia_ppi8255_intf[2] =
422422{
423   2,                   /* 2 chips */
424   { input_port_0_r, input_port_2_r },  /* Port A read */
425   { port1_r,        NULL },            /* Port B read */
426   { NULL,           NULL },            /* Port C read */
427   { NULL,           NULL },            /* Port A write */
428   { NULL,           lamps_w },         /* Port B write */
429   { sound_w,        lamps2_w },        /* Port C write */
423   {
424      input_port_0_r,         /* Port A read */
425      port1_r,            /* Port B read */
426      NULL,               /* Port C read */
427      NULL,               /* Port A write */
428      NULL,               /* Port B write */
429      sound_w               /* Port C write */
430   },
431   {
432      input_port_2_r,         /* Port A read */
433      NULL,               /* Port B read */
434      NULL,               /* Port C read */
435      NULL,               /* Port A write */
436      lamps_w,            /* Port B write */
437      lamps2_w            /* Port C write */
438   }
430439};
431440
432static const ppi8255_interface gselect_ppi8255_intf =
441static const ppi8255_interface gselect_ppi8255_intf[2] =
433442{
434   2,                   /* 2 chips */
435   { input_port_0_r, input_port_2_r },  /* Port A read */
436   { input_port_1_r, NULL },            /* Port B read */
437   { NULL,           input_port_3_r },  /* Port C read */
438   { NULL,           NULL },            /* Port A write */
439   { NULL,           lamps_w },         /* Port B write */
440   { sound2_w,       nmi_w },           /* Port C write */
443   {
444      input_port_0_r,         /* Port A read */
445      input_port_1_r,         /* Port B read */
446      NULL,               /* Port C read */
447      NULL,               /* Port A write */
448      NULL,               /* Port B write */
449      sound2_w            /* Port C write */
450   },
451   {
452      input_port_2_r,         /* Port A read */
453      NULL,               /* Port B read */
454      input_port_3_r,         /* Port C read */
455      NULL,               /* Port A write */
456      lamps_w,            /* Port B write */
457      nmi_w               /* Port C write */
458   }
441459};
442460
443461static MACHINE_RESET( getrivia )
444462{
445   ppi8255_init(&getrivia_ppi8255_intf);
446
447463   ticket_dispenser_init(100, 1, 1);
448464}
449465
450466static MACHINE_RESET( gselect )
451467{
452   ppi8255_init(&gselect_ppi8255_intf);
453468}
454469
455470static MACHINE_DRIVER_START( getrivia )
r2454r2455
473488   MDRV_VIDEO_START(generic_bitmapped)
474489   MDRV_VIDEO_UPDATE(generic_bitmapped)
475490
491   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
492   MDRV_DEVICE_CONFIG( getrivia_ppi8255_intf[0] )
493
494   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
495   MDRV_DEVICE_CONFIG( getrivia_ppi8255_intf[1] )
496
476497   /* sound hardware */
477498   MDRV_SPEAKER_STANDARD_MONO("mono")
478499
r2454r2455
489510   MDRV_CPU_PROGRAM_MAP(gselect_map,0)
490511
491512   MDRV_MACHINE_RESET(gselect)
513
514   MDRV_DEVICE_MODIFY( "ppi8255_0", PPI8255 )
515   MDRV_DEVICE_CONFIG( gselect_ppi8255_intf[0] )
516
517   MDRV_DEVICE_MODIFY( "ppi8255_1", PPI8255 )
518   MDRV_DEVICE_CONFIG( gselect_ppi8255_intf[1] )
492519MACHINE_DRIVER_END
493520
494521static MACHINE_DRIVER_START( amuse )
src/mame/drivers/taitoair.c
r2454r2455
247247
248248   dsp_HOLD_signal = (data & 4) ? CLEAR_LINE : ASSERT_LINE;
249249
250   cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
250   cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
251251
252252   logerror("68K:%06x writing %04x to TMS32025.  %s HOLD , %s RESET\n",activecpu_get_previouspc(),data,((data & 4) ? "Clear" : "Assert"),((data & 1) ? "Clear" : "Assert"));
253253}
r2454r2455
295295   COMBINE_DATA(&paletteram16[offset]);
296296
297297   a = paletteram16[offset];
298   palette_set_color_rgb(Machine,offset,pal4bit(a >> 0),pal4bit(a >> 5),pal4bit(a >> 10));
298   palette_set_color_rgb(machine,offset,pal4bit(a >> 0),pal4bit(a >> 5),pal4bit(a >> 10));
299299}
300300
301301
src/mame/drivers/cop01.c
r2454r2455
5050
5151***************************************************************************/
5252#include "driver.h"
53#include "deprecat.h"
5453#include "sound/ay8910.h"
5554#include "sound/3812intf.h"
5655
src/mame/drivers/hanaawas.c
r2454r2455
195195
196196static const struct AY8910interface ay8910_interface =
197197{
198   AY8910_LEGACY_OUTPUT,
199   AY8910_DEFAULT_LOADS,
198200   input_port_1_r,
199   0,
200   0,
201   NULL,
202   NULL,
201203   hanaawas_portB_w
202204};
203205
src/mame/drivers/mpu4drvr.c
r2454r2455
10711071         col = pal.clut[entry] & 0xfff;
10721072
10731073         /* Update the MAME palette */
1074         palette_set_color_rgb(Machine, entry, pal4bit(col >> 0), pal4bit(col >> 4), pal4bit(col >> 8));
1074         palette_set_color_rgb(machine, entry, pal4bit(col >> 0), pal4bit(col >> 4), pal4bit(col >> 8));
10751075      }
10761076
10771077         /* Address register auto-increment */
src/mame/drivers/aquarium.c
r2454r2455
8787static READ16_HANDLER( aquarium_coins_r )
8888{
8989   int data;
90   data = (input_port_2_word_r(machine,0,mem_mask) & 0x7fff);   /* IN1 */
90   data = (input_port_read_indexed(machine,2) & 0x7fff);   /* IN1 */
9191   data |= aquarium_snd_ack;
9292   aquarium_snd_ack = 0;
9393   return data;
src/mame/drivers/metro.c
r2454r2455
157157{
158158   /*  Get the pending IRQs (only the enabled ones, e.g. where
159159        irq_enable is *0*)  */
160   UINT16 irq = metro_irq_cause_r(Machine,0,0) & ~*metro_irq_enable;
160   UINT16 irq = metro_irq_cause_r(Machine,0,0xffff) & ~*metro_irq_enable;
161161
162162   if (irq_line == -1)   /* mouja, gakusai, gakusai2, dokyusei, dokyusp */
163163   {
r2454r2455
720720                      metro_blitter_regs[ 0x0a / 2 ];
721721
722722      int shift         =   (dst_offs & 0x80) ? 0 : 8;
723      UINT16 mask      =   (dst_offs & 0x80) ? 0xff00 : 0x00ff;
723      UINT16 mask      =   (dst_offs & 0x80) ? 0x00ff : 0xff00;
724724
725725//      logerror("CPU #0 PC %06X : Blitter regs %08X, %08X, %08X\n",activecpu_get_pc(),tmap,src_offs,dst_offs);
726726
r2454r2455
21512151
21522152static READ8_HANDLER( puzzlet_port7_r )
21532153{
2154   return input_port_2_word_r(machine,0,0);
2154   return input_port_read_indexed(machine,2);
21552155}
21562156
21572157static READ8_HANDLER( puzzlet_serB_r )
21582158{
2159   return input_port_0_word_r(machine,0,0);   // coin
2159   return input_port_read_indexed(machine,0);   // coin
21602160}
21612161
21622162static WRITE8_HANDLER( puzzlet_portb_w )
src/mame/drivers/angelkds.c
r2454r2455
540540
541541static const struct YM2203interface ym2203_interface =
542542{
543   0,
544   0,
545   0,
546   0,
543   {
544      AY8910_LEGACY_OUTPUT,
545      AY8910_DEFAULT_LOADS,
546      NULL, NULL, NULL, NULL
547   },
547548   irqhandler
548549};
549550
src/mame/drivers/jrpacman.c
r2454r2455
9999***************************************************************************/
100100
101101#include "driver.h"
102#include "deprecat.h"
103102#include "pacman.h"
104103#include "sound/namco.h"
105104
r2454r2455
107106static WRITE8_HANDLER( jrpacman_interrupt_vector_w )
108107{
109108   cpunum_set_input_line_vector(0, 0, data);
110   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
109   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
111110}
112111
113112
src/mame/drivers/circusc.c
r2454r2455
1414***************************************************************************/
1515
1616#include "driver.h"
17#include "deprecat.h"
1817#include "cpu/m6809/m6809.h"
1918#include "sound/dac.h"
2019#include "sound/sn76496.h"
r2454r2455
7170
7271static WRITE8_HANDLER( circusc_sh_irqtrigger_w )
7372{
74   cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
73   cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);
7574}
7675
7776static WRITE8_HANDLER( circusc_coin_counter_w )
src/mame/drivers/laserbas.c
r2454r2455
7272
7373static WRITE8_HANDLER(palette_w)
7474{
75   palette_set_color_rgb(Machine,offset,pal3bit(data>>5),pal3bit(data>>2),pal2bit(data));
75   palette_set_color_rgb(machine,offset,pal3bit(data>>5),pal3bit(data>>2),pal2bit(data));
7676}
7777
7878static WRITE8_HANDLER(vrambank_w)
src/mame/drivers/mikie.c
r2454r2455
1717***************************************************************************/
1818
1919#include "driver.h"
20#include "deprecat.h"
2120#include "cpu/m6809/m6809.h"
2221#include "sound/sn76496.h"
2322
r2454r2455
5049   if (last == 0 && data == 1)
5150   {
5251      // setting bit 0 low then high triggers IRQ on the sound CPU
53      cpunum_set_input_line_and_vector(Machine, 1, 0, HOLD_LINE, 0xff);
52      cpunum_set_input_line_and_vector(machine, 1, 0, HOLD_LINE, 0xff);
5453   }
5554
5655   last = data;
src/mame/drivers/midvunit.c
r2454r2455
1919**************************************************************************/
2020
2121#include "driver.h"
22#include "deprecat.h"
2322#include "cpu/tms32031/tms32031.h"
2423#include "cpu/adsp2100/adsp2100.h"
2524#include "audio/dcs.h"
r2454r2455
147146{
148147   if (!(control_data & 0x40))
149148   {
150      cpunum_set_input_line(Machine, 0, 3, CLEAR_LINE);
149      cpunum_set_input_line(machine, 0, 3, CLEAR_LINE);
151150      return adc_data << adc_shift;
152151   }
153152   else
src/mame/drivers/suna16.c
r2454r2455
10351035
10361036static const struct AY8910interface bestbest_ay8910_interface =
10371037{
1038   0,                     0,
1039   bestbest_ay8910_port_a_w,   0
1038   AY8910_LEGACY_OUTPUT,
1039   AY8910_DEFAULT_LOADS,
1040   NULL,                  NULL,
1041   bestbest_ay8910_port_a_w,   NULL
10401042};
10411043
10421044static MACHINE_DRIVER_START( bestbest )
src/mame/drivers/zaccaria.c
r2454r2455
232232
233233static const ppi8255_interface ppi8255_intf =
234234{
235   1,                         /* 1 chip */
236   {input_port_3_r},            /* Port A read */
237   {input_port_4_r},            /* Port B read */
238   {input_port_5_r},            /* Port C read */
239   {0},                     /* Port A write */
240   {0},                     /* Port B write */
241   {zaccaria_dsw_sel_w},          /* Port C write */
235   input_port_3_r,               /* Port A read */
236   input_port_4_r,               /* Port B read */
237   input_port_5_r,               /* Port C read */
238   NULL,                     /* Port A write */
239   NULL,                     /* Port B write */
240   zaccaria_dsw_sel_w,          /* Port C write */
242241};
243242
244243
r2454r2455
250249
251250static MACHINE_RESET( zaccaria )
252251{
253   ppi8255_init(&ppi8255_intf);
254252   pia_reset();
255253}
256254
r2454r2455
345343   AM_RANGE(0x6c00, 0x6c07) AM_READ(zaccaria_prot2_r)
346344   AM_RANGE(0x6e00, 0x6e00) AM_READWRITE(zaccaria_dsw_r, sound_command_w)
347345   AM_RANGE(0x7000, 0x77ff) AM_RAM
348   AM_RANGE(0x7800, 0x7803) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
346   AM_RANGE(0x7800, 0x7803) AM_DEVREADWRITE(PPI8255, "ppi8255", ppi8255_r, ppi8255_w)
349347   AM_RANGE(0x7c00, 0x7c00) AM_READ(watchdog_reset_r)
350348   AM_RANGE(0x8000, 0xdfff) AM_ROM
351349ADDRESS_MAP_END
r2454r2455
622620
623621static const struct AY8910interface ay8910_interface =
624622{
625   0,
623   AY8910_LEGACY_OUTPUT,
624   AY8910_DEFAULT_LOADS,
625   NULL,
626626   soundlatch2_r,
627627   ay8910_port0a_w,
628   0
628   NULL
629629};
630630
631631static const struct TMS5220interface tms5220_interface =
r2454r2455
652652   MDRV_MACHINE_START(zaccaria)
653653   MDRV_MACHINE_RESET(zaccaria)
654654
655   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
656   MDRV_DEVICE_CONFIG( ppi8255_intf )
657
655658   /* video hardware */
656659   MDRV_SCREEN_ADD("main", RASTER)
657660   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/jongkyo.c
r2454r2455
581581
582582static const struct AY8910interface ay8910_interface =
583583{
584   AY8910_LEGACY_OUTPUT,
585   AY8910_DEFAULT_LOADS,
584586   keyboard1_r,
585587   keyboard2_r,
588   NULL,
589   NULL
586590};
587591
588592static MACHINE_DRIVER_START( jongkyo )
src/mame/drivers/firebeat.c
r2454r2455
11591159{
11601160   UINT16 r;
11611161//  printf("atapi_command_r: %08X, %08X\n", offset, mem_mask);
1162   if (mem_mask == 0x0000ffff)
1162   if (ACCESSING_BITS_16_31)
11631163   {
11641164      r = atapi_command_reg_r(offset*2);
11651165      return ATAPI_ENDIAN(r) << 16;
r2454r2455
11751175{
11761176//  printf("atapi_command_w: %08X, %08X, %08X\n", data, offset, mem_mask);
11771177
1178   if (mem_mask == 0x0000ffff)
1178   if (ACCESSING_BITS_16_31)
11791179   {
11801180      atapi_command_reg_w(offset*2, ATAPI_ENDIAN((data >> 16) & 0xffff));
11811181   }
r2454r2455
11911191   UINT16 r;
11921192//  printf("atapi_control_r: %08X, %08X\n", offset, mem_mask);
11931193
1194   if (mem_mask == 0x0000ffff)
1194   if (ACCESSING_BITS_16_31)
11951195   {
11961196      r = atapi_control_reg_r(offset*2);
11971197      return ATAPI_ENDIAN(r) << 16;
r2454r2455
12051205
12061206static WRITE32_HANDLER( atapi_control_w )
12071207{
1208   if (mem_mask == 0x0000ffff)
1208   if (ACCESSING_BITS_16_31)
12091209   {
12101210      atapi_control_reg_w(offset*2, ATAPI_ENDIAN(data >> 16) & 0xff);
12111211   }
src/mame/drivers/clayshoo.c
r2454r2455
132132 *
133133 *************************************/
134134
135static const ppi8255_interface ppi8255_intf =
135static const ppi8255_interface ppi8255_intf[2] =
136136{
137   2,                      /* 2 chips */
138   { 0, 0 },               /* Port A read */
139   { 0, input_port_r },      /* Port B read */
140   { 0, 0 },               /* Port C read */
141   { 0, input_port_select_w },   /* Port A write */
142   { 0, 0 },               /* Port B write */
143   { 0, 0 /* sound effects */},/* Port C write */
137   {
138      NULL,               /* Port A read */
139      NULL,               /* Port B read */
140      NULL,               /* Port C read */
141      NULL,               /* Port A write */
142      NULL,               /* Port B write */
143      NULL               /* Port C write */
144   },
145   {
146      NULL,               /* Port A read */
147      input_port_r,         /* Port B read */
148      NULL,               /* Port C read */
149      input_port_select_w,   /* Port A write */
150      NULL,               /* Port B write */
151      NULL               /* sound effects, Port C write */
152   }
144153};
145154
146155
147156static MACHINE_START( clayshoo )
148157{
149   ppi8255_init(&ppi8255_intf);
150
151158   create_analog_timers();
152159
153160   /* register for state saving */
r2454r2455
216223static ADDRESS_MAP_START( main_io_map, ADDRESS_SPACE_IO, 8 )
217224   ADDRESS_MAP_GLOBAL_MASK(0xff)
218225   AM_RANGE(0x00, 0x00) AM_WRITE(watchdog_reset_w)
219   AM_RANGE(0x20, 0x23) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
220   AM_RANGE(0x30, 0x33) AM_READWRITE(ppi8255_1_r, ppi8255_1_w)
226   AM_RANGE(0x20, 0x23) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
227   AM_RANGE(0x30, 0x33) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
221228ADDRESS_MAP_END
222229
223230
r2454r2455
313320   MDRV_SCREEN_REFRESH_RATE(60)
314321   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
315322
323   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
324   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
325
326   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
327   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
316328MACHINE_DRIVER_END
317329
318330
src/mame/drivers/bigevglf.c
r2454r2455
168168   sound_nmi_enable = 1;
169169   if (pending_nmi)
170170   {
171      cpunum_set_input_line(Machine, 2,INPUT_LINE_NMI,PULSE_LINE);
171      cpunum_set_input_line(machine, 2,INPUT_LINE_NMI,PULSE_LINE);
172172      pending_nmi = 0;
173173   }
174174}
src/mame/drivers/bagman.c
r2454r2455
396396
397397static const struct AY8910interface ay8910_interface =
398398{
399   AY8910_LEGACY_OUTPUT,
400   AY8910_DEFAULT_LOADS,
399401   input_port_0_r,
400402   input_port_1_r,
403   NULL,
404   NULL
401405};
402406
403407static const struct TMS5110interface tms5110_interface =
src/mame/drivers/namcos23.c
r2454r2455
603603static WRITE32_HANDLER( s23_mcuen_w )
604604{
605605   mame_printf_debug("mcuen_w: mask %08x, data %08x\n", mem_mask, data);
606   if (mem_mask == 0xffff0000)
606   if (mem_mask == 0x0000ffff)
607607   {
608608      if (data)
609609      {
src/mame/drivers/atarisy2.c
r2454r2455
124124
125125
126126#include "driver.h"
127#include "deprecat.h"
128127#include "cpu/t11/t11.h"
129128#include "machine/atarigen.h"
130129#include "slapstic.h"
r2454r2455
361360
362361static STATE_POSTLOAD( bankselect_postload )
363362{
364   bankselect_w(Machine, 0, bankselect[0], 0);
365   bankselect_w(Machine, 1, bankselect[1], 0);
363   bankselect_w(machine, 0, bankselect[0], 0xffff);
364   bankselect_w(machine, 1, bankselect[1], 0xffff);
366365}
367366
368367
r2454r2455
375374
376375static READ16_HANDLER( switch_r )
377376{
378   int result = input_port_1_r(machine, offset) | (input_port_2_r(machine, offset) << 8);
377   int result = input_port_read_indexed(machine, 1) | (input_port_read_indexed(machine, 2) << 8);
379378
380379   if (atarigen_cpu_to_sound_ready) result ^= 0x20;
381380   if (atarigen_sound_to_cpu_ready) result ^= 0x10;
r2454r2455
386385
387386static READ8_HANDLER( switch_6502_r )
388387{
389   int result = input_port_0_r(machine, offset);
388   int result = input_port_read_indexed(machine, 0);
390389
391390   if (atarigen_cpu_to_sound_ready) result ^= 0x01;
392391   if (atarigen_sound_to_cpu_ready) result ^= 0x02;
393392   if (!has_tms5220 || tms5220_ready_r()) result ^= 0x04;
394   if (!(input_port_2_r(machine, offset) & 0x80)) result ^= 0x10;
393   if (!(input_port_read_indexed(machine, 2) & 0x80)) result ^= 0x10;
395394
396395   return result;
397396}
r2454r2455
591590   if (!(data & 0x02)) rbott += 1.0/47;
592591   if (!(data & 0x04)) rbott += 1.0/22;
593592   gain = (rbott == 0) ? 1.0 : ((1.0/rbott) / (rtop + (1.0/rbott)));
594   atarigen_set_ym2151_vol(Machine, gain * 100);
593   atarigen_set_ym2151_vol(machine, gain * 100);
595594
596595   /* bits 3-4 control the volume of the POKEYs, using 47k and 100k resistors */
597596   rtop = 1.0/(1.0/100 + 1.0/100);
r2454r2455
599598   if (!(data & 0x08)) rbott += 1.0/47;
600599   if (!(data & 0x10)) rbott += 1.0/22;
601600   gain = (rbott == 0) ? 1.0 : ((1.0/rbott) / (rtop + (1.0/rbott)));
602   atarigen_set_pokey_vol(Machine, gain * 100);
601   atarigen_set_pokey_vol(machine, gain * 100);
603602
604603   /* bits 5-7 control the volume of the TMS5220, using 22k, 47k, and 100k resistors */
605604   rtop = 1.0/(1.0/100 + 1.0/100);
r2454r2455
608607   if (!(data & 0x40)) rbott += 1.0/47;
609608   if (!(data & 0x80)) rbott += 1.0/22;
610609   gain = (rbott == 0) ? 1.0 : ((1.0/rbott) / (rtop + (1.0/rbott)));
611   atarigen_set_tms5220_vol(Machine, gain * 100);
610   atarigen_set_tms5220_vol(machine, gain * 100);
612611}
613612
614613
r2454r2455
639638   atarigen_update_interrupts(machine);
640639
641640   /* handle it normally otherwise */
642   return atarigen_sound_r(machine,offset,0);
641   return atarigen_sound_r(machine,offset,0xffff);
643642}
644643
645644
src/mame/drivers/mjsister.c
r2454r2455
299299
300300static const struct AY8910interface ay8910_interface =
301301{
302   AY8910_LEGACY_OUTPUT,
303   AY8910_DEFAULT_LOADS,
302304   input_port_0_r,
303   input_port_1_r
305   input_port_1_r,
306   NULL,
307   NULL
304308};
305309
306310static MACHINE_DRIVER_START( mjsister )
src/mame/drivers/ninjakd2.c
r2454r2455
191191static WRITE8_HANDLER( ninjakd2_soundreset_w )
192192{
193193   // bit 4 resets sound CPU
194   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE);
194   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE);
195195
196196   // bit 7 flips screen
197197   flip_screen_set(data & 0x80);
r2454r2455
904904
905905static const struct YM2203interface ym2203_interface =
906906{
907   0, 0, 0, 0,
907   {
908      AY8910_LEGACY_OUTPUT,
909      AY8910_DEFAULT_LOADS,
910      NULL, NULL, NULL, NULL
911   },
908912   irqhandler
909913};
910914
src/mame/drivers/warpwarp.c
r2454r2455
127127***************************************************************************/
128128
129129#include "driver.h"
130#include "deprecat.h"
131130#include "sound/custom.h"
132131#include "warpwarp.h"
133132#include "geebee.lh"
r2454r2455
289288         warpwarp_ball_on = data & 1;
290289         cpu_interrupt_enable(0,data & 1);
291290         if (~data & 1)
292            cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
291            cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
293292         break;
294293      case 7:
295294         flip_screen_set(data & 1);
src/mame/drivers/cbuster.c
r2454r2455
3838{
3939   switch (offset<<1) {
4040   case 0: /* DMA flag */
41      buffer_spriteram16_w(machine,0,0,0);
41      buffer_spriteram16_w(machine,0,0,0xffff);
4242      return;
4343
4444   case 6: /* IRQ ack */
src/mame/drivers/dunhuang.c
r2454r2455
5050*********************************************************************************************************************/
5151
5252#include "driver.h"
53#include "deprecat.h"
5453#include "sound/ay8910.h"
5554#include "sound/okim6295.h"
5655#include "sound/2413intf.h"
r2454r2455
310309{
311310   dunhuang_paldata[dunhuang_paloffs] = data;
312311
313   palette_set_color_rgb( Machine, dunhuang_paloffs/3,
312   palette_set_color_rgb( machine, dunhuang_paloffs/3,
314313      pal6bit(dunhuang_paldata[(dunhuang_paloffs/3)*3+0]),
315314      pal6bit(dunhuang_paldata[(dunhuang_paloffs/3)*3+1]),
316315      pal6bit(dunhuang_paldata[(dunhuang_paloffs/3)*3+2])
r2454r2455
666665
667666static const struct AY8910interface dunhuang_ay8910_interface =
668667{
669//  A                   B
670   0,               dunhuang_dsw_r,   // R
671   dunhuang_input_w,   0            // W
668   AY8910_LEGACY_OUTPUT,
669   AY8910_DEFAULT_LOADS,
670   //  A                   B
671   NULL,               dunhuang_dsw_r,   // R
672   dunhuang_input_w,      NULL         // W
672673};
673674
674675static MACHINE_DRIVER_START( dunhuang )
src/mame/drivers/gng.c
r2454r2455
494494   ROM_LOAD( "14.84490.1l",     0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) /* sprites 2 Plane 3-4 */
495495ROM_END
496496
497ROM_START( gngblita )
498   ROM_REGION( 0x18000, REGION_CPU1, 0 )
499   ROM_LOAD( "3",      0x04000, 0x4000, CRC(4859d068) SHA1(8b22772ea383ecaee01da696c0c7b568ab1e4615) )
500   ROM_LOAD( "4-5",    0x08000, 0x8000, CRC(233a4589) SHA1(c95c4dcbf53fac5a0c11466bc27369bf8328bd01) )
501   ROM_LOAD( "1-2",    0x10000, 0x8000, CRC(ed28e86e) SHA1(064871918547a56be330c6994d4db2c9932e14db) )
497502
503   ROM_REGION( 0x10000, REGION_CPU2, 0 )
504   ROM_LOAD( "gg2.bin",      0x0000, 0x8000, CRC(615f5b6f) SHA1(7ef9ec5c2072e21c787a6bbf700033f50c759c1d) )
505
506   ROM_REGION( 0x04000, REGION_GFX1, ROMREGION_DISPOSE )
507   ROM_LOAD( "gg1.bin",      0x00000, 0x4000, CRC(ecfccf07) SHA1(0a1518e19a2e0a4cc3dde4b9568202ea911b5ece) ) /* characters */
508
509   ROM_REGION( 0x18000, REGION_GFX2, ROMREGION_DISPOSE )
510   ROM_LOAD( "gg11.bin",     0x00000, 0x4000, CRC(ddd56fa9) SHA1(f9d77eee5e2738b7e83ba02fcc55dd480391479f) ) /* tiles 0-1 Plane 1*/
511   ROM_LOAD( "gg10.bin",     0x04000, 0x4000, CRC(7302529d) SHA1(8434c994cc55d2586641f3b90b6b15fd65dfb67c) ) /* tiles 2-3 Plane 1*/
512   ROM_LOAD( "gg9.bin",      0x08000, 0x4000, CRC(20035bda) SHA1(bbb1fba0eb19471f66d29526fa8423ccb047bd63) ) /* tiles 0-1 Plane 2*/
513   ROM_LOAD( "gg8.bin",      0x0c000, 0x4000, CRC(f12ba271) SHA1(1c42fa02cb27b35d10c3f7f036005e747f9f6b79) ) /* tiles 2-3 Plane 2*/
514   ROM_LOAD( "gg7.bin",      0x10000, 0x4000, CRC(e525207d) SHA1(1947f159189b3a53f1251d8653b6e7c65c91fc3c) ) /* tiles 0-1 Plane 3*/
515   ROM_LOAD( "gg6.bin",      0x14000, 0x4000, CRC(2d77e9b2) SHA1(944da1ce29a18bf0fc8deff78bceacba0bf23a07) ) /* tiles 2-3 Plane 3*/
516
517   ROM_REGION( 0x20000, REGION_GFX3, ROMREGION_DISPOSE | ROMREGION_ERASEFF )
518   ROM_LOAD( "gg17.bin",     0x00000, 0x4000, CRC(93e50a8f) SHA1(42d367f57bb2fdf60a0445ac1533da99cfeaa617) ) /* sprites 0 Plane 1-2 */
519   ROM_LOAD( "gg16.bin",     0x04000, 0x4000, CRC(06d7e5ca) SHA1(9e06012bcd82f98fad43de666ef9a75979d940ab) ) /* sprites 1 Plane 1-2 */
520   ROM_LOAD( "gg15.bin",     0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) /* sprites 2 Plane 1-2 */
521   ROM_LOAD( "gg14.bin",     0x10000, 0x4000, CRC(6aaf12f9) SHA1(207a7407288182a4f3eddaea634c6a6452131182) ) /* sprites 0 Plane 3-4 */
522   ROM_LOAD( "gg13.bin",     0x14000, 0x4000, CRC(e80c3fca) SHA1(cb641c25bb04b970b2cbeca41adb792bbe142fb5) ) /* sprites 1 Plane 3-4 */
523   ROM_LOAD( "gg12.bin",     0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) /* sprites 2 Plane 3-4 */
524
525   ROM_REGION( 0x0200, REGION_PROMS, 0 )
526   ROM_LOAD( "tbp24s10.14k", 0x0000, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) )  /* video timing (not used) */
527   ROM_LOAD( "63s141.2e",    0x0100, 0x0100, CRC(4a1285a4) SHA1(5018c3950b675af58db499e2883ecbc55419b491) )  /* priority (not used) */
528
529   ROM_REGION( 0x0100, REGION_PLDS, ROMREGION_DISPOSE )
530   ROM_LOAD( "gg-pal10l8.bin",  0x0000, 0x002c, CRC(87f1b7e0) SHA1(b719c3be7bd4a02660bb0887f752e9769cbd37d2) )
531ROM_END
532
498533ROM_START( gngt )
499534   ROM_REGION( 0x18000, REGION_CPU1, 0 )
500535   ROM_LOAD( "mm04",         0x04000, 0x4000, CRC(652406f6) SHA1(3b2bafd31f670ea26c568c48f3bd00597e5a2ed6) ) /* 4000-5fff is page 4 */
r2454r2455
674709GAME( 1985, gng,     0,   gng, gng,     0,      ROT0, "Capcom", "Ghosts'n Goblins (World? set 1)", GAME_SUPPORTS_SAVE )
675710GAME( 1985, gnga,     gng, gng, gng,     0,      ROT0, "Capcom", "Ghosts'n Goblins (World? set 2)", GAME_SUPPORTS_SAVE )
676711GAME( 1985, gngbl,     gng, gng, gng,     0,      ROT0, "Capcom", "Ghosts'n Goblins (bootleg with Cross)", GAME_SUPPORTS_SAVE )
712GAME( 1985, gngblita,     gng, gng, gng,     0,      ROT0, "Capcom", "Ghosts'n Goblins (Italian bootleg, harder)", GAME_SUPPORTS_SAVE )
677713GAME( 1985, gngt,     gng, gng, gng,     0,      ROT0, "Capcom (Taito America license)", "Ghosts'n Goblins (US)", GAME_SUPPORTS_SAVE )
678714GAME( 1985, makaimur, gng, gng, makaimur, 0,      ROT0, "Capcom", "Makai-Mura (Japan)", GAME_SUPPORTS_SAVE )
679715GAME( 1985, makaimuc, gng, gng, makaimur, 0,      ROT0, "Capcom", "Makai-Mura (Japan Revision C)", GAME_SUPPORTS_SAVE )
src/mame/drivers/ojankohs.c
r2454r2455
927927
928928static const struct AY8910interface ojankohs_ay8910_interface =
929929{
930   AY8910_LEGACY_OUTPUT,
931   AY8910_DEFAULT_LOADS,
930932   ojankohs_ay8910_0_r,   /* read port #0 */
931933   ojankohs_ay8910_1_r   /* read port #1 */
932934};
933935
934936static const struct AY8910interface ojankoy_ay8910_interface =
935937{
938   AY8910_LEGACY_OUTPUT,
939   AY8910_DEFAULT_LOADS,
936940   ojankoy_ay8910_0_r,      /* read port #0 */
937941   ojankoy_ay8910_1_r,      /* read port #1 */
938942};
939943
940944static const struct AY8910interface ojankoc_ay8910_interface =
941945{
946   AY8910_LEGACY_OUTPUT,
947   AY8910_DEFAULT_LOADS,
942948   input_port_0_r,         /* read port #0 */
943949   input_port_1_r         /* read port #1 */
944950};
src/mame/drivers/nbmj8891.c
r2454r2455
30153015
30163016static const struct AY8910interface ay8910_interface =
30173017{
3018   AY8910_LEGACY_OUTPUT,
3019   AY8910_DEFAULT_LOADS,
30183020   input_port_0_r,      // DIPSW-A read
3019   input_port_1_r      // DIPSW-B read
3021   input_port_1_r,      // DIPSW-B read
3022   NULL,
3023   NULL
30203024};
30213025
30223026
src/mame/drivers/wc90b.c
r2454r2455
355355
356356static const struct YM2203interface ym2203_interface =
357357{
358   0,0,0,0,irqhandler
358   {
359      AY8910_LEGACY_OUTPUT,
360      AY8910_DEFAULT_LOADS,
361      NULL, NULL, NULL, NULL
362   },
363   irqhandler
359364};
360365
361366static void adpcm_int(int data)
src/mame/drivers/kncljoe.c
r2454r2455
2626***************************************************************************/
2727
2828#include "driver.h"
29#include "deprecat.h"
3029#include "cpu/m6800/m6800.h"
3130#include "sound/ay8910.h"
3231#include "sound/sn76496.h"
r2454r2455
112111
113112static WRITE8_HANDLER( sound_irq_ack_w )
114113{
115   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
114   cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
116115}
117116
118117static WRITE8_HANDLER(unused_w)
r2454r2455
247246
248247static const struct AY8910interface ay8910_interface =
249248{
249   AY8910_LEGACY_OUTPUT,
250   AY8910_DEFAULT_LOADS,
250251   soundlatch_r,
251   0,
252   0,
252   NULL,
253   NULL,
253254   unused_w
254255};
255256
256257static INTERRUPT_GEN (sound_nmi)
257258{
258   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
259   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
259260}
260261
261262static MACHINE_DRIVER_START( kncljoe )
src/mame/drivers/holeland.c
r2454r2455
282282
283283static const struct AY8910interface ay8910_interface_1 =
284284{
285   AY8910_LEGACY_OUTPUT,
286   AY8910_DEFAULT_LOADS,
285287   input_port_0_r,
286   input_port_1_r
288   input_port_1_r,
289   NULL,
290   NULL
287291};
288292
289293static const struct AY8910interface ay8910_interface_2 =
290294{
295   AY8910_LEGACY_OUTPUT,
296   AY8910_DEFAULT_LOADS,
291297   input_port_2_r,
292   input_port_3_r
298   input_port_3_r,
299   NULL,
300   NULL
293301};
294302
295303
src/mame/drivers/cvs.c
r2454r2455
279279   /* the lower 4 (or 3?) bits select the port to read */
280280   switch (offset & 0x0f)   /* might be 0x07 */
281281   {
282   case 0x00:  ret = input_port_0_r(machine, 0); break;
283   case 0x02:  ret = input_port_1_r(machine, 0); break;
284   case 0x03:  ret = input_port_2_r(machine, 0); break;
285   case 0x04:  ret = input_port_3_r(machine, 0); break;
286   case 0x06:  ret = input_port_4_r(machine, 0); break;
287   case 0x07:  ret = input_port_5_r(machine, 0); break;
282   case 0x00:  ret = input_port_read_indexed(machine, 0); break;
283   case 0x02:  ret = input_port_read_indexed(machine, 1); break;
284   case 0x03:  ret = input_port_read_indexed(machine, 2); break;
285   case 0x04:  ret = input_port_read_indexed(machine, 3); break;
286   case 0x06:  ret = input_port_read_indexed(machine, 4); break;
287   case 0x07:  ret = input_port_read_indexed(machine, 5); break;
288288   default:    logerror("%04x : CVS: Reading unmapped input port 0x%02x\n", activecpu_get_pc(), offset & 0x0f); break;
289289   }
290290
src/mame/drivers/turbo.c
r2454r2455
267267}
268268
269269
270static const ppi8255_interface turbo_8255_intf[4] =
271{
272   {
273      NULL,
274      NULL,
275      NULL,
276      turbo_ppi0a_w,
277      turbo_ppi0b_w,
278      turbo_ppi0c_w
279   },
280   {
281      NULL,
282      NULL,
283      NULL,
284      turbo_ppi1a_w,
285      turbo_ppi1b_w,
286      turbo_ppi1c_w
287   },
288   {
289      NULL,
290      NULL,
291      NULL,
292      turbo_sound_a_w,
293      turbo_sound_b_w,
294      turbo_sound_c_w
295   },
296   {
297      turbo_analog_r,
298      input_port_2_r,
299      NULL,
300      NULL,
301      NULL,
302      turbo_ppi3c_w
303   }
304};
270305
306
307
271308/*************************************
272309 *
273310 *  Subroc 3D PPI handling
r2454r2455
312349}
313350
314351
352static const ppi8255_interface subroc3d_8255_intf[2] =
353{
354   {
355      NULL,
356      NULL,
357      NULL,
358      subroc3d_ppi0a_w,
359      subroc3d_ppi0b_w,
360      subroc3d_ppi0c_w
361   },
362   {
363      NULL,
364      NULL,
365      NULL,
366      subroc3d_sound_a_w,
367      subroc3d_sound_b_w,
368      subroc3d_sound_c_w
369   }
370};
315371
372
373
316374/*************************************
317375 *
318376 *  Buck Rogers PPI handling
r2454r2455
364422}
365423
366424
425static const ppi8255_interface buckrog_8255_intf[2] =
426{
427   {
428      NULL,
429      NULL,
430      NULL,
431      buckrog_ppi0a_w,
432      buckrog_ppi0b_w,
433      buckrog_ppi0c_w
434   },
435   {
436      NULL,
437      NULL,
438      NULL,
439      buckrog_sound_a_w,
440      buckrog_sound_b_w,
441      buckrog_ppi1c_w
442   }
443};
367444
445
446
447
368448/*************************************
369449 *
370450 *  8279 display/keyboard driver
r2454r2455
599679{
600680   /* assert ACK */
601681   turbo_state *state = machine->driver_data;
602   ppi8255_set_portC(0, 0x00);
682   ppi8255_set_portC(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), 0x00);
603683   return state->buckrog_command;
604684}
605685
r2454r2455
638718
639719static TIMER_CALLBACK( delayed_ppi8255_w )
640720{
641    ppi8255_0_w(machine, param >> 8, param & 0xff);
721    ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), param >> 8, param & 0xff);
642722}
643723
644724
645static WRITE8_HANDLER( buckrog_ppi8255_0_w )
725static WRITE8_DEVICE_HANDLER( buckrog_ppi8255_0_w )
646726{
647727   /* the port C handshaking signals control the sub CPU IRQ, */
648728   /* so we have to sync whenever we access this PPI */
r2454r2455
666746   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(turbo_videoram_w) AM_BASE_MEMBER(turbo_state, videoram)
667747   AM_RANGE(0xe800, 0xefff) AM_WRITE(turbo_collision_clear_w)
668748   AM_RANGE(0xf000, 0xf7ff) AM_RAM
669   AM_RANGE(0xf800, 0xf803) AM_MIRROR(0x00fc) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
670   AM_RANGE(0xf900, 0xf903) AM_MIRROR(0x00fc) AM_READWRITE(ppi8255_1_r, ppi8255_1_w)
671   AM_RANGE(0xfa00, 0xfa03) AM_MIRROR(0x00fc) AM_READWRITE(ppi8255_2_r, ppi8255_2_w)
672   AM_RANGE(0xfb00, 0xfb03) AM_MIRROR(0x00fc) AM_READWRITE(ppi8255_3_r, ppi8255_3_w)
749   AM_RANGE(0xf800, 0xf803) AM_MIRROR(0x00fc) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
750   AM_RANGE(0xf900, 0xf903) AM_MIRROR(0x00fc) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
751   AM_RANGE(0xfa00, 0xfa03) AM_MIRROR(0x00fc) AM_DEVREADWRITE(PPI8255, "ppi8255_2", ppi8255_r, ppi8255_w)
752   AM_RANGE(0xfb00, 0xfb03) AM_MIRROR(0x00fc) AM_DEVREADWRITE(PPI8255, "ppi8255_3", ppi8255_r, ppi8255_w)
673753   AM_RANGE(0xfc00, 0xfc01) AM_MIRROR(0x00fe) AM_READWRITE(turbo_8279_r, turbo_8279_w)
674754   AM_RANGE(0xfd00, 0xfdff) AM_READ(input_port_0_r)
675755   AM_RANGE(0xfe00, 0xfeff) AM_READ(turbo_collision_r)
r2454r2455
694774   AM_RANGE(0xb000, 0xb7ff) AM_RAM                                     // SCRATCH
695775   AM_RANGE(0xb800, 0xbfff)                                           // HANDLE CL
696776   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(turbo_videoram_w) AM_BASE_MEMBER(turbo_state, videoram)   // FIX PAGE
697   AM_RANGE(0xe800, 0xe803) AM_MIRROR(0x07fc) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
698   AM_RANGE(0xf000, 0xf003) AM_MIRROR(0x07fc) AM_READWRITE(ppi8255_1_r, ppi8255_1_w)
777   AM_RANGE(0xe800, 0xe803) AM_MIRROR(0x07fc) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
778   AM_RANGE(0xf000, 0xf003) AM_MIRROR(0x07fc) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
699779   AM_RANGE(0xf800, 0xf801) AM_MIRROR(0x07fe) AM_READWRITE(turbo_8279_r, turbo_8279_w)
700780ADDRESS_MAP_END
701781
r2454r2455
711791   AM_RANGE(0x0000, 0x7fff) AM_ROM
712792   AM_RANGE(0x8000, 0xbfff) AM_ROM
713793   AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(turbo_videoram_w) AM_BASE_MEMBER(turbo_state, videoram)      // FIX PAGE
714   AM_RANGE(0xc800, 0xc803) AM_MIRROR(0x07fc) AM_READWRITE(ppi8255_0_r, buckrog_ppi8255_0_w)   // 8255
715   AM_RANGE(0xd000, 0xd003) AM_MIRROR(0x07fc) AM_READWRITE(ppi8255_1_r, ppi8255_1_w)         // 8255
794   AM_RANGE(0xc800, 0xc803) AM_MIRROR(0x07fc) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, buckrog_ppi8255_0_w)   // 8255
795   AM_RANGE(0xd000, 0xd003) AM_MIRROR(0x07fc) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)         // 8255
716796   AM_RANGE(0xd800, 0xd801) AM_MIRROR(0x07fe) AM_READWRITE(turbo_8279_r, turbo_8279_w)         // 8279
717797   AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_BASE_MEMBER(turbo_state, sprite_position)            // CONT RAM
718798   AM_RANGE(0xe400, 0xe7ff) AM_RAM AM_BASE_MEMBER(turbo_state, spriteram)                  // CONT RAM
r2454r2455
10021082   MDRV_CPU_PROGRAM_MAP(turbo_map,0)
10031083   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
10041084
1085   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
1086   MDRV_DEVICE_CONFIG( turbo_8255_intf[0] )
1087
1088   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
1089   MDRV_DEVICE_CONFIG( turbo_8255_intf[1] )
1090
1091   MDRV_DEVICE_ADD( "ppi8255_2", PPI8255 )
1092   MDRV_DEVICE_CONFIG( turbo_8255_intf[2] )
1093
1094   MDRV_DEVICE_ADD( "ppi8255_3", PPI8255 )
1095   MDRV_DEVICE_CONFIG( turbo_8255_intf[3] )
1096
10051097   /* video hardware */
10061098   MDRV_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
10071099   MDRV_GFXDECODE(turbo)
r2454r2455
10281120   MDRV_CPU_PROGRAM_MAP(subroc3d_map,0)
10291121   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
10301122
1123   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
1124   MDRV_DEVICE_CONFIG( subroc3d_8255_intf[0] )
1125
1126   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
1127   MDRV_DEVICE_CONFIG( subroc3d_8255_intf[1] )
1128
10311129   /* video hardware */
10321130   MDRV_GFXDECODE(turbo)
10331131   MDRV_PALETTE_LENGTH(256)
r2454r2455
10601158   MDRV_INTERLEAVE(10)
10611159   MDRV_MACHINE_RESET(buckrog)
10621160
1161   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
1162   MDRV_DEVICE_CONFIG( buckrog_8255_intf[0] )
1163
1164   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
1165   MDRV_DEVICE_CONFIG( buckrog_8255_intf[1] )
1166
10631167   /* video hardware */
10641168   MDRV_GFXDECODE(turbo)
10651169   MDRV_PALETTE_LENGTH(1024)
r2454r2455
15221626 *
15231627 *************************************/
15241628
1525static DRIVER_INIT( turbo )
1526{
1527   static const ppi8255_interface turbo_8255_intf =
1528   {
1529      4,
1530      { NULL,          NULL,          NULL,            turbo_analog_r },
1531      { NULL,          NULL,          NULL,            input_port_2_r },
1532      { NULL,          NULL,          NULL,            NULL },
1533      { turbo_ppi0a_w, turbo_ppi1a_w, turbo_sound_a_w, NULL },
1534      { turbo_ppi0b_w, turbo_ppi1b_w, turbo_sound_b_w, NULL },
1535      { turbo_ppi0c_w, turbo_ppi1c_w, turbo_sound_c_w, turbo_ppi3c_w }
1536   };
1537   ppi8255_init(&turbo_8255_intf);
1538}
1539
15401629static DRIVER_INIT( turbo_enc )
15411630{
15421631   turbo_rom_decode();
1543   DRIVER_INIT_CALL(turbo);
15441632}
15451633
15461634
1547static DRIVER_INIT( subroc3d )
1548{
1549   static const ppi8255_interface subroc3d_8255_intf =
1550   {
1551      2,
1552      { NULL,             NULL },
1553      { NULL,             NULL },
1554      { NULL,             NULL },
1555      { subroc3d_ppi0a_w, subroc3d_sound_a_w },
1556      { subroc3d_ppi0b_w, subroc3d_sound_b_w },
1557      { subroc3d_ppi0c_w, subroc3d_sound_c_w }
1558   };
1559   ppi8255_init(&subroc3d_8255_intf);
1560}
1561
1562
1563static DRIVER_INIT( buckrog )
1564{
1565   static const ppi8255_interface buckrog_8255_intf =
1566   {
1567      2,
1568      { NULL,            NULL },
1569      { NULL,            NULL },
1570      { NULL,            NULL },
1571      { buckrog_ppi0a_w, buckrog_sound_a_w },
1572      { buckrog_ppi0b_w, buckrog_sound_b_w },
1573      { buckrog_ppi0c_w, buckrog_ppi1c_w }
1574   };
1575   ppi8255_init(&buckrog_8255_intf);
1576}
1577
15781635static DRIVER_INIT( buckrog_enc )
15791636{
15801637   buckrog_decode();
1581   DRIVER_INIT_CALL(buckrog);
15821638}
15831639
15841640
r2454r2455
15891645 *
15901646 *************************************/
15911647
1592GAMEL( 1981, turbo,    0,       turbo,    turbo,    turbo,       ROT270,             "Sega", "Turbo", 0, layout_turbo )
1648GAMEL( 1981, turbo,    0,       turbo,    turbo,    0,           ROT270,             "Sega", "Turbo", 0, layout_turbo )
15931649GAMEL( 1981, turboa,   turbo,   turbo,    turbo,    turbo_enc,   ROT270,             "Sega", "Turbo (encrypted set 1)", 0, layout_turbo )
15941650GAMEL( 1981, turbob,   turbo,   turbo,    turbo,    turbo_enc,   ROT270,             "Sega", "Turbo (encrypted set 2)", 0, layout_turbo )
1595GAMEL( 1982, subroc3d, 0,       subroc3d, subroc3d, subroc3d,    ORIENTATION_FLIP_X, "Sega", "Subroc-3D", 0, layout_subroc3d )
1651GAMEL( 1982, subroc3d, 0,       subroc3d, subroc3d, 0,           ORIENTATION_FLIP_X, "Sega", "Subroc-3D", 0, layout_subroc3d )
15961652GAMEL( 1982, buckrog,  0,       buckrog,  buckrog,  buckrog_enc, ROT0,               "Sega", "Buck Rogers: Planet of Zoom", 0, layout_buckrog )
15971653GAMEL( 1982, zoom909,  buckrog, buckrog,  buckrog,  buckrog_enc, ROT0,               "Sega", "Zoom 909", GAME_IMPERFECT_COLORS, layout_buckrog ) // bad PROM
1598GAMEL( 1982, buckrogn, buckrog, buckrog,  buckrog,  buckrog,     ROT0,               "Sega", "Buck Rogers: Planet of Zoom (not encrypted)", 0, layout_buckrog )
1654GAMEL( 1982, buckrogn, buckrog, buckrog,  buckrog,  0,           ROT0,               "Sega", "Buck Rogers: Planet of Zoom (not encrypted)", 0, layout_buckrog )
src/mame/drivers/seta.c
r2454r2455
14971497         if (ACCESSING_BITS_0_7)
14981498         {
14991499            if ( !(old_data&1) && (data&1) )
1500               cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE);
1500               cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, PULSE_LINE);
15011501            old_data = data;
15021502         }
15031503         break;
r2454r2455
25942594
25952595static READ16_HANDLER( kiwame_input_r )
25962596{
2597   int row_select = kiwame_nvram_r( machine,0x10a/2,0 ) & 0x1f;
2597   int row_select = kiwame_nvram_r( machine,0x10a/2,0x00ff ) & 0x1f;
25982598   int i;
25992599
26002600   for(i = 0; i < 5; i++)
r2454r2455
27042704static WRITE16_HANDLER( wiggie_soundlatch_w )
27052705{
27062706   wiggie_soundlatch = data >> 8;
2707   cpunum_set_input_line(Machine, 1,0, HOLD_LINE);
2707   cpunum_set_input_line(machine, 1,0, HOLD_LINE);
27082708}
27092709
27102710
r2454r2455
66746674
66756675static const struct YM2203interface tndrcade_ym2203_interface =
66766676{
6677   dsw1_r,      /* input A: DSW 1 */
6678   dsw2_r      /* input B: DSW 2 */
6677   {
6678      AY8910_LEGACY_OUTPUT,
6679      AY8910_DEFAULT_LOADS,
6680      dsw1_r,      /* input A: DSW 1 */
6681      dsw2_r,      /* input B: DSW 2 */
6682      NULL,
6683      NULL
6684   },
6685   NULL
66796686};
66806687
66816688
src/mame/drivers/laserbat.c
r2454r2455
660660
661661static const struct AY8910interface ay8910_interface =
662662{
663   0,
663   AY8910_LEGACY_OUTPUT,
664   AY8910_DEFAULT_LOADS,
665   NULL,
664666   soundlatch_r,
665   0,//ay8910_port0a_w,
666   0
667   NULL,//ay8910_port0a_w,
668   NULL
667669};
668670
669671static MACHINE_START( catnmous )
src/mame/drivers/tnzs.c
r2454r2455
217217
218218***************************************************************************/
219219
220/***************************************************************************
221  Jumping Pop
222   - added by David Haywood, thanks to Robin Cooper
223
224  This is not a Taito board, it's a copy, it contains no original Taito or
225   Seta components.
226
227  The game is a bootleg of Plump Pop produced by NICs of Korea, it has new
228   graphics, sounds etc.
229
230  Uses a YM2151 instead of the YM2203, has no MCU
231
232  Uses Palette RAM instead of PROMs.
233
234  ToDo:
235
236  Palette format (or gfx decode?) appears to be incorrect, some colours
237   clearly don't match the screenshot.
238
239  Frequencies have not been measured
240
241  The bar behind the players flickers first boot / first attract levels, bug?
242
243  Inputs might be wrong, should be joystick not spinner? (can't select character)
244
245***************************************************************************/
246
247
220248#include "driver.h"
221249#include "deprecat.h"
222250#include "cpu/i8x41/i8x41.h"
r2454r2455
224252#include "sound/dac.h"
225253#include "sound/samples.h"
226254#include "includes/tnzs.h"
255#include "sound/2151intf.h"
227256
228257UINT8 *tnzs_objram, *tnzs_sharedram;
229258UINT8 *tnzs_vdcram, *tnzs_scrollram, *tnzs_objctrl, *tnzs_bg_flag;
r2454r2455
515544   AM_RANGE(0x02, 0x02) AM_WRITE(tnzs_port2_w)
516545ADDRESS_MAP_END
517546
547
548WRITE8_HANDLER( jpopnics_palette_w )
549{
550   int r,g,b;
551   UINT16 paldata;
552   paletteram[offset] = data;
553
554   offset = offset >> 1;
555
556   paldata = (paletteram[offset*2]<<8) | paletteram[(offset*2+1)];
557
558   g = (paldata >> 12) & 0x000f;
559   r = (paldata >> 4) & 0x000f;
560   b = (paldata >> 8) & 0x000f;
561   // the other bits seem to be used, and the colours are wrong..
562
563   palette_set_color_rgb(Machine,offset,r<<4, g<<4, b<<4);
564}
565
566static ADDRESS_MAP_START( jpopnics_main_map, ADDRESS_SPACE_PROGRAM, 8 )
567   AM_RANGE(0x0000, 0x7fff) AM_ROM
568   AM_RANGE(0x8000, 0xbfff) AM_READWRITE(SMH_BANK1, SMH_ROM)
569   AM_RANGE(0xc000, 0xdfff) AM_RAM AM_BASE(&tnzs_objram)
570   AM_RANGE(0xe000, 0xefff) AM_RAM AM_SHARE(1) /* WORK RAM (shared by the 2 z80's) */
571   AM_RANGE(0xf000, 0xf1ff) AM_RAM AM_BASE(&tnzs_vdcram)    /* VDC RAM */
572   AM_RANGE(0xf200, 0xf2ff) AM_RAM AM_BASE(&tnzs_scrollram) /* scrolling info */
573   AM_RANGE(0xf300, 0xf303) AM_MIRROR(0xfc) AM_WRITE(SMH_RAM) AM_BASE(&tnzs_objctrl) /* control registers (0x80 mirror used by Arkanoid 2) */
574   AM_RANGE(0xf400, 0xf400) AM_WRITE(SMH_RAM) AM_BASE(&tnzs_bg_flag)   /* enable / disable background transparency */
575   AM_RANGE(0xf600, 0xf600) AM_READWRITE(SMH_NOP, tnzs_bankswitch_w)
576   AM_RANGE(0xf800, 0xffff) AM_RAM AM_WRITE(jpopnics_palette_w) AM_BASE(&paletteram)
577ADDRESS_MAP_END
578
579READ8_HANDLER( moo_r )
580{
581   return mame_rand(machine);
582}
583
584READ8_HANDLER( bbb_r )
585{
586   return 0xff;
587}
588
589WRITE8_HANDLER( jpopnics_subbankswitch_w )
590{
591   UINT8 *RAM = memory_region(REGION_CPU2);
592
593   /* bits 0-1 select ROM bank */
594   memory_set_bankptr (2, &RAM[0x10000 + 0x2000 * (data & 3)]);
595}
596
597
598static ADDRESS_MAP_START( jpopnics_sub_map, ADDRESS_SPACE_PROGRAM, 8 )
599   AM_RANGE(0x0000, 0x7fff) AM_ROM
600   AM_RANGE(0x8000, 0x9fff) AM_READWRITE(SMH_BANK2, SMH_ROM)
601
602   AM_RANGE(0xa000, 0xa000) AM_WRITE(jpopnics_subbankswitch_w)
603   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_0_r) AM_WRITE(YM2151_register_port_0_w)
604   AM_RANGE(0xb001, 0xb001) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w)
605   AM_RANGE(0xc000, 0xc000) AM_READ(input_port_1_r)
606   AM_RANGE(0xc001, 0xc001) AM_READ(input_port_2_r)
607   AM_RANGE(0xc600, 0xc600) AM_READ(input_port_3_r)
608   AM_RANGE(0xc601, 0xc601) AM_READ(input_port_4_r)
609
610   AM_RANGE(0xd000, 0xdfff) AM_RAM
611   AM_RANGE(0xe000, 0xefff) AM_RAM AM_SHARE(1)
612
613   AM_RANGE(0xf000, 0xf003) AM_READ(arknoid2_sh_f000_r)
614ADDRESS_MAP_END
615
518616#define TNZS_PLAYER_INPUT(_n_)\
519617   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(_n_)\
520618   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(_n_)\
r2454r2455
775873   PORT_BIT( 0xffff, 0x0000, IPT_DIAL ) PORT_SENSITIVITY(70) PORT_KEYDELTA(15) PORT_PLAYER(2)
776874INPUT_PORTS_END
777875
876
877static INPUT_PORTS_START( jpopnics )
878   PORT_START
879   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
880
881   PORT_START
882   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
883   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
884   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Button 2 (Cheat)")
885   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
886   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
887
888
889   PORT_START
890   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
891   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
892   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Button 2 (Cheat)") PORT_PLAYER(2)
893   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
894   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
895
896    PORT_START
897   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
898   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
899   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
900   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
901   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
902   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
903   PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
904   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
905   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
906   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
907   TAITO_COINAGE_JAPAN_8
908
909     PORT_START
910     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
911     PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
912     PORT_DIPSETTING(    0x03, DEF_STR( Medium ) )
913     PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
914     PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
915     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
916     PORT_DIPSETTING(    0x08, "50k 150k" )
917     PORT_DIPSETTING(    0x0c, "70k 200k" )
918     PORT_DIPSETTING(    0x04, "100k 250k" )
919     PORT_DIPSETTING(    0x00, "200k 300k" )
920     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
921     PORT_DIPSETTING(    0x20, "2" )
922     PORT_DIPSETTING(    0x30, "3" )
923     PORT_DIPSETTING(    0x10, "4" )
924     PORT_DIPSETTING(    0x00, "5" )
925     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
926     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
927     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
928     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Allow_Continue ) )
929     PORT_DIPSETTING(    0x00, DEF_STR( No ) )
930     PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
931
932     PORT_START
933     PORT_START
934
935
936   PORT_START_TAG("AN1")      /* spinner 1 - read at f000/1 */
937   PORT_BIT( 0xffff, 0x0000, IPT_DIAL ) PORT_SENSITIVITY(70) PORT_KEYDELTA(15)
938
939   PORT_START_TAG("AN2")      /* spinner 2 - read at f002/3 */
940   PORT_BIT( 0xffff, 0x0000, IPT_DIAL ) PORT_SENSITIVITY(70) PORT_KEYDELTA(15) PORT_PLAYER(2)
941INPUT_PORTS_END
942
943
778944#define DRTOPP_COMMON\
779945   PORT_START_TAG("DSWB")\
780946   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )\
r2454r2455
12491415
12501416static const struct YM2203interface ym2203_interface =
12511417{
1252   input_port_0_r,      /* DSW1 connected to port A */
1253   input_port_1_r      /* DSW2 connected to port B */
1418   {
1419      AY8910_LEGACY_OUTPUT,
1420      AY8910_DEFAULT_LOADS,
1421      input_port_0_r,      /* DSW1 connected to port A */
1422      input_port_1_r,      /* DSW2 connected to port B */
1423      NULL,
1424      NULL
1425   },
1426   NULL
12541427};
12551428
12561429
r2454r2455
12621435
12631436static const struct YM2203interface kageki_ym2203_interface =
12641437{
1265   kageki_csport_r,
1266   0,
1267   0,
1268   kageki_csport_w
1438   {
1439      AY8910_LEGACY_OUTPUT,
1440      AY8910_DEFAULT_LOADS,
1441      kageki_csport_r,
1442      NULL,
1443      NULL,
1444      kageki_csport_w
1445   },
12691446};
12701447
12711448static const struct YM2203interface ym2203b_interface =
12721449{
1273   0,0,0,0,
1450   {
1451      AY8910_LEGACY_OUTPUT,
1452      AY8910_DEFAULT_LOADS,
1453      NULL, NULL, NULL, NULL
1454   },
12741455   irqhandler
12751456};
12761457
12771458static const struct YM2203interface kabukiz_ym2203_interface =
12781459{
1279   0,0,kabukiz_sound_bank_w,kabukiz_sample_w,
1460   {
1461      AY8910_LEGACY_OUTPUT,
1462      AY8910_DEFAULT_LOADS,
1463      NULL,
1464      NULL,
1465      kabukiz_sound_bank_w,
1466      kabukiz_sample_w,
1467   },
12801468   irqhandler
12811469};
12821470
r2454r2455
15581746MACHINE_DRIVER_END
15591747
15601748
1749static MACHINE_DRIVER_START( jpopnics )
15611750
1751   /* basic machine hardware */
1752   MDRV_CPU_ADD(Z80,XTAL_12MHz/2) /* Not verified - Main board Crystal is 12MHz */
1753   MDRV_CPU_PROGRAM_MAP(jpopnics_main_map,0)
1754   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
1755
1756   MDRV_CPU_ADD(Z80,XTAL_12MHz/2)   /* Not verified - Main board Crystal is 12MHz */
1757   MDRV_CPU_PROGRAM_MAP(jpopnics_sub_map,0)
1758   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
1759
1760   MDRV_INTERLEAVE(100)
1761
1762   /* video hardware */
1763   MDRV_SCREEN_ADD("main", RASTER)
1764   MDRV_SCREEN_REFRESH_RATE(60)
1765   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
1766   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1767   MDRV_SCREEN_SIZE(32*8, 32*8)
1768   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
1769
1770   MDRV_GFXDECODE(tnzs)
1771   MDRV_PALETTE_LENGTH(1024)
1772
1773   MDRV_VIDEO_UPDATE(tnzs)
1774   MDRV_VIDEO_EOF(tnzs)
1775
1776   /* sound hardware */
1777   MDRV_SPEAKER_STANDARD_MONO("mono")
1778
1779   MDRV_SOUND_ADD(YM2151, XTAL_12MHz/4) /* Not verified - Main board Crystal is 12MHz */
1780   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
1781MACHINE_DRIVER_END
1782
1783
15621784/***************************************************************************
15631785
15641786  Game driver(s)
r2454r2455
16011823   ROM_LOAD( "a98-12.bpr", 0x0200, 0x200, CRC(90dc9da7) SHA1(f719dead7f4597e5ee6f1103599505b98cb58299) )   /* lo bytes, AM27S29 or compatible like MB7124 */
16021824ROM_END
16031825
1826ROM_START( jpopnics )
1827   ROM_REGION( 0x30000, REGION_CPU1, 0 )   /* 64k + bankswitch areas for the first CPU */
1828   ROM_LOAD( "u96cpu2", 0x00000, 0x08000, CRC(649e951c) SHA1(b26bb157da9fcf5d3eddbb637a4cb2cb1b0fedac) )
1829   ROM_CONTINUE(           0x18000, 0x08000 )   /* banked at 8000-bfff */
1830   ROM_CONTINUE(           0x20000, 0x10000 )   /* banked at 8000-bfff */
1831
1832   ROM_REGION( 0x18000, REGION_CPU2, 0 )   /* 64k for the second CPU */
1833   ROM_LOAD( "u124cpu1", 0x00000, 0x08000,  CRC(8453e8e4) SHA1(aac1bd501a15f79e3ed566c949504169b2aa762d) )
1834   ROM_CONTINUE(           0x10000, 0x08000 )      /* banked at 8000-9fff */
1835
1836   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
1837   ROM_LOAD( "u94gfx", 0x00000, 0x10000, CRC(e49f2fdd) SHA1(6824c6520d0039c062f028e69cbfa7b3790ea756) )
1838   ROM_CONTINUE(       0x20000, 0x10000 )
1839   ROM_LOAD( "u93gfx", 0x40000, 0x10000, CRC(a7791b5b) SHA1(4abfe9b2612ed0d17f1282a60879cf1d0620ae4c) )
1840   ROM_CONTINUE(       0x60000, 0x10000 )
1841   ROM_LOAD( "u92gfx", 0x80000, 0x10000, CRC(b30caac7) SHA1(a434f67e1bec9848d9c3e184734d8cebee048176) )
1842   ROM_CONTINUE(       0xa0000, 0x10000 )
1843   ROM_LOAD( "u91gfx", 0xc0000, 0x10000, CRC(18ada5f2) SHA1(3307dd11e5cd0d0abe8b7751a5fbf54998558b34) )
1844   ROM_CONTINUE(       0xe0000, 0x10000 )
1845ROM_END
1846
16041847ROM_START( extrmatn )
16051848   ROM_REGION( 0x30000, REGION_CPU1, 0 )            /* Region 0 - main cpu */
16061849   ROM_LOAD( "b06-20.11c", 0x00000, 0x08000, CRC(04e3fc1f) SHA1(b1cf2f79f43fa33d6175368c897f84ec6aa6e746) )
r2454r2455
21462389GAME( 1988, kabukiz,  0,        kabukiz,  kabukiz,  kabukiz,  ROT0,   "Taito Corporation Japan", "Kabuki-Z (World)", 0 )
21472390GAME( 1988, kabukizj, kabukiz,  kabukiz,  kabukiz,  kabukiz,  ROT0,   "Taito Corporation", "Kabuki-Z (Japan)", 0 )
21482391GAME( 1989, insectx,  0,        insectx,  insectx,  insectx,  ROT0,   "Taito Corporation Japan", "Insector X (World)", 0 )
2392GAME( 1992, jpopnics, 0,        jpopnics, jpopnics, 0,        ROT0,   "Nics", "Jumping Pop (Nics, Korean bootleg of Plump Pop)", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/tp84.c
r2454r2455
6565***************************************************************************/
6666
6767#include "driver.h"
68#include "deprecat.h"
6968#include "sound/sn76496.h"
7069#include "sound/flt_rc.h"
7170
r2454r2455
129128
130129static WRITE8_HANDLER( tp84_sh_irqtrigger_w )
131130{
132   cpunum_set_input_line_and_vector(Machine, 2,0,HOLD_LINE,0xff);
131   cpunum_set_input_line_and_vector(machine, 2,0,HOLD_LINE,0xff);
133132}
134133
135134
src/mame/drivers/plygonet.c
r2454r2455
187187
188188static WRITE32_HANDLER( sound_irq_w )
189189{
190   cpunum_set_input_line(Machine, 2, 0, HOLD_LINE);
190   cpunum_set_input_line(machine, 2, 0, HOLD_LINE);
191191}
192192
193193
r2454r2455
216216      return;
217217   }
218218
219   if (mem_mask == (0x00000000))
219   if (mem_mask == (0xffffffff))
220220   {
221221      /* write the data to the dsp56k as well */
222222      dsp56k_shared_ram_16[(offset<<1)]   = (dsp_shared_ram[offset] & 0xffff0000) >> 16 ;
223223      dsp56k_shared_ram_16[(offset<<1)+1] = (dsp_shared_ram[offset] & 0x0000ffff) ;
224224   }
225   else if (mem_mask == (0x0000ffff))
225   else if (mem_mask == (0xffff0000))
226226   {
227227      /* write to the 'current' dsp56k byte */
228228      dsp56k_shared_ram_16[(offset<<1)]   = (dsp_shared_ram[offset] & 0xffff0000) >> 16 ;
229229   }
230   else if (mem_mask == (0xffff0000))
230   else if (mem_mask == (0x0000ffff))
231231   {
232232      /* write to the 'next' dsp56k byte */
233233      dsp56k_shared_ram_16[(offset<<1)+1] = (dsp_shared_ram[offset] & 0x0000ffff) ;
r2454r2455
267267{
268268   UINT8 hi_addr  = offset<<1;
269269
270   if (mem_mask == (~0x0000ff00))
270   if (mem_mask == 0x0000ff00)
271271      hi_addr++;
272272
273273   logerror("CALLING dsp_host_interface_read %x = %x [%x] (@%x)\n", hi_addr, dsp56k_host_interface_read(hi_addr), mem_mask, activecpu_get_pc());
274274
275   if (mem_mask == (~0x0000ff00))
275   if (mem_mask == 0x0000ff00)
276276      return dsp56k_host_interface_read(hi_addr) << 8;
277277   else
278278      return dsp56k_host_interface_read(hi_addr) << 24;
r2454r2455
284284   UINT8 dsp_data;
285285   UINT8 hi_addr  = offset<<1;
286286
287   if (mem_mask == (~0x0000ff00))            /* The second byte */
287   if (mem_mask == 0x0000ff00)            /* The second byte */
288288   {
289289      hi_addr++;
290290      dsp_data = data >> 8;
src/mame/drivers/nemesis.c
r2454r2455
245245{
246246   switch (hcrash_selected_ip & 0xf)
247247   {                                    // From WEC Le Mans Schems:
248      case 0xc:  return input_port_8_r(machine,offset);   // Accel - Schems: Accelevr
249      case 0:    return input_port_8_r(machine,offset);
250      case 0xd:  return input_port_9_r(machine,offset);   // Wheel - Schems: Handlevr
251      case 1:    return input_port_9_r(machine,offset);
248      case 0xc:  return input_port_read_indexed(machine,8);   // Accel - Schems: Accelevr
249      case 0:    return input_port_read_indexed(machine,8);
250      case 0xd:  return input_port_read_indexed(machine,9);   // Wheel - Schems: Handlevr
251      case 1:    return input_port_read_indexed(machine,9);
252252
253253      default: return ~0;
254254   }
r2454r2455
20912091
20922092static const struct AY8910interface ay8910_interface_1 =
20932093{
2094   nemesis_portA_r
2094   AY8910_LEGACY_OUTPUT,
2095   AY8910_DEFAULT_LOADS,
2096   nemesis_portA_r,
2097   NULL,
2098   NULL,
2099   NULL
20952100};
20962101
20972102static const struct AY8910interface ay8910_interface_2 =
20982103{
2099   0,
2100   0,
2104   AY8910_LEGACY_OUTPUT,
2105   AY8910_DEFAULT_LOADS,
2106   NULL,
2107   NULL,
21012108   k005289_control_A_w,
21022109   k005289_control_B_w
21032110};
src/mame/drivers/magmax.c
r2454r2455
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1312#include "cpu/m68000/m68000.h"
1413#include "sound/ay8910.h"
1514
r2454r2455
3433   if (ACCESSING_BITS_0_7)
3534   {
3635      sound_latch = (data & 0xff) << 1;
37      cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE);
36      cpunum_set_input_line(machine, 1, 0, ASSERT_LINE);
3837   }
3938}
4039
4140static READ8_HANDLER( magmax_sound_irq_ack )
4241{
43   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
42   cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
4443   return 0;
4544}
4645
r2454r2455
353352
354353static const struct AY8910interface ay8910_interface =
355354{
356   0,
357   0,
355   AY8910_LEGACY_OUTPUT,
356   AY8910_DEFAULT_LOADS,
357   NULL,
358   NULL,
358359   ay8910_portA_0_w, /*write port A*/
359360   ay8910_portB_0_w  /*write port B*/
360361};
src/mame/drivers/stv.c
r2454r2455
24732473{
24742474   COMBINE_DATA(&stv_workram_h[0xffc44/4]);
24752475
2476   logerror("cpu #%d (PC=%08X): 60ffc44_write write = %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), data, mem_mask ^ 0xffffffff);
2476   logerror("cpu #%d (PC=%08X): 60ffc44_write write = %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), data, mem_mask);
24772477   //sinit_w(offset,data,mem_mask);
24782478}
24792479
r2454r2455
24812481{
24822482   COMBINE_DATA(&stv_workram_h[0xffc48/4]);
24832483
2484   logerror("cpu #%d (PC=%08X): 60ffc48_write write = %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), data, mem_mask ^ 0xffffffff);
2484   logerror("cpu #%d (PC=%08X): 60ffc48_write write = %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), data, mem_mask);
24852485   //minit_w(offset,data,mem_mask);
24862486}
24872487
src/mame/drivers/megatech.c
r2454r2455
7878
7979*/
8080#include "driver.h"
81#include "deprecat.h"
8281#include "genesis.h"
8382#include "rendlay.h"
8483#include "megadriv.h"
r2454r2455
443442   mt_cart_select_reg = data;
444443
445444
446   megatech_select_game(Machine, mt_cart_select_reg);
445   megatech_select_game(machine, mt_cart_select_reg);
447446
448447/*
449448    if (mt_cart_select_reg==2)
src/mame/drivers/timelimt.c
r2454r2455
1111***************************************************************************/
1212
1313#include "driver.h"
14#include "deprecat.h"
1514#include "sound/ay8910.h"
1615
1716/* from video */
r2454r2455
5049static WRITE8_HANDLER( sound_reset_w )
5150{
5251   if ( data & 1 )
53      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE );
52      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, PULSE_LINE );
5453}
5554
5655
r2454r2455
246245
247246static const struct AY8910interface ay8910_interface =
248247{
249   soundlatch_r
248   AY8910_LEGACY_OUTPUT,
249   AY8910_DEFAULT_LOADS,
250   soundlatch_r,
251   NULL,
252   NULL,
253   NULL
250254};
251255
252256static INTERRUPT_GEN( timelimt_irq ) {
src/mame/drivers/igs_blit.c
r2454r2455
357357   COMBINE_DATA(&paletteram16[offset]);
358358
359359   rgb = (paletteram16[offset & 0x7ff] & 0xff) | ((paletteram16[offset | 0x800] & 0xff) << 8);
360   palette_set_color_rgb(Machine,offset & 0x7ff,pal5bit(rgb >> 0),pal5bit(rgb >> 5),pal5bit(rgb >> 10));
360   palette_set_color_rgb(machine,offset & 0x7ff,pal5bit(rgb >> 0),pal5bit(rgb >> 5),pal5bit(rgb >> 10));
361361}
362362
363363
src/mame/drivers/goal92.c
r2454r2455
240240
241241static const struct YM2203interface ym2203_interface =
242242{
243   0,
244   0,
245   0,
246   0,
243   {
244      AY8910_LEGACY_OUTPUT,
245      AY8910_DEFAULT_LOADS,
246      NULL, NULL, NULL, NULL
247   },
247248   irqhandler
248249};
249250
src/mame/drivers/vamphalf.c
r2454r2455
2828*********************************************************************/
2929
3030#include "driver.h"
31#include "deprecat.h"
3231#include "machine/eeprom.h"
3332#include "sound/2151intf.h"
3433#include "sound/okim6295.h"
r2454r2455
161160   COMBINE_DATA(&paletteram32[offset]);
162161
163162   paldata = paletteram32[offset] & 0xffff;
164   palette_set_color_rgb(Machine, offset*2 + 1, pal5bit(paldata >> 10), pal5bit(paldata >> 5), pal5bit(paldata >> 0));
163   palette_set_color_rgb(machine, offset*2 + 1, pal5bit(paldata >> 10), pal5bit(paldata >> 5), pal5bit(paldata >> 0));
165164
166165   paldata = (paletteram32[offset] >> 16) & 0xffff;
167   palette_set_color_rgb(Machine, offset*2 + 0, pal5bit(paldata >> 10), pal5bit(paldata >> 5), pal5bit(paldata >> 0));
166   palette_set_color_rgb(machine, offset*2 + 0, pal5bit(paldata >> 10), pal5bit(paldata >> 5), pal5bit(paldata >> 0));
168167}
169168
170169static READ32_HANDLER( wyvernwg_prot_r )
src/mame/drivers/1942.c
r2454r2455
7272
7373***************************************************************************/
7474
75#define MAIN_CPU_CLOCK      (XTAL_12MHz/3) /* 12MHz is the only OSC on the PCB */
76#define SOUND_CPU_CLOCK      (XTAL_12MHz/4) /* 12MHz is the only OSC on the PCB */
77#define AUDIO_CLOCK      (XTAL_12MHz/8) /* 12MHz is the only OSC on the PCB */
78
7579#include "driver.h"
7680#include "deprecat.h"
7781#include "sound/ay8910.h"
r2454r2455
266270static MACHINE_DRIVER_START( 1942 )
267271
268272   /* basic machine hardware */
269   MDRV_CPU_ADD(Z80, 4000000)   /* 4 MHz (?) */
273   MDRV_CPU_ADD(Z80, MAIN_CPU_CLOCK)   /* 4 MHz ??? */
270274   MDRV_CPU_PROGRAM_MAP(c1942_map, 0)
271275   MDRV_CPU_VBLANK_INT_HACK(c1942_interrupt,2)
272276
273   MDRV_CPU_ADD(Z80, 3000000)   /* 3 MHz ??? */
277   MDRV_CPU_ADD(Z80, SOUND_CPU_CLOCK)   /* 3 MHz ??? */
274278   MDRV_CPU_PROGRAM_MAP(sound_map, 0)
275279   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4)
276280
r2454r2455
292296   /* sound hardware */
293297   MDRV_SPEAKER_STANDARD_MONO("mono")
294298
295   MDRV_SOUND_ADD(AY8910, 1500000)
299   MDRV_SOUND_ADD(AY8910, AUDIO_CLOCK)   /* 1.5 MHz */
296300   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
297   MDRV_SOUND_ADD(AY8910, 1500000)
301   MDRV_SOUND_ADD(AY8910, AUDIO_CLOCK)   /* 1.5 MHz */
298302   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
299303MACHINE_DRIVER_END
300304
r2454r2455
308312
309313ROM_START( 1942 )
310314   ROM_REGION( 0x1c000, REGION_CPU1, 0 )   /* 64k for code + 3*16k for the banked ROMs images */
311   ROM_LOAD( "1-n3a.bin",    0x00000, 0x4000, CRC(40201bab) SHA1(4886c07a4602223c21419118e10aadce9c99fa5a) )
312   ROM_LOAD( "1-n4.bin",     0x04000, 0x4000, CRC(a60ac644) SHA1(f37862db3cf5e6cc9ab3276f3bc45fd629fd70dd) )
313   ROM_LOAD( "1-n5.bin",     0x10000, 0x4000, CRC(835f7b24) SHA1(24b66827f08c43fbf5b9517d638acdfc38e1b1e7) )
314   ROM_LOAD( "1-n6.bin",     0x14000, 0x2000, CRC(821c6481) SHA1(06becb6bf8b4bde3a458098498eecad566a87711) )
315   ROM_LOAD( "1-n7.bin",     0x18000, 0x4000, CRC(5df525e1) SHA1(70cd2910e2945db76bd6ebfa0ff09a5efadc2d0b) )
315   ROM_LOAD( "srb-03.m3", 0x00000, 0x4000, CRC(d9dafcc3) SHA1(a089a9bc55fb7d6d0ac53f91b258396d5d62677a) )
316   ROM_LOAD( "srb-04.m4", 0x04000, 0x4000, CRC(da0cf924) SHA1(856fbb302c9a4ec7850a26ab23dab8467f79bba4) )
317   ROM_LOAD( "srb-05.m5", 0x10000, 0x4000, CRC(d102911c) SHA1(35ba1d82bd901940f61d8619273463d02fc0a952) )
318   ROM_LOAD( "srb-06.m6", 0x14000, 0x2000, CRC(466f8248) SHA1(2ccc8fc59962d3001fbc10e8d2f20a254a74f251) )
319   ROM_LOAD( "srb-07.m7", 0x18000, 0x4000, CRC(0d31038c) SHA1(b588eaf6fddd66ecb2d9832dc197f286f1ccd846) )
316320
317321   ROM_REGION( 0x10000, REGION_CPU2, 0 )
318   ROM_LOAD( "1-c11.bin",    0x0000, 0x4000, CRC(bd87f06b) SHA1(821f85cf157f81117eeaba0c3cf0337eac357e58) )
322   ROM_LOAD( "sr-01.c11", 0x0000, 0x4000, CRC(bd87f06b) SHA1(821f85cf157f81117eeaba0c3cf0337eac357e58) )
319323
320324   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
321   ROM_LOAD( "1-f2.bin",    0x0000, 0x2000, CRC(6ebca191) SHA1(0dbddadde54a0ab66994c4a8726be05c6ca88a0e) )   /* characters */
325   ROM_LOAD( "sr-02.f2", 0x0000, 0x2000, CRC(6ebca191) SHA1(0dbddadde54a0ab66994c4a8726be05c6ca88a0e) )   /* characters */
322326
323327   ROM_REGION( 0xc000, REGION_GFX2, ROMREGION_DISPOSE )
324   ROM_LOAD( "2-a1.bin",     0x0000, 0x2000, CRC(3884d9eb) SHA1(5cbd9215fa5ba5a61208b383700adc4428521aed) )   /* tiles */
325   ROM_LOAD( "2-a2.bin",     0x2000, 0x2000, CRC(999cf6e0) SHA1(5b8b685038ec98b781908b92eb7fb9506db68544) )
326   ROM_LOAD( "2-a3.bin",     0x4000, 0x2000, CRC(8edb273a) SHA1(85fdd4c690ed31e6396e3c16aa02140ee7ea2d61) )
327   ROM_LOAD( "2-a4.bin",     0x6000, 0x2000, CRC(3a2726c3) SHA1(187c92ef591febdcbd1d42ab850e0cbb62c00873) )
328   ROM_LOAD( "2-a5.bin",     0x8000, 0x2000, CRC(1bd3d8bb) SHA1(ef4dce605eb4dc8035985a415315ec61c21419c6) )
329   ROM_LOAD( "2-a6.bin",     0xa000, 0x2000, CRC(658f02c4) SHA1(f087d69e49e38cf3107350cde18fcf85a8fa04f0) )
328   ROM_LOAD( "sr-08.a1", 0x0000, 0x2000, CRC(3884d9eb) SHA1(5cbd9215fa5ba5a61208b383700adc4428521aed) )   /* tiles */
329   ROM_LOAD( "sr-08.a2", 0x2000, 0x2000, CRC(999cf6e0) SHA1(5b8b685038ec98b781908b92eb7fb9506db68544) )
330   ROM_LOAD( "sr-08.a3", 0x4000, 0x2000, CRC(8edb273a) SHA1(85fdd4c690ed31e6396e3c16aa02140ee7ea2d61) )
331   ROM_LOAD( "sr-08.a4", 0x6000, 0x2000, CRC(3a2726c3) SHA1(187c92ef591febdcbd1d42ab850e0cbb62c00873) )
332   ROM_LOAD( "sr-08.a5", 0x8000, 0x2000, CRC(1bd3d8bb) SHA1(ef4dce605eb4dc8035985a415315ec61c21419c6) )
333   ROM_LOAD( "sr-08.a6", 0xa000, 0x2000, CRC(658f02c4) SHA1(f087d69e49e38cf3107350cde18fcf85a8fa04f0) )
330334
331335   ROM_REGION( 0x10000, REGION_GFX3, ROMREGION_DISPOSE )
332   ROM_LOAD( "2-l1.bin",     0x00000, 0x4000, CRC(2528bec6) SHA1(29f7719f18faad6bd1ec6735cc24e69168361470) )   /* sprites */
333   ROM_LOAD( "2-l2.bin",     0x04000, 0x4000, CRC(f89287aa) SHA1(136fff6d2a4f48a488fc7c620213761459c3ada0) )
334   ROM_LOAD( "2-n1.bin",     0x08000, 0x4000, CRC(024418f8) SHA1(145b8d5d6c8654cd090955a98f6dd8c8dbafe7c1) )
335   ROM_LOAD( "2-n2.bin",     0x0c000, 0x4000, CRC(e2c7e489) SHA1(d4b5d575c021f58f6966df189df94e08c5b3621c) )
336   ROM_LOAD( "sr-14.l1", 0x00000, 0x4000, CRC(2528bec6) SHA1(29f7719f18faad6bd1ec6735cc24e69168361470) )   /* sprites */
337   ROM_LOAD( "sr-15.l2", 0x04000, 0x4000, CRC(f89287aa) SHA1(136fff6d2a4f48a488fc7c620213761459c3ada0) )
338   ROM_LOAD( "sr-16.n1", 0x08000, 0x4000, CRC(024418f8) SHA1(145b8d5d6c8654cd090955a98f6dd8c8dbafe7c1) )
339   ROM_LOAD( "sr-17.n2", 0x0c000, 0x4000, CRC(e2c7e489) SHA1(d4b5d575c021f58f6966df189df94e08c5b3621c) )
336340
337341   ROM_REGION( 0x0a00, REGION_PROMS, 0 )
338   ROM_LOAD( "08e_sb-5.bin", 0x0000, 0x0100, CRC(93ab8153) SHA1(a792f24e5c0c3c4a6b436102e7a98199f878ece1) )   /* red component */
339   ROM_LOAD( "09e_sb-6.bin", 0x0100, 0x0100, CRC(8ab44f7d) SHA1(f74680a6a987d74b3acb32e6396f20e127874149) )   /* green component */
340   ROM_LOAD( "10e_sb-7.bin", 0x0200, 0x0100, CRC(f4ade9a4) SHA1(62ad31d31d183cce213b03168daa035083b2f28e) )   /* blue component */
341   ROM_LOAD( "f01_sb-0.bin", 0x0300, 0x0100, CRC(6047d91b) SHA1(1ce025f9524c1033e48c5294ee7d360f8bfebe8d) )   /* char lookup table */
342   ROM_LOAD( "06d_sb-4.bin", 0x0400, 0x0100, CRC(4858968d) SHA1(20b5dbcaa1a4081b3139e7e2332d8fe3c9e55ed6) )   /* tile lookup table */
343   ROM_LOAD( "03k_sb-8.bin", 0x0500, 0x0100, CRC(f6fad943) SHA1(b0a24ea7805272e8ebf72a99b08907bc00d5f82f) )   /* sprite lookup table */
344   ROM_LOAD( "01d_sb-2.bin", 0x0600, 0x0100, CRC(8bb8b3df) SHA1(49de2819c4c92057fedcb20425282515d85829aa) )   /* tile palette selector? (not used) */
345   ROM_LOAD( "02d_sb-3.bin", 0x0700, 0x0100, CRC(3b0c99af) SHA1(38f30ac1e48632634e409f328ee3051b987de7ad) )   /* tile palette selector? (not used) */
346   ROM_LOAD( "k06_sb-1.bin", 0x0800, 0x0100, CRC(712ac508) SHA1(5349d722ab6733afdda65f6e0a98322f0d515e86) )   /* interrupt timing (not used) */
347   ROM_LOAD( "01m_sb-9.bin", 0x0900, 0x0100, CRC(4921635c) SHA1(aee37d6cdc36acf0f11ff5f93e7b16e4b12f6c39) )   /* video timing? (not used) */
342   ROM_LOAD( "sb-5.e8",  0x0000, 0x0100, CRC(93ab8153) SHA1(a792f24e5c0c3c4a6b436102e7a98199f878ece1) )   /* red component */
343   ROM_LOAD( "sb-6.e9",  0x0100, 0x0100, CRC(8ab44f7d) SHA1(f74680a6a987d74b3acb32e6396f20e127874149) )   /* green component */
344   ROM_LOAD( "sb-7.e10", 0x0200, 0x0100, CRC(f4ade9a4) SHA1(62ad31d31d183cce213b03168daa035083b2f28e) )   /* blue component */
345   ROM_LOAD( "sb-0.f1",  0x0300, 0x0100, CRC(6047d91b) SHA1(1ce025f9524c1033e48c5294ee7d360f8bfebe8d) )   /* char lookup table */
346   ROM_LOAD( "sb-4.d6",  0x0400, 0x0100, CRC(4858968d) SHA1(20b5dbcaa1a4081b3139e7e2332d8fe3c9e55ed6) )   /* tile lookup table */
347   ROM_LOAD( "sb-8.k3",  0x0500, 0x0100, CRC(f6fad943) SHA1(b0a24ea7805272e8ebf72a99b08907bc00d5f82f) )   /* sprite lookup table */
348   ROM_LOAD( "sb-2.d1",  0x0600, 0x0100, CRC(8bb8b3df) SHA1(49de2819c4c92057fedcb20425282515d85829aa) )   /* tile palette selector? (not used) */
349   ROM_LOAD( "sb-3.d2",  0x0700, 0x0100, CRC(3b0c99af) SHA1(38f30ac1e48632634e409f328ee3051b987de7ad) )   /* tile palette selector? (not used) */
350   ROM_LOAD( "sb-1.k6",  0x0800, 0x0100, CRC(712ac508) SHA1(5349d722ab6733afdda65f6e0a98322f0d515e86) )   /* interrupt timing (not used) */
351   ROM_LOAD( "sb-9.m11", 0x0900, 0x0100, CRC(4921635c) SHA1(aee37d6cdc36acf0f11ff5f93e7b16e4b12f6c39) )   /* video timing? (not used) */
348352ROM_END
349353
350354ROM_START( 1942a )
351355   ROM_REGION( 0x1c000, REGION_CPU1, 0 )   /* 64k for code + 3*16k for the banked ROMs images */
352   ROM_LOAD( "1-n3.bin",     0x00000, 0x4000, CRC(612975f2) SHA1(f3744335862dd4c53925cc32792badd4a378c837) )
353   ROM_LOAD( "1-n4.bin",     0x04000, 0x4000, CRC(a60ac644) SHA1(f37862db3cf5e6cc9ab3276f3bc45fd629fd70dd) )
354   ROM_LOAD( "1-n5.bin",     0x10000, 0x4000, CRC(835f7b24) SHA1(24b66827f08c43fbf5b9517d638acdfc38e1b1e7) )
355   ROM_LOAD( "1-n6.bin",     0x14000, 0x2000, CRC(821c6481) SHA1(06becb6bf8b4bde3a458098498eecad566a87711) )
356   ROM_LOAD( "1-n7.bin",     0x18000, 0x4000, CRC(5df525e1) SHA1(70cd2910e2945db76bd6ebfa0ff09a5efadc2d0b) )
356   ROM_LOAD( "sra-03.m3", 0x00000, 0x4000, CRC(40201bab) SHA1(4886c07a4602223c21419118e10aadce9c99fa5a) )
357   ROM_LOAD( "sr-04.m4",  0x04000, 0x4000, CRC(a60ac644) SHA1(f37862db3cf5e6cc9ab3276f3bc45fd629fd70dd) )
358   ROM_LOAD( "sr-05.m5",  0x10000, 0x4000, CRC(835f7b24) SHA1(24b66827f08c43fbf5b9517d638acdfc38e1b1e7) )
359   ROM_LOAD( "sr-06.m6",  0x14000, 0x2000, CRC(821c6481) SHA1(06becb6bf8b4bde3a458098498eecad566a87711) )
360   ROM_LOAD( "sr-07.m7",  0x18000, 0x4000, CRC(5df525e1) SHA1(70cd2910e2945db76bd6ebfa0ff09a5efadc2d0b) )
357361
358362   ROM_REGION( 0x10000, REGION_CPU2, 0 )
359   ROM_LOAD( "1-c11.bin",    0x0000, 0x4000, CRC(bd87f06b) SHA1(821f85cf157f81117eeaba0c3cf0337eac357e58) )
363   ROM_LOAD( "sr-01.c11", 0x0000, 0x4000, CRC(bd87f06b) SHA1(821f85cf157f81117eeaba0c3cf0337eac357e58) )
360364
361365   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
362   ROM_LOAD( "1-f2.bin",    0x0000, 0x2000, CRC(6ebca191) SHA1(0dbddadde54a0ab66994c4a8726be05c6ca88a0e) )   /* characters */
366   ROM_LOAD( "sr-02.f2", 0x0000, 0x2000, CRC(6ebca191) SHA1(0dbddadde54a0ab66994c4a8726be05c6ca88a0e) )   /* characters */
363367
364368   ROM_REGION( 0xc000, REGION_GFX2, ROMREGION_DISPOSE )
365   ROM_LOAD( "2-a1.bin",     0x0000, 0x2000, CRC(3884d9eb) SHA1(5cbd9215fa5ba5a61208b383700adc4428521aed) )   /* tiles */
366   ROM_LOAD( "2-a2.bin",     0x2000, 0x2000, CRC(999cf6e0) SHA1(5b8b685038ec98b781908b92eb7fb9506db68544) )
367   ROM_LOAD( "2-a3.bin",     0x4000, 0x2000, CRC(8edb273a) SHA1(85fdd4c690ed31e6396e3c16aa02140ee7ea2d61) )
368   ROM_LOAD( "2-a4.bin",     0x6000, 0x2000, CRC(3a2726c3) SHA1(187c92ef591febdcbd1d42ab850e0cbb62c00873) )
369   ROM_LOAD( "2-a5.bin",     0x8000, 0x2000, CRC(1bd3d8bb) SHA1(ef4dce605eb4dc8035985a415315ec61c21419c6) )
370   ROM_LOAD( "2-a6.bin",     0xa000, 0x2000, CRC(658f02c4) SHA1(f087d69e49e38cf3107350cde18fcf85a8fa04f0) )
369   ROM_LOAD( "sr-08.a1", 0x0000, 0x2000, CRC(3884d9eb) SHA1(5cbd9215fa5ba5a61208b383700adc4428521aed) )   /* tiles */
370   ROM_LOAD( "sr-08.a2", 0x2000, 0x2000, CRC(999cf6e0) SHA1(5b8b685038ec98b781908b92eb7fb9506db68544) )
371   ROM_LOAD( "sr-08.a3", 0x4000, 0x2000, CRC(8edb273a) SHA1(85fdd4c690ed31e6396e3c16aa02140ee7ea2d61) )
372   ROM_LOAD( "sr-08.a4", 0x6000, 0x2000, CRC(3a2726c3) SHA1(187c92ef591febdcbd1d42ab850e0cbb62c00873) )
373   ROM_LOAD( "sr-08.a5", 0x8000, 0x2000, CRC(1bd3d8bb) SHA1(ef4dce605eb4dc8035985a415315ec61c21419c6) )
374   ROM_LOAD( "sr-08.a6", 0xa000, 0x2000, CRC(658f02c4) SHA1(f087d69e49e38cf3107350cde18fcf85a8fa04f0) )
371375
372376   ROM_REGION( 0x10000, REGION_GFX3, ROMREGION_DISPOSE )
373   ROM_LOAD( "2-l1.bin",     0x00000, 0x4000, CRC(2528bec6) SHA1(29f7719f18faad6bd1ec6735cc24e69168361470) )   /* sprites */
374   ROM_LOAD( "2-l2.bin",     0x04000, 0x4000, CRC(f89287aa) SHA1(136fff6d2a4f48a488fc7c620213761459c3ada0) )
375   ROM_LOAD( "2-n1.bin",     0x08000, 0x4000, CRC(024418f8) SHA1(145b8d5d6c8654cd090955a98f6dd8c8dbafe7c1) )
376   ROM_LOAD( "2-n2.bin",     0x0c000, 0x4000, CRC(e2c7e489) SHA1(d4b5d575c021f58f6966df189df94e08c5b3621c) )
377   ROM_LOAD( "sr-14.l1", 0x00000, 0x4000, CRC(2528bec6) SHA1(29f7719f18faad6bd1ec6735cc24e69168361470) )   /* sprites */
378   ROM_LOAD( "sr-15.l2", 0x04000, 0x4000, CRC(f89287aa) SHA1(136fff6d2a4f48a488fc7c620213761459c3ada0) )
379   ROM_LOAD( "sr-16.n1", 0x08000, 0x4000, CRC(024418f8) SHA1(145b8d5d6c8654cd090955a98f6dd8c8dbafe7c1) )
380   ROM_LOAD( "sr-17.n2", 0x0c000, 0x4000, CRC(e2c7e489) SHA1(d4b5d575c021f58f6966df189df94e08c5b3621c) )
377381
378382   ROM_REGION( 0x0a00, REGION_PROMS, 0 )
379   ROM_LOAD( "08e_sb-5.bin", 0x0000, 0x0100, CRC(93ab8153) SHA1(a792f24e5c0c3c4a6b436102e7a98199f878ece1) )   /* red component */
380   ROM_LOAD( "09e_sb-6.bin", 0x0100, 0x0100, CRC(8ab44f7d) SHA1(f74680a6a987d74b3acb32e6396f20e127874149) )   /* green component */
381   ROM_LOAD( "10e_sb-7.bin", 0x0200, 0x0100, CRC(f4ade9a4) SHA1(62ad31d31d183cce213b03168daa035083b2f28e) )   /* blue component */
382   ROM_LOAD( "f01_sb-0.bin", 0x0300, 0x0100, CRC(6047d91b) SHA1(1ce025f9524c1033e48c5294ee7d360f8bfebe8d) )   /* char lookup table */
383   ROM_LOAD( "06d_sb-4.bin", 0x0400, 0x0100, CRC(4858968d) SHA1(20b5dbcaa1a4081b3139e7e2332d8fe3c9e55ed6) )   /* tile lookup table */
384   ROM_LOAD( "03k_sb-8.bin", 0x0500, 0x0100, CRC(f6fad943) SHA1(b0a24ea7805272e8ebf72a99b08907bc00d5f82f) )   /* sprite lookup table */
385   ROM_LOAD( "01d_sb-2.bin", 0x0600, 0x0100, CRC(8bb8b3df) SHA1(49de2819c4c92057fedcb20425282515d85829aa) )   /* tile palette selector? (not used) */
386   ROM_LOAD( "02d_sb-3.bin", 0x0700, 0x0100, CRC(3b0c99af) SHA1(38f30ac1e48632634e409f328ee3051b987de7ad) )   /* tile palette selector? (not used) */
387   ROM_LOAD( "k06_sb-1.bin", 0x0800, 0x0100, CRC(712ac508) SHA1(5349d722ab6733afdda65f6e0a98322f0d515e86) )   /* interrupt timing (not used) */
388   ROM_LOAD( "01m_sb-9.bin", 0x0900, 0x0100, CRC(4921635c) SHA1(aee37d6cdc36acf0f11ff5f93e7b16e4b12f6c39) )   /* video timing? (not used) */
383   ROM_LOAD( "sb-5.e8",  0x0000, 0x0100, CRC(93ab8153) SHA1(a792f24e5c0c3c4a6b436102e7a98199f878ece1) )   /* red component */
384   ROM_LOAD( "sb-6.e9",  0x0100, 0x0100, CRC(8ab44f7d) SHA1(f74680a6a987d74b3acb32e6396f20e127874149) )   /* green component */
385   ROM_LOAD( "sb-7.e10", 0x0200, 0x0100, CRC(f4ade9a4) SHA1(62ad31d31d183cce213b03168daa035083b2f28e) )   /* blue component */
386   ROM_LOAD( "sb-0.f1",  0x0300, 0x0100, CRC(6047d91b) SHA1(1ce025f9524c1033e48c5294ee7d360f8bfebe8d) )   /* char lookup table */
387   ROM_LOAD( "sb-4.d6",  0x0400, 0x0100, CRC(4858968d) SHA1(20b5dbcaa1a4081b3139e7e2332d8fe3c9e55ed6) )   /* tile lookup table */
388   ROM_LOAD( "sb-8.k3",  0x0500, 0x0100, CRC(f6fad943) SHA1(b0a24ea7805272e8ebf72a99b08907bc00d5f82f) )   /* sprite lookup table */
389   ROM_LOAD( "sb-2.d1",  0x0600, 0x0100, CRC(8bb8b3df) SHA1(49de2819c4c92057fedcb20425282515d85829aa) )   /* tile palette selector? (not used) */
390   ROM_LOAD( "sb-3.d2",  0x0700, 0x0100, CRC(3b0c99af) SHA1(38f30ac1e48632634e409f328ee3051b987de7ad) )   /* tile palette selector? (not used) */
391   ROM_LOAD( "sb-1.k6",  0x0800, 0x0100, CRC(712ac508) SHA1(5349d722ab6733afdda65f6e0a98322f0d515e86) )   /* interrupt timing (not used) */
392   ROM_LOAD( "sb-9.m11", 0x0900, 0x0100, CRC(4921635c) SHA1(aee37d6cdc36acf0f11ff5f93e7b16e4b12f6c39) )   /* video timing? (not used) */
389393ROM_END
390394
391395ROM_START( 1942b )
392396   ROM_REGION( 0x1c000, REGION_CPU1, 0 )   /* 64k for code + 3*16k for the banked ROMs images */
393   ROM_LOAD( "srb-03.n3",    0x00000, 0x4000, CRC(d9dafcc3) SHA1(a089a9bc55fb7d6d0ac53f91b258396d5d62677a) )
394   ROM_LOAD( "srb-04.n4",    0x04000, 0x4000, CRC(da0cf924) SHA1(856fbb302c9a4ec7850a26ab23dab8467f79bba4) )
395   ROM_LOAD( "srb-05.n5",    0x10000, 0x4000, CRC(d102911c) SHA1(35ba1d82bd901940f61d8619273463d02fc0a952) )
396   ROM_LOAD( "srb-06.n6",    0x14000, 0x2000, CRC(466f8248) SHA1(2ccc8fc59962d3001fbc10e8d2f20a254a74f251) )
397   ROM_LOAD( "srb-07.n7",    0x18000, 0x4000, CRC(0d31038c) SHA1(b588eaf6fddd66ecb2d9832dc197f286f1ccd846) )
397   ROM_LOAD( "sr-03.m3", 0x00000, 0x4000, CRC(612975f2) SHA1(f3744335862dd4c53925cc32792badd4a378c837) )
398   ROM_LOAD( "sr-04.m4", 0x04000, 0x4000, CRC(a60ac644) SHA1(f37862db3cf5e6cc9ab3276f3bc45fd629fd70dd) )
399   ROM_LOAD( "sr-05.m5", 0x10000, 0x4000, CRC(835f7b24) SHA1(24b66827f08c43fbf5b9517d638acdfc38e1b1e7) )
400   ROM_LOAD( "sr-06.m6", 0x14000, 0x2000, CRC(821c6481) SHA1(06becb6bf8b4bde3a458098498eecad566a87711) )
401   ROM_LOAD( "sr-07.m7", 0x18000, 0x4000, CRC(5df525e1) SHA1(70cd2910e2945db76bd6ebfa0ff09a5efadc2d0b) )
398402
399403   ROM_REGION( 0x10000, REGION_CPU2, 0 )
400   ROM_LOAD( "1-c11.bin",    0x0000, 0x4000, CRC(bd87f06b) SHA1(821f85cf157f81117eeaba0c3cf0337eac357e58) )
404   ROM_LOAD( "sr-01.c11", 0x0000, 0x4000, CRC(bd87f06b) SHA1(821f85cf157f81117eeaba0c3cf0337eac357e58) )
401405
402406   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
403   ROM_LOAD( "1-f2.bin",    0x0000, 0x2000, CRC(6ebca191) SHA1(0dbddadde54a0ab66994c4a8726be05c6ca88a0e) )   /* characters */
407   ROM_LOAD( "sr-02.f2", 0x0000, 0x2000, CRC(6ebca191) SHA1(0dbddadde54a0ab66994c4a8726be05c6ca88a0e) )   /* characters */
404408
405409   ROM_REGION( 0xc000, REGION_GFX2, ROMREGION_DISPOSE )
406   ROM_LOAD( "2-a1.bin",     0x0000, 0x2000, CRC(3884d9eb) SHA1(5cbd9215fa5ba5a61208b383700adc4428521aed) )   /* tiles */
407   ROM_LOAD( "2-a2.bin",     0x2000, 0x2000, CRC(999cf6e0) SHA1(5b8b685038ec98b781908b92eb7fb9506db68544) )
408   ROM_LOAD( "2-a3.bin",     0x4000, 0x2000, CRC(8edb273a) SHA1(85fdd4c690ed31e6396e3c16aa02140ee7ea2d61) )
409   ROM_LOAD( "2-a4.bin",     0x6000, 0x2000, CRC(3a2726c3) SHA1(187c92ef591febdcbd1d42ab850e0cbb62c00873) )
410   ROM_LOAD( "2-a5.bin",     0x8000, 0x2000, CRC(1bd3d8bb) SHA1(ef4dce605eb4dc8035985a415315ec61c21419c6) )
411   ROM_LOAD( "2-a6.bin",     0xa000, 0x2000, CRC(658f02c4) SHA1(f087d69e49e38cf3107350cde18fcf85a8fa04f0) )
410   ROM_LOAD( "sr-08.a1", 0x0000, 0x2000, CRC(3884d9eb) SHA1(5cbd9215fa5ba5a61208b383700adc4428521aed) )   /* tiles */
411   ROM_LOAD( "sr-08.a2", 0x2000, 0x2000, CRC(999cf6e0) SHA1(5b8b685038ec98b781908b92eb7fb9506db68544) )
412   ROM_LOAD( "sr-08.a3", 0x4000, 0x2000, CRC(8edb273a) SHA1(85fdd4c690ed31e6396e3c16aa02140ee7ea2d61) )
413   ROM_LOAD( "sr-08.a4", 0x6000, 0x2000, CRC(3a2726c3) SHA1(187c92ef591febdcbd1d42ab850e0cbb62c00873) )
414   ROM_LOAD( "sr-08.a5", 0x8000, 0x2000, CRC(1bd3d8bb) SHA1(ef4dce605eb4dc8035985a415315ec61c21419c6) )
415   ROM_LOAD( "sr-08.a6", 0xa000, 0x2000, CRC(658f02c4) SHA1(f087d69e49e38cf3107350cde18fcf85a8fa04f0) )
412416
413417   ROM_REGION( 0x10000, REGION_GFX3, ROMREGION_DISPOSE )
414   ROM_LOAD( "2-l1.bin",     0x00000, 0x4000, CRC(2528bec6) SHA1(29f7719f18faad6bd1ec6735cc24e69168361470) )   /* sprites */
415   ROM_LOAD( "2-l2.bin",     0x04000, 0x4000, CRC(f89287aa) SHA1(136fff6d2a4f48a488fc7c620213761459c3ada0) )
416   ROM_LOAD( "2-n1.bin",     0x08000, 0x4000, CRC(024418f8) SHA1(145b8d5d6c8654cd090955a98f6dd8c8dbafe7c1) )
417   ROM_LOAD( "2-n2.bin",     0x0c000, 0x4000, CRC(e2c7e489) SHA1(d4b5d575c021f58f6966df189df94e08c5b3621c) )
418   ROM_LOAD( "sr-14.l1", 0x00000, 0x4000, CRC(2528bec6) SHA1(29f7719f18faad6bd1ec6735cc24e69168361470) )   /* sprites */
419   ROM_LOAD( "sr-15.l2", 0x04000, 0x4000, CRC(f89287aa) SHA1(136fff6d2a4f48a488fc7c620213761459c3ada0) )
420   ROM_LOAD( "sr-16.n1", 0x08000, 0x4000, CRC(024418f8) SHA1(145b8d5d6c8654cd090955a98f6dd8c8dbafe7c1) )
421   ROM_LOAD( "sr-17.n2", 0x0c000, 0x4000, CRC(e2c7e489) SHA1(d4b5d575c021f58f6966df189df94e08c5b3621c) )
418422
419423   ROM_REGION( 0x0a00, REGION_PROMS, 0 )
420   ROM_LOAD( "08e_sb-5.bin", 0x0000, 0x0100, CRC(93ab8153) SHA1(a792f24e5c0c3c4a6b436102e7a98199f878ece1) )   /* red component */
421   ROM_LOAD( "09e_sb-6.bin", 0x0100, 0x0100, CRC(8ab44f7d) SHA1(f74680a6a987d74b3acb32e6396f20e127874149) )   /* green component */
422   ROM_LOAD( "10e_sb-7.bin", 0x0200, 0x0100, CRC(f4ade9a4) SHA1(62ad31d31d183cce213b03168daa035083b2f28e) )   /* blue component */
423   ROM_LOAD( "f01_sb-0.bin", 0x0300, 0x0100, CRC(6047d91b) SHA1(1ce025f9524c1033e48c5294ee7d360f8bfebe8d) )   /* char lookup table */
424   ROM_LOAD( "06d_sb-4.bin", 0x0400, 0x0100, CRC(4858968d) SHA1(20b5dbcaa1a4081b3139e7e2332d8fe3c9e55ed6) )   /* tile lookup table */
425   ROM_LOAD( "03k_sb-8.bin", 0x0500, 0x0100, CRC(f6fad943) SHA1(b0a24ea7805272e8ebf72a99b08907bc00d5f82f) )   /* sprite lookup table */
426   ROM_LOAD( "01d_sb-2.bin", 0x0600, 0x0100, CRC(8bb8b3df) SHA1(49de2819c4c92057fedcb20425282515d85829aa) )   /* tile palette selector? (not used) */
427   ROM_LOAD( "02d_sb-3.bin", 0x0700, 0x0100, CRC(3b0c99af) SHA1(38f30ac1e48632634e409f328ee3051b987de7ad) )   /* tile palette selector? (not used) */
428   ROM_LOAD( "k06_sb-1.bin", 0x0800, 0x0100, CRC(712ac508) SHA1(5349d722ab6733afdda65f6e0a98322f0d515e86) )   /* interrupt timing (not used) */
429   ROM_LOAD( "01m_sb-9.bin", 0x0900, 0x0100, CRC(4921635c) SHA1(aee37d6cdc36acf0f11ff5f93e7b16e4b12f6c39) )   /* video timing? (not used) */
424   ROM_LOAD( "sb-5.e8",  0x0000, 0x0100, CRC(93ab8153) SHA1(a792f24e5c0c3c4a6b436102e7a98199f878ece1) )   /* red component */
425   ROM_LOAD( "sb-6.e9",  0x0100, 0x0100, CRC(8ab44f7d) SHA1(f74680a6a987d74b3acb32e6396f20e127874149) )   /* green component */
426   ROM_LOAD( "sb-7.e10", 0x0200, 0x0100, CRC(f4ade9a4) SHA1(62ad31d31d183cce213b03168daa035083b2f28e) )   /* blue component */
427   ROM_LOAD( "sb-0.f1",  0x0300, 0x0100, CRC(6047d91b) SHA1(1ce025f9524c1033e48c5294ee7d360f8bfebe8d) )   /* char lookup table */
428   ROM_LOAD( "sb-4.d6",  0x0400, 0x0100, CRC(4858968d) SHA1(20b5dbcaa1a4081b3139e7e2332d8fe3c9e55ed6) )   /* tile lookup table */
429   ROM_LOAD( "sb-8.k3",  0x0500, 0x0100, CRC(f6fad943) SHA1(b0a24ea7805272e8ebf72a99b08907bc00d5f82f) )   /* sprite lookup table */
430   ROM_LOAD( "sb-2.d1",  0x0600, 0x0100, CRC(8bb8b3df) SHA1(49de2819c4c92057fedcb20425282515d85829aa) )   /* tile palette selector? (not used) */
431   ROM_LOAD( "sb-3.d2",  0x0700, 0x0100, CRC(3b0c99af) SHA1(38f30ac1e48632634e409f328ee3051b987de7ad) )   /* tile palette selector? (not used) */
432   ROM_LOAD( "sb-1.k6",  0x0800, 0x0100, CRC(712ac508) SHA1(5349d722ab6733afdda65f6e0a98322f0d515e86) )   /* interrupt timing (not used) */
433   ROM_LOAD( "sb-9.m11", 0x0900, 0x0100, CRC(4921635c) SHA1(aee37d6cdc36acf0f11ff5f93e7b16e4b12f6c39) )   /* video timing? (not used) */
430434ROM_END
431435
436ROM_START( 1942w )
437   ROM_REGION( 0x1c000, REGION_CPU1, 0 )   /* 64k for code + 3*16k for the banked ROMs images */
438   ROM_LOAD( "sw-03.m3", 0x00000, 0x4000, CRC(afd79770) SHA1(74c7a887fe3d4abfce1dcfec4c75b21ab81adc8c) )
439   ROM_LOAD( "sw-04.m4", 0x04000, 0x4000, CRC(933d9910) SHA1(9c73ef880f56e30a865be959f8bbdbe79c7ef8e2) )
440   ROM_LOAD( "sw-05.m5", 0x10000, 0x4000, CRC(e9a71bb6) SHA1(1f0d52c9282d15f9e4898b3b144ece25d345b71f) )
441   ROM_LOAD( "sw-06.m6", 0x14000, 0x2000, CRC(466f8248) SHA1(2ccc8fc59962d3001fbc10e8d2f20a254a74f251) )   /* matches srb-06.m6 from 1942 (Revision B) */
442   ROM_LOAD( "sw-07.m7", 0x18000, 0x4000, CRC(ec41655e) SHA1(dbe4bb11f2e88574cb43ba5cd216354c3b7f69a6) )
432443
444   ROM_REGION( 0x10000, REGION_CPU2, 0 )
445   ROM_LOAD( "sr-01.c11", 0x0000, 0x4000, CRC(bd87f06b) SHA1(821f85cf157f81117eeaba0c3cf0337eac357e58) )
446
447   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
448   ROM_LOAD( "sw-02.f2", 0x0000, 0x2000, CRC(f8e9ada2) SHA1(028f554e70425c53faa30a6fe1c45cc16724560a) )   /* characters */
449
450   ROM_REGION( 0xc000, REGION_GFX2, ROMREGION_DISPOSE )
451   ROM_LOAD( "sr-08.a1", 0x0000, 0x2000, CRC(3884d9eb) SHA1(5cbd9215fa5ba5a61208b383700adc4428521aed) )   /* tiles */
452   ROM_LOAD( "sr-08.a2", 0x2000, 0x2000, CRC(999cf6e0) SHA1(5b8b685038ec98b781908b92eb7fb9506db68544) )
453   ROM_LOAD( "sr-08.a3", 0x4000, 0x2000, CRC(8edb273a) SHA1(85fdd4c690ed31e6396e3c16aa02140ee7ea2d61) )
454   ROM_LOAD( "sr-08.a4", 0x6000, 0x2000, CRC(3a2726c3) SHA1(187c92ef591febdcbd1d42ab850e0cbb62c00873) )
455   ROM_LOAD( "sr-08.a5", 0x8000, 0x2000, CRC(1bd3d8bb) SHA1(ef4dce605eb4dc8035985a415315ec61c21419c6) )
456   ROM_LOAD( "sr-08.a6", 0xa000, 0x2000, CRC(658f02c4) SHA1(f087d69e49e38cf3107350cde18fcf85a8fa04f0) )
457
458   ROM_REGION( 0x10000, REGION_GFX3, ROMREGION_DISPOSE )
459   ROM_LOAD( "sr-14.l1", 0x00000, 0x4000, CRC(2528bec6) SHA1(29f7719f18faad6bd1ec6735cc24e69168361470) )   /* sprites */
460   ROM_LOAD( "sr-15.l2", 0x04000, 0x4000, CRC(f89287aa) SHA1(136fff6d2a4f48a488fc7c620213761459c3ada0) )
461   ROM_LOAD( "sr-16.n1", 0x08000, 0x4000, CRC(024418f8) SHA1(145b8d5d6c8654cd090955a98f6dd8c8dbafe7c1) )
462   ROM_LOAD( "sr-17.n2", 0x0c000, 0x4000, CRC(e2c7e489) SHA1(d4b5d575c021f58f6966df189df94e08c5b3621c) )
463
464   ROM_REGION( 0x0a00, REGION_PROMS, 0 )
465   ROM_LOAD( "sb-5.e8",  0x0000, 0x0100, CRC(93ab8153) SHA1(a792f24e5c0c3c4a6b436102e7a98199f878ece1) )   /* red component */
466   ROM_LOAD( "sb-6.e9",  0x0100, 0x0100, CRC(8ab44f7d) SHA1(f74680a6a987d74b3acb32e6396f20e127874149) )   /* green component */
467   ROM_LOAD( "sb-7.e10", 0x0200, 0x0100, CRC(f4ade9a4) SHA1(62ad31d31d183cce213b03168daa035083b2f28e) )   /* blue component */
468   ROM_LOAD( "sb-0.f1",  0x0300, 0x0100, CRC(6047d91b) SHA1(1ce025f9524c1033e48c5294ee7d360f8bfebe8d) )   /* char lookup table */
469   ROM_LOAD( "sb-4.d6",  0x0400, 0x0100, CRC(4858968d) SHA1(20b5dbcaa1a4081b3139e7e2332d8fe3c9e55ed6) )   /* tile lookup table */
470   ROM_LOAD( "sb-8.k3",  0x0500, 0x0100, CRC(f6fad943) SHA1(b0a24ea7805272e8ebf72a99b08907bc00d5f82f) )   /* sprite lookup table */
471   ROM_LOAD( "sb-2.d1",  0x0600, 0x0100, CRC(8bb8b3df) SHA1(49de2819c4c92057fedcb20425282515d85829aa) )   /* tile palette selector? (not used) */
472   ROM_LOAD( "sb-3.d2",  0x0700, 0x0100, CRC(3b0c99af) SHA1(38f30ac1e48632634e409f328ee3051b987de7ad) )   /* tile palette selector? (not used) */
473   ROM_LOAD( "sb-1.k6",  0x0800, 0x0100, CRC(712ac508) SHA1(5349d722ab6733afdda65f6e0a98322f0d515e86) )   /* interrupt timing (not used) */
474   ROM_LOAD( "sb-9.m11", 0x0900, 0x0100, CRC(4921635c) SHA1(aee37d6cdc36acf0f11ff5f93e7b16e4b12f6c39) )   /* video timing? (not used) */
475ROM_END
476
477
433478static DRIVER_INIT( 1942 )
434479{
435480   UINT8 *ROM = memory_region(REGION_CPU1);
r2454r2455
437482}
438483
439484
440GAME( 1984, 1942,  0,    1942, 1942, 1942, ROT270, "Capcom", "1942 (set 1)", GAME_SUPPORTS_SAVE )
441GAME( 1984, 1942a, 1942, 1942, 1942, 1942, ROT270, "Capcom", "1942 (set 2)", GAME_SUPPORTS_SAVE )
442GAME( 1984, 1942b, 1942, 1942, 1942, 1942, ROT270, "Capcom", "1942 (set 3)", GAME_SUPPORTS_SAVE )
485GAME( 1984, 1942,  0,    1942, 1942, 1942, ROT270, "Capcom", "1942 (Revision B)", GAME_SUPPORTS_SAVE )
486GAME( 1984, 1942a, 1942, 1942, 1942, 1942, ROT270, "Capcom", "1942 (Revision A)", GAME_SUPPORTS_SAVE )
487GAME( 1984, 1942b, 1942, 1942, 1942, 1942, ROT270, "Capcom", "1942 (First Version)", GAME_SUPPORTS_SAVE )
488GAME( 1985, 1942w, 1942, 1942, 1942, 1942, ROT270, "Capcom (Williams Electronics license)", "1942 (Williams Electronics license)", GAME_SUPPORTS_SAVE ) /* Based on 1942 (Revision B) */
src/mame/drivers/mayumi.c
r2454r2455
263263
264264static const struct YM2203interface ym2203_interface =
265265{
266   input_port_0_r,
267   input_port_1_r
266   {
267      AY8910_LEGACY_OUTPUT,
268      AY8910_DEFAULT_LOADS,
269      input_port_0_r,
270      input_port_1_r,
271      NULL,
272      NULL
273   },
274   NULL
268275};
269276
270277static MACHINE_DRIVER_START( mayumi )
src/mame/drivers/poolshrk.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "poolshrk.h"
109#include "sound/discrete.h"
1110
r2454r2455
9190
9291static READ8_HANDLER( poolshrk_irq_reset_r )
9392{
94   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
93   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
9594
9695   return 0;
9796}
src/mame/drivers/raiden.c
r2454r2455
228228
229229static VIDEO_EOF( raiden )
230230{
231   buffer_spriteram16_w(machine,0,0,0); /* Could be a memory location instead */
231   buffer_spriteram16_w(machine,0,0,0xffff); /* Could be a memory location instead */
232232}
233233
234234static MACHINE_DRIVER_START( raiden )
src/mame/drivers/vegaeo.c
r2454r2455
2525{
2626   switch(mem_mask)
2727   {
28      case 0:
29         vega_vram_w(machine,offset,data,0x00ffffff);
30         vega_vram_w(machine,offset,data,0xff00ffff);
31         vega_vram_w(machine,offset,data,0xffff00ff);
32         vega_vram_w(machine,offset,data,0xffffff00);
28      case 0xffffffff:
29         vega_vram_w(machine,offset,data,0xff000000);
30         vega_vram_w(machine,offset,data,0x00ff0000);
31         vega_vram_w(machine,offset,data,0x0000ff00);
32         vega_vram_w(machine,offset,data,0x000000ff);
3333         return;
3434
35      case 0x0000ffff:
36         vega_vram_w(machine,offset,data,0x00ffffff);
37         vega_vram_w(machine,offset,data,0xff00ffff);
35      case 0xffff0000:
36         vega_vram_w(machine,offset,data,0xff000000);
37         vega_vram_w(machine,offset,data,0x00ff0000);
3838         return;
3939
40      case 0xffff0000:
41         vega_vram_w(machine,offset,data,0xffff00ff);
42         vega_vram_w(machine,offset,data,0xffffff00);
40      case 0x0000ffff:
41         vega_vram_w(machine,offset,data,0x0000ff00);
42         vega_vram_w(machine,offset,data,0x000000ff);
4343         return;
4444
4545      default:
4646         // don't write transparent pen
47         if((data & ~mem_mask) == ~mem_mask)
47         if((data & mem_mask) == mem_mask)
4848            return;
4949   }
5050
r2454r2455
6363   COMBINE_DATA(&paletteram32[offset]);
6464
6565   paldata = paletteram32[offset] & 0x7fff;
66   palette_set_color_rgb(Machine, offset, pal5bit(paldata >> 10), pal5bit(paldata >> 5), pal5bit(paldata >> 0));
66   palette_set_color_rgb(machine, offset, pal5bit(paldata >> 10), pal5bit(paldata >> 5), pal5bit(paldata >> 0));
6767}
6868
6969static WRITE32_HANDLER( vega_misc_w )
src/mame/drivers/fromanc2.c
r2454r2455
244244{
245245   fromanc2_datalatch1 = data;
246246
247   cpunum_set_input_line(Machine, 2, 0, HOLD_LINE);
247   cpunum_set_input_line(machine, 2, 0, HOLD_LINE);
248248   fromanc2_subcpu_int_flag = 0;
249249}
250250
251251static READ16_HANDLER( fromanc2_subcpu_r )
252252{
253   cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE);
253   cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, PULSE_LINE);
254254   fromanc2_subcpu_nmi_flag = 0;
255255
256256   return (fromanc2_datalatch_2h << 8) | fromanc2_datalatch_2l;
src/mame/drivers/rallyx.c
r2454r2455
183183***************************************************************************/
184184
185185#include "driver.h"
186#include "deprecat.h"
187186#include "audio/timeplt.h"
188187#include "sound/namco.h"
189188#include "sound/samples.h"
r2454r2455
208207static WRITE8_HANDLER( rallyx_interrupt_vector_w )
209208{
210209   cpunum_set_input_line_vector(0, 0, data);
211   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
210   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
212211}
213212
214213
r2454r2455
237236      case 0x01:   /* INT ON */
238237         cpu_interrupt_enable(0,bit);
239238         if (!bit)
240            cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
239            cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
241240         break;
242241
243242      case 0x02:   /* SOUND ON */
src/mame/drivers/unico.c
r2454r2455
219219static READ32_HANDLER( zeropnt2_dsw2_r )         { return (input_port_read(machine, "DSW2") << 16) | 0xffff; }
220220static READ32_HANDLER( zeropnt2_buttons_r )         { return ((input_port_read(machine, "IN7") | ((EEPROM_read_bit() & 0x01) << 7)) << 16) | 0xffff; }
221221
222static READ32_HANDLER( zeropnt2_gunx_0_msb_r )      { return (unico_gunx_0_msb_r(machine,0,0)-0x0800) << 16; }
223static READ32_HANDLER( zeropnt2_guny_0_msb_r )      { return (unico_guny_0_msb_r(machine,0,0)+0x0800) << 16; }
224static READ32_HANDLER( zeropnt2_gunx_1_msb_r )      { return (unico_gunx_1_msb_r(machine,0,0)-0x0800) << 16; }
225static READ32_HANDLER( zeropnt2_guny_1_msb_r )      { return (unico_guny_1_msb_r(machine,0,0)+0x0800) << 16; }
222static READ32_HANDLER( zeropnt2_gunx_0_msb_r )      { return (unico_gunx_0_msb_r(machine,0,0xffff)-0x0800) << 16; }
223static READ32_HANDLER( zeropnt2_guny_0_msb_r )      { return (unico_guny_0_msb_r(machine,0,0xffff)+0x0800) << 16; }
224static READ32_HANDLER( zeropnt2_gunx_1_msb_r )      { return (unico_gunx_1_msb_r(machine,0,0xffff)-0x0800) << 16; }
225static READ32_HANDLER( zeropnt2_guny_1_msb_r )      { return (unico_guny_1_msb_r(machine,0,0xffff)+0x0800) << 16; }
226226
227227static READ32_HANDLER ( zeropnt2_oki0_r )         { return OKIM6295_status_0_r(machine,0) << 16; }
228228static READ32_HANDLER ( zeropnt2_oki1_r )         { return OKIM6295_status_1_r(machine,0) << 16; }
src/mame/drivers/blockhl.c
r2454r2455
2020***************************************************************************/
2121
2222#include "driver.h"
23#include "deprecat.h"
2423#include "cpu/konami/konami.h" /* for the callback and the firq irq definition */
2524#include "video/konamiic.h"
2625#include "sound/2151intf.h"
r2454r2455
6160
6261static WRITE8_HANDLER( blockhl_sh_irqtrigger_w )
6362{
64   cpunum_set_input_line_and_vector(Machine, 1, 0, HOLD_LINE, 0xff);
63   cpunum_set_input_line_and_vector(machine, 1, 0, HOLD_LINE, 0xff);
6564}
6665
6766
src/mame/drivers/gcpinbal.c
r2454r2455
8181   switch (offset)
8282   {
8383      case 0x80/2:
84         return input_port_0_word_r(machine,0,mem_mask);   /* DSW */
84         return input_port_read_indexed(machine,0);   /* DSW */
8585
8686      case 0x84/2:
87         return input_port_1_word_r(machine,0,mem_mask);   /* IN0 */
87         return input_port_read_indexed(machine,1);   /* IN0 */
8888
8989      case 0x86/2:
90         return input_port_2_word_r(machine,0,mem_mask);   /* IN1 */
90         return input_port_read_indexed(machine,2);   /* IN1 */
9191
9292      case 0x50:
9393      case 0x51:
src/mame/drivers/realbrk.c
r2454r2455
7373   {
7474      case 0x00/2: return 0xffff;
7575      case 0x02/2: return 0xffff;
76      case 0x04/2: return input_port_0_word_r(machine,0,0);/*Service buttons*/
77      case 0x06/2: return input_port_1_word_r(machine,0,0);/*DIP 2*/
78      case 0x08/2: return input_port_2_word_r(machine,0,0);/*DIP 1*/
79      case 0x0a/2: return input_port_3_word_r(machine,0,0);/*DIP 1+2 Hi-Bits*/
80      case 0x0c/2: return input_port_4_word_r(machine,0,0);/*Handle 1p*/
81      case 0x0e/2: return input_port_5_word_r(machine,0,0);/*Buttons 1p*/
82      case 0x10/2: return input_port_6_word_r(machine,0,0);/*Handle 2p*/
83      case 0x12/2: return input_port_7_word_r(machine,0,0);/*Buttons 2p*/
76      case 0x04/2: return input_port_read_indexed(machine,0);/*Service buttons*/
77      case 0x06/2: return input_port_read_indexed(machine,1);/*DIP 2*/
78      case 0x08/2: return input_port_read_indexed(machine,2);/*DIP 1*/
79      case 0x0a/2: return input_port_read_indexed(machine,3);/*DIP 1+2 Hi-Bits*/
80      case 0x0c/2: return input_port_read_indexed(machine,4);/*Handle 1p*/
81      case 0x0e/2: return input_port_read_indexed(machine,5);/*Buttons 1p*/
82      case 0x10/2: return input_port_read_indexed(machine,6);/*Handle 2p*/
83      case 0x12/2: return input_port_read_indexed(machine,7);/*Buttons 2p*/
8484   }
8585   return 0xffff;
8686}
r2454r2455
9292   switch(offset)
9393   {
9494      case 0x00/2: return 0xffff;
95      case 0x02/2: return input_port_0_word_r(machine,0,0);/*Service buttons*/
95      case 0x02/2: return input_port_read_indexed(machine,0);/*Service buttons*/
9696      /*DSW,same handling as realbrk*/
9797      case 0x04/2:
98         if (sel & 0x01)   return   (input_port_1_word_r(machine,0,0) & 0x00ff) << 8;      // DSW1 low bits
99         if (sel & 0x02)   return   (input_port_2_word_r(machine,0,0) & 0x00ff) << 8;      // DSW2 low bits
100         if (sel & 0x04)   return   (input_port_3_word_r(machine,0,0) & 0x00ff) << 8;      // DSW3 low bits
101         if (sel & 0x08)   return   (input_port_4_word_r(machine,0,0) & 0x00ff) << 8;      // DSW4 low bits
98         if (sel & 0x01)   return   (input_port_read_indexed(machine,1) & 0x00ff) << 8;      // DSW1 low bits
99         if (sel & 0x02)   return   (input_port_read_indexed(machine,2) & 0x00ff) << 8;      // DSW2 low bits
100         if (sel & 0x04)   return   (input_port_read_indexed(machine,3) & 0x00ff) << 8;      // DSW3 low bits
101         if (sel & 0x08)   return   (input_port_read_indexed(machine,4) & 0x00ff) << 8;      // DSW4 low bits
102102
103         if (sel & 0x10)   return   ((input_port_1_word_r(machine,0,0) & 0x0300) << 0) |   // DSWs high 2 bits
104                           ((input_port_2_word_r(machine,0,0) & 0x0300) << 2) |
105                           ((input_port_3_word_r(machine,0,0) & 0x0300) << 4) |
106                           ((input_port_4_word_r(machine,0,0) & 0x0300) << 6) ;
103         if (sel & 0x10)   return   ((input_port_read_indexed(machine,1) & 0x0300) << 0) |   // DSWs high 2 bits
104                           ((input_port_read_indexed(machine,2) & 0x0300) << 2) |
105                           ((input_port_read_indexed(machine,3) & 0x0300) << 4) |
106                           ((input_port_read_indexed(machine,4) & 0x0300) << 6) ;
107107
108108         return 0xffff;
109      case 0x06/2: return input_port_6_word_r(machine,0,0);/*Buttons+Handle 2p*/
110      case 0x08/2: return input_port_5_word_r(machine,0,0);/*Buttons+Handle 1p*/
109      case 0x06/2: return input_port_read_indexed(machine,6);/*Buttons+Handle 2p*/
110      case 0x08/2: return input_port_read_indexed(machine,5);/*Buttons+Handle 1p*/
111111      case 0x0a/2: return 0xffff;
112112      case 0x0c/2: return 0xffff;
113113      case 0x0e/2: return 0xffff;
src/mame/drivers/diverboy.c
r2454r2455
4747*/
4848
4949#include "driver.h"
50#include "deprecat.h"
5150#include "sound/okim6295.h"
5251
5352extern UINT16 *diverboy_spriteram;
src/mame/drivers/superchs.c
r2454r2455
3434***************************************************************************/
3535
3636#include "driver.h"
37#include "deprecat.h"
3837#include "cpu/m68000/m68000.h"
3938#include "video/taitoic.h"
4039#include "audio/taitosnd.h"
r2454r2455
8887
8988   if (ACCESSING_BITS_8_15)
9089   {
91      cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data &0x200) ? CLEAR_LINE : ASSERT_LINE);
92      if (data&0x8000) cpunum_set_input_line(Machine, 0,3,HOLD_LINE); /* Guess */
90      cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (data &0x200) ? CLEAR_LINE : ASSERT_LINE);
91      if (data&0x8000) cpunum_set_input_line(machine, 0,3,HOLD_LINE); /* Guess */
9392   }
9493
9594   if (ACCESSING_BITS_0_7)
r2454r2455
108107   g = (a &0xff00) >> 8;
109108   b = (a &0xff);
110109
111   palette_set_color(Machine,offset,MAKE_RGB(r,g,b));
110   palette_set_color(machine,offset,MAKE_RGB(r,g,b));
112111}
113112
114113static READ32_HANDLER( superchs_input_r )
r2454r2455
116115   switch (offset)
117116   {
118117      case 0x00:
119         return (input_port_0_word_r(machine,0,0) << 16) | input_port_1_word_r(machine,0,0) |
118         return (input_port_read_indexed(machine,0) << 16) | input_port_read_indexed(machine,1) |
120119              (EEPROM_read_bit() << 7);
121120
122121      case 0x01:
r2454r2455
177176
178177static READ32_HANDLER( superchs_stick_r )
179178{
180   int fake = input_port_6_word_r(machine,0,0);
179   int fake = input_port_read_indexed(machine,6);
181180   int accel;
182181
183182   if (!(fake &0x10))   /* Analogue steer (the real control method) */
184183   {
185      steer = input_port_2_word_r(machine,0,0);
184      steer = input_port_read_indexed(machine,2);
186185   }
187186   else   /* Digital steer, with smoothing - speed depends on how often stick_r is called */
188187   {
r2454r2455
207206   }
208207
209208   /* Accelerator is an analogue input but the game treats it as digital (on/off) */
210   if (input_port_6_word_r(machine,0,0) & 0x1)   /* pressing B1 */
209   if (input_port_read_indexed(machine,6) & 0x1)   /* pressing B1 */
211210      accel = 0x0;
212211   else
213212      accel = 0xff;
214213
215214   /* Todo: Verify brake - and figure out other input */
216   return (steer << 24) | (accel << 16) | (input_port_4_word_r(machine,0,0) << 8) | input_port_5_word_r(machine,0,0);
215   return (steer << 24) | (accel << 16) | (input_port_read_indexed(machine,4) << 8) | input_port_read_indexed(machine,5);
217216}
218217
219218static WRITE32_HANDLER( superchs_stick_w )
r2454r2455
221220   /* This is guess work - the interrupts are in groups of 4, with each writing to a
222221        different byte in this long word before the RTE.  I assume all but the last
223222        (top) byte cause an IRQ with the final one being an ACK.  (Total guess but it works). */
224   if (mem_mask!=0x00ffffff)
225      cpunum_set_input_line(Machine, 0,3,HOLD_LINE);
223   if (mem_mask!=0xff000000)
224      cpunum_set_input_line(machine, 0,3,HOLD_LINE);
226225}
227226
228227/***********************************************************
src/mame/drivers/bottom9.c
r2454r2455
9797
9898static WRITE8_HANDLER( bottom9_sh_irqtrigger_w )
9999{
100   cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
100   cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);
101101}
102102
103103static int nmienable;
src/mame/drivers/flower.c
r2454r2455
5454
5555static WRITE8_HANDLER( flower_irq_ack )
5656{
57   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
57   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
5858}
5959
6060
r2454r2455
6464{
6565   sn_irq_enable = data & 1;
6666
67   cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE);
67   cpunum_set_input_line(machine, 2, 0, CLEAR_LINE);
6868}
6969
7070static INTERRUPT_GEN( sn_irq )
7171{
7272   if (sn_irq_enable)
73      cpunum_set_input_line(Machine, 2, 0, ASSERT_LINE);
73      cpunum_set_input_line(machine, 2, 0, ASSERT_LINE);
7474}
7575
7676static WRITE8_HANDLER( sn_nmi_enable_w )
src/mame/drivers/dreamwld.c
r2454r2455
3737*/
3838
3939#include "driver.h"
40#include "deprecat.h"
4140#include "sound/okim6295.h"
4241
4342#define MASTER_CLOCK 32000000
r2454r2455
212211   color = offset*2;
213212
214213   dat = paletteram32[offset]&0x7fff;
215   palette_set_color_rgb(Machine,color+1,pal5bit(dat >> 10),pal5bit(dat >> 5),pal5bit(dat >> 0));
214   palette_set_color_rgb(machine,color+1,pal5bit(dat >> 10),pal5bit(dat >> 5),pal5bit(dat >> 0));
216215
217216   dat = (paletteram32[offset]>>16)&0x7fff;
218   palette_set_color_rgb(Machine,color,pal5bit(dat >> 10),pal5bit(dat >> 5),pal5bit(dat >> 0));
217   palette_set_color_rgb(machine,color,pal5bit(dat >> 10),pal5bit(dat >> 5),pal5bit(dat >> 0));
219218
220219}
221220
src/mame/drivers/xain.c
r2454r2455
208208   switch (offset)
209209   {
210210   case 0: /* 0x3a09 - NMI clear */
211      cpunum_set_input_line(Machine, 0,INPUT_LINE_NMI,CLEAR_LINE);
211      cpunum_set_input_line(machine, 0,INPUT_LINE_NMI,CLEAR_LINE);
212212      break;
213213   case 1: /* 0x3a0a - FIRQ clear */
214      cpunum_set_input_line(Machine, 0,M6809_FIRQ_LINE,CLEAR_LINE);
214      cpunum_set_input_line(machine, 0,M6809_FIRQ_LINE,CLEAR_LINE);
215215      break;
216216   case 2: /* 0x3a0b - IRQ clear */
217      cpunum_set_input_line(Machine, 0,M6809_IRQ_LINE,CLEAR_LINE);
217      cpunum_set_input_line(machine, 0,M6809_IRQ_LINE,CLEAR_LINE);
218218      break;
219219   case 3: /* 0x3a0c - IRQB assert */
220      cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,ASSERT_LINE);
220      cpunum_set_input_line(machine, 1,M6809_IRQ_LINE,ASSERT_LINE);
221221      break;
222222   }
223223}
224224
225225static WRITE8_HANDLER( xain_irqA_assert_w )
226226{
227   cpunum_set_input_line(Machine, 0,M6809_IRQ_LINE,ASSERT_LINE);
227   cpunum_set_input_line(machine, 0,M6809_IRQ_LINE,ASSERT_LINE);
228228}
229229
230230static WRITE8_HANDLER( xain_irqB_clear_w )
231231{
232   cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,CLEAR_LINE);
232   cpunum_set_input_line(machine, 1,M6809_IRQ_LINE,CLEAR_LINE);
233233}
234234
235235static READ8_HANDLER( xain_68705_r )
r2454r2455
439439
440440static const struct YM2203interface ym2203_interface =
441441{
442   0,0,0,0,irqhandler
442   {
443      AY8910_LEGACY_OUTPUT,
444      AY8910_DEFAULT_LOADS,
445      NULL, NULL, NULL, NULL
446   },
447   irqhandler
443448};
444449
445450
src/mame/drivers/galdrvr.c
r2454r2455
47374737GAME( 1982, amidaro,  amidar,   turtles,  amidaro,  turtles,  ROT90,  "Konami (Olympia license)", "Amidar (Olympia)", GAME_SUPPORTS_SAVE )
47384738GAME( 1982, amidarb,  amidar,   turtles,  amidaru,  turtles,  ROT90,  "bootleg", "Amidar (Bootleg)", GAME_SUPPORTS_SAVE ) /* Simular to Amigo bootleg */
47394739GAME( 1982, amigo,    amidar,   turtles,  amidaru,  turtles,  ROT90,  "bootleg", "Amigo", GAME_SUPPORTS_SAVE )
4740GAME( 1982, amidars,  amidar,   theend,  amidars,  scramble, ROT90,  "Konami", "Amidar (Scramble hardware)", GAME_SUPPORTS_SAVE )
4740GAME( 1982, amidars,  amidar,   scramble, amidars,  scramble, ROT90,  "Konami", "Amidar (Scramble hardware)", GAME_SUPPORTS_SAVE )
47414741
47424742
47434743/* The End/Scramble based hardware */
47444744GAME( 1980, theend,   0,        theend,   theend,   theend,   ROT90,  "Konami", "The End", GAME_SUPPORTS_SAVE )
47454745GAME( 1980, theends,  theend,   theend,   theend,   theend,   ROT90,  "[Konami] (Stern license)", "The End (Stern)", GAME_SUPPORTS_SAVE )
47464746
4747GAME( 1981, scramble, 0,        theend,   scramble, scramble, ROT90,  "Konami", "Scramble", GAME_SUPPORTS_SAVE )
4748GAME( 1981, scrambls, scramble, theend,   scramble, scramble, ROT90,  "[Konami] (Stern license)", "Scramble (Stern)", GAME_SUPPORTS_SAVE )
4749GAME( 1981, strfbomb, scramble, theend,   strfbomb, scramble, ROT90,  "Omni", "Strafe Bomb", GAME_SUPPORTS_SAVE )
4747GAME( 1981, scramble, 0,        scramble, scramble, scramble, ROT90,  "Konami", "Scramble", GAME_SUPPORTS_SAVE )
4748GAME( 1981, scrambls, scramble, scramble, scramble, scramble, ROT90,  "[Konami] (Stern license)", "Scramble (Stern)", GAME_SUPPORTS_SAVE )
4749GAME( 1981, strfbomb, scramble, scramble, strfbomb, scramble, ROT90,  "Omni", "Strafe Bomb", GAME_SUPPORTS_SAVE )
47504750GAME( 1981, explorer, scramble, explorer, explorer, explorer, ROT90,  "bootleg", "Explorer", GAME_SUPPORTS_SAVE )
47514751
47524752GAME( 1981, atlantis, 0,        theend,   atlantis, atlantis, ROT90,  "Comsoft", "Battle of Atlantis (set 1)", GAME_SUPPORTS_SAVE )
src/mame/drivers/namcos1.c
r2454r2455
395395
396396static WRITE8_HANDLER( namcos1_sub_firq_w )
397397{
398   cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, ASSERT_LINE);
398   cpunum_set_input_line(machine, 1, M6809_FIRQ_LINE, ASSERT_LINE);
399399}
400400
401401static WRITE8_HANDLER( irq_ack_w )
402402{
403   cpunum_set_input_line(Machine, cpu_getactivecpu(), 0, CLEAR_LINE);
403   cpunum_set_input_line(machine, cpu_getactivecpu(), 0, CLEAR_LINE);
404404}
405405
406406static WRITE8_HANDLER( firq_ack_w )
407407{
408   cpunum_set_input_line(Machine, cpu_getactivecpu(), M6809_FIRQ_LINE, CLEAR_LINE);
408   cpunum_set_input_line(machine, cpu_getactivecpu(), M6809_FIRQ_LINE, CLEAR_LINE);
409409}
410410
411411
src/mame/drivers/mainevt.c
r2454r2455
8989
9090static WRITE8_HANDLER( mainevt_sh_irqtrigger_w )
9191{
92   cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
92   cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);
9393}
9494
9595static WRITE8_HANDLER( mainevt_sh_irqcontrol_w )
src/mame/drivers/m62.c
r2454r2455
281281   AM_RANGE(0x00, 0x00) AM_WRITE(irem_sound_cmd_w)
282282   AM_RANGE(0x01, 0x01) AM_WRITE(m62_flipscreen_w)   /* + coin counters */
283283   AM_RANGE(0x80, 0x80) AM_WRITE(m62_vscroll_low_w)
284   /* 0x81 used too, don't know what for */
284   AM_RANGE(0x81, 0x81) AM_WRITE(ldrun3_topbottom_mask_w)
285285ADDRESS_MAP_END
286286
287287
r2454r2455
13911391   /* video hardware */
13921392   MDRV_GFXDECODE(ldrun3)
13931393   MDRV_VIDEO_START(ldrun2)
1394   MDRV_VIDEO_UPDATE(ldrun)
1394   MDRV_VIDEO_UPDATE(ldrun3)
13951395MACHINE_DRIVER_END
13961396
13971397
src/mame/drivers/astrocde.c
r2454r2455
449449
450450static STATE_POSTLOAD( profbank_banksw_restore )
451451{
452   profpac_banksw_w(Machine, 0, profpac_bank);
452   profpac_banksw_w(machine, 0, profpac_bank);
453453}
454454
455455
r2454r2455
510510
511511static const struct AY8910interface ay8912_interface =
512512{
513   input_port_5_r
513   AY8910_LEGACY_OUTPUT,
514   AY8910_DEFAULT_LOADS,
515   input_port_5_r,
516   NULL,
517   NULL,
518   NULL
514519};
515520
516521
src/mame/drivers/megazone.c
r2454r2455
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110#include "cpu/m6809/m6809.h"
1211#include "cpu/i8039/i8039.h"
1312#include "cpu/z80/z80.h"
r2454r2455
7675
7776static WRITE8_HANDLER( megazone_i8039_irq_w )
7877{
79   cpunum_set_input_line(Machine, 2, 0, ASSERT_LINE);
78   cpunum_set_input_line(machine, 2, 0, ASSERT_LINE);
8079}
8180
8281static WRITE8_HANDLER( i8039_irqen_and_status_w )
8382{
8483   if ((data & 0x80) == 0)
85      cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE);
84      cpunum_set_input_line(machine, 2, 0, CLEAR_LINE);
8685   i8039_status = (data & 0x70) >> 4;
8786}
8887
r2454r2455
303302
304303static const struct AY8910interface ay8910_interface =
305304{
305   AY8910_LEGACY_OUTPUT,
306   AY8910_DEFAULT_LOADS,
306307   megazone_portA_r,
307   0,
308   0,
308   NULL,
309   NULL,
309310   megazone_portB_w
310311};
311312
src/mame/drivers/deco156.c
r2454r2455
1616extern void decrypt156(void);
1717
1818#include "driver.h"
19#include "deprecat.h"
2019#include "decocrpt.h"
2120#include "deco32.h"
2221#include "machine/eeprom.h"
src/mame/drivers/dwarfd.c
r2454r2455
677677
678678static const struct AY8910interface ay8910_interface =
679679{
680   AY8910_LEGACY_OUTPUT,
681   AY8910_DEFAULT_LOADS,
680682   input_port_3_r,
681683   input_port_2_r,
684   NULL,
685   NULL
682686};
683687
684688
src/mame/drivers/40love.c
r2454r2455
280280   sound_nmi_enable = 1;
281281   if (pending_nmi)
282282   {
283      cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
283      cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
284284      pending_nmi = 0;
285285   }
286286}
r2454r2455
10191019
10201020static const struct AY8910interface ay8910_interface =
10211021{
1022   0,
1023   0,
1022   AY8910_LEGACY_OUTPUT,
1023   AY8910_DEFAULT_LOADS,
1024   NULL,
1025   NULL,
10241026   sound_control_2_w,
10251027   sound_control_3_w
10261028};
src/mame/drivers/junofrst.c
r2454r2455
7878
7979
8080#include "driver.h"
81#include "deprecat.h"
8281#include "tutankhm.h"
8382#include "cpu/m6809/m6809.h"
8483#include "cpu/i8039/i8039.h"
r2454r2455
145144   if (last == 0 && data == 1)
146145   {
147146      /* setting bit 0 low then high triggers IRQ on the sound CPU */
148      cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
147      cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);
149148   }
150149
151150   last = data;
r2454r2455
154153
155154static WRITE8_HANDLER( junofrst_i8039_irq_w )
156155{
157   cpunum_set_input_line(Machine, 2, 0, ASSERT_LINE);
156   cpunum_set_input_line(machine, 2, 0, ASSERT_LINE);
158157}
159158
160159
161160static WRITE8_HANDLER( i8039_irqen_and_status_w )
162161{
163162   if ((data & 0x80) == 0)
164      cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE);
163      cpunum_set_input_line(machine, 2, 0, CLEAR_LINE);
165164   i8039_status = (data & 0x70) >> 4;
166165}
167166
r2454r2455
325324
326325static const struct AY8910interface ay8910_interface =
327326{
327   AY8910_LEGACY_OUTPUT,
328   AY8910_DEFAULT_LOADS,
328329   junofrst_portA_r,
329   0,
330   0,
330   NULL,
331   NULL,
331332   junofrst_portB_w
332333};
333334
src/mame/drivers/istellar.c
r2454r2455
2222*/
2323
2424#include "driver.h"
25#include "deprecat.h"
2625#include "render.h"
2726#include "machine/laserdsc.h"
2827
r2454r2455
102101   if (z80_2_nmi_enable)
103102   {
104103      logerror("Executing an NMI on CPU2\n");
105      cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE);      /* Maybe this is a ASSERT_LINE, CLEAR_LINE combo? */
104      cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, PULSE_LINE);      /* Maybe this is a ASSERT_LINE, CLEAR_LINE combo? */
106105      z80_2_nmi_enable = 0;
107106   }
108107}
src/mame/drivers/lasso.c
r2454r2455
2828***************************************************************************/
2929
3030#include "driver.h"
31#include "deprecat.h"
3231#include "cpu/z80/z80.h"
3332#include "lasso.h"
3433#include "sound/dac.h"
src/mame/drivers/nbmj8688.c
r2454r2455
31283128
31293129static const struct AY8910interface ay8910_interface =
31303130{
3131   AY8910_LEGACY_OUTPUT,
3132   AY8910_DEFAULT_LOADS,
31313133   nb1413m3_dipsw1_r,      // DIPSW-A read
3132   nb1413m3_dipsw2_r      // DIPSW-B read
3134   nb1413m3_dipsw2_r,      // DIPSW-B read
3135   NULL,
3136   NULL
31333137};
31343138
31353139
src/mame/drivers/psychic5.c
r2454r2455
542542
543543static const struct YM2203interface ym2203_interface =
544544{
545   0,0,0,0,irqhandler
545   {
546      AY8910_LEGACY_OUTPUT,
547      AY8910_DEFAULT_LOADS,
548      NULL, NULL, NULL, NULL
549   },
550   irqhandler
546551};
547552
548553static MACHINE_DRIVER_START( psychic5 )
src/mame/drivers/ginganin.c
r2454r2455
328328      if (MC6809_CTR > S_TEMPO)
329329      {
330330         MC6809_CTR = 0;
331         cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
331         cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
332332      }
333333      else
334334      {
src/mame/drivers/tail2nos.c
r2454r2455
252252
253253static const struct YM2608interface ym2608_interface =
254254{
255   0,
256   0,
257   0,
258   sound_bankswitch_w,
255   {
256      AY8910_LEGACY_OUTPUT,
257      AY8910_DEFAULT_LOADS,
258      NULL,
259      NULL,
260      NULL,
261      sound_bankswitch_w,
262   },
259263   irqhandler,
260264   REGION_SOUND1
261265};
src/mame/drivers/quasar.c
r2454r2455
112112{
113113   UINT8 ans = 0;
114114
115   if (IOpage == 0) ans = input_port_0_r(machine, 0);
116   if (IOpage == 1) ans = input_port_1_r(machine, 0);
117   if (IOpage == 2) ans = input_port_2_r(machine, 0);
118   if (IOpage == 3) ans = input_port_3_r(machine, 0);
115   if (IOpage == 0) ans = input_port_read_indexed(machine,0);
116   if (IOpage == 1) ans = input_port_read_indexed(machine,1);
117   if (IOpage == 2) ans = input_port_read_indexed(machine,2);
118   if (IOpage == 3) ans = input_port_read_indexed(machine,3);
119119
120120   return ans;
121121}
r2454r2455
147147   Quasar_T1 = 0;
148148
149149   // Testing ...
150   // return input_port_5_r(0);
150   // return input_port_read_indexed(machine,5);
151151
152152   // Add in sound DIP switch
153   return (Quasar_Command) + (input_port_5_r(machine, 0) & 0x30);
153   return (Quasar_Command) + (input_port_read_indexed(machine, 5) & 0x30);
154154}
155155
156156static READ8_HANDLER( Quasar_T1_r )
src/mame/drivers/meritm.c
r2454r2455
4646  - blinking on Meagtouch title screen is probably incorrect
4747  - clean up V9938 interrupt implementation
4848  - finish inputs, dsw, outputs (lamps)
49  - calibration mode in Microtouch emulation (command CX)
5049  - problem with registering touches on the bottom of the screen (currently hacked to work)
5150  - megat3: u37 has bad size, should be 8MBit
5251  - megat4: rom u32 was bad, currently using u32 from megat4te
r2454r2455
6261#include "machine/8255ppi.h"
6362#include "machine/z80pio.h"
6463#include "machine/pc16552d.h"
64#include "machine/microtch.h"
6565
6666/*************************************
6767 *
r2454r2455
201201
202202/*************************************
203203 *
204 *  Microtouch touch screen controller
205 *
206 *************************************/
207
208static struct
209{
210   UINT8      tx_buffer[16];
211   int      tx_buffer_ptr;
212   emu_timer*   timer;
213   int      reset_done;
214   int      format_tablet;
215   int      mode_inactive;
216   int      mode_stream;
217   int      last_touch_state;
218   int      last_x;
219   int      last_y;
220   void      (*tx_callback)(UINT8 data);
221   int      (*touch_callback)(int *touch_x, int *touch_y);
222} microtouch;
223
224
225static int microtouch_check_command( const char* commandtocheck, int command_len, UINT8* command_data )
226  {
227   if ( (command_len == (strlen(commandtocheck) + 2)) &&
228       (command_data[0] == 0x01) &&
229       (strncmp(commandtocheck, (const char*)command_data + 1, strlen(commandtocheck)) == 0) &&
230       (command_data[command_len-1] == 0x0d) )
231   {
232      return 1;
233   }
234   else
235   {
236      return 0;
237   }
238  }
239
240static void microtouch_send_format_table_packet(UINT8 flag, int x, int y)
241{
242   microtouch.tx_callback(flag);
243   // lower byte (7bits) of x coordinate
244   microtouch.tx_callback(x & 0x7f);
245   // higher byte (7bits) of x coordinate
246   microtouch.tx_callback((x >> 7) & 0x7f);
247   // lower byte (7bits) of y coordinate
248   microtouch.tx_callback(y & 0x7f);
249   // higher byte (7bits) of y coordinate
250   microtouch.tx_callback((y >> 7) & 0x7f);
251};
252
253static TIMER_CALLBACK(microtouch_timer_callback)
254{
255   if ( (microtouch.reset_done == 0) ||
256       (microtouch.format_tablet == 0) ||
257       (microtouch.mode_inactive == 1) ||
258       (microtouch.mode_stream == 0) )
259   {
260      return;
261   }
262
263   // send format tablet packet
264   if ( input_port_read(machine, "TOUCH") & 0x01 )
265   {
266      int tx = input_port_read(machine, "TOUCH_X");
267      int ty = input_port_read(machine, "TOUCH_Y");
268
269      if ( microtouch.touch_callback == NULL ||
270          microtouch.touch_callback( &tx, &ty ) != 0 )
271      {
272         ty = 0x4000 - ty;
273
274         microtouch_send_format_table_packet(0xc0, tx, ty);
275         microtouch.last_touch_state = 1;
276         microtouch.last_x = tx;
277         microtouch.last_y = ty;
278      }
279   }
280   else
281   {
282      if ( microtouch.last_touch_state == 1 )
283      {
284         microtouch.last_touch_state = 0;
285         microtouch_send_format_table_packet(0x80, microtouch.last_x, microtouch.last_y);
286      }
287   }
288};
289
290static void microtouch_init(void (*tx_cb)(UINT8 data),
291                     int (*touch_cb)(int *touch_x, int *touch_y))
292{
293   memset(&microtouch, 0, sizeof(microtouch));
294
295   microtouch.last_touch_state = -1;
296   microtouch.tx_callback = tx_cb;
297   microtouch.touch_callback = touch_cb;
298
299   microtouch.timer = timer_alloc(microtouch_timer_callback, NULL);
300   timer_adjust_periodic(microtouch.timer, ATTOTIME_IN_HZ(167), 0, ATTOTIME_IN_HZ(167));
301
302   state_save_register_item("microtouch", 0, microtouch.reset_done);
303   state_save_register_item("microtouch", 0, microtouch.format_tablet);
304   state_save_register_item("microtouch", 0, microtouch.mode_inactive);
305   state_save_register_item("microtouch", 0, microtouch.mode_stream);
306   state_save_register_item("microtouch", 0, microtouch.last_touch_state);
307   state_save_register_item("microtouch", 0, microtouch.last_x);
308   state_save_register_item("microtouch", 0, microtouch.last_y);
309   state_save_register_item_array("microtouch", 0, microtouch.tx_buffer);
310   state_save_register_item("microtouch", 0, microtouch.tx_buffer_ptr);
311
312};
313
314
315static void microtouch_rx(int count, UINT8* data)
316{
317   int i;
318
319   for ( i = 0; (i < count) && ((microtouch.tx_buffer_ptr + i) < 16); i++ )
320   {
321      microtouch.tx_buffer[i+microtouch.tx_buffer_ptr] = data[i];
322      microtouch.tx_buffer_ptr++;
323   }
324
325   if (microtouch.tx_buffer_ptr > 0 && (microtouch.tx_buffer[microtouch.tx_buffer_ptr-1] == 0x0d))
326   {
327      // check command
328      if ( microtouch_check_command( "MS", microtouch.tx_buffer_ptr, microtouch.tx_buffer ) )
329      {
330         microtouch.mode_stream = 1;
331         microtouch.mode_inactive = 0;
332      }
333      else if ( microtouch_check_command( "MI", microtouch.tx_buffer_ptr, microtouch.tx_buffer ) )
334      {
335         microtouch.mode_inactive = 1;
336      }
337      else if ( microtouch_check_command( "R", microtouch.tx_buffer_ptr, microtouch.tx_buffer ) )
338      {
339         microtouch.reset_done = 1;
340      }
341      else if ( microtouch_check_command( "FT", microtouch.tx_buffer_ptr, microtouch.tx_buffer ) )
342      {
343         microtouch.format_tablet = 1;
344      }
345      // send response
346      microtouch.tx_callback(0x01);
347      microtouch.tx_callback(0x30);
348      microtouch.tx_callback(0x0d);
349      microtouch.tx_buffer_ptr = 0;
350   }
351};
352
353static INPUT_PORTS_START(microtouch)
354   PORT_START_TAG("TOUCH")
355   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_IMPULSE(10) PORT_NAME( "Touch screen" )
356   PORT_START_TAG("TOUCH_X")
357   PORT_BIT( 0x3fff, 0x2000, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(45) PORT_KEYDELTA(15)
358   PORT_START_TAG("TOUCH_Y")
359   PORT_BIT( 0x3fff, 0x2000, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(45) PORT_KEYDELTA(15)
360INPUT_PORTS_END
361
362/*************************************
363 *
364204 *  Microtouch <-> pc16650 interface
365205 *
366206 *************************************/
r2454r2455
696536   AM_RANGE(0x21, 0x21) AM_READWRITE(v9938_1_status_r, v9938_1_command_w)
697537   AM_RANGE(0x22, 0x22) AM_WRITE(v9938_1_palette_w)
698538   AM_RANGE(0x23, 0x23) AM_WRITE(v9938_1_register_w)
699   AM_RANGE(0x30, 0x33) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
539   AM_RANGE(0x30, 0x33) AM_DEVREADWRITE(PPI8255, "ppi8255", ppi8255_r, ppi8255_w)
700540   AM_RANGE(0x40, 0x43) AM_READWRITE(z80pio_0_r, z80pio_0_w)
701541   AM_RANGE(0x50, 0x53) AM_READWRITE(z80pio_1_r, z80pio_1_w)
702542   AM_RANGE(0x80, 0x80) AM_READWRITE(AY8910_read_port_0_r, AY8910_control_port_0_w)
r2454r2455
722562   AM_RANGE(0x21, 0x21) AM_READWRITE(v9938_1_status_r, v9938_1_command_w)
723563   AM_RANGE(0x22, 0x22) AM_WRITE(v9938_1_palette_w)
724564   AM_RANGE(0x23, 0x23) AM_WRITE(v9938_1_register_w)
725   AM_RANGE(0x30, 0x33) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
565   AM_RANGE(0x30, 0x33) AM_DEVREADWRITE(PPI8255, "ppi8255", ppi8255_r, ppi8255_w)
726566   AM_RANGE(0x40, 0x43) AM_READWRITE(z80pio_0_r, z80pio_0_w)
727567   AM_RANGE(0x50, 0x53) AM_READWRITE(z80pio_1_r, z80pio_1_w)
728568   AM_RANGE(0x60, 0x67) AM_READWRITE(pc16552d_0_r,pc16552d_0_w)
r2454r2455
831671
832672static const ppi8255_interface crt260_ppi8255_intf =
833673{
834   1,
835   { 0 }, /* Port A read */
836   { 0 }, /* Port B read */
837   { meritm_8255_port_c_r }, /* Port C read */
838   { 0 }, /* Port A write (used) */
839   { 0 }, /* Port B write (used LMP x DRIVE) */
840   { 0 }  /* Port C write */
674   NULL,                  /* Port A read */
675   NULL,                  /* Port B read */
676   meritm_8255_port_c_r,      /* Port C read */
677   NULL,                  /* Port A write (used) */
678   NULL,                  /* Port B write (used LMP x DRIVE) */
679   NULL                  /* Port C write */
841680};
842681
843682static const ppi8255_interface crt250_ppi8255_intf =
844683{
845   1,
846   { 0 }, /* Port A read */
847   { 0 }, /* Port B read */
848   { meritm_8255_port_c_r }, /* Port C read */
849   { 0 }, /* Port A write (used) */
850   { meritm_crt250_port_b_w }, /* Port B write (used LMP x DRIVE) */
851   { 0 }  /* Port C write */
684   NULL,                  /* Port A read */
685   NULL,                  /* Port B read */
686   meritm_8255_port_c_r,      /* Port C read */
687   NULL,                  /* Port A write (used) */
688   meritm_crt250_port_b_w,      /* Port B write (used LMP x DRIVE) */
689   NULL                  /* Port C write */
852690};
853691
854692/*************************************
r2454r2455
874712
875713static const struct AY8910interface ay8910_interface =
876714{
715   AY8910_LEGACY_OUTPUT,
716   AY8910_DEFAULT_LOADS,
877717   meritm_ay8930_port_a_r, /* Port A read */
878   0, /* Port B read */
879   0, /* Port A write */
718   NULL, /* Port B read */
719   NULL, /* Port A write */
880720   meritm_ay8930_port_b_w  /* Port B write */
881721};
882722
r2454r2455
984824
985825static MACHINE_START(meritm_crt250)
986826{
987   ppi8255_init(&crt250_ppi8255_intf);
988827   memory_configure_bank(1, 0, 8, memory_region(REGION_CPU1), 0x10000);
989828   meritm_bank = 0xff;
990829   meritm_crt250_switch_banks();
r2454r2455
1001840
1002841static MACHINE_START(meritm_crt260)
1003842{
1004   ppi8255_init(&crt260_ppi8255_intf);
1005843   meritm_ram = auto_malloc( 0x8000 );
1006844   memset( meritm_ram, 0x8000, 0x00 );
1007845   memory_configure_bank(1, 0, 128, memory_region(REGION_CPU1), 0x8000);
r2454r2455
1047885
1048886   MDRV_MACHINE_START(meritm_crt250)
1049887
888   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
889   MDRV_DEVICE_CONFIG( crt250_ppi8255_intf )
890
1050891   MDRV_NVRAM_HANDLER(generic_0fill)
1051892
1052893   MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
r2454r2455
1085926   MDRV_CPU_PROGRAM_MAP(meritm_map,0)
1086927   MDRV_CPU_IO_MAP(meritm_io_map,0)
1087928
929   MDRV_DEVICE_MODIFY( "ppi8255", PPI8255 )
930   MDRV_DEVICE_CONFIG( crt260_ppi8255_intf )
931
1088932   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_MSEC(1200))   // DS1232, TD connected to VCC
1089933   MDRV_MACHINE_START(meritm_crt260)
1090934
src/mame/drivers/slapshot.c
r2454r2455
171171      g = (color_ram[offset] &0xff00) >> 8;
172172      b = (color_ram[offset] &0xff);
173173
174      palette_set_color(Machine,offset/2,MAKE_RGB(r,g,b));
174      palette_set_color(machine,offset/2,MAKE_RGB(r,g,b));
175175   }
176176}
177177
r2454r2455
202202   switch (offset)
203203   {
204204      case 0x03:
205         return ((input_port_3_word_r(machine,0,0) & 0xef) |
206              (input_port_5_word_r(machine,0,0) & 0x10))  << 8;   /* IN3 + service switch */
205         return ((input_port_read_indexed(machine,3) & 0xef) |
206              (input_port_read_indexed(machine,5) & 0x10))  << 8;   /* IN3 + service switch */
207207
208208      default:
209209         return TC0640FIO_r(machine,offset) << 8;
r2454r2455
218218static WRITE16_HANDLER( opwolf3_adc_req_w )
219219{
220220   /* 4 writes a frame - one for each analogue port */
221   cpunum_set_input_line(Machine, 0,3,HOLD_LINE);
221   cpunum_set_input_line(machine, 0,3,HOLD_LINE);
222222}
223223
224224/*****************************************************
src/mame/drivers/xyonix.c
r2454r2455
2020******************************************************************************/
2121
2222#include "driver.h"
23#include "deprecat.h"
2423#include "cpu/z80/z80.h"
2524#include "sound/sn76496.h"
2625
r2454r2455
3534
3635static WRITE8_HANDLER( xyonix_irqack_w )
3736{
38   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
37   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
3938}
4039
4140
src/mame/drivers/cninja.c
r2454r2455
9696      return cninja_scanline;
9797
9898   case 2: /* Raster IRQ ACK - value read is not used */
99      cpunum_set_input_line(Machine, 0, 3, CLEAR_LINE);
100      cpunum_set_input_line(Machine, 0, 4, CLEAR_LINE);
99      cpunum_set_input_line(machine, 0, 3, CLEAR_LINE);
100      cpunum_set_input_line(machine, 0, 4, CLEAR_LINE);
101101      return 0;
102102   }
103103
src/mame/drivers/pacland.c
r2454r2455
173173***************************************************************************/
174174
175175#include "driver.h"
176#include "deprecat.h"
177176#include "cpu/m6800/m6800.h"
178177#include "sound/namco.h"
179178
r2454r2455
194193static WRITE8_HANDLER( pacland_subreset_w )
195194{
196195   int bit = !BIT(offset,11);
197   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
196   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
198197}
199198
200199static WRITE8_HANDLER( pacland_flipscreen_w )
r2454r2455
233232   int bit = !BIT(offset,11);
234233   cpu_interrupt_enable(0,bit);
235234   if (!bit)
236      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
235      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
237236}
238237
239238static WRITE8_HANDLER( pacland_irq_2_ctrl_w )
r2454r2455
241240   int bit = !BIT(offset,13);
242241   cpu_interrupt_enable(1,bit);
243242   if (!bit)
244      cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
243      cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
245244}
246245
247246
src/mame/drivers/psikyo4.c
r2454r2455
256256   g = ((paletteram32[offset] & 0x00ff0000) >>16);
257257   r = ((paletteram32[offset] & 0xff000000) >>24);
258258
259   palette_set_color(Machine,offset,MAKE_RGB(r,g,b));
260   palette_set_color(Machine,offset+0x800,MAKE_RGB(r,g,b)); // For screen 2
259   palette_set_color(machine,offset,MAKE_RGB(r,g,b));
260   palette_set_color(machine,offset+0x800,MAKE_RGB(r,g,b)); // For screen 2
261261}
262262
263263static WRITE32_HANDLER( ps4_bgpen_1_dword_w )
r2454r2455
269269   g = ((bgpen_1[0] & 0x00ff0000) >>16);
270270   r = ((bgpen_1[0] & 0xff000000) >>24);
271271
272   palette_set_color(Machine,0x1000,MAKE_RGB(r,g,b)); // Clear colour for screen 1
272   palette_set_color(machine,0x1000,MAKE_RGB(r,g,b)); // Clear colour for screen 1
273273}
274274
275275static WRITE32_HANDLER( ps4_bgpen_2_dword_w )
r2454r2455
281281   g = ((bgpen_2[0] & 0x00ff0000) >>16);
282282   r = ((bgpen_2[0] & 0xff000000) >>24);
283283
284   palette_set_color(Machine,0x1001,MAKE_RGB(r,g,b)); // Clear colour for screen 2
284   palette_set_color(machine,0x1001,MAKE_RGB(r,g,b)); // Clear colour for screen 2
285285}
286286
287287static WRITE32_HANDLER( ps4_screen1_brt_w )
r2454r2455
299299         int i;
300300
301301         for (i = 0; i < 0x800; i++)
302            palette_set_brightness(Machine,i,brt1);
302            palette_set_brightness(machine,i,brt1);
303303
304304         oldbrt1 = brt1;
305305      }
306306   } else {
307307      /* I believe this to be seperate rgb brightness due to strings in hotdebut, unused in 4 dumped games */
308      if((data & ~mem_mask) != 0)
308      if((data & mem_mask) != 0)
309309         logerror("Unk Scr 1 rgb? brt write %08x mask %08x\n", data, mem_mask);
310310   }
311311}
r2454r2455
326326         int i;
327327
328328         for (i = 0x800; i < 0x1000; i++)
329            palette_set_brightness(Machine,i,brt2);
329            palette_set_brightness(machine,i,brt2);
330330
331331         oldbrt2 = brt2;
332332      }
333333   } else {
334334      /* I believe this to be seperate rgb brightness due to strings in hotdebut, unused in 4 dumped games */
335      if((data & ~mem_mask) != 0)
335      if((data & mem_mask) != 0)
336336         logerror("Unk Scr 2 rgb? brt write %08x mask %08x\n", data, mem_mask);
337337   }
338338}
src/mame/drivers/wardner.c
r2454r2455
174174
175175STATE_POSTLOAD( wardner_restore_bank )
176176{
177   wardner_ramrom_bank_sw(Machine,0,1);   /* Dummy value to ensure restoration */
178   wardner_ramrom_bank_sw(Machine,0,wardner_membank);
177   wardner_ramrom_bank_sw(machine,0,1);   /* Dummy value to ensure restoration */
178   wardner_ramrom_bank_sw(machine,0,wardner_membank);
179179}
180180
181181
src/mame/drivers/jcross.c
r2454r2455
1717*/
1818
1919#include "driver.h"
20#include "deprecat.h"
2120#include "cpu/z80/z80.h"
2221#include "snk.h"
2322#include "sound/ay8910.h"
r2454r2455
6766
6867static READ8_HANDLER( sound_nmi_ack_r )
6968{
70   cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, CLEAR_LINE);
69   cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, CLEAR_LINE);
7170   return 0;
7271}
7372
src/mame/drivers/missile.c
r2454r2455
607607
608608   /* color RAM */
609609   else if (offset >= 0x4b00 && offset < 0x4c00)
610      palette_set_color_rgb(Machine, offset & 7, pal1bit(~data >> 3), pal1bit(~data >> 2), pal1bit(~data >> 1));
610      palette_set_color_rgb(machine, offset & 7, pal1bit(~data >> 3), pal1bit(~data >> 2), pal1bit(~data >> 1));
611611
612612   /* watchdog */
613613   else if (offset >= 0x4c00 && offset < 0x4d00)
r2454r2455
618618   {
619619      if (irq_state)
620620      {
621         cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
621         cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
622622         irq_state = 0;
623623      }
624624   }
src/mame/drivers/ddrible.c
r2454r2455
328328
329329static const struct YM2203interface ym2203_interface =
330330{
331   0,
332   ddrible_vlm5030_busy_r,
333   ddrible_vlm5030_ctrl_w,
334   0
331   {
332      AY8910_LEGACY_OUTPUT,
333      AY8910_DEFAULT_LOADS,
334      NULL,
335      ddrible_vlm5030_busy_r,
336      ddrible_vlm5030_ctrl_w,
337      NULL
338   },
339   NULL
335340};
336341
337342static const struct VLM5030interface vlm5030_interface =
src/mame/drivers/popper.c
r2454r2455
150150
151151static READ8_HANDLER( popper_soundcpu_nmi_r )
152152{
153   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
153   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
154154   return 0;
155155}
156156
src/mame/drivers/ladyfrog.c
r2454r2455
8686
8787static WRITE8_HANDLER( sound_cpu_reset_w )
8888{
89   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data&1 )? ASSERT_LINE : CLEAR_LINE);
89   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data&1 )? ASSERT_LINE : CLEAR_LINE);
9090}
9191
9292static TIMER_CALLBACK( nmi_callback )
r2454r2455
111111   sound_nmi_enable = 1;
112112   if (pending_nmi)
113113   {
114      cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE);
114      cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
115115      pending_nmi = 0;
116116   }
117117}
r2454r2455
123123
124124static const struct AY8910interface ay8910_interface =
125125{
126   0,
127   0,
126   AY8910_LEGACY_OUTPUT,
127   AY8910_DEFAULT_LOADS,
128   NULL,
129   NULL,
128130   unk_w,
129131   unk_w
130132};
src/mame/drivers/djboy.c
r2454r2455
657657
658658static WRITE8_HANDLER( trigger_nmi_on_cpu0 )
659659{
660   cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE);
660   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
661661}
662662
663663static WRITE8_HANDLER( cpu0_bankswitch_w )
src/mame/drivers/sidearms.c
r2454r2455
705705
706706static const struct YM2203interface ym2203_interface =
707707{
708   0,0,0,0,irqhandler
708   {
709         AY8910_LEGACY_OUTPUT,
710         AY8910_DEFAULT_LOADS,
711         NULL, NULL, NULL, NULL,
712   },
713   irqhandler
709714};
710715
711716static const struct YM2151interface whizz_ym2151_interface =
src/mame/drivers/jack.c
r2454r2455
865865
866866static const struct AY8910interface ay8910_interface =
867867{
868   AY8910_LEGACY_OUTPUT,
869   AY8910_DEFAULT_LOADS,
868870   soundlatch_r,
869871   timer_r
870872};
src/mame/drivers/dogfgt.c
r2454r2455
3131   /* bit 0 used but unknown */
3232
3333   if (data & 0x04)
34      cpunum_set_input_line(Machine, 1,0,ASSERT_LINE);
34      cpunum_set_input_line(machine, 1,0,ASSERT_LINE);
3535}
3636
3737static WRITE8_HANDLER( sub_irqack_w )
3838{
39   cpunum_set_input_line(Machine, 1,0,CLEAR_LINE);
39   cpunum_set_input_line(machine, 1,0,CLEAR_LINE);
4040}
4141
4242
src/mame/drivers/taitosj.c
r2454r2455
164164***************************************************************************/
165165
166166#include "driver.h"
167#include "deprecat.h"
168167#include "cpu/z80/z80.h"
169168#include "cpu/m6805/m6805.h"
170169#include "sound/ay8910.h"
r2454r2455
18261825
18271826static const struct AY8910interface ay8910_interface_1 =
18281827{
1828   AY8910_LEGACY_OUTPUT,
1829   AY8910_DEFAULT_LOADS,
18291830   input_port_6_r,
1830   input_port_7_r
1831   input_port_7_r,
1832   NULL,
1833   NULL
18311834};
18321835
18331836static const struct AY8910interface ay8910_interface_2 =
18341837{
1835   0,
1836   0,
1838   AY8910_LEGACY_OUTPUT,
1839   AY8910_DEFAULT_LOADS,
1840   NULL,
1841   NULL,
18371842   dac_out_w,   /* port Awrite */
18381843   dac_vol_w   /* port Bwrite */
18391844};
18401845
18411846static const struct AY8910interface ay8910_interface_3 =
18421847{
1843   0,
1844   0,
1848   AY8910_LEGACY_OUTPUT,
1849   AY8910_DEFAULT_LOADS,
1850   NULL,
1851   NULL,
18451852   input_port_4_f0_w,
1846   0
1853   NULL
18471854};
18481855
18491856static const struct AY8910interface ay8910_interface_4 =
18501857{
1851   0,
1852   0,
1853   0,
1858   AY8910_LEGACY_OUTPUT,
1859   AY8910_DEFAULT_LOADS,
1860   NULL,
1861   NULL,
1862   NULL,
18541863   taitosj_sndnmi_msk_w   /* port Bwrite */
18551864};
18561865
src/mame/drivers/vigilant.c
r2454r2455
516516
517517static const struct YM2203interface ym2203_interface =
518518{
519   0,0,0,0,m72_ym2151_irq_handler
519   {
520      AY8910_LEGACY_OUTPUT,
521      AY8910_DEFAULT_LOADS,
522      NULL, NULL, NULL, NULL
523   },
524   m72_ym2151_irq_handler
520525};
521526
522527
src/mame/drivers/kingobox.c
r2454r2455
1616***************************************************************************/
1717
1818#include "driver.h"
19#include "deprecat.h"
2019#include "sound/ay8910.h"
2120#include "sound/dac.h"
2221
r2454r2455
539538
540539static const struct AY8910interface ay8910_interface =
541540{
541   AY8910_LEGACY_OUTPUT,
542   AY8910_DEFAULT_LOADS,
542543   soundlatch_r
543544};
544545
src/mame/drivers/nbmj8991.c
r2454r2455
17491749
17501750static const struct AY8910interface ay8910_interface =
17511751{
1752   AY8910_LEGACY_OUTPUT,
1753   AY8910_DEFAULT_LOADS,
17521754   input_port_0_r,      // DIPSW-A read
1753   input_port_1_r      // DIPSW-B read
1755   input_port_1_r,      // DIPSW-B read
1756   NULL,
1757   NULL
17541758};
17551759
17561760
src/mame/drivers/ettrivia.c
r2454r2455
209209
210210static const struct AY8910interface ay8912_interface_2 =
211211{
212   input_port_1_r
212   AY8910_LEGACY_OUTPUT,
213   AY8910_DEFAULT_LOADS,
214   input_port_1_r,
215   NULL,
216   NULL,
217   NULL
213218};
214219
215220static const struct AY8910interface ay8912_interface_3 =
216221{
217   input_port_0_r
222   AY8910_LEGACY_OUTPUT,
223   AY8910_DEFAULT_LOADS,
224   input_port_0_r,
225   NULL,
226   NULL,
227   NULL
218228};
219229
220230
src/mame/drivers/splash.c
r2454r2455
474474
475475static const struct YM2203interface ym2203_interface =
476476{
477   0,0,0,0,ym_irq
477   {
478      AY8910_LEGACY_OUTPUT,
479      AY8910_DEFAULT_LOADS,
480      NULL, NULL, NULL, NULL
481   },
482   ym_irq
478483};
479484
480485static MACHINE_DRIVER_START( roldfrog )
src/mame/drivers/jalmah.c
r2454r2455
202202{
203203   static UINT16 prg_prot;
204204
205   if((0xffff - input_port_0_word_r(machine,0,0)) & 0x0008)//service_mode
205   if((0xffff - input_port_read_indexed(machine,0)) & 0x0008)//service_mode
206206   {
207      jm_regs[0x000/2] = input_port_2_word_r(machine,0,0);
208      jm_regs[0x002/2] = input_port_3_word_r(machine,0,0);
209      jm_regs[0x004/2] = input_port_4_word_r(machine,0,0);
210      jm_regs[0x006/2] = input_port_5_word_r(machine,0,0);
211      jm_regs[0x008/2] = input_port_6_word_r(machine,0,0);
212      jm_regs[0x00a/2] = input_port_7_word_r(machine,0,0);
207      jm_regs[0x000/2] = input_port_read_indexed(machine,2);
208      jm_regs[0x002/2] = input_port_read_indexed(machine,3);
209      jm_regs[0x004/2] = input_port_read_indexed(machine,4);
210      jm_regs[0x006/2] = input_port_read_indexed(machine,5);
211      jm_regs[0x008/2] = input_port_read_indexed(machine,6);
212      jm_regs[0x00a/2] = input_port_read_indexed(machine,7);
213213   }
214214   else
215215   {
r2454r2455
247247{
248248   static UINT16 prg_prot;
249249
250   if((0xffff - input_port_0_word_r(machine,0,0)) & 0x0008)//service_mode
250   if((0xffff - input_port_read_indexed(machine,0)) & 0x0008)//service_mode
251251   {
252      jm_regs[0x300/2] = input_port_2_word_r(machine,0,0);
253      jm_regs[0x302/2] = input_port_3_word_r(machine,0,0);
254      jm_regs[0x304/2] = input_port_4_word_r(machine,0,0);
255      jm_regs[0x306/2] = input_port_5_word_r(machine,0,0);
256      jm_regs[0x308/2] = input_port_6_word_r(machine,0,0);
257      jm_regs[0x30a/2] = input_port_7_word_r(machine,0,0);
252      jm_regs[0x300/2] = input_port_read_indexed(machine,2);
253      jm_regs[0x302/2] = input_port_read_indexed(machine,3);
254      jm_regs[0x304/2] = input_port_read_indexed(machine,4);
255      jm_regs[0x306/2] = input_port_read_indexed(machine,5);
256      jm_regs[0x308/2] = input_port_read_indexed(machine,6);
257      jm_regs[0x30a/2] = input_port_read_indexed(machine,7);
258258   }
259259   else
260260   {
r2454r2455
289289
290290static void second_mcu_run(running_machine *machine)
291291{
292   if((0xffff - input_port_1_word_r(machine,0,0)) & 0x0004)//service_mode
292   if((0xffff - input_port_read_indexed(machine,1)) & 0x0004)//service_mode
293293   {
294      jm_regs[0x200/2] = input_port_2_word_r(machine,0,0);
295      jm_regs[0x202/2] = input_port_3_word_r(machine,0,0);
296      jm_regs[0x204/2] = input_port_4_word_r(machine,0,0);
294      jm_regs[0x200/2] = input_port_read_indexed(machine,2);
295      jm_regs[0x202/2] = input_port_read_indexed(machine,3);
296      jm_regs[0x204/2] = input_port_read_indexed(machine,4);
297297   }
298298   else
299299   {
src/mame/drivers/lvcards.c
r2454r2455
458458
459459static const struct AY8910interface lcay8910_interface =
460460{
461   AY8910_LEGACY_OUTPUT,
462   AY8910_DEFAULT_LOADS,
461463   input_port_3_r, //DSW0
462   input_port_4_r  //DSW1
464   input_port_4_r,  //DSW1
465   NULL,
466   NULL
463467};
464468
465469
src/mame/drivers/route16.c
r2454r2455
569569
570570static const struct AY8910interface stratvox_ay8910_interface =
571571{
572   0,
573   0,
572   AY8910_LEGACY_OUTPUT,
573   AY8910_DEFAULT_LOADS,
574   NULL,
575   NULL,
574576   stratvox_sn76477_w,  /* SN76477 commands (not used in Route 16?) */
575   0
577   NULL
576578};
577579
578580
src/mame/drivers/exzisus.c
r2454r2455
132132
133133static WRITE8_HANDLER( exzisus_cpub_reset_w )
134134{
135   cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, PULSE_LINE);
135   cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, PULSE_LINE);
136136}
137137
138138#if 0
src/mame/drivers/exidy440.c
r2454r2455
434434
435435static READ8_HANDLER( topsecex_input_port_5_r )
436436{
437   return (input_port_5_r(machine, offset) & 1) ? 0x01 : 0x02;
437   return (input_port_read_indexed(machine, 5) & 1) ? 0x01 : 0x02;
438438}
439439
440440
src/mame/drivers/tx1.c
r2454r2455
4141***************************************************************************/
4242
4343#include "driver.h"
44#include "deprecat.h"
4544#include "sound/ay8910.h"
4645#include "sound/custom.h"
4746#include "cpu/i86/i86.h"
r2454r2455
6362/* Main CPU and Z80 synchronisation */
6463static WRITE16_HANDLER( z80_busreq_w )
6564{
66   cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
65   cpunum_set_input_line(machine, 2, INPUT_LINE_HALT, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
6766}
6867
6968static WRITE16_HANDLER( resume_math_w )
7069{
71   cpunum_set_input_line(Machine, 1, INPUT_LINE_TEST, ASSERT_LINE);
70   cpunum_set_input_line(machine, 1, INPUT_LINE_TEST, ASSERT_LINE);
7271}
7372
7473static WRITE16_HANDLER( halt_math_w )
7574{
76   cpunum_set_input_line(Machine, 1, INPUT_LINE_TEST, CLEAR_LINE);
75   cpunum_set_input_line(machine, 1, INPUT_LINE_TEST, CLEAR_LINE);
7776}
7877
7978/* Z80 can trigger an interrupt itself */
8079static WRITE8_HANDLER( z80_intreq_w )
8180{
82   cpunum_set_input_line(Machine, 2, 0, HOLD_LINE);
81   cpunum_set_input_line(machine, 2, 0, HOLD_LINE);
8382}
8483
8584/* Periodic Z80 interrupt */
r2454r2455
466465   AM_RANGE(0x0000, 0x1fff) AM_ROM
467466   AM_RANGE(0x3000, 0x37ff) AM_RAM AM_MIRROR(0x800) AM_BASE(&z80_ram)
468467   AM_RANGE(0x4000, 0x4000) AM_WRITE(z80_intreq_w)
469   AM_RANGE(0x5000, 0x5003) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
468   AM_RANGE(0x5000, 0x5003) AM_DEVREADWRITE(PPI8255, "ppi8255", ppi8255_r, ppi8255_w)
470469   AM_RANGE(0x6000, 0x6003) AM_READWRITE(tx1_pit8253_r, tx1_pit8253_w)
471470   AM_RANGE(0x7000, 0x7fff) AM_WRITE(tx1_ppi_latch_w)
472471   AM_RANGE(0xb000, 0xbfff) AM_READWRITE(ts_r, ts_w)
r2454r2455
560559   AM_RANGE(0x0000, 0x3fff) AM_ROM
561560   AM_RANGE(0x4000, 0x47ff) AM_RAM AM_BASE(&z80_ram)
562561   AM_RANGE(0x6000, 0x6001) AM_READ(bb_analog_r)
563   AM_RANGE(0x6800, 0x6803) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
562   AM_RANGE(0x6800, 0x6803) AM_DEVREADWRITE(PPI8255, "ppi8255", ppi8255_r, ppi8255_w)
564563   AM_RANGE(0x7000, 0x7003) AM_RAM
565564   AM_RANGE(0x7800, 0x7800) AM_WRITE(z80_intreq_w)
566565   AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(ts_r, ts_w)
r2454r2455
620619
621620static const struct AY8910interface tx1_ay8910_interface =
622621{
623   0,
624   0,
622   AY8910_LEGACY_OUTPUT,
623   AY8910_DEFAULT_LOADS,
624   NULL,
625   NULL,
625626   tx1_ay8910_a_w,
626627   tx1_ay8910_b_w,
627628};
r2454r2455
630631/* YM2149 IC19 */
631632static const struct AY8910interface buggyboy_ym2149_interface_1 =
632633{
634   AY8910_LEGACY_OUTPUT,
635   AY8910_DEFAULT_LOADS,
633636   input_port_1_r,
634637   input_port_2_r,
635   0,
636   0,
638   NULL,
639   NULL,
637640};
638641
639642/* YM2149 IC24 */
640643static const struct AY8910interface buggyboy_ym2149_interface_2 =
641644{
642   0,
643   0,
645   AY8910_LEGACY_OUTPUT,
646   AY8910_DEFAULT_LOADS,
647   NULL,
648   NULL,
644649   bb_ym1_a_w,
645650   bb_ym1_b_w,
646651};
r2454r2455
651656   coin_counter_w(1, data & 0x40);
652657}
653658
654const ppi8255_interface tx1_ppi8255_intf =
659static const ppi8255_interface tx1_ppi8255_intf =
655660{
656   1,
657   { tx1_ppi_porta_r },
658   { tx1_ppi_portb_r },
659   { input_port_4_r },
660   { 0 },
661   { 0 },
662   { tx1_coin_cnt },
661   tx1_ppi_porta_r,
662   tx1_ppi_portb_r,
663   input_port_4_r,
664   NULL,
665   NULL,
666   tx1_coin_cnt
663667};
664668
665669static const struct CustomSound_interface tx1_custom_interface =
r2454r2455
670674};
671675
672676/* Buggy Boy uses an 8255 PPI instead of YM2149 ports for inputs! */
673const ppi8255_interface buggyboy_ppi8255_intf =
677static const ppi8255_interface buggyboy_ppi8255_intf =
674678{
675   1,
676   { input_port_1_r },
677   { 0 },
678   { input_port_2_r },
679   { 0 },
680   { 0 },
681   { 0 },
679   input_port_1_r,
680   NULL,
681   input_port_2_r,
682   NULL,
683   NULL,
684   NULL
682685};
683686
684687static const struct CustomSound_interface bb_custom_interface =
r2454r2455
711714   MDRV_MACHINE_START(tx1)
712715   MDRV_NVRAM_HANDLER(generic_0fill)
713716
717   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
718   MDRV_DEVICE_CONFIG( tx1_ppi8255_intf )
719
714720   MDRV_GFXDECODE(tx1)
715721   MDRV_PALETTE_LENGTH(256+(256*4)+(2048*4))
716722   MDRV_PALETTE_INIT(tx1)
r2454r2455
766772   MDRV_MACHINE_START(buggyboy)
767773   MDRV_NVRAM_HANDLER(generic_0fill)
768774
775   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
776   MDRV_DEVICE_CONFIG( buggyboy_ppi8255_intf )
777
769778   MDRV_GFXDECODE(buggyboy)
770779   MDRV_DEFAULT_LAYOUT(layout_triphsxs)
771780
src/mame/drivers/thayers.c
r2454r2455
1515
1616#include "driver.h"
1717#include "render.h"
18#include "deprecat.h"
1918#include "machine/laserdsc.h"
2019#include "cpu/cop400/cop400.h"
2120
r2454r2455
156155
157156static WRITE8_HANDLER(intrq_w)
158157{
159   cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE);
158   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
160159}
161160
162161static WRITE8_HANDLER(sc01_register_w)
r2454r2455
181180                  SET_Z80_SSI_REQUEST();
182181                    if (!(Z80_SSI_REQUEST()))
183182                     logerror("SETTING IRQ LINE sc01\n");
184                        cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE);
183                        cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
185184                  break;
186185
187186               default:
r2454r2455
290289   /* Assert the Z80's interrupt line if necessary */
291290   if (irq_flag)
292291   {
293      cpunum_set_input_line(Machine, 0, 0, ASSERT_LINE);
292      cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
294293   }
295294}
296295
src/mame/drivers/merit.c
r2454r2455
3131*/
3232
3333#include "driver.h"
34#include "deprecat.h"
3534#include "machine/8255ppi.h"
3635#include "sound/ay8910.h"
3736
r2454r2455
137136//      int bit = (i & 0x300)>>8;
138137      offset = ((i & 0x7f)<<3) | ((i & 0x80) >> 5);
139138
140      palette_set_color_rgb(Machine,i,
139      palette_set_color_rgb(machine,i,
141140            pal4bit(BIT(paletteram[offset],0)*0x1 + BIT(paletteram[offset+1],0)*0x2 + BIT(paletteram[offset+2],0)*0x4 + BIT(paletteram[offset+3],0)*0x8),
142141            pal4bit(BIT(paletteram[offset],1)*0x1 + BIT(paletteram[offset+1],1)*0x2 + BIT(paletteram[offset+2],1)*0x4 + BIT(paletteram[offset+3],1)*0x8),
143142            pal4bit(BIT(paletteram[offset],2)*0x1 + BIT(paletteram[offset+1],2)*0x2 + BIT(paletteram[offset+2],2)*0x4 + BIT(paletteram[offset+3],2)*0x8));
r2454r2455
191190static ADDRESS_MAP_START( bigappg_map, ADDRESS_SPACE_PROGRAM, 8 )
192191   AM_RANGE(0x0000, 0x5fff) AM_ROM
193192   AM_RANGE(0xa000, 0xafff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
194   AM_RANGE(0xc004, 0xc007) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
195   AM_RANGE(0xc008, 0xc00b) AM_READWRITE(ppi8255_1_r, ppi8255_1_w)
193   AM_RANGE(0xc004, 0xc007) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
194   AM_RANGE(0xc008, 0xc00b) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
196195   AM_RANGE(0xe000, 0xe001) AM_WRITENOP // 6845 crt
197196   AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(phrcraze_attr_w) AM_BASE(&phrcraze_attr)
198197   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(phrcraze_bg_w) AM_BASE(&videoram)
r2454r2455
206205   AM_RANGE(0x5400, 0x54ff) AM_WRITE(low_offset_w)
207206   AM_RANGE(0x5800, 0x58ff) AM_WRITE(med_offset_w)
208207   AM_RANGE(0x6000, 0x67ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
209   AM_RANGE(0xa000, 0xa003) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
210   AM_RANGE(0xc000, 0xc003) AM_READWRITE(ppi8255_1_r, ppi8255_1_w)
208   AM_RANGE(0xa000, 0xa003) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
209   AM_RANGE(0xc000, 0xc003) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
211210   AM_RANGE(0xe000, 0xe001) AM_WRITENOP // 6845 crt
212211   AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(phrcraze_attr_w) AM_BASE(&phrcraze_attr)
213212   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(phrcraze_bg_w) AM_BASE(&videoram)
r2454r2455
223222static ADDRESS_MAP_START( phrcraze_map, ADDRESS_SPACE_PROGRAM, 8 )
224223   AM_RANGE(0x0000, 0x7fff) AM_ROM
225224   AM_RANGE(0xa000, 0xbfff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
226   AM_RANGE(0xc008, 0xc00b) AM_READWRITE(ppi8255_1_r, ppi8255_1_w)
227   AM_RANGE(0xc00c, 0xc00f) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
225   AM_RANGE(0xc008, 0xc00b) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
226   AM_RANGE(0xc00c, 0xc00f) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
228227   AM_RANGE(0xce00, 0xceff) AM_READWRITE(questions_r, high_offset_w)
229228   AM_RANGE(0xd600, 0xd6ff) AM_WRITE(low_offset_w)
230229   AM_RANGE(0xda00, 0xdaff) AM_WRITE(med_offset_w)
r2454r2455
243242static ADDRESS_MAP_START( tictac_map, ADDRESS_SPACE_PROGRAM, 8 )
244243   AM_RANGE(0x0000, 0x7fff) AM_ROM
245244   AM_RANGE(0x8000, 0x9fff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
246   AM_RANGE(0xc004, 0xc007) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
247   AM_RANGE(0xc008, 0xc00b) AM_READWRITE(ppi8255_1_r, ppi8255_1_w)
245   AM_RANGE(0xc004, 0xc007) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
246   AM_RANGE(0xc008, 0xc00b) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
248247   AM_RANGE(0xce00, 0xceff) AM_READWRITE(questions_r, high_offset_w)
249248   AM_RANGE(0xd600, 0xd6ff) AM_WRITE(low_offset_w)
250249   AM_RANGE(0xda00, 0xdaff) AM_WRITE(med_offset_w)
r2454r2455
263262static ADDRESS_MAP_START( trvwhziv_map, ADDRESS_SPACE_PROGRAM, 8 )
264263   AM_RANGE(0x0000, 0x7fff) AM_ROM
265264   AM_RANGE(0xa000, 0xbfff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
266   AM_RANGE(0xc004, 0xc007) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
267   AM_RANGE(0xc008, 0xc00b) AM_READWRITE(ppi8255_1_r, ppi8255_1_w)
265   AM_RANGE(0xc004, 0xc007) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
266   AM_RANGE(0xc008, 0xc00b) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
268267   AM_RANGE(0xce00, 0xceff) AM_READWRITE(questions_r, high_offset_w)
269268   AM_RANGE(0xd600, 0xd6ff) AM_WRITE(low_offset_w)
270269   AM_RANGE(0xda00, 0xdaff) AM_WRITE(med_offset_w)
r2454r2455
770769   GFXDECODE_ENTRY( REGION_GFX2, 8, tiles8x8x1_layout, 0, 128 ) // flipped tiles
771770GFXDECODE_END
772771
773static const ppi8255_interface ppi8255_intf =
772static const ppi8255_interface ppi8255_intf[2] =
774773{
775   2,                   /* 2 chips */
776   { input_port_0_r, input_port_3_r },   /* Port A read */
777   { input_port_1_r, NULL },      /* Port B read */
778   { input_port_2_r, NULL },      /* Port C read */
779   { NULL,      NULL },      /* Port A write */
780   { NULL,      led1_w },      /* Port B write */
781   { NULL,      misc_w },      /* Port C write */
774   {
775      input_port_0_r,            /* Port A read */
776      input_port_1_r,            /* Port B read */
777      input_port_2_r,            /* Port C read */
778      NULL,                  /* Port A write */
779      NULL,                  /* Port B write */
780      NULL                  /* Port C write */
781   },
782   {
783      input_port_3_r,            /* Port A read */
784      NULL,                  /* Port B read */
785      NULL,                  /* Port C read */
786      NULL,                  /* Port A write */
787      led1_w,                  /* Port B write */
788      misc_w                  /* Port C write */
789   }
782790};
783791
784792static const struct AY8910interface merit_ay8912_interface =
785793{
786   0,0,
787   led2_w,0
794   AY8910_LEGACY_OUTPUT,
795   AY8910_DEFAULT_LOADS,
796   NULL, NULL,
797   led2_w, NULL
788798};
789799
790static MACHINE_RESET( merit )
791{
792   ppi8255_init(&ppi8255_intf);
793}
794800
795
796801static MACHINE_DRIVER_START( pitboss )
797802   MDRV_CPU_ADD_TAG("main",Z80,2500000)       /* ?? */
798803   MDRV_CPU_PROGRAM_MAP(pitboss_map,0)
r2454r2455
800805   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
801806
802807   MDRV_NVRAM_HANDLER(generic_0fill)
803   MDRV_MACHINE_RESET(merit)
804808
809   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
810   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
811
812   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
813   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
814
805815   /* video hardware */
806816   MDRV_SCREEN_ADD("main", RASTER)
807817   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/dassault.c
r2454r2455
178178static READ16_HANDLER( dassault_irq_r )
179179{
180180   switch (offset) {
181      case 0: cpunum_set_input_line(Machine, 0, 5, CLEAR_LINE); break;
182      case 1: cpunum_set_input_line(Machine, 1, 6, CLEAR_LINE); break;
181      case 0: cpunum_set_input_line(machine, 0, 5, CLEAR_LINE); break;
182      case 1: cpunum_set_input_line(machine, 1, 6, CLEAR_LINE); break;
183183   }
184184   return shared_ram[(0xffc/2)+offset]; /* The values probably don't matter */
185185}
r2454r2455
187187static WRITE16_HANDLER( dassault_irq_w )
188188{
189189   switch (offset) {
190      case 0: cpunum_set_input_line(Machine, 0, 5, ASSERT_LINE); break;
191      case 1: cpunum_set_input_line(Machine, 1, 6, ASSERT_LINE); break;
190      case 0: cpunum_set_input_line(machine, 0, 5, ASSERT_LINE); break;
191      case 1: cpunum_set_input_line(machine, 1, 6, ASSERT_LINE); break;
192192   }
193193
194194   COMBINE_DATA(&shared_ram[(0xffc/2)+offset]); /* The values probably don't matter */
src/mame/drivers/ssrj.c
r2454r2455
163163
164164static const struct AY8910interface ay8910_interface =
165165{
166   0, /* not used ? */
166   AY8910_LEGACY_OUTPUT,
167   AY8910_DEFAULT_LOADS,
168   NULL, /* not used ? */
167169   input_port_3_r,
170   NULL,
171   NULL
168172};
169173
170174
src/mame/drivers/aztarac.c
r2454r2455
6060
6161static READ16_HANDLER( joystick_r )
6262{
63    return (((input_port_0_r (machine,offset) - 0xf) << 8) |
64            ((input_port_1_r (machine,offset) - 0xf) & 0xff));
63    return (((input_port_read_indexed(machine, 0) - 0xf) << 8) |
64            ((input_port_read_indexed(machine, 1) - 0xf) & 0xff));
6565}
6666
6767
src/mame/drivers/toratora.c
r2454r2455
140140   if (timer & 0x100) popmessage("watchdog!");
141141
142142
143   if (last != (input_port_0_r(machine, 0) & 0x0f))
143   if (last != (input_port_read_indexed(machine, 0) & 0x0f))
144144   {
145      last = input_port_0_r(machine, 0) & 0x0f;
145      last = input_port_read_indexed(machine, 0) & 0x0f;
146146      cpunum_set_input_line(machine, 0, 0, PULSE_LINE);
147147   }
148   pia_set_input_a(0, input_port_0_r(machine, 0) & 0x0f, 0);
148   pia_set_input_a(0, input_port_read_indexed(machine, 0) & 0x0f, 0);
149149
150   pia_set_input_ca1(0, input_port_0_r(machine, 0) & 0x10);
150   pia_set_input_ca1(0, input_port_read_indexed(machine, 0) & 0x10);
151151
152   pia_set_input_ca2(0, input_port_0_r(machine, 0) & 0x20);
152   pia_set_input_ca2(0, input_port_read_indexed(machine, 0) & 0x20);
153153}
154154
155155static READ8_HANDLER( timer_r )
src/mame/drivers/retofinv.c
r2454r2455
6666
6767static WRITE8_HANDLER( cpu1_reset_w )
6868{
69   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE);
69   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE);
7070}
7171
7272static WRITE8_HANDLER( cpu2_reset_w )
7373{
74   cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE);
74   cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE);
7575}
7676
7777static WRITE8_HANDLER( mcu_reset_w )
7878{
7979   /* the bootlegs don't have a MCU, so make sure it's there before trying to reset it */
8080   if (cpu_gettotalcpu() >= 4)
81      cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE);
81      cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE);
8282}
8383
8484static WRITE8_HANDLER( cpu2_m6000_w )
r2454r2455
103103
104104   cpu_interrupt_enable(0,bit);
105105   if (!bit)
106      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
106      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
107107}
108108
109109static WRITE8_HANDLER( irq1_ack_w )
r2454r2455
112112
113113   cpu_interrupt_enable(1,bit);
114114   if (!bit)
115      cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
115      cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
116116}
117117
118118static WRITE8_HANDLER( coincounter_w )
src/mame/drivers/gbusters.c
r2454r2455
88***************************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1211#include "cpu/konami/konami.h" /* for the callback and the firq irq definition */
1312#include "video/konamiic.h"
1413#include "sound/2151intf.h"
r2454r2455
101100
102101static WRITE8_HANDLER( gbusters_sh_irqtrigger_w )
103102{
104   cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
103   cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);
105104}
106105
107106static WRITE8_HANDLER( gbusters_snd_bankswitch_w )
src/mame/drivers/megaplay.c
r2454r2455
512512static WRITE8_HANDLER( megaplay_bios_6404_w )
513513{
514514   if(((bios_6404 & 0x0c) == 0x00) && ((data & 0x0c) == 0x0c))
515      cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, PULSE_LINE);
515      cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE);
516516   bios_6404 = data;
517517
518518//  logerror("BIOS: 0x6404 write: 0x%02x\n",data);
src/mame/drivers/srmp2.c
r2454r2455
10381038
10391039static const struct AY8910interface srmp2_ay8910_interface =
10401040{
1041   AY8910_LEGACY_OUTPUT,
1042   AY8910_DEFAULT_LOADS,
10411043   input_port_2_r,            /* Input A: DSW 2 */
10421044   input_port_1_r,            /* Input B: DSW 1 */
1045   NULL,
1046   NULL
10431047};
10441048
10451049
src/mame/drivers/r2dtank.c
r2454r2455
192192
193193static const struct AY8910interface ay8910_1_interface =
194194{
195   AY8910_LEGACY_OUTPUT,
196   AY8910_DEFAULT_LOADS,
195197   input_port_3_r,
196   0
198   NULL,
199   NULL,
200   NULL
197201};
198202
199203
200204static const struct AY8910interface ay8910_2_interface =
201205{
206   AY8910_LEGACY_OUTPUT,
207   AY8910_DEFAULT_LOADS,
202208   input_port_1_r,
203   input_port_2_r
209   input_port_2_r,
210   NULL,
211   NULL
204212};
205213
206214
src/mame/drivers/madalien.c
r2454r2455
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110#include "sound/ay8910.h"
1211#include "video/mc6845.h"
1312#include "madalien.h"
r2454r2455
164163
165164static const struct AY8910interface ay8910_interface =
166165{
166   AY8910_LEGACY_OUTPUT,
167   AY8910_DEFAULT_LOADS,
167168   NULL,
168169   NULL,
169170   madalien_portA_w,
src/mame/drivers/igs_180.c
r2454r2455
1/* Some IGS games with a HD64180 */
2/* also see iqblock.c and tarzan.c */
1/***************************************************************************
32
3                        -= IGS017 Based Hardware =-
4
5        driver by   Pierpaolo Prazzoli, Luca Elia (l.elia@tin.it)
6
7CPU:    Z180 (HD64180)
8GFX:    IGS017 (2 tilemaps, variable size sprites, protection)
9SOUND:  M6295, YM2413
10OTHER:  IGS025
11
12To Do:
13
14- Protection emulation, instead of patching the roms.
15- tjsb: finish sprites decryption (data lines scrambling), protection, inputs.
16- iqblocka: NVRAM.
17- iqblockf: protection.
18
19Notes:
20
21- iqblocka: keep start or test pressed during boot to enter test mode A or B.
22
23***************************************************************************/
24
425#include "driver.h"
526#include "deprecat.h"
627#include "cpu/z180/z180.h"
28#include "machine/8255ppi.h"
729#include "sound/2413intf.h"
830#include "sound/okim6295.h"
931
10static UINT8 *fg_videoram;
11static tilemap *fg_tilemap;
32/***************************************************************************
33                                Video Hardware
34***************************************************************************/
1235
36static UINT8 *fg_videoram, *bg_videoram;
37static tilemap *fg_tilemap, *bg_tilemap;
38
39#define COLOR(_X)   (((_X)>>2))
40
1341static TILE_GET_INFO( get_fg_tile_info )
1442{
15   int code = fg_videoram[tile_index*4+0] + ((fg_videoram[tile_index*4+1] & 0xf) << 8);
16   SET_TILE_INFO(1, code, 0, 0);
43   int code = fg_videoram[tile_index*4+0] + (fg_videoram[tile_index*4+1] << 8);
44   int attr = fg_videoram[tile_index*4+2] + (fg_videoram[tile_index*4+3] << 8);
45   SET_TILE_INFO(0, code, COLOR(attr), 0);
1746}
47static TILE_GET_INFO( get_bg_tile_info )
48{
49   int code = bg_videoram[tile_index*4+0] + (bg_videoram[tile_index*4+1] << 8);
50   int attr = bg_videoram[tile_index*4+2] + (bg_videoram[tile_index*4+3] << 8);
51   SET_TILE_INFO(0, code, COLOR(attr)+8, 0);
52}
1853
54static WRITE8_HANDLER( fg_w )
55{
56   fg_videoram[offset] = data;
57   tilemap_mark_tile_dirty(fg_tilemap,offset/4);
58}
59static WRITE8_HANDLER( bg_w )
60{
61   bg_videoram[offset] = data;
62   tilemap_mark_tile_dirty(bg_tilemap,offset/4);
63}
64
1965static VIDEO_START(igs_180)
2066{
2167   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,64,32);
68   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,8,8,64,32);
69
70   tilemap_set_transparent_pen(fg_tilemap,0xf);
71   tilemap_set_transparent_pen(bg_tilemap,0xf);
2272}
2373
74
75static UINT8 *sprites_gfx;
76int sprites_gfx_size;
77
78// Eeach 16 bit word in the sprites gfx roms contains three 5 bit pens: x-22222-11111-00000.
79// This routine expands each word into three bytes.
80static void expand_sprites(void)
81{
82   UINT8 *rom   =   memory_region(REGION_GFX1);
83   int size   =   memory_region_length(REGION_GFX1);
84   int i;
85
86   sprites_gfx_size   =   size / 2 * 3;
87   sprites_gfx         =   auto_malloc(sprites_gfx_size);
88
89   for (i = 0; i < size / 2 ; i++)
90   {
91      UINT16 pens = (rom[i*2+1] << 8) | rom[i*2];
92
93      sprites_gfx[i * 3 + 0] = (pens >>  0) & 0x1f;
94      sprites_gfx[i * 3 + 1] = (pens >>  5) & 0x1f;
95      sprites_gfx[i * 3 + 2] = (pens >> 10) & 0x1f;
96   }
97}
98
99/***************************************************************************
100                              Sprites Format
101
102    Offset:         Bits:               Value:
103
104        0.b                             Y (low)
105
106        1.b         7654 32--           Size Y (low)
107                    ---- --10           Y (high)
108
109        2.b         7654 3---           X (low)
110                    ---- -210           Size Y (high)
111
112        3.b         76-- ----           Size X (low)
113                    --5- ----
114                    ---4 3210           X (high)
115
116        4.b         76-- ----           Code (low)
117                    --54 3210           Size X (high)
118
119        5.b                             Code (mid low)
120
121        6.b                             Code (mid high)
122
123        7.b         765- ----           Color
124                    ---4 ----           Flip X
125                    ---- 3210           Code (high)
126
127    Code = ROM Address / 2 = Pixel / 3
128
129***************************************************************************/
130
131static void draw_sprite(bitmap_t *bitmap,const rectangle *cliprect, int sx, int sy, int dimx, int dimy, int flipx, int flipy, int color, int addr)
132{
133   // prepare GfxElement on the fly
134   gfx_element gfx;
135
136   gfx.width = dimx;
137   gfx.height = dimy;
138   gfx.total_elements = 1;
139   gfx.color_depth = 32;
140   gfx.color_granularity = 32;
141   gfx.color_base = 0x100;
142   gfx.total_colors = 8;
143   gfx.pen_usage = NULL;
144   gfx.gfxdata = sprites_gfx + addr;
145   gfx.line_modulo = dimx;
146   gfx.char_modulo = 0;   // doesn't matter
147   gfx.flags = 0;
148
149   // Bounds checking
150   if ( addr + dimx * dimy >= sprites_gfx_size )
151      return;
152
153   drawgfx(   bitmap,&gfx,
154            0, color,
155            flipx, flipy,
156            sx, sy,
157            cliprect, TRANSPARENCY_PEN, 0x1f   );
158}
159
160static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
161{
162   UINT8 *s   =   spriteram;
163   UINT8 *end   =   spriteram + 0x800;
164
165   for ( ; s < end; s += 8 )
166   {
167      int   x,y, sx,sy, dimx,dimy, flipx,flipy, addr,color;
168
169      y      =   s[0] + (s[1] << 8);
170      x      =   s[2] + (s[3] << 8);
171      addr   =   (s[4] >> 6) | (s[5] << 2) | (s[6] << 10) | ((s[7] & 0x03) << 18);
172      addr   *=   3;
173
174      flipx   =   s[7] & 0x10;
175      flipy   =   0;
176
177      dimx   =   ((((s[4] & 0x3f)<<2) | ((s[3] & 0xc0)>>6))+1) * 3;
178      dimy   =   ((y >> 10) | ((x & 0x03)<<6))+1;
179
180      x      >>=   3;
181      sx      =   (x & 0x1ff) - (x & 0x200);
182      sy      =   (y & 0x1ff) - (y & 0x200);
183
184      color = (s[7] & 0xe0) >> 5;
185
186      draw_sprite(bitmap, cliprect, sx, sy, dimx, dimy, flipx, flipy, color, addr);
187   }
188}
189
190// A simple gfx viewer (toggle with T)
191static int debug_viewer(bitmap_t *bitmap,const rectangle *cliprect)
192{
193#ifdef MAME_DEBUG
194   static int toggle = 0;
195   if (input_code_pressed_once(KEYCODE_T))   toggle = 1-toggle;
196   if (toggle)   {
197      static int a = 0, w = 512;
198      int h = 256;
199
200      if (input_code_pressed(KEYCODE_O))      w += 1;
201      if (input_code_pressed(KEYCODE_I))      w -= 1;
202
203      if (input_code_pressed(KEYCODE_U))      w += 8;
204      if (input_code_pressed(KEYCODE_Y))      w -= 8;
205
206      if (input_code_pressed(KEYCODE_RIGHT))   a += 1;
207      if (input_code_pressed(KEYCODE_LEFT))   a -= 1;
208
209      if (input_code_pressed(KEYCODE_DOWN))   a += w;
210      if (input_code_pressed(KEYCODE_UP))      a -= w;
211
212      if (input_code_pressed(KEYCODE_PGDN))   a += w * h;
213      if (input_code_pressed(KEYCODE_PGUP))   a -= w * h;
214
215      if (a < 0)      a = 0;
216      if (a > sprites_gfx_size)   a = sprites_gfx_size;
217
218      if (w <= 0)      w = 0;
219      if (w > 1024)   w = 1024;
220
221      fillbitmap(bitmap,0,cliprect);
222
223      draw_sprite(bitmap, cliprect, 0,0, w,h, 0,0, 0, a);
224
225      popmessage("a: %08X w: %03X p: %02X-%02x-%02x",a,w,sprites_gfx[a/3*3+0],sprites_gfx[a/3*3+1],sprites_gfx[a/3*3+2]);
226      osd_sleep(200000);
227      return 1;
228   }
229#endif
230   return 0;
231}
232
24233static VIDEO_UPDATE(igs_180)
25234{
26   tilemap_mark_all_tiles_dirty(fg_tilemap);
27   tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
235   int layers_ctrl = -1;
28236
237#ifdef MAME_DEBUG
238   if (input_code_pressed(KEYCODE_Z))
239   {
240      int mask = 0;
241      if (input_code_pressed(KEYCODE_Q))   mask |= 1;
242      if (input_code_pressed(KEYCODE_W))   mask |= 2;
243      if (input_code_pressed(KEYCODE_A))   mask |= 4;
244      if (mask != 0) layers_ctrl &= mask;
245   }
246#endif
247
248   if (debug_viewer(bitmap,cliprect))
249      return 0;
250
251   if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_OPAQUE,0);
252   else               fillbitmap(bitmap,get_black_pen(screen->machine),cliprect);
253
254   if (layers_ctrl & 4)   draw_sprites(screen->machine,bitmap,cliprect);
255
256   if (layers_ctrl & 2)   tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
257
29258   return 0;
30259}
31260
32static INPUT_PORTS_START( igs_180 )
33INPUT_PORTS_END
261/***************************************************************************
262                                Decryption
263***************************************************************************/
34264
265static void decrypt_program_rom(int mask, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0)
266{
267   int length = memory_region_length(REGION_CPU1);
268   UINT8 *rom = memory_region(REGION_CPU1);
269   UINT8 *tmp = auto_malloc(length);
270   int i;
271
272   // decrypt the program ROM
273
274   // XOR layer
275   for (i = 0;i < length;i++)
276   {
277      if(i & 0x2000)
278      {
279         if((i & mask) == mask)
280            rom[i] ^= 0x01;
281      }
282      else
283      {
284         if(i & 0x0100)
285         {
286            if((i & mask) == mask)
287               rom[i] ^= 0x01;
288         }
289         else
290         {
291            if(i & 0x0080)
292            {
293               if((i & mask) == mask)
294                  rom[i] ^= 0x01;
295            }
296            else
297            {
298               if((i & mask) != mask)
299                  rom[i] ^= 0x01;
300            }
301         }
302      }
303   }
304
305   memcpy(tmp,rom,length);
306
307   // address lines swap
308   for (i = 0;i < length;i++)
309   {
310      int addr = (i & ~0xff) | BITSWAP8(i,a7,a6,a5,a4,a3,a2,a1,a0);
311      rom[i] = tmp[addr];
312   }
313}
314
315
316// iqblocka
317
318static void iqblocka_patch_rom(void)
319{
320   UINT8 *rom = memory_region(REGION_CPU1);
321
322//  rom[0x7b64] = 0xc9;
323
324   rom[0x010c7] = 0x18;
325
326   // CBEF bank 0a
327   rom[0x16bef] = 0x18;
328
329   // C1BD bank 24
330   rom[0x301bd] = 0x18;
331
332   // C21B bank 2e
333   rom[0x3a21b] = 0x18;
334
335   // DCA9 bank 2e
336   rom[0x3bca9] = 0x18;
337
338   // maybe
339//  rom[0x18893] = 0x18;
340//  rom[0x385b1] = 0x18;
341}
342
343static DRIVER_INIT( iqblocka )
344{
345   decrypt_program_rom(0x11, 7, 6, 5, 4, 3, 2, 1, 0);
346   iqblocka_patch_rom();
347
348   expand_sprites();
349}
350
351// iqblockf
352
353static DRIVER_INIT( iqblockf )
354{
355   decrypt_program_rom(0x11, 7, 6, 5, 4, 3, 2, 1, 0);
356//  iqblockf_patch_rom();
357
358   expand_sprites();
359}
360
361// tjsb
362
363static void tjsb_decrypt_sprites(void)
364{
365   int length = memory_region_length(REGION_GFX1);
366   UINT8 *rom = memory_region(REGION_GFX1);
367   UINT8 *tmp = auto_malloc(length);
368   int i;
369
370   // address lines swap (to do: collapse into one bitswap)
371   memcpy(tmp,rom,length);
372   for (i = 0;i < length;i++)
373   {
374      int addr = (i & ~0xff) | BITSWAP8(i,7,6,5,4,1,2,3,0);
375      rom[i] = tmp[addr];
376   }
377
378   memcpy(tmp,rom,length);
379   for (i = 0;i < length;i++)
380   {
381      int addr = (i & ~0xff) | BITSWAP8(i,7,6,5,2,4,3,1,0);
382      rom[i] = tmp[addr];
383   }
384
385   memcpy(tmp,rom,length);
386   for (i = 0;i < length;i++)
387   {
388      int addr = (i & ~0xff) | BITSWAP8(i,7,6,5,3,4,2,1,0);
389      rom[i] = BITSWAP8(tmp[addr],7,6,5,4,3,2,1,0);
390   }
391}
392
393static void tjsb_patch_rom(void)
394{
395   UINT8 *rom = memory_region(REGION_CPU1);
396   rom[0x011df] = 0x18;
397}
398
399static DRIVER_INIT( tjsb )
400{
401   decrypt_program_rom(0x05, 7, 6, 3, 2, 5, 4, 1, 0);
402   tjsb_patch_rom();
403
404   tjsb_decrypt_sprites();
405   expand_sprites();
406}
407
408/***************************************************************************
409                                Memory Maps
410***************************************************************************/
411
35412static ADDRESS_MAP_START( igs_180_map, ADDRESS_SPACE_PROGRAM, 8 )
36   AM_RANGE(0x00000, 0x0dfff) AM_ROM
37   AM_RANGE(0x0e000, 0x0efff) AM_RAM
38   AM_RANGE(0x0f000, 0x0ffff) AM_RAM
39   AM_RANGE(0x10000, 0x3ffff) AM_ROM
413   AM_RANGE( 0x00000, 0x0dfff ) AM_ROM
414   AM_RANGE( 0x0e000, 0x0efff ) AM_RAM
415   AM_RANGE( 0x0f000, 0x0ffff ) AM_RAM
416   AM_RANGE( 0x10000, 0x3ffff ) AM_ROM
40417ADDRESS_MAP_END
41418
42/*
43#define W(n) \
44    static WRITE8_HANDLER( w##n )\
45    {\
46        static int old = -1;\
47        if(data != old)\
48            printf("w"#n" = %02X\n",old=data);\
49    }\
419static int nmi_enable;
420static WRITE8_HANDLER( nmi_enable_w )
421{
422   nmi_enable = data & 1;
423   if (data & (~1))
424      logerror("PC %06X: nmi_enable = %02x\n",activecpu_get_pc(),data);
425}
50426
51W(1)
52W(2)
53W(3)
54W(4)
55W(5)
56W(6)
57W(7)
58W(8)
59*/
60
61static WRITE8_HANDLER( nmi_ack_w )
427static int irq_enable;
428static WRITE8_HANDLER( irq_enable_w )
62429{
63//  cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
430   irq_enable = data & 1;
431   if (data & (~1))
432      logerror("PC %06X: irq_enable = %02x\n",activecpu_get_pc(),data);
64433}
65434
66static WRITE8_HANDLER( irq0_ack_w )
435static UINT8 input_select;
436static WRITE8_HANDLER( input_select_w )
67437{
68//  cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
438   input_select = data;
69439}
70440
71static READ8_HANDLER( ff_r )
441static READ8_HANDLER( input_r )
72442{
73   return 0xff;
443   switch (input_select)
444   {
445      case 0x00:   return input_port_read(machine, "PLAYER1");
446      case 0x01:   return input_port_read(machine, "PLAYER2");
447      case 0x02:   return input_port_read(machine, "COINS");
448
449      case 0x03:   return 01;
450
451      case 0x20:   return 0x49;
452      case 0x21:   return 0x47;
453      case 0x22:   return 0x53;
454
455      case 0x24:   return 0x41;
456      case 0x25:   return 0x41;
457      case 0x26:   return 0x7f;
458      case 0x27:   return 0x41;
459      case 0x28:   return 0x41;
460
461      case 0x2a:   return 0x3e;
462      case 0x2b:   return 0x41;
463      case 0x2c:   return 0x49;
464      case 0x2d:   return 0xf9;
465      case 0x2e:   return 0x0a;
466
467      case 0x30:   return 0x26;
468      case 0x31:   return 0x49;
469      case 0x32:   return 0x49;
470      case 0x33:   return 0x49;
471      case 0x34:   return 0x32;
472
473      default:
474         logerror("PC %06X: input %02x read\n",activecpu_get_pc(),input_select);
475         return 0xff;
476   }
74477}
75478
76479static ADDRESS_MAP_START( igs_180_portmap, ADDRESS_SPACE_IO, 8 )
77   AM_RANGE(0x0000, 0x003f) AM_RAM // internal regs
480   AM_RANGE( 0x0000, 0x003f ) AM_RAM // internal regs
78481
79   AM_RANGE(0x1000, 0x17ff) AM_RAM
80   AM_RANGE(0x1800, 0x19ff) AM_RAM
81   AM_RANGE(0x1a00, 0x1bff) AM_RAM
82   AM_RANGE(0x1c00, 0x1fff) AM_RAM
83   AM_RANGE(0x200a, 0x200a) AM_WRITENOP
84   AM_RANGE(0x2010, 0x2010) AM_READ(ff_r) AM_WRITENOP
85   AM_RANGE(0x2011, 0x2011) AM_READ(ff_r) AM_WRITENOP
86   AM_RANGE(0x2012, 0x2012) AM_READ(ff_r) AM_WRITENOP
87   AM_RANGE(0x2014, 0x2014) AM_WRITE(nmi_ack_w)
88   AM_RANGE(0x2015, 0x2015) AM_WRITE(irq0_ack_w)
482   AM_RANGE( 0x1000, 0x17ff ) AM_RAM AM_BASE( &spriteram )
483   AM_RANGE( 0x1800, 0x1bff ) AM_READWRITE( SMH_RAM, paletteram_xRRRRRGGGGGBBBBB_le_w ) AM_BASE(&paletteram)
484   AM_RANGE( 0x1c00, 0x1fff ) AM_RAM
89485
90   AM_RANGE(0x4000, 0x4fff) AM_RAM AM_BASE(&fg_videoram)
91   AM_RANGE(0x5000, 0x5fff) AM_RAM
92   AM_RANGE(0x6000, 0x7fff) AM_RAM
486//  AM_RANGE(0x200a, 0x200a) AM_WRITENOP
93487
94   AM_RANGE(0x8000, 0x8000) AM_WRITE(YM2413_register_port_0_w)
95   AM_RANGE(0x8001, 0x8001) AM_READ(ff_r) AM_WRITE(YM2413_data_port_0_w)
96   AM_RANGE(0xa000, 0xa000) AM_READ(ff_r)
97   AM_RANGE(0xb000, 0xb000) AM_WRITENOP
98   AM_RANGE(0xb001, 0xb001) AM_WRITENOP
488   AM_RANGE( 0x2010, 0x2013 ) AM_DEVREADWRITE(PPI8255, "ppi8255", ppi8255_r, ppi8255_w)
489
490   AM_RANGE( 0x2014, 0x2014 ) AM_WRITE( nmi_enable_w )
491   AM_RANGE( 0x2015, 0x2015 ) AM_WRITE( irq_enable_w )
492
493   AM_RANGE( 0x4000, 0x5fff ) AM_READWRITE( SMH_RAM, fg_w ) AM_BASE( &fg_videoram )
494   AM_RANGE( 0x6000, 0x7fff ) AM_READWRITE( SMH_RAM, bg_w ) AM_BASE( &bg_videoram )
495
496   AM_RANGE( 0x8000, 0x8000 ) AM_WRITE( input_select_w )
497   AM_RANGE( 0x8001, 0x8001 ) AM_READ ( input_r )
498
499   AM_RANGE( 0x9000, 0x9000 ) AM_READWRITE( OKIM6295_status_0_r, OKIM6295_data_0_w )
500
501   AM_RANGE( 0xa000, 0xa000 ) AM_READ_PORT( "BUTTONS" )
502
503   AM_RANGE( 0xb000, 0xb000 ) AM_WRITE( YM2413_register_port_0_w )
504   AM_RANGE( 0xb001, 0xb001 ) AM_WRITE( YM2413_data_port_0_w )
99505ADDRESS_MAP_END
100506
101static const gfx_layout tilelayout =
507
508/***************************************************************************
509                                Input Ports
510***************************************************************************/
511
512static INPUT_PORTS_START( iqblocka )
513
514   PORT_START_TAG("DSW0")   // IN0
515   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
516   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
517   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
518   PORT_DIPNAME( 0x02, 0x02, "Hold Mode" )
519   PORT_DIPSETTING(    0x02, "In Win" )
520   PORT_DIPSETTING(    0x00, "Always" )
521   PORT_DIPNAME( 0x04, 0x04, "Max Credit" )
522   PORT_DIPSETTING(    0x04, "4000" )
523   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
524   PORT_DIPNAME( 0x38, 0x38, "Cigarette Bet" )
525   PORT_DIPSETTING(    0x38, "1" )
526   PORT_DIPSETTING(    0x30, "10" )
527   PORT_DIPSETTING(    0x28, "20" )
528   PORT_DIPSETTING(    0x20, "50" )
529   PORT_DIPSETTING(    0x18, "80" )
530   PORT_DIPSETTING(    0x10, "100" )
531   PORT_DIPSETTING(    0x08, "120" )
532   PORT_DIPSETTING(    0x00, "150" )
533   PORT_DIPNAME( 0xc0, 0xc0, "Min Bet" )
534   PORT_DIPSETTING(    0xc0, "1" )
535   PORT_DIPSETTING(    0x80, "10" )
536   PORT_DIPSETTING(    0x40, "20" )
537   PORT_DIPSETTING(    0x00, "50" )
538
539   PORT_START_TAG("DSW1")   // IN1
540   PORT_DIPNAME( 0x07, 0x07, "Key In" )
541   PORT_DIPSETTING(    0x07, "10" )
542   PORT_DIPSETTING(    0x06, "20" )
543   PORT_DIPSETTING(    0x05, "40" )
544   PORT_DIPSETTING(    0x04, "50" )
545   PORT_DIPSETTING(    0x03, "100" )
546   PORT_DIPSETTING(    0x02, "200" )
547   PORT_DIPSETTING(    0x01, "250" )
548   PORT_DIPSETTING(    0x00, "500" )
549   PORT_DIPNAME( 0x08, 0x08, "Key Out" )
550   PORT_DIPSETTING(    0x08, "10" )
551   PORT_DIPSETTING(    0x00, "100" )
552   PORT_DIPNAME( 0x10, 0x10, "Open Mode" )
553   PORT_DIPSETTING(    0x10, "Gaming" )
554   PORT_DIPSETTING(    0x00, "Amuse" )
555   PORT_DIPNAME( 0x20, 0x20, "Demo Game" )
556   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
557   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
558   PORT_DIPNAME( 0xc0, 0xc0, "Bonus Base" )
559   PORT_DIPSETTING(    0xc0, "100" )
560   PORT_DIPSETTING(    0x80, "200" )
561   PORT_DIPSETTING(    0x40, "300" )
562   PORT_DIPSETTING(    0x00, "400" )
563
564   PORT_START_TAG("DSW2")   // IN2
565   PORT_DIPNAME( 0x03, 0x03, "Win Up Pool" )
566   PORT_DIPSETTING(    0x03, "300" )
567   PORT_DIPSETTING(    0x02, "500" )
568   PORT_DIPSETTING(    0x01, "800" )
569   PORT_DIPSETTING(    0x00, "1000" )
570   PORT_DIPNAME( 0x0c, 0x0c, "Max Double Up" )
571   PORT_DIPSETTING(    0x0c, "20000" )
572   PORT_DIPSETTING(    0x08, "30000" )
573   PORT_DIPSETTING(    0x04, "40000" )
574   PORT_DIPSETTING(    0x00, "50000" )
575   PORT_DIPNAME( 0x10, 0x10, "Cards" )
576   PORT_DIPSETTING(    0x10, "A,J,Q,K" )
577   PORT_DIPSETTING(    0x00, "Number" )
578   PORT_DIPNAME( 0x20, 0x20, "Title Name" )
579   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
580   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
581   PORT_DIPNAME( 0x40, 0x40, "Double" )
582   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
583   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
584   PORT_DIPNAME( 0x80, 0x80, "CG Select" )
585   PORT_DIPSETTING(    0x80, DEF_STR( Low ) )
586   PORT_DIPSETTING(    0x00, DEF_STR( High ) )
587
588   PORT_START_TAG("PLAYER1")
589   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1         )   PORT_NAME( "Start / Test" )   // keep pressed while booting
590   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    )
591   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  )
592   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  )
593   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
594   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1        ) PORT_NAME( "Help / Big" )
595   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2        )
596   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN        )
597
598   PORT_START_TAG("PLAYER2")
599   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2         )   PORT_NAME( "Bet" )
600   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_PLAYER(2)
601   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_PLAYER(2)
602   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_PLAYER(2)
603   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
604   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1        ) PORT_PLAYER(2)
605   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2        ) PORT_PLAYER(2)
606   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN        )
607
608   PORT_START_TAG("COINS")
609   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1     ) PORT_IMPULSE(2)
610   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2     ) PORT_IMPULSE(2)
611   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN   )
612   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN   )
613   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN   )
614   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN   )
615   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW  )   // keep pressed while booting
616   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )   // this seems to toggle between videogame and gambling
617
618   PORT_START_TAG("BUTTONS")
619   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME( "Small" )
620   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3   ) PORT_IMPULSE(2)   // coin error
621   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
622   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME( "Score -> Time" )   // converts score into time
623   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
624   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
625   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
626   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
627
628INPUT_PORTS_END
629
630
631/***************************************************************************
632                                Graphics Layout
633***************************************************************************/
634
635static const gfx_layout layout_8x8x4 =
102636{
103637   8,8,
104   RGN_FRAC(1,4), //?
105   6, //?
106   { 8, RGN_FRAC(0,4), RGN_FRAC(1,4)+8, RGN_FRAC(1,4), RGN_FRAC(2,4)+8, RGN_FRAC(2,4) }, //?
107   { 0, 1, 2, 3, 4, 5, 6, 7 },
108   { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
109   32*8
638   RGN_FRAC(1,1),
639   4,
640   { 8*3,8*2,8*1,8*0 },
641   { STEP8(0, 1) },
642   { STEP8(0, 8*4) },
643   8*8*4
110644};
111645
112646static GFXDECODE_START( igs_180 )
113   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout, 0, 1 )
114   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout, 0, 1 )
647   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_8x8x4, 0, 16 )
115648GFXDECODE_END
116649
117650
651/***************************************************************************
652                                Machine Drivers
653***************************************************************************/
654
118655static INTERRUPT_GEN( igs_180_interrupt )
119656{
120657   if (cpu_getiloops() & 1)
121      cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);//ASSERT_LINE);    /* ???? */
658   {
659       if (nmi_enable)
660         cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
661   }
122662   else
123      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);//ASSERT_LINE);          /* ???? */
663   {
664       if (irq_enable)
665         cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
666   }
124667}
125668
669// Dips are read through the 8255
670static const ppi8255_interface ppi8255_intf =
671{
672   input_port_0_r,   // Port A read
673   input_port_1_r,   // Port B read
674   input_port_2_r,   // Port C read
675   0,            // Port A write
676   0,            // Port B write
677   0,            // Port C write
678};
679
680static MACHINE_RESET( igs_180 )
681{
682   nmi_enable = 0;
683   irq_enable = 0;
684}
685
126686static MACHINE_DRIVER_START( igs_180 )
127687
128688   /* basic machine hardware */
129   MDRV_CPU_ADD(Z180,16000000)   /* 16 MHz? */
689   MDRV_CPU_ADD(Z180, XTAL_16MHz / 2)
130690   MDRV_CPU_PROGRAM_MAP(igs_180_map,0)
131691   MDRV_CPU_IO_MAP(igs_180_portmap,0)
132692   MDRV_CPU_VBLANK_INT_HACK(igs_180_interrupt,2)
133   //MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
134693
694   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
695   MDRV_DEVICE_CONFIG( ppi8255_intf )
696
697   MDRV_MACHINE_RESET(igs_180)
698
135699   /* video hardware */
136700   MDRV_SCREEN_ADD("main", RASTER)
137701   MDRV_SCREEN_REFRESH_RATE(60)
138702   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
139703   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
140   MDRV_SCREEN_SIZE(64*8, 32*8)
141   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1)
704   MDRV_SCREEN_SIZE(512, 256)
705   MDRV_SCREEN_VISIBLE_AREA(0, 512-1, 0, 240-1)
142706
143707   MDRV_GFXDECODE(igs_180)
144   MDRV_PALETTE_LENGTH(1024)
708   MDRV_PALETTE_LENGTH(0x100*2)
145709
146710   MDRV_VIDEO_START(igs_180)
147711   MDRV_VIDEO_UPDATE(igs_180)
148712
149713   /* sound hardware */
150714   MDRV_SPEAKER_STANDARD_MONO("mono")
151   MDRV_SOUND_ADD(YM2413, 3579545)
715   MDRV_SOUND_ADD(YM2413, XTAL_3_579545MHz)
152716   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
153717
154   MDRV_SOUND_ADD(OKIM6295, 16000000/16)
718   MDRV_SOUND_ADD(OKIM6295, XTAL_16MHz / 16)
155719   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high)
156720   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
157721MACHINE_DRIVER_END
r2454r2455
199763      VSync   - 60Hz
200764      HSync   - 15.31kHz
201765
202  */
766*/
203767
204768ROM_START( iqblocka )
205   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* DIP28 Code */
769   ROM_REGION( 0x40000, REGION_CPU1, 0 )
206770   ROM_LOAD( "v.u18", 0x00000, 0x40000, CRC(2e2b7d43) SHA1(cc73f4c8f9a6e2219ee04c9910725558a80b4eb2) )
207771
208   ROM_REGION( 0x40000, REGION_SOUND1, 0 ) /* Samples */
209   ROM_LOAD( "speech.u17", 0x00000, 0x40000, CRC(d9e3d39f) SHA1(bec85d1ac2dfca77453cbca0e7dd53fee8fb438b) )
772   ROM_REGION( 0x80000, REGION_GFX1, ROMREGION_DISPOSE )
773   ROM_LOAD( "cg.u7", 0x000000, 0x080000, CRC(cb48a66e) SHA1(6d597193d1333a97957d5ceec8179a24bedfd928) )   // FIXED BITS (xxxxxxxx0xxxxxxx)
210774
211   ROM_REGION( 0x80000, REGION_GFX1, ROMREGION_INVERT )
212   ROM_LOAD( "cg.u7",   0x000000, 0x080000, CRC(cb48a66e) SHA1(6d597193d1333a97957d5ceec8179a24bedfd928) )
775   ROM_REGION( 0x80000, REGION_GFX2, ROMREGION_DISPOSE)
776   ROM_LOAD( "text.u8", 0x000000, 0x080000, CRC(48c4f4e6) SHA1(b1e1ca62cf6a99c11a5cc56705eef7e22a3b2740) )
213777
214   ROM_REGION( 0x80000, REGION_GFX2, ROMREGION_INVERT )
215   ROM_LOAD( "text.u8", 0x000000, 0x080000, CRC(48c4f4e6) SHA1(b1e1ca62cf6a99c11a5cc56705eef7e22a3b2740) )
778   ROM_REGION( 0x40000, REGION_SOUND1, 0 )
779   ROM_LOAD( "speech.u17", 0x00000, 0x40000, CRC(d9e3d39f) SHA1(bec85d1ac2dfca77453cbca0e7dd53fee8fb438b) )
216780ROM_END
217781
218782ROM_START( iqblockf )
219   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* DIP28 Code */
783   ROM_REGION( 0x40000, REGION_CPU1, 0 )
220784   ROM_LOAD( "v113fr.u18", 0x00000, 0x40000, CRC(346c68af) SHA1(ceae4c0143c288dc9c1dd1e8a51f1e3371ffa439) )
221785
222   ROM_REGION( 0x40000, REGION_SOUND1, 0 ) /* Samples */
223   ROM_LOAD( "sp.u17", 0x00000, 0x40000, CRC(71357845) SHA1(25f4f7aebdcc0706018f041d3696322df569b0a3) )
786   ROM_REGION( 0x80000, REGION_GFX1, ROMREGION_DISPOSE )
787   ROM_LOAD( "cg.u7", 0x000000, 0x080000, CRC(cb48a66e) SHA1(6d597193d1333a97957d5ceec8179a24bedfd928) )   // FIXED BITS (xxxxxxxx0xxxxxxx)
224788
225   ROM_REGION( 0x80000, REGION_GFX1, ROMREGION_INVERT )
226   ROM_LOAD( "cg.u7",   0x000000, 0x080000, CRC(cb48a66e) SHA1(6d597193d1333a97957d5ceec8179a24bedfd928) )
789   ROM_REGION( 0x80000, REGION_GFX2, ROMREGION_DISPOSE )
790   ROM_LOAD( "text.u8", 0x000000, 0x080000, CRC(48c4f4e6) SHA1(b1e1ca62cf6a99c11a5cc56705eef7e22a3b2740) )
227791
228   ROM_REGION( 0x80000, REGION_GFX2, ROMREGION_INVERT )
229   ROM_LOAD( "text.u8", 0x000000, 0x080000, CRC(48c4f4e6) SHA1(b1e1ca62cf6a99c11a5cc56705eef7e22a3b2740) )
792   ROM_REGION( 0x40000, REGION_SOUND1, 0 )
793   ROM_LOAD( "sp.u17", 0x00000, 0x40000, CRC(71357845) SHA1(25f4f7aebdcc0706018f041d3696322df569b0a3) )
230794ROM_END
231795
232796/*
r2454r2455
278842*/
279843
280844ROM_START( tjsb )
281   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* DIP28 Code */
845   ROM_REGION( 0x40000, REGION_CPU1, 0 )
282846   ROM_LOAD( "p0700.u16", 0x00000, 0x40000,CRC(1b2a50df) SHA1(95a272e624f727df9523667864f933118d9e633c) )
283847
284   ROM_REGION( 0x80000, REGION_SOUND1, 0 ) /* Samples */
285   ROM_LOAD( "s0703.u15", 0x00000, 0x80000,  CRC(c6f94d29) SHA1(ec413580240711fc4977dd3c96c288501aa7ef6c) )
848   ROM_REGION( 0x200000, REGION_GFX1, ROMREGION_DISPOSE )
849   ROM_LOAD( "a0701.u3", 0x000000, 0x200000, CRC(aa182140) SHA1(37c2053386c183ff726ba417d13f2063cf9a22df) )   // FIXED BITS (xxxxxxxx0xxxxxxx)
286850
287   ROM_REGION( 0x200000, REGION_GFX1, ROMREGION_INVERT )
288   ROM_LOAD( "a0701.u3", 0x000000, 0x200000, CRC(aa182140) SHA1(37c2053386c183ff726ba417d13f2063cf9a22df) )
851   ROM_REGION( 0x80000, REGION_GFX2, ROMREGION_DISPOSE )
852   ROM_LOAD( "text.u6", 0x000000, 0x080000,  CRC(3be886b8) SHA1(15b3624ed076640c1828d065b01306a8656f5a9b) )   // BADADDR     --xxxxxxxxxxxxxxxxx
289853
290   ROM_REGION( 0x80000, REGION_GFX2, ROMREGION_INVERT )
291   ROM_LOAD( "text.u6", 0x000000, 0x080000,  CRC(3be886b8) SHA1(15b3624ed076640c1828d065b01306a8656f5a9b) )
854   ROM_REGION( 0x80000, REGION_SOUND1, 0 )
855   ROM_LOAD( "s0703.u15", 0x00000, 0x80000,  CRC(c6f94d29) SHA1(ec413580240711fc4977dd3c96c288501aa7ef6c) )
292856ROM_END
293857
294static void decrypt_program_rom(int mask, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0)
295{
296   int length = memory_region_length(REGION_CPU1);
297   UINT8 *rom = memory_region(REGION_CPU1);
298   UINT8 *tmp = auto_malloc(length);
299   int i;
300858
301   /* decrypt the program ROM */
302
303   /* XOR layer */
304   for (i = 0;i < length;i++)
305   {
306      if(i & 0x2000)
307      {
308         if((i & mask) == mask)
309            rom[i] ^= 0x01;
310      }
311      else
312      {
313         if(i & 0x0100)
314         {
315            if((i & mask) == mask)
316               rom[i] ^= 0x01;
317         }
318         else
319         {
320            if(i & 0x0080)
321            {
322               if((i & mask) == mask)
323                  rom[i] ^= 0x01;
324            }
325            else
326            {
327               if((i & mask) != mask)
328                  rom[i] ^= 0x01;
329            }
330         }
331      }
332   }
333
334   memcpy(tmp,rom,length);
335
336   /* address line swap */
337   for (i = 0;i < length;i++)
338   {
339      int addr = (i & ~0xff) | BITSWAP8(i,a7,a6,a5,a4,a3,a2,a1,a0);
340      rom[i] = tmp[addr];
341   }
342}
343
344static DRIVER_INIT( iqblock )
345{
346
347   decrypt_program_rom(0x11, 7, 6, 5, 4, 3, 2, 1, 0);
348}
349
350static DRIVER_INIT( tjsb )
351{
352   decrypt_program_rom(0x05, 7, 6, 3, 2, 5, 4, 1, 0);
353}
354
355GAME( 1996, iqblocka, iqblock, igs_180, igs_180, iqblock, ROT0, "IGS", "IQ-Block (V127M)", GAME_NOT_WORKING )
356GAME( 1996, iqblockf, iqblock, igs_180, igs_180, iqblock, ROT0, "IGS", "IQ-Block (V113FR)", GAME_NOT_WORKING )
357GAME( 1997, tjsb,     0,       igs_180, igs_180, tjsb,    ROT0, "IGS", "Mahjong Tian Jiang Shen Bing", GAME_NOT_WORKING )
859GAME( 1996, iqblocka, iqblock, igs_180, iqblocka, iqblocka, ROT0, "IGS", "Shu Zi Le Yuan (V127M)",       GAME_NOT_WORKING )
860GAME( 1996, iqblockf, iqblock, igs_180, iqblocka, iqblockf, ROT0, "IGS", "Shu Zi Le Yuan (V113FR)",      GAME_NOT_WORKING )
861GAME( 1997, tjsb,     0,       igs_180, iqblocka, tjsb,     ROT0, "IGS", "Mahjong Tian Jiang Shen Bing", GAME_NOT_WORKING )
src/mame/drivers/aeroboto.c
r2454r2455
220220
221221static const struct AY8910interface ay8910_interface =
222222{
223   AY8910_LEGACY_OUTPUT,
224   AY8910_DEFAULT_LOADS,
223225   soundlatch_r,
224   soundlatch2_r
226   soundlatch2_r,
227   NULL,
228   NULL
225229};
226230
227231static MACHINE_DRIVER_START( formatz )
src/mame/drivers/konamigv.c
r2454r2455
456456   int reg = offset*2;
457457   int shift = 0;
458458
459   if (mem_mask == 0x0000ffff)
459   if (mem_mask == 0xffff0000)
460460   {
461461      reg++;
462462      shift = 16;
r2454r2455
486486   int reg = offset*2;
487487   int chip;
488488
489   if (mem_mask == 0x0000ffff)
489   if (mem_mask == 0xffff0000)
490490   {
491491      reg++;
492492      data>>= 16;
r2454r2455
517517
518518static READ32_HANDLER( trackball_r )
519519{
520   if( offset == 0 && mem_mask == 0xffff0000 )
520   if( offset == 0 && mem_mask == 0x0000ffff )
521521   {
522522      int axis;
523523      UINT16 diff;
r2454r2455
573573
574574static READ32_HANDLER( btcflash_r )
575575{
576   if (mem_mask == 0xffff0000)
576   if (mem_mask == 0x0000ffff)
577577   {
578578      return intelflash_read(0, offset*2);
579579   }
580   else if (mem_mask == 0x0000ffff)
580   else if (mem_mask == 0xffff0000)
581581   {
582582      return intelflash_read(0, (offset*2)+1)<<16;
583583   }
r2454r2455
587587
588588static WRITE32_HANDLER( btcflash_w )
589589{
590   if (mem_mask == 0xffff0000)
590   if (mem_mask == 0x0000ffff)
591591   {
592592      intelflash_write(0, offset*2, data&0xffff);
593593   }
594   else if (mem_mask == 0x0000ffff)
594   else if (mem_mask == 0xffff0000)
595595   {
596596      intelflash_write(0, (offset*2)+1, (data>>16)&0xffff);
597597   }
r2454r2455
601601{
602602//  mame_printf_debug( "r %08x %08x %08x\n", activecpu_get_pc(), offset, mem_mask );
603603
604   if( offset == 1 && mem_mask == 0x0000ffff )
604   if( offset == 1 && mem_mask == 0xffff0000 )
605605   {
606606      int axis;
607607      UINT16 diff;
r2454r2455
674674static WRITE32_HANDLER( tokimeki_serial_w )
675675{
676676   /*
677        serial EEPROM-like device here: when mem_mask == 0xffffff00 only,
677        serial EEPROM-like device here: when mem_mask == 0x000000ff only,
678678
679679        0x40 = chip enable
680680        0x20 = clock
src/mame/drivers/firetrap.c
r2454r2455
146146   if (data==0x26) {
147147      i8751_current_command=0;
148148      i8751_return=0xff; /* This value is XOR'd and must equal 0 */
149      cpunum_set_input_line_and_vector(Machine, 0,0,HOLD_LINE,0xff);
149      cpunum_set_input_line_and_vector(machine, 0,0,HOLD_LINE,0xff);
150150      return;
151151   }
152152
r2454r2455
193193   }
194194
195195   /* Signal main cpu task is complete */
196   cpunum_set_input_line_and_vector(Machine, 0,0,HOLD_LINE,0xff);
196   cpunum_set_input_line_and_vector(machine, 0,0,HOLD_LINE,0xff);
197197   i8751_current_command=data;
198198}
199199
src/mame/drivers/crgolf.c
r2454r2455
2727***************************************************************************/
2828
2929#include "driver.h"
30#include "deprecat.h"
3130#include "crgolf.h"
3231#include "sound/ay8910.h"
3332#include "sound/msm5205.h"
r2454r2455
131130
132131static READ8_HANDLER( main_to_sound_r )
133132{
134   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
133   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
135134   return main_to_sound_data;
136135}
137136
r2454r2455
158157
159158static READ8_HANDLER( sound_to_main_r )
160159{
161   cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
160   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
162161   return sound_to_main_data;
163162}
164163
src/mame/drivers/thedeep.c
r2454r2455
328328
329329static const struct YM2203interface thedeep_ym2203_intf =
330330{
331   0,0,0,0,
331   {
332      AY8910_LEGACY_OUTPUT,
333      AY8910_DEFAULT_LOADS,
334      NULL, NULL, NULL, NULL
335   },
332336   irqhandler
333337};
334338
src/mame/drivers/rmhaihai.c
r2454r2455
496496
497497static const struct AY8910interface ay8910_interface =
498498{
499   AY8910_LEGACY_OUTPUT,
500   AY8910_DEFAULT_LOADS,
499501   input_port_0_r,
500502   input_port_1_r
501503};
src/mame/drivers/zr107.c
r2454r2455
114114{
115115   COMBINE_DATA(&paletteram32[offset]);
116116   data = paletteram32[offset];
117   palette_set_color_rgb(Machine, (offset * 2) + 0, pal5bit(data >> 26), pal5bit(data >> 21), pal5bit(data >> 16));
118   palette_set_color_rgb(Machine, (offset * 2) + 1, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
117   palette_set_color_rgb(machine, (offset * 2) + 0, pal5bit(data >> 26), pal5bit(data >> 21), pal5bit(data >> 16));
118   palette_set_color_rgb(machine, (offset * 2) + 1, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
119119}
120120
121121#define NUM_LAYERS   2
r2454r2455
217217         EEPROM_set_cs_line((data & 0x4) ? CLEAR_LINE : ASSERT_LINE);
218218
219219         if (data & 0x10)
220            cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
220            cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
221221         else
222            cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
222            cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
223223      }
224224      return;
225225   }
r2454r2455
228228      if (ACCESSING_BITS_24_31)
229229      {
230230         if (data & 0x80000000)   /* CG Board 1 IRQ Ack */
231            cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ1, CLEAR_LINE);
231            cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ1, CLEAR_LINE);
232232
233233         if (data & 0x40000000)   /* CG Board 0 IRQ Ack */
234            cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, CLEAR_LINE);
234            cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, CLEAR_LINE);
235235
236236         set_cgboard_id((data >> 28) & 0x3);
237237
r2454r2455
325325{
326326   COMBINE_DATA(&paletteram32[offset]);
327327   data = paletteram32[offset];
328   palette_set_color_rgb(Machine, offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
328   palette_set_color_rgb(machine, offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
329329}
330330
331331static ADDRESS_MAP_START( jetwave_map, ADDRESS_SPACE_PROGRAM, 32 )
src/mame/drivers/dominob.c
r2454r2455
124124
125125static READ8_HANDLER( dominob_input_2_r )
126126{
127   return input_port_2_r(machine, offset);
127   return input_port_read_indexed(machine, 2);
128128}
129129
130130
r2454r2455
243243
244244static const struct AY8910interface ay8910_interface =
245245{
246   AY8910_LEGACY_OUTPUT,
247   AY8910_DEFAULT_LOADS,
246248   input_port_5_r,
247   input_port_4_r
249   input_port_4_r,
250   NULL,
251   NULL
248252};
249253
250254
src/mame/drivers/ksys573.c
r2454r2455
527527{
528528   int reg, data;
529529
530   if (mem_mask == 0xffff0000)   // word-wide command read
530   if (mem_mask == 0x0000ffff)   // word-wide command read
531531   {
532532//      mame_printf_debug("ATAPI: packet read = %04x\n", atapi_data[atapi_data_ptr]);
533533
r2454r2455
599599      int shift;
600600      reg = offset<<1;
601601      shift = 0;
602      if (mem_mask == 0xff00ffff)
602      if (mem_mask == 0x00ff0000)
603603      {
604604         reg += 1;
605605         shift = 16;
r2454r2455
650650
651651   verboselog( 2, "atapi_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
652652
653   if (mem_mask == 0xffff0000)   // word-wide command write
653   if (mem_mask == 0x0000ffff)   // word-wide command write
654654   {
655655      verboselog( 2, "atapi_w: data=%04x\n", data );
656656
r2454r2455
756756   else
757757   {
758758      reg = offset<<1;
759      if (mem_mask == 0xff00ffff)
759      if (mem_mask == 0x00ff0000)
760760      {
761761         reg += 1;
762762         data >>= 16;
src/mame/drivers/sbrkout.c
r2454r2455
139139
140140static WRITE8_HANDLER( irq_ack_w )
141141{
142   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
142   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
143143}
144144
145145
src/mame/drivers/bladestl.c
r2454r2455
319319
320320static const struct YM2203interface ym2203_interface =
321321{
322   0,
323   0,
324   upd7759_0_port_w,
325   bladestl_port_B_w
322   {
323      AY8910_LEGACY_OUTPUT,
324      AY8910_DEFAULT_LOADS,
325      NULL,
326      NULL,
327      upd7759_0_port_w,
328      bladestl_port_B_w
329   },
330   NULL
326331};
327332
328333static const struct upd7759_interface upd7759_interface =
src/mame/drivers/bwidow.c
r2454r2455
214214***************************************************************************/
215215
216216#include "driver.h"
217#include "deprecat.h"
218217#include "video/vector.h"
219218#include "video/avgdvg.h"
220219#include "machine/atari_vg.h"
r2454r2455
327326
328327static WRITE8_HANDLER( irq_ack_w )
329328{
330   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
329   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
331330}
332331
333332
src/mame/drivers/legionna.c
r2454r2455
7373***************************************************************************/
7474
7575#include "driver.h"
76#include "deprecat.h"
7776#include "cpu/z80/z80.h"
7877#include "audio/seibu.h"
7978#include "sound/3812intf.h"
src/mame/drivers/mcr68.c
r2454r2455
9292   /* make this happen, we must assume that reads from the */
9393   /* 6840 take 14 additional cycles                       */
9494   activecpu_adjust_icount(-14);
95   return mcr68_6840_upper_r(machine,offset,0);
95   return mcr68_6840_upper_r(machine,offset,0xffff);
9696}
9797
9898
src/mame/drivers/funworld.c
r2454r2455
4646    * Joker Card (Ver.A267BC, encrypted),               Vesely Svet,        1993.
4747    * Mongolfier New (italian),                         bootleg,            199?.
4848    * Soccer New (italian),                             bootleg,            199?.
49    * Snooker 10 (Ver 1.11),                            Sandii',            1998.
5049    * Saloon (french, encrypted),                       unknown,            199?.
5150
5251
r2454r2455
145144
146145    NOTES BY GAME/SET:
147146
148    - Pool 10
149    - Cuore 1
150    - Elephant Family
151    - Tortuga Family
152    - Pot Game
147    * Pool 10
148    * Cuore 1
149    * Elephant Family
150    * Tortuga Family
151    * Pot Game
153152
154153    In Italy many people became addicted to videopokers. They put so much money on them,
155154    and they had to sell the house. Also some engineers modified videopokers to do less
r2454r2455
174173    the supported set is the program rom that is double sized, having identical halves.
175174
176175
177    - Jolly Card (austrian, Funworld, bootleg)
176    * Jolly Card (austrian, Funworld, bootleg)
178177
179178    This one seems to have normal RAM instead of NVRAM.
180179    Going through the code, there's not any NVRAM initialization routine through service 1 & 2.
181180
182181
183    - Jolly Card Professional 2.0 (Spale-Soft)
182    * Jolly Card Professional 2.0 (Spale-Soft)
184183
185184    Each 1st boot, this game show a generated code. You must enter this code in a DOS program to
186185    get the input codes necessary to allow boot the game.
187186
187    This set is one of the most wanted for customers because is a real SCAM.
188    The program has 2 hidden menues that allow change parameters without knowledge of the players.
188189
189    - Jolly Card (croatian sets) and Jolly Card Professional 2.0
190190
191    * Jolly Card (croatian sets) and Jolly Card Professional 2.0
192
191193    These games don't operate with regular coins/tokens. Only remote credits are allowed.
192194
193195
194    - Magic Card II (Impera)
196    * Magic Card II (Impera)
195197
196198    Impera made 2 graphics sets for this game. One of them is encrypted, and meant for the TAB blue board.
197199    This board has two HY18CV85 (electrically-erasable PLD) that handle the encryption.
198200    In another hand, the sound has some weird things, but is confirmed that happen in the real thing.
199201
202    The game resolution seems to change 'on the fly' when entering the input test mode.
203    There aren't any writes to the m6845 registers to manage these changes.
200204
201    - Jolly Joker (Impera, 50bet)
205    Regarding the CPU, it seems to be a custom one, or a daughterboard with a 65c02 + PLDs/TTLs.
206    Some CPU instructions seems to be changed. The following piece of code at $C1A8 is very clear:
202207
208    C1A8: A0 00         ldy  #$00       ; clear Y register to use as counter.
209
210    C1AA: B9 9D C1      lda  $C19D,y    ; load PIA port address
211    C1AD: 85 06         sta  $06        ; into $06-$07 ZP vector.
212    C1AF: B9 92 C1      lda  $C192,y    ;
213    C1B2: 85 07         sta  $07        ;
214    C1B4: C0 0B         cpy  #$0B
215    C1B6: B0 0C         bcs  $C1C4
216
217    ... load values to store into Accumulator...
218    ...
219    C1C6: 91 06         sta  ($06),y    ; store value in PIA port, indexed (Y).
220    C1C8: C8            iny             ; increment Y
221    C1C9: C0 0C         cpy  #$0C       ; finish?
222    C1CB: D0 DD         bne  $C1AA      ; if not, branch to load a new PIA adress.
223
224    In this example, as soon as Y register increments, the indexed writes go out of range.
225    To get this piece of code working and initialize the PIAs properly, the instruction 0x91 should be
226    "sta ($ZP)" instead of Y indexed. (like instruction 0x92 in stock 65c02's).
227
228
229    * Jolly Joker (Impera, 50bet)
230
203231    To boot this game for 1st time, DSW should be in the following position:
204232    1=ON 2=OFF 3=ON 4=OFF 5=OFF 6=ON 7=ON 8=OFF
205233
r2454r2455
207235    When numbers start to fill the screen, press RESET (key F3) again to start the game.
208236
209237
210    - Mongolfier New
211    - Soccer New
238    * Mongolfier New
239    * Soccer New
212240
213241    These games are based in Royal Card. They are running in a heavely modified Royal Card
214242    hardware with a microcontroller as an extra (protection?) component and a TDA2003 as
r2454r2455
224252    about them and start to implement the missing pieces for an accurate emulation.
225253
226254
227    - Snooker 10
255    * Saloon
228256
229    This game is running in a complete different hardware.
230    2x MACH231-15, an AD-65 (equivalent to OKI6295), no AY-8910, no NVRAM, no PIAs, no CRTC,
231    different memory map, and an unknown DIP40 IC, that could be an extra CPU or MCU.
232    Tiles are flipped in X-axis respect to the normal funworld games, so need it's own GFX decode.
233    Also palette is stored in a normal 27C256 ROM, repeated 64 times.
234
235    This game should be moved to a new driver in a near future, as soon as we know a bit more
236    about it and start to implement the missing pieces for an accurate emulation.
237
238
239    - Saloon
240
241257    This game is totally encrypted. No PIAs to drive I/O. The PCB has printed "LEOPARDO 5", so we
242258    can expect a game called the same way to appear.
243259
r2454r2455
628644    - 1x green led
629645
630646
631    Snooker 10 (Ver 1.11)
632    ---------------------
633
634    - 1x Unknown DIP40 (main)
635    - 1x AD-65 (equivalent to OKI6295)
636    - 1x LM358N (sound)
637    - 1x TDA2003 (sound)
638    - 2x MACH231-15-JC/1-18JI/1
639    - 1x oscillator 16.00MHz
640
641    - 2x TMS27C256 (1,2)
642    - 2x M27C256 (3,5)
643    - 1x M27C2001 (4)
644
645    - 1x JAMMA edge connector
646    - 1x 15 legs connector
647    - 1x trimmer (volume)
648    - 1x 8 DIP switches
649    - 1x battery
650
651
652647    Saloon (France, encrypted)
653648    --------------------------
654649
r2454r2455
829824    - Added new game: Pot Game (italian).
830825    - Updated technical notes.
831826
827    2008/04/18
828    - Removed the temporary hack to jolyc980.
829    - Updated technical notes regarding Magic Card II & Jolly Card Professional 2.0.
830    - Moved snookr10 to its own driver.
831    - Minor clean-up.
832832
833
833834    *** TO DO ***
834835
835836    - Figure out the royalcdc, jokercrd and saloon encryption.
r2454r2455
859860PALETTE_INIT( funworld );
860861VIDEO_START( funworld );
861862VIDEO_START( magiccrd );
862VIDEO_START( snookr10 );
863863VIDEO_UPDATE( funworld );
864864
865865
r2454r2455
869869
870870static WRITE8_HANDLER(funworld_lamp_a_w)
871871{
872   coin_counter_w(0, data & 0x01);      // credit in counter
872   coin_counter_w(0, data & 0x01);               /* credit in counter */
873873
874   output_set_lamp_value(0, 1-((data >> 1) & 1));   // button hold1 and
875   output_set_lamp_value(2, 1-((data >> 1) & 1));   // hold3 (see pinouts)
874   output_set_lamp_value(0, 1-((data >> 1) & 1));   /* button hold1 and */
875   output_set_lamp_value(2, 1-((data >> 1) & 1));   /* hold3 (see pinouts) */
876876
877   coin_counter_w(7, data & 0x04);      // credit out counter, mapped as coin 8
877   coin_counter_w(7, data & 0x04);               /* credit out counter, mapped as coin 8 */
878878
879   output_set_lamp_value(1, 1-((data >> 3) & 1));   // button hold2/low
880   output_set_lamp_value(5, 1-((data >> 5) & 1));   // button 6 (collect/cancel)
881   output_set_lamp_value(3, (data >> 7) & 1);      // button hold4/high
879   output_set_lamp_value(1, 1-((data >> 3) & 1));   /* button hold2/low */
880   output_set_lamp_value(5, 1-((data >> 5) & 1));   /* button 6 (collect/cancel) */
881   output_set_lamp_value(3, (data >> 7) & 1);      /* button hold4/high */
882882}
883883
884884static WRITE8_HANDLER(funworld_lamp_b_w)
885885{
886   output_set_lamp_value(4, (data >> 0) & 1);      // button hold5/bet
887   output_set_lamp_value(6, (data >> 1) & 1);      // button 7 (start/play)
886   output_set_lamp_value(4, (data >> 0) & 1);      /* button hold5/bet */
887   output_set_lamp_value(6, (data >> 1) & 1);      /* button 7 (start/play) */
888888}
889889
890890
r2454r2455
915915   AM_RANGE(0x0c01, 0x0c01) AM_WRITE(AY8910_write_port_0_w)
916916   AM_RANGE(0x0e00, 0x0e00) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w)
917917   AM_RANGE(0x0e01, 0x0e01) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w)
918   AM_RANGE(0x3600, 0x36ff) AM_RAM   // some games use $3603-05 range for protection.
918   AM_RANGE(0x2c00, 0x2cff) AM_RAM   /* range for protection */
919   AM_RANGE(0x3600, 0x36ff) AM_RAM   /* some games use $3603-05 range for protection */
920   AM_RANGE(0x3c00, 0x3cff) AM_RAM   /* range for protection */
919921   AM_RANGE(0x4000, 0x4fff) AM_RAM_WRITE(funworld_videoram_w) AM_BASE(&videoram)
920922   AM_RANGE(0x5000, 0x5fff) AM_RAM   AM_WRITE(funworld_colorram_w) AM_BASE(&colorram)
921923   AM_RANGE(0x6000, 0xffff) AM_ROM
r2454r2455
929931   AM_RANGE(0x0c01, 0x0c01) AM_WRITE(AY8910_write_port_0_w)
930932   AM_RANGE(0x0e00, 0x0e00) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w)
931933   AM_RANGE(0x0e01, 0x0e01) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w)
932   AM_RANGE(0x2000, 0x2000) AM_READNOP   // some unknown reads
933   AM_RANGE(0x3e00, 0x3fff) AM_RAM   // some games use $3e03-05 range for protection.
934   AM_RANGE(0x2000, 0x2000) AM_READNOP   /* some unknown reads */
935   AM_RANGE(0x3e00, 0x3fff) AM_RAM   /* some games use $3e03-05 range for protection */
934936   AM_RANGE(0x6000, 0x6fff) AM_RAM_WRITE(funworld_videoram_w) AM_BASE(&videoram)
935937   AM_RANGE(0x7000, 0x7fff) AM_RAM   AM_WRITE(funworld_colorram_w) AM_BASE(&colorram)
936938   AM_RANGE(0x8000, 0xffff) AM_ROM
r2454r2455
949951   AM_RANGE(0x6000, 0xffff) AM_ROM
950952ADDRESS_MAP_END
951953
952static ADDRESS_MAP_START( snookr10_map, ADDRESS_SPACE_PROGRAM, 8 )   // RAM 64K (8K x 8),
953   AM_RANGE(0x0000, 0x0fff) AM_RAM
954   AM_RANGE(0x1000, 0x1000) AM_READNOP   // input port?
955   AM_RANGE(0x3000, 0x3004) AM_READNOP   // input port?
956   AM_RANGE(0x5000, 0x5001) AM_READNOP   // input port?
957   AM_RANGE(0x6000, 0x6fff) AM_RAM_WRITE(funworld_videoram_w) AM_BASE(&videoram)
958   AM_RANGE(0x7000, 0x7fff) AM_RAM   AM_WRITE(funworld_colorram_w) AM_BASE(&colorram)
959   AM_RANGE(0x8000, 0xffff) AM_ROM
960ADDRESS_MAP_END
961954
962
963955/*************************
964956*      Input ports       *
965957*************************/
r2454r2455
983975   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE )   PORT_NAME("Hoppersch") PORT_CODE(KEYCODE_W)
984976   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
985977   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
986   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 )   PORT_NAME("Abschreib (Payout)") PORT_CODE(KEYCODE_M)   // Payout? Need to check with hopper filled.
978   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 )   PORT_NAME("Abschreib (Payout)") PORT_CODE(KEYCODE_M)
987979
988980   PORT_START_TAG("IN2")
989981   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
r2454r2455
10121004   PORT_DIPSETTING(    0x00, "Dattl Insert" )
10131005   PORT_DIPSETTING(    0x10, "TAB Insert" )
10141006   PORT_DIPNAME( 0x20, 0x00, "Joker" )            PORT_DIPLOCATION("SW1:3")
1015   PORT_DIPSETTING(    0x00, "With Joker" )      // also enable Five of a Kind.
1007   PORT_DIPSETTING(    0x00, "With Joker" )      /* also enable Five of a Kind */
10161008   PORT_DIPSETTING(    0x20, "Without Joker" )
10171009   PORT_DIPNAME( 0x40, 0x00, "Hold" )            PORT_DIPLOCATION("SW1:2")
10181010   PORT_DIPSETTING(    0x00, "Auto Hold" )
r2454r2455
10451037   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
10461038   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
10471039   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1048   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 )   PORT_NAME("Vratiti Nazad (Payout)") PORT_CODE(KEYCODE_M)   // Payout? Need to check with hopper filled.
1040   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 )   PORT_NAME("Vratiti Nazad (Payout)") PORT_CODE(KEYCODE_M)
10491041
10501042   PORT_START_TAG("IN2")
10511043   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
r2454r2455
10741066   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
10751067   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
10761068   PORT_DIPNAME( 0x20, 0x00, "Joker" )            PORT_DIPLOCATION("SW1:3")
1077   PORT_DIPSETTING(    0x00, "With Joker" )      // also enable Five of a Kind.
1069   PORT_DIPSETTING(    0x00, "With Joker" )      /* also enable Five of a Kind */
10781070   PORT_DIPSETTING(    0x20, "Without Joker" )
10791071   PORT_DIPNAME( 0x40, 0x00, "Hold" )            PORT_DIPLOCATION("SW1:2")
10801072   PORT_DIPSETTING(    0x00, "Auto Hold" )
r2454r2455
11351127   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
11361128   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
11371129   PORT_DIPNAME( 0x20, 0x00, "Joker" )            PORT_DIPLOCATION("SW1:3")
1138   PORT_DIPSETTING(    0x00, "With Joker" )      // also enable Five of a Kind.
1130   PORT_DIPSETTING(    0x00, "With Joker" )      /* also enable Five of a Kind */
11391131   PORT_DIPSETTING(    0x20, "Without Joker" )
11401132   PORT_DIPNAME( 0x40, 0x00, "Hold" )            PORT_DIPLOCATION("SW1:2")
11411133   PORT_DIPSETTING(    0x00, "Auto Hold" )
r2454r2455
11681160   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
11691161   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
11701162   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1171   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 )   PORT_NAME("Vratiti Nazad (Payout)") PORT_CODE(KEYCODE_M)   // Payout? Need to check with hopper filled.
1163   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 )   PORT_NAME("Vratiti Nazad (Payout)") PORT_CODE(KEYCODE_M)
11721164
11731165   PORT_START_TAG("IN2")
11741166   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
r2454r2455
11971189   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
11981190   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
11991191   PORT_DIPNAME( 0x20, 0x00, "Joker" )            PORT_DIPLOCATION("SW1:3")
1200   PORT_DIPSETTING(    0x00, "With Joker" )      // also enable Five of a Kind.
1192   PORT_DIPSETTING(    0x00, "With Joker" )      /* also enable Five of a Kind */
12011193   PORT_DIPSETTING(    0x20, "Without Joker" )
12021194   PORT_DIPNAME( 0x40, 0x00, "Hold" )            PORT_DIPLOCATION("SW1:2")
12031195   PORT_DIPSETTING(    0x00, "Auto Hold" )
r2454r2455
13051297   PORT_DIPNAME( 0x01, 0x01, "State" )            PORT_DIPLOCATION("SW1:8")
13061298   PORT_DIPSETTING(    0x00, "Keyboard Test" )
13071299   PORT_DIPSETTING(    0x01, "Play" )
1308   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW1:7")   // remote credits settings are always 10 Points/Pulse.
1300   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW1:7")   /* remote credits settings are always 10 points/pulse */
13091301   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
13101302   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
13111303   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:6")
r2454r2455
13511343   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Hoppersch") PORT_CODE(KEYCODE_W)
13521344   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
13531345   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1354   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Abschreib (Payout)") PORT_CODE(KEYCODE_M)   // Payout? Need to check with hopper filled.
1346   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Abschreib (Payout)") PORT_CODE(KEYCODE_M)
13551347
13561348   PORT_START_TAG("IN2")
13571349   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
r2454r2455
13671359   PORT_DIPNAME( 0x01, 0x01, "State" )            PORT_DIPLOCATION("SW1:8")
13681360   PORT_DIPSETTING(    0x00, "Keyboard Test" )
13691361   PORT_DIPSETTING(    0x01, "Play" )
1370   PORT_DIPNAME( 0x02, 0x00, "Remote" )         PORT_DIPLOCATION("SW1:7")   // in some sources is listed as 'Coin-C'
1362   PORT_DIPNAME( 0x02, 0x00, "Remote" )         PORT_DIPLOCATION("SW1:7")   /* listed as 'Coin-C' in some sources */
13711363   PORT_DIPSETTING(    0x00, "10 Points/Pulse" )
13721364   PORT_DIPSETTING(    0x02, "50 Points/Pulse" )
13731365   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:6")
r2454r2455
13801372   PORT_DIPSETTING(    0x00, "Dattl Insert" )
13811373   PORT_DIPSETTING(    0x10, "TAB Insert" )
13821374   PORT_DIPNAME( 0x20, 0x00, "Joker" )            PORT_DIPLOCATION("SW1:3")
1383   PORT_DIPSETTING(    0x00, "With Joker" )      // also enable Five of a Kind.
1375   PORT_DIPSETTING(    0x00, "With Joker" )      /* also enable Five of a Kind */
13841376   PORT_DIPSETTING(    0x20, "Without Joker" )
13851377   PORT_DIPNAME( 0x40, 0x00, "Hold" )            PORT_DIPLOCATION("SW1:2")
13861378   PORT_DIPSETTING(    0x00, "Auto Hold" )
r2454r2455
14131405   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
14141406   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
14151407   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1416   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Payout") PORT_CODE(KEYCODE_M)   // Payout? Need to check with hopper filled.
1408   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Payout") PORT_CODE(KEYCODE_M)
14171409
14181410   PORT_START_TAG("IN2")
14191411   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
r2454r2455
14751467   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE )   PORT_NAME("Hoppersch") PORT_CODE(KEYCODE_W)
14761468   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
14771469   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1478   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 )   PORT_NAME("Abschreib (Payout)") PORT_CODE(KEYCODE_M)   // Payout? Need to check with hopper filled.
1470   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 )   PORT_NAME("Abschreib (Payout)") PORT_CODE(KEYCODE_M)
14791471
14801472   PORT_START_TAG("IN2")
14811473   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
r2454r2455
15041496   PORT_DIPSETTING(    0x00, "disabled" )
15051497   PORT_DIPSETTING(    0x10, "enabled" )
15061498   PORT_DIPNAME( 0x20, 0x00, "Joker" )            PORT_DIPLOCATION("SW1:3")
1507   PORT_DIPSETTING(    0x00, "With Joker" )      // also enable Five of a Kind.
1499   PORT_DIPSETTING(    0x00, "With Joker" )      /* also enable Five of a Kind */
15081500   PORT_DIPSETTING(    0x20, "Without Joker" )
15091501   PORT_DIPNAME( 0x40, 0x40, "Hold" )            PORT_DIPLOCATION("SW1:2")
15101502   PORT_DIPSETTING(    0x00, "Auto Hold" )
r2454r2455
15181510   PORT_DIPSETTING(    0x80, "Manual Payout SW" )
15191511INPUT_PORTS_END
15201512
1521static INPUT_PORTS_START( snookr10 )
1522INPUT_PORTS_END
15231513
1524
15251514/*************************
15261515*    Graphics Layouts    *
15271516*************************/
r2454r2455
15431532   8*4*2
15441533};
15451534
1546static const gfx_layout sn10_charlayout =
1547{
1548   4,8,
1549   RGN_FRAC(1,2),
1550   4,
1551   { RGN_FRAC(0,2), RGN_FRAC(0,2) + 4, RGN_FRAC(1,2), RGN_FRAC(1,2) + 4 },
1552   { 0, 1, 2, 3 },
1553   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
1554   8*4*2
1555};
15561535
1557
15581536/******************************
15591537* Graphics Decode Information *
15601538******************************/
r2454r2455
15631541   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout, 0, 16 )
15641542GFXDECODE_END
15651543
1566static GFXDECODE_START( sn10 )
1567   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, sn10_charlayout, 0, 16 )
1568GFXDECODE_END
15691544
1570
15711545/***********************
15721546*    PIA Interfaces    *
15731547***********************/
r2454r2455
16031577
16041578static const struct AY8910interface ay8910_intf =
16051579{
1606   0,   // portA in
1607   0,   // portB in
1608   funworld_lamp_a_w,   // portA out
1609   funworld_lamp_b_w   // portB out
1580   AY8910_LEGACY_OUTPUT,
1581   AY8910_DEFAULT_LOADS,
1582   NULL,            /* portA in  */
1583   NULL,            /* portB in  */
1584   funworld_lamp_a_w,   /* portA out */
1585   funworld_lamp_b_w   /* portB out */
16101586};
16111587
16121588
r2454r2455
16151591**************************/
16161592
16171593static MACHINE_DRIVER_START( funworld )
1618   // basic machine hardware
1619   MDRV_CPU_ADD_TAG("main", M65SC02, MASTER_CLOCK/8)   // 2MHz
1594    /* basic machine hardware */
1595   MDRV_CPU_ADD_TAG("main", M65SC02, MASTER_CLOCK/8)   /* 2MHz */
16201596   MDRV_CPU_PROGRAM_MAP(funworld_map, 0)
16211597   MDRV_CPU_VBLANK_INT("main", nmi_line_pulse)
16221598
16231599   MDRV_NVRAM_HANDLER(generic_0fill)
16241600
1625   // video hardware
1601    /* video hardware */
16261602
16271603   MDRV_SCREEN_ADD("main", RASTER)
16281604   MDRV_SCREEN_REFRESH_RATE(60)
16291605   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
16301606   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1631   MDRV_SCREEN_SIZE((124+1)*4, (30+1)*8)      // Taken from MC6845 init, registers 00 & 04. Normally programmed with (value-1).
1632   MDRV_SCREEN_VISIBLE_AREA(0*4, 96*4-1, 0*8, 29*8-1)   // Taken from MC6845 init, registers 01 & 06.
1607   MDRV_SCREEN_SIZE((124+1)*4, (30+1)*8)            /* Taken from MC6845 init, registers 00 & 04. Normally programmed with (value-1) */
1608   MDRV_SCREEN_VISIBLE_AREA(0*4, 96*4-1, 0*8, 29*8-1)   /* Taken from MC6845 init, registers 01 & 06 */
16331609
16341610   MDRV_GFXDECODE(funworld)
16351611
r2454r2455
16421618
16431619   MDRV_DEVICE_ADD("crtc", MC6845)
16441620
1645   // sound hardware
1621    /* sound hardware */
16461622   MDRV_SPEAKER_STANDARD_MONO("mono")
16471623
1648   MDRV_SOUND_ADD_TAG("ay8910", AY8910, MASTER_CLOCK/8)   // 2MHz
1624   MDRV_SOUND_ADD_TAG("ay8910", AY8910, MASTER_CLOCK/8)   /* 2MHz */
16491625   MDRV_SOUND_CONFIG(ay8910_intf)
1650   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 8.0)   // analyzed to avoid clips.
1626   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 8.0)   /* analyzed to avoid clips */
16511627MACHINE_DRIVER_END
16521628
16531629static MACHINE_DRIVER_START( bigdeal )
16541630   MDRV_IMPORT_FROM(funworld)
16551631
1656   MDRV_SOUND_REPLACE("ay8910", AY8910, MASTER_CLOCK/8)   // 2MHz
1632   MDRV_SOUND_REPLACE("ay8910", AY8910, MASTER_CLOCK/8)   /* 2MHz */
16571633   MDRV_SOUND_CONFIG(ay8910_intf)
1658   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 5.0)   // analyzed to avoid clips.
1634   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 5.0)   /* analyzed to avoid clips */
16591635MACHINE_DRIVER_END
16601636
16611637static MACHINE_DRIVER_START( magiccrd )
16621638   MDRV_IMPORT_FROM(funworld)
16631639
1664   MDRV_CPU_REPLACE("main", M65C02, MASTER_CLOCK/8)   // 2MHz
1640   MDRV_CPU_REPLACE("main", M65C02, MASTER_CLOCK/8)   /* 2MHz */
16651641   MDRV_CPU_PROGRAM_MAP(magiccrd_map, 0)
16661642
16671643   MDRV_SCREEN_MODIFY("main")
1668   MDRV_SCREEN_SIZE((123+1)*4, (36+1)*8)         // Taken from MC6845 init, registers 00 & 04. Normally programmed with (value-1).
1669//  MDRV_SCREEN_VISIBLE_AREA(0*4, 112*4-1, 0*8, 34*8-1) // Taken from MC6845 init, registers 01 & 06.
1670   MDRV_SCREEN_VISIBLE_AREA(0*4, 98*4-1, 0*8, 32*8-1)     // adjusted to screen for testing purposes.
1644   MDRV_SCREEN_SIZE((123+1)*4, (36+1)*8)            /* Taken from MC6845 init, registers 00 & 04. Normally programmed with (value-1) */
1645//  MDRV_SCREEN_VISIBLE_AREA(0*4, 112*4-1, 0*8, 34*8-1) /* Taken from MC6845 init, registers 01 & 06 */
1646   MDRV_SCREEN_VISIBLE_AREA(0*4, 98*4-1, 0*8, 32*8-1)   /* adjusted to screen for testing purposes */
16711647
16721648   MDRV_GFXDECODE(funworld)
16731649   MDRV_VIDEO_START(magiccrd)
16741650
1675   MDRV_SOUND_REPLACE("ay8910", AY8910, MASTER_CLOCK/8)   // 2MHz
1651   MDRV_SOUND_REPLACE("ay8910", AY8910, MASTER_CLOCK/8)   /* 2MHz */
16761652   MDRV_SOUND_CONFIG(ay8910_intf)
1677   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.6)   // analyzed to avoid clips.
1653   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.6)   /* analyzed to avoid clips */
16781654MACHINE_DRIVER_END
16791655
16801656static MACHINE_DRIVER_START( royalcrd )
16811657   MDRV_IMPORT_FROM(funworld)
16821658
1683   MDRV_CPU_REPLACE("main", M65C02, MASTER_CLOCK/8)   // original cpu = R65C02P2 (2MHz)
1659   MDRV_CPU_REPLACE("main", M65C02, MASTER_CLOCK/8)   /* 2MHz */
16841660   MDRV_CPU_PROGRAM_MAP(magiccrd_map, 0)
16851661MACHINE_DRIVER_END
16861662
16871663static MACHINE_DRIVER_START( cuoreuno )
16881664   MDRV_IMPORT_FROM(funworld)
16891665
1690   MDRV_CPU_REPLACE("main", M65C02, MASTER_CLOCK/8)   // original cpu = R65C02P2 (2MHz)
1666   MDRV_CPU_REPLACE("main", M65C02, MASTER_CLOCK/8)   /* 2MHz */
16911667   MDRV_CPU_PROGRAM_MAP(cuoreuno_map, 0)
16921668MACHINE_DRIVER_END
16931669
16941670static MACHINE_DRIVER_START( royalmcu )
16951671   MDRV_IMPORT_FROM(funworld)
16961672
1697   MDRV_CPU_REPLACE("main", M65SC02, MASTER_CLOCK/8)   // original cpu = R65C02P2 (2MHz)
1673   MDRV_CPU_REPLACE("main", M65SC02, MASTER_CLOCK/8)   /* 2MHz */
16981674   MDRV_CPU_PROGRAM_MAP(royalmcu_map, 0)
16991675MACHINE_DRIVER_END
17001676
1701static MACHINE_DRIVER_START( snookr10 )
1702   MDRV_CPU_ADD_TAG("main", M65SC02, MASTER_CLOCK/8)   // 2MHz
1703   MDRV_CPU_PROGRAM_MAP(snookr10_map, 0)
1704   MDRV_CPU_VBLANK_INT("main", nmi_line_pulse)
17051677
1706   // video hardware
1707
1708   MDRV_SCREEN_ADD("main", RASTER)
1709   MDRV_SCREEN_REFRESH_RATE(60)
1710   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
1711   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1712   MDRV_SCREEN_SIZE((128+1)*4, (30+1)*8)
1713   MDRV_SCREEN_VISIBLE_AREA(0*4, 96*4-1, 0*8, 30*8-1)
1714//  MDRV_SCREEN_SIZE((124+1)*4, (30+1)*8)
1715//  MDRV_SCREEN_VISIBLE_AREA(0*4, 96*4-1, 0*8, 29*8-1)
1716
1717//  MDRV_DEVICE_ADD("crtc", MC6845)
1718
1719   MDRV_GFXDECODE(sn10)
1720
1721//  MDRV_DEFAULT_LAYOUT(layout_funworld)
1722
1723   MDRV_PALETTE_LENGTH(0x200)
1724   MDRV_PALETTE_INIT(funworld)
1725   MDRV_VIDEO_START(snookr10)
1726   MDRV_VIDEO_UPDATE(funworld)
1727MACHINE_DRIVER_END
1728
17291678/*************************
17301679*        Rom Load        *
17311680*************************/
r2454r2455
17421691   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
17431692ROM_END
17441693
1745ROM_START( jolycdae )   // encrypted roms...
1694ROM_START( jolycdae )   /* encrypted roms...*/
17461695   ROM_REGION( 0x18000, REGION_CPU1, 0 )
17471696   ROM_LOAD( "pokeru0.bin", 0x8000, 0x10000, CRC(7732f177) SHA1(b75fca596a7315d1379fa5bcf07c449ec32c90f5) )
17481697
17491698   ROM_REGION( 0x20000, REGION_GFX1, ROMREGION_DISPOSE )
17501699   ROM_LOAD( "pokeru1.bin", 0x00000, 0x10000, CRC(878d695b) SHA1(0e1ea455e991e591316a340c56b23fa26764988d) )
17511700   ROM_LOAD( "pokeru2.bin", 0x10000, 0x10000, CRC(b7b2946a) SHA1(25b15296b32bf88db6d60991105bba667f7940cc) )
1752   ROM_COPY( REGION_GFX1,    0x10000, 0x00000, 0x8000 ) // rgn,srcoffset,offset,length.
1701   ROM_COPY( REGION_GFX1,    0x10000, 0x00000, 0x8000 ) /* rgn, srcoffset, offset, length */
17531702
17541703   ROM_REGION( 0x0200, REGION_PROMS, 0 )
17551704   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
r2454r2455
18181767   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
18191768ROM_END
18201769
1821ROM_START( jolycdit )   // encrypted graphics.
1770ROM_START( jolycdit )   /* encrypted graphics */
18221771   ROM_REGION( 0x10000, REGION_CPU1, 0 )
18231772   ROM_LOAD( "jn.bin", 0x8000, 0x8000, CRC(6ae00ed0) SHA1(5921c2882aeb5eadd0e04a477fa505ad35e9d98c) )
18241773
r2454r2455
18491798ROM_END
18501799
18511800ROM_START( jolycdab )
1852   ROM_REGION( 0x10000, REGION_CPU1, 0 )   // program is testing/writting RAM in offset $8800-$BFFF (ROM)...??
1801   ROM_REGION( 0x10000, REGION_CPU1, 0 )   /* program is testing/writting RAM in offset $8800-$BFFF (ROM)...?? */
18531802   ROM_LOAD( "ig1poker.run", 0x8000, 0x8000, CRC(c96e6542) SHA1(ed6c0cf9fe8597dba9149b2225320d8d9c39219a) )
18541803//  ROM_RELOAD(               0x4000, 0x4000 )
18551804
r2454r2455
18691818   ROM_LOAD( "poker4.003", 0x0000, 0x8000, CRC(8c33a15f) SHA1(a1c8451c99a23eeffaedb21d1a1b69f54629f8ab) )
18701819   ROM_LOAD( "poker4.002", 0x8000, 0x8000, CRC(5f4e12d8) SHA1(014b2364879faaf4922cdb82ee07692389f20c2d) )
18711820
1872   ROM_REGION( 0x0200, REGION_PROMS, 0 )
1873   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )   // jollycrd palette till a dump appear.
1821   ROM_REGION( 0x0200, REGION_PROMS, 0 )   /* using jollycrd palette till a correct dump appear */
1822   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
18741823ROM_END
18751824
18761825ROM_START( bigdealb )
r2454r2455
18811830   ROM_LOAD( "poker4.003", 0x0000, 0x8000, CRC(8c33a15f) SHA1(a1c8451c99a23eeffaedb21d1a1b69f54629f8ab) )
18821831   ROM_LOAD( "poker4.002", 0x8000, 0x8000, CRC(5f4e12d8) SHA1(014b2364879faaf4922cdb82ee07692389f20c2d) )
18831832
1884   ROM_REGION( 0x0200, REGION_PROMS, 0 )
1885   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )   // jollycrd palette till a dump appear.
1833   ROM_REGION( 0x0200, REGION_PROMS, 0 )   /* using jollycrd palette till a correct dump appear */
1834   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
18861835ROM_END
18871836
1888ROM_START( jolycdat )   // there are unused pieces of code that compare or jumps within $4000-$5000 range.
1837ROM_START( jolycdat )   /* there are unused pieces of code that compare or jumps within $4000-$5000 range */
18891838   ROM_REGION( 0x10000, REGION_CPU1, 0 )
18901839   ROM_LOAD( "bonucard.cpu", 0x8000, 0x4000, CRC(da342100) SHA1(451fa6074aad19e9efd148c3d18115a20a3d344a) )
18911840   ROM_CONTINUE(           0xc000, 0x4000 )
r2454r2455
18941843   ROM_LOAD( "jolycard.ch2", 0x0000, 0x8000, CRC(c512b103) SHA1(1f4e78e97855afaf0332fb75e1b5571aafd01c29) )
18951844   ROM_LOAD( "jolycard.ch1", 0x8000, 0x8000, CRC(0f24f39d) SHA1(ac1f6a8a4a2a37cbc0d45c15187b33c25371bffb) )
18961845
1897   ROM_REGION( 0x0200, REGION_PROMS, 0 )
1898   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )   // jollycrd palette till a dump appear.
1846   ROM_REGION( 0x0200, REGION_PROMS, 0 )   /* using jollycrd palette till a correct dump appear */
1847   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
18991848ROM_END
19001849
19011850ROM_START( cuoreuno )
r2454r2455
19221871   ROM_REGION( 0x20000, REGION_GFX1, ROMREGION_DISPOSE )
19231872   ROM_LOAD( "eleph_c.u22", 0x00000, 0x10000, CRC(4b909bf3) SHA1(a822b12126bc58af6d3f999ab2117370015a039b) )
19241873   ROM_LOAD( "eleph_b.u21", 0x10000, 0x10000, CRC(e3612670) SHA1(beb65f7d2bd6d7bc68cfd876af51910cf6417bd0) )
1925   ROM_COPY( REGION_GFX1,    0x10000, 0x00000, 0x8000 ) // rgn,srcoffset,offset,length.
1874   ROM_COPY( REGION_GFX1,    0x10000, 0x00000, 0x8000 ) /* rgn, srcoffset, offset, length */
19261875
19271876   ROM_REGION( 0x0200, REGION_PROMS, 0 )
19281877   ROM_LOAD( "am27s29_ef.u25",    0x0000, 0x0200, CRC(bca8b82a) SHA1(4aa19f5ecd9953bf8792dceb075a746f77c01cfc) )
r2454r2455
19751924   ROM_REGION( 0x20000, REGION_GFX1, ROMREGION_DISPOSE )
19761925   ROM_LOAD( "u20.bin", 0x00000, 0x10000, CRC(3bdf1106) SHA1(fa21cbd49bb27ea4a784cf4e4b3fbd52650a285b) )
19771926   ROM_LOAD( "u21.bin", 0x10000, 0x10000, CRC(581c4878) SHA1(5ae61af090feea1745e22f46b33b2c01e6013fbe) )
1978   ROM_COPY( REGION_GFX1,    0x10000, 0x00000, 0x8000 ) // rgn,srcoffset,offset,length.
1927   ROM_COPY( REGION_GFX1,    0x10000, 0x00000, 0x8000 ) /* rgn, srcoffset, offset, length */
19791928
19801929   ROM_REGION( 0x0200, REGION_PROMS, 0 )
19811930   ROM_LOAD( "n82s147an_p10.u25",    0x0000, 0x0200, CRC(1de03d14) SHA1(d8eda20865c1d885a428931f4380032e103b252c) )
r2454r2455
20371986   ROM_LOAD( "2-peel18cv8.bin",   0x0400, 0x0155, CRC(8fdafd55) SHA1(fbb187ba682111648ea1586f400990cb81a3077a) )
20381987ROM_END
20391988
2040ROM_START( royalcdb ) // both halves have different program. we're using the 2nd one.
2041   ROM_REGION( 0x20000, REGION_CPU1, 0 )   // 1st half prg is testing RAM in offset $8600-$BF00...??
1989ROM_START( royalcdb ) /* both halves have different programs. we're using the 2nd one */
1990   ROM_REGION( 0x20000, REGION_CPU1, 0 )   /* 1st half prg is testing RAM in offset $8600-$BF00...?? */
20421991   ROM_LOAD( "rc.bin", 0x10000, 0x10000, CRC(8a9a6dd6) SHA1(04c3f9f17d5404ac1414c51ef8f930df54530e72) )
20431992   ROM_COPY( REGION_CPU1,   0x18000, 0x8000, 0x8000 )
20441993
20451994   ROM_REGION( 0x20000, REGION_GFX1, ROMREGION_DISPOSE )
20461995   ROM_LOAD( "1a.bin", 0x0000, 0x10000, CRC(8a66f22c) SHA1(67d6e8f8f5a0fd979dc498ba2cc67cf707ccdf95) )
20471996   ROM_LOAD( "2a.bin", 0x10000, 0x10000, CRC(3af71cf8) SHA1(3a0ce0d0abebf386573c5936545dada1d3558e55) )
2048   ROM_COPY( REGION_GFX1,    0x10000, 0x00000, 0x8000 ) // rgn,srcoffset,offset,length.
1997   ROM_COPY( REGION_GFX1,    0x10000, 0x00000, 0x8000 )   /* rgn, srcoffset, offset, length */
20491998
20501999   ROM_REGION( 0x0200, REGION_PROMS, 0 )
20512000   ROM_LOAD( "n82s147.bin",    0x0000, 0x0200, CRC(8bc86f48) SHA1(4c677ab9314a1f571e35104b22659e6811aeb194) )
r2454r2455
20542003   ROM_LOAD( "palce16v8h-4.bin",   0x0000, 0x0117, NO_DUMP ) /* PAL is read protected */
20552004ROM_END
20562005
2057ROM_START( royalcdc )   // encrypted program rom.
2006ROM_START( royalcdc )   /* encrypted program rom */
20582007   ROM_REGION( 0x10000, REGION_CPU1, 0 )
20592008   ROM_LOAD( "rc_1.bin", 0x8000, 0x8000, CRC(8cdcc978) SHA1(489b58760a7c8646399c8cdfb86ec4341823e7dd) )
20602009
r2454r2455
20662015   ROM_LOAD( "82s147.bin",    0x0000, 0x0200, CRC(44dbf086) SHA1(43a2d615c00605db75a4fd4d57d9e056c0356f10) )
20672016
20682017   ROM_REGION( 0x0600, REGION_PLDS, 0 )
2069   ROM_LOAD( "palce16v8.bin",  0x0000, 0x0117, NO_DUMP )   // not present in the set.
2070   ROM_LOAD( "1-peel18cv8p.bin",   0x0200, 0x0155, NO_DUMP )   // not present in the set.
2071   ROM_LOAD( "2-peel18cv8p.bin",   0x0400, 0x0155, NO_DUMP )   // not present in the set.
2018   ROM_LOAD( "palce16v8.bin",  0x0000, 0x0117, NO_DUMP )   /* not present in the set */
2019   ROM_LOAD( "1-peel18cv8p.bin",   0x0200, 0x0155, NO_DUMP )   /* not present in the set */
2020   ROM_LOAD( "2-peel18cv8p.bin",   0x0400, 0x0155, NO_DUMP )   /* not present in the set */
20722021ROM_END
20732022
20742023ROM_START( lluck3x3 )
r2454r2455
20972046
20982047ROM_START( magiccrd )   /* Impera */
20992048   ROM_REGION( 0x18000, REGION_CPU1, 0 )
2100    ROM_LOAD( "magicard.004", 0x0000, 0x8000,  CRC(f6e948b8) SHA1(7d5983015a508ab135ccbf69b7f3c526c229e3ef) ) // only last 16kbyte visible?
2101   ROM_LOAD( "magicard.01",  0x8000, 0x10000, CRC(c94767d4) SHA1(171ac946bdf2575f9e4a31e534a8e641597af519) ) // 1ST AND 2ND HALF IDENTICAL
2049    ROM_LOAD( "magicard.004", 0x0000, 0x8000,  CRC(f6e948b8) SHA1(7d5983015a508ab135ccbf69b7f3c526c229e3ef) ) /* only last 16kbyte visible? */
2050   ROM_LOAD( "magicard.01",  0x8000, 0x10000, CRC(c94767d4) SHA1(171ac946bdf2575f9e4a31e534a8e641597af519) ) /* 1st and 2nd half identical */
21022051
21032052   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
21042053   ROM_LOAD( "mc2gr2.bin",   0x0000, 0x8000, CRC(733da697) SHA1(45122c64d5a371ec91cecc67b7faf179078e714d) )
r2454r2455
22092158    Seems to be a Big Deal clone.
22102159*/
22112160   ROM_REGION( 0x18000, REGION_CPU1, 0 )
2212    ROM_LOAD( "ic41.bin",   0x8000,  0x8000, CRC(d36188b3) SHA1(3fb848fabbbde9fbb70875b3dfef62bfb3a8cbcb) ) // only last 16kbyte visible?
2213   ROM_LOAD( "ic37.bin",   0x10000, 0x8000, CRC(8e0d70c4) SHA1(018f92631acbe98e5826a41698f0e07b4b46cd71) ) // 1ST AND 2ND HALF IDENTICAL
2214   ROM_COPY( REGION_CPU1,   0x10000, 0xc000, 0x4000 ) // rgn,srcoffset,offset,length.
2161    ROM_LOAD( "ic41.bin",   0x8000,  0x8000, CRC(d36188b3) SHA1(3fb848fabbbde9fbb70875b3dfef62bfb3a8cbcb) ) /* only last 16kbyte visible? */
2162   ROM_LOAD( "ic37.bin",   0x10000, 0x8000, CRC(8e0d70c4) SHA1(018f92631acbe98e5826a41698f0e07b4b46cd71) ) /* 1st and 2nd half identical */
2163   ROM_COPY( REGION_CPU1,   0x10000, 0xc000, 0x4000 ) /* rgn, srcoffset, offset, length */
22152164
22162165   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
22172166   ROM_LOAD( "ic10.bin",   0x0000, 0x8000, CRC(2bbd27ad) SHA1(37d37899398d95beac5f3cbffc4277c97aca1a23) )
2218   ROM_LOAD( "ic11.bin",   0x8000, 0x8000, CRC(21d05a57) SHA1(156c18ec31b08e4c4af6f73b49cb5d5c68d1670f) ) // bad dump?, or sprite plane
2167   ROM_LOAD( "ic11.bin",   0x8000, 0x8000, CRC(21d05a57) SHA1(156c18ec31b08e4c4af6f73b49cb5d5c68d1670f) ) /* bad dump?, or sprite plane */
22192168
22202169   ROM_REGION( 0x0200, REGION_PROMS, 0 )
22212170   ROM_LOAD( "ic13.bin",   0x0000, 0x0200, CRC(e59fc06e) SHA1(88a3bb89f020fe2b20f768ca010a082e0b974831) )
r2454r2455
22322181   ROM_REGION( 0x20000, REGION_GFX1, ROMREGION_DISPOSE )
22332182   ROM_LOAD( "mong.rc.b2.u3", 0x00000, 0x10000, CRC(5e019b73) SHA1(63a544dccb9589e5a6b938e604c09d4d8fc060fc) )
22342183   ROM_LOAD( "mong.rc.c1.u2", 0x10000, 0x10000, CRC(e3fc24c4) SHA1(ea4e67ace63b55a76365f7e11a67c7d420a52dd7) )
2235   ROM_COPY( REGION_GFX1,    0x10000, 0x8000, 0x8000 ) // rgn,srcoffset,offset,length.
2184   ROM_COPY( REGION_GFX1,    0x10000, 0x8000, 0x8000 ) /* rgn, srcoffset, offset, length */
22362185
22372186   ROM_REGION( 0x0200, REGION_PROMS, 0 )
22382187   ROM_LOAD( "am27s29pc_mf.u24",    0x0000, 0x0200, CRC(da9181af) SHA1(1b30d992f3b2a4b3bd81e3f99632311988e2e8d1) )
r2454r2455
22522201   ROM_REGION( 0x20000, REGION_GFX1, ROMREGION_DISPOSE )
22532202   ROM_LOAD( "soccer2.u3", 0x00000, 0x10000, CRC(db09b5bb) SHA1(a12bf2938f5482ea5ebc0db6fd6594e1beb97017) )
22542203   ROM_LOAD( "soccer1.u2", 0x10000, 0x10000, CRC(564cc467) SHA1(8f90c4bacd97484623666b25dae77e628908e243) )
2255   ROM_COPY( REGION_GFX1,    0x10000, 0x8000, 0x8000 ) // rgn,srcoffset,offset,length.
2204   ROM_COPY( REGION_GFX1,    0x10000, 0x8000, 0x8000 ) /* rgn, srcoffset, offset, length */
22562205
22572206   ROM_REGION( 0x0200, REGION_PROMS, 0 )
22582207   ROM_LOAD( "am27s29pc_sn.u24",    0x0000, 0x0200, CRC(d02894fc) SHA1(adcdc912cc0b7a7f67b122fa94fca921c957b282) )
r2454r2455
22612210   ROM_LOAD( "palce16v8h_sn.u5",  0x0000, 0x0117, NO_DUMP ) /* PAL is read protected */
22622211ROM_END
22632212
2264ROM_START( snookr10 )
2265   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2266   ROM_LOAD( "1.u2", 0x8000, 0x8000, CRC(216ccb2d) SHA1(d86270cd03a08f6fd3e7b327b8173f66da28e5e8) )
2267
2268    /* the first 256 bytes looks as a color palette.
2269       unknown code starting at 0x0400 */
2270   ROM_REGION( 0x40000, REGION_CPU2, 0 )
2271   ROM_LOAD( "4.u18", 0x00000, 0x40000 , CRC(17090d56) SHA1(3a4c247f96c80f8cf4c1389b273880c5ea6fc39d) )
2272
2273   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
2274   ROM_LOAD( "2.u22", 0x0000, 0x8000, CRC(a70d9c48) SHA1(3fa90190323526553866662afda4dbe1c94abeff) )
2275   ROM_LOAD( "3.u25", 0x8000, 0x8000, CRC(3009faaa) SHA1(d1cda455b270cb9afa65b9701735a3a1f2a48df2) )
2276
2277    /* This should be changed because the palette is stored in a normal ROM instead of a color PROM */
2278   ROM_REGION( 0x8000, REGION_PROMS, 0 )
2279   ROM_LOAD( "5.u27", 0x0000, 0x8000, CRC(f3d7d640) SHA1(f78060f4603e316fa3c2ec4ba6d7edf261cf6d8a) )
2280ROM_END
2281
22822213ROM_START( saloon )
22832214   ROM_REGION( 0x10000, REGION_CPU1, 0 )
22842215   ROM_LOAD( "1s.bin", 0x8000, 0x8000, CRC(66938330) SHA1(09118d607eff7121472db7d2cc24079e063dc7cf) )
r2454r2455
23332264
23342265   for (x=0x0000;x<0x10000;x++)
23352266   {
2336      na = src[x] & 0xf0;   // nibble a
2337      nb = src[x] & 0x0f;   // nibble b
2267      na = src[x] & 0xf0;   /* nibble a */
2268      nb = src[x] & 0x0f;   /* nibble b */
23382269
23392270      switch (na)
23402271      {
r2454r2455
23742305         default: nbd = nb; break;
23752306      }
23762307
2377      src[x] = nad + nbd;   // decrypted value.
2308      src[x] = nad + nbd;   /* decrypted value */
23782309   }
23792310
23802311   /* Initializing PIAs... */
r2454r2455
23842315
23852316static DRIVER_INIT( jolycdae )
23862317{
2387   /* decrypting roms... */
2318   /* Decrypting roms... */
23882319
23892320   int x;
23902321   UINT8 *srcp = memory_region( REGION_CPU1 );
r2454r2455
23922323
23932324   for (x=0x8000;x<0x18000;x++)
23942325   {
2395      srcp[x] = srcp[x] ^ 0x56;   // simple XOR with 0x56
2326      srcp[x] = srcp[x] ^ 0x56;   /* simple XOR with 0x56 */
23962327   }
23972328
23982329   for (x=0x0000;x<0x20000;x++)
23992330   {
2400      srcg[x] = srcg[x] ^ 0x56;   // simple XOR with 0x56
2331      srcg[x] = srcg[x] ^ 0x56;   /* simple XOR with 0x56 */
24012332   }
24022333
24032334   /* Initializing PIAs... */
r2454r2455
24202351
24212352*************************************************************************************************/
24222353
2354//  UINT8 *ROM = memory_region(REGION_CPU1);
2355
2356//  ROM[0xc1fc] = 0x4c;
2357//  ROM[0xc1fd] = 0x1c;
2358//  ROM[0xc1fe] = 0x80;
2359
2360   /* Initializing PIAs... */
2361   pia_config(0, &pia0_intf);
2362   pia_config(1, &pia1_intf);
2363}
2364
2365static DRIVER_INIT( magiccda )
2366/*****************************************************************
2367
2368  For a serie of Mexican Rockwell's 65c02
2369  seems that opcode 0x91 is STA ($zp) instead of STA ($zp),y
2370  ...or is patched with the correct opcode (0x92) by PLDs...
2371
2372  In offset $C1C4, the code is trying to initialize both PIAs
2373  putting value 0x34 in $0800-$0803 & $0A00-$0A03.
2374
2375  The code use STA ($zp),y (opcode 0x91). As soon as register 'y'
2376  increments, almost all writes goes out of range.
2377
2378******************************************************************/
2379{
24232380   UINT8 *ROM = memory_region(REGION_CPU1);
24242381
2425   ROM[0xc1fc] = 0x4c;
2426   ROM[0xc1fd] = 0x1c;
2427   ROM[0xc1fe] = 0x80;
2382   ROM[0xc1c6] = 0x92;
24282383
24292384   /* Initializing PIAs... */
24302385   pia_config(0, &pia0_intf);
24312386   pia_config(1, &pia1_intf);
24322387}
24332388
2389static DRIVER_INIT( magiccdb )
2390/*** same as blue TAB pcb, with the magiccda patch ***/
2391{
2392   int x, na, nb, nad, nbd;
2393   UINT8 *src = memory_region( REGION_GFX1 );
2394   UINT8 *ROM = memory_region( REGION_CPU1 );
2395
2396   for (x=0x0000;x<0x10000;x++)
2397   {
2398      na = src[x] & 0xf0;   /* nibble a */
2399      nb = src[x] & 0x0f;   /* nibble b */
2400
2401      switch (na)
2402      {
2403         case 0x10: nad = 0x30; break;
2404         case 0x20: nad = 0x60; break;
2405         case 0x30: nad = 0x50; break;
2406         case 0x40: nad = 0xc0; break;
2407         case 0x50: nad = 0xf0; break;
2408         case 0x60: nad = 0xa0; break;
2409         case 0x70: nad = 0x90; break;
2410         case 0x90: nad = 0xb0; break;
2411         case 0xa0: nad = 0xe0; break;
2412         case 0xb0: nad = 0xd0; break;
2413         case 0xc0: nad = 0x40; break;
2414         case 0xd0: nad = 0x70; break;
2415         case 0xe0: nad = 0x20; break;
2416         case 0xf0: nad = 0x10; break;
2417         default: nad = na; break;
2418      }
2419
2420      switch (nb)
2421      {
2422         case 0x01: nbd = 0x03; break;
2423         case 0x02: nbd = 0x06; break;
2424         case 0x03: nbd = 0x05; break;
2425         case 0x04: nbd = 0x0c; break;
2426         case 0x05: nbd = 0x0f; break;
2427         case 0x06: nbd = 0x0a; break;
2428         case 0x07: nbd = 0x09; break;
2429         case 0x09: nbd = 0x0b; break;
2430         case 0x0a: nbd = 0x0e; break;
2431         case 0x0b: nbd = 0x0d; break;
2432         case 0x0c: nbd = 0x04; break;
2433         case 0x0d: nbd = 0x07; break;
2434         case 0x0e: nbd = 0x02; break;
2435         case 0x0f: nbd = 0x01; break;
2436         default: nbd = nb; break;
2437      }
2438
2439      src[x] = nad + nbd;   /* decrypted value */
2440   }
2441
2442   ROM[0xc1c6] = 0x92;
2443
2444   /* Initializing PIAs... */
2445   pia_config(0, &pia0_intf);
2446   pia_config(1, &pia1_intf);
2447}
2448
24342449static DRIVER_INIT( soccernw )
24352450{
24362451/* temporary patch to avoid hardware errors for debug purposes */
r2454r2455
24832498GAME( 1991, lluck3x3, royalcrd, cuoreuno, royalcrd, funworld, ROT0, "TAB-Austria",     "Lucky Lady (3x3 deal)",                           0 )
24842499GAME( 1991, lluck4x1, royalcrd, royalcrd, royalcrd, funworld, ROT0, "TAB-Austria",     "Lucky Lady (4x1 aces)",                           0 )
24852500GAME( 1996, magiccrd, 0,        magiccrd, magiccrd, funworld, ROT0, "Impera",          "Magic Card II (bulgarian)",                       GAME_IMPERFECT_SOUND )
2486GAME( 1996, magiccda, magiccrd, magiccrd, magiccrd, funworld, ROT0, "Impera",          "Magic Card II (green TAB or Impera board)",       GAME_NOT_WORKING )
2487GAME( 1996, magiccdb, magiccrd, magiccrd, magiccrd, tabblue,  ROT0, "Impera",          "Magic Card II (blue TAB board, encrypted)",       GAME_NOT_WORKING )
2501GAME( 1996, magiccda, magiccrd, magiccrd, magiccrd, magiccda, ROT0, "Impera",          "Magic Card II (green TAB or Impera board)",       GAME_NOT_WORKING )
2502GAME( 1996, magiccdb, magiccrd, magiccrd, magiccrd, magiccdb, ROT0, "Impera",          "Magic Card II (blue TAB board, encrypted)",       GAME_NOT_WORKING )
24882503GAME( 1993, vegasslw, 0,        funworld, funworld, funworld, ROT0, "Funworld",        "Royal Vegas Joker Card (slow deal)",              0 )
24892504GAME( 1993, vegasfst, vegasslw, funworld, funworld, funworld, ROT0, "Soft Design",     "Royal Vegas Joker Card (fast deal)",              0 )
24902505GAME( 1993, vegasfte, vegasslw, funworld, funworld, funworld, ROT0, "Soft Design",     "Royal Vegas Joker Card (fast deal, english gfx)", 0 )
r2454r2455
24932508GAME( 1993, jokercrd, 0,        funworld, funworld, funworld, ROT0, "Vesely Svet",     "Joker Card (Ver.A267BC, encrypted)",              GAME_WRONG_COLORS | GAME_NOT_WORKING )
24942509GAME( 199?, mongolnw, 0,        royalmcu, royalcrd, funworld, ROT0, "bootleg",         "Mongolfier New (italian)",                        GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
24952510GAME( 199?, soccernw, 0,        royalcrd, royalcrd, soccernw, ROT0, "bootleg",         "Soccer New (italian)",                            GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
2496GAME( 1998, snookr10, 0,        snookr10, snookr10, 0,        ROT0, "Sandii'",         "Snooker 10 (Ver 1.11)",                           GAME_NO_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
24972511GAME( 198?, saloon,   0,        funworld, funworld, funworld, ROT0, "Unknown",         "Saloon (french, encrypted)",                      GAME_NO_SOUND | GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
src/mame/drivers/overdriv.c
r2454r2455
129129
130130//logerror("%06x eeprom_r\n",activecpu_get_pc());
131131   /* bit 6 is EEPROM data */
132   res = (EEPROM_read_bit() << 6) | input_port_0_word_r(machine,0,0);
132   res = (EEPROM_read_bit() << 6) | input_port_read_indexed(machine,0);
133133
134134   return res;
135135}
r2454r2455
175175   if (ACCESSING_BITS_0_7)
176176   {
177177      /* bit 0 probably enables the second 68000 */
178      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
178      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
179179
180180      /* bit 1 is clear during service mode - function unknown */
181181
r2454r2455
237237
238238static WRITE16_HANDLER( overdriv_soundirq_w )
239239{
240   cpunum_set_input_line(Machine, 2,M6809_IRQ_LINE,HOLD_LINE);
240   cpunum_set_input_line(machine, 2,M6809_IRQ_LINE,HOLD_LINE);
241241}
242242
243243static WRITE16_HANDLER( overdriv_cpuB_irq5_w )
244244{
245   cpunum_set_input_line(Machine, 1,5,HOLD_LINE);
245   cpunum_set_input_line(machine, 1,5,HOLD_LINE);
246246}
247247
248248static WRITE16_HANDLER( overdriv_cpuB_irq6_w )
249249{
250   cpunum_set_input_line(Machine, 1,6,HOLD_LINE);
250   cpunum_set_input_line(machine, 1,6,HOLD_LINE);
251251}
252252
253253
src/mame/drivers/thunderx.c
r2454r2455
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1312#include "cpu/konami/konami.h" /* for the callback and the firq irq definition */
1413#include "video/konamiic.h"
1514#include "sound/2151intf.h"
r2454r2455
355354
356355static WRITE8_HANDLER( thunderx_sh_irqtrigger_w )
357356{
358   cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
357   cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);
359358}
360359
361360static WRITE8_HANDLER( scontra_snd_bankswitch_w )
src/mame/drivers/spcforce.c
r2454r2455
7575
7676static WRITE8_HANDLER( spcforce_soundtrigger_w )
7777{
78   cpunum_set_input_line(Machine, 1, 0, (~data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
78   cpunum_set_input_line(machine, 1, 0, (~data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
7979}
8080
8181
src/mame/drivers/gsword.c
r2454r2455
673673
674674static const struct AY8910interface ay8910_interface =
675675{
676   0,
677   0,
676   AY8910_LEGACY_OUTPUT,
677   AY8910_DEFAULT_LOADS,
678   NULL,
679   NULL,
678680   gsword_nmi_set_w, /* portA write */
679   0
681   NULL
680682};
681683
682684static const struct MSM5205interface msm5205_interface =
src/mame/drivers/xmen.c
r2454r2455
7676   /* bit 6 is EEPROM data */
7777   /* bit 7 is EEPROM ready */
7878   /* bit 14 is service button */
79   res = (EEPROM_read_bit() << 6) | input_port_2_word_r(machine,0,0);
79   res = (EEPROM_read_bit() << 6) | input_port_read_indexed(machine,2);
8080   if (init_eeprom_count)
8181   {
8282      init_eeprom_count--;
r2454r2455
9393   /* bit 6 is EEPROM data */
9494   /* bit 7 is EEPROM ready */
9595   /* bit 14 is service button */
96   res = (EEPROM_read_bit() << 6) | input_port_2_word_r(machine,0,0);
96   res = (EEPROM_read_bit() << 6) | input_port_read_indexed(machine,2);
9797   if (init_eeprom_count)
9898   {
9999      init_eeprom_count--;
src/mame/drivers/silkroad.c
r2454r2455
11#include "driver.h"
2#include "deprecat.h"
32#include "sound/2151intf.h"
43#include "sound/okim6295.h"
54
r2454r2455
142141static WRITE32_HANDLER( paletteram32_xRRRRRGGGGGBBBBB_dword_w )
143142{
144143   COMBINE_DATA(&paletteram32[offset]);
145   palette_set_color_rgb(Machine,offset,pal5bit(paletteram32[offset] >> (10+16)),pal5bit(paletteram32[offset] >> (5+16)),pal5bit(paletteram32[offset] >> (0+16)));
144   palette_set_color_rgb(machine,offset,pal5bit(paletteram32[offset] >> (10+16)),pal5bit(paletteram32[offset] >> (5+16)),pal5bit(paletteram32[offset] >> (0+16)));
146145}
147146
148147/* player inputs */
src/mame/drivers/wink.c
r2454r2455
1212*/
1313
1414#include "driver.h"
15#include "deprecat.h"
1615#include "sound/ay8910.h"
1716
1817static tilemap *bg_tilemap;
r2454r2455
5655
5756static WRITE8_HANDLER( sound_irq_w )
5857{
59   cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
58   cpunum_set_input_line(machine, 1,0,HOLD_LINE);
6059   //sync with sound cpu (but it still loses some soundlatches...)
6160   //timer_call_after_resynch(NULL, 0, NULL);
6261}
r2454r2455
301300
302301static const struct AY8910interface ay8912_interface =
303302{
304   sound_r
303   AY8910_LEGACY_OUTPUT,
304   AY8910_DEFAULT_LOADS,
305   sound_r,
306   NULL,
307   NULL,
308   NULL
305309};
306310
307311//AY portA is fed by an input clock at 15625 Hz
src/mame/drivers/lethal.c
r2454r2455
262262
263263static WRITE8_HANDLER( sound_irq_w )
264264{
265   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
265   cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
266266}
267267
268268static READ8_HANDLER( sound_status_r )
src/mame/drivers/runaway.c
r2454r2455
1111****************************************************************************/
1212
1313#include "driver.h"
14#include "deprecat.h"
1514#include "machine/atari_vg.h"
1615#include "sound/pokey.h"
1716
r2454r2455
8180
8281static WRITE8_HANDLER( runaway_irq_ack_w )
8382{
84   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
83   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
8584}
8685
8786
src/mame/drivers/toypop.c
r2454r2455
3030****************************************/
3131
3232#include "driver.h"
33#include "deprecat.h"
3433#include "machine/namcoio.h"
3534#include "sound/namco.h"
3635
r2454r2455
162161static WRITE8_HANDLER( toypop_main_interrupt_enable_w )
163162{
164163   cpu_interrupt_enable(0,1);
165   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
164   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
166165}
167166
168167static WRITE8_HANDLER( toypop_main_interrupt_disable_w )
r2454r2455
173172static WRITE8_HANDLER( toypop_sound_interrupt_enable_acknowledge_w )
174173{
175174   cpu_interrupt_enable(1,1);
176   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
175   cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
177176}
178177
179178static WRITE8_HANDLER( toypop_sound_interrupt_disable_w )
r2454r2455
193192
194193static WRITE8_HANDLER( toypop_sound_clear_w )
195194{
196   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
195   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
197196}
198197
199198static WRITE8_HANDLER( toypop_sound_assert_w )
200199{
201   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
200   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
202201}
203202
204203static WRITE8_HANDLER( toypop_m68000_clear_w )
205204{
206   cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, CLEAR_LINE);
205   cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, CLEAR_LINE);
207206}
208207
209208static WRITE8_HANDLER( toypop_m68000_assert_w )
210209{
211   cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, ASSERT_LINE);
210   cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, ASSERT_LINE);
212211}
213212
214213static TIMER_CALLBACK( disable_interrupts )
src/mame/drivers/tumbleb.c
r2454r2455
316316
317317static WRITE16_HANDLER( tumblepb_oki_w )
318318{
319   if (mem_mask==0x0000)
319   if (mem_mask==0xffff)
320320   {
321321      OKIM6295_data_0_w(machine,0,data&0xff);
322322      //printf("tumbleb_oki_w %04x %04x\n",data,mem_mask);
src/mame/drivers/micro3d.c
r2454r2455
513513
514514      case 0x03:        M68681.TBA = value;                   // Fill transmit buffer
515515                        M68681.SRA |=0x0400;                  // Data has been sent - TX ready for more.
516                        if(M68681.IMR & 1)   cpunum_set_input_line_and_vector(Machine, 0,3, HOLD_LINE, M68681.IVR);         // Generate an interrupt, if allowed.
516                        if(M68681.IMR & 1)   cpunum_set_input_line_and_vector(machine, 0,3, HOLD_LINE, M68681.IVR);         // Generate an interrupt, if allowed.
517517
518518#if HOST_MONITOR_DISPLAY
519519                        mame_printf_debug("%c",value);                    // Port A - Monitor
r2454r2455
541541                        // Write to sound board
542542                        if(M68681.IMR & 0x1000)
543543                        {
544                           cpunum_set_input_line_and_vector(Machine, 0,3, HOLD_LINE, M68681.IVR);         // Generate an interrupt, if allowed.
544                           cpunum_set_input_line_and_vector(machine, 0,3, HOLD_LINE, M68681.IVR);         // Generate an interrupt, if allowed.
545545                        }
546                        cpunum_set_input_line(Machine, 2, I8051_RX_LINE, ASSERT_LINE);                      // Generate 8031 interrupt
546                        cpunum_set_input_line(machine, 2, I8051_RX_LINE, ASSERT_LINE);                      // Generate 8031 interrupt
547547                        mame_printf_debug("Sound board TX: %4X at PC=%4X\n",value,activecpu_get_pc());
548548                        break;
549549
src/mame/drivers/momoko.c
r2454r2455
245245
246246static const struct YM2203interface ym2203_interface =
247247{
248   soundlatch_r
248   {
249      AY8910_LEGACY_OUTPUT,
250      AY8910_DEFAULT_LOADS,
251      soundlatch_r,
252      NULL,
253      NULL,
254      NULL
255   },
256   NULL
249257};
250258
251259static MACHINE_DRIVER_START( momoko )
src/mame/drivers/kchamp.c
r2454r2455
119119
120120static WRITE8_HANDLER( sound_reset_w ) {
121121   if ( !( data & 1 ) )
122      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE);
122      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, PULSE_LINE);
123123}
124124
125125static WRITE8_HANDLER( sound_control_w ) {
r2454r2455
204204ADDRESS_MAP_END
205205
206206static READ8_HANDLER( sound_reset_r ) {
207   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE);
207   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, PULSE_LINE);
208208   return 0;
209209}
210210
src/mame/drivers/gunbustr.c
r2454r2455
4545***************************************************************************/
4646
4747#include "driver.h"
48#include "deprecat.h"
4948#include "cpu/m68000/m68000.h"
5049#include "video/taitoic.h"
5150#include "audio/taitosnd.h"
r2454r2455
8079   COMBINE_DATA(&paletteram32[offset]);
8180
8281   a = paletteram32[offset] >> 16;
83   palette_set_color_rgb(Machine,offset*2,pal5bit(a >> 10),pal5bit(a >> 5),pal5bit(a >> 0));
82   palette_set_color_rgb(machine,offset*2,pal5bit(a >> 10),pal5bit(a >> 5),pal5bit(a >> 0));
8483
8584   a = paletteram32[offset] &0xffff;
86   palette_set_color_rgb(Machine,offset*2+1,pal5bit(a >> 10),pal5bit(a >> 5),pal5bit(a >> 0));
85   palette_set_color_rgb(machine,offset*2+1,pal5bit(a >> 10),pal5bit(a >> 5),pal5bit(a >> 0));
8786}
8887
8988static READ32_HANDLER( gunbustr_input_r )
r2454r2455
9291   {
9392      case 0x00:
9493      {
95         return (input_port_0_word_r(machine,0,0) << 16) | input_port_1_word_r(machine,0,0) |
94         return (input_port_read_indexed(machine,0) << 16) | input_port_read_indexed(machine,1) |
9695              (EEPROM_read_bit() << 7);
9796      }
9897
9998      case 0x01:
10099      {
101         return input_port_2_word_r(machine,0,0) | (coin_word << 16);
100         return input_port_read_indexed(machine,2) | (coin_word << 16);
102101      }
103102    }
104103logerror("CPU #0 PC %06x: read input %06x\n",activecpu_get_pc(),offset);
r2454r2455
175174
176175static READ32_HANDLER( gunbustr_gun_r )
177176{
178   return ( input_port_3_word_r(machine,0,0) << 24) | (input_port_4_word_r(machine,0,0) << 16) |
179       ( input_port_5_word_r(machine,0,0) << 8)  |  input_port_6_word_r(machine,0,0);
177   return ( input_port_read_indexed(machine,3) << 24) | (input_port_read_indexed(machine,4) << 16) |
178       ( input_port_read_indexed(machine,5) << 8)  |  input_port_read_indexed(machine,6);
180179}
181180
182181static WRITE32_HANDLER( gunbustr_gun_w )
src/mame/drivers/scotrsht.c
r2454r2455
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110#include "sound/2203intf.h"
1211
1312extern UINT8 *scotrsht_scroll;
src/mame/drivers/taito_z.c
r2454r2455
10291029
10301030   UINT8 port = TC0220IOC_port_r(machine,0);   /* read port number */
10311031   int steer = 0;
1032   int fake = input_port_6_word_r(machine,0,0);
1032   int fake = input_port_read_indexed(machine,6);
10331033
10341034   if (!(fake &0x10))   /* Analogue steer (the real control method) */
10351035   {
10361036      /* center around zero and reduce span to 0xc0 */
1037      steer = ((input_port_5_word_r(machine,0,0) - 0x80) * 0xc0) / 0x100;
1037      steer = ((input_port_read_indexed(machine,5) - 0x80) * 0xc0) / 0x100;
10381038
10391039   }
10401040   else   /* Digital steer */
r2454r2455
10691069
10701070   UINT8 port = TC0220IOC_port_r(machine,0);   /* read port number */
10711071   int steer = 0;
1072   int fake = input_port_10_word_r(machine,0,0);
1072   int fake = input_port_read_indexed(machine,10);
10731073
10741074   if (!(fake &0x10))   /* Analogue steer (the real control method) */
10751075   {
10761076      /* center around zero */
1077      steer = input_port_9_word_r(machine,0,0) - 0x80;
1077      steer = input_port_read_indexed(machine,9) - 0x80;
10781078   }
10791079   else   /* Digital steer */
10801080   {
r2454r2455
10911091   switch (port)
10921092   {
10931093      case 0x08:
1094         return input_port_5_word_r(machine,0,mem_mask);
1094         return input_port_read_indexed(machine,5);
10951095
10961096      case 0x09:
1097         return input_port_6_word_r(machine,0,mem_mask);
1097         return input_port_read_indexed(machine,6);
10981098
10991099      case 0x0a:
1100         return input_port_7_word_r(machine,0,mem_mask);
1100         return input_port_read_indexed(machine,7);
11011101
11021102      case 0x0b:
1103         return input_port_8_word_r(machine,0,mem_mask);
1103         return input_port_read_indexed(machine,8);
11041104
11051105      case 0x0c:
11061106         return steer &0xff;
r2454r2455
11191119   switch (offset)
11201120   {
11211121      case 0x00:
1122         return input_port_5_word_r(machine,0,mem_mask);
1122         return input_port_read_indexed(machine,5);
11231123
11241124      case 0x01:
1125         return input_port_6_word_r(machine,0,mem_mask);
1125         return input_port_read_indexed(machine,6);
11261126
11271127      case 0x02:
1128         return input_port_7_word_r(machine,0,mem_mask);
1128         return input_port_read_indexed(machine,7);
11291129
11301130      case 0x03:
1131         return input_port_8_word_r(machine,0,mem_mask);
1131         return input_port_read_indexed(machine,8);
11321132   }
11331133
11341134logerror("CPU #0 PC %06x: warning - read unmapped stick offset %06x\n",activecpu_get_pc(),offset);
r2454r2455
11521152   switch (offset)
11531153   {
11541154      case 0x00:
1155         return nightstr_stick[(input_port_5_word_r(machine,0,mem_mask) * 0x64) / 0x100];
1155         return nightstr_stick[(input_port_read_indexed(machine,5) * 0x64) / 0x100];
11561156
11571157      case 0x01:
1158         return nightstr_stick[(input_port_6_word_r(machine,0,mem_mask) * 0x64) / 0x100];
1158         return nightstr_stick[(input_port_read_indexed(machine,6) * 0x64) / 0x100];
11591159
11601160      case 0x02:
1161         return input_port_7_word_r(machine,0,mem_mask);
1161         return input_port_read_indexed(machine,7);
11621162
11631163      case 0x03:
1164         return input_port_8_word_r(machine,0,mem_mask);
1164         return input_port_read_indexed(machine,8);
11651165   }
11661166
11671167logerror("CPU #0 PC %06x: warning - read unmapped stick offset %06x\n",activecpu_get_pc(),offset);
r2454r2455
11841184static READ16_HANDLER( sci_steer_input_r )
11851185{
11861186   int steer = 0;
1187   int fake = input_port_6_word_r(machine,0,0);
1187   int fake = input_port_read_indexed(machine,6);
11881188
11891189   if (!(fake &0x10))   /* Analogue steer (the real control method) */
11901190   {
11911191      /* center around zero and reduce span to 0xc0 */
1192      steer = ((input_port_5_word_r(machine,0,0) - 0x80) * 0xc0) / 0x100;
1192      steer = ((input_port_read_indexed(machine,5) - 0x80) * 0xc0) / 0x100;
11931193   }
11941194   else   /* Digital steer */
11951195   {
r2454r2455
12351235   switch (offset)
12361236   {
12371237      case 0x00:
1238         return input_port_5_word_r(machine,0,mem_mask);   /* P1X */
1238         return input_port_read_indexed(machine,5);   /* P1X */
12391239
12401240      case 0x01:
1241         return input_port_6_word_r(machine,0,mem_mask);   /* P1Y */
1241         return input_port_read_indexed(machine,6);   /* P1Y */
12421242
12431243      case 0x02:
1244         return input_port_7_word_r(machine,0,mem_mask);   /* P2X */
1244         return input_port_read_indexed(machine,7);   /* P2X */
12451245
12461246      case 0x03:
1247         return input_port_8_word_r(machine,0,mem_mask);   /* P2Y */
1247         return input_port_read_indexed(machine,8);   /* P2Y */
12481248   }
12491249
12501250   return 0x0;
r2454r2455
12671267static READ16_HANDLER( dblaxle_steer_input_r )
12681268{
12691269   int steer = 0;
1270   int fake = input_port_6_word_r(machine,0,0);
1270   int fake = input_port_read_indexed(machine,6);
12711271
12721272   if (!(fake &0x10))   /* Analogue steer (the real control method) */
12731273   {
12741274      /* center around zero and reduce span to 0x80 */
1275      steer = ((input_port_5_word_r(machine,0,0) - 0x80) * 0x80) / 0x100;
1275      steer = ((input_port_read_indexed(machine,5) - 0x80) * 0x80) / 0x100;
12761276   }
12771277   else   /* Digital steer */
12781278   {
src/mame/drivers/phoenix.c
r2454r2455
428428
429429static const struct AY8910interface survival_ay8910_interface =
430430{
431   0,
432   survival_protection_r
431   AY8910_LEGACY_OUTPUT,
432   AY8910_DEFAULT_LOADS,
433   NULL,
434   survival_protection_r,
435   NULL,
436   NULL
433437};
434438
435439
src/mame/drivers/lastfght.c
r2454r2455
132132   if (ACCESSING_BITS_0_7)
133133   {
134134      colorram[clr_offset] = data;
135      palette_set_color_rgb(Machine, clr_offset/3,
135      palette_set_color_rgb(machine, clr_offset/3,
136136         pal6bit(colorram[(clr_offset/3)*3+0]),
137137         pal6bit(colorram[(clr_offset/3)*3+1]),
138138         pal6bit(colorram[(clr_offset/3)*3+2])
src/mame/drivers/msisaac.c
r2454r2455
77****************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110#include "cpu/z80/z80.h"
1211#include "cpu/m6805/m6805.h"
1312#include "sound/ay8910.h"
r2454r2455
8382   sound_nmi_enable = 1;
8483   if (pending_nmi)
8584   {
86      cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE);
85      cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
8786      pending_nmi = 0;
8887   }
8988}
src/mame/drivers/superqix.c
r2454r2455
291291
292292static READ8_HANDLER( nmi_ack_r )
293293{
294   cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
294   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
295295   return 0;
296296}
297297
r2454r2455
905905
906906static const struct AY8910interface pbillian_ay8910_interface =
907907{
908   AY8910_LEGACY_OUTPUT,
909   AY8910_DEFAULT_LOADS,
908910   pbillian_ay_port_a_r,         /* port Aread */
909   input_port_2_r               /* port Bread */
911   input_port_2_r,               /* port Bread */
912   NULL,
913   NULL
910914};
911915
912916static const struct AY8910interface hotsmash_ay8910_interface =
913917{
918   AY8910_LEGACY_OUTPUT,
919   AY8910_DEFAULT_LOADS,
914920   hotsmash_ay_port_a_r,         /* port Aread */
915   input_port_2_r               /* port Bread */
921   input_port_2_r,               /* port Bread */
922   NULL,
923   NULL
916924};
917925
918926static const struct AY8910interface sqix_ay8910_interface_1 =
919927{
928   AY8910_LEGACY_OUTPUT,
929   AY8910_DEFAULT_LOADS,
920930   input_port_3_r,   /* port Aread */
921931   in4_mcu_r,      /* port Bread */
932   NULL,
933   NULL
922934};
923935
924936static const struct AY8910interface sqix_ay8910_interface_2 =
925937{
926   input_port_1_r,   /* port Aread */
927   sqix_from_mcu_r,      /* port Bread */
928   0,                        /* port Awrite */
929   sqix_z80_mcu_w            /* port Bwrite */
938   AY8910_LEGACY_OUTPUT,
939   AY8910_DEFAULT_LOADS,
940   input_port_1_r,      /* port Aread */
941   sqix_from_mcu_r,   /* port Bread */
942   NULL,            /* port Awrite */
943   sqix_z80_mcu_w      /* port Bwrite */
930944};
931945
932946static const struct AY8910interface bootleg_ay8910_interface_1 =
933947{
934   input_port_3_r,   /* port Aread */
935   input_port_4_r   /* port Bread */
948   AY8910_LEGACY_OUTPUT,
949   AY8910_DEFAULT_LOADS,
950   input_port_3_r,      /* port Aread */
951   input_port_4_r,      /* port Bread */
952   NULL,
953   NULL
936954};
937955
938956static const struct AY8910interface bootleg_ay8910_interface_2 =
939957{
940   input_port_1_r,   /* port Aread */
941   bootleg_in0_r   /* port Bread */
958   AY8910_LEGACY_OUTPUT,
959   AY8910_DEFAULT_LOADS,
960   input_port_1_r,      /* port Aread */
961   bootleg_in0_r,      /* port Bread */
962   NULL,
963   NULL
942964};
943965
944966
src/mame/drivers/cojag.c
r2454r2455
247247   jaguar_dsp_resume();
248248
249249   /* halt the CPUs */
250   jaguargpu_ctrl_w(1, G_CTRL, 0, 0);
251   jaguardsp_ctrl_w(2, D_CTRL, 0, 0);
250   jaguargpu_ctrl_w(1, G_CTRL, 0, 0xffffffff);
251   jaguardsp_ctrl_w(2, D_CTRL, 0, 0xffffffff);
252252
253253   /* init the sound system */
254254   cojag_sound_reset();
r2454r2455
297297      jaguar_dsp_resume();
298298
299299      /* halt the CPUs */
300      jaguargpu_ctrl_w(1, G_CTRL, 0, 0);
301      jaguardsp_ctrl_w(2, D_CTRL, 0, 0);
300      jaguargpu_ctrl_w(1, G_CTRL, 0, 0xffffffff);
301      jaguardsp_ctrl_w(2, D_CTRL, 0, 0xffffffff);
302302   }
303303
304304   /* adjust banking */
src/mame/drivers/lockon.c
r2454r2455
6565   lockon_ctrl_reg = data & 0xff;
6666
6767   /* Bus mastering for shared access */
68   cpunum_set_input_line(Machine, GROUND_CPU, INPUT_LINE_HALT, data & 0x04 ? ASSERT_LINE : CLEAR_LINE);
69   cpunum_set_input_line(Machine, OBJECT_CPU, INPUT_LINE_HALT, data & 0x20 ? ASSERT_LINE : CLEAR_LINE);
70   cpunum_set_input_line(Machine, SOUND_CPU,  INPUT_LINE_HALT, data & 0x40 ? CLEAR_LINE : ASSERT_LINE);
68   cpunum_set_input_line(machine, GROUND_CPU, INPUT_LINE_HALT, data & 0x04 ? ASSERT_LINE : CLEAR_LINE);
69   cpunum_set_input_line(machine, OBJECT_CPU, INPUT_LINE_HALT, data & 0x20 ? ASSERT_LINE : CLEAR_LINE);
70   cpunum_set_input_line(machine, SOUND_CPU,  INPUT_LINE_HALT, data & 0x40 ? CLEAR_LINE : ASSERT_LINE);
7171}
7272
7373static READ16_HANDLER( main_gnd_r )
r2454r2455
458458
459459static const struct YM2203interface ym2203_interface =
460460{
461   input_port_1_r,
462   0,
463   0,
464   ym2203_out_b,
461   {
462      AY8910_LEGACY_OUTPUT,
463      AY8910_DEFAULT_LOADS,
464      input_port_1_r,
465      NULL,
466      NULL,
467      ym2203_out_b,
468   },
465469   ym2203_irq
466470};
467471
src/mame/drivers/mappy.c
r2454r2455
547547***************************************************************************/
548548
549549#include "driver.h"
550#include "deprecat.h"
551550#include "machine/namcoio.h"
552551#include "sound/dac.h"
553552#include "sound/namco.h"
r2454r2455
705704      case 0x00:   /* INT ON 2 */
706705         cpu_interrupt_enable(1,bit);
707706         if (!bit)
708            cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
707            cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
709708         break;
710709
711710      case 0x02:   /* INT ON */
712711         cpu_interrupt_enable(0,bit);
713712         if (!bit)
714            cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
713            cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
715714         break;
716715
717716      case 0x04:   /* n.c. */
r2454r2455
727726         break;
728727
729728      case 0x0a:   /* SUB RESET */
730         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
729         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
731730         break;
732731
733732      case 0x0c:   /* n.c. */
r2454r2455
747746      case 0x00:
748747         cpu_interrupt_enable(1,bit);
749748         if (!bit)
750            cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
749            cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
751750         break;
752751
753752      case 0x02:
754753         cpu_interrupt_enable(0,bit);
755754         if (!bit)
756            cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
755            cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
757756         break;
758757
759758      case 0x04:
760759         cpu_interrupt_enable(2,bit);
761760         if (!bit)
762            cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE);
761            cpunum_set_input_line(machine, 2, 0, CLEAR_LINE);
763762         break;
764763
765764      case 0x06:
r2454r2455
772771         break;
773772
774773      case 0x0a:
775         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
774         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
776775         break;
777776
778777      case 0x0c:
779         cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
778         cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
780779         break;
781780
782781      case 0x0e:
r2454r2455
793792      case 0x00:   /* INT ON 2 */
794793         cpu_interrupt_enable(1,bit);
795794         if (!bit)
796            cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
795            cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
797796         break;
798797
799798      case 0x02:   /* INT ON */
800799         cpu_interrupt_enable(0,bit);
801800         if (!bit)
802            cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
801            cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
803802         break;
804803
805804      case 0x04:   /* FLIP */
r2454r2455
816815         break;
817816
818817      case 0x0a:   /* SUB RESET */
819         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
818         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
820819         break;
821820
822821      case 0x0c:   /* n.c. */
src/mame/drivers/pntnpuzl.c
r2454r2455
263263      rgb[sub++] = data & 0xff;
264264      if (sub == 3)
265265      {
266         palette_set_color_rgb(Machine,indx++,pal6bit(rgb[0]),pal6bit(rgb[1]),pal6bit(rgb[2]));
266         palette_set_color_rgb(machine,indx++,pal6bit(rgb[0]),pal6bit(rgb[1]),pal6bit(rgb[2]));
267267         sub = 0;
268268         if (indx == 256) indx = 0;
269269      }
src/mame/drivers/gijoe.c
r2454r2455
9797   /* bit 8  is EEPROM data */
9898   /* bit 9  is EEPROM ready */
9999   /* bit 11 is service button */
100   res = (EEPROM_read_bit()<<8) | input_port_0_word_r(machine,0,0);
100   res = (EEPROM_read_bit()<<8) | input_port_read_indexed(machine,0);
101101
102102   if (init_eeprom_count)
103103   {
src/mame/drivers/uapce.c
r2454r2455
4141
4242   if ( diff & 0x40 )
4343   {
44      cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
44      cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
4545   }
4646
4747   // bit 3 - enable 752 Hz (D-3) square wave output
src/mame/drivers/tigeroad.c
r2454r2455
534534
535535static const struct YM2203interface ym2203_interface =
536536{
537   0,0,0,0,irqhandler
537   {
538         AY8910_LEGACY_OUTPUT,
539         AY8910_DEFAULT_LOADS,
540         NULL, NULL, NULL, NULL,
541   },
542   irqhandler
538543};
539544
540545static const struct MSM5205interface msm5205_interface =
src/mame/drivers/wilytowr.c
r2454r2455
2525***************************************************************************/
2626
2727#include "driver.h"
28#include "deprecat.h"
2928#include "cpu/i8039/i8039.h"
3029#include "sound/ay8910.h"
3130#include "sound/samples.h"
r2454r2455
221220
222221static WRITE8_HANDLER( snd_irq_w )
223222{
224   cpunum_set_input_line(Machine, 1, 0, PULSE_LINE);
223   cpunum_set_input_line(machine, 1, 0, PULSE_LINE);
225224}
226225
227226
src/mame/drivers/spaceg.c
r2454r2455
11#include "driver.h"
2#include "deprecat.h"
32#include "cpu/z80/z80.h"
43#include "sound/dac.h"
54#include "sound/sn76496.h"
r2454r2455
256255      {
257256         /* palette 1 */
258257         int col_ind = offset & 0x1f;
259         palette_set_color_rgb(Machine, 0x10 + 0x00 + col_ind, pal3bit(rgbcolor >> 0), pal3bit(rgbcolor >> 6), pal3bit(rgbcolor >> 3));
258         palette_set_color_rgb(machine, 0x10 + 0x00 + col_ind, pal3bit(rgbcolor >> 0), pal3bit(rgbcolor >> 6), pal3bit(rgbcolor >> 3));
260259      }
261260      else
262261      if ((offset>=0x300) && (offset<0x320)) /* 0xa300- 0xa31f */
263262      {
264263         /* palette 2 */
265264         int col_ind = offset & 0x1f;
266         palette_set_color_rgb(Machine, 0x10 + 0x00 + col_ind, pal3bit(rgbcolor >> 0), pal3bit(rgbcolor >> 6), pal3bit(rgbcolor >> 3));
265         palette_set_color_rgb(machine, 0x10 + 0x00 + col_ind, pal3bit(rgbcolor >> 0), pal3bit(rgbcolor >> 6), pal3bit(rgbcolor >> 3));
267266      }
268267      else
269268         logerror("palette? read from unkram offset = %04x\n",offset);
src/mame/drivers/looping.c
r2454r2455
563563
564564static const struct AY8910interface ay8910_interface =
565565{
566   soundlatch_r
566   AY8910_LEGACY_OUTPUT,
567   AY8910_DEFAULT_LOADS,
568   soundlatch_r,
569   NULL,
570   NULL,
571   NULL
567572};
568573
569574
src/mame/drivers/segas32.c
r2454r2455
854854         analog_value[offset & 3] <<= 1;
855855         return result;
856856   }
857   logerror("%06X:unknown analog_custom_io_r(%X) & %04X\n", activecpu_get_pc(), offset*2, mem_mask ^ 0xffff);
857   logerror("%06X:unknown analog_custom_io_r(%X) & %04X\n", activecpu_get_pc(), offset*2, mem_mask);
858858   return 0xffff;
859859}
860860
r2454r2455
871871         analog_value[offset & 3] = input_port_read_safe(machine, names[offset & 3], 0);
872872         return;
873873   }
874   logerror("%06X:unknown analog_custom_io_w(%X) = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask ^ 0xffff);
874   logerror("%06X:unknown analog_custom_io_w(%X) = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask);
875875}
876876
877877
r2454r2455
887887         return input_port_read_safe(machine, names[offset & 3], 0xffff);
888888   }
889889
890   logerror("%06X:unknown extra_custom_io_r(%X) & %04X\n", activecpu_get_pc(), offset*2, mem_mask ^ 0xffff);
890   logerror("%06X:unknown extra_custom_io_r(%X) & %04X\n", activecpu_get_pc(), offset*2, mem_mask);
891891   return 0xffff;
892892}
893893
r2454r2455
908908         analog_bank = data & 1;
909909         return;
910910   }
911   logerror("%06X:unknown orunners_custom_io_w(%X) = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask ^ 0xffff);
911   logerror("%06X:unknown orunners_custom_io_w(%X) = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask);
912912}
913913
914914
r2454r2455
927927         return (UINT8)(input_port_read(machine, names[offset/2]) - sonic_last[offset/2]);
928928   }
929929
930   logerror("%06X:unknown sonic_custom_io_r(%X) & %04X\n", activecpu_get_pc(), offset*2, mem_mask ^ 0xffff);
930   logerror("%06X:unknown sonic_custom_io_r(%X) & %04X\n", activecpu_get_pc(), offset*2, mem_mask);
931931   return 0xffff;
932932}
933933
r2454r2455
946946         return;
947947   }
948948
949   logerror("%06X:unknown sonic_custom_io_w(%X) = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask ^ 0xffff);
949   logerror("%06X:unknown sonic_custom_io_w(%X) = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask);
950950}
951951
952952
r2454r2455
959959
960960static WRITE16_HANDLER( random_number_16_w )
961961{
962//  mame_printf_debug("%06X:random_seed_w(%04X) = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask  ^ 0xffff);
962//  mame_printf_debug("%06X:random_seed_w(%04X) = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask);
963963}
964964
965965static READ16_HANDLER( random_number_16_r )
r2454r2455
969969
970970static WRITE32_HANDLER( random_number_32_w )
971971{
972//  mame_printf_debug("%06X:random_seed_w(%04X) = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask  ^ 0xffff);
972//  mame_printf_debug("%06X:random_seed_w(%04X) = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask);
973973}
974974
975975static READ32_HANDLER( random_number_32_r )
src/mame/drivers/badlands.c
r2454r2455
166166
167167static INTERRUPT_GEN( vblank_int )
168168{
169   int pedal_state = input_port_4_r(machine, 0);
169   int pedal_state = input_port_read_indexed(machine, 4);
170170   int i;
171171
172172   /* update the pedals once per frame */
src/mame/drivers/slapfght.c
r2454r2455
822822
823823static const struct AY8910interface ay8910_interface_1 =
824824{
825   AY8910_LEGACY_OUTPUT,
826   AY8910_DEFAULT_LOADS,
825827   input_port_0_r,
826   input_port_1_r
828   input_port_1_r,
829   NULL,
830   NULL
827831};
828832
829833static const struct AY8910interface ay8910_interface_2 =
830834{
835   AY8910_LEGACY_OUTPUT,
836   AY8910_DEFAULT_LOADS,
831837   input_port_2_r,
832   input_port_3_r
838   input_port_3_r,
839   NULL,
840   NULL
833841};
834842
835843static VIDEO_EOF( perfrman )
src/mame/drivers/astinvad.c
r2454r2455
6565static WRITE8_HANDLER( astinvad_sound1_w );
6666static WRITE8_HANDLER( astinvad_sound2_w );
6767
68static const ppi8255_interface ppi8255_intf =
68static const ppi8255_interface ppi8255_intf[2] =
6969{
70   2,
71   { input_port_0_r, NULL },
72   { input_port_1_r, input_port_3_r },
73   { input_port_2_r, NULL },
74   { NULL, astinvad_sound1_w },
75   { NULL, astinvad_sound2_w },
76   { NULL, NULL },
70   {
71      input_port_0_r,
72      input_port_1_r,
73      input_port_2_r,
74      NULL,
75      NULL,
76      NULL
77   },
78   {
79      NULL,
80      input_port_3_r,
81      NULL,
82      astinvad_sound1_w,
83      astinvad_sound2_w,
84      NULL
85   }
7786};
7887
7988
r2454r2455
195204
196205static MACHINE_START( kamikaze )
197206{
198   ppi8255_init(&ppi8255_intf);
199207   int_timer = timer_alloc(kamizake_int_gen, NULL);
200208   timer_adjust_oneshot(int_timer, video_screen_get_time_until_pos(machine->primary_screen, 128, 0), 128);
201209}
r2454r2455
221229
222230   /* the address lines are used for /CS; yes, they can overlap! */
223231   if (!(offset & 4))
224      result &= ppi8255_0_r(machine, offset);
232      result &= ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), offset);
225233   if (!(offset & 8))
226      result &= ppi8255_1_r(machine, offset);
234      result &= ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset);
227235   return result;
228236}
229237
r2454r2455
232240{
233241   /* the address lines are used for /CS; yes, they can overlap! */
234242   if (!(offset & 4))
235      ppi8255_0_w(machine, offset, data);
243      ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), offset, data);
236244   if (!(offset & 8))
237      ppi8255_1_w(machine, offset, data);
245      ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset, data);
238246}
239247
240248
r2454r2455
505513
506514   MDRV_MACHINE_START(kamikaze)
507515
516   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
517   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
518
519   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
520   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
521
508522   /* video hardware */
509523   MDRV_VIDEO_UPDATE(astinvad)
510524
src/mame/drivers/psikyosh.c
r2454r2455
431431   g = ((paletteram32[offset] & 0x00ff0000) >>16);
432432   r = ((paletteram32[offset] & 0xff000000) >>24);
433433
434   palette_set_color(Machine,offset,MAKE_RGB(r,g,b));
434   palette_set_color(machine,offset,MAKE_RGB(r,g,b));
435435}
436436
437437static WRITE32_HANDLER( psikyosh_vidregs_w )
src/mame/drivers/quizdna.c
r2454r2455
445445
446446static const struct YM2203interface ym2203_interface =
447447{
448   input_port_1_r,
449   input_port_0_r
448   {
449      AY8910_LEGACY_OUTPUT,
450      AY8910_DEFAULT_LOADS,
451      input_port_1_r,
452      input_port_0_r,
453      NULL,
454      NULL
455   },
456   NULL
450457};
451458
452459
src/mame/drivers/supertnk.c
r2454r2455
9696
9797
9898#include "driver.h"
99#include "deprecat.h"
10099#include "sound/ay8910.h"
101100
102101
r2454r2455
159158
160159static WRITE8_HANDLER( supertnk_interrupt_ack_w )
161160{
162   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
161   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
163162}
164163
165164
src/mame/drivers/bishjan.c
r2454r2455
125125   if (ACCESSING_BITS_0_7)
126126   {
127127      colorram[clr_offset] = data;
128      palette_set_color_rgb(Machine, clr_offset/3,
128      palette_set_color_rgb(machine, clr_offset/3,
129129         pal6bit(colorram[(clr_offset/3)*3+0]),
130130         pal6bit(colorram[(clr_offset/3)*3+1]),
131131         pal6bit(colorram[(clr_offset/3)*3+2])
src/mame/drivers/equites.c
r2454r2455
11191119
11201120static const struct AY8910interface equites_8910intf =
11211121{
1122   AY8910_LEGACY_OUTPUT,
1123   AY8910_DEFAULT_LOADS,
11221124   0,
11231125   0,
11241126   equites_8910porta_w,
src/mame/drivers/esh.c
r2454r2455
2323*/
2424
2525#include "driver.h"
26#include "deprecat.h"
2726#include "machine/laserdsc.h"
2827
2928/* From daphne */
r2454r2455
134133static WRITE8_HANDLER(nmi_line_w)
135134{
136135   if (data == 0x00)
137      cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, ASSERT_LINE);
136      cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE);
138137   if (data == 0x01)
139      cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
138      cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
140139
141140   if (data != 0x00 && data != 0x01)
142141      logerror("NMI line got a weird value!\n");
src/mame/drivers/gradius3.c
r2454r2455
9898      gradius3_priority = data & 0x04;
9999
100100      /* bit 3 enables cpu B */
101      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
101      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
102102
103103      /* bit 5 enables irq */
104104      irqAen = data & 0x20;
r2454r2455
153153
154154static WRITE16_HANDLER( sound_irq_w )
155155{
156   cpunum_set_input_line_and_vector(Machine, 2,0,HOLD_LINE,0xff);
156   cpunum_set_input_line_and_vector(machine, 2,0,HOLD_LINE,0xff);
157157}
158158
159159static WRITE8_HANDLER( sound_bank_w )
src/mame/drivers/omegrace.c
r2454r2455
217217***************************************************************************/
218218
219219#include "driver.h"
220#include "deprecat.h"
221220#include "video/vector.h"
222221#include "video/avgdvg.h"
223222#include "sound/ay8910.h"
src/mame/drivers/dlair.c
r2454r2455
787787
788788static const struct AY8910interface ay8910_interface =
789789{
790   AY8910_LEGACY_OUTPUT,
791   AY8910_DEFAULT_LOADS,
790792   input_port_0_r,
791793   input_port_1_r
792794};
src/mame/drivers/irobot.c
r2454r2455
7575****************************************************************************/
7676
7777#include "driver.h"
78#include "deprecat.h"
7978#include "cpu/m6809/m6809.h"
8079#include "sound/pokey.h"
8180#include "irobot.h"
r2454r2455
103102
104103static WRITE8_HANDLER( irobot_clearirq_w )
105104{
106    cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE ,CLEAR_LINE);
105    cpunum_set_input_line(machine, 0, M6809_IRQ_LINE ,CLEAR_LINE);
107106}
108107
109108
110109static WRITE8_HANDLER( irobot_clearfirq_w )
111110{
112    cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE ,CLEAR_LINE);
111    cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE ,CLEAR_LINE);
113112}
114113
115114
src/mame/drivers/skykid.c
r2454r2455
1414***************************************************************************/
1515
1616#include "driver.h"
17#include "deprecat.h"
1817#include "cpu/m6800/m6800.h"
1918#include "sound/namco.h"
2019
r2454r2455
8079static WRITE8_HANDLER( skykid_subreset_w )
8180{
8281   int bit = !BIT(offset,11);
83   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
82   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
8483}
8584
8685static WRITE8_HANDLER( skykid_bankswitch_w )
r2454r2455
9392   int bit = !BIT(offset,11);
9493   cpu_interrupt_enable(0,bit);
9594   if (!bit)
96      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
95      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
9796}
9897
9998static WRITE8_HANDLER( skykid_irq_2_ctrl_w )
r2454r2455
101100   int bit = !BIT(offset,13);
102101   cpu_interrupt_enable(1,bit);
103102   if (!bit)
104      cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
103      cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
105104}
106105
107106static MACHINE_START( skykid )
src/mame/drivers/halleys.c
r2454r2455
10021002      if (i==0 || (i==4 && !data))
10031003      {
10041004         blitter_busy = 0;
1005         if (firq_level) cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, ASSERT_LINE); // make up delayed FIRQ's
1005         if (firq_level) cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, ASSERT_LINE); // make up delayed FIRQ's
10061006      }
10071007      else
10081008      {
r2454r2455
11631163   g = d    & 0x0c; g |= i;  g = g<<4 | g;
11641164   b = d<<2 & 0x0c; b |= i;  b = b<<4 | b;
11651165
1166   palette_set_color(Machine, offset, MAKE_RGB(r, g, b));
1167   palette_set_color(Machine, offset+SP_2BACK, MAKE_RGB(r, g, b));
1168   palette_set_color(Machine, offset+SP_ALPHA, MAKE_RGB(r, g, b));
1169   palette_set_color(Machine, offset+SP_COLLD, MAKE_RGB(r, g, b));
1166   palette_set_color(machine, offset, MAKE_RGB(r, g, b));
1167   palette_set_color(machine, offset+SP_2BACK, MAKE_RGB(r, g, b));
1168   palette_set_color(machine, offset+SP_ALPHA, MAKE_RGB(r, g, b));
1169   palette_set_color(machine, offset+SP_COLLD, MAKE_RGB(r, g, b));
11701170
11711171   halleys_decode_rgb(&r, &g, &b, offset, 0);
1172   palette_set_color(Machine, offset+0x20, MAKE_RGB(r, g, b));
1172   palette_set_color(machine, offset+0x20, MAKE_RGB(r, g, b));
11731173}
11741174
11751175
r2454r2455
15681568   io_ram[0x9c] = data;
15691569
15701570   if (firq_level) firq_level--;
1571   cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, CLEAR_LINE);
1571   cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, CLEAR_LINE);
15721572}
15731573
15741574
r2454r2455
19401940
19411941static const struct AY8910interface ay8910_interface =
19421942{
1943   0,
1944   0,
1945   0,
1943   AY8910_LEGACY_OUTPUT,
1944   AY8910_DEFAULT_LOADS,
1945   NULL,
1946   NULL,
1947   NULL,
19461948   sndnmi_msk_w // port Bwrite
19471949};
19481950
src/mame/drivers/djmain.c
r2454r2455
8686   g = (data >>  8) & 0xff;
8787   b = (data >> 16) & 0xff;
8888
89   palette_set_color(Machine, offset, MAKE_RGB(r, g, b));
89   palette_set_color(machine, offset, MAKE_RGB(r, g, b));
9090}
9191
9292
r2454r2455
212212   if (ACCESSING_BITS_0_15)
213213      offset += 2;
214214
215   if (~mem_mask & 0xff00ff00)
215   if (mem_mask & 0xff00ff00)
216216      offset++;
217217
218218   return mem8[offset] * 0x01010101;
r2454r2455
232232      if (pending_vb_int && !DISABLE_VB_INT)
233233      {
234234         pending_vb_int = 0;
235         cpunum_set_input_line(Machine, 0, MC68000_IRQ_4, HOLD_LINE);
235         cpunum_set_input_line(machine, 0, MC68000_IRQ_4, HOLD_LINE);
236236      }
237237   }
238238}
r2454r2455
310310static READ32_DEVICE_HANDLER( ide_std_r )
311311{
312312   if (ACCESSING_BITS_0_7)
313      return ide_controller16_r(device, IDE_STD_OFFSET + offset, 0x00ff) >> 8;
313      return ide_controller16_r(device, IDE_STD_OFFSET + offset, 0xff00) >> 8;
314314   else
315      return ide_controller16_r(device, IDE_STD_OFFSET + offset, 0x0000) << 16;
315      return ide_controller16_r(device, IDE_STD_OFFSET + offset, 0xffff) << 16;
316316}
317317
318318static WRITE32_DEVICE_HANDLER( ide_std_w )
319319{
320320   if (ACCESSING_BITS_0_7)
321      ide_controller16_w(device, IDE_STD_OFFSET + offset, data << 8, 0x00ff);
321      ide_controller16_w(device, IDE_STD_OFFSET + offset, data << 8, 0xff00);
322322   else
323      ide_controller16_w(device, IDE_STD_OFFSET + offset, data >> 16, 0x0000);
323      ide_controller16_w(device, IDE_STD_OFFSET + offset, data >> 16, 0xffff);
324324}
325325
326326
327327static READ32_DEVICE_HANDLER( ide_alt_r )
328328{
329329   if (offset == 0)
330      return ide_controller16_r(device, IDE_ALT_OFFSET, 0xff00) << 24;
330      return ide_controller16_r(device, IDE_ALT_OFFSET, 0x00ff) << 24;
331331
332332   return 0;
333333}
r2454r2455
335335static WRITE32_DEVICE_HANDLER( ide_alt_w )
336336{
337337   if (offset == 0 && ACCESSING_BITS_16_23)
338      ide_controller16_w(device, IDE_ALT_OFFSET, data >> 24, 0xff00);
338      ide_controller16_w(device, IDE_ALT_OFFSET, data >> 24, 0x00ff);
339339}
340340
341341
r2454r2455
402402
403403static WRITE32_HANDLER( unknown590000_w )
404404{
405   //logerror("%08X: unknown 590000 write %08X: %08X & %08X\n", activecpu_get_previouspc(), offset, data, ~mem_mask);
405   //logerror("%08X: unknown 590000 write %08X: %08X & %08X\n", activecpu_get_previouspc(), offset, data, mem_mask);
406406}
407407
408408static WRITE32_HANDLER( unknown802000_w )
409409{
410   //logerror("%08X: unknown 802000 write %08X: %08X & %08X\n", activecpu_get_previouspc(), offset, data, ~mem_mask);
410   //logerror("%08X: unknown 802000 write %08X: %08X & %08X\n", activecpu_get_previouspc(), offset, data, mem_mask);
411411}
412412
413413static WRITE32_HANDLER( unknownc02000_w )
414414{
415   //logerror("%08X: unknown c02000 write %08X: %08X & %08X\n", activecpu_get_previouspc(), offset, data, ~mem_mask);
415   //logerror("%08X: unknown c02000 write %08X: %08X & %08X\n", activecpu_get_previouspc(), offset, data, mem_mask);
416416}
417417
418418
src/mame/drivers/ssfindo.c
r2454r2455
250250
251251   if(!(data>>28))
252252   {
253      palette_set_color_rgb(Machine, PS7500_FIFO[1]&0xff, data&0xff,(data>>8)&0xff,(data>>16)&0xff);
253      palette_set_color_rgb(machine, PS7500_FIFO[1]&0xff, data&0xff,(data>>8)&0xff,(data>>16)&0xff);
254254      PS7500_FIFO[1]++; //autoinc
255255   }
256256}
src/mame/drivers/peplus.c
r2454r2455
151151***********************************************************************************/
152152
153153#include "driver.h"
154#include "deprecat.h"
155154#include "sound/ay8910.h"
156155#include "cpu/i8051/i8051.h"
157156#include "machine/i2cmem.h"
r2454r2455
258257      bit2 = 0;
259258      b = 0x21 * bit2 + 0x47 * bit1 + 0x97 * bit0;
260259
261      palette_set_color(Machine, (15 + (i*16)), MAKE_RGB(r, g, b));
260      palette_set_color(machine, (15 + (i*16)), MAKE_RGB(r, g, b));
262261   }
263262}
264263
r2454r2455
494493/* Last Color in Every Palette is bgcolor */
495494static READ8_HANDLER( peplus_bgcolor_r )
496495{
497   return palette_get_color(Machine, 15); // Return bgcolor from First Palette
496   return palette_get_color(machine, 15); // Return bgcolor from First Palette
498497}
499498
500499static READ8_HANDLER( peplus_dropdoor_r )
src/mame/drivers/ddayjlc.c
r2454r2455
5252*/
5353
5454#include "driver.h"
55#include "deprecat.h"
5655#include "sound/ay8910.h"
5756
5857static INT32 char_bank = 0;
r2454r2455
381380
382381static const struct AY8910interface ay8910_interface =
383382{
384   soundlatch_r
383   AY8910_LEGACY_OUTPUT,
384   AY8910_DEFAULT_LOADS,
385   soundlatch_r,
386   NULL,
387   NULL,
388   NULL
385389};
386390
387391static INTERRUPT_GEN( ddayjlc_interrupt )
src/mame/drivers/segas16a.c
r2454r2455
144144*/
145145
146146#include "driver.h"
147#include "deprecat.h"
148147#include "system16.h"
149148#include "machine/8255ppi.h"
150149#include "cpu/i8039/i8039.h"
r2454r2455
198197
199198static const ppi8255_interface single_ppi_intf =
200199{
201   1,
202   { NULL },
203   { NULL },
204   { NULL },
205   { soundlatch_w },
206   { video_control_w },
207   { tilemap_sound_w }
200   NULL,
201   NULL,
202   NULL,
203   soundlatch_w,
204   video_control_w,
205   tilemap_sound_w
208206};
209207
210208
r2454r2455
228226   custom_io_w = NULL;
229227   lamp_changed_w = NULL;
230228   i8751_vblank_hook = NULL;
231
232   /* configure the 8255 interface */
233   ppi8255_init(&single_ppi_intf);
234229}
235230
236231
r2454r2455
266261
267262static TIMER_CALLBACK( delayed_ppi8255_w )
268263{
269   ppi8255_0_w(machine, param >> 8, param & 0xff);
264   ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), param >> 8, param & 0xff);
270265}
271266
272267
r2454r2455
276271   switch (offset & (0x3000/2))
277272   {
278273      case 0x0000/2:
279         return ppi8255_0_r(machine, offset & 3);
274         return ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), offset & 3);
280275
281276      case 0x1000/2:
282277         return input_port_read_indexed(machine, offset & 3);
r2454r2455
301296            timer_call_after_resynch(NULL, ((offset & 3) << 8) | (data & 0xff), delayed_ppi8255_w);
302297         return;
303298   }
304   logerror("%06X:standard_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask ^ 0xffff);
299   logerror("%06X:standard_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask);
305300}
306301
307302
r2454r2455
380375             0= Sound is disabled
381376             1= sound is enabled
382377    */
383   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
378   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
384379   segaic16_tilemap_set_colscroll(0, ~data & 0x04);
385380   segaic16_tilemap_set_rowscroll(0, ~data & 0x02);
386381}
r2454r2455
396391static READ8_HANDLER( sound_data_r )
397392{
398393   /* assert ACK */
399   ppi8255_set_portC(0, 0x00);
394   ppi8255_set_portC(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x00);
400395   return soundlatch_r(machine, offset);
401396}
402397
r2454r2455
432427        D1 = /RESET line on 7751
433428        D0 = /IRQ line on 7751
434429    */
435   cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
436   cpunum_set_input_line(Machine, 2, 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE);
430   cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
431   cpunum_set_input_line(machine, 2, 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE);
437432   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
438433}
439434
r2454r2455
553548   cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
554549
555550   /* X scroll values */
556   segaic16_textram_0_w(machine, 0xff8/2, workram[0x0d14/2], 0);
557   segaic16_textram_0_w(machine, 0xffa/2, workram[0x0d18/2], 0);
551   segaic16_textram_0_w(machine, 0xff8/2, workram[0x0d14/2], 0xffff);
552   segaic16_textram_0_w(machine, 0xffa/2, workram[0x0d18/2], 0xffff);
558553
559554   /* page values */
560   segaic16_textram_0_w(machine, 0xe9e/2, workram[0x0d1c/2], 0);
561   segaic16_textram_0_w(machine, 0xe9c/2, workram[0x0d1e/2], 0);
555   segaic16_textram_0_w(machine, 0xe9e/2, workram[0x0d1c/2], 0xffff);
556   segaic16_textram_0_w(machine, 0xe9c/2, workram[0x0d1e/2], 0xffff);
562557}
563558
564559
r2454r2455
17921787   MDRV_MACHINE_RESET(system16a)
17931788   MDRV_NVRAM_HANDLER(system16a)
17941789
1790   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
1791   MDRV_DEVICE_CONFIG( single_ppi_intf )
1792
17951793   /* video hardware */
17961794   MDRV_SCREEN_ADD("main", RASTER)
17971795   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/neogeo.c
r2454r2455
309309
310310static WRITE8_HANDLER( audio_cpu_clear_nmi_w )
311311{
312   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
312   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
313313}
314314
315315
r2454r2455
562562static WRITE16_HANDLER( audio_command_w )
563563{
564564   /* accessing the LSB only is not mapped */
565   if (mem_mask != 0xff00)
565   if (mem_mask != 0x00ff)
566566   {
567567      soundlatch_w(machine, 0, data >> 8);
568568
r2454r2455
10131013
10141014   /* reset system control registers */
10151015   for (offs = 0; offs < 8; offs++)
1016      system_control_w(machine, offs, 0, 0xff00);
1016      system_control_w(machine, offs, 0, 0x00ff);
10171017
10181018   neogeo_reset_rng();
10191019
src/mame/drivers/snookr10.c
r0r2455
1/**********************************************************************************
2
3
4    SNOOKER 10 / SANDII'
5
6    Driver by Roberto Fresca.
7
8
9    Games running on this hardware:
10
11    * Snooker 10 (Ver 1.11), Sandii', 1998.
12    * Apple 10 (Ver 1.21),   Sandii', 1998.
13    * Ten Balls (Ver 1.05),  unknown, 1997.
14
15
16***********************************************************************************
17
18
19    The hardware is generally composed by:
20
21
22    CPU:    1x 65SC02 at 2MHz.
23
24    Sound:  1x OKI6295
25            1x LM358N
26            1x TDA2003
27
28    HD-PLD: 2x AMD MACH231-15-JC/1-18JI/1
29            (2x Lattice ispLSI1024-60LJ for earlier revisions)
30
31    RAM:    1x 76C88AL-15, SRAM 8Kx8
32    NVRAM:  1x 76C88AL-15, SRAM 8Kx8 (battery backed)
33    ROMs:   4x 27C256
34            (3x 27C256 for earlier revisions)
35            1x 27C020
36
37    PROMs:  1x 82S147 or similar. (512 bytes)
38
39    Clock:  1x Crystal: 16MHz.
40
41    Other:  1x 28x2 edge connector.
42            1x 15 legs connector.
43            1x trimmer (volume).
44            1x 8 DIP switches.
45            1x 3.5 Volt, 55-80 mAh battery.
46
47
48***************************************************************************************
49
50
51    All the supported games have been coded using some Funworld games as point to start,
52    changing hardware accesses, program logics, graphics, plus protection and some I/O
53    through the 2x high density PLDs.
54
55
56    Color palettes are normally stored in format RRRBBBGG inside a bipolar color PROM
57    (old hardware), or repeated 64 times inside a regular 27c256 ROM (new hardware).
58
59    - bits -
60    7654 3210
61    ---- -xxx   Red component.
62    --xx x---   Blue component.
63    xx-- ----   Green component.
64
65
66    Same as Funworld video hardware, this one was designed to manage 4096 tiles with a
67    size of 8x4 pixels each. Also support 4bpp graphics and the palette limitation is
68    8 bits for color codes (256 x 16 colors). It means the hardware was designed for more
69    elaborated graphics than these games...
70
71    Color PROMs from current games are 512 bytes lenght, but they only use the first 256 bytes.
72
73    Normal hardware capabilities:
74
75    - bits -
76    7654 3210
77    xxxx xx--   tiles color (game tiles)    ;codes 0x00-0xdc
78    xxx- x-xx   tiles color (title).        :codes 0xe9-0xeb
79    xxxx -xxx   tiles color (background).   ;codes 0xf1-0xf7
80
81
82    --- Issues / Protection ---
83
84    * Apple 10
85
86    - Tiles and color palette are totally scrambled.
87
88
89
90***********************************************************************************
91
92
93    Memory Map
94    ----------
95
96
97    $0000 - $0FFF   NVRAM       ;All registers and settings.
98
99    $1000 - $1000   ???         ;R/W
100    $3000 - $3004   Input Ports ;Reads
101    $5000 - $5001   ???         ;Writes
102
103    $6000 - $6FFF   VideoRAM
104    $7000 - $7FFF   ColorRAM
105
106    $8000 - $FFFF   ROM Space
107
108
109
110***********************************************************************************
111
112
113    *** Driver Updates ***
114
115
116    [2008/04/18]
117    - Initial release. Support for snookr10, apple10 and tenballs.
118    - Added technical/general notes.
119
120
121    *** TO DO ***
122
123    - Inputs.
124    - Figure out the high-density PLDs, or get a dump of them.
125    - Figure out the sound.
126
127
128***********************************************************************************/
129
130
131#define MASTER_CLOCK   XTAL_16MHz
132
133#include "driver.h"
134
135
136/* from video */
137WRITE8_HANDLER( snookr10_videoram_w );
138WRITE8_HANDLER( snookr10_colorram_w );
139PALETTE_INIT( snookr10 );
140VIDEO_START( snookr10 );
141VIDEO_UPDATE( snookr10 );
142
143
144/*************************
145* Memory map information *
146*************************/
147
148static ADDRESS_MAP_START( snookr10_map, ADDRESS_SPACE_PROGRAM, 8 )
149   AM_RANGE(0x0000, 0x0fff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
150//  AM_RANGE(0x1000, 0x1000) AM_READNOP /* R/W */
151//  AM_RANGE(0x3000, 0x3004) AM_READNOP /* reads (input port) */
152//  AM_RANGE(0x5000, 0x5001) AM_READNOP /* writes */
153   AM_RANGE(0x6000, 0x6fff) AM_RAM_WRITE(snookr10_videoram_w) AM_BASE(&videoram)
154   AM_RANGE(0x7000, 0x7fff) AM_RAM   AM_WRITE(snookr10_colorram_w) AM_BASE(&colorram)
155   AM_RANGE(0x8000, 0xffff) AM_ROM
156ADDRESS_MAP_END
157
158
159/*************************
160*      Input ports       *
161*************************/
162
163static INPUT_PORTS_START( snookr10 )
164INPUT_PORTS_END
165
166
167/*************************
168*    Graphics Layouts    *
169*************************/
170
171static const gfx_layout charlayout =
172{
173   4,8,
174   RGN_FRAC(1,2),
175   4,
176   { RGN_FRAC(0,2), RGN_FRAC(0,2) + 4, RGN_FRAC(1,2), RGN_FRAC(1,2) + 4 },
177   { 0, 1, 2, 3 },
178   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
179   8*4*2
180};
181
182
183/******************************
184* Graphics Decode Information *
185******************************/
186
187static GFXDECODE_START( snookr10 )
188   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout, 0, 16 )
189GFXDECODE_END
190
191
192/**************************
193*     Machine Drivers     *
194**************************/
195
196static MACHINE_DRIVER_START( snookr10 )
197    /* basic machine hardware */
198   MDRV_CPU_ADD_TAG("main", M65SC02, MASTER_CLOCK/8)   /* 2MHz */
199   MDRV_CPU_PROGRAM_MAP(snookr10_map, 0)
200   MDRV_CPU_VBLANK_INT("main", nmi_line_pulse)
201
202   MDRV_NVRAM_HANDLER(generic_0fill)
203
204    /* video hardware */
205
206   MDRV_SCREEN_ADD("main", RASTER)
207   MDRV_SCREEN_REFRESH_RATE(60)
208   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
209   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
210   MDRV_SCREEN_SIZE((128+1)*4, (30+1)*8)
211   MDRV_SCREEN_VISIBLE_AREA(0*4, 96*4-1, 0*8, 30*8-1)
212
213   MDRV_GFXDECODE(snookr10)
214
215   MDRV_PALETTE_LENGTH(0x200)
216   MDRV_PALETTE_INIT(snookr10)
217   MDRV_VIDEO_START(snookr10)
218   MDRV_VIDEO_UPDATE(snookr10)
219
220MACHINE_DRIVER_END
221
222
223/*************************
224*        Rom Load        *
225*************************/
226
227ROM_START( snookr10 )
228   ROM_REGION( 0x10000, REGION_CPU1, 0 )
229   ROM_LOAD( "1.u2", 0x8000, 0x8000, CRC(216ccb2d) SHA1(d86270cd03a08f6fd3e7b327b8173f66da28e5e8) )
230
231    /* the first 256 bytes looks as a samples table */
232   ROM_REGION( 0x40000, REGION_CPU2, 0 )
233   ROM_LOAD( "4.u18", 0x00000, 0x40000 , CRC(17090d56) SHA1(3a4c247f96c80f8cf4c1389b273880c5ea6fc39d) )
234
235   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
236   ROM_LOAD( "2.u22", 0x0000, 0x8000, CRC(a70d9c48) SHA1(3fa90190323526553866662afda4dbe1c94abeff) )
237   ROM_LOAD( "3.u25", 0x8000, 0x8000, CRC(3009faaa) SHA1(d1cda455b270cb9afa65b9701735a3a1f2a48df2) )
238
239    /* this should be changed because the palette is stored in a normal ROM instead of a color PROM */
240   ROM_REGION( 0x8000, REGION_PROMS, 0 )
241   ROM_LOAD( "5.u27", 0x0000, 0x8000, CRC(f3d7d640) SHA1(f78060f4603e316fa3c2ec4ba6d7edf261cf6d8a) )
242ROM_END
243
244ROM_START( apple10 )
245   ROM_REGION( 0x10000, REGION_CPU1, 0 )
246   ROM_LOAD( "1.u2", 0x8000, 0x8000, CRC(7d538566) SHA1(2e805157010c366ab1f2313a2bedb071c1dde733) )
247
248    /* the first 256 bytes looks as a samples table */
249   ROM_REGION( 0x40000, REGION_CPU2, 0 )
250   ROM_LOAD( "4.u18", 0x00000, 0x40000 , CRC(17090d56) SHA1(3a4c247f96c80f8cf4c1389b273880c5ea6fc39d) )
251
252   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
253   ROM_LOAD( "2.u22", 0x0000, 0x8000, CRC(42b016f4) SHA1(59d1b77f8cb706a3878813111c6a71514c413784) )
254   ROM_LOAD( "3.u25", 0x8000, 0x8000, CRC(afc535dc) SHA1(ed2d65f3154c6d80b7b22bfef1f30232e4496128) )
255
256    /* this should be changed because the palette is stored in a normal ROM instead of a color PROM */
257   ROM_REGION( 0x8000, REGION_PROMS, 0 )
258   ROM_LOAD( "5.u27", 0x0000, 0x8000, CRC(3510d705) SHA1(2190c8199d29bf89e3007eb771cc6b0e2b58f6cd) )
259ROM_END
260
261ROM_START( tenballs )
262   ROM_REGION( 0x10000, REGION_CPU1, 0 )
263   ROM_LOAD( "4.u2", 0x8000, 0x8000, CRC(2f334862) SHA1(61d57995451b6bc7de23900c460c3e073993899c) )
264
265    /* the first 256 bytes looks as a samples table */
266   ROM_REGION( 0x40000, REGION_CPU2, 0 )
267   ROM_LOAD( "1.u28", 0x00000, 0x40000 , CRC(17090d56) SHA1(3a4c247f96c80f8cf4c1389b273880c5ea6fc39d) )
268
269   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
270   ROM_LOAD( "3.u16", 0x0000, 0x8000, CRC(9eb88a08) SHA1(ab52924103e2b14c598a21c3d77b053da37a0212) )
271   ROM_LOAD( "2.u15", 0x8000, 0x8000, CRC(a5091583) SHA1(c0775d9b77cb634d3702b6c08cdf73c867b6169a) )
272
273   ROM_REGION( 0x0200, REGION_PROMS, 0 )
274   ROM_LOAD( "82s147.u17", 0x0000, 0x0200, CRC(20234dcc) SHA1(197937bbec0201888467e250bdba49e39aa4204a) )
275ROM_END
276
277
278/*************************
279*      Game Drivers      *
280*************************/
281
282/*    YEAR  NAME      PARENT  MACHINE   INPUT     INIT      ROT    COMPANY     FULLNAME                FLAGS  */
283GAME( 1998, snookr10, 0,      snookr10, snookr10, 0,        ROT0, "Sandii'",  "Snooker 10 (Ver 1.11)", GAME_NO_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
284GAME( 1998, apple10,  0,      snookr10, snookr10, 0,        ROT0, "Sandii'",  "Apple 10 (Ver 1.21)",   GAME_NO_SOUND | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_NOT_WORKING )
285GAME( 1997, tenballs, 0,      snookr10, snookr10, 0,        ROT0, "unknown",  "Ten Balls (Ver 1.05)",  GAME_NO_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
src/mame/drivers/konamigx.c
r2454r2455
440440      if (konamigx_wrport1_1 & 0x10)
441441      {
442442         gx_rdport1_3 &= ~8;
443         cpunum_set_input_line(Machine, 0, 4, HOLD_LINE);
443         cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
444444      }
445445   }
446446   else
r2454r2455
559559      {
560560         // enable 68k
561561         // clear the halt condition and reset the 68000
562         cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
563         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE);
562         cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
563         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, PULSE_LINE);
564564      }
565565      else
566566      {
567567         // disable 68k
568         cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
568         cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
569569      }
570570
571571      K053246_set_OBJCHA_line((data&0x100000) ? ASSERT_LINE : CLEAR_LINE);
r2454r2455
594594static READ32_HANDLER(waitskip_r)
595595{
596596   UINT32 data = gx_workram[waitskip.offs+offset];
597   mem_mask = ~mem_mask;
598597
599598   if (activecpu_get_pc() == waitskip.pc && (data & mem_mask) == (waitskip.data & mem_mask))
600599   {
r2454r2455
629628      // vblank interrupt ACK
630629      if (ACCESSING_BITS_24_31)
631630      {
632         cpunum_set_input_line(Machine, 0, 1, CLEAR_LINE);
631         cpunum_set_input_line(machine, 0, 1, CLEAR_LINE);
633632         gx_syncen |= 0x20;
634633      }
635634
636635      // hblank interrupt ACK
637636      if (ACCESSING_BITS_8_15)
638637      {
639         cpunum_set_input_line(Machine, 0, 2, CLEAR_LINE);
638         cpunum_set_input_line(machine, 0, 2, CLEAR_LINE);
640639         gx_syncen |= 0x40;
641640      }
642641   }
r2454r2455
10971096            if (konamigx_wrport1_1 & 0x10)
10981097            {
10991098               gx_rdport1_3 &= ~8;
1100               cpunum_set_input_line(Machine, 0, 4, HOLD_LINE);
1099               cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
11011100            }
11021101
11031102            // don't accidentally do a phony command
src/mame/drivers/segahang.c
r2454r2455
6363 *
6464 *************************************/
6565
66static const ppi8255_interface hangon_ppi_intf =
66static const ppi8255_interface hangon_ppi_intf[2] =
6767{
68   2,
69   { NULL,            NULL },
70   { NULL,            NULL },
71   { NULL,            adc_status_r },
72   { soundlatch_w,    sub_control_adc_w },
73   { video_lamps_w,   NULL },
74   { tilemap_sound_w, NULL }
68   {
69      NULL,
70      NULL,
71      NULL,
72      soundlatch_w,
73      video_lamps_w,
74      tilemap_sound_w
75   },
76   {
77      NULL,
78      NULL,
79      adc_status_r,
80      sub_control_adc_w,
81      NULL,
82      NULL
83   }
7584};
7685
7786
r2454r2455
8493
8594static void hangon_generic_init(void)
8695{
87   /* configure the 8255 interface */
88   ppi8255_init(&hangon_ppi_intf);
89
9096   /* reset the custom handlers and other pointers */
9197   i8751_vblank_hook = NULL;
9298}
r2454r2455
138144
139145static TIMER_CALLBACK( delayed_ppi8255_w )
140146{
141   ppi8255_0_w(machine, param >> 8, param & 0xff);
147   ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), param >> 8, param & 0xff);
142148}
143149
144150
r2454r2455
147153   switch (offset & 0x3020/2)
148154   {
149155      case 0x0000/2: /* PPI @ 4B */
150         return ppi8255_0_r(machine, offset & 3);
156         return ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), offset & 3);
151157
152158      case 0x1000/2: /* Input ports and DIP switches */
153159         return input_port_read_indexed(machine, offset & 3);
154160
155161      case 0x3000/2: /* PPI @ 4C */
156         return ppi8255_1_r(machine, offset & 3);
162         return ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset & 3);
157163
158164      case 0x3020/2: /* ADC0804 data output */
159165         return input_port_read_indexed(machine, 4 + adc_select);
160166   }
161167
162168   logerror("%06X:hangon_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2);
163   return segaic16_open_bus_r(machine,0,0);
169   return segaic16_open_bus_r(machine,0,mem_mask);
164170}
165171
166172
r2454r2455
176182            return;
177183
178184         case 0x3000/2: /* PPI @ 4C */
179            ppi8255_1_w(machine, offset & 3, data & 0xff);
185            ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset & 3, data & 0xff);
180186            return;
181187
182188         case 0x3020/2: /* ADC0804 */
183189            return;
184190      }
185191
186   logerror("%06X:hangon_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask ^ 0xffff);
192   logerror("%06X:hangon_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask);
187193}
188194
189195
r2454r2455
192198   switch (offset & 0x0030/2)
193199   {
194200      case 0x0000/2:
195         return ppi8255_0_r(machine, offset & 3);
201         return ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), offset & 3);
196202
197203      case 0x0010/2: /* Input ports and DIP switches */
198204         return input_port_read_indexed(machine, offset & 3);
199205
200206      case 0x0020/2: /* PPI @ 4C */
201207         if (offset == 2) return 0;
202         return ppi8255_1_r(machine, offset & 3);
208         return ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset & 3);
203209
204210      case 0x0030/2: /* ADC0804 data output */
205211         return input_port_read_indexed(machine, 4 + adc_select);
206212   }
207213
208214   logerror("%06X:sharrier_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2);
209   return segaic16_open_bus_r(machine,0,0);
215   return segaic16_open_bus_r(machine,0,mem_mask);
210216}
211217
212218
r2454r2455
222228            return;
223229
224230         case 0x0020/2: /* PPI @ 4C */
225            ppi8255_1_w(machine, offset & 3, data & 0xff);
231            ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset & 3, data & 0xff);
226232            return;
227233
228234         case 0x0030/2: /* ADC0804 */
229235            return;
230236      }
231237
232   logerror("%06X:sharrier_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask ^ 0xffff);
238   logerror("%06X:sharrier_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask);
233239}
234240
235241
r2454r2455
272278   /* D2 : SCONT1 - Tilemap origin bit 1 */
273279   /* D1 : SCONT0 - Tilemap origin bit 0 */
274280   /* D0 : MUTE (1= audio on, 0= audio off) */
275   cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
281   cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
276282   segaic16_tilemap_set_colscroll(0, ~data & 0x04);
277283   segaic16_tilemap_set_rowscroll(0, ~data & 0x02);
278284   sound_global_enable(data & 0x01);
r2454r2455
285291   /* D6 : INTR line on second CPU */
286292   /* D5 : RESET line on second CPU */
287293   /* D3-D2 : ADC_SELECT */
288   cpunum_set_input_line(Machine, 1, 4, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
289   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
294   cpunum_set_input_line(machine, 1, 4, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
295   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
290296   adc_select = (data >> 2) & 3;
291297}
292298
r2454r2455
346352static READ8_HANDLER( sound_data_r )
347353{
348354   /* assert ACK */
349   ppi8255_set_portC(0, 0x00);
355   ppi8255_set_portC(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), 0x00);
350356   return soundlatch_r(machine, offset);
351357}
352358
r2454r2455
796802
797803static const struct YM2203interface ym2203_interface =
798804{
799   0,0,0,0,sound_irq
805   {
806      AY8910_LEGACY_OUTPUT,
807      AY8910_DEFAULT_LOADS,
808      NULL, NULL, NULL, NULL
809   },
810   sound_irq
800811};
801812
802813
r2454r2455
857868   MDRV_MACHINE_RESET(hangon)
858869   MDRV_INTERLEAVE(100)
859870
871   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
872   MDRV_DEVICE_CONFIG( hangon_ppi_intf[0] )
873
874   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
875   MDRV_DEVICE_CONFIG( hangon_ppi_intf[1] )
876
860877   /* video hardware */
861878   MDRV_GFXDECODE(segahang)
862879   MDRV_PALETTE_LENGTH(2048*3)
src/mame/drivers/carrera.c
r2454r2455
272272/* these are set as input, but I have no idea which input port it uses is for the AY */
273273static const struct AY8910interface ay8910_interface =
274274{
275   AY8910_LEGACY_OUTPUT,
276   AY8910_DEFAULT_LOADS,
275277   unknown_r,
276278   unknown_r,
279   NULL,
280   NULL
277281};
278282
279283static PALETTE_INIT(carrera)
src/mame/drivers/thunderj.c
r2454r2455
129129   UINT16 result = shared_ram[offset];
130130
131131   /* look for a byte access, and then check for the high bit and a TAS opcode */
132   if (mem_mask != 0 && (result & ~mem_mask & 0x8080))
132   if (mem_mask != 0xffff && (result & mem_mask & 0x8080))
133133   {
134134      offs_t ppc = activecpu_get_previouspc();
135135      if (ppc < 0xa0000)
src/mame/drivers/ultraman.c
r2454r2455
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110#include "cpu/z80/z80.h"
1211#include "cpu/m68000/m68000.h"
1312#include "video/konamiic.h"
r2454r2455
105104static WRITE16_HANDLER( sound_irq_trigger_w )
106105{
107106   if (ACCESSING_BITS_0_7)
108      cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE);
107      cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
109108}
110109
111110
src/mame/drivers/parodius.c
r2454r2455
100100
101101static WRITE8_HANDLER( parodius_sh_irqtrigger_w )
102102{
103   cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
103   cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);
104104}
105105
106106#if 0
r2454r2455
122122static WRITE8_HANDLER( sound_arm_nmi_w )
123123{
124124//  sound_nmi_enabled = 1;
125   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
125   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
126126   timer_set(ATTOTIME_IN_USEC(50), NULL,0,nmi_callback);   /* kludge until the K053260 is emulated correctly */
127127}
128128
src/mame/drivers/blueprnt.c
r2454r2455
250250
251251static const struct AY8910interface ay8910_interface_1 =
252252{
253   0,
253   AY8910_LEGACY_OUTPUT,
254   AY8910_DEFAULT_LOADS,
255   NULL,
254256   soundlatch_r,
255257   dipsw_w,
256   0
258   NULL
257259};
258260
259261static const struct AY8910interface ay8910_interface_2 =
260262{
263   AY8910_LEGACY_OUTPUT,
264   AY8910_DEFAULT_LOADS,
261265   input_port_2_r,
262   input_port_3_r
266   input_port_3_r,
267   NULL,
268   NULL
263269};
264270
265271/* Machine Driver */
src/mame/drivers/combatsc.c
r2454r2455
118118***************************************************************************/
119119
120120#include "driver.h"
121#include "deprecat.h"
122121#include "cpu/z80/z80.h"
123122#include "sound/2203intf.h"
124123#include "sound/upd7759.h"
r2454r2455
214213
215214static WRITE8_HANDLER( combasc_sh_irqtrigger_w )
216215{
217   cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
216   cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);
218217}
219218
220219static WRITE8_HANDLER( combasc_play_w )
r2454r2455
642641
643642static const struct YM2203interface ym2203_interface =
644643{
645   0,
646   0,
647   combasc_portA_w,
648   0
644   {
645      AY8910_LEGACY_OUTPUT,
646      AY8910_DEFAULT_LOADS,
647      NULL,
648      NULL,
649      combasc_portA_w,
650      NULL
651   },
652   NULL
649653};
650654
651655static const struct upd7759_interface upd7759_interface =
src/mame/drivers/rockrage.c
r2454r2455
4848***************************************************************************/
4949
5050#include "driver.h"
51#include "deprecat.h"
5251#include "cpu/m6809/m6809.h"
5352#include "cpu/hd6309/hd6309.h"
5453#include "video/konamiic.h"
src/mame/drivers/stvinit.c
r2454r2455
66*/
77
88#include "driver.h"
9#include "deprecat.h"
109#include "machine/eeprom.h"
1110#include "cpu/sh2/sh2.h"
1211#include "machine/stvprot.h"
r2454r2455
273272static READ32_HANDLER( hanagumi_slave_off )
274273{
275274   /* just turn the slave off, i don't think the game needs it */
276   cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
275   cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
277276
278277   return stv_workram_h[0x015438/4];
279278}
r2454r2455
464463
465464   if ( data != 0 ) dnmtdeka_pending_commands++;
466465   //logerror( "CMD: Written by cpu=%d, at = %08X, offset = %08X, data = %08X, commands = %d\n", cpu_getactivecpu(), activecpu_get_pc(), offset, data, dnmtdeka_pending_commands );
467   cpu_trigger(Machine, 1000);
466   cpu_trigger(machine, 1000);
468467}
469468
470469static READ32_HANDLER(dnmtdeka_cmd_read)
r2454r2455
513512
514513   if ( data != 0 ) diehard_pending_commands++;
515514   //logerror( "CMD: Written by cpu=%d, at = %08X, offset = %08X, data = %08X, commands = %d\n", cpu_getactivecpu(), activecpu_get_pc(), offset, data, diehard_pending_commands );
516   cpu_trigger(Machine, 1000);
515   cpu_trigger(machine, 1000);
517516}
518517
519518static READ32_HANDLER(diehard_cmd_read)
r2454r2455
537536   if ( (stv_workram_h[0x000e0dd8/4] & 0xff000000) == 0 &&
538537       diehard_pending_commands == 0 )
539538   {
540      cpu_trigger(Machine, 1000);
539      cpu_trigger(machine, 1000);
541540   }
542541   return stv_workram_h[0x000e0dd8/4];
543542}
r2454r2455
556555{
557556   //logerror( "CMDACK: Write by cpu=%d, at = %08X, offset = %08X, data = %08X, commands = %d\n", cpu_getactivecpu(), activecpu_get_pc(), offset, data, diehard_pending_commands );
558557   COMBINE_DATA(&stv_workram_h[0x000e0dd8/4]);
559   cpu_trigger(Machine, 1000);
558   cpu_trigger(machine, 1000);
560559}
561560
562561DRIVER_INIT(diehard)
r2454r2455
566565   memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060986ac, 0x060986af, 0, 0, diehard_speedup_r );
567566   memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060e0bd0, 0x060e0dcf, 0, 0, diehard_cmd_write );
568567   memory_install_read32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x060e0bd0, 0x060e0dcf, 0, 0, diehard_cmd_read );
569   memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060e0dd8, 0x060e0dd8, 0, 0, diehard_cmd_ack_read );
570   memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060e0dd8, 0x060e0dd8, 0, 0, diehard_cmd_ack_write_cpu0 );
571   memory_install_write32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x060e0dd8, 0x060e0dd8, 0, 0, diehard_cmd_ack_write );
568   memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060e0dd8, 0x060e0ddb, 0, 0, diehard_cmd_ack_read );
569   memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060e0dd8, 0x060e0ddb, 0, 0, diehard_cmd_ack_write_cpu0 );
570   memory_install_write32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x060e0dd8, 0x060e0ddb, 0, 0, diehard_cmd_ack_write );
572571
573572
574573   DRIVER_INIT_CALL(ic13);
r2454r2455
617616
618617static READ32_HANDLER( bakubaku_speedup2_r )
619618{
620   if (activecpu_get_pc()==0x06033762)    cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
619   if (activecpu_get_pc()==0x06033762)    cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
621620
622621   return stv_workram_h[0x0033762/4];
623622}
r2454r2455
669668/*
670669static READ32_HANDLER( groovef_second_cpu_off_r )
671670{
672    if (activecpu_get_pc()==0x060060c2)     cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
671    if (activecpu_get_pc()==0x060060c2)     cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
673672    return 0;
674673}
675674*/
src/mame/drivers/ttchamp.c
r2454r2455
105105
106106static WRITE16_HANDLER( paldat_w )
107107{
108    palette_set_color_rgb(Machine,paloff & 0x7fff,pal5bit(data>>0),pal5bit(data>>5),pal5bit(data>>10));
108    palette_set_color_rgb(machine,paloff & 0x7fff,pal5bit(data>>0),pal5bit(data>>5),pal5bit(data>>10));
109109}
110110
111111static READ16_HANDLER( peno_rand )
src/mame/drivers/egghunt.c
r2454r2455
4242*/
4343
4444#include "driver.h"
45#include "deprecat.h"
4645#include "sound/okim6295.h"
4746
4847static UINT8 *egghunt_bgram;
src/mame/drivers/buggychl.c
r2454r2455
147147   sound_nmi_enable = 1;
148148   if (pending_nmi)
149149   {
150      cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE);
150      cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
151151      pending_nmi = 0;
152152   }
153153}
r2454r2455
407407
408408static const struct AY8910interface ay8910_interface_1 =
409409{
410   0,
411   0,
410   AY8910_LEGACY_OUTPUT,
411   AY8910_DEFAULT_LOADS,
412   NULL,
413   NULL,
412414   portA_0_w,
413415   portB_0_w
414416};
415417
416418static const struct AY8910interface ay8910_interface_2 =
417419{
418   0,
419   0,
420   AY8910_LEGACY_OUTPUT,
421   AY8910_DEFAULT_LOADS,
422   NULL,
423   NULL,
420424   portA_1_w,
421425   portB_1_w
422426};
src/mame/drivers/segac2.c
r2454r2455
8181
8282
8383#include "driver.h"
84#include "deprecat.h"
8584#include "cpu/m68000/m68000.h"
8685#include "genesis.h"
8786
r2454r2455
280279   b = ((newword >> 7) & 0x1e) | ((newword >> 14) & 0x01);
281280
282281   /* set the color */
283   palette_set_color_rgb(Machine, offset, pal5bit(r), pal5bit(g), pal5bit(b));
282   palette_set_color_rgb(machine, offset, pal5bit(r), pal5bit(g), pal5bit(b));
284283}
285284
286285
src/mame/drivers/pandoras.c
r2454r2455
1414***************************************************************************/
1515
1616#include "driver.h"
17#include "deprecat.h"
1817#include "cpu/m6809/m6809.h"
1918#include "cpu/z80/z80.h"
2019#include "cpu/i8039/i8039.h"
r2454r2455
5554        other bytes unknown */
5655
5756   switch (offset){
58      case 0x00:   if (!data) cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, CLEAR_LINE);
57      case 0x00:   if (!data) cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, CLEAR_LINE);
5958               irq_enable_a = data;
6059               break;
6160      case 0x02:   coin_counter_w(0,data & 0x01);
r2454r2455
6463               break;
6564      case 0x05:   pandoras_flipscreen_w(machine, 0, data);
6665               break;
67      case 0x06:   if (!data) cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, CLEAR_LINE);
66      case 0x06:   if (!data) cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, CLEAR_LINE);
6867               irq_enable_b = data;
6968               break;
70      case 0x07:   cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE);
69      case 0x07:   cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
7170               break;
7271
7372      default:
r2454r2455
7776
7877static WRITE8_HANDLER( pandoras_cpua_irqtrigger_w ){
7978   if (!firq_old_data_a && data){
80      cpunum_set_input_line(Machine, 0,M6809_FIRQ_LINE,HOLD_LINE);
79      cpunum_set_input_line(machine, 0,M6809_FIRQ_LINE,HOLD_LINE);
8180   }
8281
8382   firq_old_data_a = data;
r2454r2455
8584
8685static WRITE8_HANDLER( pandoras_cpub_irqtrigger_w ){
8786   if (!firq_old_data_b && data){
88      cpunum_set_input_line(Machine, 1,M6809_FIRQ_LINE,HOLD_LINE);
87      cpunum_set_input_line(machine, 1,M6809_FIRQ_LINE,HOLD_LINE);
8988   }
9089
9190   firq_old_data_b = data;
r2454r2455
9392
9493static WRITE8_HANDLER( pandoras_i8039_irqtrigger_w )
9594{
96   cpunum_set_input_line(Machine, 3, 0, ASSERT_LINE);
95   cpunum_set_input_line(machine, 3, 0, ASSERT_LINE);
9796}
9897
9998static WRITE8_HANDLER( i8039_irqen_and_status_w )
10099{
101100   /* bit 7 enables IRQ */
102101   if ((data & 0x80) == 0)
103      cpunum_set_input_line(Machine, 3, 0, CLEAR_LINE);
102      cpunum_set_input_line(machine, 3, 0, CLEAR_LINE);
104103
105104   /* bit 5 goes to 8910 port A */
106105   i8039_status = (data & 0x20) >> 5;
r2454r2455
108107
109108static WRITE8_HANDLER( pandoras_z80_irqtrigger_w )
110109{
111   cpunum_set_input_line_and_vector(Machine, 2,0,HOLD_LINE,0xff);
110   cpunum_set_input_line_and_vector(machine, 2,0,HOLD_LINE,0xff);
112111}
113112
114113
r2454r2455
370369
371370static const struct AY8910interface ay8910_interface =
372371{
372   AY8910_LEGACY_OUTPUT,
373   AY8910_DEFAULT_LOADS,
373374   pandoras_portA_r,   // not used
374   pandoras_portB_r
375   pandoras_portB_r,
376   NULL,
377   NULL
375378};
376379
377380static MACHINE_DRIVER_START( pandoras )
src/mame/drivers/taito_f2.c
r2454r2455
359359    switch (offset)
360360    {
361361         case 0x00:
362              return input_port_3_word_r(machine,0,mem_mask); /* DSW A */
362              return input_port_read_indexed(machine,3); /* DSW A */
363363
364364         case 0x01:
365              return input_port_4_word_r(machine,0,mem_mask); /* DSW B */
365              return input_port_read_indexed(machine,4); /* DSW B */
366366    }
367367
368368logerror("CPU #0 PC %06x: warning - read unmapped dsw_r offset %06x\n",activecpu_get_pc(),offset);
r2454r2455
375375    switch (offset)
376376    {
377377         case 0x00:
378              return input_port_0_word_r(machine,0,mem_mask); /* IN0 */
378              return input_port_read_indexed(machine,0); /* IN0 */
379379
380380         case 0x01:
381              return input_port_1_word_r(machine,0,mem_mask); /* IN1 */
381              return input_port_read_indexed(machine,1); /* IN1 */
382382
383383         case 0x02:
384              return input_port_2_word_r(machine,0,mem_mask); /* IN2 */
384              return input_port_read_indexed(machine,2); /* IN2 */
385385
386386    }
387387
r2454r2455
395395   switch (offset)
396396   {
397397      case 0x00:
398         return input_port_3_word_r(machine,0,mem_mask); /* DSW A */
398         return input_port_read_indexed(machine,3); /* DSW A */
399399
400400      case 0x01:
401         return input_port_4_word_r(machine,0,mem_mask); /* DSW B */
401         return input_port_read_indexed(machine,4); /* DSW B */
402402
403403      case 0x02:
404         return input_port_2_word_r(machine,0,mem_mask); /* IN2 */
404         return input_port_read_indexed(machine,2); /* IN2 */
405405
406406//      case 0x03:
407//          return (coin_word & ~mem_mask);
407//          return (coin_word & mem_mask);
408408
409409      case 0x05:
410         return input_port_0_word_r(machine,0,mem_mask); /* IN0 */
410         return input_port_read_indexed(machine,0); /* IN0 */
411411
412412      case 0x06:
413         return input_port_1_word_r(machine,0,mem_mask); /* IN1 */
413         return input_port_read_indexed(machine,1); /* IN1 */
414414
415415      case 0x07:
416         return input_port_5_word_r(machine,0,mem_mask); /* IN3 */
416         return input_port_read_indexed(machine,5); /* IN3 */
417417
418418      case 0x08:
419         return input_port_6_word_r(machine,0,mem_mask); /* IN4 */
419         return input_port_read_indexed(machine,6); /* IN4 */
420420    }
421421
422422logerror("CPU #0 PC %06x: warning - read unmapped input offset %06x\n",activecpu_get_pc(),offset);
r2454r2455
429429   switch (offset)
430430   {
431431      case 0x00:
432         return (input_port_3_word_r(machine,0,0) << 8); /* DSW A */
432         return (input_port_read_indexed(machine,3) << 8); /* DSW A */
433433
434434      case 0x01:
435         return (input_port_4_word_r(machine,0,0) << 8); /* DSW B */
435         return (input_port_read_indexed(machine,4) << 8); /* DSW B */
436436
437437      case 0x02:
438         return (input_port_0_word_r(machine,0,0) << 8); /* IN 0 */
438         return (input_port_read_indexed(machine,0) << 8); /* IN 0 */
439439
440440      case 0x03:
441         return (input_port_1_word_r(machine,0,0) << 8); /* IN 1 */
441         return (input_port_read_indexed(machine,1) << 8); /* IN 1 */
442442
443443      case 0x04:
444         return (input_port_5_word_r(machine,0,0) << 8); /* IN 3 */
444         return (input_port_read_indexed(machine,5) << 8); /* IN 3 */
445445
446446      case 0x05:
447         return (input_port_6_word_r(machine,0,0) << 8); /* IN 4 */
447         return (input_port_read_indexed(machine,6) << 8); /* IN 4 */
448448
449449      case 0x06:
450         return (input_port_2_word_r(machine,0,0) << 8); /* IN 2 */
450         return (input_port_read_indexed(machine,2) << 8); /* IN 2 */
451451
452452//      case 0x07:
453//          return (coin_word & ~mem_mask);
453//          return (coin_word & mem_mask);
454454   }
455455
456456logerror("CPU #0 PC %06x: warning - read unmapped input offset %06x\n",activecpu_get_pc(),offset);
r2454r2455
466466   switch (offset)
467467   {
468468      case 0x00:
469         curr = input_port_5_word_r(machine,0,0); /* Paddle A */
469         curr = input_port_read_indexed(machine,5); /* Paddle A */
470470         res = curr - last[0];
471471         last[0] = curr;
472472         return res;
473473
474474      case 0x02:
475         curr = input_port_6_word_r(machine,0,0); /* Paddle B */
475         curr = input_port_read_indexed(machine,6); /* Paddle B */
476476         res = curr - last[1];
477477         last[1] = curr;
478478         return res;
r2454r2455
488488    switch (offset)
489489    {
490490         case 0x00:
491              return input_port_5_word_r(machine,0,mem_mask); /* Paddle A */
491              return input_port_read_indexed(machine,5); /* Paddle A */
492492
493493         case 0x01:
494              return input_port_6_word_r(machine,0,mem_mask); /* Paddle B */
494              return input_port_read_indexed(machine,6); /* Paddle B */
495495    }
496496
497497logerror("CPU #0 PC %06x: warning - read unmapped paddle offset %06x\n",activecpu_get_pc(),offset);
r2454r2455
504504   switch (offset)
505505   {
506506      case 0x00:
507         return input_port_3_word_r(machine,0,mem_mask); /* DSW A */
507         return input_port_read_indexed(machine,3); /* DSW A */
508508
509509      case 0x01:
510         return input_port_4_word_r(machine,0,mem_mask); /* DSW B */
510         return input_port_read_indexed(machine,4); /* DSW B */
511511
512512      case 0x02:
513         return input_port_2_word_r(machine,0,mem_mask); /* IN2 */
513         return input_port_read_indexed(machine,2); /* IN2 */
514514
515515//      case 0x03:
516//          return (coin_word & ~mem_mask);
516//          return (coin_word & mem_mask);
517517
518518      case 0x05:
519         return input_port_0_word_r(machine,0,mem_mask); /* IN0 */
519         return input_port_read_indexed(machine,0); /* IN0 */
520520
521521      case 0x06:
522         return input_port_1_word_r(machine,0,mem_mask); /* IN1 */
522         return input_port_read_indexed(machine,1); /* IN1 */
523523    }
524524
525525logerror("CPU #0 PC %06x: warning - read unmapped input offset %06x\n",activecpu_get_pc(),offset);
r2454r2455
533533    {
534534        case 0x00:
535535        {
536         return (input_port_5_word_r(machine,0,0) << 8) + input_port_7_word_r(machine,0,0); /* DSW A + coin */
536         return (input_port_read_indexed(machine,5) << 8) + input_port_read_indexed(machine,7); /* DSW A + coin */
537537        }
538538
539539        case 0x01:
540540        {
541         return (input_port_6_word_r(machine,0,0) << 8) + input_port_8_word_r(machine,0,0); /* DSW B + coin */
541         return (input_port_read_indexed(machine,6) << 8) + input_port_read_indexed(machine,8); /* DSW B + coin */
542542        }
543543    }
544544
r2454r2455
552552    switch (mjnquest_input)
553553    {
554554         case 0x01:
555              return input_port_0_word_r(machine,0,mem_mask); /* IN0 */
555              return input_port_read_indexed(machine,0); /* IN0 */
556556
557557         case 0x02:
558              return input_port_1_word_r(machine,0,mem_mask); /* IN1 */
558              return input_port_read_indexed(machine,1); /* IN1 */
559559
560560         case 0x04:
561              return input_port_2_word_r(machine,0,mem_mask); /* IN2 */
561              return input_port_read_indexed(machine,2); /* IN2 */
562562
563563         case 0x08:
564              return input_port_3_word_r(machine,0,mem_mask); /* IN3 */
564              return input_port_read_indexed(machine,3); /* IN3 */
565565
566566         case 0x10:
567              return input_port_4_word_r(machine,0,mem_mask); /* IN4 */
567              return input_port_read_indexed(machine,4); /* IN4 */
568568
569569    }
570570
r2454r2455
583583    switch (offset)
584584    {
585585         case 0x00:
586              return input_port_4_word_r(machine,0,mem_mask); /* DSW B */
586              return input_port_read_indexed(machine,4); /* DSW B */
587587
588588         case 0x01:
589              return input_port_0_word_r(machine,0,mem_mask); /* IN0 */
589              return input_port_read_indexed(machine,0); /* IN0 */
590590    }
591591
592592logerror("CPU #0 PC %06x: warning - read unmapped input_r offset %06x\n",activecpu_get_pc(),offset);
r2454r2455
599599    switch (offset)
600600    {
601601         case 0x00:
602              return input_port_3_word_r(machine,0,mem_mask); /* DSW A */
602              return input_port_read_indexed(machine,3); /* DSW A */
603603
604604         case 0x01:
605              return input_port_1_word_r(machine,0,mem_mask); /* IN1 */
605              return input_port_read_indexed(machine,1); /* IN1 */
606606
607607         case 0x02:
608              return input_port_2_word_r(machine,0,mem_mask); /* IN2 */
608              return input_port_read_indexed(machine,2); /* IN2 */
609609    }
610610
611611logerror("CPU #0 PC %06x: warning - read unmapped input_r offset %06x\n",activecpu_get_pc(),offset);
r2454r2455
618618    switch (offset)
619619    {
620620         case 0x00:
621              return input_port_0_word_r(machine,0,mem_mask);   /* IN0 */
621              return input_port_read_indexed(machine,0);   /* IN0 */
622622
623623/* case 0x01 only used if "printer" DSW is on, and appears to
624624   be printer status byte */
625625
626626         case 0x02:
627              return input_port_1_word_r(machine,0,mem_mask); /* IN1 */
627              return input_port_read_indexed(machine,1); /* IN1 */
628628    }
629629
630630logerror("CPU #0 PC %06x: warning - read unmapped input_r offset %06x\n",activecpu_get_pc(),offset);
r2454r2455
642642
643643   if (yesnoj_dsw)
644644   {
645      return input_port_2_word_r(machine,0,mem_mask);
645      return input_port_read_indexed(machine,2);
646646   }
647647   else
648648   {
649      return input_port_3_word_r(machine,0,mem_mask);
649      return input_port_read_indexed(machine,3);
650650   }
651651}
652652
r2454r2455
846846
847847static READ8_HANDLER( driveout_sound_command_r)
848848{
849   cpunum_set_input_line(Machine, 1,0,CLEAR_LINE);
849   cpunum_set_input_line(machine, 1,0,CLEAR_LINE);
850850//  logerror("sound IRQ OFF (sound command=%02x)\n",driveout_sound_latch);
851851   return driveout_sound_latch;
852852}
r2454r2455
887887         else
888888         {
889889            driveout_sound_latch = ((data<<4) & 0xf0) | (driveout_sound_latch & 0x0f);
890            cpunum_set_input_line (Machine, 1, 0, ASSERT_LINE);
890            cpunum_set_input_line (machine, 1, 0, ASSERT_LINE);
891891         }
892892      }
893893   }
r2454r2455
38393839
38403840static const struct YM2203interface ym2203_interface =
38413841{
3842   0,   /* portA read */
3843   0,
3844   camltrya_porta_w,   /* portA write - not implemented */
3845   0,   /* portB write */
3842   {
3843      AY8910_LEGACY_OUTPUT,
3844      AY8910_DEFAULT_LOADS,
3845      NULL,            /* portA read */
3846      NULL,
3847      camltrya_porta_w,   /* portA write - not implemented */
3848      NULL,            /* portB write */
3849   },
38463850   irq_handler
38473851};
38483852
src/mame/drivers/gottlieb.c
r2454r2455
197197
198198static READ8_HANDLER( gottlieb_track_0_r )
199199{
200   return input_port_2_r(machine, offset) - track[0];
200   return input_port_read_indexed(machine, 2) - track[0];
201201}
202202
203203static READ8_HANDLER( gottlieb_track_1_r )
204204{
205   return input_port_3_r(machine, offset) - track[1];
205   return input_port_read_indexed(machine, 3) - track[1];
206206}
207207
208208static WRITE8_HANDLER( gottlieb_track_reset_w )
209209{
210210   /* reset the trackball counters */
211   track[0] = input_port_2_r(machine, offset);
212   track[1] = input_port_3_r(machine, offset);
211   track[0] = input_port_read_indexed(machine, 2);
212   track[1] = input_port_read_indexed(machine, 3);
213213}
214214
215215static int joympx;
src/mame/drivers/sandscrp.c
r2454r2455
422422
423423static const struct YM2203interface ym2203_intf_sandscrp =
424424{
425   input_port_4_r,   /* Port A Read - DSW 1 */
426   input_port_5_r,   /* Port B Read - DSW 2 */
427   0,   /* Port A Write */
428   0,   /* Port B Write */
425   {
426      AY8910_LEGACY_OUTPUT,
427      AY8910_DEFAULT_LOADS,
428      input_port_4_r,   /* Port A Read - DSW 1 */
429      input_port_5_r,   /* Port B Read - DSW 2 */
430      NULL,   /* Port A Write */
431      NULL,   /* Port B Write */
432   },
429433   irq_handler   /* IRQ handler */
430434};
431435
src/mame/drivers/gpworld.c
r2454r2455
257257
258258   /* logerror("PAL WRITE index : %x  rgb : %d %d %d (real %x) at %x\n", pal_index, r,g,b, data, offset); */
259259
260   palette_set_color(Machine, pal_index, MAKE_RGB(r, g, b));
260   palette_set_color(machine, pal_index, MAKE_RGB(r, g, b));
261261}
262262
263263/* PROGRAM MAP */
src/mame/drivers/acommand.c
r2454r2455
281281                ---- ---- ---- --x- (Activate Test)
282282                ---- ---- ---- ---x (Advance Thru Tests)
283283            */
284         return input_port_0_word_r(machine,0,0);
284         return input_port_read_indexed(machine,0);
285285      case 0x0014/2:
286286         /*
287287                write 0x40,read (~0x08)
r2454r2455
315315                xxxx xxxx ---- ---- DIPSW4
316316                ---- ---- xxxx xxxx DIPSW3
317317            */
318         return input_port_1_word_r(machine,0,0);
318         return input_port_read_indexed(machine,1);
319319   }
320320   return ac_devram[offset];
321321}
src/mame/drivers/asterix.c
r2454r2455
1010***************************************************************************/
1111
1212#include "driver.h"
13#include "deprecat.h"
1413#include "video/konamiic.h"
1514#include "cpu/z80/z80.h"
1615#include "machine/eeprom.h"
r2454r2455
6867   /* bit 8  is EEPROM data */
6968   /* bit 9  is EEPROM ready */
7069   /* bit 10 is service button */
71   res = (EEPROM_read_bit()<<8) | input_port_1_word_r(machine,0,0);
70   res = (EEPROM_read_bit()<<8) | input_port_read_indexed(machine,1);
7271
7372   if (init_eeprom_count)
7473   {
src/mame/drivers/tubep.c
r2454r2455
168168
169169static WRITE8_HANDLER( main_cpu_irq_line_clear_w )
170170{
171   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
171   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
172172   logerror("CPU#0 VBLANK int clear at scanline=%3i\n", curr_scanline);
173173   return;
174174}
r2454r2455
204204
205205static WRITE8_HANDLER( second_cpu_irq_line_clear_w )
206206{
207   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
207   cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
208208   logerror("CPU#1 VBLANK int clear at scanline=%3i\n", curr_scanline);
209209   return;
210210}
r2454r2455
239239
240240static READ8_HANDLER( tubep_sound_irq_ack )
241241{
242   cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE);
242   cpunum_set_input_line(machine, 2, 0, CLEAR_LINE);
243243   return 0;
244244}
245245
r2454r2455
409409static WRITE8_HANDLER( rjammer_soundlatch_w )
410410{
411411   sound_latch = data;
412   cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE);
412   cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, PULSE_LINE);
413413}
414414
415415
r2454r2455
594594            I do it here because this port (0x80) is first one accessed
595595            in the interrupt routine.
596596    */
597   cpunum_set_input_line(Machine, 2, 0, CLEAR_LINE );
597   cpunum_set_input_line(machine, 2, 0, CLEAR_LINE );
598598   return;
599599}
600600
r2454r2455
858858
859859static const struct AY8910interface ay8910_interface_1 =
860860{
861   0,
862   0,
861   AY8910_LEGACY_OUTPUT,
862   AY8910_DEFAULT_LOADS,
863   NULL,
864   NULL,
863865   ay8910_portA_0_w, /* write port A */
864866   ay8910_portB_0_w  /* write port B */
865867};
866868
867869static const struct AY8910interface ay8910_interface_2 =
868870{
869   0,
870   0,
871   AY8910_LEGACY_OUTPUT,
872   AY8910_DEFAULT_LOADS,
873   NULL,
874   NULL,
871875   ay8910_portA_1_w, /* write port A */
872876   ay8910_portB_1_w  /* write port B */
873877};
874878
875879static const struct AY8910interface ay8910_interface_3 =
876880{
877   0,
878   0,
881   AY8910_LEGACY_OUTPUT,
882   AY8910_DEFAULT_LOADS,
883   NULL,
884   NULL,
879885   ay8910_portA_2_w, /* write port A */
880886   ay8910_portB_2_w  /* write port B */
881887};
src/mame/drivers/homedata.c
r2454r2455
217217***************************************************************************/
218218
219219#include "driver.h"
220#include "deprecat.h"
221220#include "cpu/m6809/m6809.h"
222221#include "cpu/upd7810/upd7810.h"
223222#include "homedata.h"
r2454r2455
13021301
13031302static const struct YM2203interface ym2203_interface =
13041303{
1305   input_port_3_r,
1306   input_port_4_r
1304   {
1305      AY8910_LEGACY_OUTPUT,
1306      AY8910_DEFAULT_LOADS,
1307      input_port_3_r,
1308      input_port_4_r,
1309      NULL,
1310      NULL
1311   },
1312   NULL
13071313};
13081314
13091315
src/mame/drivers/xxmissio.c
r2454r2455
5252
5353      case 0x40:
5454         xxmissio_status &= ~0x08;
55         cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0x10);
55         cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0x10);
5656         break;
5757
5858      case 0x80:
r2454r2455
7575
7676      case 0x80:
7777         xxmissio_status &= ~0x04;
78         cpunum_set_input_line_and_vector(Machine, 0,0,HOLD_LINE,0x10);
78         cpunum_set_input_line_and_vector(machine, 0,0,HOLD_LINE,0x10);
7979         break;
8080   }
8181}
r2454r2455
275275
276276static const struct YM2203interface ym2203_interface_1 =
277277{
278   input_port_2_r,
279   input_port_3_r
278   {
279      AY8910_LEGACY_OUTPUT,
280      AY8910_DEFAULT_LOADS,
281      input_port_2_r,
282      input_port_3_r,
283      NULL,
284      NULL
285   },
286   NULL
280287};
281288
282289static const struct YM2203interface ym2203_interface_2 =
283290{
284   0,
285   0,
286   xxmissio_scroll_x_w,
287   xxmissio_scroll_y_w
291   {
292      AY8910_LEGACY_OUTPUT,
293      AY8910_DEFAULT_LOADS,
294      NULL,
295      NULL,
296      xxmissio_scroll_x_w,
297      xxmissio_scroll_y_w
298   },
299   NULL
288300};
289301
290302static MACHINE_DRIVER_START( xxmissio )
src/mame/drivers/hyhoo.c
r2454r2455
257257
258258static const struct AY8910interface ay8910_interface =
259259{
260   AY8910_LEGACY_OUTPUT,
261   AY8910_DEFAULT_LOADS,
260262   input_port_0_r,            // DIPSW-A read
261   input_port_1_r            // DIPSW-B read
263   input_port_1_r,            // DIPSW-B read
264   NULL,
265   NULL
262266};
263267
264268
src/mame/drivers/hng64.c
r2454r2455
571571
572572static READ32_HANDLER( hng64_com_r )
573573{
574   logerror("com read  (PC=%08x): %08x %08x = %08x\n", activecpu_get_pc(), (offset*4)+0xc0000000, ~mem_mask, hng64_com_ram[offset]);
574   logerror("com read  (PC=%08x): %08x %08x = %08x\n", activecpu_get_pc(), (offset*4)+0xc0000000, mem_mask, hng64_com_ram[offset]);
575575   return hng64_com_ram[offset] ;
576576}
577577
578578
579579static WRITE32_HANDLER( hng64_com_w )
580580{
581   logerror("com write (PC=%08x): %08x %08x = %08x\n", activecpu_get_pc(), (offset*4)+0xc0000000, ~mem_mask, data);
581   logerror("com write (PC=%08x): %08x %08x = %08x\n", activecpu_get_pc(), (offset*4)+0xc0000000, mem_mask, data);
582582   COMBINE_DATA(&hng64_com_ram[offset]);
583583}
584584
r2454r2455
588588
589589static WRITE32_HANDLER( hng64_com_share_w )
590590{
591   logerror("commw  (PC=%08x): %08x %08x %08x\n", activecpu_get_pc(), data, (offset*4)+0xc0001000, ~mem_mask);
591   logerror("commw  (PC=%08x): %08x %08x %08x\n", activecpu_get_pc(), data, (offset*4)+0xc0001000, mem_mask);
592592
593593   if (offset==0x0) COMBINE_DATA(&hng64_com_shared_a);
594594   if (offset==0x1) COMBINE_DATA(&hng64_com_shared_b);
r2454r2455
596596
597597static READ32_HANDLER( hng64_com_share_r )
598598{
599   logerror("commr  (PC=%08x): %08x %08x\n", activecpu_get_pc(), (offset*4)+0xc0001000, ~mem_mask);
599   logerror("commr  (PC=%08x): %08x %08x\n", activecpu_get_pc(), (offset*4)+0xc0001000, mem_mask);
600600
601601//  if(offset==0x0) return hng64_com_shared_a;
602602//  if(offset==0x1) return hng64_com_shared_b;
r2454r2455
626626   //if (a != 0)
627627   //  popmessage("Alpha is not zero!") ;
628628
629   palette_set_color(Machine,offset,MAKE_RGB(r,g,b));
629   palette_set_color(machine,offset,MAKE_RGB(r,g,b));
630630}
631631
632632static READ32_HANDLER( hng64_port_read )
r2454r2455
709709
710710static WRITE32_HANDLER( hng64_sram_w )
711711{
712   logerror("HNG64 writing to SRAM 0x%08x == 0x%08x & 0x%08x. (PC=%08x)\n", offset*4, data, ~mem_mask, activecpu_get_pc());
712   logerror("HNG64 writing to SRAM 0x%08x == 0x%08x & 0x%08x. (PC=%08x)\n", offset*4, data, mem_mask, activecpu_get_pc());
713713   COMBINE_DATA (&hng64_sram[offset]);
714714}
715715
src/mame/drivers/macrossp.c
r2454r2455
253253   g = ((paletteram32[offset] & 0x00ff0000) >>16);
254254   r = ((paletteram32[offset] & 0xff000000) >>24);
255255
256   palette_set_color(Machine,offset,MAKE_RGB(r,g,b));
256   palette_set_color(machine,offset,MAKE_RGB(r,g,b));
257257}
258258
259259
r2454r2455
278278   if (ACCESSING_BITS_16_31)
279279   {
280280      //logerror("%08x write soundcmd %08x (%08x)\n",activecpu_get_pc(),data,mem_mask);
281      soundlatch_word_w(machine,0,data >> 16,0);
281      soundlatch_word_w(machine,0,data >> 16,0xffff);
282282      sndpending = 1;
283      cpunum_set_input_line(Machine, 1,2,HOLD_LINE);
283      cpunum_set_input_line(machine, 1,2,HOLD_LINE);
284284      /* spin for a while to let the sound CPU read the command */
285285      cpu_spinuntil_time(ATTOTIME_IN_USEC(50));
286286   }
src/mame/drivers/gladiatr.c
r2454r2455
329329/* !!!!! patch to IRQ timming for 2nd CPU !!!!! */
330330static WRITE8_HANDLER( gladiatr_irq_patch_w )
331331{
332   cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
332   cpunum_set_input_line(machine, 1,0,HOLD_LINE);
333333}
334334#endif
335335
r2454r2455
656656
657657static const struct YM2203interface ppking_ym2203_interface =
658658{
659   f1_r,
660   f1_r
659   {
660      AY8910_LEGACY_OUTPUT,
661      AY8910_DEFAULT_LOADS,
662      f1_r,
663      f1_r,
664      NULL,
665      NULL
666   },
667   NULL
661668};
662669
663670static const struct YM2203interface gladiatr_ym2203_interface =
664671{
665   0,
666   gladiator_dsw3_r,         /* port B read */
667   gladiator_int_control_w, /* port A write */
668   0,
672   {
673      AY8910_LEGACY_OUTPUT,
674      AY8910_DEFAULT_LOADS,
675      NULL,
676      gladiator_dsw3_r,         /* port B read */
677      gladiator_int_control_w, /* port A write */
678      NULL,
679   },
669680   gladiator_ym_irq          /* NMI request for 2nd cpu */
670681};
671682
src/mame/drivers/imolagp.c
r2454r2455
113113}
114114static READ8_HANDLER( trigger_slave_nmi_r )
115115{
116   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
116   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
117117   return 0;
118118}
119119
r2454r2455
392392   }
393393} /* master_interrupt */
394394
395
396static const ppi8255_interface ppi8255_intf =
397{
398   NULL,      /* Port A read */
399   NULL,      /* Port B read */
400   NULL,      /* Port C read */
401   NULL,      /* Port A write */
402   NULL,      /* Port B write */
403   NULL      /* Port C write */
404};
405
406
395407static MACHINE_DRIVER_START( imolagp )
396408   MDRV_CPU_ADD(Z80,8000000) /* ? */
397409   MDRV_CPU_PROGRAM_MAP(imolagp_master,0)
r2454r2455
405417
406418   MDRV_INTERLEAVE(100)
407419
420   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
421   MDRV_DEVICE_CONFIG( ppi8255_intf )
422
408423   MDRV_SCREEN_ADD("main", RASTER)
409424   MDRV_SCREEN_REFRESH_RATE(60)
410425   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
r2454r2455
513528   ROM_LOAD( "xe.bin", 0x3c00, 0x400, CRC(e0e81120) SHA1(14a77dfd069be342df4dbb1b747443c6d121d3fe) ) // ? car+misc
514529ROM_END
515530
516static const ppi8255_interface ppi8255_intf =
517{
518   1,          /* 1 chips */
519   {0},      /* Port A read */
520   {0},      /* Port B read */
521   {0},      /* Port C read */
522   {0},      /* Port A write */
523   {0},      /* Port B write */
524   {0},       /* Port C write */
525};
526531
527static DRIVER_INIT( imolagp )
528{
529   ppi8255_init(&ppi8255_intf);
530}
531
532532/*    YEAR, NAME,    PARENT,   MACHINE, INPUT,   INIT,    MONITOR, COMPANY,   FULLNAME */
533GAME( 1981,imolagp, 0,        imolagp, imolagp, imolagp, ROT90,   "Alberici", "Imola Grand Prix", GAME_WRONG_COLORS )
533GAME( 1981,imolagp, 0,        imolagp, imolagp, 0, ROT90,   "Alberici", "Imola Grand Prix", GAME_WRONG_COLORS )
src/mame/drivers/moo.c
r2454r2455
4242***************************************************************************/
4343
4444#include "driver.h"
45#include "deprecat.h"
4645#include "video/konamiic.h"
4746#include "cpu/m68000/m68000.h"
4847#include "cpu/z80/z80.h"
src/mame/drivers/taito_l.c
r2454r2455
312312
313313   // fix Plotting test mode
314314   if ((irq_enable & (1 << last_irq_level)) == 0)
315      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
315      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
316316}
317317
318318static READ8_HANDLER( irq_enable_r )
r2454r2455
10501050static WRITE8_HANDLER (evilston_snd_w)
10511051{
10521052   shared_ram[0x7fe]=data&0x7f;
1053   cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE);
1053   cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
10541054}
10551055
10561056
r2454r2455
22692269
22702270static const struct YM2203interface ym2203_interface_triple =
22712271{
2272   0,
2273   0,
2274   portA_w,
2275   0,
2272   {
2273      AY8910_LEGACY_OUTPUT,
2274      AY8910_DEFAULT_LOADS,
2275      NULL,
2276      NULL,
2277      portA_w,
2278      NULL,
2279   },
22762280   irqhandler
22772281};
22782282
22792283static const struct YM2203interface ym2203_interface_champwr =
22802284{
2281   0,
2282   0,
2283   portA_w,
2284   champwr_msm5205_volume_w,
2285   {
2286      AY8910_LEGACY_OUTPUT,
2287      AY8910_DEFAULT_LOADS,
2288      NULL,
2289      NULL,
2290      portA_w,
2291      champwr_msm5205_volume_w,
2292   },
22852293   irqhandler
22862294};
22872295
r2454r2455
23012309
23022310static const struct YM2203interface ym2203_interface_single =
23032311{
2304   portA_r,
2305   portB_r
2312   {
2313      AY8910_LEGACY_OUTPUT,
2314      AY8910_DEFAULT_LOADS,
2315      portA_r,
2316      portB_r,
2317      NULL,
2318      NULL
2319   },
2320   NULL
23062321};
23072322
23082323
src/mame/drivers/gyruss.c
r2454r2455
5858#include "driver.h"
5959#include "cpu/i8039/i8039.h"
6060#include "sound/ay8910.h"
61#include "sound/dac.h"
61#include "sound/discrete.h"
6262
63
6463extern UINT8 *gyruss_videoram;
6564extern UINT8 *gyruss_colorram;
6665extern UINT8 *gyruss_spriteram;
r2454r2455
7372PALETTE_INIT( gyruss );
7473VIDEO_UPDATE( gyruss );
7574
76READ8_HANDLER( gyruss_portA_r );
77WRITE8_HANDLER( gyruss_filter0_w );
78WRITE8_HANDLER( gyruss_filter1_w );
79WRITE8_HANDLER( gyruss_sh_irqtrigger_w );
80WRITE8_HANDLER( gyruss_i8039_irq_w );
75/* The timer clock which feeds the upper 4 bits of                      */
76/* AY-3-8910 port A is based on the same clock                          */
77/* feeding the sound CPU Z80.  It is a divide by                        */
78/* 10240, formed by a standard divide by 1024,                          */
79/* followed by a divide by 10 using a 4 bit                             */
80/* bi-quinary count sequence. (See LS90 data sheet                      */
81/* for an example).                                                     */
82/*                                                                      */
83/* Bit 0 comes from the output of the divide by 1024                    */
84/*       0, 1, 0, 1, 0, 1, 0, 1, 0, 1                                   */
85/* Bit 1 comes from the QC output of the LS90 producing a sequence of   */
86/*       0, 0, 1, 1, 0, 0, 1, 1, 1, 0                                   */
87/* Bit 2 comes from the QD output of the LS90 producing a sequence of   */
88/*       0, 0, 0, 0, 1, 0, 0, 0, 0, 1                                   */
89/* Bit 3 comes from the QA output of the LS90 producing a sequence of   */
90/*       0, 0, 0, 0, 0, 1, 1, 1, 1, 1                                   */
8191
92static const int gyruss_timer[10] =
93{
94   0x00, 0x01, 0x02, 0x03, 0x04, 0x09, 0x0a, 0x0b, 0x0a, 0x0d
95};
8296
97static READ8_HANDLER( gyruss_portA_r )
98{
99   return gyruss_timer[(activecpu_gettotalcycles()/1024) % 10];
100}
101
102
103static WRITE8_HANDLER(gyruss_dac_w)
104{
105   discrete_sound_w(machine, NODE(16), data);
106}
107
108static void filter_w(running_machine *machine, int chip, int data)
109{
110   int i;
111
112   //printf("chip %d - %02x\n", chip, data);
113   for (i = 0;i < 3;i++)
114   {
115      /* low bit: 47000pF = 0.047uF */
116      /* high bit: 220000pF = 0.22uF */
117      discrete_sound_w(machine, NODE(3 * chip + i + 21), data & 3);
118      data >>= 2;
119   }
120}
121
122static WRITE8_HANDLER( gyruss_filter0_w )
123{
124   filter_w(machine, 0,data);
125}
126
127static WRITE8_HANDLER( gyruss_filter1_w )
128{
129   filter_w(machine, 1,data);
130}
131
132
133static WRITE8_HANDLER( gyruss_sh_irqtrigger_w )
134{
135   /* writing to this register triggers IRQ on the sound CPU */
136   cpunum_set_input_line_and_vector(machine, 2,0,HOLD_LINE,0xff);
137}
138
139static WRITE8_HANDLER( gyruss_i8039_irq_w )
140{
141   cpunum_set_input_line(machine, 3, 0, PULSE_LINE);
142}
143
144
83145static ADDRESS_MAP_START( main_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 )
84146   AM_RANGE(0x0000, 0x7fff) AM_ROM
85147   AM_RANGE(0x8000, 0x83ff) AM_RAM AM_BASE(&gyruss_colorram)
r2454r2455
139201
140202static ADDRESS_MAP_START( audio_cpu2_io_map, ADDRESS_SPACE_IO, 8 )
141203   AM_RANGE(0x00, 0xff) AM_READ(soundlatch2_r)
142   AM_RANGE(I8039_p1, I8039_p1) AM_WRITE(DAC_0_data_w)
204   AM_RANGE(I8039_p1, I8039_p1) AM_WRITE(gyruss_dac_w)
143205   AM_RANGE(I8039_p2, I8039_p2) AM_WRITE(SMH_NOP)
144206ADDRESS_MAP_END
145207
r2454r2455
311373
312374static const struct AY8910interface ay8910_interface_1 =
313375{
314   0,
315   0,
316   0,
376   AY8910_DISCRETE_OUTPUT,
377   { RES_K(3.3), RES_K(3.3), RES_K(3.3) },
378   NULL,
379   NULL,
380   NULL,
317381   gyruss_filter0_w
318382};
319383
320384static const struct AY8910interface ay8910_interface_2 =
321385{
322   0,
323   0,
324   0,
386   AY8910_DISCRETE_OUTPUT,
387   { RES_K(3.3), RES_K(3.3), RES_K(3.3) },
388   NULL,
389   NULL,
390   NULL,
325391   gyruss_filter1_w
326392};
327393
328394static const struct AY8910interface ay8910_interface_3 =
329395{
330   gyruss_portA_r
396   AY8910_DISCRETE_OUTPUT,
397   { RES_K(3.3), RES_K(3.3), RES_K(3.3) },
398   gyruss_portA_r,
399   NULL,
400   NULL,
401   NULL
331402};
332403
404static const struct AY8910interface ay8910_interface_4 =
405{
406   AY8910_DISCRETE_OUTPUT,
407   { RES_K(3.3), RES_K(3.3), RES_K(3.3) },
408   NULL,
409   NULL,
410   NULL,
411   NULL
412};
333413
414static const struct AY8910interface ay8910_interface_5 =
415{
416   AY8910_DISCRETE_OUTPUT,
417   { RES_K(3.3), RES_K(3.3), RES_K(3.3) },
418   NULL,
419   NULL,
420   NULL,
421   NULL
422};
334423
424static const discrete_mixer_desc konami_right_mixer_desc =
425   {DISC_MIXER_IS_RESISTOR,
426      {RES_K(2.2), RES_K(2.2), RES_K(2.2), RES_K(3.3)/3, RES_K(3.3)/3 },
427      {0,0,0,0,0,0},   /* no variable resistors   */
428      {0,0,0,0,0,0},  /* no node capacitors      */
429      0, 200,
430      CAP_U(0.1),
431      0,
432      0, 1};
433
434static const discrete_mixer_desc konami_left_mixer_desc =
435   {DISC_MIXER_IS_RESISTOR,
436   {RES_K(2.2), RES_K(2.2), RES_K(2.2), RES_K(3.3)/3, RES_K(4.7) },
437   {0,0,0,0,0,0},   /* no variable resistors   */
438   {0,0,0,0,0,0},  /* no node capacitors      */
439   0, 200,
440   CAP_U(0.1),
441   0,
442   0, 1};
443
444static DISCRETE_SOUND_START( gyruss_sound )
445
446   /* Chip 1 right */
447   DISCRETE_INPUTX_STREAM(NODE_01, 0, 1.0, 0)
448   DISCRETE_INPUTX_STREAM(NODE_02, 1, 1.0, 0)
449   DISCRETE_INPUTX_STREAM(NODE_03, 2, 1.0, 0)
450
451   /* Chip 2 left */
452   DISCRETE_INPUTX_STREAM(NODE_04, 3, 1.0, 0)
453   DISCRETE_INPUTX_STREAM(NODE_05, 4, 1.0, 0)
454   DISCRETE_INPUTX_STREAM(NODE_06, 5, 1.0, 0)
455
456   /* Chip 3 right */
457   /* Outputs are tied together after 3.3k resistor on each channel.
458     * A/R + B/R + C/R = (A + B + C) / 3 * (1/(R/3))
459     */
460   DISCRETE_INPUTX_STREAM(NODE_07, 6, 0.33, 0)
461   DISCRETE_INPUTX_STREAM(NODE_08, 7, 0.33, 0)
462   DISCRETE_INPUTX_STREAM(NODE_09, 8, 0.33, 0)
463
464   /* Chip 4 right */
465   DISCRETE_INPUTX_STREAM(NODE_10, 9, 0.33, 0)
466   DISCRETE_INPUTX_STREAM(NODE_11,10, 0.33, 0)
467   DISCRETE_INPUTX_STREAM(NODE_12,11, 0.33, 0)
468
469   /* Chip 5 left */
470   DISCRETE_INPUTX_STREAM(NODE_13,12, 0.33, 0)
471   DISCRETE_INPUTX_STREAM(NODE_14,13, 0.33, 0)
472   DISCRETE_INPUTX_STREAM(NODE_15,14, 0.33, 0)
473
474   /* DAC left */
475   /* Output voltage depends on load. Datasheet gives 2.4 as minimum.
476     * This is in line with TTL, so 4V with no load seems adequate */
477   DISCRETE_INPUTX_DATA(NODE_16, 256.0 * 4.0 / 5.0, 0.0, 0.0)
478
479   /* Chip 1 Filter enable */
480   DISCRETE_INPUT_DATA(NODE_21)
481   DISCRETE_INPUT_DATA(NODE_22)
482   DISCRETE_INPUT_DATA(NODE_23)
483
484   /* Chip 2 Filter enable */
485   DISCRETE_INPUT_DATA(NODE_24)
486   DISCRETE_INPUT_DATA(NODE_25)
487   DISCRETE_INPUT_DATA(NODE_26)
488
489   /* Chip 1 Filter */
490   DISCRETE_RCFILTER_SW(NODE_31, 1, NODE_01, NODE_21, AY8910_INTERNAL_RESISTANCE+1000, CAP_U(0.047), CAP_U(0.22), 0, 0)
491   DISCRETE_RCFILTER_SW(NODE_32, 1, NODE_02, NODE_22, AY8910_INTERNAL_RESISTANCE+1000, CAP_U(0.047), CAP_U(0.22), 0, 0)
492   DISCRETE_RCFILTER_SW(NODE_33, 1, NODE_03, NODE_23, AY8910_INTERNAL_RESISTANCE+1000, CAP_U(0.047), CAP_U(0.22), 0, 0)
493
494   /* Chip 2 Filter */
495   DISCRETE_RCFILTER_SW(NODE_34, 1, NODE_04, NODE_24, AY8910_INTERNAL_RESISTANCE+1000, CAP_U(0.047), CAP_U(0.22), 0, 0)
496   DISCRETE_RCFILTER_SW(NODE_35, 1, NODE_05, NODE_25, AY8910_INTERNAL_RESISTANCE+1000, CAP_U(0.047), CAP_U(0.22), 0, 0)
497   DISCRETE_RCFILTER_SW(NODE_36, 1, NODE_06, NODE_26, AY8910_INTERNAL_RESISTANCE+1000, CAP_U(0.047), CAP_U(0.22), 0, 0)
498
499   /* Chip 3 */
500   DISCRETE_ADDER3(NODE_40, 1, NODE_07, NODE_08, NODE_09)
501   /* Chip 4 */
502   DISCRETE_ADDER3(NODE_41, 1, NODE_10, NODE_11, NODE_12)
503   /* Chip 5 */
504   DISCRETE_ADDER3(NODE_42, 1, NODE_13, NODE_14, NODE_15)
505
506   /* right channel */
507   DISCRETE_MIXER5(NODE_50, 1, NODE_31, NODE_32, NODE_33, NODE_40, NODE_41, &konami_right_mixer_desc)
508   /* left channel */
509   DISCRETE_MIXER5(NODE_51, 1, NODE_34, NODE_35, NODE_36, NODE_42, NODE_16, &konami_left_mixer_desc)
510
511   DISCRETE_OUTPUT(NODE_50, 6.0)
512   DISCRETE_OUTPUT(NODE_51, 6.0)
513
514DISCRETE_SOUND_END
515
516
335517static MACHINE_DRIVER_START( gyruss )
336518
337519   /* basic machine hardware */
r2454r2455
375557
376558   MDRV_SOUND_ADD(AY8910, 14318180/8)
377559   MDRV_SOUND_CONFIG(ay8910_interface_1)
378   MDRV_SOUND_ROUTE(0, "filter.0.0", 0.22)
379   MDRV_SOUND_ROUTE(1, "filter.0.1", 0.22)
380   MDRV_SOUND_ROUTE(2, "filter.0.2", 0.22)
560   MDRV_SOUND_ROUTE_EX(0, "konami", 1.0, 0)
561   MDRV_SOUND_ROUTE_EX(1, "konami", 1.0, 1)
562   MDRV_SOUND_ROUTE_EX(2, "konami", 1.0, 2)
381563
382564   MDRV_SOUND_ADD(AY8910, 14318180/8)
383565   MDRV_SOUND_CONFIG(ay8910_interface_2)
384   MDRV_SOUND_ROUTE(0, "filter.1.0", 0.22)
385   MDRV_SOUND_ROUTE(1, "filter.1.1", 0.22)
386   MDRV_SOUND_ROUTE(2, "filter.1.2", 0.22)
566   MDRV_SOUND_ROUTE_EX(0, "konami", 1.0, 3)
567   MDRV_SOUND_ROUTE_EX(1, "konami", 1.0, 4)
568   MDRV_SOUND_ROUTE_EX(2, "konami", 1.0, 5)
387569
388570   MDRV_SOUND_ADD(AY8910, 14318180/8)
389571   MDRV_SOUND_CONFIG(ay8910_interface_3)
390   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.44)
572   MDRV_SOUND_ROUTE_EX(0, "konami", 1.0, 6)
573   MDRV_SOUND_ROUTE_EX(1, "konami", 1.0, 7)
574   MDRV_SOUND_ROUTE_EX(2, "konami", 1.0, 8)
391575
392576   MDRV_SOUND_ADD(AY8910, 14318180/8)
393   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.44)
577   MDRV_SOUND_CONFIG(ay8910_interface_4)
578   MDRV_SOUND_ROUTE_EX(0, "konami", 1.0, 9)
579   MDRV_SOUND_ROUTE_EX(1, "konami", 1.0, 10)
580   MDRV_SOUND_ROUTE_EX(2, "konami", 1.0, 11)
394581
395582   MDRV_SOUND_ADD(AY8910, 14318180/8)
396   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.44)
583   MDRV_SOUND_CONFIG(ay8910_interface_5)
584   MDRV_SOUND_ROUTE_EX(0, "konami", 1.0, 12)
585   MDRV_SOUND_ROUTE_EX(1, "konami", 1.0, 13)
586   MDRV_SOUND_ROUTE_EX(2, "konami", 1.0, 14)
397587
398   MDRV_SOUND_ADD(DAC, 0)
399   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.28)
400
401   MDRV_SOUND_ADD_TAG("filter.0.0", FILTER_RC, 0)
402   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
403   MDRV_SOUND_ADD_TAG("filter.0.1", FILTER_RC, 0)
404   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
405   MDRV_SOUND_ADD_TAG("filter.0.2", FILTER_RC, 0)
406   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
407
408   MDRV_SOUND_ADD_TAG("filter.1.0", FILTER_RC, 0)
409   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
410   MDRV_SOUND_ADD_TAG("filter.1.1", FILTER_RC, 0)
411   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
412   MDRV_SOUND_ADD_TAG("filter.1.2", FILTER_RC, 0)
413   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
588   MDRV_SOUND_ADD_TAG("konami", DISCRETE, 0)
589   MDRV_SOUND_CONFIG_DISCRETE(gyruss_sound)
590   MDRV_SOUND_ROUTE(0, "right", 3.0)
591   MDRV_SOUND_ROUTE(1, "left",  3.0)
414592MACHINE_DRIVER_END
415593
416594
src/mame/drivers/groundfx.c
r2454r2455
6363***************************************************************************/
6464
6565#include "driver.h"
66#include "deprecat.h"
6766#include "cpu/m68000/m68000.h"
6867#include "video/taitoic.h"
6968#include "machine/eeprom.h"
r2454r2455
9796      g = (a &0xff00) >> 8;
9897      b = (a &0xff);
9998
100      palette_set_color(Machine,offset,MAKE_RGB(r,g,b));
99      palette_set_color(machine,offset,MAKE_RGB(r,g,b));
101100   }
102101}
103102
r2454r2455
164163   {
165164      case 0x00:
166165      {
167         return (input_port_0_word_r(machine,0,0) << 16) | input_port_1_word_r(machine,0,0) |
166         return (input_port_read_indexed(machine,0) << 16) | input_port_read_indexed(machine,1) |
168167              (EEPROM_read_bit() << 7) | frame_counter;
169168      }
170169
171170      case 0x01:
172171      {
173         return input_port_2_word_r(machine,0,0) | (coin_word << 16);
172         return input_port_read_indexed(machine,2) | (coin_word << 16);
174173      }
175174    }
176175
r2454r2455
215214
216215static READ32_HANDLER( groundfx_adc_r )
217216{
218   return (input_port_3_word_r(machine,0,0) << 8) | input_port_4_word_r(machine,0,0);
217   return (input_port_read_indexed(machine,3) << 8) | input_port_read_indexed(machine,4);
219218}
220219
221220static WRITE32_HANDLER( groundfx_adc_w )
src/mame/drivers/segald.c
r2454r2455
196196   g = (lowBits  & 0xf0) >> 4;
197197   b = (highBits & 0x0f);
198198
199   /* palette_set_color(Machine, palIndex, r, g, b); */
199   /* palette_set_color(machine, palIndex, r, g, b); */
200200   logerror("COLOR write : 0x%04x @   0x%04x [0x%x]\n", data, offset, activecpu_get_pc());
201201}
202202
src/mame/drivers/cabal.c
r2454r2455
113113
114114static WRITE16_HANDLER( cabalbl_sound_irq_trigger_word_w )
115115{
116   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE );
116   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE );
117117}
118118
119119
src/mame/drivers/cidelsa.c
r2454r2455
161161
162162static const struct AY8910interface ay8910_interface =
163163{
164   0,
165   0,
164   AY8910_LEGACY_OUTPUT,
165   AY8910_DEFAULT_LOADS,
166   NULL,
167   NULL,
166168   draco_ay8910_port_a_w,
167169   draco_ay8910_port_b_w
168170};
src/mame/drivers/tickee.c
r2454r2455
161161
162162static READ8_HANDLER( port1_r )
163163{
164   return input_port_1_r(machine, offset) | (ticket_dispenser_0_r(machine, 0) >> 5) | (ticket_dispenser_1_r(machine, 0) >> 6);
164   return input_port_read_indexed(machine,1) | (ticket_dispenser_0_r(machine, 0) >> 5) | (ticket_dispenser_1_r(machine, 0) >> 6);
165165}
166166
167167static READ8_HANDLER( port2_r )
168168{
169   return input_port_3_r(machine, offset) | (ticket_dispenser_0_r(machine, 0) >> 5) | (ticket_dispenser_1_r(machine, 0) >> 6);
169   return input_port_read_indexed(machine,3) | (ticket_dispenser_0_r(machine, 0) >> 5) | (ticket_dispenser_1_r(machine, 0) >> 6);
170170}
171171
172172
r2454r2455
376376
377377static const struct AY8910interface ay8910_interface_1 =
378378{
379   AY8910_LEGACY_OUTPUT,
380   AY8910_DEFAULT_LOADS,
379381   input_port_0_r,
380    input_port_2_r
382    input_port_2_r,
383    NULL,
384    NULL
381385};
382386
383387static const struct AY8910interface ay8910_interface_2 =
384388{
389   AY8910_LEGACY_OUTPUT,
390   AY8910_DEFAULT_LOADS,
385391   port1_r,
386   port2_r
392   port2_r,
393   NULL,
394   NULL
387395};
388396
389397
src/mame/drivers/hotblock.c
r2454r2455
178178
179179static const struct AY8910interface ay8910_interface =
180180{
181   AY8910_LEGACY_OUTPUT,
182   AY8910_DEFAULT_LOADS,
181183   input_port_0_r,
182184   input_port_1_r,
185   NULL,
186   NULL
183187};
184188
185189
src/mame/drivers/m92.c
r2454r2455
360360static WRITE16_HANDLER( m92_sound_status_w )
361361{
362362   COMBINE_DATA(&sound_status);
363   cpunum_set_input_line_and_vector(Machine, 0, 0, HOLD_LINE, M92_IRQ_3);
363   cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, M92_IRQ_3);
364364}
365365
366366/*****************************************************************************/
src/mame/drivers/hal21.c
r2454r2455
5353*/
5454
5555#include "driver.h"
56#include "deprecat.h"
5756#include "cpu/z80/z80.h"
5857#include "snk.h"
5958#include "sound/ay8910.h"
src/mame/drivers/vendetta.c
r2454r2455
8787***************************************************************************/
8888
8989#include "driver.h"
90#include "deprecat.h"
9190#include "video/konamiic.h"
9291#include "cpu/konami/konami.h" /* for the callback and the firq irq definition */
9392#include "machine/eeprom.h"
src/mame/drivers/fcombat.c
r2454r2455
146146static READ8_HANDLER( fcombat_port01_r )
147147{
148148   /* the cocktail flip bit muxes between ports 0 and 1 */
149   return fcombat_cocktail_flip ? input_port_1_r(machine,offset) : input_port_0_r(machine,offset);
149   return fcombat_cocktail_flip ? input_port_read_indexed(machine, 1) : input_port_read_indexed(machine, 0);
150150}
151151
152152
src/mame/drivers/destroyr.c
r2454r2455
8787
8888static WRITE8_HANDLER( destroyr_interrupt_ack_w )
8989{
90   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
90   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
9191}
9292
9393
src/mame/drivers/segas16b.c
r2454r2455
11261126         return input_port_read_indexed(machine, 4 + (offset & 1));
11271127   }
11281128   logerror("%06X:standard_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2);
1129   return segaic16_open_bus_r(machine,0,0);
1129   return segaic16_open_bus_r(machine,0,mem_mask);
11301130}
11311131
11321132
r2454r2455
11561156         coin_counter_w(0, data & 0x01);
11571157         return;
11581158   }
1159   logerror("%06X:standard_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask ^ 0xffff);
1159   logerror("%06X:standard_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask);
11601160}
11611161
11621162
r2454r2455
12051205         /* compare registers */
12061206         return segaic16_compare_timer_0_r(machine, offset & 7, mem_mask);
12071207   }
1208   return segaic16_open_bus_r(machine,0,0);
1208   return segaic16_open_bus_r(machine,0,mem_mask);
12091209}
12101210
12111211
r2454r2455
12411241
12421242static WRITE16_HANDLER( unknown_rgn2_w )
12431243{
1244   logerror("Region 2: write to %04X = %04X & %04X\n", offset * 2, data, mem_mask ^ 0xffff);
1244   logerror("Region 2: write to %04X = %04X & %04X\n", offset * 2, data, mem_mask);
12451245   segaic16_compare_timer_1_w(machine, offset & 7, data, mem_mask);
12461246}
12471247
r2454r2455
13341334static WRITE8_HANDLER( mcu_data_w )
13351335{
13361336   mcu_data = data;
1337   cpunum_set_input_line(Machine, 2, 1, PULSE_LINE);
1337   cpunum_set_input_line(machine, 2, 1, PULSE_LINE);
13381338}
13391339#endif
13401340
r2454r2455
13681368   cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
13691369
13701370   /* set tile banks */
1371   rom_5704_bank_w(machine, 1, workram[0x3094/2] & 0x00ff, 0xff00);
1371   rom_5704_bank_w(machine, 1, workram[0x3094/2] & 0x00ff, 0x00ff);
13721372
13731373   /* process any new sound data */
13741374   temp = workram[soundoffs];
src/mame/drivers/wwfwfest.c
r2454r2455
376376
377377static VIDEO_EOF( wwfwfest )
378378{
379   buffer_spriteram16_w(machine,0,0,0);
379   buffer_spriteram16_w(machine,0,0,0xffff);
380380}
381381
382382/*******************************************************************************
src/mame/drivers/pktgaldx.c
r2454r2455
5454*/
5555
5656#include "driver.h"
57#include "deprecat.h"
5857#include "decocrpt.h"
5958#include "decoprot.h"
6059#include "deco16ic.h"
r2454r2455
125124   g = ((paldat & 0x0000ff00) >>8);
126125   b = ((paldat & 0x00ff0000) >>16);
127126
128   palette_set_color(Machine,pen,MAKE_RGB(r,g,b));
127   palette_set_color(machine,pen,MAKE_RGB(r,g,b));
129128}
130129
131130static READ16_HANDLER( pckgaldx_protection_r )
src/mame/drivers/atarigx2.c
r2454r2455
133133        D0  = CC.R
134134    */
135135
136   logerror("latch_w(%08X) & %08X\n", data, ~mem_mask);
136   logerror("latch_w(%08X) & %08X\n", data, mem_mask);
137137
138138   /* upper byte */
139139   if (ACCESSING_BITS_24_31)
src/mame/drivers/shangha3.c
r2454r2455
479479
480480static const struct AY8910interface ay8910_interface =
481481{
482   AY8910_LEGACY_OUTPUT,
483   AY8910_DEFAULT_LOADS,
482484   input_port_3_r,
483   input_port_2_r
485   input_port_2_r,
486   NULL,
487   NULL
484488};
485489
486490static void irqhandler(int linestate)
src/mame/drivers/pkscram.c
r2454r2455
8787
8888   if (!(out & 0x2000) && interrupt_line_active)
8989   {
90       cpunum_set_input_line(Machine, 0, 1, CLEAR_LINE);
90       cpunum_set_input_line(machine, 0, 1, CLEAR_LINE);
9191      interrupt_line_active = 0;
9292   }
9393
r2454r2455
266266
267267static const struct YM2203interface ym2203_interface =
268268{
269   0,0,0,0,
269   {
270      AY8910_LEGACY_OUTPUT,
271      AY8910_DEFAULT_LOADS,
272      NULL, NULL, NULL, NULL
273   },
270274   irqhandler
271275};
272276
src/mame/drivers/vastar.c
r2454r2455
9292{
9393   /* I'm not sure that this works exactly like this */
9494   if (data & 1)
95      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
95      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
9696   else
97      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
97      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
9898}
9999
100100static READ8_HANDLER( vastar_sharedram_r )
r2454r2455
294294
295295static const struct AY8910interface ay8910_interface =
296296{
297   AY8910_LEGACY_OUTPUT,
298   AY8910_DEFAULT_LOADS,
297299   input_port_3_r,
298   input_port_4_r
300   input_port_4_r,
301   NULL,
302   NULL
299303};
300304
301305
src/mame/drivers/taito_f3.c
r2454r2455
3636***************************************************************************/
3737
3838#include "driver.h"
39#include "deprecat.h"
4039#include "machine/eeprom.h"
4140#include "taito_f3.h"
4241#include "sound/es5506.h"
r2454r2455
119118
120119static WRITE32_HANDLER( f3_sound_reset_0_w )
121120{
122   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
121   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
123122}
124123
125124static WRITE32_HANDLER( f3_sound_reset_1_w )
126125{
127   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
126   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
128127}
129128
130129static WRITE32_HANDLER( f3_sound_bankswitch_w )
src/mame/drivers/homerun.c
r2454r2455
3636
3737static const ppi8255_interface ppi8255_intf =
3838{
39   1,
40   { 0 },
41   { 0  },
42   { 0  },
43   { pa_w },
44   { pb_w },
45   { pc_w },
39   NULL,
40   NULL,
41   NULL,
42   pa_w,
43   pb_w,
44   pc_w
4645};
4746
4847
4948static MACHINE_RESET( homerun )
5049{
51   ppi8255_init(&ppi8255_intf);
5250}
5351
5452static const gfx_layout gfxlayout =
r2454r2455
10199   ADDRESS_MAP_GLOBAL_MASK(0xff)
102100   AM_RANGE(0x10, 0x10) AM_WRITE(SMH_NOP) /* ?? */
103101   AM_RANGE(0x20, 0x20) AM_WRITE(SMH_NOP) /* ?? */
104   AM_RANGE(0x30, 0x33) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
102   AM_RANGE(0x30, 0x33) AM_DEVREADWRITE(PPI8255, "ppi8255", ppi8255_r, ppi8255_w)
105103   AM_RANGE(0x40, 0x40) AM_READ(homerun_40_r)
106104   AM_RANGE(0x50, 0x50) AM_READ(input_port_2_r)
107105   AM_RANGE(0x60, 0x60) AM_READ(input_port_1_r)
r2454r2455
111109
112110static const struct YM2203interface ym2203_interface =
113111{
114   input_port_3_r,
115   0,
116   0,
117   homerun_banking_w
112   {
113      AY8910_LEGACY_OUTPUT,
114      AY8910_DEFAULT_LOADS,
115      input_port_3_r,
116      NULL,
117      NULL,
118      homerun_banking_w
119   },
120   NULL
118121};
119122
120123
r2454r2455
193196
194197   MDRV_MACHINE_RESET(homerun)
195198
199   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
200   MDRV_DEVICE_CONFIG( ppi8255_intf )
201
196202   /* video hardware */
197203   MDRV_SCREEN_ADD("main", RASTER)
198204   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/guab.c
r2454r2455
181181         col = pal.clut[entry] & 0xfff;
182182
183183         /* Update the MAME palette */
184         palette_set_color_rgb(Machine, entry, pal4bit(col >> 0), pal4bit(col >> 4), pal4bit(col >> 8));
184         palette_set_color_rgb(machine, entry, pal4bit(col >> 0), pal4bit(col >> 4), pal4bit(col >> 8));
185185      }
186186
187187         /* Address register auto-increment */
src/mame/drivers/champbas.c
r2454r2455
6666***************************************************************************/
6767
6868#include "driver.h"
69#include "deprecat.h"
7069#include "sound/ay8910.h"
7170#include "sound/dac.h"
7271
r2454r2455
108107
109108static WRITE8_HANDLER( irq_ack_w )
110109{
111   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
110   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
112111}
113112
114113
r2454r2455
129128
130129static WRITE8_HANDLER( champbas_mcu_halt_w )
131130{
132   int cpunum = mame_find_cpu_index(Machine, CPUTAG_MCU);
131   int cpunum = mame_find_cpu_index(machine, CPUTAG_MCU);
133132
134133   // MCU not present/not used in champbas
135134   if (cpunum == -1)
136135      return;
137136
138137   data &= 1;
139   cpunum_set_input_line(Machine, cpunum, INPUT_LINE_HALT, data ? ASSERT_LINE : CLEAR_LINE);
138   cpunum_set_input_line(machine, cpunum, INPUT_LINE_HALT, data ? ASSERT_LINE : CLEAR_LINE);
140139}
141140
142141/* champbja another protection */
src/mame/drivers/baraduke.c
r2454r2455
105105***************************************************************************/
106106
107107#include "driver.h"
108#include "deprecat.h"
109108#include "cpu/m6800/m6800.h"
110109#include "sound/namco.h"
111110
r2454r2455
170169
171170static WRITE8_HANDLER( baraduke_irq_ack_w )
172171{
173   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
172   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
174173}
175174
176175
src/mame/drivers/m107.c
r2454r2455
1414*******************************************************************************/
1515
1616#include "driver.h"
17#include "deprecat.h"
1817#include "m107.h"
1918#include "machine/irem_cpu.h"
2019#include "sound/2151intf.h"
r2454r2455
146145static WRITE16_HANDLER( m107_sound_status_w )
147146{
148147   COMBINE_DATA(&sound_status);
149   cpunum_set_input_line_and_vector(Machine, 0, 0, HOLD_LINE, M107_IRQ_3);
148   cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, M107_IRQ_3);
150149}
151150
152151/*****************************************************************************/
src/mame/drivers/arkanoid.c
r2454r2455
736736
737737static const struct AY8910interface ay8910_interface =
738738{
739   AY8910_LEGACY_OUTPUT,
740   AY8910_DEFAULT_LOADS,
739741   input_port_5_r,
740   input_port_4_r
742   input_port_4_r,
743   NULL,
744   NULL
741745};
742746
743747/* Machine Drivers */
src/mame/drivers/twin16.c
r2454r2455
5353*/
5454
5555#include "driver.h"
56#include "deprecat.h"
5756#include "cpu/m68000/m68000.h"
5857#include "cpu/z80/z80.h"
5958#include "sound/2151intf.h"
r2454r2455
171170   if( twin16_CPUA_register!=old )
172171   {
173172      if( (old&0x08)==0 && (twin16_CPUA_register&0x08) )
174         cpunum_set_input_line_and_vector(Machine, CPU_SOUND, 0, HOLD_LINE, 0xff );
173         cpunum_set_input_line_and_vector(machine, CPU_SOUND, 0, HOLD_LINE, 0xff );
175174
176175      if( (old&0x40) && (twin16_CPUA_register&0x40)==0 )
177176         twin16_spriteram_process();
178177
179178      if( (old&0x10)==0 && (twin16_CPUA_register&0x10) )
180         cpunum_set_input_line(Machine, CPU_B, MC68000_IRQ_6, HOLD_LINE );
179         cpunum_set_input_line(machine, CPU_B, MC68000_IRQ_6, HOLD_LINE );
181180
182181      coin_counter_w( 0, twin16_CPUA_register&0x01 );
183182      coin_counter_w( 1, twin16_CPUA_register&0x02 );
r2454r2455
199198   {
200199      if( (old&0x01)==0 && (twin16_CPUB_register&0x1) )
201200      {
202         cpunum_set_input_line(Machine, CPU_A, MC68000_IRQ_6, HOLD_LINE );
201         cpunum_set_input_line(machine, CPU_A, MC68000_IRQ_6, HOLD_LINE );
203202      }
204203   }
205204}
r2454r2455
211210   if( twin16_CPUA_register!=old )
212211   {
213212      if( (old&0x08)==0 && (twin16_CPUA_register&0x08) )
214         cpunum_set_input_line_and_vector(Machine, CPU_SOUND, 0, HOLD_LINE, 0xff ); // trigger IRQ on sound CPU
213         cpunum_set_input_line_and_vector(machine, CPU_SOUND, 0, HOLD_LINE, 0xff ); // trigger IRQ on sound CPU
215214   }
216215}
217216
r2454r2455
259258
260259/* Memory Maps */
261260
262static ADDRESS_MAP_START( readmem_sound, ADDRESS_SPACE_PROGRAM, 8 )
263   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
264   AM_RANGE(0x8000, 0x8fff) AM_READ(SMH_RAM)
265   AM_RANGE(0x9000, 0x9000) AM_READ(twin16_sres_r)
261static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
262   AM_RANGE(0x0000, 0x7fff) AM_ROM
263   AM_RANGE(0x8000, 0x8fff) AM_RAM
264   AM_RANGE(0x9000, 0x9000) AM_READWRITE(twin16_sres_r, twin16_sres_w)
266265   AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r)
267   AM_RANGE(0xb000, 0xb00d) AM_READ(K007232_read_port_0_r)
268   AM_RANGE(0xc001, 0xc001) AM_READ(YM2151_status_port_0_r)
269   AM_RANGE(0xf000, 0xf000) AM_READ(upd7759_0_busy_r)
270ADDRESS_MAP_END
271
272static ADDRESS_MAP_START( writemem_sound, ADDRESS_SPACE_PROGRAM, 8 )
273   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
274   AM_RANGE(0x8000, 0x8fff) AM_WRITE(SMH_RAM)
275   AM_RANGE(0x9000, 0x9000) AM_WRITE(twin16_sres_w)
276   AM_RANGE(0xb000, 0xb00d) AM_WRITE(K007232_write_port_0_w)
266   AM_RANGE(0xb000, 0xb00d) AM_READWRITE(K007232_read_port_0_r, K007232_write_port_0_w)
277267   AM_RANGE(0xc000, 0xc000) AM_WRITE(YM2151_register_port_0_w)
278   AM_RANGE(0xc001, 0xc001) AM_WRITE(YM2151_data_port_0_w)
268   AM_RANGE(0xc001, 0xc001) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w)
279269   AM_RANGE(0xd000, 0xd000) AM_WRITE(upd7759_0_port_w)
280270   AM_RANGE(0xe000, 0xe000) AM_WRITE(upd7759_0_start_w)
281   AM_RANGE(0xf000, 0xf000) AM_WRITE(SMH_NOP)   // ???
282ADDRESS_MAP_END
271   AM_RANGE(0xf000, 0xf000) AM_READWRITE(upd7759_0_busy_r, SMH_NOP)   // ??? write ???
272   ADDRESS_MAP_END
283273
284static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 16 )
285   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
286   AM_RANGE(0x040000, 0x043fff) AM_READ(COMRAM_r)
287   AM_RANGE(0x044000, 0x04ffff) AM_READ(SMH_RAM)   // miaj
288   AM_RANGE(0x060000, 0x063fff) AM_READ(SMH_RAM)
289   AM_RANGE(0x080000, 0x080fff) AM_READ(SMH_RAM)
290   AM_RANGE(0x0a0000, 0x0a001b) AM_READ(twin16_input_r)
291   AM_RANGE(0x0b0000, 0x0b03ff) AM_READ(cuebrckj_nvram_r)
292   AM_RANGE(0x0c000e, 0x0c000f) AM_READ(twin16_sprite_status_r)
293   AM_RANGE(0x100000, 0x103fff) AM_READ(SMH_RAM)
294   AM_RANGE(0x104000, 0x105fff) AM_READ(SMH_RAM)   // miaj
295   AM_RANGE(0x120000, 0x123fff) AM_READ(SMH_RAM)
296ADDRESS_MAP_END
297
298static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 16 )
299   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
300   AM_RANGE(0x040000, 0x043fff) AM_WRITE(COMRAM_w)
301   AM_RANGE(0x044000, 0x04ffff) AM_WRITE(SMH_RAM)   // miaj
302   AM_RANGE(0x060000, 0x063fff) AM_WRITE(SMH_RAM)
303   AM_RANGE(0x080000, 0x080fff) AM_WRITE(twin16_paletteram_word_w) AM_BASE(&paletteram16)
274static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
275   AM_RANGE(0x000000, 0x03ffff) AM_ROM
276   AM_RANGE(0x040000, 0x043fff) AM_READWRITE(COMRAM_r, COMRAM_w)
277   AM_RANGE(0x044000, 0x04ffff) AM_RAM            // miaj
278   AM_RANGE(0x060000, 0x063fff) AM_RAM
279   AM_RANGE(0x080000, 0x080fff) AM_RAM_WRITE(twin16_paletteram_word_w) AM_BASE(&paletteram16)
304280   AM_RANGE(0x081000, 0x081fff) AM_WRITE(SMH_NOP)
281   AM_RANGE(0x0a0000, 0x0a001b) AM_READ(twin16_input_r)
305282   AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(twin16_CPUA_register_w)
306283   AM_RANGE(0x0a0008, 0x0a0009) AM_WRITE(sound_command_w)
307284   AM_RANGE(0x0a0010, 0x0a0011) AM_WRITE(watchdog_reset16_w)
308   AM_RANGE(0x0b0000, 0x0b03ff) AM_WRITE(cuebrckj_nvram_w)
285   AM_RANGE(0x0b0000, 0x0b03ff) AM_READWRITE(cuebrckj_nvram_r, cuebrckj_nvram_w)
309286   AM_RANGE(0x0b0400, 0x0b0401) AM_WRITE(cuebrckj_nvram_bank_w)
310287   AM_RANGE(0x0c0000, 0x0c000f) AM_WRITE(twin16_video_register_w)
311   AM_RANGE(0x100000, 0x103fff) AM_WRITE(twin16_videoram2_w) AM_BASE(&twin16_videoram2)
312   AM_RANGE(0x104000, 0x105fff) AM_WRITE(SMH_RAM)   // miaj
313   AM_RANGE(0x120000, 0x123fff) AM_WRITE(SMH_RAM) AM_BASE(&videoram16)
288   AM_RANGE(0x0c000e, 0x0c000f) AM_READ(twin16_sprite_status_r)
289   AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(twin16_videoram2_w) AM_BASE(&twin16_videoram2)
290   AM_RANGE(0x104000, 0x105fff) AM_RAM            // miaj
291   AM_RANGE(0x120000, 0x123fff) AM_RAM AM_BASE(&videoram16)
314292   AM_RANGE(0x140000, 0x143fff) AM_RAM AM_SHARE(1) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
315293ADDRESS_MAP_END
316294
317static ADDRESS_MAP_START( readmem_sub, ADDRESS_SPACE_PROGRAM, 16 )
318   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
319   AM_RANGE(0x040000, 0x043fff) AM_READ(COMRAM_r)
320   AM_RANGE(0x044000, 0x04ffff) AM_READ(SMH_RAM)   // miaj
321   AM_RANGE(0x060000, 0x063fff) AM_READ(SMH_RAM)
295static ADDRESS_MAP_START( sub_map, ADDRESS_SPACE_PROGRAM, 16 )
296   AM_RANGE(0x000000, 0x03ffff) AM_ROM
297   AM_RANGE(0x040000, 0x043fff) AM_READWRITE(COMRAM_r, COMRAM_w)
298   AM_RANGE(0x044000, 0x04ffff) AM_RAM            // miaj
299   AM_RANGE(0x060000, 0x063fff) AM_RAM
322300   AM_RANGE(0x080000, 0x09ffff) AM_READ(extra_rom_r)
323   AM_RANGE(0x480000, 0x483fff) AM_READ(videoram16_r)
324   AM_RANGE(0x500000, 0x53ffff) AM_READ(SMH_RAM)
301   AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(twin16_CPUB_register_w)
302   AM_RANGE(0x400000, 0x403fff) AM_RAM AM_SHARE(1)
303   AM_RANGE(0x480000, 0x483fff) AM_READWRITE(videoram16_r, videoram16_w)
304   AM_RANGE(0x500000, 0x53ffff) AM_RAM AM_BASE(&twin16_tile_gfx_ram)
325305   AM_RANGE(0x600000, 0x6fffff) AM_READ(twin16_gfx_rom1_r)
326306   AM_RANGE(0x700000, 0x77ffff) AM_READ(twin16_gfx_rom2_r)
327   AM_RANGE(0x780000, 0x79ffff) AM_READ(SMH_RAM)
307   AM_RANGE(0x780000, 0x79ffff) AM_RAM AM_BASE(&twin16_sprite_gfx_ram)
328308ADDRESS_MAP_END
329309
330static ADDRESS_MAP_START( writemem_sub, ADDRESS_SPACE_PROGRAM, 16 )
331   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
332   AM_RANGE(0x040000, 0x043fff) AM_WRITE(COMRAM_w)
333   AM_RANGE(0x044000, 0x04ffff) AM_WRITE(SMH_RAM)   // miaj
334   AM_RANGE(0x060000, 0x063fff) AM_WRITE(SMH_RAM)
335   AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(twin16_CPUB_register_w)
336   AM_RANGE(0x400000, 0x403fff) AM_RAM AM_SHARE(1)
337   AM_RANGE(0x480000, 0x483fff) AM_WRITE(videoram16_w)
338   AM_RANGE(0x500000, 0x53ffff) AM_WRITE(SMH_RAM) AM_BASE(&twin16_tile_gfx_ram)
339   AM_RANGE(0x780000, 0x79ffff) AM_WRITE(SMH_RAM) AM_BASE(&twin16_sprite_gfx_ram)
340ADDRESS_MAP_END
341
342static ADDRESS_MAP_START( fround_readmem, ADDRESS_SPACE_PROGRAM, 16 )
343   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
344   AM_RANGE(0x040000, 0x043fff) AM_READ(COMRAM_r)
345   AM_RANGE(0x060000, 0x063fff) AM_READ(SMH_RAM)
346   AM_RANGE(0x080000, 0x080fff) AM_READ(SMH_RAM)
310static ADDRESS_MAP_START( fround_map, ADDRESS_SPACE_PROGRAM, 16 )
311   AM_RANGE(0x000000, 0x03ffff) AM_ROM
312   AM_RANGE(0x040000, 0x043fff) AM_READWRITE(COMRAM_r, COMRAM_w)
313   AM_RANGE(0x060000, 0x063fff) AM_RAM
314   AM_RANGE(0x080000, 0x080fff) AM_RAM_WRITE(twin16_paletteram_word_w) AM_BASE(&paletteram16)
347315   AM_RANGE(0x0a0000, 0x0a001b) AM_READ(twin16_input_r)
348   AM_RANGE(0x0c000e, 0x0c000f) AM_READ(twin16_sprite_status_r)
349   AM_RANGE(0x100000, 0x103fff) AM_READ(SMH_RAM)
350   AM_RANGE(0x120000, 0x123fff) AM_READ(SMH_RAM)
351   AM_RANGE(0x140000, 0x143fff) AM_READ(SMH_RAM)
352   AM_RANGE(0x500000, 0x6fffff) AM_READ(twin16_gfx_rom1_r)
353ADDRESS_MAP_END
354
355static ADDRESS_MAP_START( fround_writemem, ADDRESS_SPACE_PROGRAM, 16 )
356   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
357   AM_RANGE(0x040000, 0x043fff) AM_WRITE(COMRAM_w)
358   AM_RANGE(0x060000, 0x063fff) AM_WRITE(SMH_RAM)
359   AM_RANGE(0x080000, 0x080fff) AM_WRITE(twin16_paletteram_word_w) AM_BASE(&paletteram16)
360316   AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(fround_CPU_register_w)
361317   AM_RANGE(0x0a0008, 0x0a0009) AM_WRITE(sound_command_w)
362318   AM_RANGE(0x0a0010, 0x0a0011) AM_WRITE(watchdog_reset16_w)
363319   AM_RANGE(0x0c0000, 0x0c000f) AM_WRITE(twin16_video_register_w)
320   AM_RANGE(0x0c000e, 0x0c000f) AM_READ(twin16_sprite_status_r)
364321   AM_RANGE(0x0e0000, 0x0e0001) AM_WRITE(fround_gfx_bank_w)
365   AM_RANGE(0x100000, 0x103fff) AM_WRITE(twin16_videoram2_w) AM_BASE(&twin16_videoram2)
366   AM_RANGE(0x120000, 0x123fff) AM_WRITE(SMH_RAM) AM_BASE(&videoram16)
367   AM_RANGE(0x140000, 0x143fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
322   AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(twin16_videoram2_w) AM_BASE(&twin16_videoram2)
323   AM_RANGE(0x120000, 0x123fff) AM_RAM AM_BASE(&videoram16)
324   AM_RANGE(0x140000, 0x143fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
325   AM_RANGE(0x500000, 0x6fffff) AM_READ(twin16_gfx_rom1_r)
368326ADDRESS_MAP_END
369327
370328/* Input Ports */
r2454r2455
957915   // basic machine hardware
958916   MDRV_CPU_ADD(Z80, 3579545)
959917   /* audio CPU */
960   MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound)
918   MDRV_CPU_PROGRAM_MAP(sound_map,0)
961919
962920   MDRV_CPU_ADD(M68000, XTAL_18_432MHz/2)
963   MDRV_CPU_PROGRAM_MAP(readmem_sub,writemem_sub)
921   MDRV_CPU_PROGRAM_MAP(sub_map,0)
964922   MDRV_CPU_VBLANK_INT("main", CPUB_interrupt)
965923
966924   MDRV_CPU_ADD(M68000, XTAL_18_432MHz/2)
967   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
925   MDRV_CPU_PROGRAM_MAP(main_map,0)
968926   MDRV_CPU_VBLANK_INT("main", CPUA_interrupt)
969927
970928   MDRV_INTERLEAVE(100)
r2454r2455
1015973   /* basic machine hardware */
1016974   MDRV_CPU_ADD(Z80, 3579545)
1017975   /* audio CPU */
1018   MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound)
976   MDRV_CPU_PROGRAM_MAP(sound_map,0)
1019977
1020978   MDRV_CPU_ADD(M68000, 10000000)
1021   MDRV_CPU_PROGRAM_MAP(fround_readmem,fround_writemem)
979   MDRV_CPU_PROGRAM_MAP(fround_map,0)
1022980   MDRV_CPU_VBLANK_INT("main", CPUA_interrupt)
1023981
1024982   MDRV_INTERLEAVE(100)
src/mame/drivers/megasys1.c
r2454r2455
274274
275275   switch (i)
276276   {
277         case 0 :   return coins_r(machine,0,0);   break;
278         case 1 :   return player1_r(machine,0,0);   break;
279         case 2 :   return player2_r(machine,0,0);   break;
280         case 3 :   return dsw1_r(machine,0,0);      break;
281         case 4 :   return dsw2_r(machine,0,0);      break;
277         case 0 :   return coins_r(machine,0,0xffff);   break;
278         case 1 :   return player1_r(machine,0,0xffff);   break;
279         case 2 :   return player2_r(machine,0,0xffff);   break;
280         case 3 :   return dsw1_r(machine,0,0xffff);   break;
281         case 4 :   return dsw2_r(machine,0,0xffff);   break;
282282         default    :   return 0x0006;
283283   }
284284}
r2454r2455
286286static WRITE16_HANDLER( ip_select_w )
287287{
288288   COMBINE_DATA(&ip_select);
289   cpunum_set_input_line(Machine, 0,2,HOLD_LINE);
289   cpunum_set_input_line(machine, 0,2,HOLD_LINE);
290290}
291291
292292
r2454r2455
795795
796796static const struct YM2203interface ym2203_interface =
797797{
798   0,
799   0,
800   0,
801   0,
798   {
799      AY8910_LEGACY_OUTPUT,
800      AY8910_DEFAULT_LOADS,
801      NULL, NULL, NULL, NULL
802   },
802803   irq_handler
803804};
804805
r2454r2455
29312932   switch (protection_val)
29322933   {
29332934      case 0x02:   return 0x03;
2934      case 0x51:   return player1_r(machine,0,0);
2935      case 0x52:   return player2_r(machine,0,0);
2935      case 0x51:   return player1_r(machine,0,0xffff);
2936      case 0x52:   return player2_r(machine,0,0xffff);
29362937      default:   return protection_val;
29372938   }
29382939}
r2454r2455
29552956      }
29562957   }
29572958
2958   cpunum_set_input_line(Machine, 0,4,HOLD_LINE);
2959   cpunum_set_input_line(machine, 0,4,HOLD_LINE);
29592960}
29602961
29612962
src/mame/drivers/airbustr.c
r2454r2455
275275
276276static WRITE8_HANDLER( master_nmi_trigger_w )
277277{
278   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
278   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
279279}
280280
281281static void airbustr_bankswitch(int cpunum, int data)
r2454r2455
352352   paletteram[offset] = data;
353353   val = (paletteram[offset | 1] << 8) | paletteram[offset & ~1];
354354
355   palette_set_color_rgb(Machine, offset/2, pal5bit(val >> 5), pal5bit(val >> 10), pal5bit(val >> 0));
355   palette_set_color_rgb(machine, offset/2, pal5bit(val >> 5), pal5bit(val >> 10), pal5bit(val >> 0));
356356}
357357
358358static WRITE8_HANDLER( airbustr_coin_counter_w )
r2454r2455
560560
561561static const struct YM2203interface ym2203_interface =
562562{
563   input_port_3_r,      // DSW-1 connected to port A
564   input_port_4_r      // DSW-2 connected to port B
563   {
564      AY8910_LEGACY_OUTPUT,
565      AY8910_DEFAULT_LOADS,
566      input_port_3_r,      // DSW-1 connected to port A
567      input_port_4_r,      // DSW-2 connected to port B
568      NULL,
569      NULL
570   },
571   NULL
565572};
566573
567574/* Interrupt Generators */
src/mame/drivers/pacman.c
r2454r2455
388388static WRITE8_HANDLER( pacman_interrupt_vector_w )
389389{
390390   cpunum_set_input_line_vector(0, 0, data);
391   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
391   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
392392}
393393
394394
r2454r2455
557557
558558static READ8_HANDLER( maketrax_special_port2_r )
559559{
560   int data = input_port_2_r(machine,offset);
560   int data = input_port_read_indexed(machine, 2);
561561   int pc = activecpu_get_previouspc();
562562
563563   if ((pc == 0x1973) || (pc == 0x2389)) return data | 0x40;
r2454r2455
600600
601601static READ8_HANDLER( korosuke_special_port2_r )
602602{
603   int data = input_port_2_r(machine,offset);
603   int data = input_port_read_indexed(machine,2);
604604   int pc = activecpu_get_previouspc();
605605
606606   if ((pc == 0x196e) || (pc == 0x2387)) return data | 0x40;
r2454r2455
33263326
33273327static const struct AY8910interface crushs_ay8910_interface =
33283328{
3329   AY8910_LEGACY_OUTPUT,
3330   AY8910_DEFAULT_LOADS,
3331   NULL,
3332   NULL,
3333   NULL,
33293334   NULL
33303335};
33313336
src/mame/drivers/dcheese.c
r2454r2455
207207   if (offset % 2 == 0)
208208      sound_msb_latch = data;
209209   else
210      BSMT2000_data_0_w(machine, offset/2, (sound_msb_latch << 8) | data, 0);
210      BSMT2000_data_0_w(machine, offset/2, (sound_msb_latch << 8) | data, 0xffff);
211211}
212212
213213
src/mame/drivers/chqflag.c
r2454r2455
7777   coin_counter_w(0,data & 0x02);
7878
7979   /* bit 4 = enable rom reading thru K051316 #1 & #2 */
80   if ((K051316_readroms = (data & 0x10))){
80   K051316_readroms = (data & 0x10);
81   if (K051316_readroms)
8182      memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2800, 0x2fff, 0, 0, K051316_rom_1_r);   /* 051316 (ROM test) */
82   }
83   else{
83   else
8484      memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2800, 0x2fff, 0, 0, K051316_1_r);      /* 051316 */
85   }
8685
8786   /* Bits 3-7 probably control palette dimming in a similar way to TMNT2/Saunset Riders, */
8887   /* however I don't have enough evidence to determine the exact behaviour. */
r2454r2455
9089   /* the headlight (which have the shadow bit set) become highlights */
9190   /* Maybe one of the bits inverts the SHAD line while the other darkens the background. */
9291   if (data & 0x08)
93      palette_set_shadow_factor(Machine,1/PALETTE_DEFAULT_SHADOW_FACTOR);
92      palette_set_shadow_factor(machine,1/PALETTE_DEFAULT_SHADOW_FACTOR);
9493   else
95      palette_set_shadow_factor(Machine,PALETTE_DEFAULT_SHADOW_FACTOR);
94      palette_set_shadow_factor(machine,PALETTE_DEFAULT_SHADOW_FACTOR);
9695
9796   if ((data & 0x80) != last)
9897   {
r2454r2455
103102
104103      /* only affect the background */
105104      for (i = 512;i < 1024;i++)
106         palette_set_brightness(Machine,i,brt);
105         palette_set_brightness(machine,i,brt);
107106   }
108107
109108//if ((data & 0xf8) && (data & 0xf8) != 0x88)
r2454r2455
136135
137136static WRITE8_HANDLER( chqflag_sh_irqtrigger_w )
138137{
139   cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
138   cpunum_set_input_line(machine, 1,0,HOLD_LINE);
140139}
141140
142141
src/mame/drivers/bwing.c
r2454r2455
119119   switch (offset)
120120   {
121121      // MSSTB
122      case 0: cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, ASSERT_LINE); break;
122      case 0: cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, ASSERT_LINE); break;
123123
124124      // IRQACK
125      case 1: cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, CLEAR_LINE); break;
125      case 1: cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, CLEAR_LINE); break;
126126
127127      // FIRQACK
128      case 2: cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, CLEAR_LINE); break;
128      case 2: cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, CLEAR_LINE); break;
129129
130130      // NMIACK
131      case 3: cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE); break;
131      case 3: cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE); break;
132132
133133      // SWAP(bank-swaps sprite RAM between 1800 & 1900; ignored bc. they're treated as a single chunk.)
134134      case 4: break;
r2454r2455
136136      // SNDREQ
137137      case 5:
138138         if (data == 0x80) // protection trick to screw CPU1 & 3
139            cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, ASSERT_LINE); // SNMI
139            cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE); // SNMI
140140         else
141141         if (ffcount < MAX_SOUNDS)
142142         {
r2454r2455
163163{
164164   switch (offset)
165165   {
166      case 0: cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, ASSERT_LINE); break; // SMSTB
166      case 0: cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, ASSERT_LINE); break; // SMSTB
167167
168      case 1: cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, CLEAR_LINE); break;
168      case 1: cpunum_set_input_line(machine, 1, M6809_FIRQ_LINE, CLEAR_LINE); break;
169169
170      case 2: cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, CLEAR_LINE); break;
170      case 2: cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, CLEAR_LINE); break;
171171
172      case 3: cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE); break;
172      case 3: cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE); break;
173173   }
174174
175175   #if BW_DEBUG
src/mame/drivers/srmp6.c
r2454r2455
569569         if(b > 0x1F) b = 0x1F;
570570      }
571571
572      palette_set_color(Machine, offset, MAKE_RGB(r << 3, g << 3, b << 3));
572      palette_set_color(machine, offset, MAKE_RGB(r << 3, g << 3, b << 3));
573573   }
574574}
575575
src/mame/drivers/sf.c
r2454r2455
123123         program_write_word(0xffc00c, 0xc0);
124124         program_write_word(0xffc00e, 0);
125125
126         sf_fg_scroll_w(machine, 0, d1, 0);
127         sf_bg_scroll_w(machine, 0, d2, 0);
126         sf_fg_scroll_w(machine, 0, d1, 0xffff);
127         sf_bg_scroll_w(machine, 0, d2, 0xffff);
128128         break;
129129      }
130130   case 4:
r2454r2455
144144            }
145145            program_write_word(0xffc682, d1);
146146            program_write_word(0xffc00e, off);
147            sf_bg_scroll_w(machine, 0, d1, 0);
147            sf_bg_scroll_w(machine, 0, d1, 0xffff);
148148         }
149149         break;
150150      }
src/mame/drivers/lsasquad.c
r2454r2455
578578
579579static const struct YM2203interface ym2203_interface =
580580{
581   0,
582   0,
583   unk,
584   unk,
581   {
582      AY8910_LEGACY_OUTPUT,
583      AY8910_DEFAULT_LOADS,
584      NULL,
585      NULL,
586      unk,
587      unk,
588   },
585589   irqhandler
586590};
587591
src/mame/drivers/konamim2.c
r2454r2455
9696*/
9797
9898#include "driver.h"
99#include "deprecat.h"
10099#include "cdrom.h"
101100#include "cpu/powerpc/ppc.h"
102101
r2454r2455
228227      if (data & 0x800000)
229228      {
230229         mame_printf_debug("CPU%d: CPU1 IRQ at %08X\n", cpu_getactivecpu(), activecpu_get_pc());
231         cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ0, ASSERT_LINE);
230         cpunum_set_input_line(machine, 1, INPUT_LINE_IRQ0, ASSERT_LINE);
232231      }
233232
234233      unk20004 = (UINT32)(data);
r2454r2455
323322   {
324323      if (data & U64(0x100000000))
325324      {
326         cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, PULSE_LINE);
325         cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE);
327326         unk3 = 0;
328327      }
329328   }
src/mame/drivers/cave.c
r2454r2455
222222//  sound_flag1 = 1;
223223//  sound_flag2 = 1;
224224   soundlatch_word_w(machine,offset,data,mem_mask);
225   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
225   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
226226   cpu_spinuntil_time(ATTOTIME_IN_USEC(50));   // Allow the other cpu to reply
227227}
228228
r2454r2455
230230static READ8_HANDLER( soundlatch_lo_r )
231231{
232232//  sound_flag1 = 0;
233   return soundlatch_word_r(machine,offset,0) & 0xff;
233   return soundlatch_word_r(machine,offset,0x00ff) & 0xff;
234234}
235235
236236/* Sound CPU: read the high 8 bits of the 16 bit sound latch */
237237static READ8_HANDLER( soundlatch_hi_r )
238238{
239239//  sound_flag2 = 0;
240   return soundlatch_word_r(machine,offset,0) >> 8;
240   return soundlatch_word_r(machine,offset,0xff00) >> 8;
241241}
242242
243243/* Main CPU: read the latch written by the sound CPU (acknowledge) */
r2454r2455
578578      case 0:
579579      case 1:
580580      case 2:
581      case 3:   return cave_irq_cause_r(machine,offset,0);
581      case 3:   return cave_irq_cause_r(machine,offset,0xffff);
582582
583583      default:   return 0x0000;
584584   }
r2454r2455
20052005
20062006static const struct YM2203interface ym2203_interface =
20072007{
2008   0,0,0,0,irqhandler
2008   {
2009      AY8910_LEGACY_OUTPUT,
2010      AY8910_DEFAULT_LOADS,
2011      NULL, NULL, NULL, NULL
2012   },
2013   irqhandler
20092014};
20102015
20112016
src/mame/drivers/dooyong.c
r2454r2455
910910
911911static const struct YM2203interface ym2203_interface_1 =
912912{
913   unk_r,
914   0,
915   0,
916   0,
913   {
914      AY8910_LEGACY_OUTPUT,
915      AY8910_DEFAULT_LOADS,
916      unk_r, NULL, NULL, NULL
917   },
917918   irqhandler
918919};
919920
920921static const struct YM2203interface ym2203_interface_2 =
921922{
922   unk_r
923   {
924      AY8910_LEGACY_OUTPUT,
925      AY8910_DEFAULT_LOADS,
926      unk_r, NULL, NULL, NULL
927   },
928   NULL
923929};
924930
925931static const struct YM2151interface ym2151_interface =
src/mame/drivers/fuukifg3.c
r2454r2455
195195      g = (paletteram32[offset] & 0x03e00000) >> (5+16);
196196      b = (paletteram32[offset] & 0x001f0000) >> (0+16);
197197
198      palette_set_color_rgb(Machine,offset*2,pal5bit(r),pal5bit(g),pal5bit(b));
198      palette_set_color_rgb(machine,offset*2,pal5bit(r),pal5bit(g),pal5bit(b));
199199   }
200200
201201   if(ACCESSING_BITS_0_15)
r2454r2455
207207      g = (paletteram32[offset] & 0x000003e0) >> (5);
208208      b = (paletteram32[offset] & 0x0000001f) >> (0);
209209
210      palette_set_color_rgb(Machine,offset*2+1,pal5bit(r),pal5bit(g),pal5bit(b));
210      palette_set_color_rgb(machine,offset*2+1,pal5bit(r),pal5bit(g),pal5bit(b));
211211   }
212212}
213213
src/mame/drivers/dec8.c
r2454r2455
238238   switch (offset) {
239239   case 0: /* High byte */
240240      i8751_value=(i8751_value&0xff) | (data<<8);
241      if (int_enable) cpunum_set_input_line (Machine, 0, M6809_IRQ_LINE, HOLD_LINE); /* IRQ on *high* byte only */
241      if (int_enable) cpunum_set_input_line (machine, 0, M6809_IRQ_LINE, HOLD_LINE); /* IRQ on *high* byte only */
242242      break;
243243   case 1: /* Low byte */
244244      i8751_value=(i8751_value&0xff00) | data;
r2454r2455
271271   switch (offset) {
272272   case 0: /* High byte */
273273      i8751_value=(i8751_value&0xff) | (data<<8);
274      cpunum_set_input_line (Machine, 1, M6809_FIRQ_LINE, HOLD_LINE); /* Signal main cpu */
274      cpunum_set_input_line (machine, 1, M6809_FIRQ_LINE, HOLD_LINE); /* Signal main cpu */
275275      break;
276276   case 1: /* Low byte */
277277      i8751_value=(i8751_value&0xff00) | data;
r2454r2455
299299   switch (offset) {
300300   case 0: /* High byte */
301301      i8751_value=(i8751_value&0xff) | (data<<8);
302      cpunum_set_input_line (Machine, 0, M6809_FIRQ_LINE, HOLD_LINE); /* Signal main cpu */
302      cpunum_set_input_line (machine, 0, M6809_FIRQ_LINE, HOLD_LINE); /* Signal main cpu */
303303      break;
304304   case 1: /* Low byte */
305305      i8751_value=(i8751_value&0xff00) | data;
r2454r2455
330330   switch (offset) {
331331   case 0: /* High byte */
332332      i8751_value=(i8751_value&0xff) | (data<<8);
333      cpunum_set_input_line (Machine, 0, M6809_FIRQ_LINE, HOLD_LINE); /* Signal main cpu */
333      cpunum_set_input_line (machine, 0, M6809_FIRQ_LINE, HOLD_LINE); /* Signal main cpu */
334334      break;
335335   case 1: /* Low byte */
336336      i8751_value=(i8751_value&0xff00) | data;
r2454r2455
474474   /* Deal with interrupts, coins also generate NMI to CPU 0 */
475475   switch (offset) {
476476      case 0: /* IRQ2 */
477         cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,ASSERT_LINE);
477         cpunum_set_input_line(machine, 1,M6809_IRQ_LINE,ASSERT_LINE);
478478         return;
479479      case 1: /* IRC 1 */
480         cpunum_set_input_line(Machine, 0,M6809_IRQ_LINE,CLEAR_LINE);
480         cpunum_set_input_line(machine, 0,M6809_IRQ_LINE,CLEAR_LINE);
481481         return;
482482      case 2: /* IRQ 1 */
483         cpunum_set_input_line(Machine, 0,M6809_IRQ_LINE,ASSERT_LINE);
483         cpunum_set_input_line(machine, 0,M6809_IRQ_LINE,ASSERT_LINE);
484484         return;
485485      case 3: /* IRC 2 */
486         cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,CLEAR_LINE);
486         cpunum_set_input_line(machine, 1,M6809_IRQ_LINE,CLEAR_LINE);
487487         return;
488488   }
489489}
r2454r2455
497497    (The last interrupt has not finished and been ack'd when the new one occurs */
498498   switch (offset) {
499499      case 0: /* CPU 2 - IRQ acknowledge */
500         cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,CLEAR_LINE);
500         cpunum_set_input_line(machine, 1,M6809_IRQ_LINE,CLEAR_LINE);
501501            return;
502502        case 1: /* CPU 1 - IRQ acknowledge */
503         cpunum_set_input_line(Machine, 0,M6809_IRQ_LINE,CLEAR_LINE);
503         cpunum_set_input_line(machine, 0,M6809_IRQ_LINE,CLEAR_LINE);
504504           return;
505505        case 2: /* i8751 - FIRQ acknowledge */
506506            return;
507507        case 3: /* IRQ 1 */
508         cpunum_set_input_line(Machine, 0,M6809_IRQ_LINE,ASSERT_LINE);
508         cpunum_set_input_line(machine, 0,M6809_IRQ_LINE,ASSERT_LINE);
509509         return;
510510        case 4: /* IRQ 2 */
511            cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,ASSERT_LINE);
511            cpunum_set_input_line(machine, 1,M6809_IRQ_LINE,ASSERT_LINE);
512512            return;
513513   }
514514#endif
r2454r2455
521521        case 2: /* i8751 - FIRQ acknowledge */
522522            return;
523523        case 3: /* IRQ 1 */
524         cpunum_set_input_line (Machine, 0, M6809_IRQ_LINE, HOLD_LINE);
524         cpunum_set_input_line (machine, 0, M6809_IRQ_LINE, HOLD_LINE);
525525         return;
526526        case 4: /* IRQ 2 */
527            cpunum_set_input_line (Machine, 1, M6809_IRQ_LINE, HOLD_LINE);
527            cpunum_set_input_line (machine, 1, M6809_IRQ_LINE, HOLD_LINE);
528528            return;
529529   }
530530}
src/mame/drivers/tbowl.c
r2454r2455
152152static WRITE8_HANDLER ( tbowl_trigger_nmi )
153153{
154154   /* trigger NMI on 6206B's Cpu? (guess but seems to work..) */
155   cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE);
155   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
156156}
157157
158158static ADDRESS_MAP_START( readmem_6206C, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/battlane.c
r2454r2455
6060    /*
6161    if (~battlane_cpu_control & 0x08)
6262    {
63        cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE);
64        cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
63        cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
64        cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
6565    }
6666    */
6767
r2454r2455
6969        CPU2's SWI will trigger an 6809 IRQ on the master by resetting 0x04
7070        Master will respond by setting the bit back again
7171    */
72    cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE,  data & 0x04 ? CLEAR_LINE : HOLD_LINE);
72    cpunum_set_input_line(machine, 0, M6809_IRQ_LINE,  data & 0x04 ? CLEAR_LINE : HOLD_LINE);
7373
7474   /*
7575    Slave function call (e.g. ROM test):
r2454r2455
8787    FA96: 27 FA       BEQ   $FA92   ; Wait for bit to be set
8888    */
8989
90   cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, data & 0x02 ? CLEAR_LINE : HOLD_LINE);
90   cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, data & 0x02 ? CLEAR_LINE : HOLD_LINE);
9191}
9292
9393static ADDRESS_MAP_START( battlane_map, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/atarigt.c
r2454r2455
9393   if (reason)
9494      atarigen_sound_int_gen(Machine, 0);
9595   else
96      atarigen_sound_int_ack_w(Machine,0,0,0);
96      atarigen_sound_int_ack_w(Machine,0,0,0xffff);
9797}
9898
9999
r2454r2455
231231
232232static WRITE32_HANDLER( led_w )
233233{
234//  logerror("LED = %08X & %08X\n", data, ~mem_mask);
234//  logerror("LED = %08X & %08X\n", data, mem_mask);
235235}
236236
237237
r2454r2455
10781078   /* protected version */
10791079   if (pc == 0x2EB3C || pc == 0x2EB48)
10801080   {
1081      logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", activecpu_get_pc(), 0xd72000 + offset*4, data, ~mem_mask, (UINT32)activecpu_get_reg(M68K_A4) - 2);
1081      logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", activecpu_get_pc(), 0xd72000 + offset*4, data, mem_mask, (UINT32)activecpu_get_reg(M68K_A4) - 2);
10821082      /* skip these writes to make more stuff visible */
10831083      return;
10841084   }
10851085
10861086   /* unprotected version */
10871087   if (pc == 0x25834 || pc == 0x25860)
1088      logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", activecpu_get_pc(), 0xd72000 + offset*4, data, ~mem_mask, (UINT32)activecpu_get_reg(M68K_A3) - 2);
1088      logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", activecpu_get_pc(), 0xd72000 + offset*4, data, mem_mask, (UINT32)activecpu_get_reg(M68K_A3) - 2);
10891089
10901090   atarigen_playfield32_w(machine, offset, data, mem_mask);
10911091}
src/mame/drivers/cherrym2.c
r2454r2455
343343
344344static const struct AY8910interface ay8910_interface =
345345{
346   AY8910_LEGACY_OUTPUT,
347   AY8910_DEFAULT_LOADS,
346348   input_port_6_r,   //
347349   input_port_7_r,   //
348350   0,
src/mame/drivers/rbmk.c
r2454r2455
8888
8989static READ16_HANDLER( eeprom_r )
9090{
91   return (EEPROM_read_bit() << 15)|(input_port_3_word_r(machine,0,0)&0x7fff);
91   return (EEPROM_read_bit() << 15)|(input_port_read_indexed(machine,3)&0x7fff);
9292}
9393
9494static WRITE16_HANDLER( eeprom_w )
src/mame/drivers/bigfghtr.c
r2454r2455
272272
273273static VIDEO_EOF( bigfghtr )
274274{
275   buffer_spriteram16_w(machine,0,0,0);
275   buffer_spriteram16_w(machine,0,0,0xffff);
276276}
277277
278278
r2454r2455
317317         break;
318318
319319         case 0x46/2:
320            return (input_port_0_word_r(machine,0,0)&0xffff)^0xffff;
320            return (input_port_read_indexed(machine,0)&0xffff)^0xffff;
321321
322322
323323      }
src/mame/drivers/genesis.c
r2454r2455
204204/* from MESS */
205205WRITE16_HANDLER(genesis_ctrl_w)
206206{
207   data &= ~mem_mask;
207   data &= mem_mask;
208208
209209/*  logerror("genesis_ctrl_w %x, %x\n", offset, data); */
210210
r2454r2455
217217      if (data == 0x100)
218218      {
219219         z80running = 0;
220         cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE);   /* halt Z80 */
220         cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);   /* halt Z80 */
221221         /* logerror("z80 stopped by 68k BusReq\n"); */
222222      }
223223      else
r2454r2455
225225         z80running = 1;
226226//          memory_set_bankptr(1, &genesis_z80_ram[0]);
227227
228         cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
228         cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
229229         /* logerror("z80 started, BusReq ends\n"); */
230230      }
231231      return;
r2454r2455
233233   case 0x100:                  /* Z80 CPU Reset */
234234      if (data == 0x00)
235235      {
236         cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
237         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE);
236         cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
237         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, PULSE_LINE);
238238
239         cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
239         cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
240240         /* logerror("z80 reset, ram is %p\n", &genesis_z80_ram[0]); */
241241         z80running = 0;
242242         return;
src/mame/drivers/thepit.c
r2454r2455
635635
636636static const struct AY8910interface ay8910_interface =
637637{
638   soundlatch_r
638   AY8910_LEGACY_OUTPUT,
639   AY8910_DEFAULT_LOADS,
640   soundlatch_r,
641   NULL,
642   NULL,
643   NULL
639644};
640645
641646
src/mame/drivers/cloud9.c
r2454r2455
9191***************************************************************************/
9292
9393#include "driver.h"
94#include "deprecat.h"
9594#include "sound/pokey.h"
9695#include "cloud9.h"
9796
r2454r2455
228227{
229228   if (irq_state)
230229   {
231      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
230      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
232231      irq_state = 0;
233232   }
234233}
src/mame/drivers/rpunch.c
r2454r2455
194194static READ8_HANDLER( sound_command_r )
195195{
196196   sound_busy = 0;
197   cpunum_set_input_line(Machine, 1, 0, (ym2151_irq | sound_busy) ? ASSERT_LINE : CLEAR_LINE);
197   cpunum_set_input_line(machine, 1, 0, (ym2151_irq | sound_busy) ? ASSERT_LINE : CLEAR_LINE);
198198   return sound_data;
199199}
200200
src/mame/drivers/changela.c
r2454r2455
449449INPUT_PORTS_END
450450
451451
452static const struct AY8910interface ay8910_interface_1 = {
452static const struct AY8910interface ay8910_interface_1 =
453{
454   AY8910_LEGACY_OUTPUT,
455   AY8910_DEFAULT_LOADS,
453456   input_port_0_r,
454   input_port_1_r
457   input_port_1_r,
458   NULL,
459   NULL
455460};
456461
457static const struct AY8910interface ay8910_interface_2 = {
462static const struct AY8910interface ay8910_interface_2 =
463{
464   AY8910_LEGACY_OUTPUT,
465   AY8910_DEFAULT_LOADS,
458466   input_port_2_r,
459   input_port_3_r
467   input_port_3_r,
468   NULL,
469   NULL
460470};
461471
462472
src/mame/drivers/rabbit.c
r2454r2455
473473   r = ((paletteram32[offset] & 0x0000ff00) >>8);
474474   g = ((paletteram32[offset] & 0x00ff0000) >>16);
475475
476   palette_set_color(Machine,offset^0xff,MAKE_RGB(r,g,b));
476   palette_set_color(machine,offset^0xff,MAKE_RGB(r,g,b));
477477}
478478
479479static READ32_HANDLER( rabbit_tilemap0_r )
r2454r2455
553553#if VERBOSE_AUDIO_LOG
554554   int reg, voice, base, i;
555555
556   if (mem_mask == 0x0000ffff)
556   if (mem_mask == 0xffff0000)
557557   {
558558      reg = offset*2;
559559      data >>= 16;
560560   }
561   else if (mem_mask == 0xffff0000)
561   else if (mem_mask == 0x0000ffff)
562562   {
563563      reg = (offset*2)+1;
564564      data &= 0xffff;
r2454r2455
722722{
723723   // don't disturb the EEPROM if we're not actually writing to it
724724   // (in particular, data & 0x100 here with mask = ffff00ff looks to be the watchdog)
725   if (mem_mask == 0x00ffffff)
725   if (mem_mask == 0xff000000)
726726   {
727727      // latch the bit
728728      EEPROM_write_bit(data & 0x01000000);
r2454r2455
792792   r = ((paletteram32[offset] & 0x0000ff00) >>8);
793793   g = ((paletteram32[offset] & 0x00ff0000) >>16);
794794
795   palette_set_color(Machine,(offset^0xff)+0x2000,MAKE_RGB(r,g,b));
795   palette_set_color(machine,(offset^0xff)+0x2000,MAKE_RGB(r,g,b));
796796}
797797
798798
src/mame/drivers/pooyan.c
r2454r2455
99***************************************************************************/
1010
1111#include "driver.h"
12#include "deprecat.h"
1312#include "pooyan.h"
1413#include "audio/timeplt.h"
1514
r2454r2455
4443{
4544   irq_enable = data & 1;
4645   if (!irq_enable)
47      cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
46      cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
4847}
4948
5049
src/mame/drivers/rollerg.c
r2454r2455
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110#include "video/konamiic.h"
1211#include "cpu/konami/konami.h" /* for the callback and the firq irq definition */
1312#include "machine/eeprom.h"
r2454r2455
5756
5857static WRITE8_HANDLER( soundirq_w )
5958{
60   cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
59   cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);
6160}
6261
6362static TIMER_CALLBACK( nmi_callback )
r2454r2455
6766
6867static WRITE8_HANDLER( sound_arm_nmi_w )
6968{
70   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
69   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
7170   timer_set(ATTOTIME_IN_USEC(50), NULL,0,nmi_callback);   /* kludge until the K053260 is emulated correctly */
7271}
7372
src/mame/drivers/sidepckt.c
r2454r2455
4949   static const int table_3[]={0xbd,0x73,0x80,0xbd,0x73,0xa7,0xbd,0x73,0xe0,0x7e,0x72,0x56,0xff,0xff,0xff,0xff};
5050   static int current_ptr=0,current_table=0,in_math=0,math_param;
5151
52   cpunum_set_input_line(Machine, 0,M6809_FIRQ_LINE,HOLD_LINE); /* i8751 triggers FIRQ on main cpu */
52   cpunum_set_input_line(machine, 0,M6809_FIRQ_LINE,HOLD_LINE); /* i8751 triggers FIRQ on main cpu */
5353
5454   /* This function takes multiple parameters */
5555   if (in_math==1) {
r2454r2455
9090   static const int table_3[]={0xbd,0x71,0xc8,0xbd,0x71,0xef,0xbd,0x72,0x28,0x7e,0x70,0x9e,0xff,0xff,0xff,0xff};
9191   static int current_ptr=0,current_table=0,in_math,math_param;
9292
93   cpunum_set_input_line(Machine, 0,M6809_FIRQ_LINE,HOLD_LINE); /* i8751 triggers FIRQ on main cpu */
93   cpunum_set_input_line(machine, 0,M6809_FIRQ_LINE,HOLD_LINE); /* i8751 triggers FIRQ on main cpu */
9494
9595   /* This function takes multiple parameters */
9696   if (in_math==1) {
src/mame/drivers/pirates.c
r2454r2455
170170      bit = 1;
171171
172172   /* bit 4 is EEPROM data, bit 7 is protection */
173   return input_port_1_word_r(machine,0,0) | (EEPROM_read_bit() << 4) | (bit << 7);
173   return input_port_read_indexed(machine,1) | (EEPROM_read_bit() << 4) | (bit << 7);
174174}
175175
176176
src/mame/drivers/tankbatt.c
r2454r2455
5656***************************************************************************/
5757
5858#include "driver.h"
59#include "deprecat.h"
6059#include "cpu/m6502/m6502.h"
6160#include "sound/samples.h"
6261
r2454r2455
107106   tankbatt_sound_enable = !data;
108107   if (data != 0)
109108   {
110      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
111      cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
109      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
110      cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
112111   }
113112   /* hack - turn off the engine noise if the normal game nmi's are disabled */
114113   if (data) sample_stop (2);
r2454r2455
120119   tankbatt_nmi_enable = data;
121120   if (data != 0)
122121   {
123      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
124      cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
122      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
123      cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
125124   }
126125//  interrupt_enable_w (offset, data);
127126}
src/mame/drivers/cherrym.c
r2454r2455
363363
364364static const struct AY8910interface ay8910_interface =
365365{
366   AY8910_LEGACY_OUTPUT,
367   AY8910_DEFAULT_LOADS,
366368   input_port_6_r,   //
367369   input_port_7_r,   //
368   0,
369   0
370   NULL,
371   NULL
370372};
371373
372374static MACHINE_DRIVER_START( cmv801 )
src/mame/drivers/exerion.c
r2454r2455
3131static READ8_HANDLER( exerion_port01_r )
3232{
3333   /* the cocktail flip bit muxes between ports 0 and 1 */
34   return exerion_cocktail_flip ? input_port_1_r(machine,offset) : input_port_0_r(machine,offset);
34   return exerion_cocktail_flip ? input_port_read_indexed(machine, 1) : input_port_read_indexed(machine, 0);
3535}
3636
3737
r2454r2455
260260
261261static const struct AY8910interface ay8910_interface =
262262{
263   AY8910_LEGACY_OUTPUT,
264   AY8910_DEFAULT_LOADS,
263265   exerion_porta_r,
264   0,
265   0,
266   NULL,
267   NULL,
266268   exerion_portb_w
267269};
268270
src/mame/drivers/mosaic.c
r2454r2455
276276
277277static const struct YM2203interface ym2203_interface =
278278{
279   input_port_2_r
279   {
280      AY8910_LEGACY_OUTPUT,
281      AY8910_DEFAULT_LOADS,
282      input_port_2_r,
283      NULL,
284      NULL,
285      NULL
286   },
287   NULL
280288};
281289
282290
src/mame/drivers/segas18.c
r2454r2455
335335   if (custom_io_r)
336336      return custom_io_r(machine, offset, mem_mask);
337337   logerror("%06X:misc_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2);
338   return segaic16_open_bus_r(machine,0,0);
338   return segaic16_open_bus_r(machine,0,mem_mask);
339339}
340340
341341
r2454r2455
368368      custom_io_w(machine, offset, data, mem_mask);
369369      return;
370370   }
371   logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask ^ 0xffff);
371   logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask);
372372}
373373
374374
r2454r2455
427427      case 0x3024/2:
428428         return input_port_read(machine, "P34START");
429429   }
430   return segaic16_open_bus_r(machine,0,0);
430   return segaic16_open_bus_r(machine,0,mem_mask);
431431}
432432
433433
r2454r2455
451451         lghost_value <<= 1;
452452         return result;
453453   }
454   return segaic16_open_bus_r(machine,0,0);
454   return segaic16_open_bus_r(machine,0,mem_mask);
455455}
456456
457457
r2454r2455
511511      case 0x3014/2:
512512         return (input_port_read(machine, "TRACKY3") - wwally_last_y[2]) & 0xff;
513513   }
514   return segaic16_open_bus_r(machine,0,0);
514   return segaic16_open_bus_r(machine,0,mem_mask);
515515}
516516
517517
src/mame/drivers/meijinsn.c
r2454r2455
291291
292292static const struct AY8910interface ay8910_interface =
293293{
294   AY8910_LEGACY_OUTPUT,
295   AY8910_DEFAULT_LOADS,
294296   soundlatch_r
295297};
296298
src/mame/drivers/royalmah.c
r2454r2455
221221
222222static READ8_HANDLER( royalmah_player_1_port_r )
223223{
224   int ret = (input_port_0_r(machine,offset) & 0xc0) | 0x3f;
224   int ret = (input_port_read_indexed(machine,0) & 0xc0) | 0x3f;
225225
226   if ((input_port_select & 0x01) == 0)  ret &= input_port_0_r(machine,offset);
227   if ((input_port_select & 0x02) == 0)  ret &= input_port_1_r(machine,offset);
228   if ((input_port_select & 0x04) == 0)  ret &= input_port_2_r(machine,offset);
229   if ((input_port_select & 0x08) == 0)  ret &= input_port_3_r(machine,offset);
230   if ((input_port_select & 0x10) == 0)  ret &= input_port_4_r(machine,offset);
226   if ((input_port_select & 0x01) == 0)  ret &= input_port_read_indexed(machine,0);
227   if ((input_port_select & 0x02) == 0)  ret &= input_port_read_indexed(machine,1);
228   if ((input_port_select & 0x04) == 0)  ret &= input_port_read_indexed(machine,2);
229   if ((input_port_select & 0x08) == 0)  ret &= input_port_read_indexed(machine,3);
230   if ((input_port_select & 0x10) == 0)  ret &= input_port_read_indexed(machine,4);
231231
232232   return ret;
233233}
234234
235235static READ8_HANDLER( royalmah_player_2_port_r )
236236{
237   int ret = (input_port_5_r(machine,offset) & 0xc0) | 0x3f;
237   int ret = (input_port_read_indexed(machine,5) & 0xc0) | 0x3f;
238238
239   if ((input_port_select & 0x01) == 0)  ret &= input_port_5_r(machine,offset);
240   if ((input_port_select & 0x02) == 0)  ret &= input_port_6_r(machine,offset);
241   if ((input_port_select & 0x04) == 0)  ret &= input_port_7_r(machine,offset);
242   if ((input_port_select & 0x08) == 0)  ret &= input_port_8_r(machine,offset);
243   if ((input_port_select & 0x10) == 0)  ret &= input_port_9_r(machine,offset);
239   if ((input_port_select & 0x01) == 0)  ret &= input_port_read_indexed(machine,5);
240   if ((input_port_select & 0x02) == 0)  ret &= input_port_read_indexed(machine,6);
241   if ((input_port_select & 0x04) == 0)  ret &= input_port_read_indexed(machine,7);
242   if ((input_port_select & 0x08) == 0)  ret &= input_port_read_indexed(machine,8);
243   if ((input_port_select & 0x10) == 0)  ret &= input_port_read_indexed(machine,9);
244244
245245   return ret;
246246}
r2454r2455
33053305
33063306static const struct AY8910interface ay8910_interface =
33073307{
3308   AY8910_LEGACY_OUTPUT,
3309   AY8910_DEFAULT_LOADS,
33083310   royalmah_player_1_port_r,
33093311   royalmah_player_2_port_r
33103312};
src/mame/drivers/exctsccr.c
r2454r2455
4848***************************************************************************/
4949
5050#include "driver.h"
51#include "deprecat.h"
5251#include "sound/ay8910.h"
5352#include "sound/dac.h"
5453
r2454r2455
8382
8483static WRITE8_HANDLER( exctsccr_mcu_halt_w )
8584{
86   cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
85   cpunum_set_input_line(machine, 2, INPUT_LINE_HALT, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
8786}
8887
8988/***************************************************************************
src/mame/drivers/mquake.c
r2454r2455
126126{
127127   if (offset == 1)
128128      return input_port_read(machine, "COINCHIP");
129   logerror("%06x:coin_chip_r(%02x) & %04x\n", activecpu_get_pc(), offset, mem_mask ^ 0xffff);
129   logerror("%06x:coin_chip_r(%02x) & %04x\n", activecpu_get_pc(), offset, mem_mask);
130130   return 0xffff;
131131}
132132
133133static WRITE16_HANDLER( coin_chip_w )
134134{
135   logerror("%06x:coin_chip_w(%02x) = %04x & %04x\n", activecpu_get_pc(), offset, data, mem_mask ^ 0xffff);
135   logerror("%06x:coin_chip_w(%02x) = %04x & %04x\n", activecpu_get_pc(), offset, data, mem_mask);
136136}
137137
138138// inputs at 282000, 282002 (full word)
src/mame/drivers/funybubl.c
r2454r2455
4949
5050
5151#include "driver.h"
52#include "deprecat.h"
5352#include "sound/okim6295.h"
5453
5554/* video/funybubl.c */
src/mame/drivers/shisen.c
r2454r2455
2020
2121static READ8_HANDLER( sichuan2_dsw1_r )
2222{
23   int ret = input_port_3_r(machine, 0);
23   int ret = input_port_read_indexed(machine,3);
2424
2525   /* Based on the coin mode fill in the upper bits */
26   if (input_port_4_r(machine, 0) & 0x04)
26   if (input_port_read_indexed(machine,4) & 0x04)
2727   {
2828      /* Mode 1 */
29      ret   |= (input_port_5_r(machine, 0) << 4);
29      ret   |= (input_port_read_indexed(machine,5) << 4);
3030   }
3131   else
3232   {
3333      /* Mode 2 */
34      ret   |= (input_port_5_r(machine, 0) & 0xf0);
34      ret   |= (input_port_read_indexed(machine,5) & 0xf0);
3535   }
3636
3737   return ret;
src/mame/drivers/tutankhm.c
r2454r2455
1313***************************************************************************/
1414
1515#include "driver.h"
16#include "deprecat.h"
1716#include "tutankhm.h"
1817#include "cpu/m6809/m6809.h"
1918#include "audio/timeplt.h"
r2454r2455
4443{
4544   irq_enable = data & 1;
4645   if (!irq_enable)
47      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
46      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
4847}
4948
5049
src/mame/drivers/nmk16.c
r2454r2455
335335      return res << 8;
336336   }
337337   else
338      return ~input_port_1_word_r(machine,0,0);
338      return ~input_port_read_indexed(machine,1);
339339}
340340
341341static WRITE16_HANDLER( macross2_sound_command_w )
r2454r2455
36763676
36773677static const struct YM2203interface ym2203_nmk004_interface =
36783678{
3679   0,0,0,0,NMK004_irq
3679   {
3680      AY8910_LEGACY_OUTPUT,
3681      AY8910_DEFAULT_LOADS,
3682      NULL, NULL, NULL, NULL
3683   },
3684   NMK004_irq
36803685};
36813686
36823687static void ym2203_irqhandler(int irq)
r2454r2455
36863691
36873692static const struct YM2203interface ym2203_interface =
36883693{
3689   0,0,0,0,ym2203_irqhandler
3694   {
3695      AY8910_LEGACY_OUTPUT,
3696      AY8910_DEFAULT_LOADS,
3697      NULL, NULL, NULL, NULL
3698   },
3699   ym2203_irqhandler
36903700};
36913701
36923702static INTERRUPT_GEN( nmk_interrupt )
src/osd/windows/winmain.c
r2454r2455
6565int _CRT_glob = 0;
6666
6767
68
6968//============================================================
7069//  LOCAL VARIABLES
7170//============================================================
r2454r2455
7978static char mapfile_name[MAX_PATH];
8079static LPTOP_LEVEL_EXCEPTION_FILTER pass_thru_filter;
8180
81static HANDLE watchdog_exit_event;
82static HANDLE watchdog_thread;
83
84
8285#ifndef MESS
8386static const TCHAR helpfile[] = TEXT("docs\\windows.txt");
8487#else
r2454r2455
101104
102105static void soft_link_functions(void);
103106static int is_double_click_start(int argc);
107static DWORD WINAPI watchdog_thread_entry(LPVOID lpParameter);
104108static LONG CALLBACK exception_filter(struct _EXCEPTION_POINTERS *info);
105109static const char *lookup_symbol(UINT32 address);
106110static int get_code_base_size(UINT32 *base, UINT32 *size);
r2454r2455
120124   // debugging options
121125   { NULL,                       NULL,       OPTION_HEADER,     "WINDOWS DEBUGGING OPTIONS" },
122126   { "oslog",                    "0",        OPTION_BOOLEAN,    "output error.log data to the system debugger" },
127   { "watchdog;wdog",            "0",        0,                 "force the program to terminate if no updates within specified number of seconds" },
123128
124129   // performance options
125130   { NULL,                       NULL,       OPTION_HEADER,     "WINDOWS PERFORMANCE OPTIONS" },
r2454r2455
239244   // soft-link optional functions
240245   soft_link_functions();
241246
247   // compute the name of the mapfile
242248   strcpy(mapfile_name, argv[0]);
243249   ext = strchr(mapfile_name, '.');
244   if (ext)
250   if (ext != NULL)
245251      strcpy(ext, ".map");
246252   else
247253      strcat(mapfile_name, ".map");
r2454r2455
267273
268274void osd_init(running_machine *machine)
269275{
276   int watchdog = options_get_int(mame_options(), WINOPTION_WATCHDOG);
277
270278   // thread priority
271279   if (!options_get_bool(mame_options(), OPTION_DEBUG))
272280      SetThreadPriority(GetCurrentThread(), options_get_int(mame_options(), WINOPTION_PRIORITY));
r2454r2455
295303//          mm_task = (*av_set_mm_thread_characteristics)(TEXT("Playback"), &task_index);
296304
297305   start_profiler();
306
307   // if a watchdog thread is requested, create one
308   if (watchdog != 0)
309   {
310      watchdog_exit_event = CreateEvent(NULL, TRUE, FALSE, NULL);
311      assert_always(watchdog_exit_event != NULL, "Failed to create watchdog event");
312      watchdog_thread = CreateThread(NULL, 0, watchdog_thread_entry, (LPVOID)watchdog, 0, NULL);
313      assert_always(watchdog_thread != NULL, "Failed to create watchdog thread");
314   }
298315}
299316
300317
318//============================================================
319//  osd_exit
320//============================================================
321
301322static void osd_exit(running_machine *machine)
302323{
324   // take down the watchdog thread if it exists
325   if (watchdog_thread != NULL)
326   {
327      SetEvent(watchdog_exit_event);
328      WaitForSingleObject(watchdog_thread, INFINITE);
329      watchdog_exit_event = NULL;
330      watchdog_thread = NULL;
331   }
332
303333   stop_profiler();
304334
305335   // turn off our multimedia tasks
r2454r2455
361391
362392
363393//============================================================
394//  watchdog_thread_entry
395//============================================================
396
397static DWORD WINAPI watchdog_thread_entry(LPVOID lpParameter)
398{
399   DWORD timeout = (int)(FPTR)lpParameter * 1000;
400   DWORD wait_result;
401
402   wait_result = WaitForSingleObject(watchdog_exit_event, timeout);
403   if (wait_result == WAIT_TIMEOUT)
404      TerminateProcess(GetCurrentProcess(), -1);
405   return 0;
406}
407
408
409//============================================================
364410//  exception_filter
365411//============================================================
366412
r2454r2455
550596
551597   // parse the file, looking for map entries
552598   while (fgets(line, sizeof(line) - 1, map))
553      if (!strncmp(line, "                0x", 18))
599      if (strncmp(line, "                0x", 18) == 0)
554600         if (sscanf(line, "                0x%08x %s", &addr, symbol) == 2)
555601            if (addr <= address && addr > best_addr)
556602            {
557603               best_addr = addr;
558604               strcpy(best_symbol, symbol);
559605            }
606   fclose(map);
560607
561608   // create the final result
562609   if (address - best_addr > 0x10000)
r2454r2455
575622{
576623   FILE *   map = fopen(mapfile_name, "r");
577624   char   line[1024];
625   int result = 0;
578626
579627   // if no file, return nothing
580628   if (map == NULL)
r2454r2455
584632   while (fgets(line, sizeof(line) - 1, map))
585633      if (!strncmp(line, ".text           0x", 18))
586634         if (sscanf(line, ".text           0x%08x 0x%x", base, size) == 2)
587            return 1;
635         {
636            result = 1;
637            break;
638         }
588639
640   fclose(map);
589641   return 0;
590642}
591643
r2454r2455
625677static DWORD profiler_thread_id;
626678static volatile UINT8 profiler_thread_exit;
627679
680
681
628682//============================================================
629683//  compare_base
630684//  compare_hits -- qsort callbacks to sort on
src/osd/windows/winmain.h
r2454r2455
4848#define WINOPTION_AUDIO_LATENCY         "audio_latency"
4949#define WINOPTION_PRIORITY            "priority"
5050#define WINOPTION_MULTITHREADING      "multithreading"
51#define WINOPTION_WATCHDOG            "watchdog"
5152#define WINOPTION_OSLOG               "oslog"
5253
5354
src/emu/debug/debugcpu.c
r2454r2455
13201320   within_debugger_code = TRUE;
13211321
13221322   /* adjust address, size & value_to_write based on mem_mask. */
1323   if( mem_mask != 0 )
1323   if (mem_mask != 0)
13241324   {
13251325      const debug_cpu_info *info = &debug_cpuinfo[cpunum];
13261326      int address_offset = 0;
r2454r2455
13401340      }
13411341
13421342      if (info->endianness == CPU_IS_LE)
1343      {
13441343         address += address_offset;
1345      }
13461344      else
1347      {
13481345         address += bus_size - size - address_offset;
1349      }
13501346   }
13511347
13521348   /* if we are a write watchpoint, stash the value that will be written */
src/emu/cpu/m6805/m6805.c
r2454r2455
3232
3333
3434#include "debugger.h"
35#include "deprecat.h"
3635#include "m6805.h"
3736
3837#define IRQ_LEVEL_DETECT 0
src/emu/cpu/v30mz/v30mz.c
r2454r2455
4141****************************************************************************/
4242
4343#include "debugger.h"
44#include "deprecat.h"
4544
4645typedef UINT8 BOOLEAN;
4746typedef UINT8 BYTE;
src/emu/cpu/lh5801/lh5801.c
r2454r2455
1818 *
1919 *****************************************************************************/
2020#include "debugger.h"
21#include "deprecat.h"
2221
2322#include "lh5801.h"
2423
src/emu/cpu/m6809/m6809.c
r2454r2455
7171*****************************************************************************/
7272
7373#include "debugger.h"
74#include "deprecat.h"
7574#include "m6809.h"
7675
7776/* Enable big switch statement for the main opcodes */
src/emu/cpu/h83002/h83002.c
r2454r2455
39413941
39423942static READ16_HANDLER( h8_itu_r )
39433943{
3944   if (mem_mask == 0)
3944   if (mem_mask == 0xffff)
39453945   {
39463946      // 16-bit read
39473947      return h8_register_read8(offset*2 + 0xffff10)<<8 | h8_register_read8((offset*2) + 1 + 0xffff10);
39483948   }
3949   else if (mem_mask == 0xff)
3949   else if (mem_mask == 0xff00)
39503950   {
39513951      return h8_register_read8(offset*2 + 0xffff10)<<8;
39523952   }
3953   else if (mem_mask == 0xff00)
3953   else if (mem_mask == 0x00ff)
39543954   {
39553955      return h8_register_read8((offset*2) + 1 + 0xffff10);
39563956   }
r2454r2455
39603960
39613961static WRITE16_HANDLER( h8_itu_w )
39623962{
3963   if (mem_mask == 0)
3963   if (mem_mask == 0xffff)
39643964   {
39653965      // 16-bit write
39663966      h8_register_write8(offset*2 + 0xffff10, data>>8);
39673967      h8_register_write8((offset*2) + 1 + 0xffff10, data&0xff);
39683968   }
3969   else if (mem_mask == 0xff)
3969   else if (mem_mask == 0xff00)
39703970   {
39713971      h8_register_write8(offset*2 + 0xffff10, data>>8);
39723972   }
3973   else if (mem_mask == 0xff00)
3973   else if (mem_mask == 0x00ff)
39743974   {
39753975      h8_register_write8((offset*2) + 1 + 0xffff10, data&0xff);
39763976   }
r2454r2455
39783978
39793979static READ16_HANDLER( h8_3007_itu_r )
39803980{
3981   if (mem_mask == 0)
3981   if (mem_mask == 0xffff)
39823982   {
39833983      // 16-bit read
39843984      return h8_3007_register_read8(offset*2 + 0xffff20)<<8 | h8_3007_register_read8((offset*2) + 1 + 0xffff20);
39853985   }
3986   else if (mem_mask == 0xff)
3986   else if (mem_mask == 0xff00)
39873987   {
39883988      return h8_3007_register_read8(offset*2 + 0xffff20)<<8;
39893989   }
3990   else if (mem_mask == 0xff00)
3990   else if (mem_mask == 0x00ff)
39913991   {
39923992      return h8_3007_register_read8((offset*2) + 1 + 0xffff20);
39933993   }
r2454r2455
39963996}
39973997static WRITE16_HANDLER( h8_3007_itu_w )
39983998{
3999   if (mem_mask == 0)
3999   if (mem_mask == 0xffff)
40004000   {
40014001      // 16-bit write
40024002      h8_3007_register_write8(offset*2 + 0xffff20, data>>8);
40034003      h8_3007_register_write8((offset*2) + 1 + 0xffff20, data&0xff);
40044004   }
4005   else if (mem_mask == 0xff)
4005   else if (mem_mask == 0xff00)
40064006   {
40074007      h8_3007_register_write8(offset*2 + 0xffff20, data>>8);
40084008   }
4009   else if (mem_mask == 0xff00)
4009   else if (mem_mask == 0x00ff)
40104010   {
40114011      h8_3007_register_write8((offset*2) + 1 + 0xffff20, data&0xff);
40124012   }
r2454r2455
40144014
40154015static READ16_HANDLER( h8_3007_itu1_r )
40164016{
4017   if (mem_mask == 0)
4017   if (mem_mask == 0xffff)
40184018   {
40194019      // 16-bit read
40204020      return h8_3007_register1_read8(offset*2 + 0xfee000)<<8 | h8_3007_register1_read8((offset*2) + 1 + 0xfee000);
40214021   }
4022   else if (mem_mask == 0xff)
4022   else if (mem_mask == 0xff00)
40234023   {
40244024      return h8_3007_register1_read8(offset*2 + 0xfee000)<<8;
40254025   }
4026   else if (mem_mask == 0xff00)
4026   else if (mem_mask == 0x00ff)
40274027   {
40284028      return h8_3007_register1_read8((offset*2) + 1 + 0xfee000);
40294029   }
r2454r2455
40324032}
40334033static WRITE16_HANDLER( h8_3007_itu1_w )
40344034{
4035   if (mem_mask == 0)
4035   if (mem_mask == 0xffff)
40364036   {
40374037      // 16-bit write
40384038      h8_3007_register1_write8(offset*2 + 0xfee000, data>>8);
40394039      h8_3007_register1_write8((offset*2) + 1 + 0xfee000, data&0xff);
40404040   }
4041   else if (mem_mask == 0xff)
4041   else if (mem_mask == 0xff00)
40424042   {
40434043      h8_3007_register1_write8(offset*2 + 0xfee000, data>>8);
40444044   }
4045   else if (mem_mask == 0xff00)
4045   else if (mem_mask == 0x00ff)
40464046   {
40474047      h8_3007_register1_write8((offset*2) + 1 + 0xfee000, data&0xff);
40484048   }
src/emu/cpu/m68000/m68kmame.h
r2454r2455
66/* ======================================================================== */
77
88#include "debugger.h"
9#include "deprecat.h"
109#include "m68000.h"
1110
1211/* Configuration switches (see m68kconf.h for explanation) */
src/emu/cpu/ccpu/ccpu.c
r2454r2455
99***************************************************************************/
1010
1111#include "debugger.h"
12#include "deprecat.h"
1312#include "ccpu.h"
1413
1514
src/emu/cpu/z80gb/z80gb.c
r2454r2455
3737/**                                                         **/
3838/*************************************************************/
3939#include "debugger.h"
40#include "deprecat.h"
4140#include "z80gb.h"
4241
4342#define FLAG_Z   0x80
src/emu/cpu/tms34010/tms34010.c
r2454r2455
701701   /* the first time we are run */
702702   state.reset_deferred = state.config->halt_on_reset;
703703   if (state.config->halt_on_reset)
704      tms34010_io_register_w(Machine, REG_HSTCTLH, 0x8000, 0);
704      tms34010_io_register_w(Machine, REG_HSTCTLH, 0x8000, 0xffff);
705705}
706706
707707#if (HAS_TMS34020)
r2454r2455
16721672      /* control register */
16731673      case TMS34010_HOST_CONTROL:
16741674         external_host_access = TRUE;
1675         tms34010_io_register_w(state.screen->machine, REG_HSTCTLH, data & 0xff00, 0);
1676         tms34010_io_register_w(state.screen->machine, REG_HSTCTLL, data & 0x00ff, 0);
1675         tms34010_io_register_w(state.screen->machine, REG_HSTCTLH, data & 0xff00, 0xffff);
1676         tms34010_io_register_w(state.screen->machine, REG_HSTCTLL, data & 0x00ff, 0xffff);
16771677         external_host_access = FALSE;
16781678         break;
16791679
src/emu/cpu/tms32031/tms32031.c
r2454r2455
77***************************************************************************/
88
99#include "debugger.h"
10#include "deprecat.h"
1110#include "tms32031.h"
1211#include "eminline.h"
1312
src/emu/cpu/m37710/m37710.c
r2454r2455
669669
670670static WRITE16_HANDLER( m37710_internal_word_w )
671671{
672   if (mem_mask == 0)
672   if (mem_mask == 0xffff)
673673   {
674674      m37710_internal_w((offset*2), data & 0xff);
675675      m37710_internal_w((offset*2)+1, data>>8);
676676   }
677   else if (mem_mask == 0xff)
677   else if (mem_mask == 0xff00)
678678   {
679679      m37710_internal_w((offset*2)+1, data>>8);
680680   }
681   else if (mem_mask == 0xff00)
681   else if (mem_mask == 0x00ff)
682682   {
683683      m37710_internal_w((offset*2), data & 0xff);
684684   }
src/emu/cpu/m37710/m37710cm.h
r2454r2455
1212#include <limits.h>
1313#include "cpuintrf.h"
1414#include "debugger.h"
15#include "deprecat.h"
1615#include "m37710.h"
1716
1817
src/emu/cpu/sharc/sharc.c
r2454r2455
44*/
55
66#include "sharc.h"
7#include "deprecat.h"
87#include "debugger.h"
98
109#ifdef ENABLE_DEBUGGER
src/emu/cpu/z180/z180.c
r2454r2455
7777 *****************************************************************************/
7878
7979#include "debugger.h"
80#include "deprecat.h"
8180#include "z180.h"
8281#include "cpu/z80/z80daisy.h"
8382
src/emu/cpu/i86/i86.c
r2454r2455
66
77#include "debugger.h"
88#include "cpuintrf.h"
9#include "deprecat.h"
109
1110#include "host.h"
1211#include "i86.h"
src/emu/cpu/i86/i286.c
r2454r2455
44****************************************************************************/
55
66#include "debugger.h"
7#include "deprecat.h"
87#include "host.h"
98
109
src/emu/cpu/upd7810/upd7810.c
r2454r2455
407407
408408#include "debugger.h"
409409#include "upd7810.h"
410#include "deprecat.h"
411410
412411static UPD7810 upd7810;
413412static int upd7810_icount;
src/emu/cpu/sc61860/sc61860.c
r2454r2455
2828 *****************************************************************************/
2929
3030#include "debugger.h"
31#include "deprecat.h"
3231
3332#include "sc61860.h"
3433#include "sc.h"
src/emu/cpu/minx/minx.c
r2454r2455
4747
4848#include "minx.h"
4949#include "debugger.h"
50#include "deprecat.h"
5150
5251#define FLAG_I  0x80
5352#define FLAG_D  0x40
src/emu/cpu/v60/v60.c
r2454r2455
44// Portability fixes by Richter Belmont
55
66#include "debugger.h"
7#include "deprecat.h"
87#include "v60.h"
98
109// memory accessors
src/emu/cpu/spc700/spc700.c
r2454r2455
6262
6363#include <limits.h>
6464#include "debugger.h"
65#include "deprecat.h"
6665#include "spc700.h"
6766
6867/* ======================================================================== */
src/emu/cpu/dsp56k/dsp56k.c
r2454r2455
1919***************************************************************************/
2020
2121#include "debugger.h"
22#include "deprecat.h"
2322#include "dsp56k.h"
2423
2524// #define PC_E000
src/emu/cpu/i8039/i8039.c
r2454r2455
3535
3636
3737#include "debugger.h"
38#include "deprecat.h"
3938#include "i8039.h"
4039
4140
src/emu/cpu/ssp1601/ssp1601.c
r2454r2455
1818 */
1919
2020#include "debugger.h"
21#include "deprecat.h"
2221#include "ssp1601.h"
2322
2423
src/emu/cpu/tlcs90/tlcs90.c
r2454r2455
77*************************************************************************************************************/
88
99#include "debugger.h"
10#include "deprecat.h"
1110#include "tlcs90.h"
1211
1312typedef struct
src/emu/cpu/s2650/s2650.c
r2454r2455
1313 *************************************************************************/
1414
1515#include "debugger.h"
16#include "deprecat.h"
1716#include "s2650.h"
1817#include "s2650cpu.h"
1918
src/emu/cpu/se3208/se3208.c
r2454r2455
11#include "debugger.h"
2#include "deprecat.h"
32#include "se3208.h"
43
54/*
src/emu/cpu/e132xs/e132xs.c
r2454r2455
212212*********************************************************************/
213213
214214#include "debugger.h"
215#include "deprecat.h"
216215#include "eminline.h"
217216#include "e132xs.h"
218217#include "osd_cpu.h"
src/emu/cpu/mc68hc11/mc68hc11.c
r2454r2455
55 */
66
77#include "debugger.h"
8#include "deprecat.h"
98#include "mc68hc11.h"
109
1110enum {
src/emu/cpu/adsp2100/adsp2100.c
r2454r2455
9696***************************************************************************/
9797
9898#include "debugger.h"
99#include "deprecat.h"
10099#include "adsp2100.h"
101100
102101
src/emu/cpu/dsp32/dsp32.c
r2454r2455
2828***************************************************************************/
2929
3030#include "debugger.h"
31#include "deprecat.h"
3231#include "dsp32.h"
3332
3433
src/emu/cpu/cop400/cop410.c
r2454r2455
2020
2121#include "cpuintrf.h"
2222#include "debugger.h"
23#include "deprecat.h"
2423#include "cop400.h"
2524
2625/* The opcode table now is a combination of cycle counts and function pointers */
src/emu/cpu/cop400/cop420.c
r2454r2455
2020
2121#include "cpuintrf.h"
2222#include "debugger.h"
23#include "deprecat.h"
2423#include "cop400.h"
2524
2625/* The opcode table now is a combination of cycle counts and function pointers */
src/emu/cpu/m6502/6502dasm.c
r2454r2455
2424/* 4. February 2000 PeT ply inw dew */
2525/* 4. February 2000 PeT fixed relative word operand */
2626/* 9. May 2000 PeT added m4510 */
27/* 18.April 2008 Roberto Fresca fixed bbr, bbs, rmb & smb displayment,
28   showing the correct bit to operate */
2729
2830#include "debugger.h"
2931#include "m6502.h"
r2454r2455
589591
590592   dst += sprintf(dst, "%-5s", token[opc]);
591593   if( opc == bbr || opc == bbs || opc == rmb || opc == smb )
592      dst += sprintf(dst, "%d,", (op >> 3) & 7);
594      dst += sprintf(dst, "%d,", (op >> 4) & 7);
593595
594596   switch(arg)
595597   {
src/emu/cpu/m6502/m4510.c
r2454r2455
101101 */
102102
103103#include "debugger.h"
104#include "deprecat.h"
105104#include "m6502.h"
106105#include "m4510.h"
107106
src/emu/cpu/m6502/m6502.c
r2454r2455
3030#endif
3131
3232#include "debugger.h"
33#include "deprecat.h"
3433#include "m6502.h"
3534#include "ops02.h"
3635#include "ill02.h"
src/emu/cpu/m6502/m6509.c
r2454r2455
3838*/
3939
4040#include "debugger.h"
41#include "deprecat.h"
4241#include "m6509.h"
4342
4443#include "ops02.h"
src/emu/cpu/m6502/m65ce02.c
r2454r2455
3838*/
3939
4040#include "debugger.h"
41#include "deprecat.h"
4241#include "m65ce02.h"
4342
4443#include "mincce02.h"
src/emu/cpu/i8085/i8085.c
r2454r2455
121121/*int survival_prot = 0; */
122122
123123#include "debugger.h"
124#include "deprecat.h"
125124#include "i8085.h"
126125#include "i8085cpu.h"
127126#include "i8085daa.h"
src/emu/cpu/powerpc/ppc.c
r2454r2455
33#include <setjmp.h>
44#include "ppc.h"
55#include "debugger.h"
6#include "deprecat.h"
76
87#if (HAS_PPC603 || HAS_PPC601 || HAS_PPC604)
98static void ppc603_exception(int exception);
src/emu/cpu/powerpc/ppcdrc.c
r2454r2455
55*/
66
77#include "debugger.h"
8#include "deprecat.h"
98#include "ppc.h"
109#include "cpu/x86drc.h"
1110
src/emu/cpu/arm/arm.c
r2454r2455
1616*/
1717
1818#include "arm.h"
19#include "deprecat.h"
2019#include "debugger.h"
2120
2221#define READ8(addr)         cpu_read8(addr)
src/emu/cpu/z8000/z8000.c
r2454r2455
4444 *****************************************************************************/
4545
4646#include "debugger.h"
47#include "deprecat.h"
4847#include "z8000.h"
4948#include "z8000cpu.h"
5049#include "osd_cpu.h"
src/emu/cpu/tms32010/tms32010.c
r2454r2455
5454
5555
5656#include "debugger.h"
57#include "deprecat.h"
5857#include "tms32010.h"
5958
6059
src/emu/cpu/sm8500/sm8500.c
r2454r2455
1010*/
1111
1212#include "debugger.h"
13#include "deprecat.h"
1413#include "sm8500.h"
1514
1615#define FLAG_C   0x80
src/emu/cpu/sh2/sh2.c
r2454r2455
189189INLINE UINT8 RB(offs_t A)
190190{
191191   if (A >= 0xe0000000)
192      return sh2_internal_r(Machine, (A & 0x1fc)>>2, ~(0xff << (((~A) & 3)*8))) >> (((~A) & 3)*8);
192      return sh2_internal_r(Machine, (A & 0x1fc)>>2, 0xff << (((~A) & 3)*8)) >> (((~A) & 3)*8);
193193
194194   if (A >= 0xc0000000)
195195      return program_read_byte_32be(A);
r2454r2455
203203INLINE UINT16 RW(offs_t A)
204204{
205205   if (A >= 0xe0000000)
206      return sh2_internal_r(Machine, (A & 0x1fc)>>2, ~(0xffff << (((~A) & 2)*8))) >> (((~A) & 2)*8);
206      return sh2_internal_r(Machine, (A & 0x1fc)>>2, 0xffff << (((~A) & 2)*8)) >> (((~A) & 2)*8);
207207
208208   if (A >= 0xc0000000)
209209      return program_read_word_32be(A);
r2454r2455
217217INLINE UINT32 RL(offs_t A)
218218{
219219   if (A >= 0xe0000000)
220      return sh2_internal_r(Machine, (A & 0x1fc)>>2, 0);
220      return sh2_internal_r(Machine, (A & 0x1fc)>>2, 0xffffffff);
221221
222222   if (A >= 0xc0000000)
223223      return program_read_dword_32be(A);
r2454r2455
233233
234234   if (A >= 0xe0000000)
235235   {
236      sh2_internal_w(Machine, (A & 0x1fc)>>2, V << (((~A) & 3)*8), ~(0xff << (((~A) & 3)*8)));
236      sh2_internal_w(Machine, (A & 0x1fc)>>2, V << (((~A) & 3)*8), 0xff << (((~A) & 3)*8));
237237      return;
238238   }
239239
r2454r2455
253253{
254254   if (A >= 0xe0000000)
255255   {
256      sh2_internal_w(Machine, (A & 0x1fc)>>2, V << (((~A) & 2)*8), ~(0xffff << (((~A) & 2)*8)));
256      sh2_internal_w(Machine, (A & 0x1fc)>>2, V << (((~A) & 2)*8), 0xffff << (((~A) & 2)*8));
257257      return;
258258   }
259259
r2454r2455
273273{
274274   if (A >= 0xe0000000)
275275   {
276      sh2_internal_w(Machine, (A & 0x1fc)>>2, V, 0);
276      sh2_internal_w(Machine, (A & 0x1fc)>>2, V, 0xffffffff);
277277      return;
278278   }
279279
r2454r2455
26512651   {
26522652      // Timers
26532653   case 0x04: // TIER, FTCSR, FRC
2654      if((mem_mask & 0x00ffffff) != 0xffffff)
2654      if((mem_mask & 0x00ffffff) != 0)
26552655         sh2_timer_resync();
26562656      logerror("SH2.%d: TIER write %04x @ %04x\n", sh2.cpu_number, data >> 16, mem_mask>>16);
26572657      sh2.m[4] = (sh2.m[4] & ~(ICF|OCFA|OCFB|OVF)) | (old & sh2.m[4] & (ICF|OCFA|OCFB|OVF));
26582658      COMBINE_DATA(&sh2.frc);
2659      if((mem_mask & 0x00ffffff) != 0xffffff)
2659      if((mem_mask & 0x00ffffff) != 0)
26602660         sh2_timer_activate();
26612661      sh2_recalc_irq();
26622662      break;
r2454r2455
26642664      logerror("SH2.%d: TCR write %08x @ %08x\n", sh2.cpu_number, data, mem_mask);
26652665      sh2_timer_resync();
26662666      if(sh2.m[5] & 0x10)
2667         sh2.ocrb = (sh2.ocrb & (mem_mask >> 16)) | ((data & ~mem_mask) >> 16);
2667         sh2.ocrb = (sh2.ocrb & (~mem_mask >> 16)) | ((data & mem_mask) >> 16);
26682668      else
2669         sh2.ocra = (sh2.ocra & (mem_mask >> 16)) | ((data & ~mem_mask) >> 16);
2669         sh2.ocra = (sh2.ocra & (~mem_mask >> 16)) | ((data & mem_mask) >> 16);
26702670      sh2_timer_activate();
26712671      break;
26722672
r2454r2455
28132813   switch( offset )
28142814   {
28152815   case 0x04: // TIER, FTCSR, FRC
2816      if ( mem_mask == 0xff00ffff )
2816      if ( mem_mask == 0x00ff0000 )
28172817         if ( sh2.ftcsr_read_callback != NULL )
28182818            sh2.ftcsr_read_callback( (sh2.m[4] & 0xffff0000) | sh2.frc );
28192819      sh2_timer_resync();
src/emu/cpu/tms32051/tms32051.c
r2454r2455
55*/
66
77#include "debugger.h"
8#include "deprecat.h"
98#include "cpuintrf.h"
109#include "tms32051.h"
1110
src/emu/cpu/sh4/sh4.c
r2454r2455
239239INLINE UINT8 RB(offs_t A)
240240{
241241   if (A >= 0xfe000000)
242      return sh4_internal_r(Machine, ((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), ~(0xff << ((A & 3)*8))) >> ((A & 3)*8);
242      return sh4_internal_r(Machine, ((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), 0xff << ((A & 3)*8)) >> ((A & 3)*8);
243243
244244   if (A >= 0xe0000000)
245245      return program_read_byte_64le(A);
r2454r2455
253253INLINE UINT16 RW(offs_t A)
254254{
255255   if (A >= 0xfe000000)
256      return sh4_internal_r(Machine, ((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), ~(0xffff << ((A & 2)*8))) >> ((A & 2)*8);
256      return sh4_internal_r(Machine, ((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), 0xffff << ((A & 2)*8)) >> ((A & 2)*8);
257257
258258   if (A >= 0xe0000000)
259259      return program_read_word_64le(A);
r2454r2455
267267INLINE UINT32 RL(offs_t A)
268268{
269269   if (A >= 0xfe000000)
270      return sh4_internal_r(Machine, ((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), 0);
270      return sh4_internal_r(Machine, ((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), 0xffffffff);
271271
272272   if (A >= 0xe0000000)
273273      return program_read_dword_64le(A);
r2454r2455
283283
284284   if (A >= 0xfe000000)
285285   {
286      sh4_internal_w(Machine, ((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), V << ((A & 3)*8), ~(0xff << ((A & 3)*8)));
286      sh4_internal_w(Machine, ((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), V << ((A & 3)*8), 0xff << ((A & 3)*8));
287287      return;
288288   }
289289
r2454r2455
303303{
304304   if (A >= 0xfe000000)
305305   {
306      sh4_internal_w(Machine, ((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), V << ((A & 2)*8), ~(0xffff << ((A & 2)*8)));
306      sh4_internal_w(Machine, ((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), V << ((A & 2)*8), 0xffff << ((A & 2)*8));
307307      return;
308308   }
309309
r2454r2455
323323{
324324   if (A >= 0xfe000000)
325325   {
326      sh4_internal_w(Machine, ((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), V, 0);
326      sh4_internal_w(Machine, ((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), V, 0xffffffff);
327327      return;
328328   }
329329
src/emu/cpu/mb88xx/mb88xx.c
r2454r2455
1414***************************************************************************/
1515
1616#include "debugger.h"
17#include "deprecat.h"
1817#include "mb88xx.h"
1918
2019/***************************************************************************
src/emu/cpu/alph8201/8201dasm.c
r2454r2455
201201      pdown = 0;
202202      type = 0;
203203      bit = 7;
204      while ( (chr=*p) && bit >= 0) {
205         p++;
204      while (*p && bit >= 0) {
205         chr = *p++;
206206         switch (chr) {
207207            case '1': bits |= 1<<bit;
208208            case '0': mask |= 1<<bit; bit--; break;
209/*
210                case 'b':
211                    type |= 0x80;
212*/
209#if 0
210            case 'b':
211               type |= 0x80;
212#endif
213213            case 'a':
214214               pmask |= 1<<bit;
215215               pdown  = bit;
src/emu/cpu/alph8201/alph8201.c
r2454r2455
144144****************************************************************************/
145145
146146#include "debugger.h"
147#include "deprecat.h"
148147#include "alph8201.h"
149148
150149/* instruction cycle count */
src/emu/cpu/apexc/apexc.c
r2454r2455
325325
326326#include "cpuintrf.h"
327327#include "debugger.h"
328#include "deprecat.h"
329328#include "apexc.h"
330329
331330typedef struct
src/emu/cpu/g65816/g65816cm.h
r2454r2455
1010/* ======================================================================== */
1111
1212#include "g65816.h"
13#include "deprecat.h"
1413#include <limits.h>
1514
1615
src/emu/cpu/nec/nec.c
r2454r2455
104104****************************************************************************/
105105
106106#include "debugger.h"
107#include "deprecat.h"
108107
109108typedef UINT8 BOOLEAN;
110109typedef UINT8 BYTE;
src/emu/cpu/i8051/i8051.c
r2454r2455
17851785/* Different chip types handle differently, for speed, simply call the chip's handler */
17861786static READ8_HANDLER(internal_ram_iread)
17871787{
1788   return i8051.iram_iread(Machine,offset);
1788   return i8051.iram_iread(machine,offset);
17891789}
17901790
17911791/* Writes the contents of the Internal RAM memory (BUT CALLED FROM AN INDIRECT ADDRESSING MODE)   */
17921792/* Different chip types handle differently, for speed, simply call the chip's handler */
17931793static WRITE8_HANDLER(internal_ram_iwrite)
17941794{
1795   i8051.iram_iwrite(Machine,offset,data);
1795   i8051.iram_iwrite(machine,offset,data);
17961796}
17971797
17981798/*Generate an external ram address for read/writing using indirect addressing mode */
r2454r2455
18041804static READ32_HANDLER(external_ram_iaddr)
18051805{
18061806    if(i8051.eram_iaddr_callback)
1807        return i8051.eram_iaddr_callback(Machine,offset,mem_mask);
1807        return i8051.eram_iaddr_callback(machine,offset,mem_mask);
18081808    else
18091809        LOG(("i8051 #%d: external ram address requested (8 bit offset=%02x), but no callback available! at PC:%04x\n", cpu_getactivecpu(), offset, PC));
18101810
src/emu/cpu/mips/mdrc64.c
r2454r2455
15381538      else
15391539      {
15401540         emit_mov_r32_r32(DRCTOP, REG_P4, REG_P3);                              // mov   p4,p3
1541         emit_not_r32(DRCTOP, REG_P3);                                       // not   p3
1542         emit_and_r32_r32(DRCTOP, REG_P4, REG_P2);                              // and   p4,p2
15411543         if (raxrel)
15421544            emit_and_r32_m32(DRCTOP, REG_P3, MBISD(REG_RAX, REG_P1, 1, 0));            // and   p3,[p1 + rax]
15431545         else
15441546            emit_and_r32_m32(DRCTOP, REG_P3, MDRCISD(adjbase, REG_P1, 1, 0));         // and   p3,[p1 + adjbase]
1545         emit_not_r32(DRCTOP, REG_P4);                                       // not   p4
1546         emit_and_r32_r32(DRCTOP, REG_P4, REG_P2);                              // and   p4,p2
15471547         emit_or_r32_r32(DRCTOP, REG_P4, REG_P3);                              // or    p4,p3
15481548         if (raxrel)
15491549            emit_mov_m32_r32(DRCTOP, MBISD(REG_RAX, REG_P1, 1, 0), REG_P4);            // mov   [p1 + rax],p4
r2454r2455
15741574         if (mips3.core->bigendian)
15751575            emit_ror_r64_imm(DRCTOP, REG_P3, 32);                              // ror   p3,32
15761576         emit_mov_r64_r64(DRCTOP, REG_P4, REG_P3);                              // mov   p4,p3
1577         emit_not_r64(DRCTOP, REG_P3);                                       // not   p3
1578         emit_and_r64_r64(DRCTOP, REG_P4, REG_P2);                              // and   p4,p2
15771579         if (raxrel)
15781580            emit_and_r64_m64(DRCTOP, REG_P3, MBISD(REG_RAX, REG_P1, 1, 0));            // and   p3,[p1 + rax]
15791581         else
15801582            emit_and_r64_m64(DRCTOP, REG_P3, MDRCISD(adjbase, REG_P1, 1, 0));         // and   p3,[p1 + adjbase]
1581         emit_not_r64(DRCTOP, REG_P4);                                       // not   p4
1582         emit_and_r64_r64(DRCTOP, REG_P4, REG_P2);                              // and   p4,p2
15831583         emit_or_r64_r64(DRCTOP, REG_P4, REG_P3);                              // or    p4,p3
15841584         if (raxrel)
15851585            emit_mov_m64_r64(DRCTOP, MBISD(REG_RAX, REG_P1, 1, 0), REG_P4);            // mov   [p1 + rax],p4
r2454r2455
21302130   if (fastram == NULL)
21312131   {
21322132      emit_mov_r32_imm(DRCTOP, REG_P1, address & ~3);                              // mov  p1,address & ~3
2133      if (mask != 0)
2133      if (mask != 0xffffffff)
21342134      {
21352135         emit_mov_r32_imm(DRCTOP, REG_P2, (INT32)mask);                           // mov  p2,mask
21362136         emit_call(DRCTOP, mips3.drcdata->general.read_word_masked);                  // call read_word_masked
r2454r2455
21872187   if (fastram == NULL)
21882188   {
21892189      emit_mov_r32_imm(DRCTOP, REG_P1, address & ~7);                              // mov  p1,address & ~7
2190      if (mask != 0)
2190      if (mask != U64(0xffffffffffffffff))
21912191      {
21922192         emit_mov_r64_imm(DRCTOP, REG_P2, mask);                                 // mov  p2,mask
21932193         emit_call(DRCTOP, mips3.drcdata->general.read_double_masked);               // call read_double_masked
r2454r2455
23512351         emit_mov_r64_imm(DRCTOP, REG_P2, CONSTVAL(srcreg));                        // mov  p2,constval
23522352      else if (X86REG(srcreg) != REG_P2)
23532353         emit_mov_r64_r64(DRCTOP, REG_P2, X86REG(srcreg));                        // mov  p2,srcreg
2354      if (mask == 0)
2354      if (mask == 0xffffffff)
23552355         emit_call(DRCTOP, mips3.drcdata->general.write_word);                     // call write_word
23562356      else
23572357      {
r2454r2455
23702370      int raxrel = ((INT32)fastdisp != fastdisp);
23712371
23722372      /* non-masked case */
2373      if (mask == 0)
2373      if (mask == 0xffffffff)
23742374      {
23752375         /* if we can't fit the delta to fastram within an INT32, load RAX with the full address here */
23762376         if (raxrel)
r2454r2455
24042404         if (ISCONST(srcreg))
24052405         {
24062406            emit_mov_r32_m32(DRCTOP, REG_P2, MBD(REG_RAX, 0));                     // mov  p2,[rax]
2407            emit_and_r32_imm(DRCTOP, REG_P2, mask);                              // and  p2,mask
2408            emit_or_r32_imm(DRCTOP, REG_P2, CONSTVAL(srcreg) & ~mask);               // or   p2,constval & ~mask
2407            emit_and_r32_imm(DRCTOP, REG_P2, ~mask);                           // and  p2,~mask
2408            emit_or_r32_imm(DRCTOP, REG_P2, CONSTVAL(srcreg) & mask);               // or   p2,constval & mask
24092409            emit_mov_m32_r32(DRCTOP, MBD(REG_RAX, 0), REG_P2);                     // mov  [rax],p2
24102410         }
24112411         else
r2454r2455
24132413            emit_mov_r32_m32(DRCTOP, REG_P3, MBD(REG_RAX, 0));                     // mov  p3,[rax]
24142414            if (X86REG(srcreg) != REG_P2)
24152415               emit_mov_r32_r32(DRCTOP, REG_P2, X86REG(srcreg));                  // mov  p2,srcreg
2416            emit_and_r32_imm(DRCTOP, REG_P3, mask);                              // and  p3,mask
2417            emit_and_r32_imm(DRCTOP, REG_P2, ~mask);                           // and  p2,~mask
2416            emit_and_r32_imm(DRCTOP, REG_P3, ~mask);                           // and  p3,~mask
2417            emit_and_r32_imm(DRCTOP, REG_P2, mask);                              // and  p2,mask
24182418            emit_or_r32_r32(DRCTOP, REG_P3, REG_P2);                           // or   p3,p2
24192419            emit_mov_m32_r32(DRCTOP, MBD(REG_RAX, 0), REG_P3);                     // mov  [rax],p3
24202420         }
r2454r2455
24442444         emit_mov_r64_imm(DRCTOP, REG_P2, CONSTVAL(srcreg));                        // mov  p2,constval
24452445      else if (X86REG(srcreg) != REG_P2)
24462446         emit_mov_r64_r64(DRCTOP, REG_P2, X86REG(srcreg));                        // mov  p2,srcreg
2447      if (mask == 0)
2447      if (mask == U64(0xffffffffffffffff))
24482448         emit_call(DRCTOP, mips3.drcdata->general.write_double);                     // call write_double
24492449      else
24502450      {
r2454r2455
24782478      }
24792479
24802480      /* non-masked case */
2481      if (mask == 0)
2481      if (mask == U64(0xffffffffffffffff))
24822482      {
24832483         /* if we can't fit the delta to fastram within an INT32, load RAX with the full address here */
24842484         if (raxrel)
r2454r2455
25072507            emit_mov_r64_imm(DRCTOP, REG_RAX, (UINT64)fastram);                     // mov  rax,fastram
25082508         else
25092509            emit_lea_r64_m64(DRCTOP, REG_RAX, MDRC(fastram));                     // lea  rax,[fastram]
2510         emit_mov_r64_imm(DRCTOP, REG_P4, mask);                                 // mov  p4,mask
2510         emit_mov_r64_imm(DRCTOP, REG_P4, ~mask);                              // mov  p4,~mask
25112511
25122512         /* always write rax-relative */
25132513         if (ISCONST(srcreg))
25142514         {
25152515            emit_and_r64_m64(DRCTOP, REG_P4, MBD(REG_RAX, 0));                     // and  p4,[rax]
2516            emit_mov_r64_imm(DRCTOP, REG_P3, constval & ~mask);                     // mov  p3,constval & ~mask
2516            emit_mov_r64_imm(DRCTOP, REG_P3, constval & mask);                     // mov  p3,constval & mask
25172517            emit_or_r64_r64(DRCTOP, REG_P4, REG_P3);                           // or   p4,p3
25182518            emit_mov_m64_r64(DRCTOP, MBD(REG_RAX, 0), REG_P4);                     // mov  [rax],p4
25192519         }
r2454r2455
50135013      else if (size == 2)
50145014         was_fixed = emit_fixed_half_read(drc, compiler, desc, destreg, is_unsigned, CONSTVAL(rs) + SIMMVAL);
50155015      else if (size == 4)
5016         was_fixed = emit_fixed_word_read(drc, compiler, desc, destreg, is_unsigned, CONSTVAL(rs) + SIMMVAL, 0);
5016         was_fixed = emit_fixed_word_read(drc, compiler, desc, destreg, is_unsigned, CONSTVAL(rs) + SIMMVAL, 0xffffffff);
50175017      else
5018         was_fixed = emit_fixed_double_read(drc, compiler, desc, destreg, CONSTVAL(rs) + SIMMVAL, 0);
5018         was_fixed = emit_fixed_double_read(drc, compiler, desc, destreg, CONSTVAL(rs) + SIMMVAL, U64(0xffffffffffffffff));
50195019   }
50205020
50215021   /* otherwise, we just need to call the appropriate subroutine */
r2454r2455
50785078   {
50795079      /* perform a fixed read if we can */
50805080      if (size == 4)
5081         was_fixed = emit_fixed_word_read(drc, compiler, desc, REG_RAX, FALSE, CONSTVAL(rs) + SIMMVAL, 0);
5081         was_fixed = emit_fixed_word_read(drc, compiler, desc, REG_RAX, FALSE, CONSTVAL(rs) + SIMMVAL, 0xffffffff);
50825082      else
5083         was_fixed = emit_fixed_double_read(drc, compiler, desc, REG_RAX, CONSTVAL(rs) + SIMMVAL, 0);
5083         was_fixed = emit_fixed_double_read(drc, compiler, desc, REG_RAX, CONSTVAL(rs) + SIMMVAL, U64(0xffffffffffffffff));
50845084   }
50855085
50865086   /* otherwise, we just need to call the appropriate subroutine */
r2454r2455
51335133   {
51345134      /* perform a fixed read if we can */
51355135      if (size == 4)
5136         was_fixed = emit_fixed_word_read(drc, compiler, desc, REG_RAX, FALSE, CONSTVAL(rs) + CONSTVAL(rt), 0);
5136         was_fixed = emit_fixed_word_read(drc, compiler, desc, REG_RAX, FALSE, CONSTVAL(rs) + CONSTVAL(rt), 0xffffffff);
51375137      else
5138         was_fixed = emit_fixed_double_read(drc, compiler, desc, REG_RAX, CONSTVAL(rs) + CONSTVAL(rt), 0);
5138         was_fixed = emit_fixed_double_read(drc, compiler, desc, REG_RAX, CONSTVAL(rs) + CONSTVAL(rt), U64(0xffffffffffffffff));
51395139   }
51405140
51415141   /* otherwise, we just need to call the appropriate subroutine */
r2454r2455
51985198         shift ^= 0x18;
51995199
52005200      /* read the double value into rax, handling exceptions */
5201      was_fixed = emit_fixed_word_read(drc, compiler, desc, REG_RAX, FALSE, addr, is_right ? (~((UINT32)-1 << shift)) : (~((UINT32)-1 >> shift)));
5201      was_fixed = emit_fixed_word_read(drc, compiler, desc, REG_RAX, FALSE, addr, is_right ? ((UINT32)-1 << shift) : ((UINT32)-1 >> shift));
52025202
52035203      /* handle writing back the register */
52045204      if (RTREG != 0)
r2454r2455
52365236      else
52375237         emit_shl_r32_cl(DRCTOP, REG_P2);                                    // shl  p2,cl
52385238      emit_mov_m8_r8(DRCTOP, MBD(REG_RSP, SPOFFS_SAVECL), REG_CL);                  // mov  [sp+savecl],cl
5239      emit_not_r32(DRCTOP, REG_P2);                                          // not  p2
52405239      emit_mov_r32_r32(DRCTOP, REG_P1, REG_EAX);                                 // mov  p1,eax
52415240      emit_call(DRCTOP, mips3.drcdata->general.read_word_masked);                     // call general.read_word_masked
52425241      oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
r2454r2455
53005299         shift ^= 0x38;
53015300
53025301      /* read the double value into rax, handling exceptions */
5303      was_fixed = emit_fixed_double_read(drc, compiler, desc, REG_RAX, addr, is_right ? (~((UINT64)-1 << shift)) : (~((UINT64)-1 >> shift)));
5302      was_fixed = emit_fixed_double_read(drc, compiler, desc, REG_RAX, addr, is_right ? ((UINT64)-1 << shift) : ((UINT64)-1 >> shift));
53045303
53055304      /* handle writing back the register */
53065305      if (RTREG != 0)
r2454r2455
53435342      else
53445343         emit_shl_r64_cl(DRCTOP, REG_P2);                                    // shl  p2,cl
53455344      emit_mov_m8_r8(DRCTOP, MBD(REG_RSP, SPOFFS_SAVECL), REG_CL);                  // mov  [sp+savecl],cl
5346      emit_not_r64(DRCTOP, REG_P2);                                          // not  p2
53475345      emit_mov_r32_r32(DRCTOP, REG_P1, REG_EAX);                                 // mov  p1,eax
53485346      emit_call(DRCTOP, mips3.drcdata->general.read_double_masked);                  // call general.read_double_masked
53495347      oob_request_callback(drc, COND_NO_JUMP, oob_exception_cleanup, compiler, desc, mips3.drcdata->generate_tlbload_exception);
r2454r2455
54065404      else if (size == 2)
54075405         was_fixed = emit_fixed_half_write(drc, compiler, desc, rt, CONSTVAL(rs) + SIMMVAL);
54085406      else if (size == 4)
5409         was_fixed = emit_fixed_word_write(drc, compiler, desc, rt, CONSTVAL(rs) + SIMMVAL, 0);
5407         was_fixed = emit_fixed_word_write(drc, compiler, desc, rt, CONSTVAL(rs) + SIMMVAL, 0xffffffff);
54105408      else
5411         was_fixed = emit_fixed_double_write(drc, compiler, desc, rt, CONSTVAL(rs) + SIMMVAL, 0);
5409         was_fixed = emit_fixed_double_write(drc, compiler, desc, rt, CONSTVAL(rs) + SIMMVAL, U64(0xffffffffffffffff));
54125410   }
54135411
54145412   /* otherwise, we just need to call the appropriate subroutine */
r2454r2455
54675465   {
54685466      /* perform a fixed write if we can */
54695467      if (size == 4)
5470         was_fixed = emit_fixed_word_write(drc, compiler, desc, REG_P2, CONSTVAL(rs) + SIMMVAL, 0);
5468         was_fixed = emit_fixed_word_write(drc, compiler, desc, REG_P2, CONSTVAL(rs) + SIMMVAL, 0xffffffff);
54715469      else
5472         was_fixed = emit_fixed_double_write(drc, compiler, desc, REG_P2, CONSTVAL(rs) + SIMMVAL, 0);
5470         was_fixed = emit_fixed_double_write(drc, compiler, desc, REG_P2, CONSTVAL(rs) + SIMMVAL, U64(0xffffffffffffffff));
54735471   }
54745472
54755473   /* otherwise, we just need to call the appropriate subroutine */
r2454r2455
55225520   {
55235521      /* perform a fixed write if we can */
55245522      if (size == 4)
5525         was_fixed = emit_fixed_word_write(drc, compiler, desc, REG_P2, CONSTVAL(rs) + CONSTVAL(rt), 0);
5523         was_fixed = emit_fixed_word_write(drc, compiler, desc, REG_P2, CONSTVAL(rs) + CONSTVAL(rt), 0xffffffff);
55265524      else
5527         was_fixed = emit_fixed_double_write(drc, compiler, desc, REG_P2, CONSTVAL(rs) + CONSTVAL(rt), 0);
5525         was_fixed = emit_fixed_double_write(drc, compiler, desc, REG_P2, CONSTVAL(rs) + CONSTVAL(rt), U64(0xffffffffffffffff));
55285526   }
55295527
55305528   /* otherwise, we just need to call the appropriate subroutine */
r2454r2455
55945592      {
55955593         if (ISCONST(rt))
55965594            rt = MAKE_CONST((UINT32)CONSTVAL(rt) >> shift);
5597         mask = ~((UINT64)-1 >> shift);
5595         mask = (UINT32)-1 >> shift;
55985596      }
55995597      else
56005598      {
56015599         if (ISCONST(rt))
56025600            rt = MAKE_CONST((UINT32)CONSTVAL(rt) << shift);
5603         mask = ~((UINT64)-1 << shift);
5601         mask = (UINT32)-1 << shift;
56045602      }
56055603
56065604      /* perform a fixed write */
r2454r2455
56295627         emit_shl_r32_cl(DRCTOP, REG_P2);                                    // shl  p2,cl
56305628      }
56315629      emit_mov_r32_r32(DRCTOP, REG_P1, REG_EAX);                                 // mov  p1,eax
5632      emit_not_r32(DRCTOP, REG_P3);                                          // not  p3
56335630
56345631      /* perform the write */
56355632      emit_call(DRCTOP, mips3.drcdata->general.write_word_masked);                  // call general.write_word_masked
r2454r2455
56855682      {
56865683         if (ISCONST(rt))
56875684            rt = MAKE_CONST((UINT64)CONSTVAL(rt) >> shift);
5688         mask = ~((UINT64)-1 >> shift);
5685         mask = (UINT64)-1 >> shift;
56895686      }
56905687      else
56915688      {
56925689         if (ISCONST(rt))
56935690            rt = MAKE_CONST((UINT64)CONSTVAL(rt) << shift);
5694         mask = ~((UINT64)-1 << shift);
5691         mask = (UINT64)-1 << shift;
56955692      }
56965693
56975694      /* perform a fixed write */
r2454r2455
57205717         emit_shl_r64_cl(DRCTOP, REG_P2);                              // shl  p2,cl
57215718      }
57225719      emit_mov_r32_r32(DRCTOP, REG_P1, REG_EAX);                           // mov  p1,eax
5723      emit_not_r64(DRCTOP, REG_P3);                                    // not  p3
57245720
57255721      /* perform the write */
57265722      emit_call(DRCTOP, mips3.drcdata->general.write_double_masked);            // call general.write_double_masked
src/emu/cpu/mips/r3000.c
r2454r2455
77***************************************************************************/
88
99#include "debugger.h"
10#include "deprecat.h"
1110#include "r3000.h"
1211
1312
src/emu/cpu/mips/psx.c
r2454r2455
24052405               switch( load_type )
24062406               {
24072407               case 0:
2408                  data = ( data & 0x00ffffff ) | ( mipscpu.readword_masked( address, 0xff000000 ) << 24 );
2408                  data = ( data & 0x00ffffff ) | ( mipscpu.readword_masked( address, 0x000000ff ) << 24 );
24092409                  break;
24102410
24112411               case 1:
2412                  data = ( data & 0x0000ffff ) | ( mipscpu.readword_masked( address, 0xffff0000 ) << 16 );
2412                  data = ( data & 0x0000ffff ) | ( mipscpu.readword_masked( address, 0x0000ffff ) << 16 );
24132413                  break;
24142414
24152415               case 2:
2416                  data = ( data & 0x000000ff ) | ( mipscpu.readword_masked( address, 0xffffff00 ) << 8 );
2416                  data = ( data & 0x000000ff ) | ( mipscpu.readword_masked( address, 0x00ffffff ) << 8 );
24172417                  break;
24182418
24192419               case 3:
r2454r2455
25482548                  break;
25492549
25502550               case 2:
2551                  data = ( data & 0xffff0000 ) | ( mipscpu.readword_masked( address, 0x0000ffff ) >> 16 );
2551                  data = ( data & 0xffff0000 ) | ( mipscpu.readword_masked( address, 0xffff0000 ) >> 16 );
25522552                  break;
25532553
25542554               case 3:
2555                  data = ( data & 0xffffff00 ) | ( mipscpu.readword_masked( address, 0x000000ff ) >> 24 );
2555                  data = ( data & 0xffffff00 ) | ( mipscpu.readword_masked( address, 0xff000000 ) >> 24 );
25562556                  break;
25572557               }
25582558
r2454r2455
25802580            else
25812581            {
25822582               int shift = 8 * ( address & 3 );
2583               mipscpu.writeword_masked( address, mipscpu.r[ INS_RT( mipscpu.op ) ] << shift, ~( 0xff << shift ) );
2583               mipscpu.writeword_masked( address, mipscpu.r[ INS_RT( mipscpu.op ) ] << shift, 0xff << shift );
25842584
25852585               if( breakpoint )
25862586               {
r2454r2455
26102610            else
26112611            {
26122612               int shift = 8 * ( address & 2 );
2613               mipscpu.writeword_masked( address, mipscpu.r[ INS_RT( mipscpu.op ) ] << shift, ~( 0xffff << shift ) );
2613               mipscpu.writeword_masked( address, mipscpu.r[ INS_RT( mipscpu.op ) ] << shift, 0xffff << shift );
26142614
26152615               if( breakpoint )
26162616               {
r2454r2455
26462646               switch( save_type )
26472647               {
26482648               case 0:
2649                  mipscpu.writeword_masked( address, mipscpu.r[ INS_RT( mipscpu.op ) ] >> 24, 0xffffff00 );
2649                  mipscpu.writeword_masked( address, mipscpu.r[ INS_RT( mipscpu.op ) ] >> 24, 0x000000ff );
26502650                  break;
26512651
26522652               case 1:
2653                  mipscpu.writeword_masked( address, mipscpu.r[ INS_RT( mipscpu.op ) ] >> 16, 0xffff0000 );
2653                  mipscpu.writeword_masked( address, mipscpu.r[ INS_RT( mipscpu.op ) ] >> 16, 0x0000ffff );
26542654                  break;
26552655
26562656               case 2:
2657                  mipscpu.writeword_masked( address, mipscpu.r[ INS_RT( mipscpu.op ) ] >> 8, 0xff000000 );
2657                  mipscpu.writeword_masked( address, mipscpu.r[ INS_RT( mipscpu.op ) ] >> 8, 0x00ffffff );
26582658                  break;
26592659
26602660               case 3:
r2454r2455
27252725                  break;
27262726
27272727               case 1:
2728                  mipscpu.writeword_masked( address, mipscpu.r[ INS_RT( mipscpu.op ) ] << 8, 0x000000ff );
2728                  mipscpu.writeword_masked( address, mipscpu.r[ INS_RT( mipscpu.op ) ] << 8, 0xffffff00 );
27292729                  break;
27302730
27312731               case 2:
2732                  mipscpu.writeword_masked( address, mipscpu.r[ INS_RT( mipscpu.op ) ] << 16, 0x0000ffff );
2732                  mipscpu.writeword_masked( address, mipscpu.r[ INS_RT( mipscpu.op ) ] << 16, 0xffff0000 );
27332733                  break;
27342734
27352735               case 3:
2736                  mipscpu.writeword_masked( address, mipscpu.r[ INS_RT( mipscpu.op ) ] << 24, 0x00ffffff );
2736                  mipscpu.writeword_masked( address, mipscpu.r[ INS_RT( mipscpu.op ) ] << 24, 0xff000000 );
27372737                  break;
27382738               }
27392739
src/emu/cpu/mips/mdrcold.c
r2454r2455
725725               {
726726                  emit_mov_r32_m32(DRCTOP, REG_ECX, MBD(REG_ESP, 12));            // mov   ecx,[esp+12]
727727                  emit_mov_r32_r32(DRCTOP, REG_EAX, REG_ECX);                     // mov   eax,ecx
728                  emit_and_r32_m32(DRCTOP, REG_ECX, MBD(REG_EBX, fastbase));         // and   ecx,[ebx+fastbase]
729                  emit_not_r32(DRCTOP, REG_EAX);                              // not   eax
728                  emit_not_r32(DRCTOP, REG_ECX);                              // not   ecx
730729                  emit_and_r32_m32(DRCTOP, REG_EAX, MBD(REG_ESP, 8));               // and   eax,[esp+8]
730                  emit_and_r32_m32(DRCTOP, REG_ECX, MBD(REG_EBX, fastbase));         // and   ecx,[ebx+fastbase]
731731                  emit_or_r32_r32(DRCTOP, REG_EAX, REG_ECX);                     // or    eax,ecx
732732                  emit_mov_m32_r32(DRCTOP, MBD(REG_EBX, fastbase), REG_EAX);         // mov   [ebx+fastbase],eax
733733               }
r2454r2455
757757                  {
758758                     emit_mov_r32_m32(DRCTOP, REG_ECX, MBD(REG_ESP, 16));         // mov   ecx,[esp+16]
759759                     emit_mov_r32_r32(DRCTOP, REG_EAX, REG_ECX);                  // mov   eax,ecx
760                     emit_and_r32_m32(DRCTOP, REG_ECX, MBD(REG_EBX, fastbase+4));   // and   ecx,[ebx+fastbase+4]
761                     emit_not_r32(DRCTOP, REG_EAX);                           // not   eax
760                     emit_not_r32(DRCTOP, REG_ECX);                           // not   ecx
762761                     emit_and_r32_m32(DRCTOP, REG_EAX, MBD(REG_ESP, 8));            // and   eax,[esp+8]
762                     emit_and_r32_m32(DRCTOP, REG_ECX, MBD(REG_EBX, fastbase+4));   // and   ecx,[ebx+fastbase+4]
763763                     emit_or_r32_r32(DRCTOP, REG_EAX, REG_ECX);                  // or    eax,ecx
764764                     emit_mov_m32_r32(DRCTOP, MBD(REG_EBX, fastbase+4), REG_EAX);   // mov   [ebx+fastbase+4],eax
765765                     emit_mov_r32_m32(DRCTOP, REG_ECX, MBD(REG_ESP, 20));         // mov   ecx,[esp+20]
766766                     emit_mov_r32_r32(DRCTOP, REG_EAX, REG_ECX);                  // mov   eax,ecx
767                     emit_and_r32_m32(DRCTOP, REG_ECX, MBD(REG_EBX, fastbase));      // and   ecx,[ebx+fastbase]
768                     emit_not_r32(DRCTOP, REG_EAX);                           // not   eax
767                     emit_not_r32(DRCTOP, REG_ECX);                           // not   ecx
769768                     emit_and_r32_m32(DRCTOP, REG_EAX, MBD(REG_ESP, 12));         // and   eax,[esp+12]
769                     emit_and_r32_m32(DRCTOP, REG_ECX, MBD(REG_EBX, fastbase));      // and   ecx,[ebx+fastbase]
770770                     emit_or_r32_r32(DRCTOP, REG_EAX, REG_ECX);                  // or    eax,ecx
771771                     emit_mov_m32_r32(DRCTOP, MBD(REG_EBX, fastbase), REG_EAX);      // mov   [ebx+fastbase],eax
772772                  }
r2454r2455
774774                  {
775775                     emit_mov_r32_m32(DRCTOP, REG_ECX, MBD(REG_ESP, 16));         // mov   ecx,[esp+16]
776776                     emit_mov_r32_r32(DRCTOP, REG_EAX, REG_ECX);                  // mov   eax,ecx
777                     emit_and_r32_m32(DRCTOP, REG_ECX, MBD(REG_EBX, fastbase));      // and   ecx,[ebx+fastbase]
778                     emit_not_r32(DRCTOP, REG_EAX);                           // not   eax
777                     emit_not_r32(DRCTOP, REG_ECX);                           // not   ecx
779778                     emit_and_r32_m32(DRCTOP, REG_EAX, MBD(REG_ESP, 8));            // and   eax,[esp+8]
779                     emit_and_r32_m32(DRCTOP, REG_ECX, MBD(REG_EBX, fastbase));      // and   ecx,[ebx+fastbase]
780780                     emit_or_r32_r32(DRCTOP, REG_EAX, REG_ECX);                  // or    eax,ecx
781781                     emit_mov_m32_r32(DRCTOP, MBD(REG_EBX, fastbase), REG_EAX);      // mov   [ebx+fastbase],eax
782782                     emit_mov_r32_m32(DRCTOP, REG_ECX, MBD(REG_ESP, 20));         // mov   ecx,[esp+20]
783783                     emit_mov_r32_r32(DRCTOP, REG_EAX, REG_ECX);                  // mov   eax,ecx
784                     emit_and_r32_m32(DRCTOP, REG_ECX, MBD(REG_EBX, fastbase+4));   // and   ecx,[ebx+fastbase+4]
785                     emit_not_r32(DRCTOP, REG_EAX);                           // not   eax
784                     emit_not_r32(DRCTOP, REG_ECX);                           // not   ecx
786785                     emit_and_r32_m32(DRCTOP, REG_EAX, MBD(REG_ESP, 12));         // and   eax,[esp+12]
786                     emit_and_r32_m32(DRCTOP, REG_ECX, MBD(REG_EBX, fastbase+4));   // and   ecx,[ebx+fastbase+4]
787787                     emit_or_r32_r32(DRCTOP, REG_EAX, REG_ECX);                  // or    eax,ecx
788788                     emit_mov_m32_r32(DRCTOP, MBD(REG_EBX, fastbase+4), REG_EAX);   // mov   [ebx+fastbase+4],eax
789789                  }
r2454r2455
14741474         emit_shr_r32_cl(DRCTOP, REG_EBP);                                    // shr  ebp,cl
14751475         emit_shrd_r32_r32_cl(DRCTOP, REG_EBX, REG_EBP);                           // shrd ebx,ebp,cl
14761476         emit_shr_r32_cl(DRCTOP, REG_EBP);                                    // shr  ebp,cl
1477         emit_not_r32(DRCTOP, REG_EBX);                                       // not  ebx
1478         emit_not_r32(DRCTOP, REG_EBP);                                       // not  ebp
14791477         emit_push_r32(DRCTOP, REG_ECX);                                       // push ecx
14801478         emit_push_r32(DRCTOP, REG_EBP);                                       // push ebp
14811479         emit_push_r32(DRCTOP, REG_EBX);                                       // push ebx
r2454r2455
15211519         emit_shl_r32_cl(DRCTOP, REG_EBX);                                    // shl  ebx,cl
15221520         emit_shld_r32_r32_cl(DRCTOP, REG_EBP, REG_EBX);                           // shld ebp,ebx,cl
15231521         emit_shl_r32_cl(DRCTOP, REG_EBX);                                    // shl  ebx,cl
1524         emit_not_r32(DRCTOP, REG_EBX);                                       // not  ebx
1525         emit_not_r32(DRCTOP, REG_EBP);                                       // not  ebp
15261522         emit_push_r32(DRCTOP, REG_ECX);                                       // push ecx
15271523         emit_push_r32(DRCTOP, REG_EBP);                                       // push ebp
15281524         emit_push_r32(DRCTOP, REG_EBX);                                       // push ebx
r2454r2455
16681664         if (!mips3.core->bigendian)
16691665            emit_xor_r32_imm(DRCTOP, REG_ECX, 0x18);                           // xor  ecx,0x18
16701666         emit_shr_r32_cl(DRCTOP, REG_EBX);                                    // shr  ebx,cl
1671         emit_not_r32(DRCTOP, REG_EBX);                                       // not  ebx
16721667         emit_push_r32(DRCTOP, REG_ECX);                                       // push ecx
16731668         emit_push_r32(DRCTOP, REG_EBX);                                       // push ebx
16741669         emit_push_r32(DRCTOP, REG_EAX);                                       // push eax
r2454r2455
17761771         if (mips3.core->bigendian)
17771772            emit_xor_r32_imm(DRCTOP, REG_ECX, 0x18);                           // xor  ecx,0x18
17781773         emit_shl_r32_cl(DRCTOP, REG_EBX);                                    // shl  ebx,cl
1779         emit_not_r32(DRCTOP, REG_EBX);                                       // not  ebx
17801774         emit_push_r32(DRCTOP, REG_ECX);                                       // push ecx
17811775         emit_push_r32(DRCTOP, REG_EBX);                                       // push ebx
17821776         emit_push_r32(DRCTOP, REG_EAX);                                       // push eax
r2454r2455
18821876         if (!mips3.core->bigendian)
18831877            emit_xor_r32_imm(DRCTOP, REG_ECX, 0x18);                           // xor  ecx,0x18
18841878         emit_shr_r32_cl(DRCTOP, REG_EBX);                                    // shr  ebx,cl
1885         emit_not_r32(DRCTOP, REG_EBX);                                       // not  ebx
18861879         emit_push_r32(DRCTOP, REG_EBX);                                       // push ebx
18871880         if (RTREG != 0)
18881881         {
r2454r2455
19371930         emit_shr_r32_cl(DRCTOP, REG_EBP);                                    // shr  ebp,cl
19381931         emit_shrd_r32_r32_cl(DRCTOP, REG_EBX, REG_EBP);                           // shrd ebx,ebp,cl
19391932         emit_shr_r32_cl(DRCTOP, REG_EBP);                                    // shr  ebp,cl
1940         emit_not_r32(DRCTOP, REG_EBP);                                       // not  ebp
1941         emit_not_r32(DRCTOP, REG_EBX);                                       // not  ebx
19421933         emit_push_r32(DRCTOP, REG_EBP);                                       // push ebp
19431934         emit_push_r32(DRCTOP, REG_EBX);                                       // push ebx
19441935         if (RTREG != 0)
r2454r2455
19791970         emit_shl_r32_cl(DRCTOP, REG_EBX);                                    // shl  ebx,cl
19801971         emit_shld_r32_r32_cl(DRCTOP, REG_EBP, REG_EBX);                           // shld ebp,ebx,cl
19811972         emit_shl_r32_cl(DRCTOP, REG_EBX);                                    // shl  ebx,cl
1982         emit_not_r32(DRCTOP, REG_EBP);                                       // not  ebp
1983         emit_not_r32(DRCTOP, REG_EBX);                                       // not  ebx
19841973         emit_push_r32(DRCTOP, REG_EBP);                                       // push ebp
19851974         emit_push_r32(DRCTOP, REG_EBX);                                       // push ebx
19861975         if (RTREG != 0)
r2454r2455
20182007         if (mips3.core->bigendian)
20192008            emit_xor_r32_imm(DRCTOP, REG_ECX, 0x18);                           // xor  ecx,0x18
20202009         emit_shl_r32_cl(DRCTOP, REG_EBX);                                    // shl  ebx,cl
2021         emit_not_r32(DRCTOP, REG_EBX);                                       // not  ebx
20222010         emit_push_r32(DRCTOP, REG_EBX);                                       // push ebx
20232011         if (RTREG != 0)
20242012         {
src/emu/cpu/mips/mips3com.c
r2454r2455
2929static void tlb_write_common(mips3_state *mips, int index);
3030static void tlb_entry_log_half(mips3_tlb_entry *tlbent, int index, int which);
3131
32static UINT64 program_read_qword_masked_32be(offs_t offset, UINT64 mem_mask);
33static void program_write_qword_masked_32be(offs_t offset, UINT64 data, UINT64 mem_mask);
34static UINT64 program_read_qword_masked_32le(offs_t offset, UINT64 mem_mask);
35static void program_write_qword_masked_32le(offs_t offset, UINT64 data, UINT64 mem_mask);
3632
3733
38
3934/***************************************************************************
4035    PRIVATE GLOBAL VARIABLES
4136***************************************************************************/
r2454r2455
860855         asid, r, c, (lo & 4) ? 'd' : '.', (lo & 2) ? 'v' : '.', (hi & 0x1000) ? 'g' : '.');
861856#endif
862857}
863
864
865
866/***************************************************************************
867    DOUBLEWORD READS/WRITES
868***************************************************************************/
869
870/*-------------------------------------------------
871    program_read_qword_masked_32be - read a 64-bit
872    big-endian value with explicit masking
873-------------------------------------------------*/
874
875static UINT64 program_read_qword_masked_32be(offs_t offset, UINT64 mem_mask)
876{
877   UINT64 result = 0;
878   if (ACCESSING_BITS_32_63)
879      result |= (UINT64)program_read_dword_masked_32be(offset, mem_mask >> 32) << 32;
880   if (ACCESSING_BITS_0_31)
881      result |= program_read_dword_masked_32be(offset + 4, mem_mask);
882   return result;
883}
884
885
886/*-------------------------------------------------
887    program_read_qword_masked_32le - read a 64-bit
888    little-endian value with explicit masking
889-------------------------------------------------*/
890
891static UINT64 program_read_qword_masked_32le(offs_t offset, UINT64 mem_mask)
892{
893   UINT64 result = 0;
894   if (ACCESSING_BITS_0_31)
895      result |= program_read_dword_masked_32le(offset, mem_mask);
896   if (ACCESSING_BITS_32_63)
897      result |= (UINT64)program_read_dword_masked_32le(offset + 4, mem_mask >> 32) << 32;
898   return result;
899}
900
901
902/*-------------------------------------------------
903    program_write_qword_masked_32be - write a
904    64-bit big-endian value with explicit masking
905-------------------------------------------------*/
906
907static void program_write_qword_masked_32be(offs_t offset, UINT64 data, UINT64 mem_mask)
908{
909   if (ACCESSING_BITS_32_63)
910      program_write_dword_masked_32be(offset, data >> 32, mem_mask >> 32);
911   if (ACCESSING_BITS_0_31)
912      program_write_dword_masked_32be(offset + 4, data, mem_mask);
913}
914
915
916/*-------------------------------------------------
917    program_write_qword_masked_32le - write a
918    64-bit little-endian value with explicit masking
919-------------------------------------------------*/
920
921static void program_write_qword_masked_32le(offs_t offset, UINT64 data, UINT64 mem_mask)
922{
923   if (ACCESSING_BITS_0_31)
924      program_write_dword_masked_32le(offset, data, mem_mask);
925   if (ACCESSING_BITS_32_63)
926      program_write_dword_masked_32le(offset + 4, data >> 32, mem_mask >> 32);
927}
src/emu/cpu/mips/mips3.c
r2454r2455
1010***************************************************************************/
1111
1212#include "debugger.h"
13#include "deprecat.h"
1413#include "mips3com.h"
1514
1615
r2454r2455
19631962   UINT32 mask = 0xffffffffUL << shift;
19641963   UINT32 temp;
19651964
1966   if (RWORD_MASKED(offs & ~3, &temp, ~(mask >> shift)) && RTREG)
1965   if (RWORD_MASKED(offs & ~3, &temp, mask >> shift) && RTREG)
19671966      RTVAL64 = (INT32)((RTVAL32 & ~mask) | (temp << shift));
19681967}
19691968
r2454r2455
19741973   UINT32 mask = 0xffffffffUL >> shift;
19751974   UINT32 temp;
19761975
1977   if (RWORD_MASKED(offs & ~3, &temp, ~(mask << shift)) && RTREG)
1976   if (RWORD_MASKED(offs & ~3, &temp, mask << shift) && RTREG)
19781977      RTVAL64 = (INT32)((RTVAL32 & ~mask) | (temp >> shift));
19791978}
19801979
r2454r2455
19851984   UINT64 mask = U64(0xffffffffffffffff) << shift;
19861985   UINT64 temp;
19871986
1988   if (RDOUBLE_MASKED(offs & ~7, &temp, ~(mask >> shift)) && RTREG)
1987   if (RDOUBLE_MASKED(offs & ~7, &temp, mask >> shift) && RTREG)
19891988      RTVAL64 = (RTVAL64 & ~mask) | (temp << shift);
19901989}
19911990
r2454r2455
19961995   UINT64 mask = U64(0xffffffffffffffff) >> shift;
19971996   UINT64 temp;
19981997
1999   if (RDOUBLE_MASKED(offs & ~7, &temp, ~(mask << shift)) && RTREG)
1998   if (RDOUBLE_MASKED(offs & ~7, &temp, mask << shift) && RTREG)
20001999      RTVAL64 = (RTVAL64 & ~mask) | (temp >> shift);
20012000}
20022001
r2454r2455
20042003{
20052004   offs_t offs = SIMMVAL + RSVAL32;
20062005   int shift = 8 * (offs & 3);
2007   UINT32 mask = ~(0xffffffffUL >> shift);
2006   UINT32 mask = 0xffffffffUL >> shift;
20082007   WWORD_MASKED(offs & ~3, RTVAL32 >> shift, mask);
20092008}
20102009
r2454r2455
20122011{
20132012   offs_t offs = SIMMVAL + RSVAL32;
20142013   int shift = 8 * (~offs & 3);
2015   UINT32 mask = ~(0xffffffffUL << shift);
2014   UINT32 mask = 0xffffffffUL << shift;
20162015   WWORD_MASKED(offs & ~3, RTVAL32 << shift, mask);
20172016}
20182017
r2454r2455
20202019{
20212020   offs_t offs = SIMMVAL + RSVAL32;
20222021   int shift = 8 * (offs & 7);
2023   UINT64 mask = ~(U64(0xffffffffffffffff) >> shift);
2022   UINT64 mask = U64(0xffffffffffffffff) >> shift;
20242023   WDOUBLE_MASKED(offs & ~7, RTVAL64 >> shift, mask);
20252024}
20262025
r2454r2455
20282027{
20292028   offs_t offs = SIMMVAL + RSVAL32;
20302029   int shift = 8 * (~offs & 7);
2031   UINT64 mask = ~(U64(0xffffffffffffffff) << shift);
2030   UINT64 mask = U64(0xffffffffffffffff) << shift;
20322031   WDOUBLE_MASKED(offs & ~7, RTVAL64 << shift, mask);
20332032}
20342033
r2454r2455
20412040   UINT32 mask = 0xffffffffUL << shift;
20422041   UINT32 temp;
20432042
2044   if (RWORD_MASKED(offs & ~3, &temp, ~(mask >> shift)) && RTREG)
2043   if (RWORD_MASKED(offs & ~3, &temp, mask >> shift) && RTREG)
20452044      RTVAL64 = (INT32)((RTVAL32 & ~mask) | (temp << shift));
20462045}
20472046
r2454r2455
20522051   UINT32 mask = 0xffffffffUL >> shift;
20532052   UINT32 temp;
20542053
2055   if (RWORD_MASKED(offs & ~3, &temp, ~(mask << shift)) && RTREG)
2054   if (RWORD_MASKED(offs & ~3, &temp, mask << shift) && RTREG)
20562055      RTVAL64 = (INT32)((RTVAL32 & ~mask) | (temp >> shift));
20572056}
20582057
r2454r2455
20632062   UINT64 mask = U64(0xffffffffffffffff) << shift;
20642063   UINT64 temp;
20652064
2066   if (RDOUBLE_MASKED(offs & ~7, &temp, ~(mask >> shift)) && RTREG)
2065   if (RDOUBLE_MASKED(offs & ~7, &temp, mask >> shift) && RTREG)
20672066      RTVAL64 = (RTVAL64 & ~mask) | (temp << shift);
20682067}
20692068
r2454r2455
20742073   UINT64 mask = U64(0xffffffffffffffff) >> shift;
20752074   UINT64 temp;
20762075
2077   if (RDOUBLE_MASKED(offs & ~7, &temp, ~(mask << shift)) && RTREG)
2076   if (RDOUBLE_MASKED(offs & ~7, &temp, mask << shift) && RTREG)
20782077      RTVAL64 = (RTVAL64 & ~mask) | (temp >> shift);
20792078}
20802079
r2454r2455
20822081{
20832082   offs_t offs = SIMMVAL + RSVAL32;
20842083   int shift = 8 * (~offs & 3);
2085   UINT32 mask = ~(0xffffffffUL >> shift);
2084   UINT32 mask = 0xffffffffUL >> shift;
20862085   WWORD_MASKED(offs & ~3, RTVAL32 >> shift, mask);
20872086}
20882087
r2454r2455
20902089{
20912090   offs_t offs = SIMMVAL + RSVAL32;
20922091   int shift = 8 * (offs & 3);
2093   UINT32 mask = ~(0xffffffffUL << shift);
2092   UINT32 mask = 0xffffffffUL << shift;
20942093   WWORD_MASKED(offs & ~3, RTVAL32 << shift, mask);
20952094}
20962095
r2454r2455
20982097{
20992098   offs_t offs = SIMMVAL + RSVAL32;
21002099   int shift = 8 * (~offs & 7);
2101   UINT64 mask = ~(U64(0xffffffffffffffff) >> shift);
2100   UINT64 mask = U64(0xffffffffffffffff) >> shift;
21022101   WDOUBLE_MASKED(offs & ~7, RTVAL64 >> shift, mask);
21032102}
21042103
r2454r2455
21062105{
21072106   offs_t offs = SIMMVAL + RSVAL32;
21082107   int shift = 8 * (offs & 7);
2109   UINT64 mask = ~(U64(0xffffffffffffffff) << shift);
2108   UINT64 mask = U64(0xffffffffffffffff) << shift;
21102109   WDOUBLE_MASKED(offs & ~7, RTVAL64 << shift, mask);
21112110}
21122111
src/emu/cpu/f8/f8.c
r2454r2455
2727 */
2828
2929#include "debugger.h"
30#include "deprecat.h"
3130#include "f8.h"
3231
3332#define S   0x01
src/emu/cpu/z80/z80.c
r2454r2455
9494 *****************************************************************************/
9595
9696#include "debugger.h"
97#include "deprecat.h"
9897#include "z80.h"
9998#include "z80daisy.h"
10099
src/emu/cpu/asap/asap.c
r2454r2455
1010***************************************************************************/
1111
1212#include "debugger.h"
13#include "deprecat.h"
1413#include "asap.h"
1514
1615
src/emu/cpu/i960/i960.c
r2454r2455
11#include "debugger.h"
2#include "deprecat.h"
32#include "i960.h"
43#include "i960dis.h"
54#include <math.h>
src/emu/cpu/v810/v810.c
r2454r2455
1717********************************************/
1818
1919#include "debugger.h"
20#include "deprecat.h"
2120#include "v810.h"
2221
2322#define clkIF 3
src/emu/cpu/tms32025/tms32025.c
r2454r2455
119119
120120
121121#include "debugger.h"
122#include "deprecat.h"
123122#include "tms32025.h"
124123
125124
src/emu/cpu/pic16c5x/pic16c5x.c
r2454r2455
5454
5555
5656#include "debugger.h"
57#include "deprecat.h"
5857#include "pic16c5x.h"
5958
6059
src/emu/cpu/pdp1/pdp1.c
r2454r2455
336336
337337
338338#include "debugger.h"
339#include "deprecat.h"
340339#include "pdp1.h"
341340
342341#define LOG 0
src/emu/cpu/pdp1/tx0.c
r2454r2455
1111#include "cpuintrf.h"
1212#include "debugger.h"
1313#include "tx0.h"
14#include "deprecat.h"
1514
1615#define LOG 0
1716#define LOG_EXTRA 0
src/emu/cpu/mb86233/mb86233.c
r2454r2455
1414***************************************************************************/
1515
1616#include "mb86233.h"
17#include "deprecat.h"
1817#include "debugger.h"
1918
2019/***************************************************************************
src/emu/cpu/t11/t11.c
r2454r2455
1212*****************************************************************************/
1313
1414#include "debugger.h"
15#include "deprecat.h"
1615#include "t11.h"
1716
1817
src/emu/cpu/t11/t11ops.c
r2454r2455
255255{
256256   switch (t11.op & 0x3f)
257257   {
258      case 0x00:   /* HALT  */ t11_ICount = 0; break;
258      case 0x00:   /* HALT  */ halt(); break;
259259      case 0x01:   /* WAIT  */ t11_ICount = 0; t11.wait_state = 1; break;
260260      case 0x02:   /* RTI   */ t11_ICount -= 24; PC = POP(); PSW = POP(); change_pc(PC); t11_check_irqs(); break;
261261      case 0x03:   /* BPT   */ t11_ICount -= 48; PUSH(PSW); PUSH(PC); PC = RWORD(0x0c); PSW = RWORD(0x0e); change_pc(PC); t11_check_irqs(); break;
r2454r2455
266266   }
267267}
268268
269static void halt(void)
270{
271   t11_ICount -= 48;
272   PUSH(PSW);
273   PUSH(PC);
274   PC = RWORD(0x04);
275   PSW = RWORD(0x06);
276   change_pc(PC);
277   t11_check_irqs();
278}
279
269280static void illegal(void)
270281{
271282   t11_ICount -= 48;
r2454r2455
275286   PSW = RWORD(0x0a);
276287   change_pc(PC);
277288   t11_check_irqs();
278PC = 0;
279289}
280290
291static void mark(void)
292{
293   t11_ICount -= 36;
294
295   SP = SP + 2 * (t11.op & 0x3f);
296   PC = REGW(5);
297      REGW(5) = POP();
298
299   change_pc(PC);
300}
301
281302static void jmp_rgd(void)       { t11_ICount -= 15; { JMP(RGD); } }
282303static void jmp_in(void)        { t11_ICount -= 18; { JMP(IN);  } }
283304static void jmp_ind(void)       { t11_ICount -= 18; { JMP(IND); } }
src/emu/cpu/t11/t11table.c
r2454r2455
2121*/
2222
2323static void op_0000(void);
24static void halt(void);
2425static void illegal(void);
2526
2627static void jmp_rgd(void);
r2454r2455
168169static void asl_ix(void);
169170static void asl_ixd(void);
170171
171/*static void mark(void);*/
172static void mark(void);
172173
173174static void sxt_rg(void);
174175static void sxt_rgd(void);
r2454r2455
11121113static void (*const opcode_table[65536 >> 3])(void) =
11131114{
11141115   /* 0x0000 */
1115   op_0000,   illegal,   illegal,   illegal,   illegal,   illegal,   illegal,   illegal,
1116   op_0000,   halt,      illegal,   illegal,   illegal,   illegal,   illegal,   illegal,
11161117   illegal,   jmp_rgd,   jmp_in,      jmp_ind,   jmp_de,      jmp_ded,   jmp_ix,      jmp_ixd,
11171118   rts,      illegal,   illegal,   illegal,   ccc,      ccc,      scc,      scc,
11181119   swab_rg,   swab_rgd,   swab_in,   swab_ind,   swab_de,   swab_ded,   swab_ix,   swab_ixd,
r2454r2455
11771178   asr_rg,      asr_rgd,   asr_in,      asr_ind,   asr_de,      asr_ded,   asr_ix,      asr_ixd,
11781179   asl_rg,      asl_rgd,   asl_in,      asl_ind,   asl_de,      asl_ded,   asl_ix,      asl_ixd,
11791180   /* 0x0d00 */
1181   mark,      mark,      mark,      mark,      mark,      mark,      mark,      mark,
11801182   illegal,   illegal,   illegal,   illegal,   illegal,   illegal,   illegal,   illegal,
11811183   illegal,   illegal,   illegal,   illegal,   illegal,   illegal,   illegal,   illegal,
1182   illegal,   illegal,   illegal,   illegal,   illegal,   illegal,   illegal,   illegal,
11831184   sxt_rg,      sxt_rgd,   sxt_in,      sxt_ind,   sxt_de,      sxt_ded,   sxt_ix,      sxt_ixd,
11841185   /* 0x0e00 */
11851186   illegal,   illegal,   illegal,   illegal,   illegal,   illegal,   illegal,   illegal,
src/emu/cpu/arm7/arm7.c
r2454r2455
3535    **
3636*****************************************************************************/
3737#include "arm7.h"
38#include "deprecat.h"
3938#include "debugger.h"
4039#include "arm7core.h"   //include arm7 core
4140
src/emu/cpu/h6280/h6280.c
r2454r2455
108108
109109******************************************************************************/
110110#include "debugger.h"
111#include "deprecat.h"
112111#include "h6280.h"
113112
114113static int    h6280_ICount = 0;
src/emu/cpu/m6800/m6800.c
r2454r2455
7474*/
7575
7676#include "debugger.h"
77#include "deprecat.h"
7877#include "m6800.h"
7978
8079#define VERBOSE 0
r2454r2455
19651964
19661965READ8_HANDLER( hd63701_internal_registers_r )
19671966{
1968   return m6803_internal_registers_r(Machine, offset);
1967   return m6803_internal_registers_r(machine, offset);
19691968}
19701969
19711970WRITE8_HANDLER( hd63701_internal_registers_w )
19721971{
1973   m6803_internal_registers_w(Machine, offset,data);
1972   m6803_internal_registers_w(machine, offset,data);
19741973}
19751974#endif
19761975
src/emu/cpu/saturn/saturn.c
r2454r2455
2020 *
2121 *****************************************************************************/
2222#include "debugger.h"
23#include "deprecat.h"
2423
2524#include "saturn.h"
2625#include "sat.h"
src/emu/cpu/i8x41/i8x41.c
r2454r2455
8787 *****************************************************************************/
8888
8989#include "debugger.h"
90#include "deprecat.h"
9190#include "i8x41.h"
9291
9392typedef struct {
src/emu/cpu/konami/konami.c
r2454r2455
3535*****************************************************************************/
3636
3737#include "debugger.h"
38#include "deprecat.h"
3938#include "konami.h"
4039
4140#define VERBOSE 0
src/emu/video/voodoo.c
r2454r2455
20142014
20152015            /* loop over words */
20162016            for (i = 0; i < count; i++)
2017               cycles += lfb_w(v, target++, *src++, 0, FALSE);
2017               cycles += lfb_w(v, target++, *src++, 0xffffffff, FALSE);
20182018         }
20192019         else if ((command >> 30) == 3)
20202020         {
r2454r2455
35353535               cycles = texture_w(v, address, data);
35363536            else
35373537            {
3538               UINT32 mem_mask = 0;
3538               UINT32 mem_mask = 0xffffffff;
35393539
35403540               /* compute mem_mask */
35413541               if (address & 0x80000000)
3542                  mem_mask |= 0xffff0000;
3542                  mem_mask &= 0x0000ffff;
35433543               if (address & 0x40000000)
3544                  mem_mask |= 0x0000ffff;
3544                  mem_mask &= 0xffff0000;
35453545               address &= 0xffffff;
35463546
35473547               cycles = lfb_w(v, address, data, mem_mask, FALSE);
r2454r2455
43844384   }
43854385
43864386   if (LOG_REGISTERS)
4387      logerror("%08X:banshee_w(AGP:%s) = %08X & %08X\n", activecpu_get_pc(), banshee_agp_reg_name[offset], data, ~mem_mask);
4387      logerror("%08X:banshee_w(AGP:%s) = %08X & %08X\n", activecpu_get_pc(), banshee_agp_reg_name[offset], data, mem_mask);
43884388}
43894389
43904390
r2454r2455
43994399   else if (offset < 0x100000/4)
44004400      banshee_agp_w(v, offset, data, mem_mask);
44014401   else if (offset < 0x200000/4)
4402      logerror("%08X:banshee_w(2D:%X) = %08X & %08X\n", activecpu_get_pc(), (offset*4) & 0xfffff, data, ~mem_mask);
4402      logerror("%08X:banshee_w(2D:%X) = %08X & %08X\n", activecpu_get_pc(), (offset*4) & 0xfffff, data, mem_mask);
44034403   else if (offset < 0x600000/4)
44044404      register_w(v, offset & 0x1fffff/4, data);
44054405   else if (offset < 0x800000/4)
4406      logerror("%08X:banshee_w(TEX:%X) = %08X & %08X\n", activecpu_get_pc(), (offset*4) & 0x1fffff, data, ~mem_mask);
4406      logerror("%08X:banshee_w(TEX:%X) = %08X & %08X\n", activecpu_get_pc(), (offset*4) & 0x1fffff, data, mem_mask);
44074407   else if (offset < 0xc00000/4)
4408      logerror("%08X:banshee_w(RES:%X) = %08X & %08X\n", activecpu_get_pc(), (offset*4) & 0x3fffff, data, ~mem_mask);
4408      logerror("%08X:banshee_w(RES:%X) = %08X & %08X\n", activecpu_get_pc(), (offset*4) & 0x3fffff, data, mem_mask);
44094409   else if (offset < 0x1000000/4)
4410      logerror("%08X:banshee_w(YUV:%X) = %08X & %08X\n", activecpu_get_pc(), (offset*4) & 0x3fffff, data, ~mem_mask);
4410      logerror("%08X:banshee_w(YUV:%X) = %08X & %08X\n", activecpu_get_pc(), (offset*4) & 0x3fffff, data, mem_mask);
44114411   else if (offset < 0x2000000/4)
44124412   {
44134413      UINT8 temp = v->fbi.lfb_stride;
r2454r2455
44364436      {
44374437         if (offset*4 <= v->fbi.mask)
44384438            COMBINE_DATA(&((UINT32 *)v->fbi.ram)[offset]);
4439         logerror("%08X:banshee_fb_w(%X) = %08X & %08X\n", activecpu_get_pc(), offset*4, data, ~mem_mask);
4439         logerror("%08X:banshee_fb_w(%X) = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask);
44404440      }
44414441   }
44424442   else
r2454r2455
45184518         if ((v->banshee.io[offset] ^ old) & 0x2800)
45194519            v->fbi.clut_dirty = TRUE;
45204520         if (LOG_REGISTERS)
4521            logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", activecpu_get_pc(), banshee_io_reg_name[offset], data, ~mem_mask);
4521            logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", activecpu_get_pc(), banshee_io_reg_name[offset], data, mem_mask);
45224522         break;
45234523
45244524      case io_dacData:
r2454r2455
45294529            v->fbi.clut_dirty = TRUE;
45304530         }
45314531         if (LOG_REGISTERS)
4532            logerror("%08X:banshee_dac_w(%X) = %08X & %08X\n", activecpu_get_pc(), v->banshee.io[io_dacAddr] & 0x1ff, data, ~mem_mask);
4532            logerror("%08X:banshee_dac_w(%X) = %08X & %08X\n", activecpu_get_pc(), v->banshee.io[io_dacAddr] & 0x1ff, data, mem_mask);
45334533         break;
45344534
45354535      case io_miscInit0:
45364536         COMBINE_DATA(&v->banshee.io[offset]);
45374537         v->fbi.yorigin = (data >> 18) & 0xfff;
45384538         if (LOG_REGISTERS)
4539            logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", activecpu_get_pc(), banshee_io_reg_name[offset], data, ~mem_mask);
4539            logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", activecpu_get_pc(), banshee_io_reg_name[offset], data, mem_mask);
45404540         break;
45414541
45424542      case io_vidScreenSize:
r2454r2455
45504550         video_screen_set_visarea(v->screen, 0, v->fbi.width - 1, 0, v->fbi.height - 1);
45514551         adjust_vblank_timer(v);
45524552         if (LOG_REGISTERS)
4553            logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", activecpu_get_pc(), banshee_io_reg_name[offset], data, ~mem_mask);
4553            logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", activecpu_get_pc(), banshee_io_reg_name[offset], data, mem_mask);
45544554         break;
45554555
45564556      case io_lfbMemoryConfig:
45574557         v->fbi.lfb_base = (data & 0x1fff) << 10;
45584558         v->fbi.lfb_stride = ((data >> 13) & 7) + 9;
45594559         if (LOG_REGISTERS)
4560            logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", activecpu_get_pc(), banshee_io_reg_name[offset], data, ~mem_mask);
4560            logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", activecpu_get_pc(), banshee_io_reg_name[offset], data, mem_mask);
45614561         break;
45624562
45634563      case io_vgab0:   case io_vgab4:   case io_vgab8:   case io_vgabc:
r2454r2455
45764576      default:
45774577         COMBINE_DATA(&v->banshee.io[offset]);
45784578         if (LOG_REGISTERS)
4579            logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", activecpu_get_pc(), banshee_io_reg_name[offset], data, ~mem_mask);
4579            logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", activecpu_get_pc(), banshee_io_reg_name[offset], data, mem_mask);
45804580         break;
45814581   }
45824582}
src/emu/video/generic.c
r2454r2455
677677WRITE8_HANDLER( paletteram_RRRGGGBB_w )
678678{
679679   paletteram[offset] = data;
680   palette_set_color_rgb(Machine, offset, pal3bit(data >> 5), pal3bit(data >> 2), pal2bit(data >> 0));
680   palette_set_color_rgb(machine, offset, pal3bit(data >> 5), pal3bit(data >> 2), pal2bit(data >> 0));
681681}
682682
683683
r2454r2455
688688WRITE8_HANDLER( paletteram_BBGGGRRR_w )
689689{
690690   paletteram[offset] = data;
691   palette_set_color_rgb(Machine, offset, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6));
691   palette_set_color_rgb(machine, offset, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6));
692692}
693693
694694
r2454r2455
701701   int i = (data >> 0) & 3;
702702
703703   paletteram[offset] = data;
704   palette_set_color_rgb(Machine, offset, pal4bit(((data >> 0) & 0x0c) | i),
704   palette_set_color_rgb(machine, offset, pal4bit(((data >> 0) & 0x0c) | i),
705705                                      pal4bit(((data >> 2) & 0x0c) | i),
706706                                      pal4bit(((data >> 4) & 0x0c) | i));
707707}
r2454r2455
966966{
967967   COMBINE_DATA(&paletteram16[offset]);
968968   data = paletteram16[offset];
969   palette_set_color_rgb(Machine, offset, pal5bit(((data >> 11) & 0x1e) | ((data >> 3) & 0x01)),
969   palette_set_color_rgb(machine, offset, pal5bit(((data >> 11) & 0x1e) | ((data >> 3) & 0x01)),
970970                                          pal5bit(((data >>  7) & 0x1e) | ((data >> 2) & 0x01)),
971971                                          pal5bit(((data >>  3) & 0x1e) | ((data >> 1) & 0x01)));
972972}
src/emu/emuopts.c
r2454r2455
154154
155155   /* misc options */
156156   { NULL,                          NULL,        OPTION_HEADER,     "CORE MISC OPTIONS" },
157   { "bios",                        "default",   0,                 "select the system BIOS to use" },
157   { "bios",                        NULL,        0,                 "select the system BIOS to use" },
158158   { "cheat;c",                     "0",         OPTION_BOOLEAN,    "enable cheat subsystem" },
159159   { "skip_gameinfo",               "0",         OPTION_BOOLEAN,    "skip displaying the information screen at startup" },
160160
src/emu/video.c
r2454r2455
10631063
10641064   /* a lot of modules want to the period of the primary screen, so
10651065       if we are screenless, return something reasonable so that we don't fall over */
1066    if (video_screen_count(screen->machine->config) == 0)
1067    {
1068       assert(screen == NULL);
1069       ret = DEFAULT_FRAME_PERIOD;
1066   if (screen == NULL || video_screen_count(screen->machine->config) == 0)
1067   {
1068      ret = DEFAULT_FRAME_PERIOD;
10701069   }
1071    else
1072    {
1070   else
1071   {
10731072      screen_state *state = get_safe_token(screen);
10741073      ret = attotime_make(0, state->frame_period);
10751074   }
r2454r2455
19901989         UINT32 target_speed;
19911990
19921991         /* find the screen with the shortest frame period (max refresh rate) */
1992         /* note that we first check the token since this can get called before all screens are created */
19931993         for (screen = video_screen_first(machine->config); screen != NULL; screen = video_screen_next(screen))
1994         {
1995            screen_state *state = get_safe_token(screen);
1996            min_frame_period = MIN(min_frame_period, state->frame_period);
1997         }
1994            if (screen->token != NULL)
1995            {
1996               screen_state *state = get_safe_token(screen);
1997               min_frame_period = MIN(min_frame_period, state->frame_period);
1998            }
19981999
19992000         /* compute a target speed as an integral percentage */
20002001         target_speed = floor(minrefresh * 100.0 / ATTOSECONDS_TO_HZ(min_frame_period));
src/emu/memory.c
r2454r2455
342342static debug_hook_write_func debug_hook_write;            /* pointer to debugger callback for memory writes */
343343#endif
344344
345#define ACCESSOR_GROUP(type, width) \
346{ \
347   memory_set_opbase, \
348   type##_read_byte_##width, \
349   type##_read_word_##width, \
350   type##_read_word_masked_##width, \
351   type##_read_dword_##width, \
352   type##_read_dword_masked_##width, \
353   type##_read_qword_##width, \
354   type##_read_qword_masked_##width, \
355   type##_write_byte_##width, \
356   type##_write_word_##width, \
357   type##_write_word_masked_##width, \
358   type##_write_dword_##width, \
359   type##_write_dword_masked_##width, \
360   type##_write_qword_##width, \
361   type##_write_qword_masked_##width \
362}
363
345364static const data_accessors memory_accessors[ADDRESS_SPACES][4][2] =
346365{
347366   /* program accessors */
348367   {
349      {
350         { memory_set_opbase, program_read_byte_8le, program_read_word_8le, program_read_dword_8le, NULL, program_read_qword_8le, NULL, program_write_byte_8le, program_write_word_8le, program_write_dword_8le, NULL, program_write_qword_8le, NULL },
351         { memory_set_opbase, program_read_byte_8be, program_read_word_8be, program_read_dword_8be, NULL, program_read_qword_8be, NULL, program_write_byte_8be, program_write_word_8be, program_write_dword_8be, NULL, program_write_qword_8be, NULL }
352      },
353      {
354         { memory_set_opbase, program_read_byte_16le, program_read_word_16le, program_read_dword_16le, NULL, program_read_qword_16le, NULL, program_write_byte_16le, program_write_word_16le, program_write_dword_16le, NULL, program_write_qword_16le, NULL },
355         { memory_set_opbase, program_read_byte_16be, program_read_word_16be, program_read_dword_16be, NULL, program_read_qword_16be, NULL, program_write_byte_16be, program_write_word_16be, program_write_dword_16be, NULL, program_write_qword_16be, NULL }
356      },
357      {
358         { memory_set_opbase, program_read_byte_32le, program_read_word_32le, program_read_dword_32le, program_read_dword_masked_32le, program_read_qword_32le, NULL, program_write_byte_32le, program_write_word_32le, program_write_dword_32le, program_write_dword_masked_32le, program_write_qword_32le, NULL },
359         { memory_set_opbase, program_read_byte_32be, program_read_word_32be, program_read_dword_32be, program_read_dword_masked_32be, program_read_qword_32be, NULL, program_write_byte_32be, program_write_word_32be, program_write_dword_32be, program_write_dword_masked_32be, program_write_qword_32be, NULL }
360      },
361      {
362         { memory_set_opbase, program_read_byte_64le, program_read_word_64le, program_read_dword_64le, NULL, program_read_qword_64le, program_read_qword_masked_64le, program_write_byte_64le, program_write_word_64le, program_write_dword_64le, NULL, program_write_qword_64le, program_write_qword_masked_64le },
363         { memory_set_opbase, program_read_byte_64be, program_read_word_64be, program_read_dword_64be, NULL, program_read_qword_64be, program_read_qword_masked_64be, program_write_byte_64be, program_write_word_64be, program_write_dword_64be, NULL, program_write_qword_64be, program_write_qword_masked_64be }
364      }
368      { ACCESSOR_GROUP(program, 8le),  ACCESSOR_GROUP(program, 8be)  },
369      { ACCESSOR_GROUP(program, 16le), ACCESSOR_GROUP(program, 16be) },
370      { ACCESSOR_GROUP(program, 32le), ACCESSOR_GROUP(program, 32be) },
371      { ACCESSOR_GROUP(program, 64le), ACCESSOR_GROUP(program, 64be) }
365372   },
366373
367374   /* data accessors */
368375   {
369      {
370         { memory_set_opbase, data_read_byte_8le, data_read_word_8le, data_read_dword_8le, NULL, data_read_qword_8le, NULL, data_write_byte_8le, data_write_word_8le, data_write_dword_8le, NULL, data_write_qword_8le, NULL },
371         { memory_set_opbase, data_read_byte_8be, data_read_word_8be, data_read_dword_8be, NULL, data_read_qword_8be, NULL, data_write_byte_8be, data_write_word_8be, data_write_dword_8be, NULL, data_write_qword_8be, NULL }
372      },
373      {
374         { memory_set_opbase, data_read_byte_16le, data_read_word_16le, data_read_dword_16le, NULL, data_read_qword_16le, NULL, data_write_byte_16le, data_write_word_16le, data_write_dword_16le, NULL, data_write_qword_16le, NULL },
375         { memory_set_opbase, data_read_byte_16be, data_read_word_16be, data_read_dword_16be, NULL, data_read_qword_16be, NULL, data_write_byte_16be, data_write_word_16be, data_write_dword_16be, NULL, data_write_qword_16be, NULL }
376      },
377      {
378         { memory_set_opbase, data_read_byte_32le, data_read_word_32le, data_read_dword_32le, data_read_dword_masked_32le, data_read_qword_32le, NULL, data_write_byte_32le, data_write_word_32le, data_write_dword_32le, data_write_dword_masked_32le, data_write_qword_32le, NULL },
379         { memory_set_opbase, data_read_byte_32be, data_read_word_32be, data_read_dword_32be, data_read_dword_masked_32be, data_read_qword_32be, NULL, data_write_byte_32be, data_write_word_32be, data_write_dword_32be, data_write_dword_masked_32be, data_write_qword_32be, NULL }
380      },
381      {
382         { memory_set_opbase, data_read_byte_64le, data_read_word_64le, data_read_dword_64le, NULL, data_read_qword_64le, data_read_qword_masked_64le, data_write_byte_64le, data_write_word_64le, data_write_dword_64le, NULL, data_write_qword_64le, data_write_qword_masked_64le },
383         { memory_set_opbase, data_read_byte_64be, data_read_word_64be, data_read_dword_64be, NULL, data_read_qword_64be, data_read_qword_masked_64be, data_write_byte_64be, data_write_word_64be, data_write_dword_64be, NULL, data_write_qword_64be, data_write_qword_masked_64be }
384      }
376      { ACCESSOR_GROUP(data, 8le),  ACCESSOR_GROUP(data, 8be)  },
377      { ACCESSOR_GROUP(data, 16le), ACCESSOR_GROUP(data, 16be) },
378      { ACCESSOR_GROUP(data, 32le), ACCESSOR_GROUP(data, 32be) },
379      { ACCESSOR_GROUP(data, 64le), ACCESSOR_GROUP(data, 64be) }
385380   },
386381
387382   /* I/O accessors */
388383   {
389      {
390         { memory_set_opbase, io_read_byte_8le, io_read_word_8le, io_read_dword_8le, NULL, io_read_qword_8le, NULL, io_write_byte_8le, io_write_word_8le, io_write_dword_8le, NULL, io_write_qword_8le, NULL },
391         { memory_set_opbase, io_read_byte_8be, io_read_word_8be, io_read_dword_8be, NULL, io_read_qword_8be, NULL, io_write_byte_8be, io_write_word_8be, io_write_dword_8be, NULL, io_write_qword_8be, NULL }
392      },
393      {
394         { memory_set_opbase, io_read_byte_16le, io_read_word_16le, io_read_dword_16le, NULL, io_read_qword_16le, NULL, io_write_byte_16le, io_write_word_16le, io_write_dword_16le, NULL, io_write_qword_16le, NULL },
395         { memory_set_opbase, io_read_byte_16be, io_read_word_16be, io_read_dword_16be, NULL, io_read_qword_16be, NULL, io_write_byte_16be, io_write_word_16be, io_write_dword_16be, NULL, io_write_qword_16be, NULL }
396      },
397      {
398         { memory_set_opbase, io_read_byte_32le, io_read_word_32le, io_read_dword_32le, io_read_dword_masked_32le, io_read_qword_32le, NULL, io_write_byte_32le, io_write_word_32le, io_write_dword_32le, io_write_dword_masked_32le, io_write_qword_32le, NULL },
399         { memory_set_opbase, io_read_byte_32be, io_read_word_32be, io_read_dword_32be, io_read_dword_masked_32be, io_read_qword_32be, NULL, io_write_byte_32be, io_write_word_32be, io_write_dword_32be, io_write_dword_masked_32be, io_write_qword_32be, NULL }
400      },
401      {
402         { memory_set_opbase, io_read_byte_64le, io_read_word_64le, io_read_dword_64le, NULL, io_read_qword_64le, io_read_qword_masked_64le, io_write_byte_64le, io_write_word_64le, io_write_dword_64le, NULL, io_write_qword_64le, io_write_qword_masked_64le },
403         { memory_set_opbase, io_read_byte_64be, io_read_word_64be, io_read_dword_64be, NULL, io_read_qword_64be, io_read_qword_masked_64be, io_write_byte_64be, io_write_word_64be, io_write_dword_64be, NULL, io_write_qword_64be, io_write_qword_masked_64be }
404      }
384      { ACCESSOR_GROUP(io, 8le),  ACCESSOR_GROUP(io, 8be)  },
385      { ACCESSOR_GROUP(io, 16le), ACCESSOR_GROUP(io, 16be) },
386      { ACCESSOR_GROUP(io, 32le), ACCESSOR_GROUP(io, 32be) },
387      { ACCESSOR_GROUP(io, 64le), ACCESSOR_GROUP(io, 64be) }
405388   },
406389};
407390
r2454r2455
26272610}
26282611static READ16_HANDLER( mrh16_unmap_program )
26292612{
2630   if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory word read from %08X & %04X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM], offset*2), mem_mask ^ 0xffff);
2613   if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory word read from %08X & %04X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM], offset*2), mem_mask);
26312614   return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM].unmap;
26322615}
26332616static READ32_HANDLER( mrh32_unmap_program )
26342617{
2635   if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory dword read from %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM], offset*4), mem_mask ^ 0xffffffff);
2618   if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory dword read from %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM], offset*4), mem_mask);
26362619   return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM].unmap;
26372620}
26382621static READ64_HANDLER( mrh64_unmap_program )
26392622{
2640   if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory qword read from %08X & %08X%08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM], offset*8), (int)(mem_mask >> 32) ^ 0xffffffff, (int)(mem_mask & 0xffffffff) ^ 0xffffffff);
2623   if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory qword read from %08X & %08X%08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM], offset*8), (int)(mem_mask >> 32), (int)(mem_mask & 0xffffffff));
26412624   return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM].unmap;
26422625}
26432626
r2454r2455
26472630}
26482631static WRITE16_HANDLER( mwh16_unmap_program )
26492632{
2650   if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory word write to %08X = %04X & %04X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM], offset*2), data, mem_mask ^ 0xffff);
2633   if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory word write to %08X = %04X & %04X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM], offset*2), data, mem_mask);
26512634}
26522635static WRITE32_HANDLER( mwh32_unmap_program )
26532636{
2654   if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory dword write to %08X = %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM], offset*4), data, mem_mask ^ 0xffffffff);
2637   if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory dword write to %08X = %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM], offset*4), data, mem_mask);
26552638}
26562639static WRITE64_HANDLER( mwh64_unmap_program )
26572640{
2658   if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory qword write to %08X = %08X%08X & %08X%08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM], offset*8), (int)(data >> 32), (int)(data & 0xffffffff), (int)(mem_mask >> 32) ^ 0xffffffff, (int)(mem_mask & 0xffffffff) ^ 0xffffffff);
2641   if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory qword write to %08X = %08X%08X & %08X%08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM], offset*8), (int)(data >> 32), (int)(data & 0xffffffff), (int)(mem_mask >> 32), (int)(mem_mask & 0xffffffff));
26592642}
26602643
26612644static READ8_HANDLER( mrh8_unmap_data )
r2454r2455
26652648}
26662649static READ16_HANDLER( mrh16_unmap_data )
26672650{
2668   if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory word read from %08X & %04X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA], offset*2), mem_mask ^ 0xffff);
2651   if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory word read from %08X & %04X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA], offset*2), mem_mask);
26692652   return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA].unmap;
26702653}
26712654static READ32_HANDLER( mrh32_unmap_data )
26722655{
2673   if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory dword read from %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA], offset*4), mem_mask ^ 0xffffffff);
2656   if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory dword read from %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA], offset*4), mem_mask);
26742657   return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA].unmap;
26752658}
26762659static READ64_HANDLER( mrh64_unmap_data )
26772660{
2678   if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory qword read from %08X & %08X%08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA], offset*8), (int)(mem_mask >> 32) ^ 0xffffffff, (int)(mem_mask & 0xffffffff) ^ 0xffffffff);
2661   if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory qword read from %08X & %08X%08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA], offset*8), (int)(mem_mask >> 32), (int)(mem_mask & 0xffffffff));
26792662   return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA].unmap;
26802663}
26812664
r2454r2455
26852668}
26862669static WRITE16_HANDLER( mwh16_unmap_data )
26872670{
2688   if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory word write to %08X = %04X & %04X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA], offset*2), data, mem_mask ^ 0xffff);
2671   if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory word write to %08X = %04X & %04X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA], offset*2), data, mem_mask);
26892672}
26902673static WRITE32_HANDLER( mwh32_unmap_data )
26912674{
2692   if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory dword write to %08X = %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA], offset*4), data, mem_mask ^ 0xffffffff);
2675   if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory dword write to %08X = %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA], offset*4), data, mem_mask);
26932676}
26942677static WRITE64_HANDLER( mwh64_unmap_data )
26952678{
2696   if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory qword write to %08X = %08X%08X & %08X%08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA], offset*8), (int)(data >> 32), (int)(data & 0xffffffff), (int)(mem_mask >> 32) ^ 0xffffffff, (int)(mem_mask & 0xffffffff) ^ 0xffffffff);
2679   if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory qword write to %08X = %08X%08X & %08X%08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA], offset*8), (int)(data >> 32), (int)(data & 0xffffffff), (int)(mem_mask >> 32), (int)(mem_mask & 0xffffffff));
26972680}
26982681
26992682static READ8_HANDLER( mrh8_unmap_io )
r2454r2455
27032686}
27042687static READ16_HANDLER( mrh16_unmap_io )
27052688{
2706   if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O word read from %08X & %04X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO], offset*2), mem_mask ^ 0xffff);
2689   if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O word read from %08X & %04X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO], offset*2), mem_mask);
27072690   return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO].unmap;
27082691}
27092692static READ32_HANDLER( mrh32_unmap_io )
27102693{
2711   if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O dword read from %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO], offset*4), mem_mask ^ 0xffffffff);
2694   if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O dword read from %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO], offset*4), mem_mask);
27122695   return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO].unmap;
27132696}
27142697static READ64_HANDLER( mrh64_unmap_io )
27152698{
2716   if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O qword read from %08X & %08X%08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO], offset*8), (int)(mem_mask >> 32) ^ 0xffffffff, (int)(mem_mask & 0xffffffff) ^ 0xffffffff);
2699   if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O qword read from %08X & %08X%08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO], offset*8), (int)(mem_mask >> 32), (int)(mem_mask & 0xffffffff));
27172700   return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO].unmap;
27182701}
27192702
r2454r2455
27232706}
27242707static WRITE16_HANDLER( mwh16_unmap_io )
27252708{
2726   if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O word write to %08X = %04X & %04X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO], offset*2), data, mem_mask ^ 0xffff);
2709   if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O word write to %08X = %04X & %04X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO], offset*2), data, mem_mask);
27272710}
27282711static WRITE32_HANDLER( mwh32_unmap_io )
27292712{
2730   if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O dword write to %08X = %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO], offset*4), data, mem_mask ^ 0xffffffff);
2713   if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O dword write to %08X = %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO], offset*4), data, mem_mask);
27312714}
27322715static WRITE64_HANDLER( mwh64_unmap_io )
27332716{
2734   if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O qword write to %08X = %08X%08X & %08X%08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO], offset*8), (int)(data >> 32), (int)(data & 0xffffffff), (int)(mem_mask >> 32) ^ 0xffffffff, (int)(mem_mask & 0xffffffff) ^ 0xffffffff);
2717   if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O qword write to %08X = %08X%08X & %08X%08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO], offset*8), (int)(data >> 32), (int)(data & 0xffffffff), (int)(mem_mask >> 32), (int)(mem_mask & 0xffffffff));
27352718}
27362719
27372720
r2454r2455
30323015   while (subunits-- != 0)
30333016   {
30343017      int shift = *subshift++;
3035      if ((UINT8)(mem_mask >> shift) != 0xff)
3018      if ((UINT8)(mem_mask >> shift) != 0)
30363019         result |= (*handler->subhandler.read.mhandler8)(handler->subobject, offset) << shift;
30373020      offset++;
30383021   }
r2454r2455
30563039   while (subunits-- != 0)
30573040   {
30583041      int shift = *subshift++;
3059      if ((UINT8)(mem_mask >> shift) != 0xff)
3042      if ((UINT8)(mem_mask >> shift) != 0)
30603043         result |= (*handler->subhandler.read.mhandler8)(handler->subobject, offset) << shift;
30613044      offset++;
30623045   }
r2454r2455
30803063   while (subunits-- != 0)
30813064   {
30823065      int shift = *subshift++;
3083      if ((UINT8)(mem_mask >> shift) != 0xff)
3066      if ((UINT8)(mem_mask >> shift) != 0)
30843067         result |= (UINT64)(*handler->subhandler.read.mhandler8)(handler->subobject, offset) << shift;
30853068      offset++;
30863069   }
r2454r2455
31043087   while (subunits-- != 0)
31053088   {
31063089      int shift = *subshift++;
3107      if ((UINT16)(mem_mask >> shift) != 0xffff)
3090      if ((UINT16)(mem_mask >> shift) != 0)
31083091         result |= (*handler->subhandler.read.mhandler16)(handler->subobject, offset, mem_mask >> shift) << shift;
31093092      offset++;
31103093   }
r2454r2455
31283111   while (subunits-- != 0)
31293112   {
31303113      int shift = *subshift++;
3131      if ((UINT16)(mem_mask >> shift) != 0xffff)
3114      if ((UINT16)(mem_mask >> shift) != 0)
31323115         result |= (UINT64)(*handler->subhandler.read.mhandler16)(handler->subobject, offset, mem_mask >> shift) << shift;
31333116      offset++;
31343117   }
r2454r2455
31523135   while (subunits-- != 0)
31533136   {
31543137      int shift = *subshift++;
3155      if ((UINT32)(mem_mask >> shift) != 0xffffffff)
3138      if ((UINT32)(mem_mask >> shift) != 0)
31563139         result |= (UINT64)(*handler->subhandler.read.mhandler32)(handler->subobject, offset, mem_mask >> shift) << shift;
31573140      offset++;
31583141   }
r2454r2455
31803163   while (subunits-- != 0)
31813164   {
31823165      int shift = *subshift++;
3183      if ((UINT8)(mem_mask >> shift) != 0xff)
3166      if ((UINT8)(mem_mask >> shift) != 0)
31843167         (*handler->subhandler.write.mhandler8)(handler->subobject, offset, data >> shift);
31853168      offset++;
31863169   }
r2454r2455
32243207   while (subunits-- != 0)
32253208   {
32263209      int shift = *subshift++;
3227      if ((UINT8)(mem_mask >> shift) != 0xff)
3210      if ((UINT8)(mem_mask >> shift) != 0)
32283211         (*handler->subhandler.write.mhandler8)(handler->subobject, offset, data >> shift);
32293212      offset++;
32303213   }
r2454r2455
32463229   while (subunits-- != 0)
32473230   {
32483231      int shift = *subshift++;
3249      if ((UINT16)(mem_mask >> shift) != 0xffff)
3232      if ((UINT16)(mem_mask >> shift) != 0)
32503233         (*handler->subhandler.write.mhandler16)(handler->subobject, offset, data >> shift, mem_mask >> shift);
32513234      offset++;
32523235   }
r2454r2455
32683251   while (subunits-- != 0)
32693252   {
32703253      int shift = *subshift++;
3271      if ((UINT16)(mem_mask >> shift) != 0xffff)
3254      if ((UINT16)(mem_mask >> shift) != 0)
32723255         (*handler->subhandler.write.mhandler16)(handler->subobject, offset, data >> shift, mem_mask >> shift);
32733256      offset++;
32743257   }
r2454r2455
32903273   while (subunits-- != 0)
32913274   {
32923275      int shift = *subshift++;
3293      if ((UINT32)(mem_mask >> shift) != 0xffffffff)
3276      if ((UINT32)(mem_mask >> shift) != 0)
32943277         (*handler->subhandler.write.mhandler32)(handler->subobject, offset, data >> shift, mem_mask >> shift);
32953278      offset++;
32963279   }
r2454r2455
34633446   return result | (program_read_byte_8le(address + 1) << 8);
34643447}
34653448
3449UINT16 program_read_word_masked_8le(offs_t address, UINT16 mask)
3450{
3451   UINT16 result = 0;
3452   if (mask & 0x00ff) result |= program_read_byte_8le(address + 0) << 0;
3453   if (mask & 0xff00) result |= program_read_byte_8le(address + 1) << 8;
3454   return result;
3455}
3456
34663457UINT16 program_read_word_8be(offs_t address)
34673458{
34683459   UINT16 result = program_read_byte_8be(address + 0) << 8;
34693460   return result | (program_read_byte_8be(address + 1) << 0);
34703461}
34713462
3463UINT16 program_read_word_masked_8be(offs_t address, UINT16 mask)
3464{
3465   UINT16 result = 0;
3466   if (mask & 0xff00) result |= program_read_byte_8be(address + 0) << 8;
3467   if (mask & 0x00ff) result |= program_read_byte_8be(address + 1) << 0;
3468   return result;
3469}
3470
34723471UINT32 program_read_dword_8le(offs_t address)
34733472{
34743473   UINT32 result = program_read_word_8le(address + 0) << 0;
34753474   return result | (program_read_word_8le(address + 2) << 16);
34763475}
34773476
3477UINT32 program_read_dword_masked_8le(offs_t address, UINT32 mask)
3478{
3479   UINT32 result = 0;
3480   if (mask & 0x0000ffff) result |= program_read_word_masked_8le(address + 0, mask >> 0) << 0;
3481   if (mask & 0xffff0000) result |= program_read_word_masked_8le(address + 2, mask >> 16) << 16;
3482   return result;
3483}
3484
34783485UINT32 program_read_dword_8be(offs_t address)
34793486{
34803487   UINT32 result = program_read_word_8be(address + 0) << 16;
34813488   return result | (program_read_word_8be(address + 2) << 0);
34823489}
34833490
3491UINT32 program_read_dword_masked_8be(offs_t address, UINT32 mask)
3492{
3493   UINT32 result = 0;
3494   if (mask & 0xffff0000) result |= program_read_word_masked_8be(address + 0, mask >> 16) << 16;
3495   if (mask & 0x0000ffff) result |= program_read_word_masked_8be(address + 2, mask >> 0) << 0;
3496   return result;
3497}
3498
34843499UINT64 program_read_qword_8le(offs_t address)
34853500{
34863501   UINT64 result = (UINT64)program_read_dword_8le(address + 0) << 0;
34873502   return result | ((UINT64)program_read_dword_8le(address + 4) << 32);
34883503}
34893504
3505UINT64 program_read_qword_masked_8le(offs_t address, UINT64 mask)
3506{
3507   UINT64 result = 0;
3508   if (mask & U64(0x00000000ffffffff)) result |= (UINT64)program_read_dword_masked_8le(address + 0, mask >> 0) << 0;
3509   if (mask & U64(0xffffffff00000000)) result |= (UINT64)program_read_dword_masked_8le(address + 4, mask >> 32) << 32;
3510   return result;
3511}
3512
34903513UINT64 program_read_qword_8be(offs_t address)
34913514{
34923515   UINT64 result = (UINT64)program_read_dword_8le(address + 0) << 32;
34933516   return result | ((UINT64)program_read_dword_8le(address + 4) << 0);
34943517}
34953518
3519UINT64 program_read_qword_masked_8be(offs_t address, UINT64 mask)
3520{
3521   UINT64 result = 0;
3522   if (mask & U64(0xffffffff00000000)) result |= (UINT64)program_read_dword_masked_8be(address + 0, mask >> 32) << 32;
3523   if (mask & U64(0x00000000ffffffff)) result |= (UINT64)program_read_dword_masked_8be(address + 4, mask >> 0) << 0;
3524   return result;
3525}
34963526
3527
34973528/*-------------------------------------------------
34983529    ADDRESS_SPACE_DATA
34993530-------------------------------------------------*/
r2454r2455
35143545   return result | (data_read_byte_8le(address + 1) << 8);
35153546}
35163547
3548UINT16 data_read_word_masked_8le(offs_t address, UINT16 mask)
3549{
3550   UINT16 result = 0;
3551   if (mask & 0x00ff) result |= data_read_byte_8le(address + 0) << 0;
3552   if (mask & 0xff00) result |= data_read_byte_8le(address + 1) << 8;
3553   return result;
3554}
3555
35173556UINT16 data_read_word_8be(offs_t address)
35183557{
35193558   UINT16 result = data_read_byte_8be(address + 0) << 8;
35203559   return result | (data_read_byte_8be(address + 1) << 0);
35213560}
35223561
3562UINT16 data_read_word_masked_8be(offs_t address, UINT16 mask)
3563{
3564   UINT16 result = 0;
3565   if (mask & 0xff00) result |= data_read_byte_8be(address + 0) << 8;
3566   if (mask & 0x00ff) result |= data_read_byte_8be(address + 1) << 0;
3567   return result;
3568}
3569
35233570UINT32 data_read_dword_8le(offs_t address)
35243571{
35253572   UINT32 result = data_read_word_8le(address + 0) << 0;
35263573   return result | (data_read_word_8le(address + 2) << 16);
35273574}
35283575
3576UINT32 data_read_dword_masked_8le(offs_t address, UINT32 mask)
3577{
3578   UINT32 result = 0;
3579   if (mask & 0x0000ffff) result |= data_read_word_masked_8le(address + 0, mask >> 0) << 0;
3580   if (mask & 0xffff0000) result |= data_read_word_masked_8le(address + 2, mask >> 16) << 16;
3581   return result;
3582}
3583
35293584UINT32 data_read_dword_8be(offs_t address)
35303585{
35313586   UINT32 result = data_read_word_8be(address + 0) << 16;
35323587   return result | (data_read_word_8be(address + 2) << 0);
35333588}
35343589
3590UINT32 data_read_dword_masked_8be(offs_t address, UINT32 mask)
3591{
3592   UINT32 result = 0;
3593   if (mask & 0xffff0000) result |= data_read_word_masked_8be(address + 0, mask >> 16) << 16;
3594   if (mask & 0x0000ffff) result |= data_read_word_masked_8be(address + 2, mask >> 0) << 0;
3595   return result;
3596}
3597
35353598UINT64 data_read_qword_8le(offs_t address)
35363599{
35373600   UINT64 result = (UINT64)data_read_dword_8le(address + 0) << 0;
35383601   return result | ((UINT64)data_read_dword_8le(address + 4) << 32);
35393602}
35403603
3604UINT64 data_read_qword_masked_8le(offs_t address, UINT64 mask)
3605{
3606   UINT64 result = 0;
3607   if (mask & U64(0x00000000ffffffff)) result |= (UINT64)data_read_dword_masked_8le(address + 0, mask >> 0) << 0;
3608   if (mask & U64(0xffffffff00000000)) result |= (UINT64)data_read_dword_masked_8le(address + 4, mask >> 32) << 32;
3609   return result;
3610}
3611
35413612UINT64 data_read_qword_8be(offs_t address)
35423613{
35433614   UINT64 result = (UINT64)data_read_dword_8le(address + 0) << 32;
35443615   return result | ((UINT64)data_read_dword_8le(address + 4) << 0);
35453616}
35463617
3618UINT64 data_read_qword_masked_8be(offs_t address, UINT64 mask)
3619{
3620   UINT64 result = 0;
3621   if (mask & U64(0xffffffff00000000)) result |= (UINT64)data_read_dword_masked_8be(address + 0, mask >> 32) << 32;
3622   if (mask & U64(0x00000000ffffffff)) result |= (UINT64)data_read_dword_masked_8be(address + 4, mask >> 0) << 0;
3623   return result;
3624}
35473625
3626
35483627/*-------------------------------------------------
35493628    ADDRESS_SPACE_IO
35503629-------------------------------------------------*/
r2454r2455
35653644   return result | (io_read_byte_8le(address + 1) << 8);
35663645}
35673646
3647UINT16 io_read_word_masked_8le(offs_t address, UINT16 mask)
3648{
3649   UINT16 result = 0;
3650   if (mask & 0x00ff) result |= io_read_byte_8le(address + 0) << 0;
3651   if (mask & 0xff00) result |= io_read_byte_8le(address + 1) << 8;
3652   return result;
3653}
3654
35683655UINT16 io_read_word_8be(offs_t address)
35693656{
35703657   UINT16 result = io_read_byte_8be(address + 0) << 8;
35713658   return result | (io_read_byte_8be(address + 1) << 0);
35723659}
35733660
3661UINT16 io_read_word_masked_8be(offs_t address, UINT16 mask)
3662{
3663   UINT16 result = 0;
3664   if (mask & 0xff00) result |= io_read_byte_8be(address + 0) << 8;
3665   if (mask & 0x00ff) result |= io_read_byte_8be(address + 1) << 0;
3666   return result;
3667}
3668
35743669UINT32 io_read_dword_8le(offs_t address)
35753670{
35763671   UINT32 result = io_read_word_8le(address + 0) << 0;
35773672   return result | (io_read_word_8le(address + 2) << 16);
35783673}
35793674
3675UINT32 io_read_dword_masked_8le(offs_t address, UINT32 mask)
3676{
3677   UINT32 result = 0;
3678   if (mask & 0x0000ffff) result |= io_read_word_masked_8le(address + 0, mask >> 0) << 0;
3679   if (mask & 0xffff0000) result |= io_read_word_masked_8le(address + 2, mask >> 16) << 16;
3680   return result;
3681}
3682
35803683UINT32 io_read_dword_8be(offs_t address)
35813684{
35823685   UINT32 result = io_read_word_8be(address + 0) << 16;
35833686   return result | (io_read_word_8be(address + 2) << 0);
35843687}
35853688
3689UINT32 io_read_dword_masked_8be(offs_t address, UINT32 mask)
3690{
3691   UINT32 result = 0;
3692   if (mask & 0xffff0000) result |= io_read_word_masked_8be(address + 0, mask >> 16) << 16;
3693   if (mask & 0x0000ffff) result |= io_read_word_masked_8be(address + 2, mask >> 0) << 0;
3694   return result;
3695}
3696
35863697UINT64 io_read_qword_8le(offs_t address)
35873698{
35883699   UINT64 result = (UINT64)io_read_dword_8le(address + 0) << 0;
35893700   return result | ((UINT64)io_read_dword_8le(address + 4) << 32);
35903701}
35913702
3703UINT64 io_read_qword_masked_8le(offs_t address, UINT64 mask)
3704{
3705   UINT64 result = 0;
3706   if (mask & U64(0x00000000ffffffff)) result |= (UINT64)io_read_dword_masked_8le(address + 0, mask >> 0) << 0;
3707   if (mask & U64(0xffffffff00000000)) result |= (UINT64)io_read_dword_masked_8le(address + 4, mask >> 32) << 32;
3708   return result;
3709}
3710
35923711UINT64 io_read_qword_8be(offs_t address)
35933712{
35943713   UINT64 result = (UINT64)io_read_dword_8le(address + 0) << 32;
35953714   return result | ((UINT64)io_read_dword_8le(address + 4) << 0);
35963715}
35973716
3717UINT64 io_read_qword_masked_8be(offs_t address, UINT64 mask)
3718{
3719   UINT64 result = 0;
3720   if (mask & U64(0xffffffff00000000)) result |= (UINT64)io_read_dword_masked_8be(address + 0, mask >> 32) << 32;
3721   if (mask & U64(0x00000000ffffffff)) result |= (UINT64)io_read_dword_masked_8be(address + 4, mask >> 0) << 0;
3722   return result;
3723}
35983724
35993725
3726
36003727/***************************************************************************
36013728    8-BIT WRITE HANDLERS
36023729***************************************************************************/
r2454r2455
36513778   program_write_byte_8le(address + 1, data >> 8);
36523779}
36533780
3781void program_write_word_masked_8le(offs_t address, UINT16 data, UINT16 mask)
3782{
3783   if (mask & 0x00ff) program_write_byte_8le(address + 0, data >> 0);
3784   if (mask & 0xff00) program_write_byte_8le(address + 1, data >> 8);
3785}
3786
36543787void program_write_word_8be(offs_t address, UINT16 data)
36553788{
36563789   program_write_byte_8be(address + 0, data >> 8);
36573790   program_write_byte_8be(address + 1, data >> 0);
36583791}
36593792
3793void program_write_word_masked_8be(offs_t address, UINT16 data, UINT16 mask)
3794{
3795   if (mask & 0xff00) program_write_byte_8be(address + 0, data >> 8);
3796   if (mask & 0x00ff) program_write_byte_8be(address + 1, data >> 0);
3797}
3798
36603799void program_write_dword_8le(offs_t address, UINT32 data)
36613800{
36623801   program_write_word_8le(address + 0, data >> 0);
36633802   program_write_word_8le(address + 2, data >> 16);
36643803}
36653804
3805void program_write_dword_masked_8le(offs_t address, UINT32 data, UINT32 mask)
3806{
3807   if (mask & 0x0000ffff) program_write_word_masked_8le(address + 0, data >> 0, mask >> 0);
3808   if (mask & 0xffff0000) program_write_word_masked_8le(address + 2, data >> 16, mask >> 16);
3809}
3810
36663811void program_write_dword_8be(offs_t address, UINT32 data)
36673812{
36683813   program_write_word_8be(address + 0, data >> 16);
36693814   program_write_word_8be(address + 2, data >> 0);
36703815}
36713816
3817void program_write_dword_masked_8be(offs_t address, UINT32 data, UINT32 mask)
3818{
3819   if (mask & 0xffff0000) program_write_word_masked_8be(address + 0, data >> 16, mask >> 16);
3820   if (mask & 0x0000ffff) program_write_word_masked_8be(address + 2, data >> 0, mask >> 0);
3821}
3822
36723823void program_write_qword_8le(offs_t address, UINT64 data)
36733824{
36743825   program_write_dword_8le(address + 0, data >> 0);
36753826   program_write_dword_8le(address + 4, data >> 32);
36763827}
36773828
3829void program_write_qword_masked_8le(offs_t address, UINT64 data, UINT64 mask)
3830{
3831   if (mask & U64(0x00000000ffffffff)) program_write_dword_masked_8le(address + 0, data >> 0, mask >> 0);
3832   if (mask & U64(0xffffffff00000000)) program_write_dword_masked_8le(address + 4, data >> 32, mask >> 32);
3833}
3834
36783835void program_write_qword_8be(offs_t address, UINT64 data)
36793836{
36803837   program_write_dword_8be(address + 0, data >> 32);
36813838   program_write_dword_8be(address + 4, data >> 0);
36823839}
36833840
3841void program_write_qword_masked_8be(offs_t address, UINT64 data, UINT64 mask)
3842{
3843   if (mask & U64(0xffffffff00000000)) program_write_dword_masked_8be(address + 0, data >> 32, mask >> 32);
3844   if (mask & U64(0x00000000ffffffff)) program_write_dword_masked_8be(address + 4, data >> 0, mask >> 0);
3845}
36843846
3847
36853848/*-------------------------------------------------
36863849    ADDRESS_SPACE_DATA
36873850-------------------------------------------------*/
r2454r2455
37023865   data_write_byte_8le(address + 1, data >> 8);
37033866}
37043867
3868void data_write_word_masked_8le(offs_t address, UINT16 data, UINT16 mask)
3869{
3870   if (mask & 0x00ff) data_write_byte_8le(address + 0, data >> 0);
3871   if (mask & 0xff00) data_write_byte_8le(address + 1, data >> 8);
3872}
3873
37053874void data_write_word_8be(offs_t address, UINT16 data)
37063875{
37073876   data_write_byte_8be(address + 0, data >> 8);
37083877   data_write_byte_8be(address + 1, data >> 0);
37093878}
37103879
3880void data_write_word_masked_8be(offs_t address, UINT16 data, UINT16 mask)
3881{
3882   if (mask & 0xff00) data_write_byte_8be(address + 0, data >> 8);
3883   if (mask & 0x00ff) data_write_byte_8be(address + 1, data >> 0);
3884}
3885
37113886void data_write_dword_8le(offs_t address, UINT32 data)
37123887{
37133888   data_write_word_8le(address + 0, data >> 0);
37143889   data_write_word_8le(address + 2, data >> 16);
37153890}
37163891
3892void data_write_dword_masked_8le(offs_t address, UINT32 data, UINT32 mask)
3893{
3894   if (mask & 0x0000ffff) data_write_word_masked_8le(address + 0, data >> 0, mask >> 0);
3895   if (mask & 0xffff0000) data_write_word_masked_8le(address + 2, data >> 16, mask >> 16);
3896}
3897
37173898void data_write_dword_8be(offs_t address, UINT32 data)
37183899{
37193900   data_write_word_8be(address + 0, data >> 16);
37203901   data_write_word_8be(address + 2, data >> 0);
37213902}
37223903
3904void data_write_dword_masked_8be(offs_t address, UINT32 data, UINT32 mask)
3905{
3906   if (mask & 0xffff0000) data_write_word_masked_8be(address + 0, data >> 16, mask >> 16);
3907   if (mask & 0x0000ffff) data_write_word_masked_8be(address + 2, data >> 0, mask >> 0);
3908}
3909
37233910void data_write_qword_8le(offs_t address, UINT64 data)
37243911{
37253912   data_write_dword_8le(address + 0, data >> 0);
37263913   data_write_dword_8le(address + 4, data >> 32);
37273914}
37283915
3916void data_write_qword_masked_8le(offs_t address, UINT64 data, UINT64 mask)
3917{
3918   if (mask & U64(0x00000000ffffffff)) data_write_dword_masked_8le(address + 0, data >> 0, mask >> 0);
3919   if (mask & U64(0xffffffff00000000)) data_write_dword_masked_8le(address + 4, data >> 32, mask >> 32);
3920}
3921
37293922void data_write_qword_8be(offs_t address, UINT64 data)
37303923{
37313924   data_write_dword_8be(address + 0, data >> 32);
37323925   data_write_dword_8be(address + 4, data >> 0);
37333926}
37343927
3928void data_write_qword_masked_8be(offs_t address, UINT64 data, UINT64 mask)
3929{
3930   if (mask & U64(0xffffffff00000000)) data_write_dword_masked_8be(address + 0, data >> 32, mask >> 32);
3931   if (mask & U64(0x00000000ffffffff)) data_write_dword_masked_8be(address + 4, data >> 0, mask >> 0);
3932}
37353933
3934
37363935/*-------------------------------------------------
37373936    ADDRESS_SPACE_IO
37383937-------------------------------------------------*/
r2454r2455
37533952   io_write_byte_8le(address + 1, data >> 8);
37543953}
37553954
3955void io_write_word_masked_8le(offs_t address, UINT16 data, UINT16 mask)
3956{
3957   if (mask & 0x00ff) io_write_byte_8le(address + 0, data >> 0);
3958   if (mask & 0xff00) io_write_byte_8le(address + 1, data >> 8);
3959}
3960
37563961void io_write_word_8be(offs_t address, UINT16 data)
37573962{
37583963   io_write_byte_8be(address + 0, data >> 8);
37593964   io_write_byte_8be(address + 1, data >> 0);
37603965}
37613966
3967void io_write_word_masked_8be(offs_t address, UINT16 data, UINT16 mask)
3968{
3969   if (mask & 0xff00) io_write_byte_8be(address + 0, data >> 8);
3970   if (mask & 0x00ff) io_write_byte_8be(address + 1, data >> 0);
3971}
3972
37623973void io_write_dword_8le(offs_t address, UINT32 data)
37633974{
37643975   io_write_word_8le(address + 0, data >> 0);
37653976   io_write_word_8le(address + 2, data >> 16);
37663977}
37673978
3979void io_write_dword_masked_8le(offs_t address, UINT32 data, UINT32 mask)
3980{
3981   if (mask & 0x0000ffff) io_write_word_masked_8le(address + 0, data >> 0, mask >> 0);
3982   if (mask & 0xffff0000) io_write_word_masked_8le(address + 2, data >> 16, mask >> 16);
3983}
3984
37683985void io_write_dword_8be(offs_t address, UINT32 data)
37693986{
37703987   io_write_word_8be(address + 0, data >> 16);
37713988   io_write_word_8be(address + 2, data >> 0);
37723989}
37733990
3991void io_write_dword_masked_8be(offs_t address, UINT32 data, UINT32 mask)
3992{
3993   if (mask & 0xffff0000) io_write_word_masked_8be(address + 0, data >> 16, mask >> 16);
3994   if (mask & 0x0000ffff) io_write_word_masked_8be(address + 2, data >> 0, mask >> 0);
3995}
3996
37743997void io_write_qword_8le(offs_t address, UINT64 data)
37753998{
37763999   io_write_dword_8le(address + 0, data >> 0);
37774000   io_write_dword_8le(address + 4, data >> 32);
37784001}
37794002
4003void io_write_qword_masked_8le(offs_t address, UINT64 data, UINT64 mask)
4004{
4005   if (mask & U64(0x00000000ffffffff)) io_write_dword_masked_8le(address + 0, data >> 0, mask >> 0);
4006   if (mask & U64(0xffffffff00000000)) io_write_dword_masked_8le(address + 4, data >> 32, mask >> 32);
4007}
4008
37804009void io_write_qword_8be(offs_t address, UINT64 data)
37814010{
37824011   io_write_dword_8be(address + 0, data >> 32);
37834012   io_write_dword_8be(address + 4, data >> 0);
37844013}
37854014
4015void io_write_qword_masked_8be(offs_t address, UINT64 data, UINT64 mask)
4016{
4017   if (mask & U64(0xffffffff00000000)) io_write_dword_masked_8be(address + 0, data >> 32, mask >> 32);
4018   if (mask & U64(0x00000000ffffffff)) io_write_dword_masked_8be(address + 4, data >> 0, mask >> 0);
4019}
37864020
37874021
4022
37884023/***************************************************************************
37894024    16-BIT READ HANDLERS
37904025***************************************************************************/
r2454r2455
38084043   entry = lookup_read_entry(space, address);
38094044   handler = &space->readhandlers[entry];
38104045
3811   DEBUG_HOOK_READ(spacenum, address & ~1, (UINT16)~mem_mask);
4046   DEBUG_HOOK_READ(spacenum, address & ~1, mem_mask);
38124047
38134048   offset = (address - handler->bytestart) & handler->bytemask;
38144049   if (entry < STATIC_RAM)
r2454r2455
38294064UINT8 program_read_byte_16le(offs_t address)
38304065{
38314066   UINT32 shift = (address & 1) * 8;
3832   return read_word_masked_generic(ADDRESS_SPACE_PROGRAM, address, ~(0xff << shift)) >> shift;
4067   return read_word_masked_generic(ADDRESS_SPACE_PROGRAM, address, 0xff << shift) >> shift;
38334068}
38344069
38354070UINT8 program_read_byte_16be(offs_t address)
38364071{
38374072   UINT32 shift = (~address & 1) * 8;
3838   return read_word_masked_generic(ADDRESS_SPACE_PROGRAM, address, ~(0xff << shift)) >> shift;
4073   return read_word_masked_generic(ADDRESS_SPACE_PROGRAM, address, 0xff << shift) >> shift;
38394074}
38404075
38414076UINT16 program_read_word_16le(offs_t address)
38424077{
3843   return read_word_masked_generic(ADDRESS_SPACE_PROGRAM, address, 0);
4078   return read_word_masked_generic(ADDRESS_SPACE_PROGRAM, address, 0xffff);
38444079}
38454080
4081UINT16 program_read_word_masked_16le(offs_t address, UINT16 mask)
4082{
4083   return read_word_masked_generic(ADDRESS_SPACE_PROGRAM, address, mask);
4084}
4085
38464086UINT16 program_read_word_16be(offs_t address)
38474087{
3848   return read_word_masked_generic(ADDRESS_SPACE_PROGRAM, address, 0);
4088   return read_word_masked_generic(ADDRESS_SPACE_PROGRAM, address, 0xffff);
38494089}
38504090
4091UINT16 program_read_word_masked_16be(offs_t address, UINT16 mask)
4092{
4093   return read_word_masked_generic(ADDRESS_SPACE_PROGRAM, address, mask);
4094}
4095
38514096UINT32 program_read_dword_16le(offs_t address)
38524097{
38534098   UINT32 result = program_read_word_16le(address + 0) << 0;
38544099   return result | (program_read_word_16le(address + 2) << 16);
38554100}
38564101
4102UINT32 program_read_dword_masked_16le(offs_t address, UINT32 mask)
4103{
4104   UINT32 result = 0;
4105   if (mask & 0x0000ffff) result |= program_read_word_masked_16le(address + 0, mask >> 0) << 0;
4106   if (mask & 0xffff0000) result |= program_read_word_masked_16le(address + 2, mask >> 16) << 16;
4107   return result;
4108}
4109
38574110UINT32 program_read_dword_16be(offs_t address)
38584111{
38594112   UINT32 result = program_read_word_16be(address + 0) << 16;
38604113   return result | (program_read_word_16be(address + 2) << 0);
38614114}
38624115
4116UINT32 program_read_dword_masked_16be(offs_t address, UINT32 mask)
4117{
4118   UINT32 result = 0;
4119   if (mask & 0xffff0000) result |= program_read_word_masked_16be(address + 0, mask >> 16) << 16;
4120   if (mask & 0x0000ffff) result |= program_read_word_masked_16be(address + 2, mask >> 0) << 0;
4121   return result;
4122}
4123
38634124UINT64 program_read_qword_16le(offs_t address)
38644125{
38654126   UINT64 result = (UINT64)program_read_dword_16le(address + 0) << 0;
38664127   return result | ((UINT64)program_read_dword_16le(address + 4) << 32);
38674128}
38684129
4130UINT64 program_read_qword_masked_16le(offs_t address, UINT64 mask)
4131{
4132   UINT64 result = 0;
4133   if (mask & U64(0x00000000ffffffff)) result |= (UINT64)program_read_dword_masked_16le(address + 0, mask >> 0) << 0;
4134   if (mask & U64(0xffffffff00000000)) result |= (UINT64)program_read_dword_masked_16le(address + 4, mask >> 32) << 32;
4135   return result;
4136}
4137
38694138UINT64 program_read_qword_16be(offs_t address)
38704139{
38714140   UINT64 result = (UINT64)program_read_dword_16le(address + 0) << 32;
38724141   return result | ((UINT64)program_read_dword_16le(address + 4) << 0);
38734142}
38744143
4144UINT64 program_read_qword_masked_16be(offs_t address, UINT64 mask)
4145{
4146   UINT64 result = 0;
4147   if (mask & U64(0xffffffff00000000)) result |= (UINT64)program_read_dword_masked_16be(address + 0, mask >> 32) << 32;
4148   if (mask & U64(0x00000000ffffffff)) result |= (UINT64)program_read_dword_masked_16be(address + 4, mask >> 0) << 0;
4149   return result;
4150}
38754151
4152
38764153/*-------------------------------------------------
38774154    ADDRESS_SPACE_DATA
38784155-------------------------------------------------*/
r2454r2455
38804157UINT8 data_read_byte_16le(offs_t address)
38814158{
38824159   UINT32 shift = (address & 1) * 8;
3883   return read_word_masked_generic(ADDRESS_SPACE_DATA, address, ~(0xff << shift)) >> shift;
4160   return read_word_masked_generic(ADDRESS_SPACE_DATA, address, 0xff << shift) >> shift;
38844161}
38854162
38864163UINT8 data_read_byte_16be(offs_t address)
38874164{
38884165   UINT32 shift = (~address & 1) * 8;
3889   return read_word_masked_generic(ADDRESS_SPACE_DATA, address, ~(0xff << shift)) >> shift;
4166   return read_word_masked_generic(ADDRESS_SPACE_DATA, address, 0xff << shift) >> shift;
38904167}
38914168
38924169UINT16 data_read_word_16le(offs_t address)
38934170{
3894   return read_word_masked_generic(ADDRESS_SPACE_DATA, address, 0);
4171   return read_word_masked_generic(ADDRESS_SPACE_DATA, address, 0xffff);
38954172}
38964173
4174UINT16 data_read_word_masked_16le(offs_t address, UINT16 mask)
4175{
4176   return read_word_masked_generic(ADDRESS_SPACE_DATA, address, mask);
4177}
4178
38974179UINT16 data_read_word_16be(offs_t address)
38984180{
3899   return read_word_masked_generic(ADDRESS_SPACE_DATA, address, 0);
4181   return read_word_masked_generic(ADDRESS_SPACE_DATA, address, 0xffff);
39004182}
39014183
4184UINT16 data_read_word_masked_16be(offs_t address, UINT16 mask)
4185{
4186   return read_word_masked_generic(ADDRESS_SPACE_DATA, address, mask);
4187}
4188
39024189UINT32 data_read_dword_16le(offs_t address)
39034190{
39044191   UINT32 result = data_read_word_16le(address + 0) << 0;
39054192   return result | (data_read_word_16le(address + 2) << 16);
39064193}
39074194
4195UINT32 data_read_dword_masked_16le(offs_t address, UINT32 mask)
4196{
4197   UINT32 result = 0;
4198   if (mask & 0x0000ffff) result |= data_read_word_masked_16le(address + 0, mask >> 0) << 0;
4199   if (mask & 0xffff0000) result |= data_read_word_masked_16le(address + 2, mask >> 16) << 16;
4200   return result;
4201}
4202
39084203UINT32 data_read_dword_16be(offs_t address)
39094204{
39104205   UINT32 result = data_read_word_16be(address + 0) << 16;
39114206   return result | (data_read_word_16be(address + 2) << 0);
39124207}
39134208
4209UINT32 data_read_dword_masked_16be(offs_t address, UINT32 mask)
4210{
4211   UINT32 result = 0;
4212   if (mask & 0xffff0000) result |= data_read_word_masked_16be(address + 0, mask >> 16) << 16;
4213   if (mask & 0x0000ffff) result |= data_read_word_masked_16be(address + 2, mask >> 0) << 0;
4214   return result;
4215}
4216
39144217UINT64 data_read_qword_16le(offs_t address)
39154218{
39164219   UINT64 result = (UINT64)data_read_dword_16le(address + 0) << 0;
39174220   return result | ((UINT64)data_read_dword_16le(address + 4) << 32);
39184221}
39194222
4223UINT64 data_read_qword_masked_16le(offs_t address, UINT64 mask)
4224{
4225   UINT64 result = 0;
4226   if (mask & U64(0x00000000ffffffff)) result |= (UINT64)data_read_dword_masked_16le(address + 0, mask >> 0) << 0;
4227   if (mask & U64(0xffffffff00000000)) result |= (UINT64)data_read_dword_masked_16le(address + 4, mask >> 32) << 32;
4228   return result;
4229}
4230
39204231UINT64 data_read_qword_16be(offs_t address)
39214232{
39224233   UINT64 result = (UINT64)data_read_dword_16le(address + 0) << 32;
39234234   return result | ((UINT64)data_read_dword_16le(address + 4) << 0);
39244235}
39254236
4237UINT64 data_read_qword_masked_16be(offs_t address, UINT64 mask)
4238{
4239   UINT64 result = 0;
4240   if (mask & U64(0xffffffff00000000)) result |= (UINT64)data_read_dword_masked_16be(address + 0, mask >> 32) << 32;
4241   if (mask & U64(0x00000000ffffffff)) result |= (UINT64)data_read_dword_masked_16be(address + 4, mask >> 0) << 0;
4242   return result;
4243}
39264244
4245
39274246/*-------------------------------------------------
39284247    ADDRESS_SPACE_IO
39294248-------------------------------------------------*/
r2454r2455
39314250UINT8 io_read_byte_16le(offs_t address)
39324251{
39334252   UINT32 shift = (address & 1) * 8;
3934   return read_word_masked_generic(ADDRESS_SPACE_IO, address, ~(0xff << shift)) >> shift;
4253   return read_word_masked_generic(ADDRESS_SPACE_IO, address, 0xff << shift) >> shift;
39354254}
39364255
39374256UINT8 io_read_byte_16be(offs_t address)
39384257{
39394258   UINT32 shift = (~address & 1) * 8;
3940   return read_word_masked_generic(ADDRESS_SPACE_IO, address, ~(0xff << shift)) >> shift;
4259   return read_word_masked_generic(ADDRESS_SPACE_IO, address, 0xff << shift) >> shift;
39414260}
39424261
39434262UINT16 io_read_word_16le(offs_t address)
39444263{
3945   return read_word_masked_generic(ADDRESS_SPACE_IO, address, 0);
4264   return read_word_masked_generic(ADDRESS_SPACE_IO, address, 0xffff);
39464265}
39474266
4267UINT16 io_read_word_masked_16le(offs_t address, UINT16 mask)
4268{
4269   return read_word_masked_generic(ADDRESS_SPACE_IO, address, mask);
4270}
4271
39484272UINT16 io_read_word_16be(offs_t address)
39494273{
3950   return read_word_masked_generic(ADDRESS_SPACE_IO, address, 0);
4274   return read_word_masked_generic(ADDRESS_SPACE_IO, address, 0xffff);
39514275}
39524276
4277UINT16 io_read_word_masked_16be(offs_t address, UINT16 mask)
4278{
4279   return read_word_masked_generic(ADDRESS_SPACE_IO, address, mask);
4280}
4281
39534282UINT32 io_read_dword_16le(offs_t address)
39544283{
39554284   UINT32 result = io_read_word_16le(address + 0) << 0;
39564285   return result | (io_read_word_16le(address + 2) << 16);
39574286}
39584287
4288UINT32 io_read_dword_masked_16le(offs_t address, UINT32 mask)
4289{
4290   UINT32 result = 0;
4291   if (mask & 0x0000ffff) result |= io_read_word_masked_16le(address + 0, mask >> 0) << 0;
4292   if (mask & 0xffff0000) result |= io_read_word_masked_16le(address + 2, mask >> 16) << 16;
4293   return result;
4294}
4295
39594296UINT32 io_read_dword_16be(offs_t address)
39604297{
39614298   UINT32 result = io_read_word_16be(address + 0) << 16;
39624299   return result | (io_read_word_16be(address + 2) << 0);
39634300}
39644301
4302UINT32 io_read_dword_masked_16be(offs_t address, UINT32 mask)
4303{
4304   UINT32 result = 0;
4305   if (mask & 0xffff0000) result |= io_read_word_masked_16be(address + 0, mask >> 16) << 16;
4306   if (mask & 0x0000ffff) result |= io_read_word_masked_16be(address + 2, mask >> 0) << 0;
4307   return result;
4308}
4309
39654310UINT64 io_read_qword_16le(offs_t address)
39664311{
39674312   UINT64 result = (UINT64)io_read_dword_16le(address + 0) << 0;
39684313   return result | ((UINT64)io_read_dword_16le(address + 4) << 32);
39694314}
39704315
4316UINT64 io_read_qword_masked_16le(offs_t address, UINT64 mask)
4317{
4318   UINT64 result = 0;
4319   if (mask & U64(0x00000000ffffffff)) result |= (UINT64)io_read_dword_masked_16le(address + 0, mask >> 0) << 0;
4320   if (mask & U64(0xffffffff00000000)) result |= (UINT64)io_read_dword_masked_16le(address + 4, mask >> 32) << 32;
4321   return result;
4322}
4323
39714324UINT64 io_read_qword_16be(offs_t address)
39724325{
39734326   UINT64 result = (UINT64)io_read_dword_16le(address + 0) << 32;
39744327   return result | ((UINT64)io_read_dword_16le(address + 4) << 0);
39754328}
39764329
4330UINT64 io_read_qword_masked_16be(offs_t address, UINT64 mask)
4331{
4332   UINT64 result = 0;
4333   if (mask & U64(0xffffffff00000000)) result |= (UINT64)io_read_dword_masked_16be(address + 0, mask >> 32) << 32;
4334   if (mask & U64(0x00000000ffffffff)) result |= (UINT64)io_read_dword_masked_16be(address + 4, mask >> 0) << 0;
4335   return result;
4336}
39774337
39784338
4339
39794340/***************************************************************************
39804341    16-BIT WRITE HANDLERS
39814342***************************************************************************/
r2454r2455
39984359   entry = lookup_write_entry(space, address);
39994360   handler = &space->writehandlers[entry];
40004361
4001   DEBUG_HOOK_WRITE(spacenum, address & ~1, data, (UINT16)~mem_mask);
4362   DEBUG_HOOK_WRITE(spacenum, address & ~1, data, mem_mask);
40024363
40034364   offset = (address - handler->bytestart) & handler->bytemask;
40044365   if (entry < STATIC_RAM)
40054366   {
40064367      UINT16 *dest = (UINT16 *)&bank_ptr[entry][offset & ~1];
4007      *dest = (*dest & mem_mask) | (data & ~mem_mask);
4368      *dest = (*dest & ~mem_mask) | (data & mem_mask);
40084369   }
40094370   else
40104371      (*handler->handler.write.mhandler16)(handler->object, offset >> 1, data, mem_mask);
r2454r2455
40204381void program_write_byte_16le(offs_t address, UINT8 data)
40214382{
40224383   UINT32 shift = (address & 1) * 8;
4023   write_word_masked_generic(ADDRESS_SPACE_PROGRAM, address, data << shift, ~(0xff << shift));
4384   write_word_masked_generic(ADDRESS_SPACE_PROGRAM, address, data << shift, 0xff << shift);
40244385}
40254386
40264387void program_write_byte_16be(offs_t address, UINT8 data)
40274388{
40284389   UINT32 shift = (~address & 1) * 8;
4029   write_word_masked_generic(ADDRESS_SPACE_PROGRAM, address, data << shift, ~(0xff << shift));
4390   write_word_masked_generic(ADDRESS_SPACE_PROGRAM, address, data << shift, 0xff << shift);
40304391}
40314392
40324393void program_write_word_16le(offs_t address, UINT16 data)
40334394{
4034   write_word_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, 0);
4395   write_word_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, 0xffff);
40354396}
40364397
4398void program_write_word_masked_16le(offs_t address, UINT16 data, UINT16 mask)
4399{
4400   write_word_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, mask);
4401}
4402
40374403void program_write_word_16be(offs_t address, UINT16 data)
40384404{
4039   write_word_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, 0);
4405   write_word_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, 0xffff);
40404406}
40414407
4408void program_write_word_masked_16be(offs_t address, UINT16 data, UINT16 mask)
4409{
4410   write_word_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, mask);
4411}
4412
40424413void program_write_dword_16le(offs_t address, UINT32 data)
40434414{
40444415   program_write_word_16le(address + 0, data >> 0);
40454416   program_write_word_16le(address + 2, data >> 16);
40464417}
40474418
4419void program_write_dword_masked_16le(offs_t address, UINT32 data, UINT32 mask)
4420{
4421   if (mask & 0x0000ffff) program_write_word_masked_16le(address + 0, data >> 0, mask >> 0);
4422   if (mask & 0xffff0000) program_write_word_masked_16le(address + 2, data >> 16, mask >> 16);
4423}
4424
40484425void program_write_dword_16be(offs_t address, UINT32 data)
40494426{
40504427   program_write_word_16be(address + 0, data >> 16);
40514428   program_write_word_16be(address + 2, data >> 0);
40524429}
40534430
4431void program_write_dword_masked_16be(offs_t address, UINT32 data, UINT32 mask)
4432{
4433   if (mask & 0xffff0000) program_write_word_masked_16be(address + 0, data >> 16, mask >> 16);
4434   if (mask & 0x0000ffff) program_write_word_masked_16be(address + 2, data >> 0, mask >> 0);
4435}
4436
40544437void program_write_qword_16le(offs_t address, UINT64 data)
40554438{
40564439   program_write_dword_16le(address + 0, data >> 0);
40574440   program_write_dword_16le(address + 4, data >> 32);
40584441}
40594442
4443void program_write_qword_masked_16le(offs_t address, UINT64 data, UINT64 mask)
4444{
4445   if (mask & U64(0x00000000ffffffff)) program_write_dword_masked_16le(address + 0, data >> 0, mask >> 0);
4446   if (mask & U64(0xffffffff00000000)) program_write_dword_masked_16le(address + 4, data >> 32, mask >> 32);
4447}
4448
40604449void program_write_qword_16be(offs_t address, UINT64 data)
40614450{
40624451   program_write_dword_16be(address + 0, data >> 32);
40634452   program_write_dword_16be(address + 4, data >> 0);
40644453}
40654454
4455void program_write_qword_masked_16be(offs_t address, UINT64 data, UINT64 mask)
4456{
4457   if (mask & U64(0xffffffff00000000)) program_write_dword_masked_16be(address + 0, data >> 32, mask >> 32);
4458   if (mask & U64(0x00000000ffffffff)) program_write_dword_masked_16be(address + 4, data >> 0, mask >> 0);
4459}
40664460
4461
40674462/*-------------------------------------------------
40684463    ADDRESS_SPACE_DATA
40694464-------------------------------------------------*/
r2454r2455
40714466void data_write_byte_16le(offs_t address, UINT8 data)
40724467{
40734468   UINT32 shift = (address & 1) * 8;
4074   write_word_masked_generic(ADDRESS_SPACE_DATA, address, data << shift, ~(0xff << shift));
4469   write_word_masked_generic(ADDRESS_SPACE_DATA, address, data << shift, 0xff << shift);
40754470}
40764471
40774472void data_write_byte_16be(offs_t address, UINT8 data)
40784473{
40794474   UINT32 shift = (~address & 1) * 8;
4080   write_word_masked_generic(ADDRESS_SPACE_DATA, address, data << shift, ~(0xff << shift));
4475   write_word_masked_generic(ADDRESS_SPACE_DATA, address, data << shift, 0xff << shift);
40814476}
40824477
40834478void data_write_word_16le(offs_t address, UINT16 data)
40844479{
4085   write_word_masked_generic(ADDRESS_SPACE_DATA, address, data, 0);
4480   write_word_masked_generic(ADDRESS_SPACE_DATA, address, data, 0xffff);
40864481}
40874482
4483void data_write_word_masked_16le(offs_t address, UINT16 data, UINT16 mask)
4484{
4485   write_word_masked_generic(ADDRESS_SPACE_DATA, address, data, mask);
4486}
4487
40884488void data_write_word_16be(offs_t address, UINT16 data)
40894489{
4090   write_word_masked_generic(ADDRESS_SPACE_DATA, address, data, 0);
4490   write_word_masked_generic(ADDRESS_SPACE_DATA, address, data, 0xffff);
40914491}
40924492
4493void data_write_word_masked_16be(offs_t address, UINT16 data, UINT16 mask)
4494{
4495   write_word_masked_generic(ADDRESS_SPACE_DATA, address, data, mask);
4496}
4497
40934498void data_write_dword_16le(offs_t address, UINT32 data)
40944499{
40954500   data_write_word_16le(address + 0, data >> 0);
40964501   data_write_word_16le(address + 2, data >> 16);
40974502}
40984503
4504void data_write_dword_masked_16le(offs_t address, UINT32 data, UINT32 mask)
4505{
4506   if (mask & 0x0000ffff) data_write_word_masked_16le(address + 0, data >> 0, mask >> 0);
4507   if (mask & 0xffff0000) data_write_word_masked_16le(address + 2, data >> 16, mask >> 16);
4508}
4509
40994510void data_write_dword_16be(offs_t address, UINT32 data)
41004511{
41014512   data_write_word_16be(address + 0, data >> 16);
41024513   data_write_word_16be(address + 2, data >> 0);
41034514}
41044515
4516void data_write_dword_masked_16be(offs_t address, UINT32 data, UINT32 mask)
4517{
4518   if (mask & 0xffff0000) data_write_word_masked_16be(address + 0, data >> 16, mask >> 16);
4519   if (mask & 0x0000ffff) data_write_word_masked_16be(address + 2, data >> 0, mask >> 0);
4520}
4521
41054522void data_write_qword_16le(offs_t address, UINT64 data)
41064523{
41074524   data_write_dword_16le(address + 0, data >> 0);
41084525   data_write_dword_16le(address + 4, data >> 32);
41094526}
41104527
4528void data_write_qword_masked_16le(offs_t address, UINT64 data, UINT64 mask)
4529{
4530   if (mask & U64(0x00000000ffffffff)) data_write_dword_masked_16le(address + 0, data >> 0, mask >> 0);
4531   if (mask & U64(0xffffffff00000000)) data_write_dword_masked_16le(address + 4, data >> 32, mask >> 32);
4532}
4533
41114534void data_write_qword_16be(offs_t address, UINT64 data)
41124535{
41134536   data_write_dword_16be(address + 0, data >> 32);
41144537   data_write_dword_16be(address + 4, data >> 0);
41154538}
41164539
4540void data_write_qword_masked_16be(offs_t address, UINT64 data, UINT64 mask)
4541{
4542   if (mask & U64(0xffffffff00000000)) data_write_dword_masked_16be(address + 0, data >> 32, mask >> 32);
4543   if (mask & U64(0x00000000ffffffff)) data_write_dword_masked_16be(address + 4, data >> 0, mask >> 0);
4544}
41174545
4546
41184547/*-------------------------------------------------
41194548    ADDRESS_SPACE_IO
41204549-------------------------------------------------*/
r2454r2455
41224551void io_write_byte_16le(offs_t address, UINT8 data)
41234552{
41244553   UINT32 shift = (address & 1) * 8;
4125   write_word_masked_generic(ADDRESS_SPACE_IO, address, data << shift, ~(0xff << shift));
4554   write_word_masked_generic(ADDRESS_SPACE_IO, address, data << shift, 0xff << shift);
41264555}
41274556
41284557void io_write_byte_16be(offs_t address, UINT8 data)
41294558{
41304559   UINT32 shift = (~address & 1) * 8;
4131   write_word_masked_generic(ADDRESS_SPACE_IO, address, data << shift, ~(0xff << shift));
4560   write_word_masked_generic(ADDRESS_SPACE_IO, address, data << shift, 0xff << shift);
41324561}
41334562
41344563void io_write_word_16le(offs_t address, UINT16 data)
41354564{
4136   write_word_masked_generic(ADDRESS_SPACE_IO, address, data, 0);
4565   write_word_masked_generic(ADDRESS_SPACE_IO, address, data, 0xffff);
41374566}
41384567
4568void io_write_word_masked_16le(offs_t address, UINT16 data, UINT16 mask)
4569{
4570   write_word_masked_generic(ADDRESS_SPACE_IO, address, data, mask);
4571}
4572
41394573void io_write_word_16be(offs_t address, UINT16 data)
41404574{
4141   write_word_masked_generic(ADDRESS_SPACE_IO, address, data, 0);
4575   write_word_masked_generic(ADDRESS_SPACE_IO, address, data, 0xffff);
41424576}
41434577
4578void io_write_word_masked_16be(offs_t address, UINT16 data, UINT16 mask)
4579{
4580   write_word_masked_generic(ADDRESS_SPACE_IO, address, data, mask);
4581}
4582
41444583void io_write_dword_16le(offs_t address, UINT32 data)
41454584{
41464585   io_write_word_16le(address + 0, data >> 0);
41474586   io_write_word_16le(address + 2, data >> 16);
41484587}
41494588
4589void io_write_dword_masked_16le(offs_t address, UINT32 data, UINT32 mask)
4590{
4591   if (mask & 0x0000ffff) io_write_word_masked_16le(address + 0, data >> 0, mask >> 0);
4592   if (mask & 0xffff0000) io_write_word_masked_16le(address + 2, data >> 16, mask >> 16);
4593}
4594
41504595void io_write_dword_16be(offs_t address, UINT32 data)
41514596{
41524597   io_write_word_16be(address + 0, data >> 16);
41534598   io_write_word_16be(address + 2, data >> 0);
41544599}
41554600
4601void io_write_dword_masked_16be(offs_t address, UINT32 data, UINT32 mask)
4602{
4603   if (mask & 0xffff0000) io_write_word_masked_16be(address + 0, data >> 16, mask >> 16);
4604   if (mask & 0x0000ffff) io_write_word_masked_16be(address + 2, data >> 0, mask >> 0);
4605}
4606
41564607void io_write_qword_16le(offs_t address, UINT64 data)
41574608{
41584609   io_write_dword_16le(address + 0, data >> 0);
41594610   io_write_dword_16le(address + 4, data >> 32);
41604611}
41614612
4613void io_write_qword_masked_16le(offs_t address, UINT64 data, UINT64 mask)
4614{
4615   if (mask & U64(0x00000000ffffffff)) io_write_dword_masked_16le(address + 0, data >> 0, mask >> 0);
4616   if (mask & U64(0xffffffff00000000)) io_write_dword_masked_16le(address + 4, data >> 32, mask >> 32);
4617}
4618
41624619void io_write_qword_16be(offs_t address, UINT64 data)
41634620{
41644621   io_write_dword_16be(address + 0, data >> 32);
41654622   io_write_dword_16be(address + 4, data >> 0);
41664623}
41674624
4625void io_write_qword_masked_16be(offs_t address, UINT64 data, UINT64 mask)
4626{
4627   if (mask & U64(0xffffffff00000000)) io_write_dword_masked_16be(address + 0, data >> 32, mask >> 32);
4628   if (mask & U64(0x00000000ffffffff)) io_write_dword_masked_16be(address + 4, data >> 0, mask >> 0);
4629}
41684630
41694631
4632
41704633/***************************************************************************
41714634    32-BIT READ HANDLERS
41724635***************************************************************************/
r2454r2455
41904653   entry = lookup_read_entry(space, address);
41914654   handler = &space->readhandlers[entry];
41924655
4193   DEBUG_HOOK_READ(spacenum, address & ~3, (UINT32)~mem_mask);
4656   DEBUG_HOOK_READ(spacenum, address & ~3, mem_mask);
41944657
41954658   offset = (address - handler->bytestart) & handler->bytemask;
41964659   if (entry < STATIC_RAM)
r2454r2455
42114674UINT8 program_read_byte_32le(offs_t address)
42124675{
42134676   UINT32 shift = (address & 3) * 8;
4214   return read_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, ~(0xff << shift)) >> shift;
4677   return read_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, 0xff << shift) >> shift;
42154678}
42164679
42174680UINT8 program_read_byte_32be(offs_t address)
42184681{
42194682   UINT32 shift = (~address & 3) * 8;
4220   return read_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, ~(0xff << shift)) >> shift;
4683   return read_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, 0xff << shift) >> shift;
42214684}
42224685
42234686UINT16 program_read_word_32le(offs_t address)
42244687{
42254688   UINT32 shift = (address & 2) * 8;
4226   return read_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, ~(0xffff << shift)) >> shift;
4689   return read_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, 0xffff << shift) >> shift;
42274690}
42284691
4692UINT16 program_read_word_masked_32le(offs_t address, UINT16 mask)
4693{
4694   UINT32 shift = (address & 2) * 8;
4695   return read_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, mask << shift) >> shift;
4696}
4697
42294698UINT16 program_read_word_32be(offs_t address)
42304699{
42314700   UINT32 shift = (~address & 2) * 8;
4232   return read_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, ~(0xffff << shift)) >> shift;
4701   return read_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, 0xffff << shift) >> shift;
42334702}
42344703
4704UINT16 program_read_word_masked_32be(offs_t address, UINT16 mask)
4705{
4706   UINT32 shift = (~address & 2) * 8;
4707   return read_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, mask << shift) >> shift;
4708}
4709
42354710UINT32 program_read_dword_32le(offs_t address)
42364711{
4237   return read_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, 0);
4712   return read_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, 0xffffffff);
42384713}
42394714
4240UINT32 program_read_dword_32be(offs_t address)
4715UINT32 program_read_dword_masked_32le(offs_t address, UINT32 mask)
42414716{
4242   return read_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, 0);
4717   return read_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, mask);
42434718}
42444719
4245UINT32 program_read_dword_masked_32le(offs_t address, UINT32 mem_mask)
4720UINT32 program_read_dword_32be(offs_t address)
42464721{
4247   return read_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, mem_mask);
4722   return read_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, 0xffffffff);
42484723}
42494724
4250UINT32 program_read_dword_masked_32be(offs_t address, UINT32 mem_mask)
4725UINT32 program_read_dword_masked_32be(offs_t address, UINT32 mask)
42514726{
4252   return read_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, mem_mask);
4727   return read_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, mask);
42534728}
42544729
42554730UINT64 program_read_qword_32le(offs_t address)
r2454r2455
42584733   return result | ((UINT64)program_read_dword_32le(address + 4) << 32);
42594734}
42604735
4736UINT64 program_read_qword_masked_32le(offs_t address, UINT64 mask)
4737{
4738   UINT64 result = 0;
4739   if (mask & U64(0x00000000ffffffff)) result |= (UINT64)program_read_dword_masked_32le(address + 0, mask >> 0) << 0;
4740   if (mask & U64(0xffffffff00000000)) result |= (UINT64)program_read_dword_masked_32le(address + 4, mask >> 32) << 32;
4741   return result;
4742}
4743
42614744UINT64 program_read_qword_32be(offs_t address)
42624745{
42634746   UINT64 result = (UINT64)program_read_dword_32le(address + 0) << 32;
42644747   return result | ((UINT64)program_read_dword_32le(address + 4) << 0);
42654748}
42664749
4750UINT64 program_read_qword_masked_32be(offs_t address, UINT64 mask)
4751{
4752   UINT64 result = 0;
4753   if (mask & U64(0xffffffff00000000)) result |= (UINT64)program_read_dword_masked_32be(address + 0, mask >> 32) << 32;
4754   if (mask & U64(0x00000000ffffffff)) result |= (UINT64)program_read_dword_masked_32be(address + 4, mask >> 0) << 0;
4755   return result;
4756}
42674757
4758
42684759/*-------------------------------------------------
42694760    ADDRESS_SPACE_DATA
42704761-------------------------------------------------*/
r2454r2455
42724763UINT8 data_read_byte_32le(offs_t address)
42734764{
42744765   UINT32 shift = (address & 3) * 8;
4275   return read_dword_masked_generic(ADDRESS_SPACE_DATA, address, ~(0xff << shift)) >> shift;
4766   return read_dword_masked_generic(ADDRESS_SPACE_DATA, address, 0xff << shift) >> shift;
42764767}
42774768
42784769UINT8 data_read_byte_32be(offs_t address)
42794770{
42804771   UINT32 shift = (~address & 3) * 8;
4281   return read_dword_masked_generic(ADDRESS_SPACE_DATA, address, ~(0xff << shift)) >> shift;
4772   return read_dword_masked_generic(ADDRESS_SPACE_DATA, address, 0xff << shift) >> shift;
42824773}
42834774
42844775UINT16 data_read_word_32le(offs_t address)
42854776{
42864777   UINT32 shift = (address & 2) * 8;
4287   return read_dword_masked_generic(ADDRESS_SPACE_DATA, address, ~(0xffff << shift)) >> shift;
4778   return read_dword_masked_generic(ADDRESS_SPACE_DATA, address, 0xffff << shift) >> shift;
42884779}
42894780
4781UINT16 data_read_word_masked_32le(offs_t address, UINT16 mask)
4782{
4783   UINT32 shift = (address & 2) * 8;
4784   return read_dword_masked_generic(ADDRESS_SPACE_DATA, address, mask << shift) >> shift;
4785}
4786
42904787UINT16 data_read_word_32be(offs_t address)
42914788{
42924789   UINT32 shift = (~address & 2) * 8;
4293   return read_dword_masked_generic(ADDRESS_SPACE_DATA, address, ~(0xffff << shift)) >> shift;
4790   return read_dword_masked_generic(ADDRESS_SPACE_DATA, address, 0xffff << shift) >> shift;
42944791}
42954792
4793UINT16 data_read_word_masked_32be(offs_t address, UINT16 mask)
4794{
4795   UINT32 shift = (~address & 2) * 8;
4796   return read_dword_masked_generic(ADDRESS_SPACE_DATA, address, mask << shift) >> shift;
4797}
4798
42964799UINT32 data_read_dword_32le(offs_t address)
42974800{
4298   return read_dword_masked_generic(ADDRESS_SPACE_DATA, address, 0);
4801   return read_dword_masked_generic(ADDRESS_SPACE_DATA, address, 0xffffffff);
42994802}
43004803
4301UINT32 data_read_dword_32be(offs_t address)
4804UINT32 data_read_dword_masked_32le(offs_t address, UINT32 mask)
43024805{
4303   return read_dword_masked_generic(ADDRESS_SPACE_DATA, address, 0);
4806   return read_dword_masked_generic(ADDRESS_SPACE_DATA, address, mask);
43044807}
43054808
4306UINT32 data_read_dword_masked_32le(offs_t address, UINT32 mem_mask)
4809UINT32 data_read_dword_32be(offs_t address)
43074810{
4308   return read_dword_masked_generic(ADDRESS_SPACE_DATA, address, mem_mask);
4811   return read_dword_masked_generic(ADDRESS_SPACE_DATA, address, 0xffffffff);
43094812}
43104813
4311UINT32 data_read_dword_masked_32be(offs_t address, UINT32 mem_mask)
4814UINT32 data_read_dword_masked_32be(offs_t address, UINT32 mask)
43124815{
4313   return read_dword_masked_generic(ADDRESS_SPACE_DATA, address, mem_mask);
4816   return read_dword_masked_generic(ADDRESS_SPACE_DATA, address, mask);
43144817}
43154818
43164819UINT64 data_read_qword_32le(offs_t address)
r2454r2455
43194822   return result | ((UINT64)data_read_dword_32le(address + 4) << 32);
43204823}
43214824
4825UINT64 data_read_qword_masked_32le(offs_t address, UINT64 mask)
4826{
4827   UINT64 result = 0;
4828   if (mask & U64(0x00000000ffffffff)) result |= (UINT64)data_read_dword_masked_32le(address + 0, mask >> 0) << 0;
4829   if (mask & U64(0xffffffff00000000)) result |= (UINT64)data_read_dword_masked_32le(address + 4, mask >> 32) << 32;
4830   return result;
4831}
4832
43224833UINT64 data_read_qword_32be(offs_t address)
43234834{
43244835   UINT64 result = (UINT64)data_read_dword_32le(address + 0) << 32;
43254836   return result | ((UINT64)data_read_dword_32le(address + 4) << 0);
43264837}
43274838
4839UINT64 data_read_qword_masked_32be(offs_t address, UINT64 mask)
4840{
4841   UINT64 result = 0;
4842   if (mask & U64(0xffffffff00000000)) result |= (UINT64)data_read_dword_masked_32be(address + 0, mask >> 32) << 32;
4843   if (mask & U64(0x00000000ffffffff)) result |= (UINT64)data_read_dword_masked_32be(address + 4, mask >> 0) << 0;
4844   return result;
4845}
43284846
4847
43294848/*-------------------------------------------------
43304849    ADDRESS_SPACE_IO
43314850-------------------------------------------------*/
r2454r2455
43334852UINT8 io_read_byte_32le(offs_t address)
43344853{
43354854   UINT32 shift = (address & 3) * 8;
4336   return read_dword_masked_generic(ADDRESS_SPACE_IO, address, ~(0xff << shift)) >> shift;
4855   return read_dword_masked_generic(ADDRESS_SPACE_IO, address, 0xff << shift) >> shift;
43374856}
43384857
43394858UINT8 io_read_byte_32be(offs_t address)
43404859{
43414860   UINT32 shift = (~address & 3) * 8;
4342   return read_dword_masked_generic(ADDRESS_SPACE_IO, address, ~(0xff << shift)) >> shift;
4861   return read_dword_masked_generic(ADDRESS_SPACE_IO, address, 0xff << shift) >> shift;
43434862}
43444863
43454864UINT16 io_read_word_32le(offs_t address)
43464865{
43474866   UINT32 shift = (address & 2) * 8;
4348   return read_dword_masked_generic(ADDRESS_SPACE_IO, address, ~(0xffff << shift)) >> shift;
4867   return read_dword_masked_generic(ADDRESS_SPACE_IO, address, 0xffff << shift) >> shift;
43494868}
43504869
4870UINT16 io_read_word_masked_32le(offs_t address, UINT16 mask)
4871{
4872   UINT32 shift = (address & 2) * 8;
4873   return read_dword_masked_generic(ADDRESS_SPACE_IO, address, mask << shift) >> shift;
4874}
4875
43514876UINT16 io_read_word_32be(offs_t address)
43524877{
43534878   UINT32 shift = (~address & 2) * 8;
4354   return read_dword_masked_generic(ADDRESS_SPACE_IO, address, ~(0xffff << shift)) >> shift;
4879   return read_dword_masked_generic(ADDRESS_SPACE_IO, address, 0xffff << shift) >> shift;
43554880}
43564881
4882UINT16 io_read_word_masked_32be(offs_t address, UINT16 mask)
4883{
4884   UINT32 shift = (~address & 2) * 8;
4885   return read_dword_masked_generic(ADDRESS_SPACE_IO, address, mask << shift) >> shift;
4886}
4887
43574888UINT32 io_read_dword_32le(offs_t address)
43584889{
4359   return read_dword_masked_generic(ADDRESS_SPACE_IO, address, 0);
4890   return read_dword_masked_generic(ADDRESS_SPACE_IO, address, 0xffffffff);
43604891}
43614892
4362UINT32 io_read_dword_32be(offs_t address)
4893UINT32 io_read_dword_masked_32le(offs_t address, UINT32 mask)
43634894{
4364   return read_dword_masked_generic(ADDRESS_SPACE_IO, address, 0);
4895   return read_dword_masked_generic(ADDRESS_SPACE_IO, address, mask);
43654896}
43664897
4367UINT32 io_read_dword_masked_32le(offs_t address, UINT32 mem_mask)
4898UINT32 io_read_dword_32be(offs_t address)
43684899{
4369   return read_dword_masked_generic(ADDRESS_SPACE_IO, address, mem_mask);
4900   return read_dword_masked_generic(ADDRESS_SPACE_IO, address, 0xffffffff);
43704901}
43714902
4372UINT32 io_read_dword_masked_32be(offs_t address, UINT32 mem_mask)
4903UINT32 io_read_dword_masked_32be(offs_t address, UINT32 mask)
43734904{
4374   return read_dword_masked_generic(ADDRESS_SPACE_IO, address, mem_mask);
4905   return read_dword_masked_generic(ADDRESS_SPACE_IO, address, mask);
43754906}
43764907
43774908UINT64 io_read_qword_32le(offs_t address)
r2454r2455
43804911   return result | ((UINT64)io_read_dword_32le(address + 4) << 32);
43814912}
43824913
4914UINT64 io_read_qword_masked_32le(offs_t address, UINT64 mask)
4915{
4916   UINT64 result = 0;
4917   if (mask & U64(0x00000000ffffffff)) result |= (UINT64)io_read_dword_masked_32le(address + 0, mask >> 0) << 0;
4918   if (mask & U64(0xffffffff00000000)) result |= (UINT64)io_read_dword_masked_32le(address + 4, mask >> 32) << 32;
4919   return result;
4920}
4921
43834922UINT64 io_read_qword_32be(offs_t address)
43844923{
43854924   UINT64 result = (UINT64)io_read_dword_32le(address + 0) << 32;
43864925   return result | ((UINT64)io_read_dword_32le(address + 4) << 0);
43874926}
43884927
4928UINT64 io_read_qword_masked_32be(offs_t address, UINT64 mask)
4929{
4930   UINT64 result = 0;
4931   if (mask & U64(0xffffffff00000000)) result |= (UINT64)io_read_dword_masked_32be(address + 0, mask >> 32) << 32;
4932   if (mask & U64(0x00000000ffffffff)) result |= (UINT64)io_read_dword_masked_32be(address + 4, mask >> 0) << 0;
4933   return result;
4934}
43894935
43904936
4937
43914938/***************************************************************************
43924939    32-BIT WRITE HANDLERS
43934940***************************************************************************/
r2454r2455
44104957   entry = lookup_write_entry(space, address);
44114958   handler = &space->writehandlers[entry];
44124959
4413   DEBUG_HOOK_WRITE(spacenum, address & ~3, data, (UINT32)~mem_mask);
4960   DEBUG_HOOK_WRITE(spacenum, address & ~3, data, mem_mask);
44144961
44154962   offset = (address - handler->bytestart) & handler->bytemask;
44164963   if (entry < STATIC_RAM)
44174964   {
44184965      UINT32 *dest = (UINT32 *)&bank_ptr[entry][offset & ~3];
4419      *dest = (*dest & mem_mask) | (data & ~mem_mask);
4966      *dest = (*dest & ~mem_mask) | (data & mem_mask);
44204967   }
44214968   else
44224969      (*handler->handler.write.mhandler32)(handler->object, offset >> 2, data, mem_mask);
r2454r2455
44324979void program_write_byte_32le(offs_t address, UINT8 data)
44334980{
44344981   UINT32 shift = (address & 3) * 8;
4435   write_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data << shift, ~(0xff << shift));
4982   write_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data << shift, 0xff << shift);
44364983}
44374984
44384985void program_write_byte_32be(offs_t address, UINT8 data)
44394986{
44404987   UINT32 shift = (~address & 3) * 8;
4441   write_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data << shift, ~(0xff << shift));
4988   write_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data << shift, 0xff << shift);
44424989}
44434990
44444991void program_write_word_32le(offs_t address, UINT16 data)
44454992{
44464993   UINT32 shift = (address & 2) * 8;
4447   write_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data << shift, ~(0xffff << shift));
4994   write_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data << shift, 0xffff << shift);
44484995}
44494996
4997void program_write_word_masked_32le(offs_t address, UINT16 data, UINT16 mask)
4998{
4999   UINT32 shift = (address & 2) * 8;
5000   write_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data << shift, mask << shift);
5001}
5002
44505003void program_write_word_32be(offs_t address, UINT16 data)
44515004{
44525005   UINT32 shift = (~address & 2) * 8;
4453   write_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data << shift, ~(0xffff << shift));
5006   write_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data << shift, 0xffff << shift);
44545007}
44555008
5009void program_write_word_masked_32be(offs_t address, UINT16 data, UINT16 mask)
5010{
5011   UINT32 shift = (~address & 2) * 8;
5012   write_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data << shift, mask << shift);
5013}
5014
44565015void program_write_dword_32le(offs_t address, UINT32 data)
44575016{
4458   write_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, 0);
5017   write_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, 0xffffffff);
44595018}
44605019
4461void program_write_dword_32be(offs_t address, UINT32 data)
5020void program_write_dword_masked_32le(offs_t address, UINT32 data, UINT32 mask)
44625021{
4463   write_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, 0);
5022   write_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, mask);
44645023}
44655024
4466void program_write_dword_masked_32le(offs_t address, UINT32 data, UINT32 mem_mask)
5025void program_write_dword_32be(offs_t address, UINT32 data)
44675026{
4468   write_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, mem_mask);
5027   write_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, 0xffffffff);
44695028}
44705029
4471void program_write_dword_masked_32be(offs_t address, UINT32 data, UINT32 mem_mask)
5030void program_write_dword_masked_32be(offs_t address, UINT32 data, UINT32 mask)
44725031{
4473   write_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, mem_mask);
5032   write_dword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, mask);
44745033}
44755034
44765035void program_write_qword_32le(offs_t address, UINT64 data)
r2454r2455
44795038   program_write_dword_32le(address + 4, data >> 32);
44805039}
44815040
5041void program_write_qword_masked_32le(offs_t address, UINT64 data, UINT64 mask)
5042{
5043   if (mask & U64(0x00000000ffffffff)) program_write_dword_masked_32le(address + 0, data >> 0, mask >> 0);
5044   if (mask & U64(0xffffffff00000000)) program_write_dword_masked_32le(address + 4, data >> 32, mask >> 32);
5045}
5046
44825047void program_write_qword_32be(offs_t address, UINT64 data)
44835048{
44845049   program_write_dword_32be(address + 0, data >> 32);
44855050   program_write_dword_32be(address + 4, data >> 0);
44865051}
44875052
5053void program_write_qword_masked_32be(offs_t address, UINT64 data, UINT64 mask)
5054{
5055   if (mask & U64(0xffffffff00000000)) program_write_dword_masked_32be(address + 0, data >> 32, mask >> 32);
5056   if (mask & U64(0x00000000ffffffff)) program_write_dword_masked_32be(address + 4, data >> 0, mask >> 0);
5057}
44885058
5059
44895060/*-------------------------------------------------
44905061    ADDRESS_SPACE_DATA
44915062-------------------------------------------------*/
r2454r2455
44935064void data_write_byte_32le(offs_t address, UINT8 data)
44945065{
44955066   UINT32 shift = (address & 3) * 8;
4496   write_dword_masked_generic(ADDRESS_SPACE_DATA, address, data << shift, ~(0xff << shift));
5067   write_dword_masked_generic(ADDRESS_SPACE_DATA, address, data << shift, 0xff << shift);
44975068}
44985069
44995070void data_write_byte_32be(offs_t address, UINT8 data)
45005071{
45015072   UINT32 shift = (~address & 3) * 8;
4502   write_dword_masked_generic(ADDRESS_SPACE_DATA, address, data << shift, ~(0xff << shift));
5073   write_dword_masked_generic(ADDRESS_SPACE_DATA, address, data << shift, 0xff << shift);
45035074}
45045075
45055076void data_write_word_32le(offs_t address, UINT16 data)
45065077{
45075078   UINT32 shift = (address & 2) * 8;
4508   write_dword_masked_generic(ADDRESS_SPACE_DATA, address, data << shift, ~(0xffff << shift));
5079   write_dword_masked_generic(ADDRESS_SPACE_DATA, address, data << shift, 0xffff << shift);
45095080}
45105081
5082void data_write_word_masked_32le(offs_t address, UINT16 data, UINT16 mask)
5083{
5084   UINT32 shift = (address & 2) * 8;
5085   write_dword_masked_generic(ADDRESS_SPACE_DATA, address, data << shift, mask << shift);
5086}
5087
45115088void data_write_word_32be(offs_t address, UINT16 data)
45125089{
45135090   UINT32 shift = (~address & 2) * 8;
4514   write_dword_masked_generic(ADDRESS_SPACE_DATA, address, data << shift, ~(0xffff << shift));
5091   write_dword_masked_generic(ADDRESS_SPACE_DATA, address, data << shift, 0xffff << shift);
45155092}
45165093
5094void data_write_word_masked_32be(offs_t address, UINT16 data, UINT16 mask)
5095{
5096   UINT32 shift = (~address & 2) * 8;
5097   write_dword_masked_generic(ADDRESS_SPACE_DATA, address, data << shift, mask << shift);
5098}
5099
45175100void data_write_dword_32le(offs_t address, UINT32 data)
45185101{
4519   write_dword_masked_generic(ADDRESS_SPACE_DATA, address, data, 0);
5102   write_dword_masked_generic(ADDRESS_SPACE_DATA, address, data, 0xffffffff);
45205103}
45215104
4522void data_write_dword_32be(offs_t address, UINT32 data)
5105void data_write_dword_masked_32le(offs_t address, UINT32 data, UINT32 mask)
45235106{
4524   write_dword_masked_generic(ADDRESS_SPACE_DATA, address, data, 0);
5107   write_dword_masked_generic(ADDRESS_SPACE_DATA, address, data, mask);
45255108}
45265109
4527void data_write_dword_masked_32le(offs_t address, UINT32 data, UINT32 mem_mask)
5110void data_write_dword_32be(offs_t address, UINT32 data)
45285111{
4529   write_dword_masked_generic(ADDRESS_SPACE_DATA, address, data, mem_mask);
5112   write_dword_masked_generic(ADDRESS_SPACE_DATA, address, data, 0xffffffff);
45305113}
45315114
4532void data_write_dword_masked_32be(offs_t address, UINT32 data, UINT32 mem_mask)
5115void data_write_dword_masked_32be(offs_t address, UINT32 data, UINT32 mask)
45335116{
4534   write_dword_masked_generic(ADDRESS_SPACE_DATA, address, data, mem_mask);
5117   write_dword_masked_generic(ADDRESS_SPACE_DATA, address, data, mask);
45355118}
45365119
45375120void data_write_qword_32le(offs_t address, UINT64 data)
r2454r2455
45405123   data_write_dword_32le(address + 4, data >> 32);
45415124}
45425125
5126void data_write_qword_masked_32le(offs_t address, UINT64 data, UINT64 mask)
5127{
5128   if (mask & U64(0x00000000ffffffff)) data_write_dword_masked_32le(address + 0, data >> 0, mask >> 0);
5129   if (mask & U64(0xffffffff00000000)) data_write_dword_masked_32le(address + 4, data >> 32, mask >> 32);
5130}
5131
45435132void data_write_qword_32be(offs_t address, UINT64 data)
45445133{
45455134   data_write_dword_32be(address + 0, data >> 32);
45465135   data_write_dword_32be(address + 4, data >> 0);
45475136}
45485137
5138void data_write_qword_masked_32be(offs_t address, UINT64 data, UINT64 mask)
5139{
5140   if (mask & U64(0xffffffff00000000)) data_write_dword_masked_32be(address + 0, data >> 32, mask >> 32);
5141   if (mask & U64(0x00000000ffffffff)) data_write_dword_masked_32be(address + 4, data >> 0, mask >> 0);
5142}
45495143
5144
45505145/*-------------------------------------------------
45515146    ADDRESS_SPACE_IO
45525147-------------------------------------------------*/
r2454r2455
45545149void io_write_byte_32le(offs_t address, UINT8 data)
45555150{
45565151   UINT32 shift = (address & 3) * 8;
4557   write_dword_masked_generic(ADDRESS_SPACE_IO, address, data << shift, ~(0xff << shift));
5152   write_dword_masked_generic(ADDRESS_SPACE_IO, address, data << shift, 0xff << shift);
45585153}
45595154
45605155void io_write_byte_32be(offs_t address, UINT8 data)
45615156{
45625157   UINT32 shift = (~address & 3) * 8;
4563   write_dword_masked_generic(ADDRESS_SPACE_IO, address, data << shift, ~(0xff << shift));
5158   write_dword_masked_generic(ADDRESS_SPACE_IO, address, data << shift, 0xff << shift);
45645159}
45655160
45665161void io_write_word_32le(offs_t address, UINT16 data)
45675162{
45685163   UINT32 shift = (address & 2) * 8;
4569   write_dword_masked_generic(ADDRESS_SPACE_IO, address, data << shift, ~(0xffff << shift));
5164   write_dword_masked_generic(ADDRESS_SPACE_IO, address, data << shift, 0xffff << shift);
45705165}
45715166
5167void io_write_word_masked_32le(offs_t address, UINT16 data, UINT16 mask)
5168{
5169   UINT32 shift = (address & 2) * 8;
5170   write_dword_masked_generic(ADDRESS_SPACE_IO, address, data << shift, mask << shift);
5171}
5172
45725173void io_write_word_32be(offs_t address, UINT16 data)
45735174{
45745175   UINT32 shift = (~address & 2) * 8;
4575   write_dword_masked_generic(ADDRESS_SPACE_IO, address, data << shift, ~(0xffff << shift));
5176   write_dword_masked_generic(ADDRESS_SPACE_IO, address, data << shift, 0xffff << shift);
45765177}
45775178
5179void io_write_word_masked_32be(offs_t address, UINT16 data, UINT16 mask)
5180{
5181   UINT32 shift = (~address & 2) * 8;
5182   write_dword_masked_generic(ADDRESS_SPACE_IO, address, data << shift, mask << shift);
5183}
5184
45785185void io_write_dword_32le(offs_t address, UINT32 data)
45795186{
4580   write_dword_masked_generic(ADDRESS_SPACE_IO, address, data, 0);
5187   write_dword_masked_generic(ADDRESS_SPACE_IO, address, data, 0xffffffff);
45815188}
45825189
4583void io_write_dword_32be(offs_t address, UINT32 data)
5190void io_write_dword_masked_32le(offs_t address, UINT32 data, UINT32 mask)
45845191{
4585   write_dword_masked_generic(ADDRESS_SPACE_IO, address, data, 0);
5192   write_dword_masked_generic(ADDRESS_SPACE_IO, address, data, mask);
45865193}
45875194
4588void io_write_dword_masked_32le(offs_t address, UINT32 data, UINT32 mem_mask)
5195void io_write_dword_32be(offs_t address, UINT32 data)
45895196{
4590   write_dword_masked_generic(ADDRESS_SPACE_IO, address, data, mem_mask);
5197   write_dword_masked_generic(ADDRESS_SPACE_IO, address, data, 0xffffffff);
45915198}
45925199
4593void io_write_dword_masked_32be(offs_t address, UINT32 data, UINT32 mem_mask)
5200void io_write_dword_masked_32be(offs_t address, UINT32 data, UINT32 mask)
45945201{
4595   write_dword_masked_generic(ADDRESS_SPACE_IO, address, data, mem_mask);
5202   write_dword_masked_generic(ADDRESS_SPACE_IO, address, data, mask);
45965203}
45975204
45985205void io_write_qword_32le(offs_t address, UINT64 data)
r2454r2455
46015208   io_write_dword_32le(address + 4, data >> 32);
46025209}
46035210
5211void io_write_qword_masked_32le(offs_t address, UINT64 data, UINT64 mask)
5212{
5213   if (mask & U64(0x00000000ffffffff)) io_write_dword_masked_32le(address + 0, data >> 0, mask >> 0);
5214   if (mask & U64(0xffffffff00000000)) io_write_dword_masked_32le(address + 4, data >> 32, mask >> 32);
5215}
5216
46045217void io_write_qword_32be(offs_t address, UINT64 data)
46055218{
46065219   io_write_dword_32be(address + 0, data >> 32);
46075220   io_write_dword_32be(address + 4, data >> 0);
46085221}
46095222
5223void io_write_qword_masked_32be(offs_t address, UINT64 data, UINT64 mask)
5224{
5225   if (mask & U64(0xffffffff00000000)) io_write_dword_masked_32be(address + 0, data >> 32, mask >> 32);
5226   if (mask & U64(0x00000000ffffffff)) io_write_dword_masked_32be(address + 4, data >> 0, mask >> 0);
5227}
46105228
46115229
5230
46125231/***************************************************************************
46135232    64-BIT READ HANDLERS
46145233***************************************************************************/
r2454r2455
46325251   entry = lookup_read_entry(space, address);
46335252   handler = &space->readhandlers[entry];
46345253
4635   DEBUG_HOOK_READ(spacenum, address & ~7, ~mem_mask);
5254   DEBUG_HOOK_READ(spacenum, address & ~7, mem_mask);
46365255
46375256   offset = (address - handler->bytestart) & handler->bytemask;
46385257   if (entry < STATIC_RAM)
r2454r2455
46535272UINT8 program_read_byte_64le(offs_t address)
46545273{
46555274   UINT32 shift = (address & 7) * 8;
4656   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, ~((UINT64)0xff << shift)) >> shift;
5275   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)0xff << shift) >> shift;
46575276}
46585277
46595278UINT8 program_read_byte_64be(offs_t address)
46605279{
46615280   UINT32 shift = (~address & 7) * 8;
4662   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, ~((UINT64)0xff << shift)) >> shift;
5281   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)0xff << shift) >> shift;
46635282}
46645283
46655284UINT16 program_read_word_64le(offs_t address)
46665285{
46675286   UINT32 shift = (address & 6) * 8;
4668   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, ~((UINT64)0xffff << shift)) >> shift;
5287   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)0xffff << shift) >> shift;
46695288}
46705289
5290UINT16 program_read_word_masked_64le(offs_t address, UINT16 mask)
5291{
5292   UINT32 shift = (address & 6) * 8;
5293   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)mask << shift) >> shift;
5294}
5295
46715296UINT16 program_read_word_64be(offs_t address)
46725297{
46735298   UINT32 shift = (~address & 6) * 8;
4674   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, ~((UINT64)0xffff << shift)) >> shift;
5299   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)0xffff << shift) >> shift;
46755300}
46765301
5302UINT16 program_read_word_masked_64be(offs_t address, UINT16 mask)
5303{
5304   UINT32 shift = (~address & 6) * 8;
5305   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)mask << shift) >> shift;
5306}
5307
46775308UINT32 program_read_dword_64le(offs_t address)
46785309{
46795310   UINT32 shift = (address & 4) * 8;
4680   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, ~((UINT64)0xffffffff << shift)) >> shift;
5311   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)0xffffffff << shift) >> shift;
46815312}
46825313
5314UINT32 program_read_dword_masked_64le(offs_t address, UINT32 mask)
5315{
5316   UINT32 shift = (address & 4) * 8;
5317   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)mask << shift) >> shift;
5318}
5319
46835320UINT32 program_read_dword_64be(offs_t address)
46845321{
46855322   UINT32 shift = (~address & 4) * 8;
4686   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, ~((UINT64)0xffffffff << shift)) >> shift;
5323   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)0xffffffff << shift) >> shift;
46875324}
46885325
5326UINT32 program_read_dword_masked_64be(offs_t address, UINT32 mask)
5327{
5328   UINT32 shift = (~address & 4) * 8;
5329   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)mask << shift) >> shift;
5330}
5331
46895332UINT64 program_read_qword_64le(offs_t address)
46905333{
4691   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, 0);
5334   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, U64(0xffffffffffffffff));
46925335}
46935336
4694UINT64 program_read_qword_64be(offs_t address)
5337UINT64 program_read_qword_masked_64le(offs_t address, UINT64 mask)
46955338{
4696   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, 0);
5339   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, mask);
46975340}
46985341
4699UINT64 program_read_qword_masked_64le(offs_t address, UINT64 mem_mask)
5342UINT64 program_read_qword_64be(offs_t address)
47005343{
4701   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, mem_mask);
5344   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, U64(0xffffffffffffffff));
47025345}
47035346
4704UINT64 program_read_qword_masked_64be(offs_t address, UINT64 mem_mask)
5347UINT64 program_read_qword_masked_64be(offs_t address, UINT64 mask)
47055348{
4706   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, mem_mask);
5349   return read_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, mask);
47075350}
47085351
47095352
r2454r2455
47145357UINT8 data_read_byte_64le(offs_t address)
47155358{
47165359   UINT32 shift = (address & 7) * 8;
4717   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, ~((UINT64)0xff << shift)) >> shift;
5360   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)0xff << shift) >> shift;
47185361}
47195362
47205363UINT8 data_read_byte_64be(offs_t address)
47215364{
47225365   UINT32 shift = (~address & 7) * 8;
4723   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, ~((UINT64)0xff << shift)) >> shift;
5366   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)0xff << shift) >> shift;
47245367}
47255368
47265369UINT16 data_read_word_64le(offs_t address)
47275370{
47285371   UINT32 shift = (address & 6) * 8;
4729   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, ~((UINT64)0xffff << shift)) >> shift;
5372   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)0xffff << shift) >> shift;
47305373}
47315374
5375UINT16 data_read_word_masked_64le(offs_t address, UINT16 mask)
5376{
5377   UINT32 shift = (address & 6) * 8;
5378   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)mask << shift) >> shift;
5379}
5380
47325381UINT16 data_read_word_64be(offs_t address)
47335382{
47345383   UINT32 shift = (~address & 6) * 8;
4735   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, ~((UINT64)0xffff << shift)) >> shift;
5384   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)0xffff << shift) >> shift;
47365385}
47375386
5387UINT16 data_read_word_masked_64be(offs_t address, UINT16 mask)
5388{
5389   UINT32 shift = (~address & 6) * 8;
5390   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)mask << shift) >> shift;
5391}
5392
47385393UINT32 data_read_dword_64le(offs_t address)
47395394{
47405395   UINT32 shift = (address & 4) * 8;
4741   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, ~((UINT64)0xffffffff << shift)) >> shift;
5396   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)0xffffffff << shift) >> shift;
47425397}
47435398
5399UINT32 data_read_dword_masked_64le(offs_t address, UINT32 mask)
5400{
5401   UINT32 shift = (address & 4) * 8;
5402   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)mask << shift) >> shift;
5403}
5404
47445405UINT32 data_read_dword_64be(offs_t address)
47455406{
47465407   UINT32 shift = (~address & 4) * 8;
4747   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, ~((UINT64)0xffffffff << shift)) >> shift;
5408   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)0xffffffff << shift) >> shift;
47485409}
47495410
5411UINT32 data_read_dword_masked_64be(offs_t address, UINT32 mask)
5412{
5413   UINT32 shift = (~address & 4) * 8;
5414   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)mask << shift) >> shift;
5415}
5416
47505417UINT64 data_read_qword_64le(offs_t address)
47515418{
4752   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, 0);
5419   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, U64(0xffffffffffffffff));
47535420}
47545421
4755UINT64 data_read_qword_64be(offs_t address)
5422UINT64 data_read_qword_masked_64le(offs_t address, UINT64 mask)
47565423{
4757   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, 0);
5424   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, mask);
47585425}
47595426
4760UINT64 data_read_qword_masked_64le(offs_t address, UINT64 mem_mask)
5427UINT64 data_read_qword_64be(offs_t address)
47615428{
4762   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, mem_mask);
5429   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, U64(0xffffffffffffffff));
47635430}
47645431
4765UINT64 data_read_qword_masked_64be(offs_t address, UINT64 mem_mask)
5432UINT64 data_read_qword_masked_64be(offs_t address, UINT64 mask)
47665433{
4767   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, mem_mask);
5434   return read_qword_masked_generic(ADDRESS_SPACE_DATA, address, mask);
47685435}
47695436
47705437
r2454r2455
47755442UINT8 io_read_byte_64le(offs_t address)
47765443{
47775444   UINT32 shift = (address & 7) * 8;
4778   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, ~((UINT64)0xff << shift)) >> shift;
5445   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)0xff << shift) >> shift;
47795446}
47805447
47815448UINT8 io_read_byte_64be(offs_t address)
47825449{
47835450   UINT32 shift = (~address & 7) * 8;
4784   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, ~((UINT64)0xff << shift)) >> shift;
5451   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)0xff << shift) >> shift;
47855452}
47865453
47875454UINT16 io_read_word_64le(offs_t address)
47885455{
47895456   UINT32 shift = (address & 6) * 8;
4790   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, ~((UINT64)0xffff << shift)) >> shift;
5457   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)0xffff << shift) >> shift;
47915458}
47925459
5460UINT16 io_read_word_masked_64le(offs_t address, UINT16 mask)
5461{
5462   UINT32 shift = (address & 6) * 8;
5463   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)mask << shift) >> shift;
5464}
5465
47935466UINT16 io_read_word_64be(offs_t address)
47945467{
47955468   UINT32 shift = (~address & 6) * 8;
4796   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, ~((UINT64)0xffff << shift)) >> shift;
5469   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)0xffff << shift) >> shift;
47975470}
47985471
5472UINT16 io_read_word_masked_64be(offs_t address, UINT16 mask)
5473{
5474   UINT32 shift = (~address & 6) * 8;
5475   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)mask << shift) >> shift;
5476}
5477
47995478UINT32 io_read_dword_64le(offs_t address)
48005479{
48015480   UINT32 shift = (address & 4) * 8;
4802   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, ~((UINT64)0xffffffff << shift)) >> shift;
5481   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)0xffffffff << shift) >> shift;
48035482}
48045483
5484UINT32 io_read_dword_masked_64le(offs_t address, UINT32 mask)
5485{
5486   UINT32 shift = (address & 4) * 8;
5487   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)mask << shift) >> shift;
5488}
5489
48055490UINT32 io_read_dword_64be(offs_t address)
48065491{
48075492   UINT32 shift = (~address & 4) * 8;
4808   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, ~((UINT64)0xffffffff << shift)) >> shift;
5493   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)0xffffffff << shift) >> shift;
48095494}
48105495
5496UINT32 io_read_dword_masked_64be(offs_t address, UINT32 mask)
5497{
5498   UINT32 shift = (~address & 4) * 8;
5499   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)mask << shift) >> shift;
5500}
5501
48115502UINT64 io_read_qword_64le(offs_t address)
48125503{
4813   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, 0);
5504   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, U64(0xffffffffffffffff));
48145505}
48155506
4816UINT64 io_read_qword_64be(offs_t address)
5507UINT64 io_read_qword_masked_64le(offs_t address, UINT64 mask)
48175508{
4818   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, 0);
5509   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, mask);
48195510}
48205511
4821UINT64 io_read_qword_masked_64le(offs_t address, UINT64 mem_mask)
5512UINT64 io_read_qword_64be(offs_t address)
48225513{
4823   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, mem_mask);
5514   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, U64(0xffffffffffffffff));
48245515}
48255516
4826UINT64 io_read_qword_masked_64be(offs_t address, UINT64 mem_mask)
5517UINT64 io_read_qword_masked_64be(offs_t address, UINT64 mask)
48275518{
4828   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, mem_mask);
5519   return read_qword_masked_generic(ADDRESS_SPACE_IO, address, mask);
48295520}
48305521
48315522
r2454r2455
48525543   entry = lookup_write_entry(space, address);
48535544   handler = &space->writehandlers[entry];
48545545
4855   DEBUG_HOOK_WRITE(spacenum, address & ~7, data, ~mem_mask);
5546   DEBUG_HOOK_WRITE(spacenum, address & ~7, data, mem_mask);
48565547
48575548   offset = (address - handler->bytestart) & handler->bytemask;
48585549   if (entry < STATIC_RAM)
48595550   {
48605551      UINT64 *dest = (UINT64 *)&bank_ptr[entry][offset & ~7];
4861      *dest = (*dest & mem_mask) | (data & ~mem_mask);
5552      *dest = (*dest & ~mem_mask) | (data & mem_mask);
48625553   }
48635554   else
48645555      (*handler->handler.write.mhandler64)(handler->object, offset >> 3, data, mem_mask);
r2454r2455
48745565void program_write_byte_64le(offs_t address, UINT8 data)
48755566{
48765567   UINT32 shift = (address & 7) * 8;
4877   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)data << shift, ~((UINT64)0xff << shift));
5568   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)data << shift, (UINT64)0xff << shift);
48785569}
48795570
48805571void program_write_byte_64be(offs_t address, UINT8 data)
48815572{
48825573   UINT32 shift = (~address & 7) * 8;
4883   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)data << shift, ~((UINT64)0xff << shift));
5574   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)data << shift, (UINT64)0xff << shift);
48845575}
48855576
48865577void program_write_word_64le(offs_t address, UINT16 data)
48875578{
48885579   UINT32 shift = (address & 6) * 8;
4889   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)data << shift, ~((UINT64)0xffff << shift));
5580   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)data << shift, (UINT64)0xffff << shift);
48905581}
48915582
5583void program_write_word_masked_64le(offs_t address, UINT16 data, UINT16 mask)
5584{
5585   UINT32 shift = (address & 6) * 8;
5586   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)data << shift, (UINT64)mask << shift);
5587}
5588
48925589void program_write_word_64be(offs_t address, UINT16 data)
48935590{
48945591   UINT32 shift = (~address & 6) * 8;
4895   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)data << shift, ~((UINT64)0xffff << shift));
5592   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)data << shift, (UINT64)0xffff << shift);
48965593}
48975594
5595void program_write_word_masked_64be(offs_t address, UINT16 data, UINT16 mask)
5596{
5597   UINT32 shift = (~address & 6) * 8;
5598   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)data << shift, (UINT64)mask << shift);
5599}
5600
48985601void program_write_dword_64le(offs_t address, UINT32 data)
48995602{
49005603   UINT32 shift = (address & 4) * 8;
4901   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)data << shift, ~((UINT64)0xffffffff << shift));
5604   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)data << shift, (UINT64)0xffffffff << shift);
49025605}
49035606
5607void program_write_dword_masked_64le(offs_t address, UINT32 data, UINT32 mask)
5608{
5609   UINT32 shift = (address & 4) * 8;
5610   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)data << shift, (UINT64)mask << shift);
5611}
5612
49045613void program_write_dword_64be(offs_t address, UINT32 data)
49055614{
49065615   UINT32 shift = (~address & 4) * 8;
4907   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)data << shift, ~((UINT64)0xffffffff << shift));
5616   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)data << shift, (UINT64)0xffffffff << shift);
49085617}
49095618
5619void program_write_dword_masked_64be(offs_t address, UINT32 data, UINT32 mask)
5620{
5621   UINT32 shift = (~address & 4) * 8;
5622   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, (UINT64)data << shift, (UINT64)mask << shift);
5623}
5624
49105625void program_write_qword_64le(offs_t address, UINT64 data)
49115626{
4912   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, 0);
5627   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, U64(0xffffffffffffffff));
49135628}
49145629
4915void program_write_qword_64be(offs_t address, UINT64 data)
5630void program_write_qword_masked_64le(offs_t address, UINT64 data, UINT64 mask)
49165631{
4917   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, 0);
5632   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, mask);
49185633}
49195634
4920void program_write_qword_masked_64le(offs_t address, UINT64 data, UINT64 mem_mask)
5635void program_write_qword_64be(offs_t address, UINT64 data)
49215636{
4922   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, mem_mask);
5637   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, U64(0xffffffffffffffff));
49235638}
49245639
4925void program_write_qword_masked_64be(offs_t address, UINT64 data, UINT64 mem_mask)
5640void program_write_qword_masked_64be(offs_t address, UINT64 data, UINT64 mask)
49265641{
4927   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, mem_mask);
5642   write_qword_masked_generic(ADDRESS_SPACE_PROGRAM, address, data, mask);
49285643}
49295644
49305645
r2454r2455
49355650void data_write_byte_64le(offs_t address, UINT8 data)
49365651{
49375652   UINT32 shift = (address & 7) * 8;
4938   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)data << shift, ~((UINT64)0xff << shift));
5653   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)data << shift, (UINT64)0xff << shift);
49395654}
49405655
49415656void data_write_byte_64be(offs_t address, UINT8 data)
49425657{
49435658   UINT32 shift = (~address & 7) * 8;
4944   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)data << shift, ~((UINT64)0xff << shift));
5659   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)data << shift, (UINT64)0xff << shift);
49455660}
49465661
49475662void data_write_word_64le(offs_t address, UINT16 data)
49485663{
49495664   UINT32 shift = (address & 6) * 8;
4950   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)data << shift, ~((UINT64)0xffff << shift));
5665   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)data << shift, (UINT64)0xffff << shift);
49515666}
49525667
5668void data_write_word_masked_64le(offs_t address, UINT16 data, UINT16 mask)
5669{
5670   UINT32 shift = (address & 6) * 8;
5671   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)data << shift, (UINT64)mask << shift);
5672}
5673
49535674void data_write_word_64be(offs_t address, UINT16 data)
49545675{
49555676   UINT32 shift = (~address & 6) * 8;
4956   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)data << shift, ~((UINT64)0xffff << shift));
5677   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)data << shift, (UINT64)0xffff << shift);
49575678}
49585679
5680void data_write_word_masked_64be(offs_t address, UINT16 data, UINT16 mask)
5681{
5682   UINT32 shift = (~address & 6) * 8;
5683   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)data << shift, (UINT64)mask << shift);
5684}
5685
49595686void data_write_dword_64le(offs_t address, UINT32 data)
49605687{
49615688   UINT32 shift = (address & 4) * 8;
4962   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)data << shift, ~((UINT64)0xffffffff << shift));
5689   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)data << shift, (UINT64)0xffffffff << shift);
49635690}
49645691
5692void data_write_dword_masked_64le(offs_t address, UINT32 data, UINT32 mask)
5693{
5694   UINT32 shift = (address & 4) * 8;
5695   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)data << shift, (UINT64)mask << shift);
5696}
5697
49655698void data_write_dword_64be(offs_t address, UINT32 data)
49665699{
49675700   UINT32 shift = (~address & 4) * 8;
4968   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)data << shift, ~((UINT64)0xffffffff << shift));
5701   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)data << shift, (UINT64)0xffffffff << shift);
49695702}
49705703
5704void data_write_dword_masked_64be(offs_t address, UINT32 data, UINT32 mask)
5705{
5706   UINT32 shift = (~address & 4) * 8;
5707   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, (UINT64)data << shift, (UINT64)mask << shift);
5708}
5709
49715710void data_write_qword_64le(offs_t address, UINT64 data)
49725711{
4973   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, data, 0);
5712   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, data, U64(0xffffffffffffffff));
49745713}
49755714
4976void data_write_qword_64be(offs_t address, UINT64 data)
5715void data_write_qword_masked_64le(offs_t address, UINT64 data, UINT64 mask)
49775716{
4978   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, data, 0);
5717   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, data, mask);
49795718}
49805719
4981void data_write_qword_masked_64le(offs_t address, UINT64 data, UINT64 mem_mask)
5720void data_write_qword_64be(offs_t address, UINT64 data)
49825721{
4983   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, data, mem_mask);
5722   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, data, U64(0xffffffffffffffff));
49845723}
49855724
4986void data_write_qword_masked_64be(offs_t address, UINT64 data, UINT64 mem_mask)
5725void data_write_qword_masked_64be(offs_t address, UINT64 data, UINT64 mask)
49875726{
4988   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, data, mem_mask);
5727   write_qword_masked_generic(ADDRESS_SPACE_DATA, address, data, mask);
49895728}
49905729
49915730
r2454r2455
49965735void io_write_byte_64le(offs_t address, UINT8 data)
49975736{
49985737   UINT32 shift = (address & 7) * 8;
4999   write_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)data << shift, ~((UINT64)0xff << shift));
5738   write_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)data << shift, (UINT64)0xff << shift);
50005739}
50015740
50025741void io_write_byte_64be(offs_t address, UINT8 data)
50035742{
50045743   UINT32 shift = (~address & 7) * 8;
5005   write_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)data << shift, ~((UINT64)0xff << shift));
5744   write_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)data << shift, (UINT64)0xff << shift);
50065745}
50075746
50085747void io_write_word_64le(offs_t address, UINT16 data)
50095748{
50105749   UINT32 shift = (address & 6) * 8;
5011   write_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)data << shift, ~((UINT64)0xffff << shift));
5750   write_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)data << shift, (UINT64)0xffff << shift);
50125751}
50135752
5753void io_write_word_masked_64le(offs_t address, UINT16 data, UINT16 mask)
5754{
5755   UINT32 shift = (address & 6) * 8;
5756   write_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)data << shift, (UINT64)mask << shift);
5757}
5758
50145759void io_write_word_64be(offs_t address, UINT16 data)
50155760{
50165761   UINT32 shift = (~address & 6) * 8;
5017   write_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)data << shift, ~((UINT64)0xffff << shift));
5762   write_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)data << shift, (UINT64)0xffff << shift);
50185763}
50195764
5765void io_write_word_masked_64be(offs_t address, UINT16 data, UINT16 mask)
5766{
5767   UINT32 shift = (~address & 6) * 8;
5768   write_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)data << shift, (UINT64)mask << shift);
5769}
5770
50205771void io_write_dword_64le(offs_t address, UINT32 data)
50215772{
50225773   UINT32 shift = (address & 4) * 8;
5023   write_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)data << shift, ~((UINT64)0xffffffff << shift));
5774   write_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)data << shift, (UINT64)0xffffffff << shift);
50245775}
50255776
5777void io_write_dword_masked_64le(offs_t address, UINT32 data, UINT32 mask)
5778{
5779   UINT32 shift = (address & 4) * 8;
5780   write_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)data << shift, (UINT64)mask << shift);
5781}
5782
50265783void io_write_dword_64be(offs_t address, UINT32 data)
50275784{
50285785   UINT32 shift = (~address & 4) * 8;
5029   write_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)data << shift, ~((UINT64)0xffffffff << shift));
5786   write_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)data << shift, (UINT64)0xffffffff << shift);
50305787}
50315788
5789void io_write_dword_masked_64be(offs_t address, UINT32 data, UINT32 mask)
5790{
5791   UINT32 shift = (~address & 4) * 8;
5792   write_qword_masked_generic(ADDRESS_SPACE_IO, address, (UINT64)data << shift, (UINT64)mask << shift);
5793}
5794
50325795void io_write_qword_64le(offs_t address, UINT64 data)
50335796{
5034   write_qword_masked_generic(ADDRESS_SPACE_IO, address, data, 0);
5797   write_qword_masked_generic(ADDRESS_SPACE_IO, address, data, U64(0xffffffffffffffff));
50355798}
50365799
5037void io_write_qword_64be(offs_t address, UINT64 data)
5800void io_write_qword_masked_64le(offs_t address, UINT64 data, UINT64 mask)
50385801{
5039   write_qword_masked_generic(ADDRESS_SPACE_IO, address, data, 0);
5802   write_qword_masked_generic(ADDRESS_SPACE_IO, address, data, mask);
50405803}
50415804
5042void io_write_qword_masked_64le(offs_t address, UINT64 data, UINT64 mem_mask)
5805void io_write_qword_64be(offs_t address, UINT64 data)
50435806{
5044   write_qword_masked_generic(ADDRESS_SPACE_IO, address, data, mem_mask);
5807   write_qword_masked_generic(ADDRESS_SPACE_IO, address, data, U64(0xffffffffffffffff));
50455808}
50465809
5047void io_write_qword_masked_64be(offs_t address, UINT64 data, UINT64 mem_mask)
5810void io_write_qword_masked_64be(offs_t address, UINT64 data, UINT64 mask)
50485811{
5049   write_qword_masked_generic(ADDRESS_SPACE_IO, address, data, mem_mask);
5812   write_qword_masked_generic(ADDRESS_SPACE_IO, address, data, mask);
50505813}
src/emu/emu.mak
r2454r2455
117117   $(EMUMACHINE)/6821pia.o \
118118   $(EMUMACHINE)/6840ptm.o \
119119   $(EMUMACHINE)/6850acia.o \
120   $(EMUMACHINE)/68681.o \
120121   $(EMUMACHINE)/7474.o \
121122   $(EMUMACHINE)/74123.o \
122123   $(EMUMACHINE)/74148.o \
r2454r2455
142143   $(EMUMACHINE)/mb3773.o \
143144   $(EMUMACHINE)/mb87078.o \
144145   $(EMUMACHINE)/mc146818.o \
146   $(EMUMACHINE)/microtch.o \
145147   $(EMUMACHINE)/msm6242.o \
146148   $(EMUMACHINE)/pc16552d.o \
147149   $(EMUMACHINE)/pci.o \
src/emu/memory.h
r2454r2455
125125
126126   UINT8      (*read_byte)(offs_t byteaddress);
127127   UINT16      (*read_word)(offs_t byteaddress);
128   UINT16      (*read_word_masked)(offs_t byteaddress, UINT16 mask);
128129   UINT32      (*read_dword)(offs_t byteaddress);
129130   UINT32      (*read_dword_masked)(offs_t byteaddress, UINT32 mask);
130131   UINT64      (*read_qword)(offs_t byteaddress);
r2454r2455
132133
133134   void      (*write_byte)(offs_t byteaddress, UINT8 data);
134135   void      (*write_word)(offs_t byteaddress, UINT16 data);
136   void      (*write_word_masked)(offs_t byteaddress, UINT16 data, UINT16 mask);
135137   void      (*write_dword)(offs_t byteaddress, UINT32 data);
136138   void      (*write_dword_masked)(offs_t byteaddress, UINT32 data, UINT32 mask);
137139   void      (*write_qword)(offs_t byteaddress, UINT64 data);
r2454r2455
426428
427429
428430/* helper macro for merging data with the memory mask */
429#define COMBINE_DATA(varptr)         (*(varptr) = (*(varptr) & mem_mask) | (data & ~mem_mask))
431#define COMBINE_DATA(varptr)         (*(varptr) = (*(varptr) & ~mem_mask) | (data & mem_mask))
430432
431#define ACCESSING_BITS_0_7            ((~mem_mask & 0x000000ff) != 0)
432#define ACCESSING_BITS_8_15            ((~mem_mask & 0x0000ff00) != 0)
433#define ACCESSING_BITS_16_23         ((~mem_mask & 0x00ff0000) != 0)
434#define ACCESSING_BITS_24_31         ((~mem_mask & 0xff000000) != 0)
435#define ACCESSING_BITS_32_39         ((~mem_mask & U64(0x000000ff00000000)) != 0)
436#define ACCESSING_BITS_40_47         ((~mem_mask & U64(0x0000ff0000000000)) != 0)
437#define ACCESSING_BITS_48_55         ((~mem_mask & U64(0x00ff000000000000)) != 0)
438#define ACCESSING_BITS_56_63         ((~mem_mask & U64(0xff00000000000000)) != 0)
433#define ACCESSING_BITS_0_7            ((mem_mask & 0x000000ff) != 0)
434#define ACCESSING_BITS_8_15            ((mem_mask & 0x0000ff00) != 0)
435#define ACCESSING_BITS_16_23         ((mem_mask & 0x00ff0000) != 0)
436#define ACCESSING_BITS_24_31         ((mem_mask & 0xff000000) != 0)
437#define ACCESSING_BITS_32_39         ((mem_mask & U64(0x000000ff00000000)) != 0)
438#define ACCESSING_BITS_40_47         ((mem_mask & U64(0x0000ff0000000000)) != 0)
439#define ACCESSING_BITS_48_55         ((mem_mask & U64(0x00ff000000000000)) != 0)
440#define ACCESSING_BITS_56_63         ((mem_mask & U64(0xff00000000000000)) != 0)
439441
440#define ACCESSING_BITS_0_15            ((~mem_mask & 0x0000ffff) != 0)
441#define ACCESSING_BITS_16_31         ((~mem_mask & 0xffff0000) != 0)
442#define ACCESSING_BITS_32_47         ((~mem_mask & U64(0x0000ffff00000000)) != 0)
443#define ACCESSING_BITS_48_63         ((~mem_mask & U64(0xffff000000000000)) != 0)
442#define ACCESSING_BITS_0_15            ((mem_mask & 0x0000ffff) != 0)
443#define ACCESSING_BITS_16_31         ((mem_mask & 0xffff0000) != 0)
444#define ACCESSING_BITS_32_47         ((mem_mask & U64(0x0000ffff00000000)) != 0)
445#define ACCESSING_BITS_48_63         ((mem_mask & U64(0xffff000000000000)) != 0)
444446
445#define ACCESSING_BITS_0_31            ((~mem_mask & 0xffffffff) != 0)
446#define ACCESSING_BITS_32_63         ((~mem_mask & U64(0xffffffff00000000)) != 0)
447#define ACCESSING_BITS_0_31            ((mem_mask & 0xffffffff) != 0)
448#define ACCESSING_BITS_32_63         ((mem_mask & U64(0xffffffff00000000)) != 0)
447449
448450
449451/* bank switching for CPU cores */
r2454r2455
957959/* declare program address space handlers */
958960UINT8 program_read_byte_8le(offs_t address);
959961UINT16 program_read_word_8le(offs_t address);
962UINT16 program_read_word_masked_8le(offs_t address, UINT16 mask);
960963UINT32 program_read_dword_8le(offs_t address);
964UINT32 program_read_dword_masked_8le(offs_t address, UINT32 mask);
961965UINT64 program_read_qword_8le(offs_t address);
966UINT64 program_read_qword_masked_8le(offs_t address, UINT64 mask);
962967void program_write_byte_8le(offs_t address, UINT8 data);
963968void program_write_word_8le(offs_t address, UINT16 data);
969void program_write_word_masked_8le(offs_t address, UINT16 data, UINT16 mask);
964970void program_write_dword_8le(offs_t address, UINT32 data);
971void program_write_dword_masked_8le(offs_t address, UINT32 data, UINT32 mask);
965972void program_write_qword_8le(offs_t address, UINT64 data);
973void program_write_qword_masked_8le(offs_t address, UINT64 data, UINT64 mask);
966974
967975UINT8 program_read_byte_8be(offs_t address);
968976UINT16 program_read_word_8be(offs_t address);
977UINT16 program_read_word_masked_8be(offs_t address, UINT16 mask);
969978UINT32 program_read_dword_8be(offs_t address);
979UINT32 program_read_dword_masked_8be(offs_t address, UINT32 mask);
970980UINT64 program_read_qword_8be(offs_t address);
981UINT64 program_read_qword_masked_8be(offs_t address, UINT64 mask);
971982void program_write_byte_8be(offs_t address, UINT8 data);
972983void program_write_word_8be(offs_t address, UINT16 data);
984void program_write_word_masked_8be(offs_t address, UINT16 data, UINT16 mask);
973985void program_write_dword_8be(offs_t address, UINT32 data);
986void program_write_dword_masked_8be(offs_t address, UINT32 data, UINT32 mask);
974987void program_write_qword_8be(offs_t address, UINT64 data);
988void program_write_qword_masked_8be(offs_t address, UINT64 data, UINT64 mask);
975989
976990UINT8 program_read_byte_16le(offs_t address);
977991UINT16 program_read_word_16le(offs_t address);
992UINT16 program_read_word_masked_16le(offs_t address, UINT16 mask);
978993UINT32 program_read_dword_16le(offs_t address);
994UINT32 program_read_dword_masked_16le(offs_t address, UINT32 mask);
979995UINT64 program_read_qword_16le(offs_t address);
996UINT64 program_read_qword_masked_16le(offs_t address, UINT64 mask);
980997void program_write_byte_16le(offs_t address, UINT8 data);
981998void program_write_word_16le(offs_t address, UINT16 data);
999void program_write_word_masked_16le(offs_t address, UINT16 data, UINT16 mask);
9821000void program_write_dword_16le(offs_t address, UINT32 data);
1001void program_write_dword_masked_16le(offs_t address, UINT32 data, UINT32 mask);
9831002void program_write_qword_16le(offs_t address, UINT64 data);
1003void program_write_qword_masked_16le(offs_t address, UINT64 data, UINT64 mask);
9841004
9851005UINT8 program_read_byte_16be(offs_t address);
9861006UINT16 program_read_word_16be(offs_t address);
1007UINT16 program_read_word_masked_16be(offs_t address, UINT16 mask);
9871008UINT32 program_read_dword_16be(offs_t address);
1009UINT32 program_read_dword_masked_16be(offs_t address, UINT32 mask);
9881010UINT64 program_read_qword_16be(offs_t address);
1011UINT64 program_read_qword_masked_16be(offs_t address, UINT64 mask);
9891012void program_write_byte_16be(offs_t address, UINT8 data);
9901013void program_write_word_16be(offs_t address, UINT16 data);
1014void program_write_word_masked_16be(offs_t address, UINT16 data, UINT16 mask);
9911015void program_write_dword_16be(offs_t address, UINT32 data);
1016void program_write_dword_masked_16be(offs_t address, UINT32 data, UINT32 mask);
9921017void program_write_qword_16be(offs_t address, UINT64 data);
1018void program_write_qword_masked_16be(offs_t address, UINT64 data, UINT64 mask);
9931019
9941020UINT8 program_read_byte_32le(offs_t address);
9951021UINT16 program_read_word_32le(offs_t address);
1022UINT16 program_read_word_masked_32le(offs_t address, UINT16 mask);
9961023UINT32 program_read_dword_32le(offs_t address);
997UINT32 program_read_dword_masked_32le(offs_t address, UINT32 mem_mask);
1024UINT32 program_read_dword_masked_32le(offs_t address, UINT32 mask);
9981025UINT64 program_read_qword_32le(offs_t address);
1026UINT64 program_read_qword_masked_32le(offs_t address, UINT64 mask);
9991027void program_write_byte_32le(offs_t address, UINT8 data);
10001028void program_write_word_32le(offs_t address, UINT16 data);
1029void program_write_word_masked_32le(offs_t address, UINT16 data, UINT16 mask);
10011030void program_write_dword_32le(offs_t address, UINT32 data);
1002void program_write_dword_masked_32le(offs_t address, UINT32 data, UINT32 mem_mask);
1031void program_write_dword_masked_32le(offs_t address, UINT32 data, UINT32 mask);
10031032void program_write_qword_32le(offs_t address, UINT64 data);
1033void program_write_qword_masked_32le(offs_t address, UINT64 data, UINT64 mask);
10041034
10051035UINT8 program_read_byte_32be(offs_t address);
10061036UINT16 program_read_word_32be(offs_t address);
1037UINT16 program_read_word_masked_32be(offs_t address, UINT16 mask);
10071038UINT32 program_read_dword_32be(offs_t address);
1008UINT32 program_read_dword_masked_32be(offs_t address, UINT32 mem_mask);
1039UINT32 program_read_dword_masked_32be(offs_t address, UINT32 mask);
10091040UINT64 program_read_qword_32be(offs_t address);
1041UINT64 program_read_qword_masked_32be(offs_t address, UINT64 mask);
10101042void program_write_byte_32be(offs_t address, UINT8 data);
10111043void program_write_word_32be(offs_t address, UINT16 data);
1044void program_write_word_masked_32be(offs_t address, UINT16 data, UINT16 mask);
10121045void program_write_dword_32be(offs_t address, UINT32 data);
1013void program_write_dword_masked_32be(offs_t address, UINT32 data, UINT32 mem_mask);
1046void program_write_dword_masked_32be(offs_t address, UINT32 data, UINT32 mask);
10141047void program_write_qword_32be(offs_t address, UINT64 data);
1048void program_write_qword_masked_32be(offs_t address, UINT64 data, UINT64 mask);
10151049
10161050UINT8 program_read_byte_64le(offs_t address);
10171051UINT16 program_read_word_64le(offs_t address);
1052UINT16 program_read_word_masked_64le(offs_t address, UINT16 mask);
10181053UINT32 program_read_dword_64le(offs_t address);
1054UINT32 program_read_dword_masked_64le(offs_t address, UINT32 mask);
10191055UINT64 program_read_qword_64le(offs_t address);
1020UINT64 program_read_qword_masked_64le(offs_t address, UINT64 mem_mask);
1056UINT64 program_read_qword_masked_64le(offs_t address, UINT64 mask);
10211057void program_write_byte_64le(offs_t address, UINT8 data);
10221058void program_write_word_64le(offs_t address, UINT16 data);
1059void program_write_word_masked_64le(offs_t address, UINT16 data, UINT16 mask);
10231060void program_write_dword_64le(offs_t address, UINT32 data);
1061void program_write_dword_masked_64le(offs_t address, UINT32 data, UINT32 mask);
10241062void program_write_qword_64le(offs_t address, UINT64 data);
1025void program_write_qword_masked_64le(offs_t address, UINT64 data, UINT64 mem_mask);
1063void program_write_qword_masked_64le(offs_t address, UINT64 data, UINT64 mask);
10261064
10271065UINT8 program_read_byte_64be(offs_t address);
10281066UINT16 program_read_word_64be(offs_t address);
1067UINT16 program_read_word_masked_64be(offs_t address, UINT16 mask);
10291068UINT32 program_read_dword_64be(offs_t address);
1069UINT32 program_read_dword_masked_64be(offs_t address, UINT32 mask);
10301070UINT64 program_read_qword_64be(offs_t address);
1031UINT64 program_read_qword_masked_64be(offs_t address, UINT64 mem_mask);
1071UINT64 program_read_qword_masked_64be(offs_t address, UINT64 mask);
10321072void program_write_byte_64be(offs_t address, UINT8 data);
10331073void program_write_word_64be(offs_t address, UINT16 data);
1074void program_write_word_masked_64be(offs_t address, UINT16 data, UINT16 mask);
10341075void program_write_dword_64be(offs_t address, UINT32 data);
1076void program_write_dword_masked_64be(offs_t address, UINT32 data, UINT32 mask);
10351077void program_write_qword_64be(offs_t address, UINT64 data);
1036void program_write_qword_masked_64be(offs_t address, UINT64 data, UINT64 mem_mask);
1078void program_write_qword_masked_64be(offs_t address, UINT64 data, UINT64 mask);
10371079
10381080
10391081/* declare data address space handlers */
10401082UINT8 data_read_byte_8le(offs_t address);
10411083UINT16 data_read_word_8le(offs_t address);
1084UINT16 data_read_word_masked_8le(offs_t address, UINT16 mask);
10421085UINT32 data_read_dword_8le(offs_t address);
1086UINT32 data_read_dword_masked_8le(offs_t address, UINT32 mask);
10431087UINT64 data_read_qword_8le(offs_t address);
1088UINT64 data_read_qword_masked_8le(offs_t address, UINT64 mask);
10441089void data_write_byte_8le(offs_t address, UINT8 data);
10451090void data_write_word_8le(offs_t address, UINT16 data);
1091void data_write_word_masked_8le(offs_t address, UINT16 data, UINT16 mask);
10461092void data_write_dword_8le(offs_t address, UINT32 data);
1093void data_write_dword_masked_8le(offs_t address, UINT32 data, UINT32 mask);
10471094void data_write_qword_8le(offs_t address, UINT64 data);
1095void data_write_qword_masked_8le(offs_t address, UINT64 data, UINT64 mask);
10481096
10491097UINT8 data_read_byte_8be(offs_t address);
10501098UINT16 data_read_word_8be(offs_t address);
1099UINT16 data_read_word_masked_8be(offs_t address, UINT16 mask);
10511100UINT32 data_read_dword_8be(offs_t address);
1101UINT32 data_read_dword_masked_8be(offs_t address, UINT32 mask);
10521102UINT64 data_read_qword_8be(offs_t address);
1103UINT64 data_read_qword_masked_8be(offs_t address, UINT64 mask);
10531104void data_write_byte_8be(offs_t address, UINT8 data);
10541105void data_write_word_8be(offs_t address, UINT16 data);
1106void data_write_word_masked_8be(offs_t address, UINT16 data, UINT16 mask);
10551107void data_write_dword_8be(offs_t address, UINT32 data);
1108void data_write_dword_masked_8be(offs_t address, UINT32 data, UINT32 mask);
10561109void data_write_qword_8be(offs_t address, UINT64 data);
1110void data_write_qword_masked_8be(offs_t address, UINT64 data, UINT64 mask);
10571111
10581112UINT8 data_read_byte_16le(offs_t address);
10591113UINT16 data_read_word_16le(offs_t address);
1114UINT16 data_read_word_masked_16le(offs_t address, UINT16 mask);
10601115UINT32 data_read_dword_16le(offs_t address);
1116UINT32 data_read_dword_masked_16le(offs_t address, UINT32 mask);
10611117UINT64 data_read_qword_16le(offs_t address);
1118UINT64 data_read_qword_masked_16le(offs_t address, UINT64 mask);
10621119void data_write_byte_16le(offs_t address, UINT8 data);
10631120void data_write_word_16le(offs_t address, UINT16 data);
1121void data_write_word_masked_16le(offs_t address, UINT16 data, UINT16 mask);
10641122void data_write_dword_16le(offs_t address, UINT32 data);
1123void data_write_dword_masked_16le(offs_t address, UINT32 data, UINT32 mask);
10651124void data_write_qword_16le(offs_t address, UINT64 data);
1125void data_write_qword_masked_16le(offs_t address, UINT64 data, UINT64 mask);
10661126
10671127UINT8 data_read_byte_16be(offs_t address);
10681128UINT16 data_read_word_16be(offs_t address);
1129UINT16 data_read_word_masked_16be(offs_t address, UINT16 mask);
10691130UINT32 data_read_dword_16be(offs_t address);
1131UINT32 data_read_dword_masked_16be(offs_t address, UINT32 mask);
10701132UINT64 data_read_qword_16be(offs_t address);
1133UINT64 data_read_qword_masked_16be(offs_t address, UINT64 mask);
10711134void data_write_byte_16be(offs_t address, UINT8 data);
10721135void data_write_word_16be(offs_t address, UINT16 data);
1136void data_write_word_masked_16be(offs_t address, UINT16 data, UINT16 mask);
10731137void data_write_dword_16be(offs_t address, UINT32 data);
1138void data_write_dword_masked_16be(offs_t address, UINT32 data, UINT32 mask);
10741139void data_write_qword_16be(offs_t address, UINT64 data);
1140void data_write_qword_masked_16be(offs_t address, UINT64 data, UINT64 mask);
10751141
10761142UINT8 data_read_byte_32le(offs_t address);
10771143UINT16 data_read_word_32le(offs_t address);
1144UINT16 data_read_word_masked_32le(offs_t address, UINT16 mask);
10781145UINT32 data_read_dword_32le(offs_t address);
1079UINT32 data_read_dword_masked_32le(offs_t address, UINT32 mem_mask);
1146UINT32 data_read_dword_masked_32le(offs_t address, UINT32 mask);
10801147UINT64 data_read_qword_32le(offs_t address);
1148UINT64 data_read_qword_masked_32le(offs_t address, UINT64 mask);
10811149void data_write_byte_32le(offs_t address, UINT8 data);
10821150void data_write_word_32le(offs_t address, UINT16 data);
1151void data_write_word_masked_32le(offs_t address, UINT16 data, UINT16 mask);
10831152void data_write_dword_32le(offs_t address, UINT32 data);
1084void data_write_dword_masked_32le(offs_t address, UINT32 data, UINT32 mem_mask);
1153void data_write_dword_masked_32le(offs_t address, UINT32 data, UINT32 mask);
10851154void data_write_qword_32le(offs_t address, UINT64 data);
1155void data_write_qword_masked_32le(offs_t address, UINT64 data, UINT64 mask);
10861156
10871157UINT8 data_read_byte_32be(offs_t address);
10881158UINT16 data_read_word_32be(offs_t address);
1159UINT16 data_read_word_masked_32be(offs_t address, UINT16 mask);
10891160UINT32 data_read_dword_32be(offs_t address);
1090UINT32 data_read_dword_masked_32be(offs_t address, UINT32 mem_mask);
1161UINT32 data_read_dword_masked_32be(offs_t address, UINT32 mask);
10911162UINT64 data_read_qword_32be(offs_t address);
1163UINT64 data_read_qword_masked_32be(offs_t address, UINT64 mask);
10921164void data_write_byte_32be(offs_t address, UINT8 data);
10931165void data_write_word_32be(offs_t address, UINT16 data);
1166void data_write_word_masked_32be(offs_t address, UINT16 data, UINT16 mask);
10941167void data_write_dword_32be(offs_t address, UINT32 data);
1095void data_write_dword_masked_32be(offs_t address, UINT32 data, UINT32 mem_mask);
1168void data_write_dword_masked_32be(offs_t address, UINT32 data, UINT32 mask);
10961169void data_write_qword_32be(offs_t address, UINT64 data);
1170void data_write_qword_masked_32be(offs_t address, UINT64 data, UINT64 mask);
10971171
10981172UINT8 data_read_byte_64le(offs_t address);
10991173UINT16 data_read_word_64le(offs_t address);
1174UINT16 data_read_word_masked_64le(offs_t address, UINT16 mask);
11001175UINT32 data_read_dword_64le(offs_t address);
1176UINT32 data_read_dword_masked_64le(offs_t address, UINT32 mask);
11011177UINT64 data_read_qword_64le(offs_t address);
1102UINT64 data_read_qword_masked_64le(offs_t address, UINT64 mem_mask);
1178UINT64 data_read_qword_masked_64le(offs_t address, UINT64 mask);
11031179void data_write_byte_64le(offs_t address, UINT8 data);
11041180void data_write_word_64le(offs_t address, UINT16 data);
1181void data_write_word_masked_64le(offs_t address, UINT16 data, UINT16 mask);
11051182void data_write_dword_64le(offs_t address, UINT32 data);
1183void data_write_dword_masked_64le(offs_t address, UINT32 data, UINT32 mask);
11061184void data_write_qword_64le(offs_t address, UINT64 data);
1107void data_write_qword_masked_64le(offs_t address, UINT64 data, UINT64 mem_mask);
1185void data_write_qword_masked_64le(offs_t address, UINT64 data, UINT64 mask);
11081186
11091187UINT8 data_read_byte_64be(offs_t address);
11101188UINT16 data_read_word_64be(offs_t address);
1189UINT16 data_read_word_masked_64be(offs_t address, UINT16 mask);
11111190UINT32 data_read_dword_64be(offs_t address);
1191UINT32 data_read_dword_masked_64be(offs_t address, UINT32 mask);
11121192UINT64 data_read_qword_64be(offs_t address);
1113UINT64 data_read_qword_masked_64be(offs_t address, UINT64 mem_mask);
1193UINT64 data_read_qword_masked_64be(offs_t address, UINT64 mask);
11141194void data_write_byte_64be(offs_t address, UINT8 data);
11151195void data_write_word_64be(offs_t address, UINT16 data);
1196void data_write_word_masked_64be(offs_t address, UINT16 data, UINT16 mask);
11161197void data_write_dword_64be(offs_t address, UINT32 data);
1198void data_write_dword_masked_64be(offs_t address, UINT32 data, UINT32 mask);
11171199void data_write_qword_64be(offs_t address, UINT64 data);
1118void data_write_qword_masked_64be(offs_t address, UINT64 data, UINT64 mem_mask);
1200void data_write_qword_masked_64be(offs_t address, UINT64 data, UINT64 mask);
11191201
11201202
11211203/* declare io address space handlers */
11221204UINT8 io_read_byte_8le(offs_t address);
11231205UINT16 io_read_word_8le(offs_t address);
1206UINT16 io_read_word_masked_8le(offs_t address, UINT16 mask);
11241207UINT32 io_read_dword_8le(offs_t address);
1208UINT32 io_read_dword_masked_8le(offs_t address, UINT32 mask);
11251209UINT64 io_read_qword_8le(offs_t address);
1210UINT64 io_read_qword_masked_8le(offs_t address, UINT64 mask);
11261211void io_write_byte_8le(offs_t address, UINT8 data);
11271212void io_write_word_8le(offs_t address, UINT16 data);
1213void io_write_word_masked_8le(offs_t address, UINT16 data, UINT16 mask);
11281214void io_write_dword_8le(offs_t address, UINT32 data);
1215void io_write_dword_masked_8le(offs_t address, UINT32 data, UINT32 mask);
11291216void io_write_qword_8le(offs_t address, UINT64 data);
1217void io_write_qword_masked_8le(offs_t address, UINT64 data, UINT64 mask);
11301218
11311219UINT8 io_read_byte_8be(offs_t address);
11321220UINT16 io_read_word_8be(offs_t address);
1221UINT16 io_read_word_masked_8be(offs_t address, UINT16 mask);
11331222UINT32 io_read_dword_8be(offs_t address);
1223UINT32 io_read_dword_masked_8be(offs_t address, UINT32 mask);
11341224UINT64 io_read_qword_8be(offs_t address);
1225UINT64 io_read_qword_masked_8be(offs_t address, UINT64 mask);
11351226void io_write_byte_8be(offs_t address, UINT8 data);
11361227void io_write_word_8be(offs_t address, UINT16 data);
1228void io_write_word_masked_8be(offs_t address, UINT16 data, UINT16 mask);
11371229void io_write_dword_8be(offs_t address, UINT32 data);
1230void io_write_dword_masked_8be(offs_t address, UINT32 data, UINT32 mask);
11381231void io_write_qword_8be(offs_t address, UINT64 data);
1232void io_write_qword_masked_8be(offs_t address, UINT64 data, UINT64 mask);
11391233
11401234UINT8 io_read_byte_16le(offs_t address);
11411235UINT16 io_read_word_16le(offs_t address);
1236UINT16 io_read_word_masked_16le(offs_t address, UINT16 mask);
11421237UINT32 io_read_dword_16le(offs_t address);
1238UINT32 io_read_dword_masked_16le(offs_t address, UINT32 mask);
11431239UINT64 io_read_qword_16le(offs_t address);
1240UINT64 io_read_qword_masked_16le(offs_t address, UINT64 mask);
11441241void io_write_byte_16le(offs_t address, UINT8 data);
11451242void io_write_word_16le(offs_t address, UINT16 data);
1243void io_write_word_masked_16le(offs_t address, UINT16 data, UINT16 mask);
11461244void io_write_dword_16le(offs_t address, UINT32 data);
1245void io_write_dword_masked_16le(offs_t address, UINT32 data, UINT32 mask);
11471246void io_write_qword_16le(offs_t address, UINT64 data);
1247void io_write_qword_masked_16le(offs_t address, UINT64 data, UINT64 mask);
11481248
11491249UINT8 io_read_byte_16be(offs_t address);
11501250UINT16 io_read_word_16be(offs_t address);
1251UINT16 io_read_word_masked_16be(offs_t address, UINT16 mask);
11511252UINT32 io_read_dword_16be(offs_t address);
1253UINT32 io_read_dword_masked_16be(offs_t address, UINT32 mask);
11521254UINT64 io_read_qword_16be(offs_t address);
1255UINT64 io_read_qword_masked_16be(offs_t address, UINT64 mask);
11531256void io_write_byte_16be(offs_t address, UINT8 data);
11541257void io_write_word_16be(offs_t address, UINT16 data);
1258void io_write_word_masked_16be(offs_t address, UINT16 data, UINT16 mask);
11551259void io_write_dword_16be(offs_t address, UINT32 data);
1260void io_write_dword_masked_16be(offs_t address, UINT32 data, UINT32 mask);
11561261void io_write_qword_16be(offs_t address, UINT64 data);
1262void io_write_qword_masked_16be(offs_t address, UINT64 data, UINT64 mask);
11571263
11581264UINT8 io_read_byte_32le(offs_t address);
11591265UINT16 io_read_word_32le(offs_t address);
1266UINT16 io_read_word_masked_32le(offs_t address, UINT16 mask);
11601267UINT32 io_read_dword_32le(offs_t address);
1161UINT32 io_read_dword_masked_32le(offs_t address, UINT32 mem_mask);
1268UINT32 io_read_dword_masked_32le(offs_t address, UINT32 mask);
11621269UINT64 io_read_qword_32le(offs_t address);
1270UINT64 io_read_qword_masked_32le(offs_t address, UINT64 mask);
11631271void io_write_byte_32le(offs_t address, UINT8 data);
11641272void io_write_word_32le(offs_t address, UINT16 data);
1273void io_write_word_masked_32le(offs_t address, UINT16 data, UINT16 mask);
11651274void io_write_dword_32le(offs_t address, UINT32 data);
1166void io_write_dword_masked_32le(offs_t address, UINT32 data, UINT32 mem_mask);
1275void io_write_dword_masked_32le(offs_t address, UINT32 data, UINT32 mask);
11671276void io_write_qword_32le(offs_t address, UINT64 data);
1277void io_write_qword_masked_32le(offs_t address, UINT64 data, UINT64 mask);
11681278
11691279UINT8 io_read_byte_32be(offs_t address);
11701280UINT16 io_read_word_32be(offs_t address);
1281UINT16 io_read_word_masked_32be(offs_t address, UINT16 mask);
11711282UINT32 io_read_dword_32be(offs_t address);
1172UINT32 io_read_dword_masked_32be(offs_t address, UINT32 mem_mask);
1283UINT32 io_read_dword_masked_32be(offs_t address, UINT32 mask);
11731284UINT64 io_read_qword_32be(offs_t address);
1285UINT64 io_read_qword_masked_32be(offs_t address, UINT64 mask);
11741286void io_write_byte_32be(offs_t address, UINT8 data);
11751287void io_write_word_32be(offs_t address, UINT16 data);
1288void io_write_word_masked_32be(offs_t address, UINT16 data, UINT16 mask);
11761289void io_write_dword_32be(offs_t address, UINT32 data);
1177void io_write_dword_masked_32be(offs_t address, UINT32 data, UINT32 mem_mask);
1290void io_write_dword_masked_32be(offs_t address, UINT32 data, UINT32 mask);
11781291void io_write_qword_32be(offs_t address, UINT64 data);
1292void io_write_qword_masked_32be(offs_t address, UINT64 data, UINT64 mask);
11791293
11801294UINT8 io_read_byte_64le(offs_t address);
11811295UINT16 io_read_word_64le(offs_t address);
1296UINT16 io_read_word_masked_64le(offs_t address, UINT16 mask);
11821297UINT32 io_read_dword_64le(offs_t address);
1298UINT32 io_read_dword_masked_64le(offs_t address, UINT32 mask);
11831299UINT64 io_read_qword_64le(offs_t address);
1184UINT64 io_read_qword_masked_64le(offs_t address, UINT64 mem_mask);
1300UINT64 io_read_qword_masked_64le(offs_t address, UINT64 mask);
11851301void io_write_byte_64le(offs_t address, UINT8 data);
11861302void io_write_word_64le(offs_t address, UINT16 data);
1303void io_write_word_masked_64le(offs_t address, UINT16 data, UINT16 mask);
11871304void io_write_dword_64le(offs_t address, UINT32 data);
1305void io_write_dword_masked_64le(offs_t address, UINT32 data, UINT32 mask);
11881306void io_write_qword_64le(offs_t address, UINT64 data);
1189void io_write_qword_masked_64le(offs_t address, UINT64 data, UINT64 mem_mask);
1307void io_write_qword_masked_64le(offs_t address, UINT64 data, UINT64 mask);
11901308
11911309UINT8 io_read_byte_64be(offs_t address);
11921310UINT16 io_read_word_64be(offs_t address);
1311UINT16 io_read_word_masked_64be(offs_t address, UINT16 mask);
11931312UINT32 io_read_dword_64be(offs_t address);
1313UINT32 io_read_dword_masked_64be(offs_t address, UINT32 mask);
11941314UINT64 io_read_qword_64be(offs_t address);
1195UINT64 io_read_qword_masked_64be(offs_t address, UINT64 mem_mask);
1315UINT64 io_read_qword_masked_64be(offs_t address, UINT64 mask);
11961316void io_write_byte_64be(offs_t address, UINT8 data);
11971317void io_write_word_64be(offs_t address, UINT16 data);
1318void io_write_word_masked_64be(offs_t address, UINT16 data, UINT16 mask);
11981319void io_write_dword_64be(offs_t address, UINT32 data);
1320void io_write_dword_masked_64be(offs_t address, UINT32 data, UINT32 mask);
11991321void io_write_qword_64be(offs_t address, UINT64 data);
1200void io_write_qword_masked_64be(offs_t address, UINT64 data, UINT64 mem_mask);
1322void io_write_qword_masked_64be(offs_t address, UINT64 data, UINT64 mask);
12011323
12021324
12031325#endif   /* __MEMORY_H__ */
src/emu/machine/msm6242.c
r2454r2455
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "machine/msm6242.h"
109
1110static UINT8 msm6264_reg[3] = { 0, 0, 0 };
r2454r2455
4140   }
4241   else /* otherwise, use the current time */
4342   {
44      mame_get_current_datetime(Machine, &curtime);
43      mame_get_current_datetime(machine, &curtime);
4544   }
4645
4746   switch(offset)
r2454r2455
5352      case MSM6264_REG_H1:
5453      case MSM6264_REG_H10:
5554      {
55         int   hour = systime->local_time.hour;
56
5657         /* check for 12/24 hour mode */
5758         if ( (msm6264_reg[2] & 0x04) == 0 ) /* 12 hour mode? */
5859         {
59            int   hour = systime->local_time.hour;
60            int   pm = (hour >= 12) ? 1 : 0;
60            hour %= 12;
6161
62            if ( pm ) hour -= 12;
63            if ( hour == 0 ) hour = 12;
64
65            if ( offset == MSM6264_REG_H1 )
66               return hour % 10;
67
68            return (hour / 10) | (pm << 2);
62            if ( hour == 0 )
63            hour = 12;
6964         }
7065
7166         if ( offset == MSM6264_REG_H1 )
72            return systime->local_time.hour % 10;
67            return hour % 10;
7368
74         return systime->local_time.hour / 10;
69         return hour / 10;
7570      }
7671
7772      case MSM6264_REG_D1: return systime->local_time.mday % 10;
7873      case MSM6264_REG_D10: return systime->local_time.mday / 10;
7974      case MSM6264_REG_MO1: return (systime->local_time.month+1) % 10;
8075      case MSM6264_REG_MO10: return (systime->local_time.month+1) / 10;
81      case MSM6264_REG_Y1: return (systime->local_time.year - 1900) % 10;
82      case MSM6264_REG_Y10: return (systime->local_time.year - 1900) / 10;
76      case MSM6264_REG_Y1: return systime->local_time.year % 10;
77      case MSM6264_REG_Y10: return (systime->local_time.year % 100) / 10;
8378      case MSM6264_REG_W: return systime->local_time.weekday;
8479      case MSM6264_REG_CD: return msm6264_reg[0];
8580      case MSM6264_REG_CE: return msm6264_reg[1];
r2454r2455
10095
10196          if ( data & 1 )   /* was Hold set? */
10297          {
103             mame_get_current_datetime(Machine, &msm6264_hold_time);
98             mame_get_current_datetime(machine, &msm6264_hold_time);
10499          }
105100
106101          return;
src/emu/machine/idectrl.c
r2454r2455
77#include "driver.h"
88#include "idectrl.h"
99#include "debugger.h"
10#include "deprecat.h"
1110
1211
1312/***************************************************************************
src/emu/machine/68681.c
r0r2455
1/*
2    68681 DUART
3
4    Written by Mariusz Wojcieszek
5
6    Emulation is preliminary, only features required by Touch Master games are implemented
7
8    ToDo:
9    - interrupts other than RXRDY
10    - timer/counter
11    - input port
12    - input port change
13    - output port
14    - output port when used as control signals
15    - MAME device interface
16    - multiple instances
17*/
18
19#include "driver.h"
20
21#define INT_INPUT_PORT_CHANGE      0x80
22#define INT_DELTA_BREAK_B         0x40
23#define INT_RXRDY_FFULLB         0x20
24#define INT_TXRDYB               0x10
25#define INT_COUNTER_READY         0x08
26#define INT_DELTA_BREAK_A         0x04
27#define INT_RXRDY_FFULLA         0x02
28#define INT_TXRDYA               0x01
29
30#define STATUS_RECEIVED_BREAK      0x80
31#define STATUS_FRAMING_ERROR      0x40
32#define STATUS_PARITY_ERROR         0x20
33#define STATUS_OVERRUN_ERROR      0x10
34#define STATUS_TRANSMITTER_EMPTY   0x08
35#define STATUS_TRANSMITTER_READY   0x04
36#define STATUS_FIFO_FULL         0x02
37#define STATUS_RECEIVER_READY      0x01
38
39#define MODE_RX_INT_SELECT_BIT      6
40
41#define RX_FIFO_SIZE            3
42
43typedef struct
44{
45   /* Registers */
46   UINT8 CR;  /* Command register */
47   UINT8 CSR; /* Clock select register */
48   UINT8 MR1; /* Mode register 1 */
49   UINT8 MR2; /* Mode register 2 */
50   UINT8 MR_ptr; /* Mode register pointer */
51   UINT8 SR;  /* Status register */
52
53   /* State */
54   int   baud_rate;
55
56   /* Receiver */
57   UINT8 rx_enabled;
58   UINT8 rx_fifo[RX_FIFO_SIZE];
59   int   rx_fifo_read_ptr;
60   int   rx_fifo_write_ptr;
61   int   rx_fifo_num;
62
63   /* Transmitter */
64   UINT8 tx_enabled;
65   UINT8 tx_data;
66   UINT8 tx_ready;
67   emu_timer *tx_timer;
68
69} DUART_68681_CHANNEL;
70
71typedef struct
72{
73   int   frequency;
74
75   // registers
76   UINT8 ACR;  /* Auxiliary Control Register */
77   UINT8 IMR;  /* Interrupt Mask Register */
78   UINT8 ISR;  /* Interrupt Status Register */
79   UINT8 IVR;  /* Interrupt Vector Register */
80   UINT8 OPCR; /* Output Port Conf. Register */
81
82   // state
83   UINT8 IP_last_state; /* last state of IP bits */
84
85   // callbacks
86   UINT8 (*input_port_read)(void);
87   void  (*tx_callback)(int channel, UINT8 data);
88   void  (*irq_handler)(UINT8 vector);
89
90   DUART_68681_CHANNEL channel[2];
91} DUART_68681;
92
93static DUART_68681 duart_68681;
94
95static void duart_68681_update_interrupts( void )
96{
97   if ( (duart_68681.ISR & duart_68681.IMR) != 0 )
98   {
99      if ( duart_68681.irq_handler )
100      {
101         duart_68681.irq_handler( duart_68681.IVR );
102      }
103   }
104};
105
106static void duart_68681_write_MR( int ch, UINT8 data )
107{
108   if ( duart_68681.channel[ch].MR_ptr == 0 )
109   {
110      duart_68681.channel[ch].MR1 = data;
111      // TODO:
112      duart_68681.channel[ch].MR_ptr = 1;
113   }
114   else
115   {
116      duart_68681.channel[ch].MR2 = data;
117      // TODO:
118   }
119};
120
121static void duart_68681_write_CSR(int ch, UINT8 data, UINT8 ACR)
122{
123   const int baud_rate_ACR_0[] = { 50, 110, 134, 200, 300, 600, 1200, 1050, 2400, 4800, 7200, 9600, 38400, 0, 0, 0 };
124   const int baud_rate_ACR_1[] = { 75, 110, 134, 150, 300, 600, 1200, 2000, 2400, 4800, 1800, 9600, 19200, 0, 0, 0 };
125
126   duart_68681.channel[ch].CSR = data;
127
128   if ( BIT(ACR,7) == 0 )
129   {
130      duart_68681.channel[ch].baud_rate = baud_rate_ACR_0[data & 0x0f];
131   }
132   else
133   {
134      duart_68681.channel[ch].baud_rate = baud_rate_ACR_1[data & 0x0f];
135   }
136   if ( duart_68681.channel[ch].baud_rate == 0 )
137   {
138      logerror( "Unsupported transmitter clock: channel %d, clock select = %02x\n", ch, data );
139   }
140};
141
142static void duart_68681_write_CR(int ch, UINT8 data)
143{
144   duart_68681.channel[ch].CR = data;
145   if ( BIT(data,0) )
146   {
147      duart_68681.channel[ch].rx_enabled = 1;
148   }
149   if ( BIT(data,1) )
150   {
151      duart_68681.channel[ch].rx_enabled = 0;
152      duart_68681.channel[ch].SR &= ~STATUS_RECEIVER_READY;
153   }
154
155   if ( BIT(data,2) )
156   {
157      duart_68681.channel[ch].tx_enabled = 1;
158      duart_68681.channel[ch].tx_ready = 1;
159      duart_68681.channel[ch].SR |= STATUS_TRANSMITTER_READY;
160   }
161   if ( BIT(data,3) )
162   {
163      duart_68681.channel[ch].tx_enabled = 0;
164      duart_68681.channel[ch].tx_ready = 0;
165      duart_68681.channel[ch].SR &= ~STATUS_TRANSMITTER_READY;
166   }
167
168   switch( (data >> 4) & 0x07 )
169   {
170      case 0: /* No command */
171         break;
172      case 1: /* Reset MR pointer. Causes the Channel A MR pointer to point to MR1 */
173         duart_68681.channel[ch].MR_ptr = 0;
174         break;
175      case 2: /* Reset channel A receiver (disable receiver and flush fifo) */
176         duart_68681.channel[ch].rx_enabled = 0;
177         duart_68681.channel[ch].SR &= ~STATUS_RECEIVER_READY;
178         duart_68681.channel[ch].rx_fifo_read_ptr = 0;
179         duart_68681.channel[ch].rx_fifo_write_ptr = 0;
180         duart_68681.channel[ch].rx_fifo_num = 0;
181         break;
182      case 3: /* Reset channel A transmitter */
183         //TODO:
184         break;
185      case 4: /* Reset Error Status */
186         // TODO:
187         duart_68681.channel[ch].SR &= ~(STATUS_RECEIVED_BREAK | STATUS_FRAMING_ERROR | STATUS_PARITY_ERROR | STATUS_OVERRUN_ERROR);
188         break;
189      default:
190         logerror( "68681: Unhandled command (%x) in CR%d\n", ch, (data >> 4) & 0x07 );
191         break;
192   }
193};
194
195static UINT8 duart_68681_read_rx_fifo( int ch )
196{
197   UINT8 r;
198
199   if ( duart_68681.channel[ch].rx_fifo_num == 0 )
200   {
201      logerror( "68681: rx fifo underflow\n" );
202      return 0;
203   }
204
205   r = duart_68681.channel[ch].rx_fifo[duart_68681.channel[ch].rx_fifo_read_ptr++];
206   if ( duart_68681.channel[ch].rx_fifo_read_ptr == RX_FIFO_SIZE )
207   {
208      duart_68681.channel[ch].rx_fifo_read_ptr = 0;
209   }
210
211   duart_68681.channel[ch].rx_fifo_num--;
212
213   if ( duart_68681.channel[ch].rx_fifo_num > 0 )
214   {
215      duart_68681.channel[ch].SR |= STATUS_RECEIVER_READY;
216      if ( ch == 0 )
217      {
218         duart_68681.ISR |= INT_RXRDY_FFULLA;
219      }
220      else
221      {
222         duart_68681.ISR |= INT_RXRDY_FFULLB;
223      }
224   }
225   else
226   {
227      duart_68681.channel[ch].SR &= ~STATUS_RECEIVER_READY;
228      if ( ch == 0 )
229      {
230         duart_68681.ISR &= ~INT_RXRDY_FFULLA;
231      }
232      else
233      {
234         duart_68681.ISR &= ~INT_RXRDY_FFULLB;
235      }
236   }
237   duart_68681_update_interrupts();
238   return r;
239};
240
241static TIMER_CALLBACK( tx_timer_callback )
242{
243   int ch = param & 1;
244
245   if (duart_68681.tx_callback)
246      duart_68681.tx_callback(ch, duart_68681.channel[ch].tx_data);
247
248   duart_68681.channel[ch].tx_ready = 1;
249   duart_68681.channel[ch].SR |= STATUS_TRANSMITTER_READY;
250
251   if (ch == 0)
252      duart_68681.ISR |= INT_TXRDYA;
253   else
254      duart_68681.ISR |= INT_TXRDYB;
255
256   duart_68681_update_interrupts();
257   timer_adjust_oneshot(duart_68681.channel[ch].tx_timer, attotime_never, ch);
258};
259
260static void duart_68681_write_TX(int ch, UINT8 data)
261{
262   attotime period;
263
264   duart_68681.channel[ch].tx_data = data;
265
266   duart_68681.channel[ch].tx_ready = 0;
267   duart_68681.channel[ch].SR &= ~STATUS_TRANSMITTER_READY;
268
269   if (ch == 0)
270      duart_68681.ISR &= ~INT_TXRDYA;
271   else
272      duart_68681.ISR &= ~INT_TXRDYB;
273
274   duart_68681_update_interrupts();
275
276   period = ATTOTIME_IN_HZ(duart_68681.channel[ch].baud_rate / 10 );
277   timer_adjust_oneshot(duart_68681.channel[ch].tx_timer, period, ch);
278};
279
280READ16_HANDLER(duart_68681_r)
281{
282   UINT16 r = 0x0;
283
284   //logerror( "Reading 68681 reg %x\n", offset );
285   switch (offset)
286   {
287      case 0x01: /* SRA */
288         r = duart_68681.channel[0].SR;
289         break;
290      case 0x03: /* Rx Holding Register A */
291         r = duart_68681_read_rx_fifo(0);
292         break;
293      case 0x04: /* IPCR */
294         {
295            UINT8 IP;
296            if ( duart_68681.input_port_read != NULL )
297               IP = duart_68681.input_port_read();
298            else
299               IP = 0x0;
300
301            r = (((duart_68681.IP_last_state ^ IP) & 0x0f) << 4) | (IP & 0x0f);
302            duart_68681.IP_last_state = IP;
303            duart_68681.ISR &= ~INT_INPUT_PORT_CHANGE;
304            duart_68681_update_interrupts();
305         }
306         break;
307      case 0x09: /* SRB */
308         r = duart_68681.channel[1].SR;
309         break;
310      case 0x0b: /* RHRB */
311         r = duart_68681_read_rx_fifo(1);
312         break;
313      default:
314         logerror( "Reading unhandled 68681 reg %x\n", offset );
315         break;
316   }
317   return r;
318}
319
320WRITE16_HANDLER(duart_68681_w)
321{
322   //logerror( "Writing 68681 reg %x with %04x\n", offset, data );
323   switch(offset)
324   {
325      case 0x00: /* MRA */
326         duart_68681_write_MR(0, data);
327         break;
328      case 0x01: /* CSRA */
329         duart_68681_write_CSR(0, data, duart_68681.ACR);
330         break;
331      case 0x02: /* CRA */
332         duart_68681_write_CR(0, data);
333         break;
334      case 0x03: /* THRA */
335         duart_68681_write_TX(0, data);
336         break;
337      case 0x04: /* ACR */
338         duart_68681.ACR = data;
339         // TODO:
340         //       bits 6-4: Counter/Timer Mode And Clock Source Select
341         //       bits 3-0: IP3-0 Change-Of-State Interrupt Enable
342         duart_68681_write_CSR(0, duart_68681.channel[0].CSR, data);
343         duart_68681_write_CSR(1, duart_68681.channel[1].CSR, data);
344         break;
345      case 0x05: /* IMR */
346         duart_68681.IMR = data;
347         // TODO: handle update interrupts?
348         break;
349      case 0x08: /* MRB */
350         duart_68681_write_MR(1, data);
351         break;
352      case 0x09: /* CSRB */
353         duart_68681_write_CSR(1, data, duart_68681.ACR);
354         break;
355      case 0x0a: /* CRB */
356         duart_68681_write_CR(1, data);
357         break;
358      case 0x0b: /* THRB */
359         duart_68681_write_TX(1, data);
360         break;
361      case 0x0c: /* IVR */
362         duart_68681.IVR = data;
363         break;
364      case 0x0d: /* OPCR */
365         duart_68681.OPCR = data;
366         break;
367      case 0x0e: /* Set Output Port Bits */
368         // TODO: bits set to 1 causes corresponding output port bit to be set to 0
369         break;
370      case 0x0f: /* Reset Output Port Bits */
371         // TODO: bits set to 1 causes corresponding output port bit to be set to 1
372         break;
373      default:
374         logerror( "Writing 68681 reg %x with %04x\n", offset, data );
375         break;
376   }
377}
378
379void duart_68681_rx_data( int ch, UINT8 data )
380{
381   if ( duart_68681.channel[ch].rx_enabled )
382   {
383      if ( duart_68681.channel[ch].rx_fifo_num >= RX_FIFO_SIZE )
384      {
385         logerror( "68681: FIFO overflow\n" );
386         return;
387      }
388      duart_68681.channel[ch].rx_fifo[duart_68681.channel[ch].rx_fifo_write_ptr++] = data;
389      if ( duart_68681.channel[ch].rx_fifo_write_ptr == RX_FIFO_SIZE )
390      {
391         duart_68681.channel[ch].rx_fifo_write_ptr = 0;
392      }
393      duart_68681.channel[ch].rx_fifo_num++;
394
395      duart_68681.channel[ch].SR |= STATUS_RECEIVER_READY;
396      if ( BIT(duart_68681.channel[ch].MR1,MODE_RX_INT_SELECT_BIT) == 0 )
397      {
398         duart_68681.ISR |= (ch == 0) ? INT_RXRDY_FFULLA : INT_RXRDY_FFULLB;
399      }
400      if ( duart_68681.channel[ch].rx_fifo_num == RX_FIFO_SIZE )
401      {
402         duart_68681.channel[ch].SR |= STATUS_FIFO_FULL;
403         if ( BIT(duart_68681.channel[ch].MR1,MODE_RX_INT_SELECT_BIT) == 1 )
404         {
405            duart_68681.ISR |= (ch == 0) ? INT_RXRDY_FFULLA : INT_RXRDY_FFULLB;
406         }
407      }
408      duart_68681_update_interrupts();
409   }
410};
411
412void duart_68681_init(int frequency, void (*irq_handler)(UINT8 vector), void (*tx_callback)(int channel, UINT8 data))
413{
414   memset(&duart_68681, 0, sizeof(duart_68681));
415
416   duart_68681.frequency = frequency;
417   duart_68681.tx_callback = tx_callback;
418   duart_68681.irq_handler = irq_handler;
419
420   // allocate timers
421   duart_68681.channel[0].tx_timer = timer_alloc(tx_timer_callback, NULL);
422   timer_adjust_oneshot(duart_68681.channel[0].tx_timer, attotime_never, 0);
423
424   duart_68681.channel[1].tx_timer = timer_alloc(tx_timer_callback, NULL);
425   timer_adjust_oneshot(duart_68681.channel[1].tx_timer, attotime_never, 1);
426};
src/emu/machine/6522via.c
r2454r2455
337337      UINT8 write_data = (v->out_b & v->ddr_b) | (v->ddr_b ^ 0xff);
338338
339339      if (v->intf->out_b_func)
340         v->intf->out_b_func(Machine, 0, write_data);
340         v->intf->out_b_func(machine, 0, write_data);
341341      else
342342         logerror("6522VIA chip %d: Port B is being written to but has no handler.  PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data);
343343   }
src/emu/machine/68681.h
r0r2455
1#ifndef _68681_H
2#define _68681_H
3
4void duart_68681_init(int frequency, void (*irq_handler)(UINT8 vector), void (*tx_callback)(int channel, UINT8 data));
5void duart_68681_rx_data( int ch, UINT8 data );
6
7READ16_HANDLER(duart_68681_r);
8WRITE16_HANDLER(duart_68681_w);
9
10#endif //_68681_H
src/emu/machine/am53cf96.c
r2454r2455
4545   static const int states[] = { 0, 0, 1, 1, 2, 3, 4, 5, 6, 7, 0 };
4646
4747   reg = offset * 2;
48   if (mem_mask == 0xffffff00)
48   if (mem_mask == 0x000000ff)
4949   {
5050      shift = 0;
5151   }
r2454r2455
9696
9797   reg = offset * 2;
9898   val = data;
99   if (mem_mask == 0xffffff00)
99   if (mem_mask == 0x000000ff)
100100   {
101101   }
102102   else
src/emu/machine/z80dma.c
r2454r2455
489489
490490READ8_HANDLER( z80dma_0_r )
491491{
492   z80dma_t   *z80dma = devtag_get_token(Machine, Z80DMA, Z80DMA_DEV_0_TAG);
492   z80dma_t   *z80dma = devtag_get_token(machine, Z80DMA, Z80DMA_DEV_0_TAG);
493493
494494   return z80dma_read(z80dma);
495495}
496496
497497READ8_HANDLER( z80dma_1_r )
498498{
499   z80dma_t   *z80dma = devtag_get_token(Machine, Z80DMA, Z80DMA_DEV_1_TAG);
499   z80dma_t   *z80dma = devtag_get_token(machine, Z80DMA, Z80DMA_DEV_1_TAG);
500500
501501   return z80dma_read(z80dma);
502502}
503503
504504WRITE8_HANDLER( z80dma_0_w )
505505{
506   z80dma_t   *z80dma = devtag_get_token(Machine, Z80DMA, Z80DMA_DEV_0_TAG);
506   z80dma_t   *z80dma = devtag_get_token(machine, Z80DMA, Z80DMA_DEV_0_TAG);
507507
508508   z80dma_write(z80dma, data);
509509}
510510
511511WRITE8_HANDLER( z80dma_1_w )
512512{
513   z80dma_t   *z80dma = devtag_get_token(Machine, Z80DMA, Z80DMA_DEV_1_TAG);
513   z80dma_t   *z80dma = devtag_get_token(machine, Z80DMA, Z80DMA_DEV_1_TAG);
514514
515515   z80dma_write(z80dma, data);
516516}
517517
518518WRITE8_HANDLER( z80dma_0_rdy_w )
519519{
520   z80dma_t   *z80dma = devtag_get_token(Machine, Z80DMA, Z80DMA_DEV_0_TAG);
520   z80dma_t   *z80dma = devtag_get_token(machine, Z80DMA, Z80DMA_DEV_0_TAG);
521521
522522   z80dma_rdy_write(z80dma, data);
523523}
524524
525525WRITE8_HANDLER( z80dma_1_rdy_w )
526526{
527   z80dma_t   *z80dma = devtag_get_token(Machine, Z80DMA, Z80DMA_DEV_1_TAG);
527   z80dma_t   *z80dma = devtag_get_token(machine, Z80DMA, Z80DMA_DEV_1_TAG);
528528
529529   z80dma_rdy_write(z80dma, data);
530530}
src/emu/machine/smc91c9x.c
r2454r2455
440440   }
441441
442442   if (LOG_ETHERNET && offset != EREG_BANK)
443      logerror("%08X:ethernet_r(%s) = %04X & %04X\n", activecpu_get_pc(), ethernet_regname[offset], result, mem_mask ^ 0xffff);
443      logerror("%08X:ethernet_r(%s) = %04X & %04X\n", activecpu_get_pc(), ethernet_regname[offset], result, mem_mask);
444444   return result;
445445}
446446
r2454r2455
463463
464464   /* update the data generically */
465465   olddata = ethernet.reg[offset];
466   mem_mask |= ~ethernet.regmask[offset];
466   mem_mask &= ethernet.regmask[offset];
467467   COMBINE_DATA(&ethernet.reg[offset]);
468468
469469   if (LOG_ETHERNET && offset != 7)
470      logerror("%08X:ethernet_w(%s) = %04X & %04X\n", activecpu_get_pc(), ethernet_regname[offset], data, mem_mask ^ 0xffff);
470      logerror("%08X:ethernet_w(%s) = %04X & %04X\n", activecpu_get_pc(), ethernet_regname[offset], data, mem_mask);
471471
472472   /* handle it */
473473   switch (offset)
src/emu/machine/8042kbdc.c
r2454r2455
175175
176176#include "driver.h"
177177#include "memconv.h"
178#include "deprecat.h"
179178
180179#include "machine/pckeybrd.h"
181180#include "machine/8042kbdc.h"
r2454r2455
601600             * the bits low set in the command byte.  The only pulse that has
602601             * an effect currently is bit 0, which pulses the CPU's reset line
603602             */
604         cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, PULSE_LINE);
603         cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE);
605604         at_8042_set_outport(kbdc8042.outport | 0x02, 0);
606605         break;
607606      }
src/emu/machine/microtch.c
r0r2455
1/*
2    Microtouch touch screen controller
3
4    Written by Mariusz Wojcieszek
5
6    Notes/ToDo:
7    - calibration mode (command CX)
8    - only tablet format is supported for returning touch screen state
9
10*/
11
12#include "driver.h"
13#include "microtch.h"
14
15static struct
16{
17   UINT8      rx_buffer[16];
18   int         rx_buffer_ptr;
19   emu_timer*   timer;
20   UINT8      tx_buffer[16];
21   UINT8      tx_buffer_num;
22   UINT8      tx_buffer_ptr;
23   int         reset_done;
24   int         format_tablet;
25   int         mode_inactive;
26   int         mode_stream;
27   int         last_touch_state;
28   int         last_x;
29   int         last_y;
30   void      (*tx_callback)(UINT8 data);
31   int         (*touch_callback)(int *touch_x, int *touch_y);
32} microtouch;
33
34
35static int microtouch_check_command( const char* commandtocheck, int command_len, UINT8* command_data )
36{
37   if ( (command_len == (strlen(commandtocheck) + 2)) &&
38       (command_data[0] == 0x01) &&
39       (strncmp(commandtocheck, (const char*)command_data + 1, strlen(commandtocheck)) == 0) &&
40       (command_data[command_len-1] == 0x0d) )
41   {
42      return 1;
43   }
44   else
45   {
46      return 0;
47   }
48}
49
50static void microtouch_send_format_table_packet(UINT8 flag, int x, int y)
51{
52   microtouch.tx_buffer[microtouch.tx_buffer_num++] = flag;
53   // lower byte (7bits) of x coordinate
54   microtouch.tx_buffer[microtouch.tx_buffer_num++] = x & 0x7f;
55   // higher byte (7bits) of x coordinate
56   microtouch.tx_buffer[microtouch.tx_buffer_num++] = (x >> 7) & 0x7f;
57   // lower byte (7bits) of y coordinate
58   microtouch.tx_buffer[microtouch.tx_buffer_num++] = y & 0x7f;
59   // higher byte (7bits) of y coordinate
60   microtouch.tx_buffer[microtouch.tx_buffer_num++] = (y >> 7) & 0x7f;
61};
62
63static TIMER_CALLBACK(microtouch_timer_callback)
64{
65   if ( microtouch.tx_buffer_ptr < microtouch.tx_buffer_num )
66   {
67      microtouch.tx_callback( microtouch.tx_buffer[microtouch.tx_buffer_ptr++] );
68      if ( microtouch.tx_buffer_ptr == microtouch.tx_buffer_num )
69      {
70         microtouch.tx_buffer_ptr = microtouch.tx_buffer_num = 0;
71      }
72      return;
73   }
74
75   if ( (microtouch.reset_done == 0) ||
76       (microtouch.format_tablet == 0) ||
77       (microtouch.mode_inactive == 1) ||
78       (microtouch.mode_stream == 0) )
79   {
80      return;
81   }
82
83   // send format tablet packet
84   if ( input_port_read(machine, "TOUCH") & 0x01 )
85   {
86      int tx = input_port_read(machine, "TOUCH_X");
87      int ty = input_port_read(machine, "TOUCH_Y");
88
89      if ( microtouch.touch_callback == NULL ||
90          microtouch.touch_callback( &tx, &ty ) != 0 )
91      {
92         ty = 0x4000 - ty;
93
94         microtouch_send_format_table_packet(0xc0, tx, ty);
95         microtouch.last_touch_state = 1;
96         microtouch.last_x = tx;
97         microtouch.last_y = ty;
98      }
99   }
100   else
101   {
102      if ( microtouch.last_touch_state == 1 )
103      {
104         microtouch.last_touch_state = 0;
105         microtouch_send_format_table_packet(0x80, microtouch.last_x, microtouch.last_y);
106      }
107   }
108};
109
110void microtouch_init(void (*tx_cb)(UINT8 data),
111                     int (*touch_cb)(int *touch_x, int *touch_y))
112{
113   memset(&microtouch, 0, sizeof(microtouch));
114
115   microtouch.last_touch_state = -1;
116   microtouch.tx_callback = tx_cb;
117   microtouch.touch_callback = touch_cb;
118
119   microtouch.timer = timer_alloc(microtouch_timer_callback, NULL);
120   timer_adjust_periodic(microtouch.timer, ATTOTIME_IN_HZ(167*5), 0, ATTOTIME_IN_HZ(167*5));
121
122   state_save_register_item("microtouch", 0, microtouch.reset_done);
123   state_save_register_item("microtouch", 0, microtouch.format_tablet);
124   state_save_register_item("microtouch", 0, microtouch.mode_inactive);
125   state_save_register_item("microtouch", 0, microtouch.mode_stream);
126   state_save_register_item("microtouch", 0, microtouch.last_touch_state);
127   state_save_register_item("microtouch", 0, microtouch.last_x);
128   state_save_register_item("microtouch", 0, microtouch.last_y);
129   state_save_register_item_array("microtouch", 0, microtouch.rx_buffer);
130   state_save_register_item("microtouch", 0, microtouch.rx_buffer_ptr);
131   state_save_register_item_array("microtouch", 0, microtouch.tx_buffer);
132   state_save_register_item("microtouch", 0, microtouch.tx_buffer_num);
133   state_save_register_item("microtouch", 0, microtouch.tx_buffer_ptr);
134
135};
136
137
138void microtouch_rx(int count, UINT8* data)
139{
140   int i;
141
142   for ( i = 0; (i < count) && ((microtouch.rx_buffer_ptr + i) < 16); i++ )
143   {
144      microtouch.rx_buffer[i+microtouch.rx_buffer_ptr] = data[i];
145      microtouch.rx_buffer_ptr++;
146   }
147
148   if (microtouch.rx_buffer_ptr > 0 && (microtouch.rx_buffer[microtouch.rx_buffer_ptr-1] == 0x0d))
149   {
150      // check command
151      if ( microtouch_check_command( "MS", microtouch.rx_buffer_ptr, microtouch.rx_buffer ) )
152      {
153         microtouch.mode_stream = 1;
154         microtouch.mode_inactive = 0;
155      }
156      else if ( microtouch_check_command( "MI", microtouch.rx_buffer_ptr, microtouch.rx_buffer ) )
157      {
158         microtouch.mode_inactive = 1;
159      }
160      else if ( microtouch_check_command( "R", microtouch.rx_buffer_ptr, microtouch.rx_buffer ) )
161      {
162         microtouch.tx_buffer_num = 0;
163         microtouch.reset_done = 1;
164      }
165      else if ( microtouch_check_command( "FT", microtouch.rx_buffer_ptr, microtouch.rx_buffer ) )
166      {
167         microtouch.format_tablet = 1;
168      }
169      // send response
170      microtouch.tx_buffer[microtouch.tx_buffer_num++] = 0x01;
171      microtouch.tx_buffer[microtouch.tx_buffer_num++] = 0x30;
172      microtouch.tx_buffer[microtouch.tx_buffer_num++] = 0x0d;
173      microtouch.rx_buffer_ptr = 0;
174   }
175};
176
177INPUT_PORTS_START(microtouch)
178   PORT_START_TAG("TOUCH")
179   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_IMPULSE(10) PORT_NAME( "Touch screen" )
180   PORT_START_TAG("TOUCH_X")
181   PORT_BIT( 0x3fff, 0x2000, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(45) PORT_KEYDELTA(15)
182   PORT_START_TAG("TOUCH_Y")
183   PORT_BIT( 0x3fff, 0x2000, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(45) PORT_KEYDELTA(15)
184INPUT_PORTS_END
185
src/emu/machine/microtch.h
r0r2455
1#ifndef _MICROTOUCH_H
2#define _MICROTOUCH_H
3
4INPUT_PORTS_EXTERN(microtouch);
5
6void microtouch_init(void (*tx_cb)(UINT8 data), int (*touch_cb)(int *touch_x, int *touch_y));
7void microtouch_rx(int count, UINT8* data);
8
9#endif //_MICROTOUCH_H
src/emu/sound/c352.c
r2454r2455
572572
573573WRITE16_HANDLER( c352_0_w )
574574{
575   if (mem_mask == 0)
575   if (mem_mask == 0xffff)
576576   {
577577      c352_write_reg16(sndti_token(SOUND_C352, 0), offset*2, data);
578578   }
src/emu/sound/ay8910.c
r2454r2455
88  Based on various code snippets by Ville Hallik, Michael Cuddy,
99  Tatsuyuki Satoh, Fabrice Frances, Nicola Salmoria.
1010
11  Mostly rewritten by couriersud in 2008
12
13  TODO:
14  * The AY8930 has an extended mode which is currently
15    not emulated.
16  * The YMZ284 only has one 1 output channel (mixed chan A,B,C).
17    This should be forced.
18  * YM2610 & YM2608 will need a separate flag in their config structures
19    to distinguish between legacy and discrete mode.
20
21  The rewrite also introduces a generic model for the DAC. This model is
22  not perfect, but allows channel mixing based on a parametrized approach.
23  This model also allows to factor in different loads on individual channels.
24  If a better model is developped in the future or better measurements are
25  available, the driver should be easy to change. The model is described
26  later.
27
28  In order to not break hundreds of existing drivers by default the flag
29  AY8910_LEGACY_OUTPUT is used by drivers not changed to take into account the
30  new model. All outputs are normalized to the old output range (i.e. 0 .. 7ffff).
31  In the case of channel mixing, output range is 0...3 * 7fff.
32
33  The main difference between the AY-3-8910 and the YM2149 is, that the
34  AY-3-8910 datasheet mentions, that fixed volume level 0, which is set by
35  registers 8 to 10 is "channel off". The YM2149 mentions, that the generated
36  signal has a 2V DC component. This is confirmed by measurements. The approach
37  taken here is to assume the 2V DC offset for all outputs for the YM2149.
38  For the AY-3-8910, an offset is used if envelope is active for a channel.
39  This is backed by oscilloscope pictures from the datasheet. If a fixed volume
40  is set, i.e. enveloppe is disabled, the output voltage is set to 0V. Recordings
41  I found on the web for gyruss indicate, that the AY-3-8910 offset should
42  be around 1.5V. This will also make sound levels more compatible with
43  user descriptions.
44
45  The Model:
46                     5V     5V
47                      |      |
48                      /      |
49  Volume Level x >---|       Z
50                      >      Z Pullup Resistor RU
51                       |     Z
52                       Z     |
53                    Rx Z     |
54                       Z     |
55                       |     |
56                       '-----+-------->  >---+----> Output signal
57                             |               |
58                             Z               Z
59               Pulldown RD   Z               Z Load RL
60                             Z               Z
61                             |               |
62                            GND             GND
63
64Each Volume level x will select a different resistor Rx. Measurements from fpgaarcade.com
65where used to calibrate channel mixing for the YM2149. This was done using
66a least square approach using a fixed RL of 1K Ohm.
67
68For the AY measurements cited in e.g. openmsx as "Hacker Kay" for a single
69channel were taken. These were normalized to 0 ... 65535 and adapted to on
70offset of 1.5V and a VPP of 1.3V.
71
1172***************************************************************************/
1273
1374#include "sndintrf.h"
r2454r2455
1778#include "ay8910.h"
1879
1980#define MAX_OUTPUT 0x7fff
81#define NUM_CHANNELS 3
2082
21#define STEP 2
83typedef struct _ay_ym_param ay_ym_param;
84struct _ay_ym_param
85{
86   double r_up;
87   double r_down;
88   int    N;
89   double res[32];
90};
2291
23
2492struct AY8910
2593{
2694   int index;
2795   int streams;
2896   int ready;
2997   sound_stream *Channel;
30   read8_machine_func PortAread;
31   read8_machine_func PortBread;
32   write8_machine_func PortAwrite;
33   write8_machine_func PortBwrite;
98   const struct AY8910interface *intf;
3499   INT32 register_latch;
35   UINT8 Regs[16];
100   UINT8 regs[16];
36101   INT32 lastEnable;
37   INT32 PeriodA,PeriodB,PeriodC,PeriodN,PeriodE;
38   INT32 CountA,CountB,CountC,CountN,CountE;
39   UINT32 VolA,VolB,VolC,VolE;
40   UINT8 EnvelopeA,EnvelopeB,EnvelopeC;
41   UINT8 OutputA,OutputB,OutputC,OutputN;
102   INT32 Count[NUM_CHANNELS];
103   UINT8 Output[NUM_CHANNELS];
104   UINT8 OutputN;
105   INT32 CountN;
106   INT32 CountE;
42107   INT8 CountEnv;
108   UINT32 VolE;
43109   UINT8 Hold,Alternate,Attack,Holding;
44110   INT32 RNG;
45   unsigned int VolTable[32];
111   UINT8 EnvP;
112   /* init parameters ... */
113   int step;
114   int zero_is_off;
115   UINT8 vol_enabled[NUM_CHANNELS];
116   ay_ym_param *par;
117   ay_ym_param *parE;
118   INT32 VolTable[NUM_CHANNELS][16];
119   INT32 VolTableE[NUM_CHANNELS][32];
120   INT32 vol3d_tab[8*32*32*32];
46121};
47122
48123/* register id's */
r2454r2455
64139#define AY_PORTA   (14)
65140#define AY_PORTB   (15)
66141
142#define NOISE_ENABLEQ(_psg, _chan)   (((_psg)->regs[AY_ENABLE] >> (3 + _chan)) & 1)
143#define TONE_ENABLEQ(_psg, _chan)   (((_psg)->regs[AY_ENABLE] >> (_chan)) & 1)
144#define TONE_PERIOD(_psg, _chan)   ( (_psg)->regs[(_chan) << 1] | (((_psg)->regs[((_chan) << 1) | 1] & 0x0f) << 8) )
145#define NOISE_PERIOD(_psg)         ((_psg)->regs[AY_NOISEPER] & 0x1f)
146#define TONE_VOLUME(_psg, _chan)   ((_psg)->regs[AY_AVOL + (_chan)] & 0x0f)
147#define TONE_ENVELOPE(_psg, _chan)   (((_psg)->regs[AY_AVOL + (_chan)] >> 4) & 1)
148#define ENVELOPE_PERIOD(_psg)      (((_psg)->regs[AY_EFINE] | ((_psg)->regs[AY_ECOARSE]<<8)))
67149
68static void _AYWriteReg(struct AY8910 *PSG, int r, int v)
150
151static ay_ym_param ym2149_param =
69152{
70   int old;
153   630, 801,
154   16,
155   { 73770, 37586, 27458, 21451, 15864, 12371, 8922,  6796,
156      4763,  3521,  2403,  1737,  1123,   762,  438,   251 },
157};
71158
159static ay_ym_param ym2149_paramE =
160{
161   630, 801,
162   32,
163   { 103350, 73770, 52657, 37586, 32125, 27458, 24269, 21451,
164      18447, 15864, 14009, 12371, 10506,  8922,  7787,  6796,
165       5689,  4763,  4095,  3521,  2909,  2403,  2043,  1737,
166       1397,  1123,   925,   762,   578,   438,   332,   251 },
167};
72168
73   PSG->Regs[r] = v;
169#if 0
170/* RL = 1000, Hacker Kay normalized, 2.1V to 3.2V */
171static ay_ym_param ay8910_param =
172{
173   664, 913,
174   16,
175   { 85785, 34227, 26986, 20398, 14886, 10588,  7810,  4856,
176      4120,  2512,  1737,  1335,  1005,   747,   586,    451 },
177};
74178
179/*
180 * RL = 3000, Hacker Kay normalized pattern, 1.5V to 2.8V
181 * These values correspond with guesses based on Gyruss schematics
182 * They work well with scramble as well.
183 */
184static ay_ym_param ay8910_param =
185{
186   930, 454,
187   16,
188   { 85066, 34179, 27027, 20603, 15046, 10724, 7922, 4935,
189      4189,  2557,  1772,  1363,  1028,  766,   602,  464 },
190};
191
192/*
193 * RL = 1000, Hacker Kay normalized pattern, 0.75V to 2.05V
194 * These values correspond with guesses based on Gyruss schematics
195 * They work well with scramble as well.
196 */
197static ay_ym_param ay8910_param =
198{
199   1371, 313,
200   16,
201   { 93399, 33289, 25808, 19285, 13940, 9846,  7237,  4493,
202      3814,  2337,  1629,  1263,   962,  727,   580,   458 },
203};
204#endif
205
206/*
207 * RL = 1000, Hacker Kay normalized pattern, 0.2V to 1.5V
208 */
209static ay_ym_param ay8910_param =
210{
211   5806, 300,
212   16,
213   { 118996, 42698, 33105, 24770, 17925, 12678,  9331,  5807,
214        4936,  3038,  2129,  1658,  1271,   969,   781,   623 }
215};
216
217
218static void AY8910_write_reg(struct AY8910 *PSG, int r, int v)
219{
220
221   //if (r != 4 && r !=5) printf("%d %x %02x\n", PSG->index, r, v);
222   PSG->regs[r] = v;
223
75224   /* A note about the period of tones, noise and envelope: for speed reasons,*/
76225   /* we count down from the period to 0, but careful studies of the chip     */
77226   /* output prove that it instead counts up from 0 until the counter becomes */
r2454r2455
84233   /* period. In that case, period = 0 is half as period = 1. */
85234   switch( r )
86235   {
87   case AY_AFINE:
88   case AY_ACOARSE:
89      PSG->Regs[AY_ACOARSE] &= 0x0f;
90      old = PSG->PeriodA;
91      PSG->PeriodA = (PSG->Regs[AY_AFINE] + 256 * PSG->Regs[AY_ACOARSE]) * STEP;
92      if (PSG->PeriodA == 0) PSG->PeriodA = STEP;
93      PSG->CountA += PSG->PeriodA - old;
94      if (PSG->CountA <= 0) PSG->CountA = 1;
95      break;
96   case AY_BFINE:
97   case AY_BCOARSE:
98      PSG->Regs[AY_BCOARSE] &= 0x0f;
99      old = PSG->PeriodB;
100      PSG->PeriodB = (PSG->Regs[AY_BFINE] + 256 * PSG->Regs[AY_BCOARSE]) * STEP;
101      if (PSG->PeriodB == 0) PSG->PeriodB = STEP;
102      PSG->CountB += PSG->PeriodB - old;
103      if (PSG->CountB <= 0) PSG->CountB = 1;
104      break;
105   case AY_CFINE:
106   case AY_CCOARSE:
107      PSG->Regs[AY_CCOARSE] &= 0x0f;
108      old = PSG->PeriodC;
109      PSG->PeriodC = (PSG->Regs[AY_CFINE] + 256 * PSG->Regs[AY_CCOARSE]) * STEP;
110      if (PSG->PeriodC == 0) PSG->PeriodC = STEP;
111      PSG->CountC += PSG->PeriodC - old;
112      if (PSG->CountC <= 0) PSG->CountC = 1;
113      break;
114   case AY_NOISEPER:
115      PSG->Regs[AY_NOISEPER] &= 0x1f;
116      old = PSG->PeriodN;
117      PSG->PeriodN = PSG->Regs[AY_NOISEPER] * STEP;
118      if (PSG->PeriodN == 0) PSG->PeriodN = STEP;
119      PSG->CountN += PSG->PeriodN - old;
120      if (PSG->CountN <= 0) PSG->CountN = 1;
121      break;
122   case AY_ENABLE:
123      if ((PSG->lastEnable == -1) ||
124          ((PSG->lastEnable & 0x40) != (PSG->Regs[AY_ENABLE] & 0x40)))
125      {
126         /* write out 0xff if port set to input */
127         if (PSG->PortAwrite)
128            (*PSG->PortAwrite)(Machine, 0, (PSG->Regs[AY_ENABLE] & 0x40) ? PSG->Regs[AY_PORTA] : 0xff);
129      }
236      case AY_AFINE:
237      case AY_ACOARSE:
238      case AY_BFINE:
239      case AY_BCOARSE:
240      case AY_CFINE:
241      case AY_CCOARSE:
242         /* No action required */
243         break;
244      case AY_NOISEPER:
245         /* No action required */
246         break;
247      case AY_ENABLE:
248         if ((PSG->lastEnable == -1) ||
249             ((PSG->lastEnable & 0x40) != (PSG->regs[AY_ENABLE] & 0x40)))
250         {
251            /* write out 0xff if port set to input */
252            if (PSG->intf->portAwrite)
253               (*PSG->intf->portAwrite)(Machine, 0, (PSG->regs[AY_ENABLE] & 0x40) ? PSG->regs[AY_PORTA] : 0xff);
254         }
130255
131      if ((PSG->lastEnable == -1) ||
132          ((PSG->lastEnable & 0x80) != (PSG->Regs[AY_ENABLE] & 0x80)))
133      {
134         /* write out 0xff if port set to input */
135         if (PSG->PortBwrite)
136            (*PSG->PortBwrite)(Machine, 0, (PSG->Regs[AY_ENABLE] & 0x80) ? PSG->Regs[AY_PORTB] : 0xff);
137      }
256         if ((PSG->lastEnable == -1) ||
257             ((PSG->lastEnable & 0x80) != (PSG->regs[AY_ENABLE] & 0x80)))
258         {
259            /* write out 0xff if port set to input */
260            if (PSG->intf->portBwrite)
261               (*PSG->intf->portBwrite)(Machine, 0, (PSG->regs[AY_ENABLE] & 0x80) ? PSG->regs[AY_PORTB] : 0xff);
262         }
138263
139      PSG->lastEnable = PSG->Regs[AY_ENABLE];
140      break;
141   case AY_AVOL:
142      PSG->Regs[AY_AVOL] &= 0x1f;
143      PSG->EnvelopeA = PSG->Regs[AY_AVOL] & 0x10;
144      PSG->VolA = PSG->EnvelopeA ? PSG->VolE : PSG->VolTable[PSG->Regs[AY_AVOL] ? PSG->Regs[AY_AVOL]*2+1 : 0];
145      break;
146   case AY_BVOL:
147      PSG->Regs[AY_BVOL] &= 0x1f;
148      PSG->EnvelopeB = PSG->Regs[AY_BVOL] & 0x10;
149      PSG->VolB = PSG->EnvelopeB ? PSG->VolE : PSG->VolTable[PSG->Regs[AY_BVOL] ? PSG->Regs[AY_BVOL]*2+1 : 0];
150      break;
151   case AY_CVOL:
152      PSG->Regs[AY_CVOL] &= 0x1f;
153      PSG->EnvelopeC = PSG->Regs[AY_CVOL] & 0x10;
154      PSG->VolC = PSG->EnvelopeC ? PSG->VolE : PSG->VolTable[PSG->Regs[AY_CVOL] ? PSG->Regs[AY_CVOL]*2+1 : 0];
155      break;
156   case AY_EFINE:
157   case AY_ECOARSE:
158      old = PSG->PeriodE;
159      PSG->PeriodE = ((PSG->Regs[AY_EFINE] + 256 * PSG->Regs[AY_ECOARSE])) * STEP;
160      if (PSG->PeriodE == 0) PSG->PeriodE = STEP / 2;
161      PSG->CountE += PSG->PeriodE - old;
162      if (PSG->CountE <= 0) PSG->CountE = 1;
163      break;
164   case AY_ESHAPE:
165      /* envelope shapes:
166        C AtAlH
167        0 0 x x  \___
264         PSG->lastEnable = PSG->regs[AY_ENABLE];
265         break;
266      case AY_AVOL:
267      case AY_BVOL:
268      case AY_CVOL:
269         /* No action required */
270         break;
271      case AY_EFINE:
272      case AY_ECOARSE:
273         /* No action required */
274         break;
275      case AY_ESHAPE:
276         /* envelope shapes:
277            C AtAlH
278            0 0 x x  \___
279            0 1 x x  /___
280            1 0 0 0  \\\\
281            1 0 0 1  \___
282            1 0 1 0  \/\/
283            1 0 1 1  \??????
284            1 1 0 0  ////
285            1 1 0 1  /??????
286            1 1 1 0  /\/\
287            1 1 1 1  /___
288            The envelope counter on the AY-3-8910 has 16 steps. On the YM2149 it
289            has twice the steps, happening twice as fast.
290            */
291         PSG->Attack = (PSG->regs[AY_ESHAPE] & 0x04) ? PSG->EnvP : 0x00;
292         if ((PSG->regs[AY_ESHAPE] & 0x08) == 0)
293         {
294            /* if Continue = 0, map the shape to the equivalent one which has Continue = 1 */
295            PSG->Hold = 1;
296            PSG->Alternate = PSG->Attack;
297         }
298         else
299         {
300            PSG->Hold = PSG->regs[AY_ESHAPE] & 0x01;
301            PSG->Alternate = PSG->regs[AY_ESHAPE] & 0x02;
302         }
303         PSG->CountEnv = PSG->EnvP;
304         PSG->Holding = 0;
305         PSG->VolE = (PSG->CountEnv ^ PSG->Attack);
306         break;
307      case AY_PORTA:
308         if (PSG->regs[AY_ENABLE] & 0x40)
309         {
310            if (PSG->intf->portAwrite)
311               (*PSG->intf->portAwrite)(Machine, 0, PSG->regs[AY_PORTA]);
312            else
313               logerror("warning - write %02x to 8910 #%d Port A\n",PSG->regs[AY_PORTA],PSG->index);
314         }
315         else
316         {
317            logerror("warning: write to 8910 #%d Port A set as input - ignored\n",PSG->index);
318         }
319         break;
320      case AY_PORTB:
321         if (PSG->regs[AY_ENABLE] & 0x80)
322         {
323            if (PSG->intf->portBwrite)
324               (*PSG->intf->portBwrite)(Machine, 0, PSG->regs[AY_PORTB]);
325            else
326               logerror("warning - write %02x to 8910 #%d Port B\n",PSG->regs[AY_PORTB],PSG->index);
327         }
328         else
329         {
330            logerror("warning: write to 8910 #%d Port B set as input - ignored\n",PSG->index);
331         }
332         break;
333   }
334}
168335
169        0 1 x x  /___
170336
171        1 0 0 0  \\\\
337INLINE UINT16 mix_3D(struct AY8910 *PSG)
338{
339   int indx = 0, chan;
172340
173        1 0 0 1  \___
174
175        1 0 1 0  \/\/
176                  ___
177        1 0 1 1  \
178
179        1 1 0 0  ////
180                  ___
181        1 1 0 1  /
182
183        1 1 1 0  /\/\
184
185        1 1 1 1  /___
186
187        The envelope counter on the AY-3-8910 has 16 steps. On the YM2149 it
188        has twice the steps, happening twice as fast. Since the end result is
189        just a smoother curve, we always use the YM2149 behaviour.
190        */
191      PSG->Regs[AY_ESHAPE] &= 0x0f;
192      PSG->Attack = (PSG->Regs[AY_ESHAPE] & 0x04) ? 0x1f : 0x00;
193      if ((PSG->Regs[AY_ESHAPE] & 0x08) == 0)
341   for (chan = 0; chan < NUM_CHANNELS; chan++)
342      if (TONE_ENVELOPE(PSG, chan))
194343      {
195         /* if Continue = 0, map the shape to the equivalent one which has Continue = 1 */
196         PSG->Hold = 1;
197         PSG->Alternate = PSG->Attack;
344         indx |= (1 << (chan+15)) | ( PSG->vol_enabled[chan] ? PSG->VolE << (chan*5) : 0);
198345      }
199346      else
200347      {
201         PSG->Hold = PSG->Regs[AY_ESHAPE] & 0x01;
202         PSG->Alternate = PSG->Regs[AY_ESHAPE] & 0x02;
348         indx |= (PSG->vol_enabled[chan] ? TONE_VOLUME(PSG, chan) << (chan*5) : 0);
203349      }
204      PSG->CountE = PSG->PeriodE;
205      PSG->CountEnv = 0x1f;
206      PSG->Holding = 0;
207      PSG->VolE = PSG->VolTable[PSG->CountEnv ^ PSG->Attack];
208      if (PSG->EnvelopeA) PSG->VolA = PSG->VolE;
209      if (PSG->EnvelopeB) PSG->VolB = PSG->VolE;
210      if (PSG->EnvelopeC) PSG->VolC = PSG->VolE;
211      break;
212   case AY_PORTA:
213      if (PSG->Regs[AY_ENABLE] & 0x40)
214      {
215         if (PSG->PortAwrite)
216            (*PSG->PortAwrite)(Machine, 0, PSG->Regs[AY_PORTA]);
217         else
218            logerror("warning - write %02x to 8910 #%d Port A\n",PSG->Regs[AY_PORTA],PSG->index);
219      }
220      else
221      {
222         logerror("warning: write to 8910 #%d Port A set as input - ignored\n",PSG->index);
223      }
224      break;
225   case AY_PORTB:
226      if (PSG->Regs[AY_ENABLE] & 0x80)
227      {
228         if (PSG->PortBwrite)
229            (*PSG->PortBwrite)(Machine, 0, PSG->Regs[AY_PORTB]);
230         else
231            logerror("warning - write %02x to 8910 #%d Port B\n",PSG->Regs[AY_PORTB],PSG->index);
232      }
233      else
234      {
235         logerror("warning: write to 8910 #%d Port B set as input - ignored\n",PSG->index);
236      }
237      break;
238   }
350   return PSG->vol3d_tab[indx];
239351}
240352
241
242
243/* AY8910 interface */
244READ8_HANDLER( AY8910_read_port_0_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 0)); }
245READ8_HANDLER( AY8910_read_port_1_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 1)); }
246READ8_HANDLER( AY8910_read_port_2_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 2)); }
247READ8_HANDLER( AY8910_read_port_3_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 3)); }
248READ8_HANDLER( AY8910_read_port_4_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 4)); }
249READ16_HANDLER( AY8910_read_port_0_lsb_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 0)); }
250READ16_HANDLER( AY8910_read_port_1_lsb_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 1)); }
251READ16_HANDLER( AY8910_read_port_2_lsb_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 2)); }
252READ16_HANDLER( AY8910_read_port_3_lsb_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 3)); }
253READ16_HANDLER( AY8910_read_port_4_lsb_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 4)); }
254READ16_HANDLER( AY8910_read_port_0_msb_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 0)) << 8; }
255READ16_HANDLER( AY8910_read_port_1_msb_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 1)) << 8; }
256READ16_HANDLER( AY8910_read_port_2_msb_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 2)) << 8; }
257READ16_HANDLER( AY8910_read_port_3_msb_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 3)) << 8; }
258READ16_HANDLER( AY8910_read_port_4_msb_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 4)) << 8; }
259
260WRITE8_HANDLER( AY8910_control_port_0_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 0),0,data); }
261WRITE8_HANDLER( AY8910_control_port_1_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 1),0,data); }
262WRITE8_HANDLER( AY8910_control_port_2_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 2),0,data); }
263WRITE8_HANDLER( AY8910_control_port_3_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 3),0,data); }
264WRITE8_HANDLER( AY8910_control_port_4_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 4),0,data); }
265WRITE16_HANDLER( AY8910_control_port_0_lsb_w ) { if (ACCESSING_BITS_0_7) ay8910_write_ym(sndti_token(SOUND_AY8910, 0),0,data & 0xff); }
266WRITE16_HANDLER( AY8910_control_port_1_lsb_w ) { if (ACCESSING_BITS_0_7) ay8910_write_ym(sndti_token(SOUND_AY8910, 1),0,data & 0xff); }
267WRITE16_HANDLER( AY8910_control_port_2_lsb_w ) { if (ACCESSING_BITS_0_7) ay8910_write_ym(sndti_token(SOUND_AY8910, 2),0,data & 0xff); }
268WRITE16_HANDLER( AY8910_control_port_3_lsb_w ) { if (ACCESSING_BITS_0_7) ay8910_write_ym(sndti_token(SOUND_AY8910, 3),0,data & 0xff); }
269WRITE16_HANDLER( AY8910_control_port_4_lsb_w ) { if (ACCESSING_BITS_0_7) ay8910_write_ym(sndti_token(SOUND_AY8910, 4),0,data & 0xff); }
270WRITE16_HANDLER( AY8910_control_port_0_msb_w ) { if (ACCESSING_BITS_8_15) ay8910_write_ym(sndti_token(SOUND_AY8910, 0),0,data >> 8); }
271WRITE16_HANDLER( AY8910_control_port_1_msb_w ) { if (ACCESSING_BITS_8_15) ay8910_write_ym(sndti_token(SOUND_AY8910, 1),0,data >> 8); }
272WRITE16_HANDLER( AY8910_control_port_2_msb_w ) { if (ACCESSING_BITS_8_15) ay8910_write_ym(sndti_token(SOUND_AY8910, 2),0,data >> 8); }
273WRITE16_HANDLER( AY8910_control_port_3_msb_w ) { if (ACCESSING_BITS_8_15) ay8910_write_ym(sndti_token(SOUND_AY8910, 3),0,data >> 8); }
274WRITE16_HANDLER( AY8910_control_port_4_msb_w ) { if (ACCESSING_BITS_8_15) ay8910_write_ym(sndti_token(SOUND_AY8910, 4),0,data >> 8); }
275
276WRITE8_HANDLER( AY8910_write_port_0_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 0),1,data); }
277WRITE8_HANDLER( AY8910_write_port_1_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 1),1,data); }
278WRITE8_HANDLER( AY8910_write_port_2_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 2),1,data); }
279WRITE8_HANDLER( AY8910_write_port_3_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 3),1,data); }
280WRITE8_HANDLER( AY8910_write_port_4_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 4),1,data); }
281WRITE16_HANDLER( AY8910_write_port_0_lsb_w ) { if (ACCESSING_BITS_0_7) ay8910_write_ym(sndti_token(SOUND_AY8910, 0),1,data & 0xff); }
282WRITE16_HANDLER( AY8910_write_port_1_lsb_w ) { if (ACCESSING_BITS_0_7) ay8910_write_ym(sndti_token(SOUND_AY8910, 1),1,data & 0xff); }
283WRITE16_HANDLER( AY8910_write_port_2_lsb_w ) { if (ACCESSING_BITS_0_7) ay8910_write_ym(sndti_token(SOUND_AY8910, 2),1,data & 0xff); }
284WRITE16_HANDLER( AY8910_write_port_3_lsb_w ) { if (ACCESSING_BITS_0_7) ay8910_write_ym(sndti_token(SOUND_AY8910, 3),1,data & 0xff); }
285WRITE16_HANDLER( AY8910_write_port_4_lsb_w ) { if (ACCESSING_BITS_0_7) ay8910_write_ym(sndti_token(SOUND_AY8910, 4),1,data & 0xff); }
286WRITE16_HANDLER( AY8910_write_port_0_msb_w ) { if (ACCESSING_BITS_8_15) ay8910_write_ym(sndti_token(SOUND_AY8910, 0),1,data >> 8); }
287WRITE16_HANDLER( AY8910_write_port_1_msb_w ) { if (ACCESSING_BITS_8_15) ay8910_write_ym(sndti_token(SOUND_AY8910, 1),1,data >> 8); }
288WRITE16_HANDLER( AY8910_write_port_2_msb_w ) { if (ACCESSING_BITS_8_15) ay8910_write_ym(sndti_token(SOUND_AY8910, 2),1,data >> 8); }
289WRITE16_HANDLER( AY8910_write_port_3_msb_w ) { if (ACCESSING_BITS_8_15) ay8910_write_ym(sndti_token(SOUND_AY8910, 3),1,data >> 8); }
290WRITE16_HANDLER( AY8910_write_port_4_msb_w ) { if (ACCESSING_BITS_8_15) ay8910_write_ym(sndti_token(SOUND_AY8910, 4),1,data >> 8); }
291
292
293
294static void AY8910Update(void *param,stream_sample_t **inputs, stream_sample_t **buffer,int length)
353static void AY8910_update(void *param,stream_sample_t **inputs, stream_sample_t **buffer,int length)
295354{
296355   struct AY8910 *PSG = param;
297   stream_sample_t *buf1,*buf2,*buf3;
298   int outn;
356   stream_sample_t *buf[NUM_CHANNELS];
357   int chan;
299358
300   buf1 = buffer[0];
301   buf2 = NULL;
302   buf3 = NULL;
303   if (PSG->streams == 3)
359   buf[0] = buffer[0];
360   buf[1] = NULL;
361   buf[2] = NULL;
362   if (PSG->streams == NUM_CHANNELS)
304363   {
305      buf2 = buffer[1];
306      buf3 = buffer[2];
364      buf[1] = buffer[1];
365      buf[2] = buffer[2];
307366   }
308367
309368   /* hack to prevent us from hanging when starting filtered outputs */
310369   if (!PSG->ready)
311370   {
312      memset(buf1, 0, length * sizeof(*buf1));
313      if (buf2)
314         memset(buf2, 0, length * sizeof(*buf2));
315      if (buf3)
316         memset(buf3, 0, length * sizeof(*buf3));
317      return;
371      for (chan = 0; chan < NUM_CHANNELS; chan++)
372         if (buf[chan] != NULL)
373            memset(buf[chan], 0, length * sizeof(*buf[chan]));
318374   }
319375
320
321376   /* The 8910 has three outputs, each output is the mix of one of the three */
322377   /* tone generators and of the (single) noise generator. The two are mixed */
323378   /* BEFORE going into the DAC. The formula to mix each channel is: */
r2454r2455
325380   /* Note that this means that if both tone and noise are disabled, the output */
326381   /* is 1, not 0, and can be modulated changing the volume. */
327382
328
329   /* If the channels are disabled, set their output to 1, and increase the */
330   /* counter, if necessary, so they will not be inverted during this update. */
331   /* Setting the output to 1 is necessary because a disabled channel is locked */
332   /* into the ON state (see above); and it has no effect if the volume is 0. */
333   /* If the volume is 0, increase the counter, but don't touch the output. */
334   if (PSG->Regs[AY_ENABLE] & 0x01)
335   {
336      if (PSG->CountA <= length*STEP) PSG->CountA += length*STEP;
337      PSG->OutputA = 1;
338   }
339   else if (PSG->Regs[AY_AVOL] == 0)
340   {
341      /* note that I do count += length, NOT count = length + 1. You might think */
342      /* it's the same since the volume is 0, but doing the latter could cause */
343      /* interferencies when the program is rapidly modulating the volume. */
344      if (PSG->CountA <= length*STEP) PSG->CountA += length*STEP;
345   }
346   if (PSG->Regs[AY_ENABLE] & 0x02)
347   {
348      if (PSG->CountB <= length*STEP) PSG->CountB += length*STEP;
349      PSG->OutputB = 1;
350   }
351   else if (PSG->Regs[AY_BVOL] == 0)
352   {
353      if (PSG->CountB <= length*STEP) PSG->CountB += length*STEP;
354   }
355   if (PSG->Regs[AY_ENABLE] & 0x04)
356   {
357      if (PSG->CountC <= length*STEP) PSG->CountC += length*STEP;
358      PSG->OutputC = 1;
359   }
360   else if (PSG->Regs[AY_CVOL] == 0)
361   {
362      if (PSG->CountC <= length*STEP) PSG->CountC += length*STEP;
363   }
364
365   /* for the noise channel we must not touch OutputN - it's also not necessary */
366   /* since we use outn. */
367   if ((PSG->Regs[AY_ENABLE] & 0x38) == 0x38)   /* all off */
368      if (PSG->CountN <= length*STEP) PSG->CountN += length*STEP;
369
370   outn = (PSG->OutputN | PSG->Regs[AY_ENABLE]);
371
372
373383   /* buffering loop */
374384   while (length)
375385   {
376      int vola,volb,volc;
377      int left;
378
379
380      /* vola, volb and volc keep track of how long each square wave stays */
381      /* in the 1 position during the sample period. */
382      vola = volb = volc = 0;
383
384      left = STEP;
385      do
386      for (chan = 0; chan < NUM_CHANNELS; chan++)
386387      {
387         int nextevent;
388
389
390         if (PSG->CountN < left) nextevent = PSG->CountN;
391         else nextevent = left;
392
393         if (outn & 0x08)
388         PSG->Count[chan]++;
389         if (PSG->Count[chan] >= TONE_PERIOD(PSG, chan) * PSG->step)
394390         {
395            if (PSG->OutputA) vola += PSG->CountA;
396            PSG->CountA -= nextevent;
397            /* PeriodA is the half period of the square wave. Here, in each */
398            /* loop I add PeriodA twice, so that at the end of the loop the */
399            /* square wave is in the same status (0 or 1) it was at the start. */
400            /* vola is also incremented by PeriodA, since the wave has been 1 */
401            /* exactly half of the time, regardless of the initial position. */
402            /* If we exit the loop in the middle, OutputA has to be inverted */
403            /* and vola incremented only if the exit status of the square */
404            /* wave is 1. */
405            while (PSG->CountA <= 0)
406            {
407               PSG->CountA += PSG->PeriodA;
408               if (PSG->CountA > 0)
409               {
410                  PSG->OutputA ^= 1;
411                  if (PSG->OutputA) vola += PSG->PeriodA;
412                  break;
413               }
414               PSG->CountA += PSG->PeriodA;
415               vola += PSG->PeriodA;
416            }
417            if (PSG->OutputA) vola -= PSG->CountA;
391            PSG->Output[chan] ^= 1;
392            PSG->Count[chan] = 0;;
418393         }
419         else
420         {
421            PSG->CountA -= nextevent;
422            while (PSG->CountA <= 0)
423            {
424               PSG->CountA += PSG->PeriodA;
425               if (PSG->CountA > 0)
426               {
427                  PSG->OutputA ^= 1;
428                  break;
429               }
430               PSG->CountA += PSG->PeriodA;
431            }
432         }
394      }
433395
434         if (outn & 0x10)
396      PSG->CountN++;
397      if (PSG->CountN >= NOISE_PERIOD(PSG) * PSG->step)
398      {
399         /* Is noise output going to change? */
400         if ((PSG->RNG + 1) & 2)   /* (bit0^bit1)? */
435401         {
436            if (PSG->OutputB) volb += PSG->CountB;
437            PSG->CountB -= nextevent;
438            while (PSG->CountB <= 0)
439            {
440               PSG->CountB += PSG->PeriodB;
441               if (PSG->CountB > 0)
442               {
443                  PSG->OutputB ^= 1;
444                  if (PSG->OutputB) volb += PSG->PeriodB;
445                  break;
446               }
447               PSG->CountB += PSG->PeriodB;
448               volb += PSG->PeriodB;
449            }
450            if (PSG->OutputB) volb -= PSG->CountB;
402            PSG->OutputN ^= 1;
451403         }
452         else
453         {
454            PSG->CountB -= nextevent;
455            while (PSG->CountB <= 0)
456            {
457               PSG->CountB += PSG->PeriodB;
458               if (PSG->CountB > 0)
459               {
460                  PSG->OutputB ^= 1;
461                  break;
462               }
463               PSG->CountB += PSG->PeriodB;
464            }
465         }
466404
467         if (outn & 0x20)
468         {
469            if (PSG->OutputC) volc += PSG->CountC;
470            PSG->CountC -= nextevent;
471            while (PSG->CountC <= 0)
472            {
473               PSG->CountC += PSG->PeriodC;
474               if (PSG->CountC > 0)
475               {
476                  PSG->OutputC ^= 1;
477                  if (PSG->OutputC) volc += PSG->PeriodC;
478                  break;
479               }
480               PSG->CountC += PSG->PeriodC;
481               volc += PSG->PeriodC;
482            }
483            if (PSG->OutputC) volc -= PSG->CountC;
484         }
485         else
486         {
487            PSG->CountC -= nextevent;
488            while (PSG->CountC <= 0)
489            {
490               PSG->CountC += PSG->PeriodC;
491               if (PSG->CountC > 0)
492               {
493                  PSG->OutputC ^= 1;
494                  break;
495               }
496               PSG->CountC += PSG->PeriodC;
497            }
498         }
405         /* The Random Number Generator of the 8910 is a 17-bit shift */
406         /* register. The input to the shift register is bit0 XOR bit3 */
407         /* (bit0 is the output). This was verified on AY-3-8910 and YM2149 chips. */
499408
500         PSG->CountN -= nextevent;
501         if (PSG->CountN <= 0)
502         {
503            /* Is noise output going to change? */
504            if ((PSG->RNG + 1) & 2)   /* (bit0^bit1)? */
505            {
506               PSG->OutputN = ~PSG->OutputN;
507               outn = (PSG->OutputN | PSG->Regs[AY_ENABLE]);
508            }
409         /* The following is a fast way to compute bit17 = bit0^bit3. */
410         /* Instead of doing all the logic operations, we only check */
411         /* bit0, relying on the fact that after three shifts of the */
412         /* register, what now is bit3 will become bit0, and will */
413         /* invert, if necessary, bit14, which previously was bit17. */
414         if (PSG->RNG & 1)
415            PSG->RNG ^= 0x24000; /* This version is called the "Galois configuration". */
416         PSG->RNG >>= 1;
417         PSG->CountN = 0;
418      }
509419
510            /* The Random Number Generator of the 8910 is a 17-bit shift */
511            /* register. The input to the shift register is bit0 XOR bit3 */
512            /* (bit0 is the output). This was verified on AY-3-8910 and YM2149 chips. */
420      for (chan = 0; chan < NUM_CHANNELS; chan++)
421      {
422         PSG->vol_enabled[chan] = (PSG->Output[chan] | TONE_ENABLEQ(PSG, chan)) & (PSG->OutputN | NOISE_ENABLEQ(PSG, chan));
423      }
513424
514            /* The following is a fast way to compute bit17 = bit0^bit3. */
515            /* Instead of doing all the logic operations, we only check */
516            /* bit0, relying on the fact that after three shifts of the */
517            /* register, what now is bit3 will become bit0, and will */
518            /* invert, if necessary, bit14, which previously was bit17. */
519            if (PSG->RNG & 1) PSG->RNG ^= 0x24000; /* This version is called the "Galois configuration". */
520            PSG->RNG >>= 1;
521            PSG->CountN += PSG->PeriodN;
522         }
523
524         left -= nextevent;
525      } while (left > 0);
526
527425      /* update envelope */
528426      if (PSG->Holding == 0)
529427      {
530         PSG->CountE -= STEP;
531         if (PSG->CountE <= 0)
428         PSG->CountE++;
429         if (PSG->CountE >= ENVELOPE_PERIOD(PSG))
532430         {
533            do
534            {
535               PSG->CountEnv--;
536               PSG->CountE += PSG->PeriodE;
537            } while (PSG->CountE <= 0);
431            PSG->CountE = 0;
432            PSG->CountEnv--;
538433
539434            /* check envelope current position */
540435            if (PSG->CountEnv < 0)
r2454r2455
542437               if (PSG->Hold)
543438               {
544439                  if (PSG->Alternate)
545                     PSG->Attack ^= 0x1f;
440                     PSG->Attack ^= PSG->EnvP;
546441                  PSG->Holding = 1;
547442                  PSG->CountEnv = 0;
548443               }
r2454r2455
550445               {
551446                  /* if CountEnv has looped an odd number of times (usually 1), */
552447                  /* invert the output. */
553                  if (PSG->Alternate && (PSG->CountEnv & 0x20))
554                      PSG->Attack ^= 0x1f;
448                  if (PSG->Alternate && (PSG->CountEnv & (PSG->EnvP + 1)))
449                      PSG->Attack ^= PSG->EnvP;
555450
556                  PSG->CountEnv &= 0x1f;
451                  PSG->CountEnv &= PSG->EnvP;
557452               }
558453            }
559454
560            PSG->VolE = PSG->VolTable[PSG->CountEnv ^ PSG->Attack];
561            /* reload volume */
562            if (PSG->EnvelopeA) PSG->VolA = PSG->VolE;
563            if (PSG->EnvelopeB) PSG->VolB = PSG->VolE;
564            if (PSG->EnvelopeC) PSG->VolC = PSG->VolE;
565455         }
566456      }
457      PSG->VolE = (PSG->CountEnv ^ PSG->Attack);
567458
568459      if (PSG->streams == 3)
569460      {
570         *(buf1++) = (vola * PSG->VolA) / STEP;
571         *(buf2++) = (volb * PSG->VolB) / STEP;
572         *(buf3++) = (volc * PSG->VolC) / STEP;
461         for (chan = 0; chan < NUM_CHANNELS; chan++)
462            if (TONE_ENVELOPE(PSG,chan))
463            {
464               /* Envolope has no "off" state */
465               *(buf[chan]++) = PSG->VolTableE[chan][PSG->vol_enabled[chan] ? PSG->VolE : 0];
466            }
467            else
468            {
469               *(buf[chan]++) = PSG->VolTable[chan][PSG->vol_enabled[chan] ? TONE_VOLUME(PSG, chan) : 0];
470            }
573471      }
574472      else
575         *(buf1++) = (vola * PSG->VolA + volb * PSG->VolB + volc * PSG->VolC) / STEP;
576
473      {
474         *(buf[0]++) = mix_3D(PSG);
475#if 0
476         *(buf[0]) = (  vol_enabled[0] * PSG->VolTable[PSG->Vol[0]]
477                      + vol_enabled[1] * PSG->VolTable[PSG->Vol[1]]
478                      + vol_enabled[2] * PSG->VolTable[PSG->Vol[2]]) / PSG->step;
479#endif
480      }
577481      length--;
578482   }
579483}
r2454r2455
589493         stream_set_output_gain(PSG->Channel, ch, volume / 100.0);
590494}
591495
496INLINE void build_single_table(double rl, ay_ym_param *par, int normalize, INT32 *tab, int zero_is_off)
497{
498   int j;
499   double rt, rw = 0;
500   double temp[32], min=10.0, max=0.0;
592501
593static void build_mixer_table(struct AY8910 *PSG)
502   for (j=0; j < par->N; j++)
503   {
504      rt = 1.0 / par->r_down + 1.0 / rl;
505
506      rw = 1.0 / par->res[j];
507      rt += 1.0 / par->res[j];
508
509      if (!(zero_is_off && j == 0))
510      {
511         rw += 1.0 / par->r_up;
512         rt += 1.0 / par->r_up;
513      }
514
515      temp[j] = rw / rt;
516      if (temp[j] < min)
517         min = temp[j];
518      if (temp[j] > max)
519         max = temp[j];
520   }
521   if (normalize)
522   {
523      for (j=0; j < par->N; j++)
524         tab[j] = MAX_OUTPUT * (((temp[j] - min)/(max-min)) - 0.25) * 0.5;
525   }
526   else
527   {
528      for (j=0; j < par->N; j++)
529         tab[j] = MAX_OUTPUT * temp[j];
530   }
531
532}
533
534INLINE void build_3D_table(double rl, ay_ym_param *par, ay_ym_param *parE, int normalize, double factor, int zero_is_off, INT32 *tab)
594535{
595   int i;
596   double out;
536   int j, j1, j2, j3, e, indx;
537   double rt, rw, n;
538   double min = 10.0,  max = 0.0;
539   double *temp;
597540
541   temp = malloc(8*32*32*32*sizeof(*temp));
598542
599   /* calculate the volume->voltage conversion table */
600   /* The AY-3-8910 has 16 levels, in a logarithmic scale (3dB per step) */
601   /* The YM2149 still has 16 levels for the tone generators, but 32 for */
602   /* the envelope generator (1.5dB per step). */
603   out = MAX_OUTPUT;
604   for (i = 31;i > 0;i--)
543   for (e=0; e < 8; e++)
544      for (j1=0; j1 < 32; j1++)
545         for (j2=0; j2 < 32; j2++)
546            for (j3=0; j3 < 32; j3++)
547            {
548               if (zero_is_off)
549               {
550                  n  = (j1 != 0 || (e & 0x01)) ? 1 : 0;
551                  n += (j2 != 0 || (e & 0x02)) ? 1 : 0;
552                  n += (j3 != 0 || (e & 0x04)) ? 1 : 0;
553               }
554               else
555                  n = 3.0;
556
557               rt = n / par->r_up + 3.0 / par->r_down + 1.0 / rl;
558               rw = n / par->r_up;
559
560               rw += 1.0 / ( (e & 0x01) ? parE->res[j1] : par->res[j1]);
561               rt += 1.0 / ( (e & 0x01) ? parE->res[j1] : par->res[j1]);
562               rw += 1.0 / ( (e & 0x02) ? parE->res[j2] : par->res[j2]);
563               rt += 1.0 / ( (e & 0x02) ? parE->res[j2] : par->res[j2]);
564               rw += 1.0 / ( (e & 0x04) ? parE->res[j3] : par->res[j3]);
565               rt += 1.0 / ( (e & 0x04) ? parE->res[j3] : par->res[j3]);
566
567               indx = (e << 15) | (j3<<10) | (j2<<5) | j1;
568               temp[indx] = rw / rt;
569               if (temp[indx] < min)
570                  min = temp[indx];
571               if (temp[indx] > max)
572                  max = temp[indx];
573            }
574
575   if (normalize)
605576   {
606      PSG->VolTable[i] = out + 0.5;   /* round to nearest */
577      for (j=0; j < 32*32*32*8; j++)
578         tab[j] = MAX_OUTPUT * (((temp[j] - min)/(max-min)) - 0.25) * factor;
579   }
580   else
581   {
582      for (j=0; j < 32*32*32*8; j++)
583         tab[j] = MAX_OUTPUT * temp[j];
584   }
607585
608      out /= 1.188502227;   /* = 10 ^ (1.5/20) = 1.5dB */
609   }
610   PSG->VolTable[0] = 0;
586   /* for (e=0;e<16;e++) printf("%d %d\n",e<<10, tab[e<<10]); */
587
588   free(temp);
611589}
612590
613591
614
615static void AY8910_init(struct AY8910 *PSG, int streams,
616      int clock,int sample_rate,
617      read8_machine_func portAread,read8_machine_func portBread,
618      write8_machine_func portAwrite,write8_machine_func portBwrite)
592static void build_mixer_table(struct AY8910 *PSG)
619593{
620   PSG->PortAread = portAread;
621   PSG->PortBread = portBread;
622   PSG->PortAwrite = portAwrite;
623   PSG->PortBwrite = portBwrite;
594   int   normalize = 0;
595   int   chan;
624596
625   /* the step clock for the tone and noise generators is the chip clock    */
626   /* divided by 8; for the envelope generator of the AY-3-8910, it is half */
627   /* that much (clock/16), but the envelope of the YM2149 goes twice as    */
628   /* fast, therefore again clock/8.                                        */
629   PSG->Channel = stream_create(0,streams,clock/8,PSG,AY8910Update);
597   if ((PSG->intf->flags & AY8910_LEGACY_OUTPUT) != 0)
598   {
599      logerror("AY-3-8910/YM2149 using legacy output levels!\n");
600      normalize = 1;
601   }
630602
631   ay8910_set_clock_ym(PSG,clock);
603   for (chan=0; chan < NUM_CHANNELS; chan++)
604   {
605      build_single_table(PSG->intf->res_load[chan], PSG->par, normalize, PSG->VolTable[chan], PSG->zero_is_off);
606      build_single_table(PSG->intf->res_load[chan], PSG->parE, normalize, PSG->VolTableE[chan], 0);
607   }
608   build_3D_table(PSG->intf->res_load[0], PSG->par, PSG->parE, normalize, 3, PSG->zero_is_off, PSG->vol3d_tab);
632609}
633610
634611
635612static void AY8910_statesave(struct AY8910 *PSG, int sndindex)
636613{
637614   state_save_register_item("AY8910", sndindex, PSG->register_latch);
638   state_save_register_item_array("AY8910", sndindex, PSG->Regs);
615   state_save_register_item_array("AY8910", sndindex, PSG->regs);
639616   state_save_register_item("AY8910", sndindex, PSG->lastEnable);
640617
641   state_save_register_item("AY8910", sndindex, PSG->PeriodA);
642   state_save_register_item("AY8910", sndindex, PSG->PeriodB);
643   state_save_register_item("AY8910", sndindex, PSG->PeriodC);
644   state_save_register_item("AY8910", sndindex, PSG->PeriodN);
645   state_save_register_item("AY8910", sndindex, PSG->PeriodE);
646
647   state_save_register_item("AY8910", sndindex, PSG->CountA);
648   state_save_register_item("AY8910", sndindex, PSG->CountB);
649   state_save_register_item("AY8910", sndindex, PSG->CountC);
618   state_save_register_item_array("AY8910", sndindex, PSG->Count);
650619   state_save_register_item("AY8910", sndindex, PSG->CountN);
651620   state_save_register_item("AY8910", sndindex, PSG->CountE);
652621
653   state_save_register_item("AY8910", sndindex, PSG->VolA);
654   state_save_register_item("AY8910", sndindex, PSG->VolB);
655   state_save_register_item("AY8910", sndindex, PSG->VolC);
656622   state_save_register_item("AY8910", sndindex, PSG->VolE);
657623
658   state_save_register_item("AY8910", sndindex, PSG->EnvelopeA);
659   state_save_register_item("AY8910", sndindex, PSG->EnvelopeB);
660   state_save_register_item("AY8910", sndindex, PSG->EnvelopeC);
661
662   state_save_register_item("AY8910", sndindex, PSG->OutputA);
663   state_save_register_item("AY8910", sndindex, PSG->OutputB);
664   state_save_register_item("AY8910", sndindex, PSG->OutputC);
624   state_save_register_item_array("AY8910", sndindex, PSG->Output);
665625   state_save_register_item("AY8910", sndindex, PSG->OutputN);
666626
667627   state_save_register_item("AY8910", sndindex, PSG->CountEnv);
r2454r2455
673633}
674634
675635
676void *ay8910_start_ym(sound_type chip_type, int sndindex, int clock, int streams,
677      read8_machine_func portAread, read8_machine_func portBread,
678      write8_machine_func portAwrite, write8_machine_func portBwrite)
636void *ay8910_start_ym(sound_type chip_type, int sndindex, int clock, const struct AY8910interface *intf)
679637{
680638   struct AY8910 *info;
681639
682640   info = auto_malloc(sizeof(*info));
683641   memset(info, 0, sizeof(*info));
684642   info->index = sndindex;
685   info->streams = streams;
643   info->intf = intf;
644   if ((info->intf->flags & AY8910_SINGLE_OUTPUT) != 0)
645   {
646      logerror("AY-3-8910/YM2149 using single output!\n");
647      info->streams = 1;
648   }
649   else
650      info->streams = 3;
686651
687   AY8910_init(info, streams, clock,
688         clock/8,
689         portAread,portBread,
690         portAwrite,portBwrite);
652   switch (chip_type)
653   {
654      case SOUND_AY8910:
655      case SOUND_AY8930:
656         info->step = 1;
657         info->par = &ay8910_param;
658         info->parE = &ay8910_param;
659         info->zero_is_off = 1;
660         break;
661      case SOUND_YM2149:
662      case SOUND_YM2203:
663      case SOUND_YM2610:
664      case SOUND_YM2610B:
665      case SOUND_YM2608:
666      case SOUND_YMZ284:
667      case SOUND_YMZ294:
668      case SOUND_YM3439:
669      default:
670         info->step = 2;
671         info->par = &ym2149_param;
672         info->parE = &ym2149_paramE;
673         info->zero_is_off = 0;
674         break;
675   }
676   info->EnvP = info->step * 16 - 1;
691677
692678   build_mixer_table(info);
679
680   /* the step clock for the tone and noise generators is the chip clock    */
681   /* divided by 8 for the YM2149 and 16 for the AY-3-8910, To emulate a    */
682   /* full cycle, we have to use a divisor of 4 resp. 8                     */
683   info->Channel = stream_create(0,info->streams,clock / (8 / info->step),info,AY8910_update);
684
685   ay8910_set_clock_ym(info,clock);
693686   AY8910_statesave(info, sndindex);
694687
695688   return info;
r2454r2455
706699
707700   PSG->register_latch = 0;
708701   PSG->RNG = 1;
709   PSG->OutputA = 0;
710   PSG->OutputB = 0;
711   PSG->OutputC = 0;
712   PSG->OutputN = 0xff;
702   PSG->Output[0] = 0;
703   PSG->Output[1] = 0;
704   PSG->Output[2] = 0;
705   PSG->Count[0] = 0;
706   PSG->Count[1] = 0;
707   PSG->Count[2] = 0;
708   PSG->CountN = 0;
709   PSG->CountE = 0;
710   PSG->OutputN = 0x01;
713711   PSG->lastEnable = -1;   /* force a write */
714712   for (i = 0;i < AY_PORTA;i++)
715      _AYWriteReg(PSG,i,0);   /* AYWriteReg() uses the timer system; we cannot */
716                        /* call it at this time because the timer system */
717                        /* has not been initialized. */
713      AY8910_write_reg(PSG,i,0);
718714   PSG->ready = 1;
719715}
720716
721717void ay8910_set_clock_ym(void *chip, int clock)
722718{
723719   struct AY8910 *PSG = chip;
724   stream_set_sample_rate(PSG->Channel, clock/8);
720   stream_set_sample_rate(PSG->Channel, clock / (8 / PSG->step));
725721}
726722
727723void ay8910_write_ym(void *chip, int addr, int data)
r2454r2455
733729      int r = PSG->register_latch;
734730
735731      if (r > 15) return;
736      if (r < 14)
732      if (r == AY_ESHAPE || PSG->regs[r] != data)
737733      {
738         if (r == AY_ESHAPE || PSG->Regs[r] != data)
739         {
740            /* update the output buffer before changing the register */
741            stream_update(PSG->Channel);
742         }
734         /* update the output buffer before changing the register */
735         stream_update(PSG->Channel);
743736      }
744737
745      _AYWriteReg(PSG,r,data);
738      AY8910_write_reg(PSG,r,data);
746739   }
747740   else
748741   {   /* Register port */
r2454r2455
760753   switch (r)
761754   {
762755   case AY_PORTA:
763      if ((PSG->Regs[AY_ENABLE] & 0x40) != 0)
756      if ((PSG->regs[AY_ENABLE] & 0x40) != 0)
764757         logerror("warning: read from 8910 #%d Port A set as output\n",PSG->index);
765758      /*
766759           even if the port is set as output, we still need to return the external
767760           data. Some games, like kidniki, need this to work.
768761         */
769      if (PSG->PortAread) PSG->Regs[AY_PORTA] = (*PSG->PortAread)(Machine, 0);
770      else logerror("PC %04x: warning - read 8910 #%d Port A\n",activecpu_get_pc(),PSG->index);
762      if (PSG->intf->portAread)
763         PSG->regs[AY_PORTA] = (*PSG->intf->portAread)(Machine, 0);
764      else
765         logerror("PC %04x: warning - read 8910 #%d Port A\n",activecpu_get_pc(),PSG->index);
771766      break;
772767   case AY_PORTB:
773      if ((PSG->Regs[AY_ENABLE] & 0x80) != 0)
768      if ((PSG->regs[AY_ENABLE] & 0x80) != 0)
774769         logerror("warning: read from 8910 #%d Port B set as output\n",PSG->index);
775      if (PSG->PortBread) PSG->Regs[AY_PORTB] = (*PSG->PortBread)(Machine, 0);
776      else logerror("PC %04x: warning - read 8910 #%d Port B\n",activecpu_get_pc(),PSG->index);
770      if (PSG->intf->portBread)
771         PSG->regs[AY_PORTB] = (*PSG->intf->portBread)(Machine, 0);
772      else
773         logerror("PC %04x: warning - read 8910 #%d Port B\n",activecpu_get_pc(),PSG->index);
777774      break;
778775   }
779   return PSG->Regs[r];
776   return PSG->regs[r];
780777}
781778
782779
783
784780static void *ay8910_start(int sndindex, int clock, const void *config)
785781{
786   static const struct AY8910interface generic_ay8910 = { 0 };
787   const struct AY8910interface *intf = config ? config : &generic_ay8910;
788   return ay8910_start_ym(SOUND_AY8910, sndindex+16, clock, 3, intf->portAread, intf->portBread, intf->portAwrite, intf->portBwrite);
782   static const struct AY8910interface generic_ay8910 =
783   {
784      AY8910_LEGACY_OUTPUT,
785      AY8910_DEFAULT_LOADS,
786      NULL, NULL, NULL, NULL
787   };
788   const struct AY8910interface *intf = (config ? config : &generic_ay8910);
789   return ay8910_start_ym(SOUND_AY8910, sndindex+16, clock, intf);
789790}
790791
792static void *ym2149_start(int sndindex, int clock, const void *config)
793{
794   static const struct AY8910interface generic_ay8910 =
795   {
796      AY8910_LEGACY_OUTPUT,
797      AY8910_DEFAULT_LOADS,
798      NULL, NULL, NULL, NULL
799   };
800   const struct AY8910interface *intf = (config ? config : &generic_ay8910);
801   return ay8910_start_ym(SOUND_YM2149, sndindex+16, clock, intf);
802}
803
791804static void ay8910_stop(void *chip)
792805{
793806   ay8910_stop_ym(chip);
r2454r2455
863876{
864877   switch (state)
865878   {
866      case SNDINFO_PTR_START:                     info->start = ay8910_start;            break;
879      case SNDINFO_PTR_START:                     info->start = ym2149_start;            break;
867880      case SNDINFO_STR_NAME:                     info->s = "YM2149";                  break;
868881      default:                               ay8910_get_info(token, state, info);   break;
869882   }
r2454r2455
873886{
874887   switch (state)
875888   {
876      case SNDINFO_PTR_START:                     info->start = ay8910_start;            break;
889      case SNDINFO_PTR_START:                     info->start = ym2149_start;            break;
877890      case SNDINFO_STR_NAME:                     info->s = "YM3439";                  break;
878891      default:                               ay8910_get_info(token, state, info);   break;
879892   }
r2454r2455
883896{
884897   switch (state)
885898   {
886      case SNDINFO_PTR_START:                     info->start = ay8910_start;            break;
899      case SNDINFO_PTR_START:                     info->start = ym2149_start;            break;
887900      case SNDINFO_STR_NAME:                     info->s = "YMZ284";                  break;
888901      default:                               ay8910_get_info(token, state, info);   break;
889902   }
r2454r2455
893906{
894907   switch (state)
895908   {
896      case SNDINFO_PTR_START:                     info->start = ay8910_start;            break;
909      case SNDINFO_PTR_START:                     info->start = ym2149_start;            break;
897910      case SNDINFO_STR_NAME:                     info->s = "YMZ294";                  break;
898911      default:                               ay8910_get_info(token, state, info);   break;
899912   }
900913}
914
915/* AY8910 interface */
916READ8_HANDLER( AY8910_read_port_0_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 0)); }
917READ8_HANDLER( AY8910_read_port_1_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 1)); }
918READ8_HANDLER( AY8910_read_port_2_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 2)); }
919READ8_HANDLER( AY8910_read_port_3_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 3)); }
920READ8_HANDLER( AY8910_read_port_4_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 4)); }
921READ16_HANDLER( AY8910_read_port_0_lsb_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 0)); }
922READ16_HANDLER( AY8910_read_port_1_lsb_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 1)); }
923READ16_HANDLER( AY8910_read_port_2_lsb_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 2)); }
924READ16_HANDLER( AY8910_read_port_3_lsb_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 3)); }
925READ16_HANDLER( AY8910_read_port_4_lsb_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 4)); }
926READ16_HANDLER( AY8910_read_port_0_msb_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 0)) << 8; }
927READ16_HANDLER( AY8910_read_port_1_msb_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 1)) << 8; }
928READ16_HANDLER( AY8910_read_port_2_msb_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 2)) << 8; }
929READ16_HANDLER( AY8910_read_port_3_msb_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 3)) << 8; }
930READ16_HANDLER( AY8910_read_port_4_msb_r ) { return ay8910_read_ym(sndti_token(SOUND_AY8910, 4)) << 8; }
931
932WRITE8_HANDLER( AY8910_control_port_0_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 0),0,data); }
933WRITE8_HANDLER( AY8910_control_port_1_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 1),0,data); }
934WRITE8_HANDLER( AY8910_control_port_2_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 2),0,data); }
935WRITE8_HANDLER( AY8910_control_port_3_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 3),0,data); }
936WRITE8_HANDLER( AY8910_control_port_4_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 4),0,data); }
937WRITE16_HANDLER( AY8910_control_port_0_lsb_w ) { if (ACCESSING_BITS_0_7) ay8910_write_ym(sndti_token(SOUND_AY8910, 0),0,data & 0xff); }
938WRITE16_HANDLER( AY8910_control_port_1_lsb_w ) { if (ACCESSING_BITS_0_7) ay8910_write_ym(sndti_token(SOUND_AY8910, 1),0,data & 0xff); }
939WRITE16_HANDLER( AY8910_control_port_2_lsb_w ) { if (ACCESSING_BITS_0_7) ay8910_write_ym(sndti_token(SOUND_AY8910, 2),0,data & 0xff); }
940WRITE16_HANDLER( AY8910_control_port_3_lsb_w ) { if (ACCESSING_BITS_0_7) ay8910_write_ym(sndti_token(SOUND_AY8910, 3),0,data & 0xff); }
941WRITE16_HANDLER( AY8910_control_port_4_lsb_w ) { if (ACCESSING_BITS_0_7) ay8910_write_ym(sndti_token(SOUND_AY8910, 4),0,data & 0xff); }
942WRITE16_HANDLER( AY8910_control_port_0_msb_w ) { if (ACCESSING_BITS_8_15) ay8910_write_ym(sndti_token(SOUND_AY8910, 0),0,data >> 8); }
943WRITE16_HANDLER( AY8910_control_port_1_msb_w ) { if (ACCESSING_BITS_8_15) ay8910_write_ym(sndti_token(SOUND_AY8910, 1),0,data >> 8); }
944WRITE16_HANDLER( AY8910_control_port_2_msb_w ) { if (ACCESSING_BITS_8_15) ay8910_write_ym(sndti_token(SOUND_AY8910, 2),0,data >> 8); }
945WRITE16_HANDLER( AY8910_control_port_3_msb_w ) { if (ACCESSING_BITS_8_15) ay8910_write_ym(sndti_token(SOUND_AY8910, 3),0,data >> 8); }
946WRITE16_HANDLER( AY8910_control_port_4_msb_w ) { if (ACCESSING_BITS_8_15) ay8910_write_ym(sndti_token(SOUND_AY8910, 4),0,data >> 8); }
947
948WRITE8_HANDLER( AY8910_write_port_0_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 0),1,data); }
949WRITE8_HANDLER( AY8910_write_port_1_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 1),1,data); }
950WRITE8_HANDLER( AY8910_write_port_2_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 2),1,data); }
951WRITE8_HANDLER( AY8910_write_port_3_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 3),1,data); }
952WRITE8_HANDLER( AY8910_write_port_4_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 4),1,data); }
953WRITE16_HANDLER( AY8910_write_port_0_lsb_w ) { if (ACCESSING_BITS_0_7) ay8910_write_ym(sndti_token(SOUND_AY8910, 0),1,data & 0xff); }
954WRITE16_HANDLER( AY8910_write_port_1_lsb_w ) { if (ACCESSING_BITS_0_7) ay8910_write_ym(sndti_token(SOUND_AY8910, 1),1,data & 0xff); }
955WRITE16_HANDLER( AY8910_write_port_2_lsb_w ) { if (ACCESSING_BITS_0_7) ay8910_write_ym(sndti_token(SOUND_AY8910, 2),1,data & 0xff); }
956WRITE16_HANDLER( AY8910_write_port_3_lsb_w ) { if (ACCESSING_BITS_0_7) ay8910_write_ym(sndti_token(SOUND_AY8910, 3),1,data & 0xff); }
957WRITE16_HANDLER( AY8910_write_port_4_lsb_w ) { if (ACCESSING_BITS_0_7) ay8910_write_ym(sndti_token(SOUND_AY8910, 4),1,data & 0xff); }
958WRITE16_HANDLER( AY8910_write_port_0_msb_w ) { if (ACCESSING_BITS_8_15) ay8910_write_ym(sndti_token(SOUND_AY8910, 0),1,data >> 8); }
959WRITE16_HANDLER( AY8910_write_port_1_msb_w ) { if (ACCESSING_BITS_8_15) ay8910_write_ym(sndti_token(SOUND_AY8910, 1),1,data >> 8); }
960WRITE16_HANDLER( AY8910_write_port_2_msb_w ) { if (ACCESSING_BITS_8_15) ay8910_write_ym(sndti_token(SOUND_AY8910, 2),1,data >> 8); }
961WRITE16_HANDLER( AY8910_write_port_3_msb_w ) { if (ACCESSING_BITS_8_15) ay8910_write_ym(sndti_token(SOUND_AY8910, 3),1,data >> 8); }
962WRITE16_HANDLER( AY8910_write_port_4_msb_w ) { if (ACCESSING_BITS_8_15) ay8910_write_ym(sndti_token(SOUND_AY8910, 4),1,data >> 8); }
src/emu/sound/ay8910.h
r2454r2455
1616
1717#define ALL_8910_CHANNELS -1
1818
19
20/* Internal resistance at Volume level 7 */
21
22#define AY8910_INTERNAL_RESISTANCE   (356)
23#define YM2149_INTERNAL_RESISTANCE   (353)
24#define AY8910_DEFAULT_LOADS      {1000, 1000, 1000}
25
26
27#define AY8910_LEGACY_OUTPUT      (1)
28#define AY8910_SINGLE_OUTPUT      (2)
29#define AY8910_DISCRETE_OUTPUT      (4)
30
1931struct AY8910interface
2032{
21   read8_machine_func portAread;
22   read8_machine_func portBread;
23   write8_machine_func portAwrite;
24   write8_machine_func portBwrite;
33   int               flags;         /* Flags */
34   int               res_load[3];    /* Load on channel in ohms */
35   read8_machine_func   portAread;
36   read8_machine_func   portBread;
37   write8_machine_func   portAwrite;
38   write8_machine_func   portBwrite;
2539};
2640
2741void AY8910_set_volume(int chip,int channel,int volume);
r2454r2455
7791
7892/*********** An interface for SSG of YM2203 ***********/
7993
80void *ay8910_start_ym(sound_type chip_type, int sndindex, int clock, int streams,
81      read8_machine_func portAread, read8_machine_func portBread,
82      write8_machine_func portAwrite, write8_machine_func portBwrite);
94void *ay8910_start_ym(sound_type chip_type, int sndindex, int clock, const struct AY8910interface *intf);
8395
8496void ay8910_stop_ym(void *chip);
8597void ay8910_reset_ym(void *chip);
src/emu/sound/scsp.c
r2454r2455
13101310      case 0x42a:
13111311         if(stv_scu && !(stv_scu[40] & 0x40) /*&& scsp_regs[0x42c/2] & 0x20*/)/*Main CPU allow sound irq*/
13121312         {
1313            cpunum_set_input_line_and_vector(Machine, 0, 9, HOLD_LINE , 0x46);
1313            cpunum_set_input_line_and_vector(machine, 0, 9, HOLD_LINE , 0x46);
13141314             logerror("SCSP: Main CPU interrupt\n");
13151315         }
13161316      break;
src/emu/sound/2610intf.c
r2454r2455
123123static void *ym2610_start(int sndindex, int clock, const void *config)
124124{
125125   static const struct YM2610interface generic_2610 = { 0 };
126   static const struct AY8910interface generic_ay8910 =
127   {
128      AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT,
129      AY8910_DEFAULT_LOADS,
130      NULL, NULL, NULL, NULL
131   };
126132   const struct YM2610interface *intf = config ? config : &generic_2610;
127133   int rate = clock/72;
128134   void *pcmbufa,*pcmbufb;
r2454r2455
135141   memset(info, 0, sizeof(*info));
136142
137143   info->intf = intf;
138   info->psg = ay8910_start_ym(SOUND_YM2610, sndindex, clock, 1, NULL, NULL, NULL, NULL);
144   info->psg = ay8910_start_ym(SOUND_YM2610, sndindex, clock, &generic_ay8910);
139145   if (!info->psg) return NULL;
140146
141147   /* Timer Handler set */
r2454r2455
175181static void *ym2610b_start(int sndindex, int clock, const void *config)
176182{
177183   static const struct YM2610interface generic_2610 = { 0 };
184   static const struct AY8910interface generic_ay8910 =
185   {
186      AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT,
187      AY8910_DEFAULT_LOADS,
188      NULL, NULL, NULL, NULL
189   };
178190   const struct YM2610interface *intf = config ? config : &generic_2610;
179191   int rate = clock/72;
180192   void *pcmbufa,*pcmbufb;
r2454r2455
187199   memset(info, 0, sizeof(*info));
188200
189201   info->intf = intf;
190   info->psg = ay8910_start_ym(SOUND_YM2610B, sndindex, clock, 1, NULL, NULL, NULL, NULL);
202   info->psg = ay8910_start_ym(SOUND_YM2610B, sndindex, clock, &generic_ay8910);
191203   if (!info->psg) return NULL;
192204
193205   /* Timer Handler set */
src/emu/sound/fm.c
r2454r2455
115115#include "support.h"      /* use RAINE */
116116#endif
117117
118#include "ay8910.h"
118//#include "ay8910.h"
119119#include "fm.h"
120120
121121
src/emu/sound/2608intf.c
r2454r2455
120120
121121static void *ym2608_start(int sndindex, int clock, const void *config)
122122{
123   static const struct YM2608interface generic_2608 = { 0 };
123   static const struct YM2608interface generic_2608 =
124   {
125      {
126         AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT,
127         AY8910_DEFAULT_LOADS,
128         NULL, NULL, NULL, NULL
129      },
130      NULL,
131      0,
132   };
124133   const struct YM2608interface *intf = config ? config : &generic_2608;
125134   int rate = clock/72;
126135   void *pcmbufa;
r2454r2455
132141   memset(info, 0, sizeof(*info));
133142
134143   info->intf = intf;
135   info->psg = ay8910_start_ym(SOUND_YM2608, sndindex, clock, 1, intf->portAread, intf->portBread, intf->portAwrite, intf->portBwrite);
144   /* FIXME: Force to use simgle output */
145   info->psg = ay8910_start_ym(SOUND_YM2608, sndindex, clock, &intf->ay8910_intf);
136146   if (!info->psg) return NULL;
137147
138148   /* Timer Handler set */
src/emu/sound/2608intf.h
r2454r2455
22#define __2608INTF_H__
33
44#include "fm.h"
5#include "ay8910.h"
56
67struct YM2608interface
78{
8   read8_machine_func portAread;
9   read8_machine_func portBread;
10   write8_machine_func portAwrite;
11   write8_machine_func portBwrite;
9   const struct AY8910interface ay8910_intf;
1210   void ( *handler )( int irq );   /* IRQ handler for the YM2608 */
1311   int pcmrom;      /* Delta-T memory region ram/rom */
1412};
src/emu/sound/es5506.c
r2454r2455
17111711                          ((data << 2) & (CONTROL_CA0 | CONTROL_CA1));
17121712         }
17131713         if (LOG_COMMANDS && eslog)
1714            fprintf(eslog, "%06x:voice %d, control=%04x (raw=%04x & %04x)\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->control, data, mem_mask ^ 0xffff);
1714            fprintf(eslog, "%06x:voice %d, control=%04x (raw=%04x & %04x)\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->control, data, mem_mask);
17151715         break;
17161716
17171717      case 0x01:   /* O4(n-1) */
r2454r2455
18471847{
18481848   struct ES5506Voice *voice = &chip->voice[chip->current_page & 0x1f];
18491849
1850//  logerror("%04x:ES5505 write %02x/%02x = %04x & %04x\n", activecpu_get_previouspc(), chip->current_page, offset, data, mem_mask ^ 0xffff);
1850//  logerror("%04x:ES5505 write %02x/%02x = %04x & %04x\n", activecpu_get_previouspc(), chip->current_page, offset, data, mem_mask);
18511851
18521852   /* force an update */
18531853   stream_update(chip->stream);
src/emu/sound/disc_flt.c
r2454r2455
11041104   struct dst_rcfilter_sw_context *context = node->context;
11051105   int i;
11061106   double rcexp;
1107   int bits = (int)DST_RCFILTER_SW__SWITCH;
11071108   double us=0, rs=0;
11081109
1109   if(DST_RCFILTER_SW__ENABLE)
1110   if (DST_RCFILTER_SW__ENABLE)
11101111   {
11111112      for (i=0;i<4;i++)
11121113      {
1113         if ( ( (int)DST_RCFILTER_SW__SWITCH & (1<<i)) == 1)
1114         if ( ( bits & (1<<i)) != 0)
11141115         {
11151116            us += context->vCap[i];
11161117            rs += DST_RCFILTER_SW__R;
r2454r2455
11191120      node->output[0] = CD4066_ON_RES / ( CD4066_ON_RES + rs) * DST_RCFILTER_SW__VIN + DST_RCFILTER_SW__R / (CD4066_ON_RES + rs)  * us;
11201121      for (i=0;i<4;i++)
11211122      {
1122         if ( ( (int)DST_RCFILTER_SW__SWITCH & (1<<i)) == 1)
1123         if ( ( bits & (1<<i)) != 0)
11231124         {
11241125            rcexp = 1.0 - exp(-1.0 / ( CD4066_ON_RES * DST_RCFILTER_SW__C(i)) * discrete_current_context->sample_rate);
11251126            context->vCap[i] += ((node->output[0] - context->vCap[i]) * rcexp);
src/emu/sound/2203intf.c
r2454r2455
107107
108108static void *ym2203_start(int sndindex, int clock, const void *config)
109109{
110   static const struct YM2203interface generic_2203 = { 0 };
110   static const struct YM2203interface generic_2203 =
111   {
112      {
113         AY8910_LEGACY_OUTPUT,
114         AY8910_DEFAULT_LOADS,
115         NULL, NULL, NULL, NULL
116      },
117      NULL
118   };
111119   const struct YM2203interface *intf = config ? config : &generic_2203;
112120   struct ym2203_info *info;
113121   int rate = clock/72; /* ??? */
r2454r2455
116124   memset(info, 0, sizeof(*info));
117125
118126   info->intf = intf;
119   info->psg = ay8910_start_ym(SOUND_YM2203, sndindex, clock, 3, intf->portAread, intf->portBread, intf->portAwrite, intf->portBwrite);
127   info->psg = ay8910_start_ym(SOUND_YM2203, sndindex, clock, &intf->ay8910_intf);
120128   if (!info->psg) return NULL;
121129
122130   /* Timer Handler set */
src/emu/sound/2203intf.h
r2454r2455
55
66struct YM2203interface
77{
8   read8_machine_func portAread;
9   read8_machine_func portBread;
10   write8_machine_func portAwrite;
11   write8_machine_func portBwrite;
8   const struct AY8910interface ay8910_intf;
129   void (*handler)(int irq);
1310};
1411
src/emu/sound/es5503.c
r2454r2455
3535
3636#include <math.h>
3737#include "sndintrf.h"
38#include "deprecat.h"
3938#include "cpuintrf.h"
4039#include "es5503.h"
4140#include "streams.h"
r2454r2455
377376         case 0xe2:   // A/D converter
378377            if (chip->adc_read)
379378            {
380               return chip->adc_read(Machine, 0);
379               return chip->adc_read(machine, 0);
381380            }
382381            break;
383382      }
src/emu/devconv.h
r2454r2455
8888INLINE UINT16 read16be_with_read8_device_handler(read8_device_func handler, const device_config *device, offs_t offset, UINT16 mem_mask)
8989{
9090   UINT16 result = 0;
91   if ((mem_mask & 0xff00) != 0xff00)
91   if (ACCESSING_BITS_8_15)
9292      result |= ((UINT16)(*handler)(device, offset * 2 + 0)) << 8;
93   if ((mem_mask & 0x00ff) != 0x00ff)
93   if (ACCESSING_BITS_0_7)
9494      result |= ((UINT16)(*handler)(device, offset * 2 + 1)) << 0;
9595   return result;
9696}
r2454r2455
9898
9999INLINE void write16be_with_write8_device_handler(write8_device_func handler, const device_config *device, offs_t offset, UINT16 data, UINT16 mem_mask)
100100{
101   if ((mem_mask & 0xff00) != 0xff00)
101   if (ACCESSING_BITS_8_15)
102102      (*handler)(device, offset * 2 + 0, data >> 8);
103   if ((mem_mask & 0x00ff) != 0x00ff)
103   if (ACCESSING_BITS_0_7)
104104      (*handler)(device, offset * 2 + 1, data >> 0);
105105}
106106
r2454r2455
114114INLINE UINT16 read16le_with_read8_device_handler(read8_device_func handler, const device_config *device, offs_t offset, UINT16 mem_mask)
115115{
116116   UINT16 result = 0;
117   if ((mem_mask & 0x00ff) != 0x00ff)
117   if (ACCESSING_BITS_0_7)
118118      result |= ((UINT16) (*handler)(device, offset * 2 + 0)) << 0;
119   if ((mem_mask & 0xff00) != 0xff00)
119   if (ACCESSING_BITS_8_15)
120120      result |= ((UINT16) (*handler)(device, offset * 2 + 1)) << 8;
121121   return result;
122122}
r2454r2455
124124
125125INLINE void write16le_with_write8_device_handler(write8_device_func handler, const device_config *device, offs_t offset, UINT16 data, UINT16 mem_mask)
126126{
127   if ((mem_mask & 0x00ff) != 0x00ff)
127   if (ACCESSING_BITS_0_7)
128128      (*handler)(device, offset * 2 + 0, data >> 0);
129   if ((mem_mask & 0xff00) != 0xff00)
129   if (ACCESSING_BITS_8_15)
130130      (*handler)(device, offset * 2 + 1, data >> 8);
131131}
132132
r2454r2455
140140INLINE UINT32 read32be_with_read8_device_handler(read8_device_func handler, const device_config *device, offs_t offset, UINT32 mem_mask)
141141{
142142   UINT32 result = 0;
143   if ((mem_mask & 0xffff0000) != 0xffff0000)
143   if (ACCESSING_BITS_16_31)
144144      result |= read16be_with_read8_device_handler(handler, device, offset * 2 + 0, mem_mask >> 16) << 16;
145   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
145   if (ACCESSING_BITS_0_15)
146146      result |= read16be_with_read8_device_handler(handler, device, offset * 2 + 1, mem_mask) << 0;
147147   return result;
148148}
r2454r2455
150150
151151INLINE void write32be_with_write8_device_handler(write8_device_func handler, const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask)
152152{
153   if ((mem_mask & 0xffff0000) != 0xffff0000)
153   if (ACCESSING_BITS_16_31)
154154      write16be_with_write8_device_handler(handler, device, offset * 2 + 0, data >> 16, mem_mask >> 16);
155   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
155   if (ACCESSING_BITS_0_15)
156156      write16be_with_write8_device_handler(handler, device, offset * 2 + 1, data, mem_mask);
157157}
158158
r2454r2455
166166INLINE UINT32 read32le_with_read8_device_handler(read8_device_func handler, const device_config *device, offs_t offset, UINT32 mem_mask)
167167{
168168   UINT32 result = 0;
169   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
169   if (ACCESSING_BITS_0_15)
170170      result |= read16le_with_read8_device_handler(handler, device, offset * 2 + 0, mem_mask) << 0;
171   if ((mem_mask & 0xffff0000) != 0xffff0000)
171   if (ACCESSING_BITS_16_31)
172172      result |= read16le_with_read8_device_handler(handler, device, offset * 2 + 1, mem_mask >> 16) << 16;
173173   return result;
174174}
r2454r2455
176176
177177INLINE void write32le_with_write8_device_handler(write8_device_func handler, const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask)
178178{
179   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
179   if (ACCESSING_BITS_0_15)
180180      write16le_with_write8_device_handler(handler, device, offset * 2 + 0, data, mem_mask);
181   if ((mem_mask & 0xffff0000) != 0xffff0000)
181   if (ACCESSING_BITS_16_31)
182182      write16le_with_write8_device_handler(handler, device, offset * 2 + 1, data >> 16, mem_mask >> 16);
183183}
184184
r2454r2455
192192INLINE UINT32 read32be_with_16be_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT32 mem_mask)
193193{
194194   UINT32 result = 0;
195   if ((mem_mask & 0xffff0000) != 0xffff0000)
195   if (ACCESSING_BITS_16_31)
196196      result |= (*handler)(device, offset * 2 + 0, mem_mask >> 16) << 16;
197   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
197   if (ACCESSING_BITS_0_15)
198198      result |= (*handler)(device, offset * 2 + 1, mem_mask) << 0;
199199   return result;
200200}
r2454r2455
202202
203203INLINE void write32be_with_16be_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask)
204204{
205   if ((mem_mask & 0xffff0000) != 0xffff0000)
205   if (ACCESSING_BITS_16_31)
206206      (*handler)(device, offset * 2 + 0, data >> 16, mem_mask >> 16);
207   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
207   if (ACCESSING_BITS_0_15)
208208      (*handler)(device, offset * 2 + 1, data, mem_mask);
209209}
210210
r2454r2455
218218INLINE UINT32 read32le_with_16le_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT32 mem_mask)
219219{
220220   UINT32 result = 0;
221   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
221   if (ACCESSING_BITS_0_15)
222222      result |= (*handler)(device, offset * 2 + 0, mem_mask) << 0;
223   if ((mem_mask & 0xffff0000) != 0xffff0000)
223   if (ACCESSING_BITS_16_31)
224224      result |= (*handler)(device, offset * 2 + 1, mem_mask >> 16) << 16;
225225   return result;
226226}
r2454r2455
228228
229229INLINE void write32le_with_16le_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask)
230230{
231   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
231   if (ACCESSING_BITS_0_15)
232232      (*handler)(device, offset * 2 + 0, data, mem_mask);
233   if ((mem_mask & 0xffff0000) != 0xffff0000)
233   if (ACCESSING_BITS_16_31)
234234      (*handler)(device, offset * 2 + 1, data >> 16, mem_mask >> 16);
235235}
236236
r2454r2455
290290INLINE UINT64 read64be_with_read8_device_handler(read8_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask)
291291{
292292   UINT64 result = 0;
293   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
293   if (ACCESSING_BITS_32_63)
294294      result |= (UINT64)read32be_with_read8_device_handler(handler, device, offset * 2 + 0, mem_mask >> 32) << 32;
295   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
295   if (ACCESSING_BITS_0_31)
296296      result |= (UINT64)read32be_with_read8_device_handler(handler, device, offset * 2 + 1, mem_mask) << 0;
297297   return result;
298298}
r2454r2455
300300
301301INLINE void write64be_with_write8_device_handler(write8_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask)
302302{
303   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
303   if (ACCESSING_BITS_32_63)
304304      write32be_with_write8_device_handler(handler, device, offset * 2 + 0, data >> 32, mem_mask >> 32);
305   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
305   if (ACCESSING_BITS_0_31)
306306      write32be_with_write8_device_handler(handler, device, offset * 2 + 1, data, mem_mask);
307307}
308308
r2454r2455
316316INLINE UINT64 read64le_with_read8_device_handler(read8_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask)
317317{
318318   UINT64 result = 0;
319   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
319   if (ACCESSING_BITS_0_31)
320320      result |= (UINT64)read32le_with_read8_device_handler(handler, device, offset * 2 + 0, mem_mask >> 0) << 0;
321   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
321   if (ACCESSING_BITS_32_63)
322322      result |= (UINT64)read32le_with_read8_device_handler(handler, device, offset * 2 + 1, mem_mask >> 32) << 32;
323323   return result;
324324}
r2454r2455
326326
327327INLINE void write64le_with_write8_device_handler(write8_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask)
328328{
329   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
329   if (ACCESSING_BITS_0_31)
330330      write32le_with_write8_device_handler(handler, device, offset * 2 + 0, data >> 0, mem_mask >> 0);
331   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
331   if (ACCESSING_BITS_32_63)
332332      write32le_with_write8_device_handler(handler, device, offset * 2 + 1, data >> 32, mem_mask >> 32);
333333}
334334
r2454r2455
342342INLINE UINT32 read64be_with_16be_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask)
343343{
344344   UINT64 result = 0;
345   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
345   if (ACCESSING_BITS_32_63)
346346      result |= (UINT64)read32be_with_16be_device_handler(handler, device, offset * 2 + 0, mem_mask >> 32) << 32;
347   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
347   if (ACCESSING_BITS_0_31)
348348      result |= (UINT64)read32be_with_16be_device_handler(handler, device, offset * 2 + 1, mem_mask >> 0) << 0;
349349   return result;
350350}
r2454r2455
352352
353353INLINE void write64be_with_16be_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask)
354354{
355   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
355   if (ACCESSING_BITS_32_63)
356356      write32be_with_16be_device_handler(handler, device, offset * 2 + 0, data >> 32, mem_mask >> 32);
357   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
357   if (ACCESSING_BITS_0_31)
358358      write32be_with_16be_device_handler(handler, device, offset * 2 + 1, data >> 0, mem_mask >> 0);
359359}
360360
r2454r2455
368368INLINE UINT32 read64le_with_16le_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask)
369369{
370370   UINT64 result = 0;
371   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
371   if (ACCESSING_BITS_0_31)
372372      result |= (UINT64)read32le_with_16le_device_handler(handler, device, offset * 2 + 0, mem_mask >> 0) << 0;
373   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
373   if (ACCESSING_BITS_32_63)
374374      result |= (UINT64)read32le_with_16le_device_handler(handler, device, offset * 2 + 1, mem_mask >> 32) << 32;
375375   return result;
376376}
r2454r2455
378378
379379INLINE void write64le_with_16le_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask)
380380{
381   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
381   if (ACCESSING_BITS_0_31)
382382      write32le_with_16le_device_handler(handler, device, offset * 2 + 0, data >> 0, mem_mask >> 0);
383   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
383   if (ACCESSING_BITS_32_63)
384384      write32le_with_16le_device_handler(handler, device, offset * 2 + 1, data >> 32, mem_mask >> 32);
385385}
386386
r2454r2455
394394INLINE UINT32 read64be_with_16le_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask)
395395{
396396   UINT64 result = 0;
397   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
397   if (ACCESSING_BITS_32_63)
398398      result |= (UINT64)read32be_with_16le_device_handler(handler, device, offset * 2 + 0, mem_mask >> 32) << 32;
399   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
399   if (ACCESSING_BITS_0_31)
400400      result |= (UINT64)read32be_with_16le_device_handler(handler, device, offset * 2 + 1, mem_mask >> 0) << 0;
401401   return result;
402402}
r2454r2455
404404
405405INLINE void write64be_with_16le_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask)
406406{
407   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
407   if (ACCESSING_BITS_32_63)
408408      write32be_with_16le_device_handler(handler, device, offset * 2 + 0, data >> 32, mem_mask >> 32);
409   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
409   if (ACCESSING_BITS_0_31)
410410      write32be_with_16le_device_handler(handler, device, offset * 2 + 1, data >> 0, mem_mask >> 0);
411411}
412412
r2454r2455
420420INLINE UINT32 read64le_with_16be_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask)
421421{
422422   UINT64 result = 0;
423   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
423   if (ACCESSING_BITS_0_31)
424424      result |= (UINT64)read32le_with_16be_device_handler(handler, device, offset * 2 + 0, mem_mask >> 0) << 0;
425   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
425   if (ACCESSING_BITS_32_63)
426426      result |= (UINT64)read32le_with_16be_device_handler(handler, device, offset * 2 + 1, mem_mask >> 32) << 32;
427427   return result;
428428}
r2454r2455
430430
431431INLINE void write64le_with_16be_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask)
432432{
433   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
433   if (ACCESSING_BITS_0_31)
434434      write32le_with_16be_device_handler(handler, device, offset * 2 + 0, data >> 0, mem_mask >> 0);
435   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
435   if (ACCESSING_BITS_32_63)
436436      write32le_with_16be_device_handler(handler, device, offset * 2 + 1, data >> 32, mem_mask >> 32);
437437}
438438
r2454r2455
446446INLINE UINT64 read64be_with_32be_device_handler(read32_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask)
447447{
448448   UINT64 result = 0;
449   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
449   if (ACCESSING_BITS_32_63)
450450      result |= (UINT64)(*handler)(device, offset * 2 + 0, mem_mask >> 32) << 32;
451   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
451   if (ACCESSING_BITS_0_31)
452452      result |= (UINT64)(*handler)(device, offset * 2 + 1, mem_mask >> 0) << 0;
453453   return result;
454454}
r2454r2455
456456
457457INLINE void write64be_with_32be_device_handler(write32_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask)
458458{
459   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
459   if (ACCESSING_BITS_32_63)
460460      (*handler)(device, offset * 2 + 0, data >> 32, mem_mask >> 32);
461   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
461   if (ACCESSING_BITS_0_31)
462462      (*handler)(device, offset * 2 + 1, data >>  0, mem_mask >>  0);
463463}
464464
r2454r2455
472472INLINE UINT64 read64le_with_32le_device_handler(read32_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask)
473473{
474474   UINT64 result = 0;
475   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
475   if (ACCESSING_BITS_0_31)
476476      result |= (UINT64)(*handler)(device, offset * 2 + 0, mem_mask >> 0) << 0;
477   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
477   if (ACCESSING_BITS_32_63)
478478      result |= (UINT64)(*handler)(device, offset * 2 + 1, mem_mask >> 32) << 32;
479479   return result;
480480}
r2454r2455
482482
483483INLINE void write64le_with_32le_device_handler(write32_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask)
484484{
485   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
485   if (ACCESSING_BITS_0_31)
486486      (*handler)(device, offset * 2 + 0, data >> 0, mem_mask >> 0);
487   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
487   if (ACCESSING_BITS_32_63)
488488      (*handler)(device, offset * 2 + 1, data >> 32, mem_mask >> 32);
489489}
490490
src/emu/ui.c
r2454r2455
15471547   /* add per-channel volume */
15481548   numitems = sound_get_user_gain_count();
15491549   for (item = 0; item < numitems; item++)
1550      slider_config(&slider_list[slider_count++], 0, sound_get_default_gain(item) * 1000.0f + 0.5f, 2000, 20, slider_mixervol, item);
1550   {
1551      INT32 maxval = 2000;
1552      INT32 defval = sound_get_default_gain(item) * 1000.0f + 0.5f;
15511553
1554      if (defval > 1000)
1555         maxval = 2 * defval;
1556
1557      slider_config(&slider_list[slider_count++], 0, defval, maxval, 20, slider_mixervol, item);
1558   }
1559
15521560   /* add analog adjusters */
15531561   for (in = machine->input_ports; in && in->type != IPT_END; in++)
15541562      if ((in->type & 0xff) == IPT_ADJUSTER)
src/emu/sound.c
r2454r2455
661661   profiler_mark(PROFILER_SOUND);
662662
663663   /* force all the speaker streams to generate the proper number of samples */
664   for (curspeak = speaker_output_first(Machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak))
664   for (curspeak = speaker_output_first(machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak))
665665   {
666666      speaker_info *spk = curspeak->token;
667667      const stream_sample_t *stream_buf;
src/emu/emupal.c
r2454r2455
1010******************************************************************************/
1111
1212#include "driver.h"
13#include "deprecat.h"
1413
1514#define VERBOSE 0
1615
src/emu/validity.c
r2454r2455
228228   INT64 resulti64, expectedi64;
229229   UINT64 resultu64, expectedu64;
230230   INT32 remainder, expremainder;
231   UINT32 uremainder, expuremainder;
231   UINT32 uremainder, expuremainder, bigu32 = 0xffffffff;
232232   int error = FALSE;
233233
234234   /* use only non-zero, positive numbers */
r2454r2455
278278
279279   while ((INT64)testi32a * (INT64)0x7fffffff < testi64a)
280280      testi64a /= 2;
281   while ((UINT64)testu32a * (UINT64)0xffffffff < testu64a)
281   while ((UINT64)testu32a * (UINT64)bigu32 < testu64a)
282282      testu64a /= 2;
283283
284284   resulti32 = div_64x32(testi64a, testi32a);
src/emu/romload.c
r2454r2455
4848static open_chd **chd_list_tailptr;
4949
5050/* system BIOS */
51int system_bios;
51static int system_bios;
5252
5353static int total_rom_load_warnings;
5454
r2454r2455
190190   const char *specbios = options_get_string(mame_options(), OPTION_BIOS);
191191   const rom_entry *rom;
192192   int bios_count = 0;
193   int bios_no = 0;
193194
194   /* set to default */
195   int bios_no = 1;
196
197195   for (rom = romp;!ROMENTRY_ISEND(rom);rom++)
198196      if (ROMENTRY_ISSYSTEM_BIOS(rom))
199197      {
r2454r2455
208206         bios_count++;
209207      }
210208
211   if (bios_count == 0)
212      bios_no = 0;
209   if (bios_no == 0 && bios_count > 0)
210   {
211      if (specbios[0] != 0)
212         fatalerror("%s: no such bios\n", specbios);
213      /* set to default */
214      bios_no = 1;
215   }
213216
214217   debugload("Using System BIOS: %d\n", bios_no);
215218
src/lib/util/sha1.c
r2454r2455
292292      buffer += SHA1_DATA_SIZE;
293293      length -= SHA1_DATA_SIZE;
294294    }
295  if ((ctx->index = length))     /* This assignment is intended */
295  ctx->index = length;
296  if (length)
296297    /* Buffer leftovers */
297298    memcpy(ctx->block, buffer, length);
298299}
src/mess/drivers/cpschngr.c
r2454r2455
3131void slammast_decode(void) { }
3232#endif
3333
34void forogttn_dummy_function(running_machine *machine)
35{
36   /* Forgotten Worlds has extra inputs on the B-board CN-MOWS connector for the dial controls. */
37   memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x800040, 0x800041, 0, 0, forgottn_dial_0_reset_w);
38   memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x800048, 0x800049, 0, 0, forgottn_dial_1_reset_w);
39   memory_install_read16_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x800052, 0x800055, 0, 0, forgottn_dial_0_r);
40   memory_install_read16_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x80005a, 0x80005d, 0, 0, forgottn_dial_1_r);
41}
42
3443/***************************************************************************
3544
3645  Game driver(s)
3746
3847***************************************************************************/
3948
40#define CODE_SIZE 0x200000
49#define CODE_SIZE 0x400000
4150
4251static INPUT_PORTS_START( sfzch )
4352   PORT_START_TAG("IN0")     /* IN0 */
src/mess/drivers/coco.c
r2454r2455
618618/* AY-8912 for Dragon Alpha, the AY-8912 simply an AY-8910 with only one io port. */
619619static const struct AY8910interface ay8912_interface =
620620{
621   AY8910_LEGACY_OUTPUT,
622   AY8910_DEFAULT_LOADS,
621623   dgnalpha_psg_porta_read,   /* portA read */
622624   NULL,                   /* portB read */
623625   dgnalpha_psg_porta_write,   /* portA write */
src/mess/drivers/msx.c
r2454r2455
704704
705705static const struct AY8910interface ay8910_interface =
706706{
707   AY8910_LEGACY_OUTPUT,
708   AY8910_DEFAULT_LOADS,
707709   msx_psg_port_a_r,
708710   msx_psg_port_b_r,
709711   msx_psg_port_a_w,
src/mess/drivers/vectrex.c
r2454r2455
8484
8585static const struct AY8910interface ay8910_interface =
8686{
87   AY8910_LEGACY_OUTPUT,
88   AY8910_DEFAULT_LOADS,
8789   input_port_4_r,
8890   0,
8991   vectrex_psg_port_w,
src/mess/drivers/cgenie.c
r2454r2455
369369
370370static const struct AY8910interface ay8910_interface =
371371{
372   AY8910_LEGACY_OUTPUT,
373   AY8910_DEFAULT_LOADS,
372374   cgenie_psg_port_a_r,
373375   cgenie_psg_port_b_r,
374376   cgenie_psg_port_a_w,
src/mess/drivers/spectrum.c
r2454r2455
161161
162162static const struct AY8910interface spectrum_ay_interface =
163163{
164   AY8910_LEGACY_OUTPUT,
165   AY8910_DEFAULT_LOADS,
164166   NULL
165167};
166168
src/mess/drivers/atarist.c
r2454r2455
12951295
12961296static const struct AY8910interface ym2149_interface =
12971297{
1298   AY8910_LEGACY_OUTPUT,
1299   AY8910_DEFAULT_LOADS,
12981300   0,
12991301   0,
13001302   ym2149_port_a_w,
r2454r2455
16331635
16341636static const struct AY8910interface stbook_ym2149_interface =
16351637{
1638   AY8910_LEGACY_OUTPUT,
1639   AY8910_DEFAULT_LOADS,
16361640   0,
16371641   0,
16381642   stbook_ym2149_port_a_w,
src/mess/drivers/pc8801.c
r2454r2455
492492
493493static const struct YM2203interface ym2203_interface =
494494{
495   opn_dummy_input,
496   opn_dummy_input,
497   0,
498   0,
495   {
496      AY8910_LEGACY_OUTPUT,
497      AY8910_DEFAULT_LOADS,
498      opn_dummy_input,
499      opn_dummy_input,
500      0,
501      0
502   },
499503   pc88sr_sound_interupt
500504};
501505
src/mess/drivers/oric.c
r2454r2455
432432
433433static const struct AY8910interface oric_ay_interface =
434434{
435   AY8910_LEGACY_OUTPUT,
436   AY8910_DEFAULT_LOADS,
435437   0,
436438   0,
437439   oric_psg_porta_write,
src/mess/drivers/orion.c
r2454r2455
308308
309309static const struct AY8910interface orionz80_ay_interface =
310310{
311   AY8910_LEGACY_OUTPUT,
312   AY8910_DEFAULT_LOADS,
311313   NULL
312314};
313315
src/mess/drivers/microtan.c
r2454r2455
203203
204204static const struct AY8910interface ay8910_interface =
205205{
206   AY8910_LEGACY_OUTPUT,
207   AY8910_DEFAULT_LOADS,
206208   0,
207209   0,
208210   0,
src/mess/drivers/einstein.c
r2454r2455
16101610
16111611static const struct AY8910interface einstein_ay_interface =
16121612{
1613   AY8910_LEGACY_OUTPUT,
1614   AY8910_DEFAULT_LOADS,
16131615   NULL,
16141616   einstein_port_b_read,
16151617   einstein_port_a_write,
src/mess/drivers/intv.c
r2454r2455
9090
9191static const struct AY8910interface ay8910_interface =
9292{
93   AY8910_LEGACY_OUTPUT,
94   AY8910_DEFAULT_LOADS,
9395   intv_right_control_r,
9496   intv_left_control_r,
9597   0,
src/mess/drivers/amstrad.c
r2454r2455
28552855   --------------------*/
28562856static const struct AY8910interface ay8912_interface =
28572857{
2858   AY8910_LEGACY_OUTPUT,
2859   AY8910_DEFAULT_LOADS,
28582860   amstrad_psg_porta_read,   /* portA read */
28592861   amstrad_psg_porta_read,   /* portB read */
28602862   NULL,               /* portA write */
src/mess/drivers/apple2.c
r2454r2455
535535
536536static const struct AY8910interface ay8910_interface =
537537{
538   AY8910_LEGACY_OUTPUT,
539   AY8910_DEFAULT_LOADS,
538540   NULL
539541};
540542
src/mess/drivers/svi318.c
r2454r2455
289289
290290static const struct AY8910interface ay8910_interface =
291291{
292   AY8910_LEGACY_OUTPUT,
293   AY8910_DEFAULT_LOADS,
292294   svi318_psg_port_a_r,
293295   NULL,
294296   NULL,
docs/messnew.txt
r2454r2455
8181
8282Source Changes:
8383----------------
84- The core is based on MAME 0.124u3.  This incorporates all features of the
84- The core is based on MAME 0.124u4.  This incorporates all features of the
8585  update to this core.  [MAME team]
8686
8787- Major changes to transition MESS's device system onto MAME's device system.

Previous 15994 Revisions Next


© 1998-2018 The MESS Team