Previous 15994 Revisions Next

r2242 Friday 4th April, 2008 at 00:51:02 UTC by Nathan Woods
Updated to MAME 0.124u1 core
[ROOT]makefile
[docs]messnew.txt
[src/emu]debugger.h devconv.h emupal.c emupal.h inptport.c inptport.h input.c input.h mame.c memconv.h memory.c memory.h sound.c tilemap.c tilemap.h uigfx.c video.c
[src/emu/cpu/cop400]410ops.c 420ops.c cop400.h cop410.c cop410ds.c cop420.c cop420ds.c
[src/emu/cpu/mips]mips3com.c
[src/emu/debug]debugcon.c debugcpu.c debugcpu.h
[src/emu/drivers]xtal.h
[src/emu/machine]6821pia.c 6840ptm.c 6850acia.c 6850acia.h at28c16.c ds2401.c generic.c idectrl.c msm6242.c scsicd.c smc91c9x.c timekpr.c tmp68301.c
[src/emu/sound]2151intf.c 2203intf.c 2413intf.c 2610intf.c aicadsp.c ay8910.c disc_dev.c disc_flt.c disc_inp.c disc_mth.c disc_wav.c discrete.c discrete.h es5506.c es8712.c iremga20.c k053260.c okim6295.c psx.c saa1099.c scspdsp.c ymz280b.c
[src/emu/video]cdp1869.c tlc34076.c voodoo.c
[src/mame]mame.mak mamedriv.c tiny.mak
[src/mame/audio]atarijsa.c aztarac.c cchasm.c cyberbal.c dcs.c galaxian.c gottlieb.c jaguar.c leland.c m72.c mcr.c mw8080bw.c scramble.c seibu.c seibu.h sprint4.c taitosnd.c turbo.c tx1.c
[src/mame/drivers]20pacgal.c acommand.c aerofgt.c alpha68k.c arcadecl.c armedf.c ashnojoe.c asterix.c astrocorp.c* atarig1.c atarig42.c atarigt.c atarigx2.c atarisy2.c backfire.c badlands.c beathead.c bfcobra.c bigfghtr.c bishi.c bishjan.c blmbycar.c blockout.c bloodbro.c blueprnt.c btoads.c cave.c cidelsa.c cinemat.c circusc.c cischeat.c coolpool.c cps1.c cps2.c cps3.c crospang.c crshrace.c cubocd32.c cybertnk.c dambustr.c darkhors.c dcheese.c dcon.c ddenlovr.c ddragon.c deadang.c dec0.c deco156.c deco32.c deniam.c dgpix.c diverboy.c djmain.c dkong.c dreamwld.c drgnmst.c dynduke.c eprom.c equites.c ertictac.c esd16.c esh.c expro02.c exterm.c f1gp.c fantland.c filetto.c firebeat.c flkatck.c foodf.c fromanc2.c fuukifg2.c fuukifg3.c gaelco.c gaelco3d.c gaiden.c galaxian.c galaxold.c* galdrvr.c* galpani2.c galpanic.c galspnbl.c gamecstl.c gameplan.c gauntlet.c genesis.c ghosteo.c gijoe.c glass.c goal92.c goodejan.c gotcha.c gradius3.c grchamp.c groundfx.c gstream.c gstriker.c gticlub.c guab.c* gunbustr.c hornet.c hyprduel.c igs_blit.c inufuku.c ironhors.c itech32.c itech8.c jalmah.c jpmimpct.c kaneko16.c kickgoal.c klax.c konamigq.c konamigx.c konamim2.c ksys573.c lastduel.c lastfght.c legionna.c limenko.c lockon.c looping.c lordgun.c m10.c m107.c m62.c m72.c m90.c m92.c macrossp.c madmotor.c magmax.c mastboy.c mcatadv.c mcr68.c mediagx.c megadriv.c megaplay.c megasys1.c meijinsn.c mermaid.c metro.c midas.c midvunit.c model1.c model2.c model3.c mogura.c mpu4.c mpu4drvr.c mquake.c multigam.c mystwarr.c namcofl.c namcona1.c namcos11.c namcos12.c namcos2.c namcos21.c namcos22.c namcos23.c naomi.c nbmj9195.c nemesis.c neodrvr.c neogeo.c nmg5.c nmk16.c nwk-tr.c offtwall.c ohmygod.c oneshot.c othldrby.c othunder.c overdriv.c pgm.c pirates.c playmark.c plygonet.c pntnpuzl.c policetr.c powerbal.c powerins.c psikyo.c psikyo4.c psikyosh.c puckpkmn.c pushman.c qdrmfgp.c quantum.c raiden.c raiden2.c rainbow.c rampart.c rbmk.c relief.c rpunch.c rungun.c sandscrp.c scobra.c scramble.c seattle.c segac2.c segahang.c segaorun.c segas16a.c segas16b.c segas18.c segas24.c segas32.c segaxbd.c segaybd.c seibuspi.c sengokmj.c seta.c seta2.c sf.c shadfrce.c shangha3.c shanghai.c shuuz.c silkroad.c snk68.c snowbros.c spbactn.c splash.c srmp2.c sslam.c ssv.c stactics.c stlforce.c stv.c suna16.c superchs.c suprnova.c suprslam.c system16.c system18.c tail2nos.c taito_b.c taito_f2.c taito_f3.c taito_z.c taitoair.c taitojc.c taitowlf.c taotaido.c targeth.c tceptor.c tecmo.c tecmo16.c tecmosys.c terracre.c tetrisp2.c thoop2.c thunderj.c tigeroad.c tmaster.c tmnt.c toaplan2.c toki.c toypop.c trvmadns.c trvquest.c tsamurai.c ttchamp.c tumbleb.c turbo.c tx1.c ultraman.c ultrsprt.c undrfire.c unico.c vegas.c vertigo.c videopin.c vigilant.c viper.c volfied.c vulgus.c wecleman.c welltris.c wgp.c wiping.c witch.c wiz.c wolfpack.c wrally.c wwfsstar.c wwfwfest.c xexex.c xmen.c xtheball.c xxmissio.c xyonix.c yumefuda.c yunsun16.c zac2650.c zaccaria.c zaxxon.c zerozone.c zr107.c
[src/mame/includes]cclimber.h cidelsa.h* galaxian.h galaxold.h* tx1.h vertigo.h
[src/mame/layout]armora.lay*
[src/mame/machine]amiga.c atarigen.c bublbobl.c cclimber.c cubocd32.c dc.c galaxold.c* harddriv.c konamigx.c konamiic.c konppc.c mcr.c mexico86.c midtunit.c midwayic.c midwunit.c midyunit.c namcoio.c namcos2.c nmk004.c nmk112.c pcshare.c pcshare.h pgmprot.c psx.c scramble.c segaic16.c segas24.c tatsumi.c tnzs.c toaplan1.c twincobr.c tx1.c vertigo.c wrally.c
[src/mame/video]aerofgt.c alpha68k.c armedf.c badlands.c bionicc.c btoads.c cabal.c cchasm.c cidelsa.c* cischeat.c cps1.c crshrace.c dcon.c deadang.c dooyong.c dynduke.c equites.c f1gp.c fastfred.c gaiden.c galaxian.c galaxold.c* gberet.c genesis.c goal92.c gotcha.c gticlub.c itech32.c kan_pand.c kaneko16.c konamigx.c konamiic.c lastduel.c legionna.c m107.c m62.c m72.c m92.c mappy.c mcr68.c mermaid.c midtunit.c midyunit.c model3.c ms32.c mystwarr.c namcona1.c namcos2.c nemesis.c niyanpai.c nmk16.c nova2001.c ohmygod.c policetr.c powerins.c psikyo.c quizpani.c raiden.c realbrk.c rpunch.c segaic16.c segas32.c seibuspi.c seta.c sf.c shangha3.c snk68.c spbactn.c stvvdp1.c suna16.c tail2nos.c taito_b.c taito_z.c taitoic.c taotaido.c tatsumi.c tecmo16.c terracre.c tetrisp2.c tigeroad.c tmnt.c toaplan1.c toaplan2.c toobin.c toypop.c ultraman.c undrfire.c wecleman.c welltris.c wwfwfest.c
[src/mess]mess.mak
[src/mess/drivers]atarist.c compis.c x68k.c
[src/mess/includes]mz700.h special.h
[src/mess/machine]99_hsgpl.c amigacrt.c concept.c cybiko.c genesis.c hd63450.c lisa.c mac.c ti99_4x.c
[src/mess/video]atarist.c x68k.c
[src/osd/windows]ledutil.c winwork.c

src/mame/audio/cchasm.c
r2241r2242
8888{
8989    static int led;
9090
91   if (ACCESSING_MSB)
91   if (ACCESSING_BITS_8_15)
9292   {
9393      data >>= 8;
9494      switch (offset & 0xf)
src/mame/audio/jaguar.c
r2241r2242
367367
368368   /* if they were clearing the A2S interrupt, see if we are headed for the spin */
369369   /* loop with R22 != 0; if we are, just start spinning again */
370   if (cpu_getactivecpu() == 2 && !(mem_mask & 0x0000ff00) && (data & 0x400))
370   if (cpu_getactivecpu() == 2 && ACCESSING_BITS_8_15 && (data & 0x400))
371371   {
372372      /* see if we're going back to the spin loop */
373373      if (!(data & 0x04000) && activecpu_get_reg(JAGUAR_R22) != 0)
src/mame/audio/cyberbal.c
r2241r2242
146146
147147WRITE16_HANDLER( cyberbal_sound_68k_w )
148148{
149   if (ACCESSING_MSB)
149   if (ACCESSING_BITS_8_15)
150150   {
151151      sound_data_from_68k = (data >> 8) & 0xff;
152152      sound_data_from_68k_ready = 1;
src/mame/audio/galaxian.c
r2241r2242
22#include "streams.h"
33#include "deprecat.h"
44#include "sound/samples.h"
5#include "includes/galaxian.h"
5#include "includes/galaxold.h"
66
77#define VERBOSE 0
88
r2241r2242
105105   }
106106}
107107
108WRITE8_HANDLER( galaxian_sound_w )
109{
110   data &= 0x01;
111   switch (offset & 7)
112   {
113      case 0:      /* FS1 (controls 555 timer at 8R) */
114      case 1:      /* FS2 (controls 555 timer at 8S) */
115      case 2:      /* FS3 (controls 555 timer at 8T) */
116         galaxian_background_enable_w(machine, offset, data);
117         break;
118
119      case 3:      /* HIT */
120         galaxian_noise_enable_w(machine, 0, data);
121         break;
122
123      case 4:      /* n/c */
124         break;
125
126      case 5:      /* FIRE */
127         galaxian_shoot_enable_w(machine, 0, data);
128         break;
129
130      case 6:      /* VOL1 */
131      case 7:      /* VOL2 */
132         galaxian_vol_w(machine, offset & 1, data);
133         break;
134   }
135}
136
137
108138WRITE8_HANDLER( galaxian_pitch_w )
109139{
110140   stream_update(tone_stream);
r2241r2242
528558   NULL,
529559   galaxian_sh_start
530560};
561
562const struct Samplesinterface galaxian_custom_interface =
563{
564   5,
565   NULL,
566   galaxian_sh_start
567};
src/mame/audio/turbo.c
r2241r2242
55*************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
98#include "turbo.h"
109#include "sound/samples.h"
1110
r2241r2242
7271
7372WRITE8_HANDLER( turbo_sound_a_w )
7473{
75   turbo_state *state = Machine->driver_data;
74   turbo_state *state = machine->driver_data;
7675   UINT8 diff = data ^ state->sound_state[0];
7776   state->sound_state[0] = data;
7877
r2241r2242
120119
121120WRITE8_HANDLER( turbo_sound_b_w )
122121{
123   turbo_state *state = Machine->driver_data;
122   turbo_state *state = machine->driver_data;
124123   UINT8 diff = data ^ state->sound_state[1];
125124   state->sound_state[1] = data;
126125
r2241r2242
142141
143142WRITE8_HANDLER( turbo_sound_c_w )
144143{
145   turbo_state *state = Machine->driver_data;
144   turbo_state *state = machine->driver_data;
146145
147146   /* OSEL1-2 */
148147   state->turbo_osel = (state->turbo_osel & 1) | ((data & 3) << 1);
r2241r2242
292291
293292WRITE8_HANDLER( subroc3d_sound_a_w )
294293{
295   turbo_state *state = Machine->driver_data;
294   turbo_state *state = machine->driver_data;
296295   state->sound_state[0] = data;
297296
298297   /* DIS0-3 contained in bits 0-3 */
r2241r2242
322321
323322WRITE8_HANDLER( subroc3d_sound_b_w )
324323{
325   turbo_state *state = Machine->driver_data;
324   turbo_state *state = machine->driver_data;
326325   UINT8 diff = data ^ state->sound_state[1];
327326   state->sound_state[1] = data;
328327
r2241r2242
377376
378377WRITE8_HANDLER( subroc3d_sound_c_w )
379378{
380   turbo_state *state = Machine->driver_data;
379   turbo_state *state = machine->driver_data;
381380   UINT8 diff = data ^ state->sound_state[2];
382381   state->sound_state[2] = data;
383382
r2241r2242
501500
502501WRITE8_HANDLER( buckrog_sound_a_w )
503502{
504   turbo_state *state = Machine->driver_data;
503   turbo_state *state = machine->driver_data;
505504   UINT8 diff = data ^ state->sound_state[0];
506505   state->sound_state[0] = data;
507506
r2241r2242
526525
527526WRITE8_HANDLER( buckrog_sound_b_w )
528527{
529   turbo_state *state = Machine->driver_data;
528   turbo_state *state = machine->driver_data;
530529   UINT8 diff = data ^ state->sound_state[1];
531530   state->sound_state[1] = data;
532531
src/mame/audio/atarijsa.c
r2241r2242
3131****************************************************************************/
3232
3333#include "driver.h"
34#include "deprecat.h"
3534#include "cpu/m6502/m6502.h"
3635#include "sound/5220intf.h"
3736#include "sound/2151intf.h"
r2241r2242
123122   has_tms5220 = has_oki6295 = has_pokey = has_ym2151 = 0;
124123   for (i = 0; i < MAX_SOUND; i++)
125124   {
126      switch (Machine->config->sound[i].type)
125      switch (machine->config->sound[i].type)
127126      {
128127         case SOUND_TMS5220:
129128            has_tms5220 = 1;
src/mame/audio/tx1.c
r2241r2242
4343} pit8253;
4444
4545
46WRITE8_HANDLER( pit8253_w )
46WRITE8_HANDLER( tx1_pit8253_w )
4747{
4848   stream_update(stream);
4949
r2241r2242
7575   }
7676}
7777
78READ8_HANDLER( pit8253_r )
78READ8_HANDLER( tx1_pit8253_r )
7979{
8080   mame_printf_debug("PIT R: %x", offset);
8181   return 0;
src/mame/audio/mcr.c
r2241r2242
549549   /* My guess is that Turbo Tag works through a fluke, whereby the 68000 */
550550   /* using the MOVEP instruction outputs the same value on the high and */
551551   /* low bytes. */
552   if (ACCESSING_MSB)
552   if (ACCESSING_BITS_8_15)
553553      return pia_0_alt_r(machine, offset) << 8;
554554   else
555555      return pia_0_alt_r(machine, offset);
r2241r2242
557557
558558static WRITE16_HANDLER( csdeluxe_pia_w )
559559{
560   if (ACCESSING_MSB)
560   if (ACCESSING_BITS_8_15)
561561      pia_0_alt_w(machine, offset, data >> 8);
562562   else
563563      pia_0_alt_w(machine, offset, data);
src/mame/audio/aztarac.c
r2241r2242
1818
1919WRITE16_HANDLER( aztarac_sound_w )
2020{
21   if (ACCESSING_LSB)
21   if (ACCESSING_BITS_0_7)
2222   {
2323      data &= 0xff;
2424      soundlatch_w(machine, offset, data);
src/mame/audio/taitosnd.c
r2241r2242
265265
266266WRITE16_HANDLER( taitosound_port16_lsb_w )
267267{
268   if (ACCESSING_LSB)
268   if (ACCESSING_BITS_0_7)
269269      taitosound_port_w(machine,0,data & 0xff);
270270}
271271WRITE16_HANDLER( taitosound_comm16_lsb_w )
272272{
273   if (ACCESSING_LSB)
273   if (ACCESSING_BITS_0_7)
274274      taitosound_comm_w(machine,0,data & 0xff);
275275}
276276READ16_HANDLER( taitosound_comm16_lsb_r )
r2241r2242
281281
282282WRITE16_HANDLER( taitosound_port16_msb_w )
283283{
284   if (ACCESSING_MSB)
284   if (ACCESSING_BITS_8_15)
285285      taitosound_port_w(machine,0,data >> 8);
286286}
287287WRITE16_HANDLER( taitosound_comm16_msb_w )
288288{
289   if (ACCESSING_MSB)
289   if (ACCESSING_BITS_8_15)
290290      taitosound_comm_w(machine,0,data >> 8);
291291}
292292READ16_HANDLER( taitosound_comm16_msb_r )
src/mame/audio/leland.c
r2241r2242
11631163      case 0x60/2:
11641164         if (LOG_PORTS) logerror("%05X:read 80186 Timer %d count\n", activecpu_get_pc(), (offset - 0x50/2) / 4);
11651165         which = (offset - 0x50/2) / 4;
1166         if (ACCESSING_LSB)
1166         if (ACCESSING_BITS_0_7)
11671167            internal_timer_sync(which);
11681168         return i80186.timer[which].count;
11691169
r2241r2242
12691269   int temp, which;
12701270
12711271   /* handle partials */
1272   if (!ACCESSING_MSB)
1272   if (!ACCESSING_BITS_8_15)
12731273      data = (i80186_internal_port_r(machine, offset, 0) & 0xff00) | (data & 0x00ff);
1274   else if (!ACCESSING_LSB)
1274   else if (!ACCESSING_BITS_0_7)
12751275      data = (i80186_internal_port_r(machine, offset, 0) & 0x00ff) | (data & 0xff00);
12761276
12771277   switch (offset)
r2241r2242
15761576   int reg = offset & 3;
15771577
15781578   /* ignore odd offsets */
1579   if (!ACCESSING_LSB)
1579   if (!ACCESSING_BITS_0_7)
15801580      return;
15811581   data &= 0xff;
15821582
r2241r2242
18251825   struct dac_state *d = &dac[which];
18261826
18271827   /* handle value changes */
1828   if (ACCESSING_LSB)
1828   if (ACCESSING_BITS_0_7)
18291829   {
18301830      int count = (d->bufin - d->bufout) & DAC_BUFFER_SIZE_MASK;
18311831
r2241r2242
18511851   }
18521852
18531853   /* handle volume changes */
1854   if (ACCESSING_MSB)
1854   if (ACCESSING_BITS_8_15)
18551855   {
18561856      d->volume = ((data >> 8) ^ 0x00) / DAC_VOLUME_SCALE;
18571857      if (LOG_DAC) logerror("%05X:DAC %d volume = %02X\n", activecpu_get_pc(), offset, data);
r2241r2242
18971897   int data16;
18981898
18991899   /* warning: this assumes all port writes here are word-sized */
1900   assert(ACCESSING_LSB && ACCESSING_MSB);
1900   assert(ACCESSING_BITS_0_7 && ACCESSING_BITS_8_15);
19011901   data16 = data;
19021902
19031903   /* set the new value */
r2241r2242
19301930      case 0x00:
19311931      case 0x01:
19321932      case 0x02:
1933         if (ACCESSING_LSB)
1933         if (ACCESSING_BITS_0_7)
19341934            dac_w(machine, offset, data, 0xff00);
19351935         return;
19361936
src/mame/audio/sprint4.c
r2241r2242
157157/* used to offset the motor nodes based on the player so the nodes do not overlap */
158158/* _plr must be 1, 2, 3, or 4 */
159159/* so it uses NODES_30 to NODE_69 */
160#define SPRINT4_PLAYER_MOTOR_NODE(_node, _plr)      NODE_20 + 10 * _plr + _node
160#define SPRINT4_PLAYER_MOTOR_NODE(_node, _plr)      NODE(20 + 10 * _plr + _node)
161161
162162
163163/************************************************
src/mame/audio/m72.c
r2241r2242
123123
124124WRITE16_HANDLER( m72_sound_command_w )
125125{
126   if (ACCESSING_LSB)
126   if (ACCESSING_BITS_0_7)
127127   {
128128      soundlatch_w(machine,offset,data);
129129      timer_call_after_resynch(NULL, Z80_ASSERT,setvector_callback);
src/mame/audio/seibu.c
r2241r2242
434434WRITE16_HANDLER( seibu_main_word_w )
435435{
436436   //logerror("%06x: seibu_main_word_w(%x,%02x)\n",activecpu_get_pc(),offset,data);
437   if (ACCESSING_LSB)
437   if (ACCESSING_BITS_0_7)
438438   {
439439      switch (offset)
440440      {
r2241r2242
514514   AM_RANGE(0x4009, 0x4009) AM_WRITE(YM3812_write_port_0_w)
515515   AM_RANGE(0x4010, 0x4011) AM_READ(seibu_soundlatch_r)
516516   AM_RANGE(0x4012, 0x4012) AM_READ(seibu_main_data_pending_r)
517   AM_RANGE(0x4013, 0x4013) AM_READ(input_port_0_r)
517   AM_RANGE(0x4013, 0x4013) AM_READ_PORT("COIN")
518518   AM_RANGE(0x4018, 0x4019) AM_WRITE(seibu_main_data_w)
519519   AM_RANGE(0x401b, 0x401b) AM_WRITE(seibu_coin_w)
520520   AM_RANGE(0x6000, 0x6000) AM_READWRITE(OKIM6295_status_0_r, OKIM6295_data_0_w)
r2241r2242
534534   AM_RANGE(0x4009, 0x4009) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w)
535535   AM_RANGE(0x4010, 0x4011) AM_READ(seibu_soundlatch_r)
536536   AM_RANGE(0x4012, 0x4012) AM_READ(seibu_main_data_pending_r)
537   AM_RANGE(0x4013, 0x4013) AM_READ(input_port_0_r)
537   AM_RANGE(0x4013, 0x4013) AM_READ_PORT("COIN")
538538   AM_RANGE(0x4018, 0x4019) AM_WRITE(seibu_main_data_w)
539539   AM_RANGE(0x401b, 0x401b) AM_WRITE(seibu_coin_w)
540540   AM_RANGE(0x6000, 0x6000) AM_READWRITE(OKIM6295_status_0_r, OKIM6295_data_0_w)
r2241r2242
555555   AM_RANGE(0x4009, 0x4009) AM_READWRITE(YM2203_read_port_0_r, YM2203_write_port_0_w)
556556   AM_RANGE(0x4010, 0x4011) AM_READ(seibu_soundlatch_r)
557557   AM_RANGE(0x4012, 0x4012) AM_READ(seibu_main_data_pending_r)
558   AM_RANGE(0x4013, 0x4013) AM_READ(input_port_0_r)
558   AM_RANGE(0x4013, 0x4013) AM_READ_PORT("COIN")
559559   AM_RANGE(0x4018, 0x4019) AM_WRITE(seibu_main_data_w)
560560   AM_RANGE(0x401b, 0x401b) AM_WRITE(seibu_coin_w)
561561   AM_RANGE(0x6008, 0x6008) AM_READWRITE(YM2203_status_port_1_r, YM2203_control_port_1_w)
r2241r2242
576576   AM_RANGE(0x4009, 0x4009) AM_READWRITE(YM2203_read_port_0_r, YM2203_write_port_0_w)
577577   AM_RANGE(0x4010, 0x4011) AM_READ(seibu_soundlatch_r)
578578   AM_RANGE(0x4012, 0x4012) AM_READ(seibu_main_data_pending_r)
579   AM_RANGE(0x4013, 0x4013) AM_READ(input_port_0_r)
579   AM_RANGE(0x4013, 0x4013) AM_READ_PORT("COIN")
580580   AM_RANGE(0x4018, 0x4019) AM_WRITE(seibu_main_data_w)
581581   AM_RANGE(0x401a, 0x401a) AM_WRITE(seibu_adpcm_ctl_1_w)
582582   AM_RANGE(0x401b, 0x401b) AM_WRITE(seibu_coin_w)
src/mame/audio/seibu.h
r2241r2242
7070/**************************************************************************/
7171
7272#define SEIBU_COIN_INPUTS                                 \
73   PORT_START                                          \
74   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(4)         \
73   PORT_START_TAG("COIN")                                 \
74   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(4)      \
7575   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(4)
7676
7777
src/mame/audio/scramble.c
r2241r2242
1919#include "sound/5110intf.h"
2020#include "sound/tms5110.h"
2121#include "sound/ay8910.h"
22#include "includes/galaxian.h"
22#include "includes/galaxold.h"
2323
2424#define AD2083_TMS5110_CLOCK       XTAL_640kHz
2525
src/mame/audio/gottlieb.c
r2241r2242
3535   {
3636      if (sndti_exists(SOUND_SAMPLES, 0))
3737      {
38         if (!strcmp(Machine->gamedrv->name,"reactor"))   /* reactor */
38         if (!strcmp(machine->gamedrv->name,"reactor"))   /* reactor */
3939         {
4040            switch (data ^ 0x3f)
4141            {
r2241r2242
297297
298298WRITE8_HANDLER( gottlieb_cause_dac_nmi_w )
299299{
300   cpunum_set_input_line(Machine, cpu_gettotalcpu()-2, INPUT_LINE_NMI, PULSE_LINE);
300   cpunum_set_input_line(machine, cpu_gettotalcpu()-2, INPUT_LINE_NMI, PULSE_LINE);
301301}
src/mame/audio/dcs.c
r2241r2242
14111411{
14121412   UINT32 pc = activecpu_get_pc();
14131413   cpuintrf_push_context(dcs.cpunum);
1414   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
1414   if (ACCESSING_BITS_0_15)
14151415   {
14161416      if (LOG_DCS_TRANSFERS)
14171417         logerror("%08X:IDMA_data_w(%04X) = %04X\n", pc, adsp2181_idma_addr_r(), data & 0xffff);
14181418      adsp2181_idma_data_w(data & 0xffff);
14191419   }
1420   if ((mem_mask & 0xffff0000) != 0xffff0000)
1420   if (ACCESSING_BITS_16_31)
14211421   {
14221422      if (LOG_DCS_TRANSFERS)
14231423         logerror("%08X:IDMA_data_w(%04X) = %04X\n", pc, adsp2181_idma_addr_r(), data >> 16);
src/mame/audio/mw8080bw.c
r2241r2242
33953395
33963396
33973397/* sound board 1 or 2, for multi-board games */
3398#define INVADERS_NODE(_node, _board)   (NODE_START + _node + ((_board - 1) * 100))
3398#define INVADERS_NODE(_node, _board)   (NODE(_node + ((_board - 1) * 100)))
33993399
34003400/************************************************
34013401 * Noise Generator
src/mame/machine/cubocd32.c
r2241r2242
852852         break;
853853
854854      case 0x18/4:   /* CDROM COMMAND 1 */
855         if ( ( mem_mask & 0x00ff0000 ) == 0 )
855         if ( ACCESSING_BITS_16_23 )
856856            akiko.cdrom_cmd_start = ( data >> 16 ) & 0xff;
857857
858         if ( ( mem_mask & 0x0000ff00 ) == 0 )
858         if ( ACCESSING_BITS_8_15 )
859859            akiko.cdrom_cmd_resp = ( data >> 8 ) & 0xff;
860860
861861         akiko_update_cdrom();
862862         break;
863863
864864      case 0x1C/4:   /* CDROM COMMAND 2 */
865         if ( ( mem_mask & 0x00ff0000 ) == 0 )
865         if ( ACCESSING_BITS_16_23 )
866866            akiko.cdrom_cmd_end = ( data >> 16 ) & 0xff;
867867
868868         akiko_update_cdrom();
r2241r2242
872872#if LOG_AKIKO_CD
873873         logerror( "Read Req mask W: data %08x - mem mask %08x\n", data, mem_mask );
874874#endif
875         if ( ( mem_mask & 0xffff0000 ) == 0 )
875         if ( ACCESSING_BITS_16_31 )
876876         {
877877            akiko.cdrom_readreqmask = (data >> 16);
878878            akiko.cdrom_readmask = 0;
src/mame/machine/nmk004.c
r2241r2242
10571057
10581058WRITE16_HANDLER( NMK004_w )
10591059{
1060   if (ACCESSING_LSB)
1060   if (ACCESSING_BITS_0_7)
10611061   {
10621062logerror("%06x: NMK004_w %02x\n",activecpu_get_pc(),data);
10631063      NMK004_state.from_main = data & 0xff;
src/mame/machine/bublbobl.c
r2241r2242
2727   /* bit 3 n.c. */
2828
2929   /* bit 4 resets second Z80 */
30   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
30   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
3131
3232   /* bit 5 resets mcu */
33   if (Machine->config->cpu[3].type != CPU_DUMMY)   // only if we have a MCU
34      cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE);
33   if (machine->config->cpu[3].type != CPU_DUMMY)   // only if we have a MCU
34      cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE);
3535
3636   /* bit 6 enables display */
3737   bublbobl_video_enable = data & 0x40;
r2241r2242
6060
6161WRITE8_HANDLER( bublbobl_nmitrigger_w )
6262{
63   cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE);
63   cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
6464}
6565
6666
r2241r2242
119119   sound_nmi_enable = 1;
120120   if (pending_nmi)
121121   {
122      cpunum_set_input_line(Machine, 2,INPUT_LINE_NMI,PULSE_LINE);
122      cpunum_set_input_line(machine, 2,INPUT_LINE_NMI,PULSE_LINE);
123123      pending_nmi = 0;
124124   }
125125}
r2241r2242
200200   {
201201//      logerror("triggering IRQ on main CPU\n");
202202      cpunum_set_input_line_vector(0,0,bublbobl_mcu_sharedram[0]);
203      cpunum_set_input_line(Machine, 0,0,HOLD_LINE);
203      cpunum_set_input_line(machine, 0,0,HOLD_LINE);
204204   }
205205
206206   // bit 7: select read or write shared RAM
r2241r2242
295295   if (offset == 0)
296296      return ic43_a << 4;
297297   else
298      return mame_rand(Machine) & 0xff;
298      return mame_rand(machine) & 0xff;
299299}
300300
301301WRITE8_HANDLER( boblbobl_ic43_a_w )
r2241r2242
475475   if ((ddrB & 0x20) && (~data & 0x20) && (portB_out & 0x20))
476476   {
477477      /* hack to get random EXTEND letters (who is supposed to do this? 68705? PAL?) */
478      bublbobl_mcu_sharedram[0x7c] = mame_rand(Machine)%6;
478      bublbobl_mcu_sharedram[0x7c] = mame_rand(machine)%6;
479479
480480      cpunum_set_input_line_vector(0,0,bublbobl_mcu_sharedram[0]);
481      cpunum_set_input_line(Machine, 0,0,HOLD_LINE);
481      cpunum_set_input_line(machine, 0,0,HOLD_LINE);
482482   }
483483   if ((ddrB & 0x40) && (~data & 0x40) && (portB_out & 0x40))
484484   {
src/mame/machine/tnzs.c
r2241r2242
1313***************************************************************************/
1414
1515#include "driver.h"
16#include "deprecat.h"
1716#include "cpu/i8x41/i8x41.h"
1817#include "includes/tnzs.h"
1918
r2241r2242
722721
723722   /* bit 4 resets the second CPU */
724723   if (data & 0x10)
725      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
724      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
726725   else
727      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
726      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
728727
729728   /* bits 0-2 select RAM/ROM bank */
730729   memory_set_bankptr (1, &RAM[0x10000 + 0x4000 * (data & 0x07)]);
r2241r2242
743742            /* bit 2 resets the mcu */
744743            if (data & 0x04)
745744            {
746               if (Machine->config->cpu[2].type == CPU_I8X41)
747                  cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, PULSE_LINE);
745               if (machine->config->cpu[2].type == CPU_I8X41)
746                  cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, PULSE_LINE);
748747            }
749748            /* Coin count and lockout is handled by the i8742 */
750749            break;
src/mame/machine/midyunit.c
r2241r2242
560560   }
561561
562562   /* call through based on the sound type */
563   if (ACCESSING_LSB && ACCESSING_MSB)
563   if (ACCESSING_BITS_0_7 && ACCESSING_BITS_8_15)
564564      switch (chip_type)
565565      {
566566         case SOUND_NARC:
src/mame/machine/twincobr.c
r2241r2242
240240
241241WRITE16_HANDLER( twincobr_control_w )
242242{
243   if (ACCESSING_LSB)
243   if (ACCESSING_BITS_0_7)
244244   {
245245      toaplan0_control_w(offset, data & 0xff);
246246   }
r2241r2242
259259
260260WRITE16_HANDLER( twincobr_sharedram_w )
261261{
262   if (ACCESSING_LSB)
262   if (ACCESSING_BITS_0_7)
263263   {
264264      twincobr_sharedram[offset] = data & 0xff;
265265   }
r2241r2242
297297
298298WRITE16_HANDLER( fshark_coin_dsp_w )
299299{
300   if (ACCESSING_LSB)
300   if (ACCESSING_BITS_0_7)
301301   {
302302      toaplan0_coin_dsp_w(offset, data & 0xff);
303303   }
src/mame/machine/konppc.c
r2241r2242
137137   {
138138      if (offset == 0)
139139      {
140         if (!(mem_mask & 0xff000000))
140         if (ACCESSING_BITS_24_31)
141141         {
142142            dsp_shared_ram_bank[cgboard_id] = (data >> 24) & 0x1;
143143
r2241r2242
158158               cpunum_set_input_line(Machine, dsp, INPUT_LINE_IRQ1, ASSERT_LINE);
159159         }
160160
161         if (!(mem_mask & 0x000000ff))
161         if (ACCESSING_BITS_0_7)
162162            dsp_comm_ppc[cgboard_id][offset] = data & 0xff;
163163      }
164164      else
src/mame/machine/midwayic.c
r2241r2242
852852READ32_HANDLER( midway_ioasic_packed_r )
853853{
854854   UINT32 result = 0;
855   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
855   if (ACCESSING_BITS_0_15)
856856      result |= midway_ioasic_r(machine, offset*2, 0xffff0000) & 0xffff;
857   if ((mem_mask & 0xffff0000) != 0xffff0000)
857   if (ACCESSING_BITS_16_31)
858858      result |= (midway_ioasic_r(machine, offset*2+1, 0xffff0000) & 0xffff) << 16;
859859   return result;
860860}
r2241r2242
948948
949949WRITE32_HANDLER( midway_ioasic_packed_w )
950950{
951   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
951   if (ACCESSING_BITS_0_15)
952952      midway_ioasic_w(machine, offset*2, data & 0xffff, 0xffff0000);
953   if ((mem_mask & 0xffff0000) != 0xffff0000)
953   if (ACCESSING_BITS_16_31)
954954      midway_ioasic_w(machine, offset*2+1, data >> 16, 0xffff0000);
955955}
956956
src/mame/machine/segas24.c
r2241r2242
8181
8282WRITE16_HANDLER( system24temp_sys16_io_w )
8383{
84   if(ACCESSING_LSB) {
84   if(ACCESSING_BITS_0_7) {
8585      if(offset < 8) {
8686         if(!(system24temp_sys16_io_dir & (1 << offset))) {
8787            logerror("IO port write on input-only port (%d, [%02x], %02x, %d:%x)\n", offset, system24temp_sys16_io_dir, data & 0xff, cpu_getactivecpu(), activecpu_get_pc());
src/mame/machine/konamigx.c
r2241r2242
18411841
18421842   COMBINE_DATA(prot_data+offset);
18431843
1844   if (offset == 0 && ACCESSING_MSB)
1844   if (offset == 0 && ACCESSING_BITS_8_15)
18451845   {
18461846      data >>= 8;
18471847      switch (data)
r2241r2242
19681968
19691969   COMBINE_DATA(prot_data+offset);
19701970
1971   if (offset == 0x0c && ACCESSING_MSB)
1971   if (offset == 0x0c && ACCESSING_BITS_8_15)
19721972   {
19731973      mode  = (prot_data[0x0d]<<8 & 0xff00) | (prot_data[0x0f] & 0xff);
19741974
src/mame/machine/toaplan1.c
r2241r2242
3636
3737WRITE16_HANDLER( toaplan1_intenable_w )
3838{
39   if (ACCESSING_LSB)
39   if (ACCESSING_BITS_0_7)
4040   {
4141      toaplan1_intenable = data & 0xff;
4242   }
r2241r2242
9999   if (data == 0) {
100100      if (dsp_execute) {
101101         logerror("Turning 68000 on\n");
102         cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, CLEAR_LINE);
102         cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, CLEAR_LINE);
103103         dsp_execute = 0;
104104      }
105105      demonwld_dsp_BIO = ASSERT_LINE;
r2241r2242
140140   logerror("68000:%08x  Writing %08x to %08x.\n",activecpu_get_pc() ,data ,0xe0000a + offset);
141141#endif
142142
143   if (ACCESSING_LSB)
143   if (ACCESSING_BITS_0_7)
144144   {
145145      switch (data)
146146      {
r2241r2242
201201   {
202202      case 0:  break;
203203      case 1:  break;
204      case 2:  if (ACCESSING_LSB) vimana_credits = data & 0xff; break;
204      case 2:  if (ACCESSING_BITS_0_7) vimana_credits = data & 0xff; break;
205205   }
206206}
207207
r2241r2242
212212
213213WRITE16_HANDLER( toaplan1_shared_w )
214214{
215   if (ACCESSING_LSB)
215   if (ACCESSING_BITS_0_7)
216216   {
217217      toaplan1_sharedram[offset] = data & 0xff;
218218   }
r2241r2242
223223{
224224   /* Reset the secondary CPU and sound chip during soft resets */
225225
226   if (ACCESSING_LSB && (data == 0))
226   if (ACCESSING_BITS_0_7 && (data == 0))
227227   {
228228      logerror("PC:%04x  Resetting Sound CPU and Sound chip (%08x)\n",activecpu_get_previouspc(),data);
229      if (Machine->config->sound[0].type == SOUND_YM3812)
229      if (machine->config->sound[0].type == SOUND_YM3812)
230230         sndti_reset(SOUND_YM3812, 0);
231      if (Machine->config->cpu[1].type == CPU_Z80)
232         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE);
231      if (machine->config->cpu[1].type == CPU_Z80)
232         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, PULSE_LINE);
233233   }
234234}
235235
r2241r2242
281281
282282WRITE16_HANDLER( samesame_coin_w )
283283{
284   if (ACCESSING_LSB)
284   if (ACCESSING_BITS_0_7)
285285   {
286286      toaplan1_coin_w(machine, offset, data & 0xff);
287287   }
288   if (ACCESSING_MSB && (data&0xff00))
288   if (ACCESSING_BITS_8_15 && (data&0xff00))
289289   {
290290      logerror("PC:%04x  Writing unknown MSB data (%04x) to coin count/lockout port\n",activecpu_get_previouspc(),data);
291291   }
src/mame/machine/namcoio.c
r2241r2242
133133***************************************************************************/
134134
135135#include "driver.h"
136#include "deprecat.h"
137136#include "machine/namcoio.h"
138137#include "machine/namco50.h"
139138#include "sound/namco52.h"
r2241r2242
218217               static int namcoio_51XX_kludge = 0;
219218
220219               /* Only compute namcoio_51XX_kludge when gamedrv changes */
221               if (namcoio_51XX_driver != Machine->gamedrv)
220               if (namcoio_51XX_driver != machine->gamedrv)
222221               {
223                  namcoio_51XX_driver = Machine->gamedrv;
222                  namcoio_51XX_driver = machine->gamedrv;
224223                  if (strcmp(namcoio_51XX_driver->name, "xevious") == 0 ||
225224                     strcmp(namcoio_51XX_driver->parent, "xevious") == 0)
226225                     namcoio_51XX_kludge = 1;
src/mame/machine/dc.c
r2241r2242
745745   UINT64 shift;
746746
747747   reg = decode_reg_64(offset, mem_mask, &shift);
748
749   // from ElSemi: this makes Atomiswave do it's "verbose boot" with a Sammy logo and diagnostics instead of just running the cart.
750   // our PVR emulation is apparently not good enough for that to work yet though.
751   if ((reg == 0x280/4) && (mem_mask == U64(0xffffffff00000000)))
752   {
753      return 1;
754   }
755
748756   mame_printf_verbose("MODEM:  Unmapped read %08x\n", 0x600000+reg*4);
749757   return 0;
750758}
src/mame/machine/scramble.c
r2241r2242
1010#include "driver.h"
1111#include "cpu/z80/z80.h"
1212#include "machine/8255ppi.h"
13#include "includes/galaxian.h"
13#include "includes/galaxold.h"
1414
1515static UINT8 moonwar_port_select;
1616
r2241r2242
2020
2121MACHINE_RESET( scramble )
2222{
23   MACHINE_RESET_CALL(galaxian);
23   MACHINE_RESET_CALL(galaxold);
2424
2525   if (cpu_gettotalcpu() > 1)
2626   {
r2241r2242
6161   UINT8 *RAM = memory_region(REGION_CPU1);
6262   RAM[0x47ff] = 0; /* If not set, it doesn't reset after the 1st time */
6363
64   MACHINE_RESET_CALL(galaxian);
64   MACHINE_RESET_CALL(galaxold);
6565}
6666
6767static READ8_HANDLER( scrambls_input_port_2_r )
r2241r2242
333333{
334334   DRIVER_INIT_CALL(scramble_ppi);
335335
336   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa803, 0xa803, 0, 0, scramble_background_enable_w);
336   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa803, 0xa803, 0, 0, scrambold_background_enable_w);
337337}
338338
339339DRIVER_INIT( atlantis )
340340{
341341   DRIVER_INIT_CALL(scramble_ppi);
342342
343   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6803, 0x6803, 0, 0, scramble_background_enable_w);
343   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6803, 0x6803, 0, 0, scrambold_background_enable_w);
344344}
345345
346346DRIVER_INIT( scramble )
r2241r2242
371371{
372372   DRIVER_INIT_CALL(scramble_ppi);
373373
374   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0, scramble_background_green_w);
375   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb002, 0xb002, 0, 0, scramble_background_blue_w);
376   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb00a, 0xb00a, 0, 0, scramble_background_red_w);
374   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0, scrambold_background_green_w);
375   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb002, 0xb002, 0, 0, scrambold_background_blue_w);
376   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb00a, 0xb00a, 0, 0, scrambold_background_red_w);
377377
378378   ppi8255_set_portCread(0, stratgyx_input_port_2_r);
379379   ppi8255_set_portCread(1, stratgyx_input_port_3_r);
r2241r2242
383383{
384384   DRIVER_INIT_CALL(scramble_ppi);
385385
386   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb002, 0xb002, 0, 0, scramble_background_enable_w);
386   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb002, 0xb002, 0, 0, scrambold_background_enable_w);
387387}
388388
389389DRIVER_INIT( amidar )
r2241r2242
576576
577577   DRIVER_INIT_CALL(scramble_ppi);
578578
579   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa804, 0xa804, 0, 0, scramble_background_enable_w);
579   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa804, 0xa804, 0, 0, scrambold_background_enable_w);
580580}
581581
582582DRIVER_INIT( mimonsco )
583583{
584584   DRIVER_INIT_CALL(scramble_ppi);
585585
586   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa804, 0xa804, 0, 0, scramble_background_enable_w);
586   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa804, 0xa804, 0, 0, scrambold_background_enable_w);
587587}
588588
589589DRIVER_INIT( mimonscr )
590590{
591591   DRIVER_INIT_CALL(scramble_ppi);
592592
593   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6804, 0x6804, 0, 0, scramble_background_enable_w);
593   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6804, 0x6804, 0, 0, scrambold_background_enable_w);
594594}
595595
596596
src/mame/machine/midtunit.c
r2241r2242
144144
145145static WRITE16_HANDLER( mk_prot_w )
146146{
147   if (ACCESSING_MSB)
147   if (ACCESSING_BITS_8_15)
148148   {
149149      int first_val = (data >> 9) & 0x3f;
150150      int i;
r2241r2242
609609   }
610610
611611   /* call through based on the sound type */
612   if (ACCESSING_LSB && ACCESSING_MSB)
612   if (ACCESSING_BITS_0_7 && ACCESSING_BITS_8_15)
613613      switch (chip_type)
614614      {
615615         case SOUND_ADPCM:
src/mame/machine/segaic16.c
r2241r2242
417417
418418WRITE16_HANDLER( segaic16_memory_mapper_lsb_w )
419419{
420   if (ACCESSING_LSB)
420   if (ACCESSING_BITS_0_7)
421421      memory_mapper_w(&memory_mapper, offset, data & 0xff);
422422}
423423
src/mame/machine/nmk112.c
r2241r2242
5454
5555WRITE16_HANDLER( NMK112_okibank_lsb_w )
5656{
57   if (ACCESSING_LSB)
57   if (ACCESSING_BITS_0_7)
5858   {
5959      NMK112_okibank_w(machine, offset, data & 0xff);
6060   }
src/mame/machine/mexico86.c
r2241r2242
2121*/
2222WRITE8_HANDLER( mexico86_f008_w )
2323{
24   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 4) ? CLEAR_LINE : ASSERT_LINE);
25    if (Machine->config->cpu[2].type != CPU_DUMMY)
24   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 4) ? CLEAR_LINE : ASSERT_LINE);
25    if (machine->config->cpu[2].type != CPU_DUMMY)
2626   {
2727      // mexico 86, knight boy
28      cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 2) ? CLEAR_LINE : ASSERT_LINE);
28      cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (data & 2) ? CLEAR_LINE : ASSERT_LINE);
2929   }
3030   else
3131   {
r2241r2242
314314   if ((ddrB & 0x20) && (data & 0x20) && (~portB_out & 0x20))
315315   {
316316      cpunum_set_input_line_vector(0,0,mexico86_protection_ram[0]);
317      //cpunum_set_input_line(Machine, 0,0,PULSE_LINE);
318      cpunum_set_input_line(Machine, 0, 0, HOLD_LINE); //AT: HOLD_LINE works better in Z80 interrupt mode 1.
317      //cpunum_set_input_line(machine, 0,0,PULSE_LINE);
318      cpunum_set_input_line(machine, 0, 0, HOLD_LINE); //AT: HOLD_LINE works better in Z80 interrupt mode 1.
319319   }
320320   if ((ddrB & 0x40) && (~data & 0x40) && (portB_out & 0x40))
321321   {
src/mame/machine/amiga.c
r2241r2242
11061106   /* offsets 0000-07ff reference CIA B, and are accessed via the MSB */
11071107   if ((offset & 0x0800) == 0)
11081108   {
1109      if (!ACCESSING_MSB)
1109      if (!ACCESSING_BITS_8_15)
11101110         return;
11111111      which = 1;
11121112      data >>= 8;
r2241r2242
11151115   /* offsets 0800-0fff reference CIA A, and are accessed via the LSB */
11161116   else
11171117   {
1118      if (!ACCESSING_LSB)
1118      if (!ACCESSING_BITS_0_7)
11191119         return;
11201120      which = 0;
11211121      data &= 0xff;
r2241r2242
17371737   logerror("autoconfig_w(%02X) = %04X & %04X\n", offset, data, mem_mask ^ 0xffff);
17381738
17391739   /* if no current device, bail */
1740   if (!cur_autoconfig || !ACCESSING_MSB)
1740   if (!cur_autoconfig || !ACCESSING_BITS_8_15)
17411741      return;
17421742
17431743   /* switch off of the base offset */
src/mame/machine/vertigo.c
r2241r2242
1919 *
2020 *************************************/
2121
22static void v_irq4_w(int level);
23static void v_irq3_w(int level);
22static PIT8253_OUTPUT_CHANGED( v_irq4_w );
23static PIT8253_OUTPUT_CHANGED( v_irq3_w );
2424static void update_irq(void);
2525
2626
r2241r2242
4343static UINT8 adc_result;
4444
4545/* 8254 timer config */
46static const struct pit8253_config pit8254_config =
46const struct pit8253_config vertigo_pit8254_config =
4747{
48   TYPE8254,
4948   {
5049      {
5150         240000,
r2241r2242
9897}
9998
10099
101static void v_irq4_w(int level)
100static PIT8253_OUTPUT_CHANGED( v_irq4_w )
102101{
103   update_irq_encoder(INPUT_LINE_IRQ4, level);
104   vertigo_vproc(ATTOTIME_TO_CYCLES(0, attotime_sub(timer_get_time(), irq4_time)), level);
102   update_irq_encoder(INPUT_LINE_IRQ4, state);
103   vertigo_vproc(ATTOTIME_TO_CYCLES(0, attotime_sub(timer_get_time(), irq4_time)), state);
105104   irq4_time = timer_get_time();
106105}
107106
108107
109static void v_irq3_w(int level)
108static PIT8253_OUTPUT_CHANGED( v_irq3_w )
110109{
111   if (level)
110   if (state)
112111      cpunum_set_input_line(Machine, 1, INPUT_LINE_IRQ0, ASSERT_LINE);
113112
114   update_irq_encoder(INPUT_LINE_IRQ3, level);
113   update_irq_encoder(INPUT_LINE_IRQ3, state);
115114}
116115
117116
r2241r2242
189188
190189WRITE16_HANDLER( vertigo_audio_w )
191190{
192   if (ACCESSING_LSB)
191   if (ACCESSING_BITS_0_7)
193192      timer_call_after_resynch(NULL, data & 0xff, sound_command_w);
194193}
195194
r2241r2242
221220      TTL74148_input_line_w(0, i, 1);
222221
223222   TTL74148_update(0);
224   pit8253_init(1, &pit8254_config);
225223   vertigo_vproc_init();
226224
227225   irq4_time = timer_get_time();
src/mame/machine/pcshare.c
r2241r2242
3636#ifdef MESS
3737#include "machine/pc_fdc.h"
3838#include "machine/pc_hdc.h"
39#include "audio/pc.h"
4039#endif /* MESS */
4140
4241#define VERBOSE_DBG 0       /* general debug messages */
r2241r2242
5554#define LOG_PORT80 0
5655
5756
58static void pc_timer0_w(int state)
59{
60   pic8259_set_irq_line(0, 0, state);
61}
62
63
64/*
65 * timer0   heartbeat IRQ
66 * timer1   DRAM refresh (ignored)
67 * timer2   PIO port C pin 4 and speaker polling
68 */
69static const struct pit8253_config pc_pit8253_config =
70{
71   TYPE8253,
72   {
73      {
74         4772720/4,            /* heartbeat IRQ */
75         pc_timer0_w,
76         NULL
77      }, {
78         4772720/4,            /* dram refresh */
79         NULL,
80         NULL
81      }, {
82         4772720/4,            /* pio port c pin 4, and speaker polling enough */
83         NULL,
84#ifdef MESS
85         pc_sh_speaker_change_clock
86#else
87         NULL //pc_sh_speaker_change_clock
88#endif /* MESS */
89      }
90   }
91};
92
93static const struct pit8253_config pc_pit8254_config =
94{
95   TYPE8254,
96   {
97      {
98         4772720/4,            /* heartbeat IRQ */
99         pc_timer0_w,
100         NULL
101      }, {
102         4772720/4,            /* dram refresh */
103         NULL,
104         NULL
105      }, {
106         4772720/4,            /* pio port c pin 4, and speaker polling enough */
107         NULL,
108#ifdef MESS
109         pc_sh_speaker_change_clock
110#else
111         NULL //pc_sh_speaker_change_clock
112#endif /* MESS */
113      }
114   }
115};
116
117
118
11957/*************************************************************************
12058 *
12159 *      PC DMA stuff
r2241r2242
289227
290228void init_pc_common(UINT32 flags)
291229{
292   /* PIT */
293   if (flags & PCCOMMON_TIMER_8254)
294      pit8253_init(1, &pc_pit8254_config);
295   else if (flags & PCCOMMON_TIMER_8253)
296      pit8253_init(1, &pc_pit8253_config);
297
298230   /* PC-XT keyboard */
299231   if (flags & PCCOMMON_KEYBOARD_AT)
300232      at_keyboard_init(AT_KEYBOARD_TYPE_AT);
src/mame/machine/pcshare.h
r2241r2242
55#define PCCOMMON_KEYBOARD_AT   1
66#define PCCOMMON_DMA8237_PC      0
77#define PCCOMMON_DMA8237_AT      2
8#define PCCOMMON_TIMER_NONE     0
9#define PCCOMMON_TIMER_8253     4
10#define PCCOMMON_TIMER_8254     8
118#define PCCOMMON_NEC765_RDY_NC   16
129
1310void init_pc_common(UINT32 flags);
src/mame/machine/atarigen.c
r2241r2242
706706
707707WRITE16_HANDLER( atarigen_sound_w )
708708{
709   if (ACCESSING_LSB)
709   if (ACCESSING_BITS_0_7)
710710      timer_call_after_resynch(NULL, data & 0xff, delayed_sound_w);
711711}
712712
713713WRITE16_HANDLER( atarigen_sound_upper_w )
714714{
715   if (ACCESSING_MSB)
715   if (ACCESSING_BITS_8_15)
716716      timer_call_after_resynch(NULL, (data >> 8) & 0xff, delayed_sound_w);
717717}
718718
719719WRITE32_HANDLER( atarigen_sound_upper32_w )
720720{
721   if (ACCESSING_MSB32)
721   if (ACCESSING_BITS_24_31)
722722      timer_call_after_resynch(NULL, (data >> 24) & 0xff, delayed_sound_w);
723723}
724724
r2241r2242
12941294WRITE32_HANDLER( atarigen_alpha32_w )
12951295{
12961296   COMBINE_DATA(&atarigen_alpha32[offset]);
1297   if ((mem_mask & 0xffff0000) != 0xffff0000)
1297   if (ACCESSING_BITS_16_31)
12981298      tilemap_mark_tile_dirty(atarigen_alpha_tilemap, offset * 2);
1299   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
1299   if (ACCESSING_BITS_0_15)
13001300      tilemap_mark_tile_dirty(atarigen_alpha_tilemap, offset * 2 + 1);
13011301}
13021302
r2241r2242
13381338WRITE32_HANDLER( atarigen_playfield32_w )
13391339{
13401340   COMBINE_DATA(&atarigen_playfield32[offset]);
1341   if ((mem_mask & 0xffff0000) != 0xffff0000)
1341   if (ACCESSING_BITS_16_31)
13421342      tilemap_mark_tile_dirty(atarigen_playfield_tilemap, offset * 2);
1343   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
1343   if (ACCESSING_BITS_0_15)
13441344      tilemap_mark_tile_dirty(atarigen_playfield_tilemap, offset * 2 + 1);
13451345}
13461346
r2241r2242
15121512{
15131513   COMBINE_DATA(&paletteram16[offset]);
15141514
1515   if (ACCESSING_MSB)
1515   if (ACCESSING_BITS_8_15)
15161516   {
15171517      int palentry = offset / 2;
15181518      int newword = (paletteram16[palentry * 2] & 0xff00) | (paletteram16[palentry * 2 + 1] >> 8);
r2241r2242
15381538
15391539   COMBINE_DATA(&paletteram32[offset]);
15401540
1541   if (ACCESSING_MSW32)
1541   if (ACCESSING_BITS_16_31)
15421542   {
15431543      newword = paletteram32[offset] >> 16;
15441544
r2241r2242
15491549      palette_set_color_rgb(machine, offset * 2, pal6bit(r), pal6bit(g), pal6bit(b));
15501550   }
15511551
1552   if (ACCESSING_LSW32)
1552   if (ACCESSING_BITS_0_15)
15531553   {
15541554      newword = paletteram32[offset] & 0xffff;
15551555
src/mame/machine/midwunit.c
r2241r2242
162162{
163163   int offs = offset / 0x40000;
164164
165   if (offs == 1 && ACCESSING_LSB)
165   if (offs == 1 && ACCESSING_BITS_0_7)
166166      dcs_reset_w(data & 2);
167167
168   if (ACCESSING_LSB && offset % 0x40000 == 0)
168   if (ACCESSING_BITS_0_7 && offset % 0x40000 == 0)
169169      logerror("%08X:midxunit_unknown_w @ %d = %02X\n", activecpu_get_pc(), offs, data & 0xff);
170170}
171171
r2241r2242
229229
230230WRITE16_HANDLER( midxunit_analog_select_w )
231231{
232   if (offset == 0 && ACCESSING_LSB)
232   if (offset == 0 && ACCESSING_BITS_0_7)
233233      midxunit_analog_port = data - 8 + 4;
234234}
235235
r2241r2242
328328WRITE16_HANDLER( midxunit_uart_w )
329329{
330330   /* convert to a byte offset, ignoring MSB writes */
331   if ((offset & 1) || !ACCESSING_LSB)
331   if ((offset & 1) || !ACCESSING_BITS_0_7)
332332      return;
333333   offset /= 2;
334334   data &= 0xff;
r2241r2242
645645
646646WRITE16_HANDLER( midwunit_security_w )
647647{
648   if (offset == 0 && ACCESSING_LSB)
648   if (offset == 0 && ACCESSING_BITS_0_7)
649649      midway_serial_pic_w(data);
650650}
651651
652652
653653WRITE16_HANDLER( midxunit_security_w )
654654{
655   if (ACCESSING_LSB)
655   if (ACCESSING_BITS_0_7)
656656      security_bits = data & 0x0f;
657657}
658658
659659
660660WRITE16_HANDLER( midxunit_security_clock_w )
661661{
662   if (offset == 0 && ACCESSING_LSB)
662   if (offset == 0 && ACCESSING_BITS_0_7)
663663      midway_serial_pic_w(((~data & 2) << 3) | security_bits);
664664}
665665
r2241r2242
695695   }
696696
697697   /* call through based on the sound type */
698   if (ACCESSING_LSB)
698   if (ACCESSING_BITS_0_7)
699699   {
700700      logerror("%08X:Sound write = %04X\n", activecpu_get_pc(), data);
701701      dcs_data_w(data & 0xff);
src/mame/machine/namcos2.c
r2241r2242
150150}
151151
152152WRITE16_HANDLER( namcos2_68k_eeprom_w ){
153   if( ACCESSING_LSB )
153   if( ACCESSING_BITS_0_7 )
154154   {
155155      namcos2_eeprom[offset] = data;
156156   }
src/mame/machine/tx1.c
r2241r2242
2323    Globals
2424*/
2525static UINT16 *prom;
26static emu_timer *interrupt_timer;
2627
2728static struct
2829{
r2241r2242
6566static TIMER_CALLBACK( interrupt_callback )
6667{
6768   cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xff);
68   timer_set(video_screen_get_time_until_pos(machine->primary_screen, CURSOR_YPOS, CURSOR_XPOS), NULL, 0, interrupt_callback);
69   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, CURSOR_YPOS, CURSOR_XPOS), 0);
6970}
7071
7172/*
r2241r2242
14771478   /* Initialise for each game */
14781479   prom = (UINT16*)memory_region(REGION_USER1) + (0x8000 >> 1);
14791480
1481   /* set a timer to run the interrupts */
1482   interrupt_timer = timer_alloc(interrupt_callback, NULL);
1483
14801484   /* /CUDISP CRTC interrupt */
1481   timer_set(video_screen_get_time_until_pos(machine->primary_screen, CURSOR_YPOS, CURSOR_XPOS), NULL, 0, interrupt_callback);
1485   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, CURSOR_YPOS, CURSOR_XPOS), 0);
14821486}
14831487
14841488MACHINE_START( buggyboy )
r2241r2242
14881492   /* Initialise for each game */
14891493   prom = (UINT16*)memory_region(REGION_USER1) + (0x8000 >> 1);
14901494
1495   /* set a timer to run the interrupts */
1496   interrupt_timer = timer_alloc(interrupt_callback, NULL);
1497
14911498   /* /CUDISP CRTC interrupt */
1492   timer_set(video_screen_get_time_until_pos(machine->primary_screen, CURSOR_YPOS, CURSOR_XPOS), NULL, 0, interrupt_callback);
1499   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, CURSOR_YPOS, CURSOR_XPOS), 0);
14931500}
14941501
14951502MACHINE_START( buggybjr )
r2241r2242
14971504   /* Initialise for each game */
14981505   prom = (UINT16*)memory_region(REGION_USER1) + (0x8000 >> 1);
14991506
1507   /* set a timer to run the interrupts */
1508   interrupt_timer = timer_alloc(interrupt_callback, NULL);
1509
15001510   /* /CUDISP CRTC interrupt */
1501   timer_set(video_screen_get_time_until_pos(machine->primary_screen, CURSOR_YPOS, CURSOR_XPOS), NULL, 0, interrupt_callback);
1511   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, CURSOR_YPOS, CURSOR_XPOS), 0);
15021512}
src/mame/machine/cclimber.c
r2241r2242
5050   cclimber_decode(convtable);
5151}
5252
53DRIVER_INIT( cclimbrj )
53void cclimbrj_decode(void)
5454{
5555   static const UINT8 convtable[8][16] =
5656   {
r2241r2242
6767   cclimber_decode(convtable);
6868}
6969
70DRIVER_INIT( mshuttle )
70DRIVER_INIT( cclimbrj )
7171{
72   cclimbrj_decode();
73}
74
75void mshuttle_decode(void)
76{
7277   static const UINT8 convtable[8][16] =
7378   {
7479      /* -1 marks spots which are unused and therefore unknown */
src/mame/machine/mcr.c
r2241r2242
902902
903903WRITE16_HANDLER( mcr68_6840_upper_w )
904904{
905   if (ACCESSING_MSB)
905   if (ACCESSING_BITS_8_15)
906906      mcr68_6840_w_common(machine, offset, (data >> 8) & 0xff);
907907}
908908
909909
910910WRITE16_HANDLER( mcr68_6840_lower_w )
911911{
912   if (ACCESSING_LSB)
912   if (ACCESSING_BITS_0_7)
913913      mcr68_6840_w_common(machine, offset, data & 0xff);
914914}
915915
src/mame/machine/tatsumi.c
r2241r2242
111111      logerror("%08x: write unmapped v30 rom %08x\n",activecpu_get_pc(),offset);
112112
113113   /* Only 8 bits of the V30 data bus are connected - ignore writes to the other half */
114   if (ACCESSING_LSB)
114   if (ACCESSING_BITS_0_7)
115115   {
116116      cpuintrf_push_context(2);
117117      program_write_byte(offset, data&0xff);
r2241r2242
170170WRITE16_HANDLER( roundup_v30_z80_w )
171171{
172172   /* Only 8 bits of the V30 data bus are connected - ignore writes to the other half */
173   if (ACCESSING_LSB)
173   if (ACCESSING_BITS_0_7)
174174   {
175175      if (tatsumi_control_word&0x20)
176176         offset+=0x8000; /* Upper half of Z80 address space */
src/mame/machine/konamiic.c
r2241r2242
7171{
7272   UINT32 r = 0;
7373
74   if (!(mem_mask & 0xff000000))
74   if (ACCESSING_BITS_24_31)
7575   {
7676      r |= K056800_host_reg_r((offset*4)+0) << 24;
7777   }
78   if (!(mem_mask & 0x00ff0000))
78   if (ACCESSING_BITS_16_23)
7979   {
8080      r |= K056800_host_reg_r((offset*4)+1) << 16;
8181   }
82   if (!(mem_mask & 0x0000ff00))
82   if (ACCESSING_BITS_8_15)
8383   {
8484      r |= K056800_host_reg_r((offset*4)+2) << 8;
8585   }
86   if (!(mem_mask & 0x000000ff))
86   if (ACCESSING_BITS_0_7)
8787   {
8888      r |= K056800_host_reg_r((offset*4)+3) << 0;
8989   }
r2241r2242
9393
9494WRITE32_HANDLER(K056800_host_w)
9595{
96   if (!(mem_mask & 0xff000000))
96   if (ACCESSING_BITS_24_31)
9797   {
9898      K056800_host_reg_w((offset*4)+0, (data >> 24) & 0xff);
9999   }
100   if (!(mem_mask & 0x00ff0000))
100   if (ACCESSING_BITS_16_23)
101101   {
102102      K056800_host_reg_w((offset*4)+1, (data >> 16) & 0xff);
103103   }
104   if (!(mem_mask & 0x0000ff00))
104   if (ACCESSING_BITS_8_15)
105105   {
106106      K056800_host_reg_w((offset*4)+2, (data >> 8) & 0xff);
107107   }
108   if (!(mem_mask & 0x000000ff))
108   if (ACCESSING_BITS_0_7)
109109   {
110110      K056800_host_reg_w((offset*4)+3, (data >> 0) & 0xff);
111111   }
src/mame/machine/galaxold.c
r0r2242
1/***************************************************************************
2
3  machine.c
4
5  Functions to emulate general aspects of the machine (RAM, ROM, interrupts,
6  I/O ports)
7
8***************************************************************************/
9
10#include "driver.h"
11#include "deprecat.h"
12#include "machine/7474.h"
13#include "includes/galaxold.h"
14
15static int irq_line;
16static emu_timer *int_timer;
17
18static UINT8 kingball_speech_dip;
19static UINT8 kingball_sound;
20
21static UINT8 _4in1_bank;
22static UINT8 gmgalax_selected_game;
23
24
25static void galaxold_7474_9M_2_callback(void)
26{
27   /* Q bar clocks the other flip-flop,
28       Q is VBLANK (not visible to the CPU) */
29   TTL7474_clock_w(1, TTL7474_output_comp_r(0));
30   TTL7474_update(1);
31}
32
33static void galaxold_7474_9M_1_callback(void)
34{
35   /* Q goes to the NMI line */
36   cpunum_set_input_line(Machine, 0, irq_line, TTL7474_output_r(1) ? CLEAR_LINE : ASSERT_LINE);
37}
38
39static const struct TTL7474_interface galaxold_7474_9M_2_intf =
40{
41   galaxold_7474_9M_2_callback
42};
43
44static const struct TTL7474_interface galaxold_7474_9M_1_intf =
45{
46   galaxold_7474_9M_1_callback
47};
48
49
50WRITE8_HANDLER( galaxold_nmi_enable_w )
51{
52   TTL7474_preset_w(1, data);
53   TTL7474_update(1);
54}
55
56
57static TIMER_CALLBACK( interrupt_timer )
58{
59   /* 128V, 64V and 32V go to D */
60   TTL7474_d_w(0, (param & 0xe0) != 0xe0);
61
62   /* 16V clocks the flip-flop */
63   TTL7474_clock_w(0, param & 0x10);
64
65   param = (param + 0x10) & 0xff;
66
67   timer_adjust_oneshot(int_timer, video_screen_get_time_until_pos(machine->primary_screen, param, 0), param);
68
69   TTL7474_update(0);
70}
71
72
73static void machine_reset_common(running_machine *machine, int line)
74{
75   irq_line = line;
76
77   /* initalize main CPU interrupt generator flip-flops */
78   TTL7474_config(0, &galaxold_7474_9M_2_intf);
79   TTL7474_preset_w(0, 1);
80   TTL7474_clear_w (0, 1);
81
82   TTL7474_config(1, &galaxold_7474_9M_1_intf);
83   TTL7474_clear_w (1, 1);
84   TTL7474_d_w     (1, 0);
85   TTL7474_preset_w(1, 0);
86
87   /* start a timer to generate interrupts */
88   int_timer = timer_alloc(interrupt_timer, NULL);
89   timer_adjust_oneshot(int_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), 0);
90}
91
92MACHINE_RESET( galaxold )
93{
94   machine_reset_common(machine, INPUT_LINE_NMI);
95}
96
97MACHINE_RESET( devilfsg )
98{
99   machine_reset_common(machine, 0);
100}
101
102
103WRITE8_HANDLER( galaxold_coin_lockout_w )
104{
105   coin_lockout_global_w(~data & 1);
106}
107
108
109WRITE8_HANDLER( galaxold_coin_counter_w )
110{
111   coin_counter_w(offset, data & 0x01);
112}
113
114WRITE8_HANDLER( galaxold_coin_counter_1_w )
115{
116   coin_counter_w(1, data & 0x01);
117}
118
119WRITE8_HANDLER( galaxold_coin_counter_2_w )
120{
121   coin_counter_w(2, data & 0x01);
122}
123
124
125WRITE8_HANDLER( galaxold_leds_w )
126{
127   set_led_status(offset,data & 1);
128}
129
130
131static READ8_HANDLER( checkmaj_protection_r )
132{
133   switch (activecpu_get_pc())
134   {
135   case 0x0f15:  return 0xf5;
136   case 0x0f8f:  return 0x7c;
137   case 0x10b3:  return 0x7c;
138   case 0x10e0:  return 0x00;
139   case 0x10f1:  return 0xaa;
140   case 0x1402:  return 0xaa;
141   default:
142      logerror("Unknown protection read. PC=%04X\n",activecpu_get_pc());
143   }
144
145   return 0;
146}
147
148
149/* Zig Zag can swap ROMs 2 and 3 as a form of copy protection */
150WRITE8_HANDLER( zigzag_sillyprotection_w )
151{
152   if (data)
153   {
154      /* swap ROM 2 and 3! */
155      memory_set_bank(1, 1);
156      memory_set_bank(2, 0);
157   }
158   else
159   {
160      memory_set_bank(1, 0);
161      memory_set_bank(2, 1);
162   }
163}
164
165DRIVER_INIT( zigzag )
166{
167   UINT8 *RAM = memory_region(REGION_CPU1);
168   memory_configure_bank(1, 0, 2, &RAM[0x2000], 0x1000);
169   memory_configure_bank(2, 0, 2, &RAM[0x2000], 0x1000);
170   memory_set_bank(1, 0);
171   memory_set_bank(2, 1);
172}
173
174
175
176static READ8_HANDLER( dingo_3000_r )
177{
178   return 0xaa;
179}
180
181static READ8_HANDLER( dingo_3035_r )
182{
183   return 0x8c;
184}
185
186static READ8_HANDLER( dingoe_3001_r )
187{
188   return 0xaa;
189}
190
191
192DRIVER_INIT( dingoe )
193{
194   offs_t i;
195   UINT8 *rom = memory_region(REGION_CPU1);
196
197   for (i = 0; i < 0x3000; i++)
198   {
199      UINT8 data_xor;
200
201      /* XOR bit 2 with 4 and 5 with 0 */
202      data_xor = BIT(rom[i], 2) << 4 | BIT(rom[i], 5) << 0;
203      rom[i] ^= data_xor;
204
205
206      /* Invert bit 1 */
207      if (~rom[i] & 0x02)
208         rom[i] = rom[i] | 0x02;
209      else
210         rom[i] = rom[i] & 0xfd;
211
212
213      /* Swap bit0 with bit4 */
214      if ((i & 0x0f) == 0x02 || (i & 0x0f) == 0x0a || (i & 0x0f) == 0x03 || (i & 0x0f) == 0x0b || (i & 0x0f) == 0x06 || (i & 0x0f) == 0x0e || (i & 0x0f) == 0x07 || (i & 0x0f) == 0x0f)   /* Swap Bit 0 and 4 */
215         rom[i] = BITSWAP8(rom[i],7,6,5,0,3,2,1,4);
216   }
217
218   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3001, 0x3001, 0, 0, dingoe_3001_r);   /* Protection check */
219
220}
221
222
223
224/* Hack? If $b003 is high, we'll check our "fake" speech dipswitch (marked as SLAM) */
225static READ8_HANDLER( kingball_IN0_r )
226{
227   if (kingball_speech_dip)
228      return (readinputport(0) & ~0x40) | ((readinputport(3) & 0x01) << 6);
229   else
230      return readinputport(0);
231}
232
233static READ8_HANDLER( kingball_IN1_r )
234{
235   /* bit 5 is the NOISE line from the sound circuit.  The code just verifies
236       that it's working, doesn't actually use return value, so we can just use
237       rand() */
238
239   return (readinputport(1) & ~0x20) | (mame_rand(Machine) & 0x20);
240}
241
242WRITE8_HANDLER( kingball_speech_dip_w )
243{
244   kingball_speech_dip = data;
245}
246
247WRITE8_HANDLER( kingball_sound1_w )
248{
249   kingball_sound = (kingball_sound & ~0x01) | data;
250}
251
252WRITE8_HANDLER( kingball_sound2_w )
253{
254   kingball_sound = (kingball_sound & ~0x02) | (data << 1);
255   soundlatch_w (machine, 0, kingball_sound | 0xf0);
256}
257
258
259READ8_HANDLER( scramblb_protection_1_r )
260{
261   switch (activecpu_get_pc())
262   {
263   case 0x01da: return 0x80;
264   case 0x01e4: return 0x00;
265   default:
266      logerror("%04x: read protection 1\n",activecpu_get_pc());
267      return 0;
268   }
269}
270
271READ8_HANDLER( scramblb_protection_2_r )
272{
273   switch (activecpu_get_pc())
274   {
275   case 0x01ca: return 0x90;
276   default:
277      logerror("%04x: read protection 2\n",activecpu_get_pc());
278      return 0;
279   }
280}
281
282
283static READ8_HANDLER( azurian_IN1_r )
284{
285   return (readinputport(1) & ~0x40) | ((readinputport(3) & 0x01) << 6);
286}
287
288static READ8_HANDLER( azurian_IN2_r )
289{
290   return (readinputport(2) & ~0x04) | ((readinputport(3) & 0x02) << 1);
291}
292
293
294WRITE8_HANDLER( _4in1_bank_w )
295{
296   _4in1_bank = data & 0x03;
297   galaxold_gfxbank_w(machine, 0, _4in1_bank);
298   memory_set_bank(1, _4in1_bank);
299}
300
301READ8_HANDLER( _4in1_input_port_1_r )
302{
303   return (readinputport(1) & ~0xc0) | (readinputport(3+_4in1_bank) & 0xc0);
304}
305
306READ8_HANDLER( _4in1_input_port_2_r )
307{
308   return (readinputport(2) & 0x04) | (readinputport(3+_4in1_bank) & ~0xc4);
309}
310
311
312static void gmgalax_select_game(int game)
313{
314   gmgalax_selected_game = game;
315
316   memory_set_bank(1, game);
317
318   galaxold_gfxbank_w(Machine, 0, gmgalax_selected_game);
319}
320
321READ8_HANDLER( gmgalax_input_port_0_r )
322{
323   return readinputport(gmgalax_selected_game ? 3 : 0);
324}
325
326READ8_HANDLER( gmgalax_input_port_1_r )
327{
328   return readinputport(gmgalax_selected_game ? 4 : 1);
329}
330
331READ8_HANDLER( gmgalax_input_port_2_r )
332{
333   return readinputport(gmgalax_selected_game ? 5 : 2);
334}
335
336
337DRIVER_INIT( pisces )
338{
339   /* the coin lockout was replaced */
340   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0, galaxold_gfxbank_w);
341}
342
343DRIVER_INIT( checkmaj )
344{
345   /* for the title screen */
346   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3800, 0x3800, 0, 0, checkmaj_protection_r);
347}
348
349DRIVER_INIT( dingo )
350{
351   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3000, 0, 0, dingo_3000_r);
352   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3035, 0x3035, 0, 0, dingo_3035_r);
353}
354
355DRIVER_INIT( kingball )
356{
357   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa000, 0, 0, kingball_IN0_r);
358   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xa800, 0, 0, kingball_IN1_r);
359
360   state_save_register_global(kingball_speech_dip);
361   state_save_register_global(kingball_sound);
362}
363
364
365static UINT8 decode_mooncrst(UINT8 data,offs_t addr)
366{
367   UINT8 res;
368
369   res = data;
370   if (BIT(data,1)) res ^= 0x40;
371   if (BIT(data,5)) res ^= 0x04;
372   if ((addr & 1) == 0)
373      res = (res & 0xbb) | (BIT(res,6) << 2) | (BIT(res,2) << 6);
374   return res;
375}
376
377DRIVER_INIT( mooncrsu )
378{
379   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa002, 0, 0, galaxold_gfxbank_w);
380}
381
382DRIVER_INIT( mooncrst )
383{
384   offs_t i;
385   UINT8 *rom = memory_region(REGION_CPU1);
386
387
388   for (i = 0;i < memory_region_length(REGION_CPU1);i++)
389      rom[i] = decode_mooncrst(rom[i],i);
390
391   DRIVER_INIT_CALL(mooncrsu);
392}
393
394DRIVER_INIT( mooncrgx )
395{
396   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6002, 0, 0, galaxold_gfxbank_w);
397}
398
399DRIVER_INIT( moonqsr )
400{
401   offs_t i;
402   UINT8 *rom = memory_region(REGION_CPU1);
403   UINT8 *decrypt = auto_malloc(0x8000);
404
405   memory_set_decrypted_region(0, 0x0000, 0x7fff, decrypt);
406
407   for (i = 0;i < 0x8000;i++)
408      decrypt[i] = decode_mooncrst(rom[i],i);
409}
410
411DRIVER_INIT( checkman )
412{
413/*
414                     Encryption Table
415                     ----------------
416+---+---+---+------+------+------+------+------+------+------+------+
417|A2 |A1 |A0 |D7    |D6    |D5    |D4    |D3    |D2    |D1    |D0    |
418+---+---+---+------+------+------+------+------+------+------+------+
419| 0 | 0 | 0 |D7    |D6    |D5    |D4    |D3    |D2    |D1    |D0^^D6|
420| 0 | 0 | 1 |D7    |D6    |D5    |D4    |D3    |D2    |D1^^D5|D0    |
421| 0 | 1 | 0 |D7    |D6    |D5    |D4    |D3    |D2^^D4|D1^^D6|D0    |
422| 0 | 1 | 1 |D7    |D6    |D5    |D4^^D2|D3    |D2    |D1    |D0^^D5|
423| 1 | 0 | 0 |D7    |D6^^D4|D5^^D1|D4    |D3    |D2    |D1    |D0    |
424| 1 | 0 | 1 |D7    |D6^^D0|D5^^D2|D4    |D3    |D2    |D1    |D0    |
425| 1 | 1 | 0 |D7    |D6    |D5    |D4    |D3    |D2^^D0|D1    |D0    |
426| 1 | 1 | 1 |D7    |D6    |D5    |D4^^D1|D3    |D2    |D1    |D0    |
427+---+---+---+------+------+------+------+------+------+------+------+
428
429For example if A2=1, A1=1 and A0=0 then D2 to the CPU would be an XOR of
430D2 and D0 from the ROM's. Note that D7 and D3 are not encrypted.
431
432Encryption PAL 16L8 on cardridge
433         +--- ---+
434    OE --|   U   |-- VCC
435 ROMD0 --|       |-- D0
436 ROMD1 --|       |-- D1
437 ROMD2 --|VER 5.2|-- D2
438    A0 --|       |-- NOT USED
439    A1 --|       |-- A2
440 ROMD4 --|       |-- D4
441 ROMD5 --|       |-- D5
442 ROMD6 --|       |-- D6
443   GND --|       |-- M1 (NOT USED)
444         +-------+
445Pin layout is such that links can replace the PAL if encryption is not used.
446
447*/
448   static const UINT8 xortable[8][4] =
449   {
450      { 6,0,6,0 },
451      { 5,1,5,1 },
452      { 4,2,6,1 },
453      { 2,4,5,0 },
454      { 4,6,1,5 },
455      { 0,6,2,5 },
456      { 0,2,0,2 },
457      { 1,4,1,4 }
458   };
459
460   offs_t i;
461   UINT8 *rom = memory_region(REGION_CPU1);
462
463
464   for (i = 0; i < memory_region_length(REGION_CPU1); i++)
465   {
466      UINT8 data_xor;
467      int line = i & 0x07;
468
469      data_xor = (BIT(rom[i],xortable[line][0]) << xortable[line][1]) |
470               (BIT(rom[i],xortable[line][2]) << xortable[line][3]);
471
472      rom[i] ^= data_xor;
473   }
474}
475
476DRIVER_INIT( azurian )
477{
478   DRIVER_INIT_CALL(pisces);
479
480   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6800, 0x6800, 0, 0, azurian_IN1_r);
481   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7000, 0, 0, azurian_IN2_r);
482}
483
484DRIVER_INIT( 4in1 )
485{
486   offs_t i;
487   UINT8 *RAM = memory_region(REGION_CPU1);
488
489   /* Decrypt Program Roms */
490   for (i = 0; i < memory_region_length(REGION_CPU1); i++)
491      RAM[i] = RAM[i] ^ (i & 0xff);
492
493   /* games are banked at 0x0000 - 0x3fff */
494   memory_configure_bank(1, 0, 4, &RAM[0x10000], 0x4000);
495
496   _4in1_bank_w(machine, 0, 0); /* set the initial CPU bank */
497
498   state_save_register_global(_4in1_bank);
499}
500
501INTERRUPT_GEN( hunchbks_vh_interrupt )
502{
503   cpunum_set_input_line_and_vector(machine, 0,0,PULSE_LINE,0x03);
504}
505
506DRIVER_INIT( ladybugg )
507{
508/* Doesn't actually use the bank, but it mustn't have a coin lock! */
509memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0, galaxold_gfxbank_w);
510}
511
512DRIVER_INIT( gmgalax )
513{
514   /* games are banked at 0x0000 - 0x3fff */
515   UINT8 *RAM=memory_region(REGION_CPU1);
516   memory_configure_bank(1, 0, 2, &RAM[0x10000], 0x4000);
517
518   state_save_register_global(gmgalax_selected_game);
519
520   gmgalax_select_game(input_port_6_r(machine, 0) & 0x01);
521}
522
523INTERRUPT_GEN( gmgalax_vh_interrupt )
524{
525   // reset the cpu if the selected game changed
526   int new_game = input_port_6_r(machine, 0) & 0x01;
527
528   if (gmgalax_selected_game != new_game)
529   {
530      gmgalax_select_game(new_game);
531
532      /* Ghost Muncher never clears this */
533      galaxold_stars_enable_w(machine, 0, 0);
534
535      cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, ASSERT_LINE);
536   }
537}
src/mame/machine/harddriv.c
r2241r2242
679679
680680WRITE16_HANDLER( hd68k_duart_w )
681681{
682   if (ACCESSING_MSB)
682   if (ACCESSING_BITS_8_15)
683683   {
684684      int newdata = (data >> 8) & 0xff;
685685      duart_write_data[offset] = newdata;
src/mame/machine/psx.c
r2241r2242
854854      verboselog( 0, "psx_sio_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
855855      break;
856856   case 2:
857      if( ACCESSING_LSW32 )
857      if( ACCESSING_BITS_0_15 )
858858      {
859859         m_p_n_sio_mode[ n_port ] = data & 0xffff;
860860         verboselog( 1, "psx_sio_w %d mode %04x\n", n_port, data & 0xffff );
861861      }
862      if( ACCESSING_MSW32 )
862      if( ACCESSING_BITS_16_31 )
863863      {
864864         verboselog( 1, "psx_sio_w %d control %04x\n", n_port, data >> 16 );
865865         m_p_n_sio_control[ n_port ] = data >> 16;
r2241r2242
897897      }
898898      break;
899899   case 3:
900      if( ACCESSING_LSW32 )
900      if( ACCESSING_BITS_0_15 )
901901      {
902902         verboselog( 0, "psx_sio_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
903903      }
904      if( ACCESSING_MSW32 )
904      if( ACCESSING_BITS_16_31 )
905905      {
906906         m_p_n_sio_baud[ n_port ] = data >> 16;
907907         verboselog( 1, "psx_sio_w %d baud %04x\n", n_port, data >> 16 );
r2241r2242
930930      break;
931931   case 1:
932932      data = m_p_n_sio_status[ n_port ];
933      if( ACCESSING_LSW32 )
933      if( ACCESSING_BITS_0_15 )
934934      {
935935         verboselog( 1, "psx_sio_r %d status %04x\n", n_port, data & 0xffff );
936936      }
937      if( ACCESSING_MSW32 )
937      if( ACCESSING_BITS_16_31 )
938938      {
939939         verboselog( 0, "psx_sio_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
940940      }
941941      break;
942942   case 2:
943943      data = ( m_p_n_sio_control[ n_port ] << 16 ) | m_p_n_sio_mode[ n_port ];
944      if( ACCESSING_LSW32 )
944      if( ACCESSING_BITS_0_15 )
945945      {
946946         verboselog( 1, "psx_sio_r %d mode %04x\n", n_port, data & 0xffff );
947947      }
948      if( ACCESSING_MSW32 )
948      if( ACCESSING_BITS_16_31 )
949949      {
950950         verboselog( 1, "psx_sio_r %d control %04x\n", n_port, data >> 16 );
951951      }
952952      break;
953953   case 3:
954954      data = m_p_n_sio_baud[ n_port ] << 16;
955      if( ACCESSING_LSW32 )
955      if( ACCESSING_BITS_0_15 )
956956      {
957957         verboselog( 0, "psx_sio_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
958958      }
959      if( ACCESSING_MSW32 )
959      if( ACCESSING_BITS_16_31 )
960960      {
961961         verboselog( 1, "psx_sio_r %d baud %04x\n", n_port, data >> 16 );
962962      }
src/mame/machine/pgmprot.c
r2241r2242
392392
393393WRITE16_HANDLER( pgm_asic3_w )
394394{
395   if(ACCESSING_LSB)
395   if(ACCESSING_BITS_0_7)
396396   {
397397      if(asic3_reg < 3)
398398         asic3_latch[asic3_reg] = data << 1;
r2241r2242
421421
422422WRITE16_HANDLER( pgm_asic3_reg_w )
423423{
424   if(ACCESSING_LSB)
424   if(ACCESSING_BITS_0_7)
425425      asic3_reg = data & 0xff;
426426}
427427
src/mame/machine/wrally.c
r2241r2242
119119{
120120   UINT8 *RAM = memory_region(REGION_SOUND1);
121121
122   if (ACCESSING_LSB){
122   if (ACCESSING_BITS_0_7){
123123      memcpy(&RAM[0x30000], &RAM[0x40000 + (data & 0x0f)*0x10000], 0x10000);
124124   }
125125}
src/mame/mamedriv.c
r2241r2242
939939   DRIVER( dkongjrj )   /* (c) 1982 Nintendo */
940940   DRIVER( dkngjnrj )   /* (c) 1982 Nintendo */
941941   DRIVER( dkongjrb )   /* bootleg */
942   DRIVER( jrking )   /* bootleg */
942943   DRIVER( dkongjre )   /* (c) 1982 Nintendo of America */
943944   DRIVER( dkong3 )   /* (c) 1983 Nintendo of America */
944945   DRIVER( dkong3j )   /* (c) 1983 Nintendo */
r2241r2242
10811082   /* NES-based hacks */
10821083   DRIVER( multigam )   /* 1992 */
10831084   DRIVER( multigmb )   /* 1992 */
1085   DRIVER( multigm3 )  /* 19?? */
10841086   DRIVER( cham24 )   /* 2002 */
10851087
10861088   /* Nintendo Super System Games */
r2241r2242
18541856   DRIVER( undrfire )   /* D67 (c) 1993 Taito Coporation Japan (World) */
18551857   DRIVER( undrfiru )   /* D67 (c) 1993  Taito America Corporation (US) */
18561858   DRIVER( undrfirj )   /* D67 (c) 1993 Taito Coporation (Japan) */
1859   DRIVER( cbombers )
18571860
18581861   /* Taito F2 games */
18591862   DRIVER( finalb )   /* B82 (c) 1988 Taito Corporation Japan (World) */
r2241r2242
29322935   DRIVER( ddrs2kj )   /* 1999 - Dance Dance Revolution Solo 2000 (GC905 VER. JAA) */
29332936   DRIVER( dsfdct )   /* 1999 - Dancing Stage featuring Dreams Come True (GC910 VER. JCA) */
29342937   DRIVER( dsfdcta )   /* 1999 - Dancing Stage featuring Dreams Come True (GC910 VER. JAA) */
2935   DRIVER( drmn2m )   /* 1999 - DrumMania 2nd Mix (GE912 VER. JAA) */
2938   DRIVER( drmn2m )   /* 1999 - DrumMania 2nd Mix (GE912 VER. JAB) */
2939   DRIVER( drmn2mpu )   /* 1999 - DrumMania 2nd Mix Session Power Up Kit (GE912 VER. JAB) */
29362940   DRIVER( dncfrks )   /* 2000 - Dance Freaks (G*874 VER. KAA) */
29372941   DRIVER( dmx )      /* 2000 - Dance Maniax (G*874 VER. JAA) */
29382942   DRIVER( gtrfrk3m )   /* 2000 - Guitar Freaks 3rd Mix (GE949 VER. JAC) */
r2241r2242
47264730   DRIVER( dbz2 )      /* (c) 1994 Banpresto */
47274731   DRIVER( bishi )      /* GX575 (c) 1996 (Japan) */
47284732   DRIVER( sbishi )   /* GX675 (c) 1998 (Japan) */
4733   DRIVER( sbishik )   /* GX675 (c) 1998 (Korea) */
47294734
47304735   /* Konami dual 68000 games */
47314736   DRIVER( overdriv )   /* GX789 (c) 1990 */
r2241r2242
52775282   DRIVER( cyberbt1 )   /* 136073           (c) 1989 */
52785283
52795284   DRIVER( badlands )   /* 136074           (c) 1989 */
5285   DRIVER( badlandb )   /* bootleg */
52805286   DRIVER( klax )      /* 136075           (c) 1989 */
52815287   DRIVER( klax2 )      /* 136075           (c) 1989 */
52825288   DRIVER( klax3 )      /* 136075           (c) 1989 */
r2241r2242
54695475   DRIVER( burningh )   /* 0018 (c) 1991 SNK */
54705476   DRIVER( lbowling )   /* 0019 (c) 1990 SNK */
54715477   DRIVER( gpilots )   /* 0020 (c) 1991 SNK */
5478   DRIVER( gpilotsh )   /* 0020 (c) 1991 SNK */
54725479   DRIVER( joyjoy )   /* 0021 (c) 1990 SNK */
54735480   DRIVER( bjourney )   /* 0022 (c) 1990 Alpha Denshi Co. */
54745481   DRIVER( quizdais )   /* 0023 (c) 1991 SNK */
r2241r2242
54845491   DRIVER( socbrawl )   /* 0031 (c) 1991 SNK */
54855492   DRIVER( socbrala )   /* 0031 (c) 1991 SNK */
54865493   DRIVER( roboarmy )   /* 0032 (c) 1991 SNK */
5487   DRIVER( roboarma )   /* 0032 (c) 1991 SNK */
54885494   DRIVER( fatfury1 )   /* 0033 (c) 1991 SNK */
54895495   DRIVER( fbfrenzy )   /* 0034 (c) 1992 SNK */
54905496            /* 0035 Mystic Wand (prototype) 1991 Alpha */
r2241r2242
54985504   DRIVER( 3countb )   /* 0043 (c) 1993 SNK */
54995505   DRIVER( aof )      /* 0044 (c) 1992 SNK */
55005506   DRIVER( samsho )   /* 0045 (c) 1993 SNK */
5507   DRIVER( samshoh )   /* 0045 (c) 1993 SNK */
55015508   DRIVER( tophuntr )   /* 0046 (c) 1994 SNK */
55025509   DRIVER( tophunta )   /* 0046 (c) 1994 SNK */
55035510   DRIVER( fatfury2 )   /* 0047 (c) 1992 SNK */
r2241r2242
55655572   DRIVER( sonicwi3 )   /* 0097 (c) 1995 Video System Co. */
55665573            /* 0098 Idol Mahjong - final romance 2 (CD only? not confirmed, MVS might exist) */
55675574            /* 0099 Neo Pool Masters */
5568            /* 0160 Japanese MVS cart; No bootleg (c) 1997/1998 SNK */
5575            /* 0160 98 BEST 44 (c) 1997/1998 SNK */
55695576   DRIVER( turfmast )   /* 0200 (c) 1996 Nazca */
55705577   DRIVER( mslug )      /* 0201 (c) 1996 Nazca */
55715578   DRIVER( puzzledp )   /* 0202 (c) 1995 Taito (Visco license) */
r2241r2242
57925799   DRIVER( ddragnw1 )   /* TA-0021 (c) 1987 Taito */
57935800   DRIVER( ddragonb )   /* bootleg */
57945801   DRIVER( ddragnba )   /* bootleg */
5802   DRIVER( ddgn6809 )   /* bootleg */
57955803   DRIVER( spdodgeb )   /* TA-0022 (c) 1987 */
57965804   DRIVER( nkdodge )   /* TA-0022 (c) 1987 (Japan) */
57975805   DRIVER( nkdodgeb )   /* TA-0022 (c) 1987 (Japan) */
r2241r2242
59105918   DRIVER( strahl )   /* UPL-91074 (c) 1992 UPL (Japan) */
59115919   DRIVER( strahla )   /* UPL-91074 (c) 1992 UPL (Japan) */
59125920   DRIVER( bjtwin )   /* UPL-93087 (c) 1993 NMK */
5921   DRIVER( bjtwina )   /* UPL-93087 (c) 1993 NMK */
59135922   DRIVER( tdragon2 )   /* UPL-93091 (c) 1993 NMK */
59145923   DRIVER( tdragn2a )   /* UPL-93091 (c) 1993 NMK */
59155924   DRIVER( bigbang )   /* UPL-93091 (c) 1993 NMK */
r2241r2242
60316040   DRIVER( crusnw23 )   /* (c) 1996 Midway */
60326041   DRIVER( crusnw20 )   /* (c) 1996 Midway */
60336042   DRIVER( crusnw13 )   /* (c) 1996 Midway */
6034   DRIVER( offroadc )   /* (c) 1997 Midway */
6043   DRIVER( offroadc )   /* (c) 1997 Midway (v1.40) */
6044   DRIVER( offrodc3 )   /* (c) 1997 Midway (v1.30) */
6045   DRIVER( offrodc1 )   /* (c) 1997 Midway (v1.10) */
60356046   DRIVER( wargods )   /* (c) 1996 Midway */
60366047
60376048   /* Midway Zeus games */
r2241r2242
67146725   DRIVER( deerhunt )   /* (c) 2000 Sammy USA Corporation */
67156726   DRIVER( deerhuna )   /* (c) 2000 Sammy USA Corporation */
67166727   DRIVER( deerhunb )   /* (c) 2000 Sammy USA Corporation */
6728   DRIVER( deerhunc )   /* (c) 2000 Sammy USA Corporation */
67176729   DRIVER( turkhunt )   /* (c) 2001 Sammy USA Corporation */
67186730   DRIVER( wschamp )   /* (c) 2001 Sammy USA Corporation */
67196731   DRIVER( wschampa )   /* (c) 2001 Sammy USA Corporation */
r2241r2242
74397451   DRIVER( inquiztr )   /* 1989 BFM */
74407452   DRIVER( escounts )   /* 1990 BFM */
74417453   DRIVER( trebltop )   /* 1991 BFM */
7454   DRIVER( beeline )   /* 1991 BFM */
74427455   DRIVER( quizvadr )   /* 1991 BFM */
74437456   DRIVER( qos )      /* 1992 BFM */
74447457   DRIVER( qosa )      /* 1992 BFM */
r2241r2242
74877500   DRIVER( skattva )   /* (c) 1995 */
74887501   DRIVER( fashiong )   /* (c) 1997 */
74897502
7490   /* JMP Impact Games */
7503   /* JPM Give us a Break hardware */
7504   DRIVER( guab )      /* (c) 1986 */
7505   DRIVER( guab3 )      /* (c) 1986 */
7506   DRIVER( tenup )      /* (c) 1988 */
7507   DRIVER( tenup3 )   /* (c) 1988 */
7508
7509   /* JPM Impact Games */
74917510   DRIVER( cluedo )   /* (c) 1995 */
74927511   DRIVER( cluedo2c )   /* (c) 1995 */
74937512   DRIVER( cluedo2 )   /* (c) 1995 */
r2241r2242
80058024   DRIVER( vcombat )   /* (c) 1993 VR8 Inc. */
80068025   DRIVER( shadfgtr )  /* (c) 1989 Sega? */
80078026
8027   /* Astro Corp. */
8028   DRIVER( showhand )
8029
80088030#endif   /* DRIVER_RECURSIVE */
src/mame/includes/galaxian.h
r2241r2242
11/***************************************************************************
22
3  Galaxian hardware family
3    Galaxian hardware family
44
5  This include file is used by the following drivers:
6    - galaxian.c
7    - scramble.c
8    - scobra.c
9    - frogger.c
10    - amidar.c
11
125***************************************************************************/
136
14/*----------- defined in video/galaxian.c -----------*/
7/* we scale horizontally by 3 to render stars correctly */
8#define GALAXIAN_XSCALE         3
159
16extern UINT8 *galaxian_videoram;
17extern UINT8 *galaxian_spriteram;
18extern UINT8 *galaxian_spriteram2;
19extern UINT8 *galaxian_attributesram;
20extern UINT8 *galaxian_bulletsram;
21extern UINT8 *rockclim_videoram;
22extern UINT8 *racknrol_tiles_bank;
10/* master clocks */
11#define GALAXIAN_MASTER_CLOCK   (18432000)
12#define GALAXIAN_PIXEL_CLOCK   (GALAXIAN_XSCALE*GALAXIAN_MASTER_CLOCK/3)
2313
14/* H counts from 128->511, HBLANK starts at 130 and ends at 250 */
15/* we normalize this here so that we count 0->383 with HBLANK */
16/* from 264-383 */
17#define GALAXIAN_HTOTAL         (384*GALAXIAN_XSCALE)
18#define GALAXIAN_HBEND         (0*GALAXIAN_XSCALE)
19//#define GALAXIAN_H0START      (6*GALAXIAN_XSCALE)
20//#define GALAXIAN_HBSTART      (264*GALAXIAN_XSCALE)
21#define GALAXIAN_H0START      (0*GALAXIAN_XSCALE)
22#define GALAXIAN_HBSTART      (256*GALAXIAN_XSCALE)
2423
25extern size_t galaxian_spriteram_size;
26extern size_t galaxian_spriteram2_size;
27extern size_t galaxian_bulletsram_size;
24#define GALAXIAN_VTOTAL         (264)
25#define GALAXIAN_VBEND         (16)
26#define GALAXIAN_VBSTART      (224+16)
2827
28
29/*----------- defined in video/galaxian.c -----------*/
30
31extern UINT8 galaxian_frogger_adjust;
32extern UINT8 galaxian_sfx_tilemap;
33extern UINT8 galaxian_sprite_clip_start;
34extern UINT8 galaxian_sprite_clip_end;
35
2936PALETTE_INIT( galaxian );
30PALETTE_INIT( scramble );
31PALETTE_INIT( turtles );
32PALETTE_INIT( moonwar );
33PALETTE_INIT( darkplnt );
34PALETTE_INIT( rescue );
35PALETTE_INIT( minefld );
36PALETTE_INIT( stratgyx );
37PALETTE_INIT( mariner );
38PALETTE_INIT( frogger );
39PALETTE_INIT( rockclim );
4037
38VIDEO_START( galaxian );
39VIDEO_UPDATE( galaxian );
40
4141WRITE8_HANDLER( galaxian_videoram_w );
42READ8_HANDLER( galaxian_videoram_r );
42WRITE8_HANDLER( galaxian_objram_w );
4343
44WRITE8_HANDLER( rockclim_videoram_w );
45WRITE8_HANDLER( rockclim_scroll_w );
46READ8_HANDLER( rockclim_videoram_r );
44WRITE8_HANDLER( galaxian_flip_screen_x_w );
45WRITE8_HANDLER( galaxian_flip_screen_y_w );
46WRITE8_HANDLER( galaxian_flip_screen_xy_w );
4747
48WRITE8_HANDLER( galaxian_attributesram_w );
49
5048WRITE8_HANDLER( galaxian_stars_enable_w );
5149WRITE8_HANDLER( scramble_background_enable_w );
5250WRITE8_HANDLER( scramble_background_red_w );
5351WRITE8_HANDLER( scramble_background_green_w );
5452WRITE8_HANDLER( scramble_background_blue_w );
55WRITE8_HANDLER( hotshock_flip_screen_w );
56WRITE8_HANDLER( darkplnt_bullet_color_w );
57WRITE8_HANDLER( racknrol_tiles_bank_w );
5853
59VIDEO_START( galaxian_plain );
60VIDEO_START( galaxian );
61VIDEO_START( gmgalax );
62VIDEO_START( mooncrst );
63VIDEO_START( mooncrgx );
64VIDEO_START( moonqsr );
65VIDEO_START( mshuttle );
66VIDEO_START( pisces );
67VIDEO_START( gteikob2 );
68VIDEO_START( batman2 );
69VIDEO_START( jumpbug );
70VIDEO_START( azurian );
71VIDEO_START( dkongjrm );
72VIDEO_START( scramble );
73VIDEO_START( theend );
74VIDEO_START( darkplnt );
75VIDEO_START( rescue );
76VIDEO_START( minefld );
77VIDEO_START( calipso );
78VIDEO_START( stratgyx );
79VIDEO_START( mimonkey );
80VIDEO_START( turtles );
81VIDEO_START( frogger );
82VIDEO_START( mariner );
83VIDEO_START( ckongs );
84VIDEO_START( froggers );
85VIDEO_START( newsin7 );
86VIDEO_START( sfx );
87VIDEO_START( rockclim );
88VIDEO_START( drivfrcg );
89VIDEO_START( bongo );
90VIDEO_START( scorpion );
91VIDEO_START( racknrol );
92VIDEO_START( ad2083 );
93
94VIDEO_UPDATE( galaxian );
95
9654WRITE8_HANDLER( galaxian_gfxbank_w );
97WRITE8_HANDLER( galaxian_flip_screen_x_w );
98WRITE8_HANDLER( galaxian_flip_screen_y_w );
99WRITE8_HANDLER( gteikob2_flip_screen_x_w );
100WRITE8_HANDLER( gteikob2_flip_screen_y_w );
10155
56TIMER_CALLBACK( galaxian_stars_blink_timer );
10257
103/*----------- defined in machine/galaxian.c -----------*/
58/* video extension callbacks */
59typedef void (*galaxian_extend_tile_info_func)(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x);
60typedef void (*galaxian_extend_sprite_info_func)(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color);
61typedef void (*galaxian_draw_bullet_func)(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
62typedef void (*galaxian_draw_background_func)(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
10463
105DRIVER_INIT( zigzag );
106DRIVER_INIT( pisces );
107DRIVER_INIT( checkmaj );
108DRIVER_INIT( dingo );
109DRIVER_INIT( dingoe );
110DRIVER_INIT( kingball );
111DRIVER_INIT( mooncrsu );
112DRIVER_INIT( mooncrst );
113DRIVER_INIT( mooncrgx );
114DRIVER_INIT( moonqsr );
115DRIVER_INIT( checkman );
116DRIVER_INIT( gteikob2 );
117DRIVER_INIT( azurian );
118DRIVER_INIT( 4in1 );
119DRIVER_INIT( ladybugg );
120DRIVER_INIT( gmgalax );
64extern galaxian_extend_tile_info_func galaxian_extend_tile_info_ptr;
65extern galaxian_extend_sprite_info_func galaxian_extend_sprite_info_ptr;
66extern galaxian_draw_bullet_func galaxian_draw_bullet_ptr;
67extern galaxian_draw_background_func galaxian_draw_background_ptr;
12168
122WRITE8_HANDLER( galaxian_nmi_enable_w );
69/* special purpose background rendering */
70void galaxian_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
71void frogger_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
72void amidar_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
73void turtles_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
74void scramble_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
75void jumpbug_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
12376
124MACHINE_RESET( galaxian );
125MACHINE_RESET( devilfsg );
77/* special purpose bullet rendering */
78void galaxian_draw_bullet(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
79void mshuttle_draw_bullet(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
80void scramble_draw_bullet(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
81void theend_draw_bullet(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
12682
127WRITE8_HANDLER( galaxian_coin_lockout_w );
128WRITE8_HANDLER( galaxian_coin_counter_w );
129#define galaxian_coin_counter_0_w galaxian_coin_counter_w
130WRITE8_HANDLER( galaxian_coin_counter_1_w );
131WRITE8_HANDLER( galaxian_coin_counter_2_w );
132WRITE8_HANDLER( galaxian_leds_w );
83/* generic extensions */
84void upper_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x);
85void upper_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color);
13386
134READ8_HANDLER( scramblb_protection_1_r );
135READ8_HANDLER( scramblb_protection_2_r );
87/* Frogger extensions */
88void frogger_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x);
89void frogger_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color);
13690
137READ8_HANDLER( jumpbug_protection_r );
91/* Ghostmuncher Galaxian extensions */
92void gmgalax_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x);
93void gmgalax_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color);
13894
139WRITE8_HANDLER( kingball_speech_dip_w );
140WRITE8_HANDLER( kingball_sound1_w );
141WRITE8_HANDLER( kingball_sound2_w );
95/* Pisces extensions */
96void pisces_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x);
97void pisces_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color);
14298
143WRITE8_HANDLER( _4in1_bank_w );
144READ8_HANDLER( _4in1_input_port_1_r );
145READ8_HANDLER( _4in1_input_port_2_r );
99/* Batman Part 2 extensions */
100void batman2_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x);
101void batman2_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color);
146102
147WRITE8_HANDLER( zigzag_sillyprotection_w );
103/* Moon Cresta extensions */
104void mooncrst_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x);
105void mooncrst_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color);
148106
149INTERRUPT_GEN( hunchbks_vh_interrupt );
150INTERRUPT_GEN( gmgalax_vh_interrupt );
107/* Moon Quasar extensions */
108void moonqsr_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x);
109void moonqsr_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color);
151110
152READ8_HANDLER( gmgalax_input_port_0_r );
153READ8_HANDLER( gmgalax_input_port_1_r );
154READ8_HANDLER( gmgalax_input_port_2_r );
111/* Moon Shuttle extensions */
112void mshuttle_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x);
113void mshuttle_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color);
155114
115/* Jumpbug extensions */
116void jumpbug_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x);
117void jumpbug_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color);
156118
157/*----------- defined in machine/scramble.c -----------*/
158119
159DRIVER_INIT( scramble_ppi );
160DRIVER_INIT( amidar );
161DRIVER_INIT( frogger );
162DRIVER_INIT( froggers );
163DRIVER_INIT( scobra );
164DRIVER_INIT( stratgyx );
165DRIVER_INIT( moonwar );
166DRIVER_INIT( darkplnt );
167DRIVER_INIT( tazmani2 );
168DRIVER_INIT( anteater );
169DRIVER_INIT( rescue );
170DRIVER_INIT( minefld );
171DRIVER_INIT( losttomb );
172DRIVER_INIT( superbon );
173DRIVER_INIT( hustler );
174DRIVER_INIT( billiard );
175DRIVER_INIT( mimonkey );
176DRIVER_INIT( mimonsco );
177DRIVER_INIT( atlantis );
178DRIVER_INIT( scramble );
179DRIVER_INIT( scrambls );
180DRIVER_INIT( theend );
181DRIVER_INIT( ckongs );
182DRIVER_INIT( mariner );
183DRIVER_INIT( mars );
184DRIVER_INIT( devilfsh );
185DRIVER_INIT( hotshock );
186DRIVER_INIT( cavelon );
187DRIVER_INIT( mrkougar );
188DRIVER_INIT( mrkougb );
189DRIVER_INIT( mimonscr );
190DRIVER_INIT( sfx );
191DRIVER_INIT( monsterz );
192DRIVER_INIT( scorpion );
193DRIVER_INIT( ad2083 );
194120
195MACHINE_RESET( scramble );
196MACHINE_RESET( sfx );
197MACHINE_RESET( monsterz );
198MACHINE_RESET( explorer );
199
200READ8_HANDLER( triplep_pip_r );
201READ8_HANDLER( triplep_pap_r );
202
203READ8_HANDLER( hunchbks_mirror_r );
204WRITE8_HANDLER( hunchbks_mirror_w );
205
206
207
208121/*----------- defined in audio/galaxian.c -----------*/
209122
210extern const struct Samplesinterface galaxian_samples_interface;
123extern const struct Samplesinterface galaxian_custom_interface;
124WRITE8_HANDLER( galaxian_sound_w );
211125WRITE8_HANDLER( galaxian_pitch_w );
212126WRITE8_HANDLER( galaxian_vol_w );
213127WRITE8_HANDLER( galaxian_noise_enable_w );
214128WRITE8_HANDLER( galaxian_background_enable_w );
215129WRITE8_HANDLER( galaxian_shoot_enable_w );
216130WRITE8_HANDLER( galaxian_lfo_freq_w );
217
218
219/*----------- defined in audio/scramble.c -----------*/
220
221void scramble_sh_init(void);
222void sfx_sh_init(void);
223
224WRITE8_HANDLER( scramble_filter_w );
225WRITE8_HANDLER( frogger_filter_w );
226
227READ8_HANDLER( scramble_portB_r );
228READ8_HANDLER( frogger_portB_r );
229
230READ8_HANDLER( hotshock_soundlatch_r );
231
232WRITE8_HANDLER( scramble_sh_irqtrigger_w );
233WRITE8_HANDLER( sfx_sh_irqtrigger_w );
234WRITE8_HANDLER( mrkougar_sh_irqtrigger_w );
235WRITE8_HANDLER( froggrmc_sh_irqtrigger_w );
236WRITE8_HANDLER( hotshock_sh_irqtrigger_w );
237
238MACHINE_DRIVER_EXTERN( ad2083_audio );
239
src/mame/includes/cidelsa.h
r0r2242
1#ifndef __CIDELSA__
2#define __CIDELSA__
3
4#include "video/cdp1869.h"
5
6#define DESTRYER_CHR1   3579000.0 // unverified
7#define DESTRYER_CHR2   XTAL_5_7143MHz
8#define ALTAIR_CHR1      3579000.0 // unverified
9#define ALTAIR_CHR2      CDP1869_DOT_CLK_PAL // unverified
10#define DRACO_CHR1      XTAL_4_43361MHz
11#define DRACO_CHR2      CDP1869_DOT_CLK_PAL // unverified
12#define DRACO_SND_CHR1   XTAL_2_01216MHz
13
14typedef struct _cidelsa_state cidelsa_state;
15
16struct _cidelsa_state
17{
18   int cdp1802_mode;
19   int cdp1802_q;
20
21   int cdp1869_prd;
22   int cdp1869_pcb;
23
24   int draco_sound;
25   int draco_ay_latch;
26
27   UINT8 *pageram;
28   UINT8 *pcbram;
29   UINT8 *charram;
30};
31
32/*----------- defined in video/cidelsa.c -----------*/
33
34MACHINE_DRIVER_EXTERN( destryer_video );
35MACHINE_DRIVER_EXTERN( altair_video );
36MACHINE_DRIVER_EXTERN( draco_video );
37
38#endif
src/mame/includes/vertigo.h
r2241r2242
66
77/*----------- defined in machine/vertigo.c -----------*/
88
9extern const struct pit8253_config vertigo_pit8254_config;
10
911READ16_HANDLER( vertigo_io_convert );
1012READ16_HANDLER( vertigo_io_adc );
1113READ16_HANDLER( vertigo_coin_r );
src/mame/includes/tx1.h
r2241r2242
5353MACHINE_START( buggyboy );
5454
5555/*----------- defined in audio/tx1.c -----------*/
56READ8_HANDLER( pit8253_r );
57WRITE8_HANDLER( pit8253_w );
56READ8_HANDLER( tx1_pit8253_r );
57WRITE8_HANDLER( tx1_pit8253_w );
5858
5959WRITE8_HANDLER( bb_ym1_a_w );
6060WRITE8_HANDLER( bb_ym1_b_w );
src/mame/includes/cclimber.h
r2241r2242
22
33DRIVER_INIT( cclimber );
44DRIVER_INIT( cclimbrj );
5DRIVER_INIT( mshuttle );
5void cclimbrj_decode(void);
6void mshuttle_decode(void);
67DRIVER_INIT( cannonb );
78DRIVER_INIT( cannonb2 );
89DRIVER_INIT( ckongb );
src/mame/includes/galaxold.h
r0r2242
1/***************************************************************************
2
3  Galaxian hardware family
4
5  This include file is used by the following drivers:
6    - galaxian.c
7    - scramble.c
8    - scobra.c
9    - frogger.c
10    - amidar.c
11
12***************************************************************************/
13
14/*----------- defined in video/galaxian.c -----------*/
15
16extern UINT8 *galaxold_videoram;
17extern UINT8 *galaxold_spriteram;
18extern UINT8 *galaxold_spriteram2;
19extern UINT8 *galaxold_attributesram;
20extern UINT8 *galaxold_bulletsram;
21extern UINT8 *rockclim_videoram;
22extern UINT8 *racknrol_tiles_bank;
23
24
25extern size_t galaxold_spriteram_size;
26extern size_t galaxold_spriteram2_size;
27extern size_t galaxold_bulletsram_size;
28
29PALETTE_INIT( galaxold );
30PALETTE_INIT( scrambold );
31PALETTE_INIT( moonwar );
32PALETTE_INIT( darkplnt );
33PALETTE_INIT( rescue );
34PALETTE_INIT( minefld );
35PALETTE_INIT( stratgyx );
36PALETTE_INIT( mariner );
37PALETTE_INIT( rockclim );
38PALETTE_INIT( turtles );
39
40WRITE8_HANDLER( galaxold_videoram_w );
41READ8_HANDLER( galaxold_videoram_r );
42
43WRITE8_HANDLER( rockclim_videoram_w );
44WRITE8_HANDLER( rockclim_scroll_w );
45READ8_HANDLER( rockclim_videoram_r );
46
47WRITE8_HANDLER( galaxold_attributesram_w );
48
49WRITE8_HANDLER( galaxold_stars_enable_w );
50WRITE8_HANDLER( scrambold_background_enable_w );
51WRITE8_HANDLER( scrambold_background_red_w );
52WRITE8_HANDLER( scrambold_background_green_w );
53WRITE8_HANDLER( scrambold_background_blue_w );
54WRITE8_HANDLER( hotshock_flip_screen_w );
55WRITE8_HANDLER( darkplnt_bullet_color_w );
56WRITE8_HANDLER( racknrol_tiles_bank_w );
57
58VIDEO_START( galaxold_plain );
59VIDEO_START( galaxold );
60VIDEO_START( mooncrst );
61VIDEO_START( mooncrgx );
62VIDEO_START( moonqsr );
63VIDEO_START( mshuttle );
64VIDEO_START( pisces );
65VIDEO_START( batman2 );
66VIDEO_START( jumpbug );
67VIDEO_START( azurian );
68VIDEO_START( dkongjrm );
69VIDEO_START( scrambold );
70VIDEO_START( theend );
71VIDEO_START( darkplnt );
72VIDEO_START( rescue );
73VIDEO_START( minefld );
74VIDEO_START( calipso );
75VIDEO_START( stratgyx );
76VIDEO_START( mimonkey );
77VIDEO_START( turtles );
78VIDEO_START( frogger );
79VIDEO_START( mariner );
80VIDEO_START( ckongs );
81VIDEO_START( froggers );
82VIDEO_START( newsin7 );
83VIDEO_START( sfx );
84VIDEO_START( rockclim );
85VIDEO_START( drivfrcg );
86VIDEO_START( bongo );
87VIDEO_START( scorpion );
88VIDEO_START( racknrol );
89VIDEO_START( ad2083 );
90
91VIDEO_UPDATE( galaxold );
92
93WRITE8_HANDLER( galaxold_gfxbank_w );
94WRITE8_HANDLER( galaxold_flip_screen_x_w );
95WRITE8_HANDLER( galaxold_flip_screen_y_w );
96WRITE8_HANDLER( gteikob2_flip_screen_x_w );
97WRITE8_HANDLER( gteikob2_flip_screen_y_w );
98
99
100/*----------- defined in machine/galaxian.c -----------*/
101
102DRIVER_INIT( zigzag );
103DRIVER_INIT( pisces );
104DRIVER_INIT( checkmaj );
105DRIVER_INIT( dingo );
106DRIVER_INIT( dingoe );
107DRIVER_INIT( kingball );
108DRIVER_INIT( mooncrsu );
109DRIVER_INIT( mooncrst );
110DRIVER_INIT( mooncrgx );
111DRIVER_INIT( moonqsr );
112DRIVER_INIT( checkman );
113DRIVER_INIT( azurian );
114DRIVER_INIT( 4in1 );
115DRIVER_INIT( ladybugg );
116DRIVER_INIT( gmgalax );
117
118WRITE8_HANDLER( galaxold_nmi_enable_w );
119
120MACHINE_RESET( galaxold );
121MACHINE_RESET( devilfsg );
122
123WRITE8_HANDLER( galaxold_coin_lockout_w );
124WRITE8_HANDLER( galaxold_coin_counter_w );
125#define galaxold_coin_counter_0_w galaxold_coin_counter_w
126WRITE8_HANDLER( galaxold_coin_counter_1_w );
127WRITE8_HANDLER( galaxold_coin_counter_2_w );
128WRITE8_HANDLER( galaxold_leds_w );
129
130READ8_HANDLER( scramblb_protection_1_r );
131READ8_HANDLER( scramblb_protection_2_r );
132
133READ8_HANDLER( jumpbug_protection_r );
134
135WRITE8_HANDLER( kingball_speech_dip_w );
136WRITE8_HANDLER( kingball_sound1_w );
137WRITE8_HANDLER( kingball_sound2_w );
138
139WRITE8_HANDLER( _4in1_bank_w );
140READ8_HANDLER( _4in1_input_port_1_r );
141READ8_HANDLER( _4in1_input_port_2_r );
142
143WRITE8_HANDLER( zigzag_sillyprotection_w );
144
145INTERRUPT_GEN( hunchbks_vh_interrupt );
146INTERRUPT_GEN( gmgalax_vh_interrupt );
147
148READ8_HANDLER( gmgalax_input_port_0_r );
149READ8_HANDLER( gmgalax_input_port_1_r );
150READ8_HANDLER( gmgalax_input_port_2_r );
151
152
153/*----------- defined in machine/scramble.c -----------*/
154
155DRIVER_INIT( scramble_ppi );
156DRIVER_INIT( amidar );
157DRIVER_INIT( frogger );
158DRIVER_INIT( froggers );
159DRIVER_INIT( scobra );
160DRIVER_INIT( stratgyx );
161DRIVER_INIT( moonwar );
162DRIVER_INIT( darkplnt );
163DRIVER_INIT( tazmani2 );
164DRIVER_INIT( anteater );
165DRIVER_INIT( rescue );
166DRIVER_INIT( minefld );
167DRIVER_INIT( losttomb );
168DRIVER_INIT( superbon );
169DRIVER_INIT( hustler );
170DRIVER_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 );
183DRIVER_INIT( mrkougar );
184DRIVER_INIT( mrkougb );
185DRIVER_INIT( mimonscr );
186DRIVER_INIT( sfx );
187DRIVER_INIT( monsterz );
188DRIVER_INIT( scorpion );
189DRIVER_INIT( ad2083 );
190
191MACHINE_RESET( scramble );
192MACHINE_RESET( sfx );
193MACHINE_RESET( monsterz );
194MACHINE_RESET( explorer );
195
196READ8_HANDLER( triplep_pip_r );
197READ8_HANDLER( triplep_pap_r );
198
199READ8_HANDLER( hunchbks_mirror_r );
200WRITE8_HANDLER( hunchbks_mirror_w );
201
202
203
204/*----------- defined in audio/galaxian.c -----------*/
205
206extern const struct Samplesinterface galaxian_samples_interface;
207WRITE8_HANDLER( galaxian_pitch_w );
208WRITE8_HANDLER( galaxian_vol_w );
209WRITE8_HANDLER( galaxian_noise_enable_w );
210WRITE8_HANDLER( galaxian_background_enable_w );
211WRITE8_HANDLER( galaxian_shoot_enable_w );
212WRITE8_HANDLER( galaxian_lfo_freq_w );
213
214
215/*----------- defined in audio/scramble.c -----------*/
216
217void scramble_sh_init(void);
218void sfx_sh_init(void);
219
220WRITE8_HANDLER( scramble_filter_w );
221WRITE8_HANDLER( frogger_filter_w );
222
223READ8_HANDLER( scramble_portB_r );
224READ8_HANDLER( frogger_portB_r );
225
226READ8_HANDLER( hotshock_soundlatch_r );
227
228WRITE8_HANDLER( scramble_sh_irqtrigger_w );
229WRITE8_HANDLER( sfx_sh_irqtrigger_w );
230WRITE8_HANDLER( mrkougar_sh_irqtrigger_w );
231WRITE8_HANDLER( froggrmc_sh_irqtrigger_w );
232WRITE8_HANDLER( hotshock_sh_irqtrigger_w );
233
234MACHINE_DRIVER_EXTERN( ad2083_audio );
235
src/mame/mame.mak
r2241r2242
345345   $(MAMEOBJ)/irem.a \
346346   $(MAMEOBJ)/itech.a \
347347   $(MAMEOBJ)/jaleco.a \
348   $(MAMEOBJ)/jpm.a \
348349   $(MAMEOBJ)/kaneko.a \
349350   $(MAMEOBJ)/konami.a \
350351   $(MAMEOBJ)/meadows.a \
r2241r2242
802803   $(DRIVERS)/stepstag.o \
803804   $(DRIVERS)/tetrisp2.o $(VIDEO)/tetrisp2.o \
804805
806$(MAMEOBJ)/jpm.a: \
807   $(DRIVERS)/guab.o \
808   $(DRIVERS)/jpmimpct.o $(VIDEO)/jpmimpct.o \
809
805810$(MAMEOBJ)/kaneko.a: \
806811   $(DRIVERS)/airbustr.o $(VIDEO)/airbustr.o \
807812   $(DRIVERS)/djboy.o $(VIDEO)/djboy.o \
r2241r2242
818823   $(DRIVERS)/88games.o $(VIDEO)/88games.o \
819824   $(DRIVERS)/ajax.o $(MACHINE)/ajax.o $(VIDEO)/ajax.o \
820825   $(DRIVERS)/aliens.o $(VIDEO)/aliens.o \
821   $(DRIVERS)/amidar.o \
822826   $(DRIVERS)/asterix.o $(VIDEO)/asterix.o \
823827   $(DRIVERS)/battlnts.o $(VIDEO)/battlnts.o \
824828   $(DRIVERS)/bishi.o $(VIDEO)/bishi.o \
r2241r2242
838842   $(DRIVERS)/finalizr.o $(VIDEO)/finalizr.o \
839843   $(DRIVERS)/firebeat.o \
840844   $(DRIVERS)/flkatck.o $(VIDEO)/flkatck.o \
841   $(DRIVERS)/frogger.o \
842845   $(DRIVERS)/gberet.o $(VIDEO)/gberet.o \
843846   $(DRIVERS)/gbusters.o $(VIDEO)/gbusters.o \
844847   $(DRIVERS)/gijoe.o $(VIDEO)/gijoe.o \
r2241r2242
961964   $(DRIVERS)/baraduke.o $(VIDEO)/baraduke.o \
962965   $(DRIVERS)/dambustr.o \
963966   $(DRIVERS)/galaga.o $(AUDIO)/galaga.o $(VIDEO)/galaga.o \
964   $(DRIVERS)/galaxian.o $(MACHINE)/galaxian.o $(AUDIO)/galaxian.o $(VIDEO)/galaxian.o \
967   $(DRIVERS)/galaxian.o $(AUDIO)/galaxian.o $(VIDEO)/galaxian.o \
968   $(DRIVERS)/galaxold.o $(MACHINE)/galaxold.o $(VIDEO)/galaxold.o \
965969   $(DRIVERS)/gaplus.o $(MACHINE)/gaplus.o $(VIDEO)/gaplus.o \
966970   $(DRIVERS)/mappy.o $(VIDEO)/mappy.o \
967971   $(DRIVERS)/namcofl.o $(VIDEO)/namcofl.o \
r2241r2242
15021506   $(DRIVERS)/ampoker2.o $(VIDEO)/ampoker2.o \
15031507   $(DRIVERS)/amspdwy.o $(VIDEO)/amspdwy.o \
15041508   $(DRIVERS)/artmagic.o $(VIDEO)/artmagic.o \
1509   $(DRIVERS)/astrocorp.o \
15051510   $(DRIVERS)/attckufo.o $(AUDIO)/attckufo.o $(VIDEO)/attckufo.o \
15061511   $(DRIVERS)/aztarac.o $(AUDIO)/aztarac.o $(VIDEO)/aztarac.o \
15071512   $(DRIVERS)/beaminv.o \
r2241r2242
15101515   $(DRIVERS)/carrera.o \
15111516   $(DRIVERS)/cave.o $(VIDEO)/cave.o \
15121517   $(DRIVERS)/cherrym.o \
1513   $(DRIVERS)/cidelsa.o \
1518   $(DRIVERS)/cidelsa.o $(VIDEO)/cidelsa.o \
15141519   $(DRIVERS)/coinmstr.o \
15151520   $(DRIVERS)/comebaby.o \
15161521   $(DRIVERS)/coolpool.o \
r2241r2242
15531558   $(DRIVERS)/istellar.o \
15541559   $(DRIVERS)/jackpool.o \
15551560   $(DRIVERS)/jongkyo.o \
1556   $(DRIVERS)/jpmimpct.o $(VIDEO)/jpmimpct.o \
15571561   $(DRIVERS)/kingpin.o \
15581562   $(DRIVERS)/koikoi.o \
15591563   $(DRIVERS)/kyugo.o $(VIDEO)/kyugo.o \
r2241r2242
16641668
16651669$(DRIVERS)/cardline.o:   $(LAYOUT)/cardline.lh
16661670
1667$(DRIVERS)/cinemat.o:   $(LAYOUT)/solarq.lh \
1671$(DRIVERS)/cinemat.o:   $(LAYOUT)/armora.lh \
1672                  $(LAYOUT)/solarq.lh \
16681673                  $(LAYOUT)/starcas.lh
16691674
16701675$(DRIVERS)/circus.o:   $(LAYOUT)/circus.lh \
r2241r2242
17401745# misc dependencies
17411746#-------------------------------------------------
17421747
1748$(DRIVERS)/galaxian.o:   $(MAMESRC)/drivers/galdrvr.c
1749$(DRIVERS)/mpu4.o:      $(MAMESRC)/drivers/mpu4drvr.c
17431750$(DRIVERS)/neogeo.o:   $(MAMESRC)/drivers/neodrvr.c
1744$(DRIVERS)/mpu4.o:      $(MAMESRC)/drivers/mpu4drvr.c
src/mame/video/dynduke.c
r2241r2242
9393{
9494   static int old_back,old_fore;
9595
96   if (ACCESSING_LSB)
96   if (ACCESSING_BITS_0_7)
9797   {
9898      if (data&0x01) back_bankbase=0x1000; else back_bankbase=0;
9999      if (data&0x10) fore_bankbase=0x1000; else fore_bankbase=0;
r2241r2242
112112WRITE16_HANDLER( dynduke_control_w )
113113{
114114
115   if (ACCESSING_LSB)
115   if (ACCESSING_BITS_0_7)
116116   {
117117      // bit 0x80 toggles, maybe sprite buffering?
118118      // bit 0x40 is flipscreen
src/mame/video/aerofgt.c
r2241r2242
193193
194194WRITE16_HANDLER( pspikes_gfxbank_w )
195195{
196   if (ACCESSING_LSB)
196   if (ACCESSING_BITS_0_7)
197197   {
198198      setbank(bg1_tilemap,0,(data & 0xf0) >> 4);
199199      setbank(bg1_tilemap,1,data & 0x0f);
r2241r2242
210210
211211WRITE16_HANDLER( karatblz_gfxbank_w )
212212{
213   if (ACCESSING_MSB)
213   if (ACCESSING_BITS_8_15)
214214   {
215215      setbank(bg1_tilemap,0,(data & 0x0100) >> 8);
216216      setbank(bg2_tilemap,1,(data & 0x0800) >> 11);
r2241r2242
219219
220220WRITE16_HANDLER( spinlbrk_gfxbank_w )
221221{
222   if (ACCESSING_LSB)
222   if (ACCESSING_BITS_0_7)
223223   {
224224      setbank(bg1_tilemap,0,(data & 0x07));
225225      setbank(bg2_tilemap,1,(data & 0x38) >> 3);
r2241r2242
272272
273273WRITE16_HANDLER( pspikes_palette_bank_w )
274274{
275   if (ACCESSING_LSB)
275   if (ACCESSING_BITS_0_7)
276276   {
277277      spritepalettebank = data & 0x03;
278278      if (charpalettebank != (data & 0x1c) >> 2)
r2241r2242
479479static void aerfboot_draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
480480{
481481   int attr_start;//,base,first;
482//  int notdraw = 0;
482483
483
484484//  base = chip * 0x0200;
485485//  first = 4 * aerofgt_spriteram3[0x1fe + base];
486486
487   for (attr_start = aerofgt_spriteram3_size/2 - 4;attr_start >= 0;attr_start -= 4)
487   for (attr_start = aerofgt_spriteram3_size/2 - 4 /* - 16 */;attr_start >= 0;attr_start -= 4)
488488   {
489489      int code;
490      int ox,oy,x,y,xsize,ysize,zoomx,zoomy,flipx,flipy,color,pri;
490      int ox,oy,sx,sy,zoomx,zoomy,flipx,flipy,color,pri;
491491// some other drivers still use this wrong table, they have to be upgraded
492492//      int zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 };
493493
r2241r2242
497497      flipy = aerofgt_spriteram3[attr_start + 2] & 0x8000;
498498      color = aerofgt_spriteram3[attr_start + 2] & 0x000f;
499499
500//      xsize = (aerofgt_spriteram3[attr_start + 2] & 0x0700) >> 8;
501      xsize = (aerofgt_spriteram3[attr_start + 1] & 0x0e00) >> 9;
502500      zoomx = (aerofgt_spriteram3[attr_start + 1] & 0xf000) >> 12;
503//      ysize = (aerofgt_spriteram3[attr_start + 2] & 0x7000) >> 12;
504      ysize = (aerofgt_spriteram3[attr_start + 0] & 0x0e00) >> 9;
505501      zoomy = (aerofgt_spriteram3[attr_start + 0] & 0xf000) >> 12;
506
507502      pri = aerofgt_spriteram3[attr_start + 2] & 0x0010;
508      code = aerofgt_spriteram3[attr_start + 3] & 0x3fff;
503//      code = aerofgt_spriteram3[attr_start + 3] & 0x3fff;
504      code = aerofgt_spriteram3[attr_start + 3] & 0x1fff;
509505
506//      if ((!(aerofgt_spriteram3[attr_start + 0])) & (!(aerofgt_spriteram3[attr_start + 1])) &
507//          (!(aerofgt_spriteram3[attr_start + 2])) & (!(aerofgt_spriteram3[attr_start + 3]))) notdraw = 1;
510508
511// aerofgt has this adjustment, but doing it here would break turbo force title screen
512//      ox += (xsize*zoomx+2)/4;
513//      oy += (ysize*zoomy+2)/4;
509//      if (notdraw) continue;
514510
515      zoomx = 32 - zoomx;
516      zoomy = 32 - zoomy;
511      if (!(aerofgt_spriteram3[attr_start + 2] & 0x0040)) code |= 0x2000;
517512
518      for (y = 0;y <= ysize;y++)
519      {
520         int sx,sy;
513      zoomx = 32 + zoomx;
514      zoomy = 32 + zoomy;
521515
522         if (flipy) sy = ((oy + zoomy * (ysize - y)/2 + 16) & 0x1ff) - 16;
523         else sy = ((oy + zoomy * y / 2 + 16) & 0x1ff) - 16;
516      sy = ((oy + 16) & 0x1ff) - 16;
524517
525         for (x = 0;x <= xsize;x++)
526         {
527            if (flipx) sx = ((ox + zoomx * (xsize - x) / 2 + 16) & 0x1ff) - 16;
528            else sx = ((ox + zoomx * x / 2 + 16) & 0x1ff) - 16;
518      sx = ((ox + 16) & 0x1ff) - 16;
529519
530            pdrawgfxzoom(bitmap,machine->gfx[sprite_gfx + (code >= 0x1000 ? 0 : 1)],
531                  code,
532                  color,
533                  flipx,flipy,
534                  sx,sy,
535                  cliprect,TRANSPARENCY_PEN,15,
536                  zoomx << 11,zoomy << 11,
537                  pri ? 0 : 0x2);
538            code++;
539         }
520      pdrawgfxzoom(bitmap,machine->gfx[sprite_gfx + (code >= 0x1000 ? 0 : 1)],
521            code,
522            color,
523            flipx,flipy,
524            sx,sy,
525            cliprect,TRANSPARENCY_PEN,15,
526            zoomx << 11,zoomy << 11,
527            pri ? 0 : 0x2);
540528
541//          if (xsize == 2) code += 1;
542//          if (xsize == 4) code += 3;
543//          if (xsize == 5) code += 2;
544//          if (xsize == 6) code += 1;
545      }
546529   }
547530}
548531
src/mame/video/midyunit.c
r2241r2242
172172   offset *= 2;
173173   if (videobank_select)
174174   {
175      if (ACCESSING_LSB)
175      if (ACCESSING_BITS_0_7)
176176         local_videoram[offset] = (data & 0x00ff) | (dma_register[DMA_PALETTE] << 8);
177      if (ACCESSING_MSB)
177      if (ACCESSING_BITS_8_15)
178178         local_videoram[offset + 1] = (data >> 8) | (dma_register[DMA_PALETTE] & 0xff00);
179179   }
180180   else
181181   {
182      if (ACCESSING_LSB)
182      if (ACCESSING_BITS_0_7)
183183         local_videoram[offset] = (local_videoram[offset] & 0x00ff) | (data << 8);
184      if (ACCESSING_MSB)
184      if (ACCESSING_BITS_8_15)
185185         local_videoram[offset + 1] = (local_videoram[offset + 1] & 0x00ff) | (data & 0xff00);
186186   }
187187}
r2241r2242
239239     *
240240     */
241241
242   if (ACCESSING_LSB)
242   if (ACCESSING_BITS_0_7)
243243   {
244244      /* CMOS page is bits 6-7 */
245245      midyunit_cmos_page = ((data >> 6) & 3) * 0x1000;
src/mame/video/stvvdp1.c
r2241r2242
287287   if ( offset == 0 )
288288   {
289289      stv_set_framebuffer_config();
290      if ( ACCESSING_LSW32 )
290      if ( ACCESSING_BITS_0_15 )
291291      {
292292         if ( vdp1_sprite_log ) logerror( "VDP1: Access to register FBCR = %1X\n", STV_VDP1_FBCR );
293293         stv_vdp1_fbcr_accessed = 1;
r2241r2242
309309   }
310310   else if ( offset == 1 )
311311   {
312      if ( ACCESSING_MSW32 )
312      if ( ACCESSING_BITS_16_31 )
313313      {
314314         if ( STV_VDP1_PTMR == 1 )
315315         {
r2241r2242
323323            }
324324         }
325325      }
326      else if ( ACCESSING_LSW32 )
326      else if ( ACCESSING_BITS_0_15 )
327327      {
328328         if ( vdp1_sprite_log ) logerror( "VDP1: Erase data set %08X\n", data );
329329      }
330330   }
331331   else if ( offset == 2 )
332332   {
333      if ( ACCESSING_MSW32 )
333      if ( ACCESSING_BITS_16_31 )
334334      {
335335         if ( vdp1_sprite_log ) logerror( "VDP1: Erase upper-left coord set: %08X\n", data );
336336      }
337      else if ( ACCESSING_LSW32 )
337      else if ( ACCESSING_BITS_0_15 )
338338      {
339339         if ( vdp1_sprite_log ) logerror( "VDP1: Erase lower-right coord set: %08X\n", data );
340340      }
r2241r2242
377377   else
378378   {
379379      /* 16-bit mode */
380      if ( ACCESSING_MSW32 )
380      if ( ACCESSING_BITS_16_31 )
381381      {
382382         stv_framebuffer[stv_vdp1_current_draw_framebuffer][offset*2] = (data >> 16) & 0xffff;
383383      }
384      if ( ACCESSING_LSW32 )
384      if ( ACCESSING_BITS_0_15 )
385385      {
386386         stv_framebuffer[stv_vdp1_current_draw_framebuffer][offset*2+1] = data & 0xffff;
387387      }
r2241r2242
399399   else
400400   {
401401      /* 16-bit mode */
402      if ( ACCESSING_MSW32 )
402      if ( ACCESSING_BITS_16_31 )
403403      {
404404         result |= (stv_framebuffer[stv_vdp1_current_draw_framebuffer][offset*2] << 16);
405405      }
406      if ( ACCESSING_LSW32 )
406      if ( ACCESSING_BITS_0_15 )
407407      {
408408         result |= stv_framebuffer[stv_vdp1_current_draw_framebuffer][offset*2+1];
409409      }
src/mame/video/deadang.c
r2241r2242
2020
2121WRITE16_HANDLER( deadang_bank_w )
2222{
23   if (ACCESSING_LSB)
23   if (ACCESSING_BITS_0_7)
2424   {
2525      deadangle_tilebank = data&1;
2626      if (deadangle_tilebank!=deadangle_oldtilebank)
src/mame/video/policetr.c
r2241r2242
203203
204204            /* latch 0x50 allows a direct write to the destination bitmap */
205205            case 0x50:
206               if (ACCESSING_MSB32 && dst_xoffs < DSTBITMAP_WIDTH && dst_yoffs < DSTBITMAP_HEIGHT)
206               if (ACCESSING_BITS_24_31 && dst_xoffs < DSTBITMAP_WIDTH && dst_yoffs < DSTBITMAP_HEIGHT)
207207                  dstbitmap[dst_yoffs * DSTBITMAP_WIDTH + dst_xoffs] = data >> 24;
208208               break;
209209
r2241r2242
331331
332332WRITE32_HANDLER( policetr_palette_offset_w )
333333{
334   if (!(mem_mask & 0x00ff0000))
334   if (ACCESSING_BITS_16_23)
335335   {
336336      palette_offset = (data >> 16) & 0xff;
337337      palette_index = 0;
r2241r2242
341341
342342WRITE32_HANDLER( policetr_palette_data_w )
343343{
344   if (!(mem_mask & 0x00ff0000))
344   if (ACCESSING_BITS_16_23)
345345   {
346346      palette_data[palette_index] = (data >> 16) & 0xff;
347347      if (++palette_index == 3)
src/mame/video/seibuspi.c
r2241r2242
11#include "driver.h"
2#include "deprecat.h"
32
43static tilemap *text_layer;
54static tilemap *back_layer;
r2241r2242
208207         UINT32 color = spimainram[(video_dma_address / 4) + i - 0x200];
209208         if (palette_ram[i] != color) {
210209            palette_ram[i] = color;
211            palette_set_color_rgb( Machine, (i * 2), pal5bit(palette_ram[i] >> 0), pal5bit(palette_ram[i] >> 5), pal5bit(palette_ram[i] >> 10) );
212            palette_set_color_rgb( Machine, (i * 2) + 1, pal5bit(palette_ram[i] >> 16), pal5bit(palette_ram[i] >> 21), pal5bit(palette_ram[i] >> 26) );
210            palette_set_color_rgb( machine, (i * 2), pal5bit(palette_ram[i] >> 0), pal5bit(palette_ram[i] >> 5), pal5bit(palette_ram[i] >> 10) );
211            palette_set_color_rgb( machine, (i * 2) + 1, pal5bit(palette_ram[i] >> 16), pal5bit(palette_ram[i] >> 21), pal5bit(palette_ram[i] >> 26) );
213212         }
214213      }
215214   }
r2241r2242
233232   COMBINE_DATA( &video_dma_address );
234233}
235234
236static void draw_blend_gfx(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy)
235static void draw_blend_gfx(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy)
237236{
237   const pen_t *pens = &machine->pens[gfx->color_base];
238238   UINT8 *dp;
239239   int i, j;
240240   int x1, x2;
r2241r2242
319319   // draw
320320   for (j=y1; j <= y2; j++)
321321   {
322      UINT16 *p = BITMAP_ADDR16(bitmap, j, 0);
322      UINT32 *p = BITMAP_ADDR32(bitmap, j, 0);
323323      int dp_i = (py * width) + px;
324324      py += yd;
325325
r2241r2242
332332            UINT8 alpha = alpha_table[global_pen];
333333            if (alpha)
334334            {
335               p[i] = alpha_blend16(p[i], Machine->pens[gfx->color_base + global_pen]);
335               p[i] = alpha_blend_r32(p[i], pens[global_pen], 0x7f);
336336            }
337337            else
338338            {
339               p[i] = Machine->pens[gfx->color_base + global_pen];
339               p[i] = pens[global_pen];
340340            }
341341         }
342342         dp_i += xd;
r2241r2242
407407
408408      for( x=x1; x < width; x++ ) {
409409         for( y=y1; y < height; y++ ) {
410            draw_blend_gfx(bitmap, cliprect, gfx, tile_num, color, flip_x, flip_y, xpos + sprite_xtable[flip_x][x], ypos + sprite_ytable[flip_y][y]);
410            draw_blend_gfx(machine, bitmap, cliprect, gfx, tile_num, color, flip_x, flip_y, xpos + sprite_xtable[flip_x][x], ypos + sprite_ytable[flip_y][y]);
411411
412412            /* xpos seems to wrap-around to 0 at 512 */
413413            if( (xpos + (16 * x) + 16) >= 512 ) {
414               draw_blend_gfx(bitmap, cliprect, gfx, tile_num, color, flip_x, flip_y, xpos - 512 + sprite_xtable[flip_x][x], ypos + sprite_ytable[flip_y][y]);
414               draw_blend_gfx(machine, bitmap, cliprect, gfx, tile_num, color, flip_x, flip_y, xpos - 512 + sprite_xtable[flip_x][x], ypos + sprite_ytable[flip_y][y]);
415415            }
416416
417417            tile_num++;
r2241r2242
566566{
567567   int i,j;
568568   UINT16 *s;
569   UINT16 *d;
569   UINT32 *d;
570570   UINT8 *t;
571571   UINT32 xscroll_mask, yscroll_mask;
572572   bitmap_t *pen_bitmap;
r2241r2242
577577   xscroll_mask = pen_bitmap->width - 1;
578578   yscroll_mask = pen_bitmap->height - 1;
579579
580   alpha_set_level(0x7f);
581
582580   for (j=cliprect->min_y; j <= cliprect->max_y; j++)
583581   {
584582      int rx = x;
r2241r2242
587585         rx += rowscroll[(j+y) & yscroll_mask];
588586      }
589587
590      d = BITMAP_ADDR16(bitmap, j, 0);
588      d = BITMAP_ADDR32(bitmap, j, 0);
591589      s = BITMAP_ADDR16(pen_bitmap, (j+y) & yscroll_mask, 0);
592590      t = BITMAP_ADDR8(flags_bitmap, (j+y) & yscroll_mask, 0);
593591      for (i=cliprect->min_x+rx; i <= cliprect->max_x+rx; i++)
r2241r2242
598596            UINT8 alpha = alpha_table[pen];
599597            if (alpha)
600598            {
601               *d = alpha_blend16(*d, machine->pens[pen]);
599               *d = alpha_blend_r32(*d, machine->pens[pen], 0x7f);
602600            }
603601            else
604602            {
src/mame/video/midtunit.c
r2241r2242
156156   offset *= 2;
157157   if (videobank_select)
158158   {
159      if (ACCESSING_LSB)
159      if (ACCESSING_BITS_0_7)
160160         local_videoram[offset] = (data & 0xff) | ((dma_register[DMA_PALETTE] & 0xff) << 8);
161      if (ACCESSING_MSB)
161      if (ACCESSING_BITS_8_15)
162162         local_videoram[offset + 1] = ((data >> 8) & 0xff) | (dma_register[DMA_PALETTE] & 0xff00);
163163   }
164164   else
165165   {
166      if (ACCESSING_LSB)
166      if (ACCESSING_BITS_0_7)
167167         local_videoram[offset] = (local_videoram[offset] & 0xff) | ((data & 0xff) << 8);
168      if (ACCESSING_MSB)
168      if (ACCESSING_BITS_8_15)
169169         local_videoram[offset + 1] = (local_videoram[offset + 1] & 0xff) | (data & 0xff00);
170170   }
171171}
r2241r2242
174174WRITE16_HANDLER( midtunit_vram_data_w )
175175{
176176   offset *= 2;
177   if (ACCESSING_LSB)
177   if (ACCESSING_BITS_0_7)
178178      local_videoram[offset] = (data & 0xff) | ((dma_register[DMA_PALETTE] & 0xff) << 8);
179   if (ACCESSING_MSB)
179   if (ACCESSING_BITS_8_15)
180180      local_videoram[offset + 1] = ((data >> 8) & 0xff) | (dma_register[DMA_PALETTE] & 0xff00);
181181}
182182
r2241r2242
184184WRITE16_HANDLER( midtunit_vram_color_w )
185185{
186186   offset *= 2;
187   if (ACCESSING_LSB)
187   if (ACCESSING_BITS_0_7)
188188      local_videoram[offset] = (local_videoram[offset] & 0xff) | ((data & 0xff) << 8);
189   if (ACCESSING_MSB)
189   if (ACCESSING_BITS_8_15)
190190      local_videoram[offset + 1] = (local_videoram[offset + 1] & 0xff) | (data & 0xff00);
191191}
192192
src/mame/video/powerins.c
r2241r2242
6060
6161WRITE16_HANDLER( powerins_flipscreen_w )
6262{
63   if (ACCESSING_LSB)   flip_screen_set( data & 1 );
63   if (ACCESSING_BITS_0_7)   flip_screen_set( data & 1 );
6464}
6565
6666WRITE16_HANDLER( powerins_tilebank_w )
6767{
68   if (ACCESSING_LSB)
68   if (ACCESSING_BITS_0_7)
6969   {
7070      if (data != tile_bank)
7171      {
src/mame/video/niyanpai.c
r2241r2242
6262      offs_h = (offset / 0x180);
6363      offs_l = (offset & 0x7f);
6464
65      if (ACCESSING_MSB16)
65      if (ACCESSING_BITS_8_15)
6666      {
6767         r  = ((niyanpai_palette[(0x000 + (offs_h * 0x180) + offs_l)] & 0xff00) >> 8);
6868         g  = ((niyanpai_palette[(0x080 + (offs_h * 0x180) + offs_l)] & 0xff00) >> 8);
r2241r2242
7171         palette_set_color(Machine, ((offs_h << 8) + (offs_l << 1) + 0), MAKE_RGB(r, g, b));
7272      }
7373
74      if (ACCESSING_LSB16)
74      if (ACCESSING_BITS_0_7)
7575      {
7676         r  = ((niyanpai_palette[(0x000 + (offs_h * 0x180) + offs_l)] & 0x00ff) >> 0);
7777         g  = ((niyanpai_palette[(0x080 + (offs_h * 0x180) + offs_l)] & 0x00ff) >> 0);
src/mame/video/itech32.c
r2241r2242
249249
250250WRITE16_HANDLER( timekill_colora_w )
251251{
252   if (ACCESSING_LSB)
252   if (ACCESSING_BITS_0_7)
253253   {
254254      enable_latch[0] = (~data >> 5) & 1;
255255      enable_latch[1] = (~data >> 7) & 1;
r2241r2242
260260
261261WRITE16_HANDLER( timekill_colorbc_w )
262262{
263   if (ACCESSING_LSB)
263   if (ACCESSING_BITS_0_7)
264264      color_latch[1] = ((data & 0xf0) << 4) | 0x1000;
265265}
266266
267267
268268WRITE16_HANDLER( timekill_intensity_w )
269269{
270   if (ACCESSING_LSB)
270   if (ACCESSING_BITS_0_7)
271271   {
272272      double intensity = (double)(data & 0xff) / (double)0x60;
273273      int i;
r2241r2242
279279
280280WRITE16_HANDLER( bloodstm_color1_w )
281281{
282   if (ACCESSING_LSB)
282   if (ACCESSING_BITS_0_7)
283283      color_latch[0] = (data & 0x7f) << 8;
284284}
285285
286286
287287WRITE16_HANDLER( bloodstm_color2_w )
288288{
289   if (ACCESSING_LSB)
289   if (ACCESSING_BITS_0_7)
290290      color_latch[1] = (data & 0x7f) << 8;
291291}
292292
293293
294294WRITE16_HANDLER( bloodstm_plane_w )
295295{
296   if (ACCESSING_LSB)
296   if (ACCESSING_BITS_0_7)
297297   {
298298      enable_latch[0] = (~data >> 1) & 1;
299299      enable_latch[1] = (~data >> 2) & 1;
r2241r2242
303303
304304WRITE32_HANDLER( drivedge_color0_w )
305305{
306   if (!(mem_mask & 0x00ff0000))
306   if (ACCESSING_BITS_16_23)
307307      color_latch[0] = ((data >> 16) & 0x7f) << 8;
308308}
309309
310310
311311WRITE32_HANDLER( itech020_color1_w )
312312{
313   if (ACCESSING_LSB32)
313   if (ACCESSING_BITS_0_7)
314314      color_latch[1] = (data & 0x7f) << 8;
315315}
316316
317317
318318WRITE32_HANDLER( itech020_color2_w )
319319{
320   if (ACCESSING_LSB32)
320   if (ACCESSING_BITS_0_7)
321321      color_latch[0] = (data & 0x7f) << 8;
322322}
323323
324324
325325WRITE32_HANDLER( itech020_plane_w )
326326{
327   if (!(mem_mask & 0x0000ff00))
327   if (ACCESSING_BITS_8_15)
328328   {
329329      enable_latch[0] = (~data >> 9) & 1;
330330      enable_latch[1] = (~data >> 10) & 1;
r2241r2242
359359   int r, g, b;
360360
361361   /* in test mode, the LSB is used; in game mode, the MSB is used */
362   if (!ACCESSING_LSB && (offset & 1))
362   if (!ACCESSING_BITS_0_7 && (offset & 1))
363363      data >>= 8, mem_mask >>= 8;
364364   COMBINE_DATA(&paletteram16[offset]);
365365
r2241r2242
14221422
14231423WRITE32_HANDLER( itech020_video_w )
14241424{
1425   if (ACCESSING_MSW32)
1425   if (ACCESSING_BITS_16_31)
14261426      itech32_video_w(machine, offset, data >> 16, mem_mask >> 16);
14271427   else
14281428      itech32_video_w(machine, offset, data, mem_mask);
src/mame/video/terracre.c
r2241r2242
165165
166166WRITE16_HANDLER( amazon_flipscreen_w )
167167{
168   if( ACCESSING_LSB )
168   if( ACCESSING_BITS_0_7 )
169169   {
170170      coin_counter_w( 0, data&0x01 );
171171      coin_counter_w( 1, (data&0x02)>>1 );
src/mame/video/undrfire.c
r2241r2242
223223   }
224224}
225225
226
227static void draw_sprites_cbombers(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,const int *primasks,int x_offs,int y_offs)
228{
229   UINT16 *spritemap = (UINT16 *)memory_region(REGION_USER1);
230   UINT8 *spritemapHibit = (UINT8 *)memory_region(REGION_USER2);
231
232   int offs, data, tilenum, color, flipx, flipy;
233   int x, y, priority, dblsize, curx, cury;
234   int sprites_flipscreen = 0;
235   int zoomx, zoomy, zx, zy;
236   int sprite_chunk,map_offset,code,j,k,px,py;
237   int dimension,total_chunks;
238
239   /* pdrawgfx() needs us to draw sprites front to back, so we have to build a list
240       while processing sprite ram and then draw them all at the end */
241   struct tempsprite *sprite_ptr = spritelist;
242
243   for (offs = (spriteram_size/4-4);offs >= 0;offs -= 4)
244   {
245      data = spriteram32[offs+0];
246      flipx =    (data & 0x00800000) >> 23;
247      zoomx =    (data & 0x007f0000) >> 16;
248      tilenum =  (data & 0x00007fff);
249
250      data = spriteram32[offs+2];
251      priority = (data & 0x000c0000) >> 18;
252      color =    (data & 0x0003fc00) >> 10;
253      x =        (data & 0x000003ff);
254
255      data = spriteram32[offs+3];
256      dblsize =  (data & 0x00040000) >> 18;
257      flipy =    (data & 0x00020000) >> 17;
258      zoomy =    (data & 0x0001fc00) >> 10;
259      y =        (data & 0x000003ff);
260
261      color |= (/*0x100 +*/ (priority << 6));      /* priority bits select color bank */
262
263      color /= 2;      /* as sprites are 5bpp */
264      flipy = !flipy;
265//      y = (-y &0x3ff);
266
267      if (!tilenum) continue;
268
269//      flipy = !flipy;
270      zoomx += 1;
271      zoomy += 1;
272
273      y += y_offs;
274
275      /* treat coords as signed */
276      if (x>0x340) x -= 0x400;
277      if (y>0x340) y -= 0x400;
278
279      x -= x_offs;
280
281      dimension = ((dblsize*2) + 2);   // 2 or 4
282      total_chunks = ((dblsize*3) + 1) << 2;   // 4 or 16
283      map_offset = tilenum << 2;
284
285      {
286         for (sprite_chunk=0;sprite_chunk<total_chunks;sprite_chunk++)
287         {
288            j = sprite_chunk / dimension;   /* rows */
289            k = sprite_chunk % dimension;   /* chunks per row */
290
291            px = k;
292            py = j;
293            /* pick tiles back to front for x and y flips */
294            if (flipx)  px = dimension-1-k;
295            if (flipy)  py = dimension-1-j;
296
297            code = spritemap[map_offset + px + (py<<(dblsize+1))];
298
299            if (spritemapHibit)
300            {
301               code|=spritemapHibit[map_offset + px + (py<<(dblsize+1))] << 16;
302
303               //if (spritemapHibit[map_offset + px + (py<<(dblsize+1))])
304                  //color=mame_rand(machine);
305            }
306
307            curx = x + ((k*zoomx)/dimension);
308            cury = y + ((j*zoomy)/dimension);
309
310            zx= x + (((k+1)*zoomx)/dimension) - curx;
311            zy= y + (((j+1)*zoomy)/dimension) - cury;
312
313            if (sprites_flipscreen)
314            {
315               /* -zx/y is there to fix zoomed sprite coords in screenflip.
316                       drawgfxzoom does not know to draw from flip-side of sprites when
317                       screen is flipped; so we must correct the coords ourselves. */
318
319               curx = 320 - curx - zx;
320               cury = 256 - cury - zy;
321               flipx = !flipx;
322               flipy = !flipy;
323            }
324
325            sprite_ptr->gfx = 0;
326            sprite_ptr->code = code;
327            sprite_ptr->color = color;
328            sprite_ptr->flipx = !flipx;
329            sprite_ptr->flipy = flipy;
330            sprite_ptr->x = curx;
331            sprite_ptr->y = cury;
332            sprite_ptr->zoomx = zx << 12;
333            sprite_ptr->zoomy = zy << 12;
334
335            if (primasks)
336            {
337               sprite_ptr->primask = primasks[priority];
338
339               sprite_ptr++;
340            }
341            else
342            {
343               drawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx],
344                     sprite_ptr->code,
345                     sprite_ptr->color,
346                     sprite_ptr->flipx,sprite_ptr->flipy,
347                     sprite_ptr->x,sprite_ptr->y,
348                     cliprect,TRANSPARENCY_PEN,0,
349                     sprite_ptr->zoomx,sprite_ptr->zoomy);
350            }
351         }
352      }
353   }
354
355   /* this happens only if primsks != NULL */
356   while (sprite_ptr != spritelist)
357   {
358      sprite_ptr--;
359
360      pdrawgfxzoom(bitmap,machine->gfx[sprite_ptr->gfx],
361            sprite_ptr->code,
362            sprite_ptr->color,
363            sprite_ptr->flipx,sprite_ptr->flipy,
364            sprite_ptr->x,sprite_ptr->y,
365            cliprect,TRANSPARENCY_PEN,0,
366            sprite_ptr->zoomx,sprite_ptr->zoomy,
367            sprite_ptr->primask);
368   }
369}
370
371
226372/**************************************************************
227373                SCREEN REFRESH
228374**************************************************************/
r2241r2242
369515#endif
370516   return 0;
371517}
518
519
520VIDEO_UPDATE( cbombers )
521{
522   UINT8 layer[5];
523   UINT8 pivlayer[3];
524   UINT16 priority;
525
526#ifdef MAME_DEBUG
527   static UINT8 dislayer[6];   /* Layer toggles to help get layers correct */
528#endif
529
530#ifdef MAME_DEBUG
531   if (input_code_pressed_once (KEYCODE_X))
532   {
533      dislayer[5] ^= 1;
534      popmessage("piv text: %01x",dislayer[5]);
535   }
536   if (input_code_pressed_once (KEYCODE_C))
537   {
538      dislayer[0] ^= 1;
539      popmessage("bg0: %01x",dislayer[0]);
540   }
541
542   if (input_code_pressed_once (KEYCODE_V))
543   {
544      dislayer[1] ^= 1;
545      popmessage("bg1: %01x",dislayer[1]);
546   }
547
548   if (input_code_pressed_once (KEYCODE_B))
549   {
550      dislayer[2] ^= 1;
551      popmessage("bg2: %01x",dislayer[2]);
552   }
553
554   if (input_code_pressed_once (KEYCODE_N))
555   {
556      dislayer[3] ^= 1;
557      popmessage("bg3: %01x",dislayer[3]);
558   }
559
560   if (input_code_pressed_once (KEYCODE_M))
561   {
562      dislayer[4] ^= 1;
563      popmessage("sprites: %01x",dislayer[4]);
564   }
565#endif
566
567   TC0100SCN_tilemap_update(screen->machine);
568   TC0480SCP_tilemap_update(screen->machine);
569
570   priority = TC0480SCP_get_bg_priority();
571
572   layer[0] = (priority &0xf000) >> 12;   /* tells us which bg layer is bottom */
573   layer[1] = (priority &0x0f00) >>  8;
574   layer[2] = (priority &0x00f0) >>  4;
575   layer[3] = (priority &0x000f) >>  0;   /* tells us which is top */
576   layer[4] = 4;   /* text layer always over bg layers */
577
578   pivlayer[0] = TC0100SCN_bottomlayer(0);
579   pivlayer[1] = pivlayer[0]^1;
580   pivlayer[2] = 2;
581
582   fillbitmap(priority_bitmap,0,cliprect);
583   fillbitmap(bitmap,0,cliprect);   /* wrong color? */
584
585
586/* The "PIV" chip seems to be a renamed TC0100SCN. It has a
587   bottom layer usually full of bright garish colors that
588   vaguely mimic the structure of the layers on top. Seems
589   pointless - it's always hidden by other layers. Does it
590   serve some blending pupose ? */
591
592   TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,pivlayer[0],TILEMAP_DRAW_OPAQUE,0);
593   TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,pivlayer[1],0,0);
594
595#ifdef MAME_DEBUG
596   if (dislayer[layer[0]]==0)
597#endif
598   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],0,1);
599
600#ifdef MAME_DEBUG
601   if (dislayer[layer[1]]==0)
602#endif
603   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[1],0,2);
604
605#ifdef MAME_DEBUG
606   if (dislayer[layer[2]]==0)
607#endif
608   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[2],0,4);
609
610#ifdef MAME_DEBUG
611   if (dislayer[layer[3]]==0)
612#endif
613   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[3],0,8);
614
615#ifdef MAME_DEBUG
616   if (dislayer[4]==0)
617#endif
618   /* Sprites have variable priority (we kludge this on road levels) */
619   {
620      if ((TC0480SCP_pri_reg &0x3) == 3)   /* on road levels kludge sprites up 1 priority */
621      {
622         static const int primasks[4] = {0xfff0, 0xff00, 0x0, 0x0};
623         draw_sprites_cbombers(screen->machine, bitmap,cliprect,primasks,80,-208);
624      }
625      else
626      {
627         static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0};
628         draw_sprites_cbombers(screen->machine, bitmap,cliprect,primasks,80,-208);
629      }
630   }
631
632#ifdef MAME_DEBUG
633   if (dislayer[5]==0)
634#endif
635   TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,pivlayer[2],0,0);   /* piv text layer */
636
637   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[4],0,0);   /* TC0480SCP text layer */
638
639   /* See if we should draw artificial gun targets */
640   /* (not yet implemented...) */
641
642   if (input_port_7_word_r(screen->machine,0,0) & 0x1)   /* Fake DSW */
643   {
644      popmessage("Gunsights on");
645   }
646
647/* Enable this to see rotation (?) control words */
648#if 0
649   {
650      char buf[80];
651      int i;
652
653      for (i = 0; i < 8; i += 1)
654      {
655         sprintf (buf, "%02x: %04x", i, undrfire_rotate_ctrl[i]);
656         ui_draw_text (buf, 0, i*8);
657      }
658   }
659#endif
660   return 0;
661}
src/mame/video/gaiden.c
r2241r2242
179179
180180WRITE16_HANDLER( gaiden_flip_w )
181181{
182   if (ACCESSING_LSB)
182   if (ACCESSING_BITS_0_7)
183183      flip_screen_set(data & 1);
184184}
185185
r2241r2242
363363
364364               pdrawgfx(bitmap, gfx,
365365                  number + layout[row][col],
366                  color,
366                  gfx->color_base + color * gfx->color_granularity,
367367                  flipx, flipy,
368368                  sx, sy,
369                  cliprect, TRANSPARENCY_PEN, 0,
369                  cliprect, TRANSPARENCY_PEN_RAW, 0,
370370                  priority_mask);
371371            }
372372         }
r2241r2242
464464
465465                  pdrawgfx(bitmap_sp, gfx,
466466                     number + layout[row][col],
467                     color,
467                     gfx->color_base + color * gfx->color_granularity,
468468                     flipx, flipy,
469469                     sx, sy,
470                     cliprect, TRANSPARENCY_PEN, 0,
470                     cliprect, TRANSPARENCY_PEN_RAW, 0,
471471                     priority_mask);
472472               }
473473            }
r2241r2242
485485
486486                  pdrawgfx(bitmap, gfx,
487487                     number + layout[row][col],
488                     color,
488                     gfx->color_base + color * gfx->color_granularity,
489489                     flipx, flipy,
490490                     sx, sy,
491                     cliprect, TRANSPARENCY_PEN, 0,
491                     cliprect, TRANSPARENCY_PEN_RAW, 0,
492492                     priority_mask);
493493               }
494494            }
r2241r2242
543543
544544      pdrawgfx(bitmap,machine->gfx[3],
545545            code,
546            color,flipx,flipy,x,y,
546            machine->gfx[3]->color_base + color * machine->gfx[3]->color_granularity,
547            flipx,flipy,x,y,
547548            cliprect,
548            TRANSPARENCY_PEN,15,
549            TRANSPARENCY_PEN_RAW,15,
549550            priority_mask);
550551
551552      /* wrap x*/
552553      pdrawgfx(bitmap,machine->gfx[3],
553554            code,
554            color,flipx,flipy,x-512,y,
555            machine->gfx[3]->color_base + color * machine->gfx[3]->color_granularity,
556            flipx,flipy,x-512,y,
555557            cliprect,
556            TRANSPARENCY_PEN,15,
558            TRANSPARENCY_PEN_RAW,15,
557559            priority_mask);
558560
559561   }
src/mame/video/fastfred.c
r2241r2242
1111#include "video/resnet.h"
1212#include "fastfred.h"
1313
14extern UINT8 galaxian_stars_on;
15void galaxian_init_stars(running_machine *machine, int colors_offset);
16void galaxian_draw_stars(running_machine *machine, bitmap_t *bitmap);
14extern UINT8 galaxold_stars_on;
15void galaxold_init_stars(running_machine *machine, int colors_offset);
16void galaxold_draw_stars(running_machine *machine, bitmap_t *bitmap);
1717
1818UINT8 *fastfred_videoram;
1919UINT8 *fastfred_spriteram;
r2241r2242
380380   tilemap_set_transparent_pen(fg_tilemap, 0);
381381
382382   /* the game has a galaxian starfield */
383   galaxian_init_stars(machine, 256);
384   galaxian_stars_on = 1;
383   galaxold_init_stars(machine, 256);
384   galaxold_stars_on = 1;
385385
386386   /* web colors */
387387   palette_set_color(machine,256+64+0,MAKE_RGB(0x50,0x00,0x00));
r2241r2242
391391VIDEO_UPDATE( imago )
392392{
393393   tilemap_draw(bitmap,cliprect,web_tilemap,0,0);
394   galaxian_draw_stars(screen->machine, bitmap);
394   galaxold_draw_stars(screen->machine, bitmap);
395395   tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
396396   draw_sprites(screen->machine, bitmap, cliprect);
397397   tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
src/mame/video/gticlub.c
r2241r2242
117117   }
118118   else if (offset == 2)
119119   {
120      if (!(mem_mask & 0xffff0000))
120      if (ACCESSING_BITS_16_31)
121121      {
122122         K001006_device_sel[chip] = (data >> 16) & 0xf;
123123      }
src/mame/video/namcona1.c
r2241r2242
11/*  Namco System NA1/2 Video Hardware */
22
3/*
4TODO:
5- dynamic screen resolution
6- bg pen (or the pen of the lower tilemap?)
7- hook up roz tilemaps with roz enable / disable and tweak it (mainly missing offsets)
8- sprites with shadow bit have bad colors
9- check if the data&0x8000 condition in tilemaps is valid even when 4bpp mode it's used
10- namco logo in emeralda demo is missing (it's used with a roz effect)
11- invisible dolphin sprite in emeralda instruction screen
12*/
13
314#include "driver.h"
4#include "deprecat.h"
515#include "namcona1.h"
616
717#define NAMCONA1_NUM_TILEMAPS 4
r2241r2242
2232static int palette_is_dirty;
2333
2434static void tilemap_get_info(
25   running_machine *machine,tile_data *tileinfo,int tile_index,const UINT16 *tilemap_videoram,int tilemap_color )
35   running_machine *machine,tile_data *tileinfo,int tile_index,const UINT16 *tilemap_videoram,int tilemap_color,int use_4bpp_gfx )
2636{
2737#ifdef LSB_FIRST
2838   UINT16 *source;
r2241r2242
3141
3242   int data = tilemap_videoram[tile_index];
3343   int tile = data&0xfff;
44   int gfx;
3445
35   if( data&0x8000 )
46   if( use_4bpp_gfx )
3647   {
37      SET_TILE_INFO( 0,tile,tilemap_color,TILE_FORCE_LAYER0 );
48      gfx = 1;
49      tilemap_color *= 0x10;
50      tilemap_color += (data & 0x7000)>>12;
3851   }
3952   else
4053   {
41      SET_TILE_INFO( 0,tile,tilemap_color,0 );
54      gfx = 0;
55   }
56
57   if( data & 0x8000 )
58   {
59      SET_TILE_INFO( gfx,tile,tilemap_color,TILE_FORCE_LAYER0 );
60   }
61   else
62   {
63      SET_TILE_INFO( gfx,tile,tilemap_color,0 );
4264#ifdef LSB_FIRST
4365      source = shaperam+4*tile;
4466      mask_data[0] = source[0]>>8;
r2241r2242
5678   }
5779} /* tilemap_get_info */
5880
59static TILE_GET_INFO( tilemap_get_info0 ){ tilemap_get_info(machine,tileinfo,tile_index,0*0x1000+videoram16,tilemap_palette_bank[0]); }
60static TILE_GET_INFO( tilemap_get_info1 ){ tilemap_get_info(machine,tileinfo,tile_index,1*0x1000+videoram16,tilemap_palette_bank[1]); }
61static TILE_GET_INFO( tilemap_get_info2 ){ tilemap_get_info(machine,tileinfo,tile_index,2*0x1000+videoram16,tilemap_palette_bank[2]); }
62static TILE_GET_INFO( tilemap_get_info3 ){ tilemap_get_info(machine,tileinfo,tile_index,3*0x1000+videoram16,tilemap_palette_bank[3]); }
81static TILE_GET_INFO( tilemap_get_info0 ){ tilemap_get_info(machine,tileinfo,tile_index,0*0x1000+videoram16,tilemap_palette_bank[0],namcona1_vreg[0x58+6]&1); }
82static TILE_GET_INFO( tilemap_get_info1 ){ tilemap_get_info(machine,tileinfo,tile_index,1*0x1000+videoram16,tilemap_palette_bank[1],namcona1_vreg[0x58+6]&2); }
83static TILE_GET_INFO( tilemap_get_info2 ){ tilemap_get_info(machine,tileinfo,tile_index,2*0x1000+videoram16,tilemap_palette_bank[2],namcona1_vreg[0x58+6]&4); }
84static TILE_GET_INFO( tilemap_get_info3 ){ tilemap_get_info(machine,tileinfo,tile_index,3*0x1000+videoram16,tilemap_palette_bank[3],namcona1_vreg[0x58+6]&8); }
6385
6486/*************************************************************************/
6587
r2241r2242
98120   if( namcona1_vreg[0x8e/2] )
99121   {
100122      /* graphics enabled; update palette immediately */
101      UpdatePalette(Machine, offset );
123      UpdatePalette(machine, offset );
102124   }
103125   else
104126   {
r2241r2242
123145   8*8
124146}; /* shape_layout */
125147
126static const gfx_layout cg_layout =
148static const gfx_layout cg_layout_8bpp =
127149{
128150   8,8,
129151   0x1000,
r2241r2242
136158#endif
137159   { 64*0,64*1,64*2,64*3,64*4,64*5,64*6,64*7 },
138160   64*8
139}; /* cg_layout */
161}; /* cg_layout_8bpp */
140162
163static const gfx_layout cg_layout_4bpp =
164{
165   8,8,
166   0x1000,
167   4, /* 4BPP */
168   { 4,5,6,7 },
169#ifdef LSB_FIRST
170   { 8*1,8*0,8*3,8*2,8*5,8*4,8*7,8*6 },
171#else
172   { 8*0,8*1,8*2,8*3,8*4,8*5,8*6,8*7 },
173#endif
174   { 64*0,64*1,64*2,64*3,64*4,64*5,64*6,64*7 },
175   64*8
176}; /* cg_layout_4bpp */
177
141178READ16_HANDLER( namcona1_gfxram_r )
142179{
143180   UINT16 type = namcona1_vreg[0x0c/2];
r2241r2242
209246         {
210247            dirtychar[i] = 0;
211248            decodechar(machine->gfx[0],i,(UINT8 *)cgram);
212            decodechar(machine->gfx[1],i,(UINT8 *)shaperam);
249            decodechar(machine->gfx[1],i,(UINT8 *)cgram);
250            decodechar(machine->gfx[2],i,(UINT8 *)shaperam);
213251         }
214252      }
215253      dirtygfx = 0;
r2241r2242
219257VIDEO_START( namcona1 )
220258{
221259   int i;
222   gfx_element *gfx0,*gfx1;
260   gfx_element *gfx0,*gfx1,*gfx2;
223261   static const tile_get_info_func get_info[4] =
224262   { tilemap_get_info0, tilemap_get_info1, tilemap_get_info2, tilemap_get_info3 };
225263
r2241r2242
237275   cgram         = auto_malloc( 0x1000*0x20*2 );
238276   dirtychar      = auto_malloc( 0x1000 );
239277
240      gfx0 = allocgfx( &cg_layout );
241      gfx1 = allocgfx( &shape_layout );
278      gfx0 = allocgfx( &cg_layout_8bpp );
279      gfx1 = allocgfx( &cg_layout_4bpp );
280      gfx2 = allocgfx( &shape_layout );
242281         gfx0->total_colors = machine->config->total_colors/256;
243282         machine->gfx[0] = gfx0;
244283
245         gfx1->total_colors = machine->config->total_colors/2;
284         gfx1->total_colors = machine->config->total_colors/16;
246285         machine->gfx[1] = gfx1;
286
287         gfx2->total_colors = machine->config->total_colors/2;
288         machine->gfx[2] = gfx2;
247289} /* namcona1_vh_start */
248290
249291/*************************************************************************/
250292
251static void pdraw_masked_tile(running_machine *machine,
252      bitmap_t *bitmap,
253      const rectangle *cliprect,
254      unsigned code,
293static void pdraw_tile(running_machine *machine,
294      bitmap_t *dest_bmp,
295      const rectangle *clip,
296      UINT32 code,
255297      int color,
256298      int sx, int sy,
257299      int flipx, int flipy,
258300      int priority,
259      int bShadow )
301      int bShadow,
302      int bOpaque,
303      int gfx_region )
260304{
261   const gfx_element *gfx,*mask;
262   pen_t pen_base;
263   UINT8 *gfx_addr;
264   int gfx_pitch;
265   UINT8 *mask_addr;
266   int mask_pitch;
267   int x,y;
305   const gfx_element *gfx = machine->gfx[gfx_region];
306   const gfx_element *mask = machine->gfx[2];
268307
269   /*
270     *  custom blitter for drawing a masked 8x8x8BPP tile
271     */
272   if( sx > cliprect->min_x-8 &&
273      sy > cliprect->min_y-8 &&
274      sx <= cliprect->max_x &&
275      sy <= cliprect->max_y ) /* all-or-nothing clip */
308   int pal_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors);
309   UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
310   UINT8 *mask_base = mask->gfxdata + (code % mask->total_elements) * mask->char_modulo;
311
312   int sprite_screen_height = ((1<<16)*gfx->height+0x8000)>>16;
313   int sprite_screen_width = ((1<<16)*gfx->width+0x8000)>>16;
314
315   if (sprite_screen_width && sprite_screen_height)
276316   {
277      gfx = machine->gfx[0];
278      mask = machine->gfx[1];
279      code %= gfx->total_elements;
280      color %= gfx->total_colors;
281      pen_base = gfx->color_base + gfx->color_granularity * color;
282      gfx_addr = gfx->gfxdata + code * gfx->char_modulo;
283      gfx_pitch = gfx->line_modulo;
284      mask_addr = mask->gfxdata + code * mask->char_modulo;
285      mask_pitch = mask->line_modulo;
317      /* compute sprite increment per screen pixel */
318      int dx = (gfx->width<<16)/sprite_screen_width;
319      int dy = (gfx->height<<16)/sprite_screen_height;
286320
287      /* The way we render shadows makes some Emeralda text invisible.
288         * The relevant text is composed of sprites with the shadow bit set,
289         * displayed over a black backdrop.
290         */
291      if( bShadow && namcona1_gametype!=NAMCO_EMERALDA )
321      int ex = sx+sprite_screen_width;
322      int ey = sy+sprite_screen_height;
323
324      int x_index_base;
325      int y_index;
326
327      if( flipx )
292328      {
293         for( y=0; y<8; y++ )
329         x_index_base = (sprite_screen_width-1)*dx;
330         dx = -dx;
331      }
332      else
333      {
334         x_index_base = 0;
335      }
336
337      if( flipy )
338      {
339         y_index = (sprite_screen_height-1)*dy;
340         dy = -dy;
341      }
342      else
343      {
344         y_index = 0;
345      }
346
347      if( clip )
348      {
349         if( sx < clip->min_x)
350         { /* clip left */
351            int pixels = clip->min_x-sx;
352            sx += pixels;
353            x_index_base += pixels*dx;
354         }
355         if( sy < clip->min_y )
356         { /* clip top */
357            int pixels = clip->min_y-sy;
358            sy += pixels;
359            y_index += pixels*dy;
360         }
361         /* NS 980211 - fixed incorrect clipping */
362         if( ex > clip->max_x+1 )
363         { /* clip right */
364            int pixels = ex-clip->max_x-1;
365            ex -= pixels;
366         }
367         if( ey > clip->max_y+1 )
368         { /* clip bottom */
369            int pixels = ey-clip->max_y-1;
370            ey -= pixels;
371         }
372      }
373
374      if( ex>sx )
375      { /* skip if inner loop doesn't draw anything */
376         int y;
377
378         for( y=sy; y<ey; y++ )
294379         {
295            int ypos = sy+(flipy?7-y:y);
296            if (ypos >= cliprect->min_y && ypos <= cliprect->max_y)
380            UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
381            UINT8 *mask_addr = mask_base + (y_index>>16) * mask->line_modulo;
382            UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
383            UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
384
385            int x, x_index = x_index_base;
386            for( x=sx; x<ex; x++ )
297387            {
298               UINT8 *pri = BITMAP_ADDR8(priority_bitmap, ypos, 0);
299               UINT16 *dest = BITMAP_ADDR16(bitmap, ypos, 0);
300               if( flipx )
388               if( bOpaque )
301389               {
302                  dest += sx+7;
303                  pri += sx+7;
304                  for( x=0; x<8; x++ )
305                     if (sx+x >= cliprect->min_x && sx+x <= cliprect->max_x)
306                     {
307                        if( mask_addr[x] )
308                        { /* sprite pixel is opaque */
309                           if( priority>=pri[-x] )
310                           {
311                              dest[-x] |= 0x1000;
312                           }
313                           pri[-x] = 0xff;
314                        }
315                     }
390                  if (pri[x] <= priority)
391                  {
392                     int c = source[x_index>>16];
393                     dest[x] = pal_base + c;
394                  }
395
396                  pri[x] = 0xff;
316397               }
317398               else
318399               {
319                  dest += sx;
320                  pri += sx;
321                  for( x=0; x<8; x++ )
322                     if (sx+x >= cliprect->min_x && sx+x <= cliprect->max_x)
400                  /* sprite pixel is opaque */
401                  if( mask_addr[x_index>>16] != 0 )
402                  {
403                     if (pri[x] <= priority)
323404                     {
324                        if( mask_addr[x] )
325                        { /* sprite pixel is opaque */
326                           if( priority>=pri[x] )
327                           {
328                              dest[x] |= 0x1000;
329                           }
330                           pri[x] = 0xff;
405                        int c = source[x_index>>16];
406
407                        /* render a shadow only if the sprites color is $F (8bpp) or $FF (4bpp) */
408                        if( bShadow && ((gfx_region == 0 && color == 0x0f) || (gfx_region == 1 && color == 0xff)))
409                        {
410                           pen_t *palette_shadow_table = machine->shadow_table;
411                           dest[x] = palette_shadow_table[dest[x]];
331412                        }
332                     }
333               }
334            }
335            mask_addr += mask_pitch;
336         }
337      } /* render translucent sprite */
338      else
339      {
340         for( y=0; y<8; y++ )
341         {
342            int ypos = sy+(flipy?7-y:y);
343            if (ypos >= cliprect->min_y && ypos <= cliprect->max_y)
344            {
345               UINT8 *pri = BITMAP_ADDR8(priority_bitmap, ypos, 0);
346               UINT16 *dest = BITMAP_ADDR16(bitmap, ypos, 0);
347               if( flipx )
348               {
349                  dest += sx+7;
350                  pri += sx+7;
351                  for( x=0; x<8; x++ )
352                     if (sx-x >= cliprect->min_x && sx-x <= cliprect->max_x)
353                     {
354                        if( mask_addr[x] )
355                        { /* sprite pixel is opaque */
356                           if( priority>=pri[-x] )
357                           {
358                              dest[-x] = pen_base + gfx_addr[x];
359                           }
360                           pri[-x] = 0xff;
413                        else
414                        {
415                           dest[x] = pal_base + c;
361416                        }
362417                     }
418
419                     pri[x] = 0xff;
420                  }
363421               }
364               else
365               {
366                  dest += sx;
367                  pri += sx;
368                  for( x=0; x<8; x++ )
369                     if (sx+x >= cliprect->min_x && sx+x <= cliprect->max_x)
370                     {
371                        if( mask_addr[x] )
372                        { /* sprite pixel is opaque */
373                           if( priority>=pri[x] )
374                           {
375                              dest[x] = pen_base + gfx_addr[x];
376                           }
377                           pri[x] = 0xff;
378                        }
379                     } /* next x */
380               } /* !flipx */
422
423               x_index += dx;
381424            }
382            gfx_addr += gfx_pitch;
383            mask_addr += mask_pitch;
384         } /* next y */
385      } /* render normal sprite (no translucency) */
386   }
387} /* pdraw_masked_tile */
388425
389static void pdraw_opaque_tile(running_machine *machine,
390      bitmap_t *bitmap,
391      const rectangle *cliprect,
392      unsigned code,
393      int color,
394      int sx, int sy,
395      int flipx, int flipy,
396      int priority,
397      int bShadow )
398{
399   const gfx_element *gfx;
400   pen_t pen_base;
401   UINT8 *gfx_addr;
402   int gfx_pitch;
403   int x,y;
404   int ypos;
405   UINT8 *pri;
406   UINT16 *dest;
407
408   if( sx > cliprect->min_x-8 &&
409      sy > cliprect->min_y-8 &&
410      sx <= cliprect->max_x &&
411      sy <= cliprect->max_y ) /* all-or-nothing clip */
412   {
413      gfx = machine->gfx[0];
414      code %= gfx->total_elements;
415      color %= gfx->total_colors;
416      pen_base = gfx->color_base + gfx->color_granularity * color;
417      gfx_addr = gfx->gfxdata + code * gfx->char_modulo;
418      gfx_pitch = gfx->line_modulo;
419
420      for( y=0; y<8; y++ )
421      {
422         ypos = sy+(flipy?7-y:y);
423         if (ypos >= cliprect->min_y && ypos <= cliprect->max_y)
424         {
425            pri = BITMAP_ADDR8(priority_bitmap, ypos, 0);
426            dest = BITMAP_ADDR16(bitmap, ypos, 0);
427            if( flipx )
428            {
429               dest += sx+7;
430               pri += sx+7;
431               for( x=0; x<8; x++ )
432                  if (sx-x >= cliprect->min_x && sx-x <= cliprect->max_x)
433                  {
434                     if( priority>=pri[-x] )
435                     {
436                        dest[-x] = pen_base + gfx_addr[x];
437                     }
438                     pri[-x] = 0xff;
439                  }
440            }
441            else
442            {
443               dest += sx;
444               pri += sx;
445               for( x=0; x<8; x++ )
446                  if (sx+x >= cliprect->min_x && sx+x <= cliprect->max_x)
447                  {
448                     if( priority>=pri[x] )
449                     {
450                        dest[x] = pen_base + gfx_addr[x];
451                     }
452                     pri[x] = 0xff;
453                  } /* next x */
454            } /* !flipx */
426            y_index += dy;
455427         }
456         gfx_addr += gfx_pitch;
457      } /* next y */
428      }
458429   }
459} /* pdraw_opaque_tile */
430} /* pdraw_tile */
460431
461static const UINT8 pri_mask[8] = { 0x00,0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f };
462
463432static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
464433{
465434   int which;
466435   const UINT16 *source = spriteram16;
467   void (*drawtile)(running_machine *,
468      bitmap_t *,
469      const rectangle *,
470      unsigned code,
471      int color,
472      int sx, int sy,
473      int flipx, int flipy,
474      int priority,
475      int bShadow );
476436   UINT16 sprite_control;
477437   UINT16 ypos,tile,color,xpos;
478438   int priority;
r2241r2242
486446
487447   for( which=0; which<0x100; which++ )
488448   { /* max 256 sprites */
489      ypos   = source[0];   /* FHHH---E YYYYYYYY    flipy, height, ypos */
449      ypos   = source[0];   /* FHHH---Y YYYYYYYY    flipy, height, ypos */
490450      tile   = source[1];   /* O???TTTT TTTTTTTT    opaque tile */
491      color   = source[2];   /* FSWW???B CCCC?PPP    flipx, shadow, width, color, pri*/
451      color   = source[2];   /* FSWWOOOO CCCCBPPP    flipx, shadow, width, color offset for 4bpp, color, 4bbp - 8bpp mode, pri*/
492452      xpos   = source[3];   /* -------X XXXXXXXX    xpos */
493453
494      priority = pri_mask[color&0x7];
454      priority = color&0x7;
495455      width = ((color>>12)&0x3)+1;
496456      height = ((ypos>>12)&0x7)+1;
497457      flipy = ypos&0x8000;
498458      flipx = color&0x8000;
499459
500      if( (tile&0x8000)==0 )
501      {
502         drawtile = pdraw_masked_tile;
503      }
504      else
505      {
506         drawtile = pdraw_opaque_tile;
507      }
508460      for( row=0; row<height; row++ )
509461      {
510462         sy = (ypos&0x1ff)-30+32;
r2241r2242
527479            {
528480               sx+=col*8;
529481            }
530            drawtile(machine,
531               bitmap,
532               cliprect,
533               tile + row*64+col,
534               (color>>4)&0xf,
535               ((sx+16)&0x1ff)-8,
536               ((sy+8)&0x1ff)-8,
537               flipx,flipy,
538               priority,
539               color&0x4000 /* shadow */ );
482
483            if(color & 8)
484            {
485               pdraw_tile(machine,
486                  bitmap,
487                  cliprect,
488                  (tile & 0xfff) + row*64+col,
489                  ((color>>4)&0xf) * 0x10 + ((color & 0xf00) >> 8),
490                  ((sx+16)&0x1ff)-8,
491                  ((sy+8)&0x1ff)-8,
492                  flipx,flipy,
493                  priority,
494                  color & 0x4000, /* shadow */
495                  tile & 0x8000, /* opaque */
496                  1 /* 4bpp gfx */ );
497            }
498            else
499            {
500               pdraw_tile(machine,
501                  bitmap,
502                  cliprect,
503                  (tile & 0xfff) + row*64+col,
504                  (color>>4)&0xf,
505                  ((sx+16)&0x1ff)-8,
506                  ((sy+8)&0x1ff)-8,
507                  flipx,flipy,
508                  priority,
509                  color & 0x4000, /* shadow */
510                  tile & 0x8000, /* opaque */
511                  0 /* 8bpp gfx */ );
512            }
513
540514         } /* next col */
541515      } /* next row */
542516      source += 4;
r2241r2242
616590         {
617591            tilemap_set_scrollx( bg_tilemap[which], 0, scrollx );
618592            tilemap_set_scrolly( bg_tilemap[which], 0, scrolly );
619            tilemap_draw( bitmap, &clip, bg_tilemap[which], 0, primask );
593            tilemap_draw_primask( bitmap, &clip, bg_tilemap[which], 0, primask, 0 );
594
595#if 0
596            INT16 incxy, incyx, incxx, incyy;
597            INT16 xoffset, yoffset;
598            UINT32 startx,starty;
599
600            incxx = (INT16)namcona1_vreg[0xc0/2]; // or incyy ?
601            incxy = (INT16)namcona1_vreg[0xc2/2];
602            incyx = (INT16)namcona1_vreg[0xc4/2];
603            incyy = (INT16)namcona1_vreg[0xc6/2]; // or incxx ?
604            xoffset = namcona1_vreg[0xc8/2];
605            yoffset = namcona1_vreg[0xca/2];
606            //namcona1_vreg[0xcc/2]; // ?
607
608            startx = ((xoffset + a) << 12);
609            starty = ((yoffset + b) << 12);
610
611            popmessage("scrollx = %x - scrolly = %x - xo = %d - yo = %d",scrollx,scrolly,xoffset,yoffset);
612
613            tilemap_draw_roz_primask(bitmap, &clip, bg_tilemap[which],
614               startx , starty ,
615               incxx << 8, incxy << 8, incyx << 8, incyy << 8,
616               0, 0, primask, 0);
617#endif
618
620619         }
621620      }
622621   }
r2241r2242
651650         }
652651      } /* next tilemap */
653652      fillbitmap( priority_bitmap,0,cliprect );
654      fillbitmap( bitmap,0,cliprect );
653
654      // It fixes bg in emeralda
655      fillbitmap( bitmap,/* 0 */ 0xff,cliprect );
656
655657      for( priority = 0; priority<8; priority++ )
656658      {
657659         for( which=NAMCONA1_NUM_TILEMAPS-1; which>=0; which-- )
658660         {
659661            if( (namcona1_vreg[0x50+which]&0x7) == priority )
660662            {
661               draw_background(screen->machine,bitmap,cliprect,which,pri_mask[priority] );
663               draw_background(screen->machine,bitmap,cliprect,which,priority);
662664            }
663665         } /* next tilemap */
664666      } /* next priority level */
src/mame/video/armedf.c
r2241r2242
167167
168168WRITE16_HANDLER( terraf_fg_scrollx_w )
169169{
170   if (ACCESSING_MSB)
170   if (ACCESSING_BITS_8_15)
171171   {
172172      armedf_fg_scrollx = data >> 8;
173173      waiting_msb = 1;
r2241r2242
176176
177177WRITE16_HANDLER( terraf_fg_scrolly_w )
178178{
179   if (ACCESSING_MSB)
179   if (ACCESSING_BITS_8_15)
180180   {
181181      if (waiting_msb)
182182         terraf_scroll_msb = data >> 8;
r2241r2242
187187
188188WRITE16_HANDLER( terraf_fg_scroll_msb_arm_w )
189189{
190   if (ACCESSING_MSB)
190   if (ACCESSING_BITS_8_15)
191191      waiting_msb = 0;
192192}
193193
src/mame/video/kaneko16.c
r2241r2242
694694   switch (offset)
695695   {
696696      case 0:
697         if (ACCESSING_LSB)
697         if (ACCESSING_BITS_0_7)
698698         {
699699            kaneko16_sprite_flipx = new_data & 2;
700700            kaneko16_sprite_flipy = new_data & 1;
src/mame/video/ms32.c
r2241r2242
220220
221221WRITE32_HANDLER( ms32_gfxctrl_w )
222222{
223   if (ACCESSING_LSB32)
223   if (ACCESSING_BITS_0_7)
224224   {
225225      /* bit 1 = flip screen */
226226      flipscreen = data & 0x02;
src/mame/video/spbactn.c
r2241r2242
9292
9393               drawgfx(bitmap, machine->gfx[2],
9494                  code + layout[row][col],
95                  color,
95                  machine->gfx[2]->color_base + color * machine->gfx[2]->color_granularity,
9696                  flipx, flipy,
9797                  x, y,
98                  cliprect, TRANSPARENCY_PEN, 0);
98                  cliprect, TRANSPARENCY_PEN_RAW, 0);
9999            }
100100         }
101101
r2241r2242
135135
136136      drawgfx(tile_bitmap_bg, screen->machine->gfx[1],
137137               code,
138               color,
138               screen->machine->gfx[1]->color_base + color * screen->machine->gfx[1]->color_granularity,
139139               0, 0,
140140               16 * sx, 8 * sy,
141               cliprect, TRANSPARENCY_NONE, 0);
141               cliprect, TRANSPARENCY_PEN_RAW, -1);
142142
143143      sx++;
144144      if (sx > 63)
r2241r2242
162162
163163         drawgfx(tile_bitmap_bg, screen->machine->gfx[1],
164164               code,
165               color,
165               screen->machine->gfx[1]->color_base + color * screen->machine->gfx[1]->color_granularity,
166166               0, 0,
167167               16 * sx, 8 * sy,
168               cliprect, TRANSPARENCY_PEN, 0);
168               cliprect, TRANSPARENCY_PEN_RAW, 0);
169169
170170         sx++;
171171         if (sx > 63)
r2241r2242
196196
197197      drawgfx(tile_bitmap_fg, screen->machine->gfx[0],
198198               code,
199               color,
199               screen->machine->gfx[0]->color_base + color * screen->machine->gfx[0]->color_granularity,
200200               0, 0,
201201               16 * sx, 8 * sy,
202               cliprect, TRANSPARENCY_PEN, 0);
202               cliprect, TRANSPARENCY_PEN_RAW, 0);
203203
204204      sx++;
205205      if (sx > 63)
src/mame/video/taito_b.c
r2241r2242
9595
9696   COMBINE_DATA (&TC0180VCU_ctrl[offset]);
9797
98   if (ACCESSING_MSB)
98   if (ACCESSING_BITS_8_15)
9999   {
100100      switch(offset)
101101      {
r2241r2242
143143
144144  COMBINE_DATA(&taitob_pixelram[offset]);
145145
146  if (ACCESSING_LSB)
146  if (ACCESSING_BITS_0_7)
147147  {
148148    /* bit 15 of pixel_scroll[0] is probably flip screen */
149149
r2241r2242
320320  int sy = offset >> 8;
321321  int sx = 2*(offset & 0xff);
322322
323  if (ACCESSING_MSB)
323  if (ACCESSING_BITS_8_15)
324324   *BITMAP_ADDR16(framebuffer[sy >> 8], sy & 0xff, sx + 0) = data >> 8;
325  if (ACCESSING_LSB)
325  if (ACCESSING_BITS_0_7)
326326   *BITMAP_ADDR16(framebuffer[sy >> 8], sy & 0xff, sx + 1) = data & 0xff;
327327}
328328
src/mame/video/taitoic.c
r2241r2242
26152615
26162616WRITE32_HANDLER( TC0100SCN_ctrl_long_w )
26172617{
2618   if (ACCESSING_MSW32) TC0100SCN_ctrl_word_w(0,offset*2,data>>16,mem_mask>>16);
2619   if (ACCESSING_LSW32) TC0100SCN_ctrl_word_w(0,(offset*2)+1,data&0xffff,mem_mask&0xffff);
2618   if (ACCESSING_BITS_16_31) TC0100SCN_ctrl_word_w(0,offset*2,data>>16,mem_mask>>16);
2619   if (ACCESSING_BITS_0_15) TC0100SCN_ctrl_word_w(0,(offset*2)+1,data&0xffff,mem_mask&0xffff);
26202620}
26212621
26222622READ32_HANDLER( TC0100SCN_long_r )
r2241r2242
26262626
26272627WRITE32_HANDLER( TC0100SCN_long_w )
26282628{
2629   if (((mem_mask & 0xff000000) == 0) || ((mem_mask & 0x00ff0000) == 0))
2629   if (ACCESSING_BITS_16_31)
26302630   {
26312631      int oldword = TC0100SCN_word_0_r(machine,offset*2,0);
26322632      int newword = data>>16;
2633      if ((mem_mask & 0x00ff0000) != 0)
2633      if (!ACCESSING_BITS_16_23)
26342634         newword |= (oldword &0x00ff);
2635      if ((mem_mask & 0xff000000) != 0)
2635      if (!ACCESSING_BITS_24_31)
26362636         newword |= (oldword &0xff00);
26372637      TC0100SCN_word_0_w(machine,offset*2,newword,0);
26382638   }
2639   if (((mem_mask & 0x0000ff00) == 0) || ((mem_mask & 0x000000ff) == 0))
2639   if (ACCESSING_BITS_0_15)
26402640   {
26412641      int oldword = TC0100SCN_word_0_r(machine,(offset*2)+1,0);
26422642      int newword = data&0xffff;
2643      if ((mem_mask & 0x000000ff) != 0)
2643      if (!ACCESSING_BITS_0_7)
26442644         newword |= (oldword &0x00ff);
2645      if ((mem_mask & 0x0000ff00) != 0)
2645      if (!ACCESSING_BITS_8_15)
26462646         newword |= (oldword &0xff00);
26472647      TC0100SCN_word_0_w(machine,(offset*2)+1,newword,0);
26482648   }
r2241r2242
29172917
29182918WRITE16_HANDLER( TC0360PRI_halfword_w )
29192919{
2920   if (ACCESSING_LSB)
2920   if (ACCESSING_BITS_0_7)
29212921   {
29222922      TC0360PRI_w(machine,offset,data & 0xff);
29232923#if 0
r2241r2242
29312931
29322932WRITE16_HANDLER( TC0360PRI_halfword_swap_w )
29332933{
2934   if (ACCESSING_MSB)
2934   if (ACCESSING_BITS_8_15)
29352935   {
29362936      TC0360PRI_w(machine,offset,(data >> 8) & 0xff);
29372937#if 0
r2241r2242
32823282
32833283WRITE32_HANDLER( TC0480SCP_ctrl_long_w )
32843284{
3285   if (ACCESSING_MSW32) TC0480SCP_ctrl_word_w(machine,offset*2,data>>16,mem_mask>>16);
3286   if (ACCESSING_LSW32) TC0480SCP_ctrl_word_w(machine,(offset*2)+1,data&0xffff,mem_mask&0xffff);
3285   if (ACCESSING_BITS_16_31) TC0480SCP_ctrl_word_w(machine,offset*2,data>>16,mem_mask>>16);
3286   if (ACCESSING_BITS_0_15) TC0480SCP_ctrl_word_w(machine,(offset*2)+1,data&0xffff,mem_mask&0xffff);
32873287}
32883288
32893289READ32_HANDLER( TC0480SCP_long_r )
r2241r2242
32933293
32943294WRITE32_HANDLER( TC0480SCP_long_w )
32953295{
3296   if (((mem_mask & 0xff000000) == 0) || ((mem_mask & 0x00ff0000) == 0))
3296   if (ACCESSING_BITS_16_31)
32973297   {
32983298      int oldword = TC0480SCP_word_r(machine,offset*2,0);
32993299      int newword = data>>16;
3300      if ((mem_mask & 0x00ff0000) != 0)
3300      if (!ACCESSING_BITS_16_23)
33013301         newword |= (oldword &0x00ff);
3302      if ((mem_mask & 0xff000000) != 0)
3302      if (!ACCESSING_BITS_24_31)
33033303         newword |= (oldword &0xff00);
33043304      TC0480SCP_word_w(machine,offset*2,newword,0);
33053305   }
3306   if (((mem_mask & 0x0000ff00) == 0) || ((mem_mask & 0x000000ff) == 0))
3306   if (ACCESSING_BITS_0_15)
33073307   {
33083308      int oldword = TC0480SCP_word_r(machine,(offset*2)+1,0);
33093309      int newword = data&0xffff;
3310      if ((mem_mask & 0x000000ff) != 0)
3310      if (!ACCESSING_BITS_0_7)
33113311         newword |= (oldword &0x00ff);
3312      if ((mem_mask & 0x0000ff00) != 0)
3312      if (!ACCESSING_BITS_8_15)
33133313         newword |= (oldword &0xff00);
33143314      TC0480SCP_word_w(machine,(offset*2)+1,newword,0);
33153315   }
r2241r2242
50225022
50235023WRITE16_HANDLER( TC0220IOC_halfword_port_w )
50245024{
5025   if (ACCESSING_LSB)
5025   if (ACCESSING_BITS_0_7)
50265026      TC0220IOC_port_w( machine, offset, data & 0xff );
50275027}
50285028
r2241r2242
50335033
50345034WRITE16_HANDLER( TC0220IOC_halfword_portreg_w )
50355035{
5036   if (ACCESSING_LSB)
5036   if (ACCESSING_BITS_0_7)
50375037      TC0220IOC_portreg_w( machine, offset, data & 0xff );
50385038}
50395039
r2241r2242
50445044
50455045WRITE16_HANDLER( TC0220IOC_halfword_byteswap_port_w )
50465046{
5047   if (ACCESSING_MSB)
5047   if (ACCESSING_BITS_8_15)
50485048      TC0220IOC_port_w( machine, offset, (data>>8) & 0xff );
50495049}
50505050
r2241r2242
50555055
50565056WRITE16_HANDLER( TC0220IOC_halfword_byteswap_portreg_w )
50575057{
5058   if (ACCESSING_MSB)
5058   if (ACCESSING_BITS_8_15)
50595059      TC0220IOC_portreg_w( machine, offset, (data>>8) & 0xff );
50605060}
50615061
r2241r2242
50665066
50675067WRITE16_HANDLER( TC0220IOC_halfword_w )
50685068{
5069   if (ACCESSING_LSB)
5069   if (ACCESSING_BITS_0_7)
50705070      TC0220IOC_w(machine,offset,data & 0xff);
50715071   else
50725072   {
r2241r2242
50855085
50865086WRITE16_HANDLER( TC0220IOC_halfword_byteswap_w )
50875087{
5088   if (ACCESSING_MSB)
5088   if (ACCESSING_BITS_8_15)
50895089      TC0220IOC_w(machine,offset,(data >> 8) & 0xff);
50905090   else
50915091   {
r2241r2242
51595159
51605160WRITE16_HANDLER( TC0510NIO_halfword_w )
51615161{
5162   if (ACCESSING_LSB)
5162   if (ACCESSING_BITS_0_7)
51635163      TC0510NIO_w(machine,offset,data & 0xff);
51645164   else
51655165   {
r2241r2242
52425242
52435243WRITE16_HANDLER( TC0640FIO_halfword_w )
52445244{
5245   if (ACCESSING_LSB)
5245   if (ACCESSING_BITS_0_7)
52465246      TC0640FIO_w(machine,offset,data & 0xff);
52475247   else
52485248   {
r2241r2242
52585258
52595259WRITE16_HANDLER( TC0640FIO_halfword_byteswap_w )
52605260{
5261   if (ACCESSING_MSB)
5261   if (ACCESSING_BITS_8_15)
52625262      TC0640FIO_w(machine,offset,(data >> 8) & 0xff);
52635263   else
52645264   {
src/mame/video/nova2001.c
r2241r2242
357357
358358VIDEO_UPDATE( pkunwar )
359359{
360   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | 0, 0);
361   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | 1, 0);
360   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0);
362361
363362   pkunwar_draw_sprites(screen->machine, bitmap, cliprect);
364363
src/mame/video/cps1.c
r2241r2242
2020Street Fighter II (Japan Rev C)             CPS-B-12  DL-0411-10007     C632           STF29 & IOB1
2121Magic Sword (US)                            CPS-B-13  DL-0411-10008     None           MS24B & IOB1
2222Street Fighter II (Japan)                   CPS-B-13  DL-0411-10008     C632           STF29 & IOB1
23Chiki Chiki Boys / Mega Twins               CPS-B-14  DL-0411-10009     ?              ?
23Chiki Chiki Boys / Mega Twins               CPS-B-14  DL-0411-10009     ?              CK24B & IOB1
2424Street Fighter II (US Rev I)                CPS-B-14  DL-0411-10009     C632           STF29 & IOB1
2525Nemo                                        CPS-B-15  DL-0411-10010     ?              NM24B & ?
2626Carrier Air Wing                            CPS-B-16  DL-0411-10011     None           CA24B & IOB1
r2241r2242
98980x6c-0x6d   Priority mask |   of these masks. The masks indicate pens in the tile
99990x6e-0x6f   Priority mask /   that have priority over sprites.
1001000x70-0x71   Control register (usually 0x003f). The details of how this register
101            works are unknown, but it definitely affects the palette; experiments
102            on the real board show that values different from 0x3f in the low 6
103            bits cause wrong colors. The other bits seem to be unused.
101            works are unknown, but it definitely affects the palette, and games
102            always set it together with the palette base register.
103            Experiments on the real board show that values different from 0x3f in
104            the low 6 bits cause wrong colors. The other bits seem to be unused.
104105            There is one CPS2 game (Slammasters II) setting this to 0x2f: the
105106            purpose is unknown.
106107            The only other places where this register seems to be set to a value
107108            different from 0x3f is during startup tests. Examples:
108            ghouls  0x02
109            strider 0x02
109            ghouls  0x02 (and palette base is set to 9105; palette base is 9100 normally)
110            strider 0x02 (and palette base is set to 9145; palette base is 9140 normally)
111            1941    0x02 (and palette base is set to 9145; palette base is 9140 normally)
110112            unsquad 0x0f
111113            kod     0x0f
112114            mtwins  0x0f
r2241r2242
165167some sprites. When an enemy falls to the floor near the edge of the bridge,
166168parts of it become visible under the bridge.
167169
170varth
171* the background color during startup is brown, while it should most likely be
172  black. This is caused by the background color palette entry (0xbff), however
173  that entry is definitely correct and used by other games (3wonders, mtwins)
174  to make the background different from black.
175  The boot screen of some CPS2 also has a blue background instead of black,
176  however that might be the correct behaviour.
168177
178
169179Unknown issues
170180==============
171181
r2241r2242
270280   {"ghouls",  CPS_B_01, 0,0,0, 0x0000,0xffff,0x0000,0xffff, 1 },
271281   {"ghoulsu", CPS_B_01, 0,0,0, 0x0000,0xffff,0x0000,0xffff, 1 },
272282   {"daimakai",CPS_B_01, 0,0,0, 0x0000,0xffff,0x0000,0xffff, 1 },
273   {"strider", CPS_B_01, 1,0,1, 0x0000,0xffff,0x0000,0xffff },
274   {"stridrua",CPS_B_01, 1,0,1, 0x0000,0xffff,0x0000,0xffff },
275   {"striderj",CPS_B_01, 1,0,1, 0x0000,0xffff,0x0000,0xffff },
276   {"stridrja",CPS_B_01, 1,0,1, 0x0000,0xffff,0x0000,0xffff },
283   {"strider", CPS_B_01, 1,0,1, 0x0000,0xffff,0x0000,0xffff, 11 },
284   {"stridrua",CPS_B_01, 1,0,1, 0x0000,0xffff,0x0000,0xffff, 11 },
285   {"striderj",CPS_B_01, 1,0,1, 0x0000,0xffff,0x0000,0xffff, 11 },
286   {"stridrja",CPS_B_01, 1,0,1, 0x0000,0xffff,0x0000,0xffff, 11 },
277287   {"dynwar",  CPS_B_02, 0,1,1, 0x0000,0xffff,0x0000,0xffff },
278288   {"dynwarj", CPS_B_02, 0,1,1, 0x0000,0xffff,0x0000,0xffff },
279289   {"willow",  CPS_B_03, 0,1,0, 0x0000,0xffff,0x0000,0xffff },
r2241r2242
287297   {"ffightj1",CPS_B_02, 0,0,0, 0x0001,0xffff,0x0001,0xffff },
288298   {"1941",    CPS_B_05, 0,0,0, 0x0000,0xffff,0x0400,0x07ff },
289299   {"1941j",   CPS_B_05, 0,0,0, 0x0000,0xffff,0x0400,0x07ff },
290   {"unsquad", CPS_B_11, 0,0,0, 0x0000,0xffff,0x0001,0xffff },   /* CPSB ID not checked, but it's the same as sf2eg */
291   {"area88",  CPS_B_11, 0,0,0, 0x0000,0xffff,0x0001,0xffff },   /* CPSB ID not checked, but it's the same as sf2eg */
300   {"unsquad", CPS_B_11, 0,0,0, 0x0000,0xffff,0x0001,0xffff, 11 },   /* CPSB ID not checked, but it's the same as sf2eg */
301   {"area88",  CPS_B_11, 0,0,0, 0x0000,0xffff,0x0001,0xffff, 11 },   /* CPSB ID not checked, but it's the same as sf2eg */
292302   {"mercs",   CPS_B_12, 0,0,0, 0x0600,0x5bff,0x0700,0x17ff, 4 },   /* (uses port 74) */
293303   {"mercsu",  CPS_B_12, 0,0,0, 0x0600,0x5bff,0x0700,0x17ff, 4 },   /* (uses port 74) */
294304   {"mercsua", CPS_B_12, 0,0,0, 0x0600,0x5bff,0x0700,0x17ff, 4 },   /* (uses port 74) */
r2241r2242
325335   {"kodu",    BATTRY_2, 0,0,0, 0x0000,0xffff,0x0000,0xffff },
326336   {"kodj",    BATTRY_2, 0,0,0, 0x0000,0xffff,0x0000,0xffff },
327337   {"kodb",    BATTRY_2, 0,0,0, 0x0000,0xffff,0x0000,0xffff },   /* bootleg, doesn't use multiply protection */
328   {"captcomm",BATTRY_3, 0,0,0, 0x0000,0xffff,0x0000,0xffff },
329   {"captcomu",BATTRY_3, 0,0,0, 0x0000,0xffff,0x0000,0xffff },
330   {"captcomj",BATTRY_3, 0,0,0, 0x0000,0xffff,0x0000,0xffff },
338   {"captcomm",BATTRY_3, 0,0,0, 0x0000,0xffff,0x0000,0xffff, 11 },
339   {"captcomu",BATTRY_3, 0,0,0, 0x0000,0xffff,0x0000,0xffff, 11 },
340   {"captcomj",BATTRY_3, 0,0,0, 0x0000,0xffff,0x0000,0xffff, 11 },
331341   {"knights", BATTRY_4, 0,0,0, 0x0000,0xffff,0x0000,0xffff, 3 },
332342   {"knightsu",BATTRY_4, 0,0,0, 0x0000,0xffff,0x0000,0xffff, 3 },
333343   {"knightsj",BATTRY_4, 0,0,0, 0x0000,0xffff,0x0000,0xffff, 3 },
r2241r2242
420430int cps1_scanline2;
421431int cps1_scancalls;
422432
423#ifdef UNUSED_FUNCTION
424void cps_setversion(int v)
425{
426    cps_version=v;
427}
428#endif
429433
430
431434static MACHINE_RESET( cps )
432435{
433436   const char *gamename = machine->gamedrv->name;
r2241r2242
571574if (VERBOSE)
572575{
573576if (offset > 0x22/2 &&
574        offset != cps1_game_config->layer_control/2 &&
577      offset != cps1_game_config->layer_control/2 &&
575578      offset != cps1_game_config->priority[0]/2 &&
576579      offset != cps1_game_config->priority[1]/2 &&
577580      offset != cps1_game_config->priority[2]/2 &&
r2241r2242
599602
600603/* Offset of each palette entry */
601604static int palette_basecolor[6];
602#define cps1_palette_entries (32*8)  /* Number colour schemes in palette */
605#define cps1_palette_entries (32*6)  /* Number colour schemes in palette */
603606
604607static const int cps1_scroll_size =0x4000;   /* scroll1, scroll2, scroll3 */
605608static const int cps1_obj_size    =0x0800;
r2241r2242
10151018   /* allows us to reproduce a problem seen with a ffight board where USA and Japanese
10161019       roms have been mixed to be reproduced (ffightua) -- it looks like each column
10171020       should alternate between the left and right side of the 16x16 tiles */
1018   if (tile_index&0x20) gfxset = 1;
1019   else gfxset = 0;
1021   gfxset = (tile_index & 0x20) >> 5;
10201022
1021   /* knights & msword */
1022   if (cps1_game_config->kludge == 3)
1023      if (code == 0xf020) { gfxset = 4; code = 0; } // use a blank tile (see startup text..)
1024
1025   /* 0x0020 appears to never be drawn for CPS1 games (it is drawn for CPS2 games though, see gigawing '0' in score for example) */
1026   if (cps_version == 1 && code == 0x0020) { gfxset = 4; code = 0; }
1027
10281023   SET_TILE_INFO(
10291024         gfxset,
10301025         code + base,
10311026         (attr & 0x1f) + palette_basecolor[1],
10321027         TILE_FLIPYX((attr & 0x60) >> 5));
10331028   tileinfo->group = (attr & 0x0180) >> 7;
1029
1030   if ((cps1_game_config->kludge == 3  && code == 0xf020) ||   // knights & msword: startup text
1031      (cps1_game_config->kludge == 2  && code == 0x0000) ||   // 3wonders: bottom of screen, between lives of first player and the word INSERT COIN
1032      (cps1_game_config->kludge == 11 && code == 0x0020))      // strider, unsquad, captcomm
1033   {
1034      tileinfo->pen_data = empty_tile;
1035   }
10341036}
10351037
10361038static TILE_GET_INFO( get_tile1_info )
r2241r2242
11611163    cps1_buffered_obj = auto_malloc (cps1_obj_size);
11621164    memset(cps1_buffered_obj, 0x00, cps1_obj_size);
11631165
1164    if (cps_version==2) {
1165   cps2_buffered_obj = auto_malloc (cps2_obj_size);
1166   memset(cps2_buffered_obj, 0x00, cps2_obj_size);
1167    }
1166   if (cps_version==2)
1167   {
1168      cps2_buffered_obj = auto_malloc (cps2_obj_size);
1169      memset(cps2_buffered_obj, 0x00, cps2_obj_size);
1170   }
11681171
11691172   memset(cps1_gfxram, 0, cps1_gfxram_size);   /* Clear GFX RAM */
11701173   memset(cps1_output, 0, cps1_output_size);   /* Clear output ports */
r2241r2242
11951198   palette_basecolor[2] = 2*32;   /* scroll2 */
11961199   palette_basecolor[3] = 3*32;   /* scroll3 */
11971200   palette_basecolor[4] = 4*32;   /* stars1 */
1198   palette_basecolor[5] = 5*32;   /* stars2 */
1201   palette_basecolor[5] = 5*32;   /* stars2 (and bg) */
11991202}
12001203
12011204VIDEO_START( cps1 )
12021205{
1203    cps_version=1;
1204    VIDEO_START_CALL(cps);
1206   cps_version=1;
1207   VIDEO_START_CALL(cps);
12051208}
12061209
12071210VIDEO_START( cps2 )
12081211{
1209    if (cps_version != 99)
1210    {
1211        cps_version=2;
1212    }
1213    VIDEO_START_CALL(cps);
1212   cps_version=2;
1213   VIDEO_START_CALL(cps);
12141214}
12151215
12161216/***************************************************************************
r2241r2242
12311231
12321232      if (palette != cps1_old_palette[offset])
12331233      {
1234            int red, green, blue, bright;
1234         int red, green, blue, bright;
12351235
12361236         bright = 0x10 + (palette>>12);
12371237
r2241r2242
14711471
14721472WRITE16_HANDLER( cps2_objram_bank_w )
14731473{
1474   if (ACCESSING_LSB)
1474   if (ACCESSING_BITS_0_7)
14751475   {
14761476      cps2_objram_bank = data & 1;
14771477   }
r2241r2242
18011801
18021802VIDEO_UPDATE( cps1 )
18031803{
1804    int layercontrol,l0,l1,l2,l3;
1804   int layercontrol,l0,l1,l2,l3;
18051805   int videocontrol=cps1_port(0x22);
18061806
18071807
r2241r2242
18131813   cps1_get_video_base();
18141814
18151815   /* Find the offset of the last sprite in the sprite table */
1816    cps1_find_last_sprite();
1817    if (cps_version == 2)
1818    {
1819        cps2_find_last_sprite();
1820    }
1816   cps1_find_last_sprite();
1817   if (cps_version == 2)
1818   {
1819      cps2_find_last_sprite();
1820   }
18211821   /* Build palette */
18221822   cps1_build_palette(screen->machine);
18231823
r2241r2242
18491849
18501850
18511851   /* Blank screen */
1852   fillbitmap(bitmap,4095,cliprect);
1852   fillbitmap(bitmap,0xbff,cliprect);
18531853
18541854   cps1_render_stars(screen, bitmap,cliprect);
18551855
src/mame/video/mermaid.c
r2241r2242
88
99static bitmap_t* helper;
1010static bitmap_t* helper2;
11static int collision_sprite_background,collision_sprite_foreground,collision_sprite_sprite_boat,collision_sprite_sprite_wind;
11static int coll_bit0,coll_bit1,coll_bit2,coll_bit3,coll_bit6;
1212
1313static int rougien_gfxbank1, rougien_gfxbank2;
1414
r2241r2242
107107READ8_HANDLER( mermaid_collision_r )
108108{
109109   /*
110        collision register active LO
111        Bit 0
112        Bit 1 - Sprite - Foreground
113        Bit 2 - Sprite - Stream
114        Bit 3 - Sprite (Wind) - Sprite
110        collision register active LOW:
111
112    with coll = spriteram[offs + 2] & 0xc0
113
114        Bit 0 - Sprite (coll = 0x40) - Sprite (coll = 0x00)
115        Bit 1 - Sprite (coll = 0x40) - Foreground
116        Bit 2 - Sprite (coll = 0x40) - Background
117        Bit 3 - Sprite (coll = 0x80) - Sprite (coll = 0x00)
115118        Bit 4
116119        Bit 5
117        Bit 6 - Sprite (Boat) - Sprite
120        Bit 6 - Sprite (coll = 0x40) - Sprite (coll = 0x80)
118121        Bit 7
119122    */
120123
121124   int collision = 0xff;
122125
123   if(collision_sprite_foreground) collision  &= 0xfd;
124   if(collision_sprite_background) collision  &= 0xfb;
126   if(coll_bit0) collision &= 0xfe;
127   if(coll_bit1) collision &= 0xfd;
128   if(coll_bit2) collision &= 0xfb;
129   if(coll_bit3) collision &= 0xf7;
130   if(coll_bit6) collision &= 0xbf;
125131
126   if(collision_sprite_sprite_wind) collision &= 0xf7;
127   if(collision_sprite_sprite_boat) collision &= 0xbf;
128
129132   return collision;
130133}
131134
r2241r2242
179182      int sx = spriteram[offs + 3] + 1;
180183      int sy = 240 - spriteram[offs + 1];
181184
185      if (sx >= 0xf0) sx -= 256;
186
182187      code |= rougien_gfxbank1 * 0x2800;
183188      code |= rougien_gfxbank2 * 0x2400;
184189
r2241r2242
220225      {
221226         UINT16 a = colortable_entry_get_value(colortable, *BITMAP_ADDR16(helper, y, x));
222227         UINT16 b = colortable_entry_get_value(colortable, *BITMAP_ADDR16(helper2, y, x));
228
223229         if (b != 0)
224            if (a != 0)
230            if ((a != 0) & (a != 0x40))
225231               data |= 0x01;
226232      }
227233
r2241r2242
234240
235241   int offs,offs2;
236242
237   collision_sprite_foreground = 0;
238   collision_sprite_sprite_boat = 0;
239   collision_sprite_sprite_wind = 0;
243   coll_bit1 = 0;
244   coll_bit2 = 0;
245   coll_bit3 = 0;
246   coll_bit6 = 0;
247   coll_bit0 = 0;
240248
241   // check for "boat" sprite
249   // check for bit 0 (sprite-sprite), 1 (sprite-foreground), 2 (sprite-background)
242250
243   for (offs = spriteram_size - 4; offs >= spriteram_size - (4*2); offs -= 4)
251   for (offs = spriteram_size - 4; offs >= 0; offs -= 4)
244252   {
245253      int attr = spriteram[offs + 2];
246254      int bank = (attr & 0x30) >> 4;
255      int coll = (attr & 0xc0) >> 6;
247256      int code = (spriteram[offs] & 0x3f) | (bank << 6);
248//      int color = attr & 0x0f;
249257      int flipx = spriteram[offs] & 0x40;
250258      int flipy = spriteram[offs] & 0x80;
251259      int sx = spriteram[offs + 3] + 1;
r2241r2242
253261
254262      rectangle rect;
255263
264      if (coll != 1) continue;
265
256266      code |= rougien_gfxbank1 * 0x2800;
257267      code |= rougien_gfxbank2 * 0x2400;
258268
r2241r2242
282292      if (rect.max_y > visarea->max_y)
283293         rect.max_y = visarea->max_y;
284294
285      // check collision sprite-background (stream)
295      // check collision sprite - background
286296
287297      fillbitmap(helper,0,&rect);
288298      fillbitmap(helper2,0,&rect);
r2241r2242
292302      drawgfx(helper2, machine->gfx[1], code, 0, flipx, flipy, sx, sy,
293303         &rect,TRANSPARENCY_PEN, 0);
294304
295      collision_sprite_background |= collision_check(machine->colortable, &rect);
305      coll_bit2 |= collision_check(machine->colortable, &rect);
296306
297      // check collision sprite-foreground
307      // check collision sprite - foreground
298308
299309      fillbitmap(helper,0,&rect);
300310      fillbitmap(helper2,0,&rect);
r2241r2242
304314      drawgfx(helper2, machine->gfx[1], code, 0, flipx, flipy, sx, sy,
305315         &rect,TRANSPARENCY_PEN, 0);
306316
307      collision_sprite_foreground |= collision_check(machine->colortable, &rect);
317      coll_bit1 |= collision_check(machine->colortable, &rect);
308318
309      // check collision sprite "boat" - sprite
319      // check collision sprite - sprite
310320
311321      fillbitmap(helper,0,&rect);
312322      fillbitmap(helper2,0,&rect);
313323
314      for (offs2 = spriteram_size - (4*6) - 4; offs2 >= 0; offs2 -= 4)
324      for (offs2 = spriteram_size - 4; offs2 >= 0; offs2 -= 4)
315325         if (offs != offs2)
316326         {
317327            int attr2 = spriteram[offs2 + 2];
318328            int bank2 = (attr2 & 0x30) >> 4;
329            int coll2 = (attr2 & 0xc0) >> 6;
319330            int code2 = (spriteram[offs2] & 0x3f) | (bank2 << 6);
320//              int color2 = attr2 & 0x0f;
321331            int flipx2 = spriteram[offs2] & 0x40;
322332            int flipy2 = spriteram[offs2] & 0x80;
323333            int sx2 = spriteram[offs2 + 3] + 1;
324334            int sy2 = 240 - spriteram[offs2 + 1];
325335
336            if (coll2 != 0) continue;
337
326338            code2 |= rougien_gfxbank1 * 0x2800;
327339            code2 |= rougien_gfxbank2 * 0x2400;
328340
r2241r2242
342354               &rect,TRANSPARENCY_PEN, 0);
343355         }
344356
345         drawgfx(helper2, machine->gfx[1], code, 0, flipx, flipy, sx, sy,
357      drawgfx(helper2, machine->gfx[1], code, 0, flipx, flipy, sx, sy,
346358            &rect,TRANSPARENCY_PEN, 0);
347359
348         collision_sprite_sprite_boat |= collision_check(machine->colortable, &rect);
360      coll_bit0 |= collision_check(machine->colortable, &rect);
361   }
362
363   // check for bit 3 (sprite-sprite)
364
365   for (offs = spriteram_size - 4; offs >= 0; offs -= 4)
366   {
367      int attr = spriteram[offs + 2];
368      int bank = (attr & 0x30) >> 4;
369      int coll = (attr & 0xc0) >> 6;
370      int code = (spriteram[offs] & 0x3f) | (bank << 6);
371      int flipx = spriteram[offs] & 0x40;
372      int flipy = spriteram[offs] & 0x80;
373      int sx = spriteram[offs + 3] + 1;
374      int sy = 240 - spriteram[offs + 1];
375
376      rectangle rect;
377
378      if (coll != 2) continue;
379
380      code |= rougien_gfxbank1 * 0x2800;
381      code |= rougien_gfxbank2 * 0x2400;
382
383      if (flip_screen_x_get())
384      {
385         flipx = !flipx;
386         sx = 240 - sx;
349387      }
350388
351   // check for "sail" sprite
389      if (flip_screen_y_get())
390      {
391         flipy = !flipy;
392         sy = 240 - sy;
393      }
352394
353   for (offs = spriteram_size - 4*3; offs >= spriteram_size - (4*4); offs -= 4)
395      rect.min_x = sx;
396      rect.min_y = sy;
397      rect.max_x = sx + machine->gfx[1]->width - 1;
398      rect.max_y = sy + machine->gfx[1]->height - 1;
399
400      if (rect.min_x < visarea->min_x)
401         rect.min_x = visarea->min_x;
402      if (rect.min_y < visarea->min_y)
403         rect.min_y = visarea->min_y;
404      if (rect.max_x > visarea->max_x)
405         rect.max_x = visarea->max_x;
406      if (rect.max_y > visarea->max_y)
407         rect.max_y = visarea->max_y;
408
409      // check collision sprite - sprite
410
411      fillbitmap(helper,0,&rect);
412      fillbitmap(helper2,0,&rect);
413
414      for (offs2 = spriteram_size - 4; offs2 >= 0; offs2 -= 4)
415         if (offs != offs2)
416         {
417            int attr2 = spriteram[offs2 + 2];
418            int bank2 = (attr2 & 0x30) >> 4;
419            int coll2 = (attr2 & 0xc0) >> 6;
420            int code2 = (spriteram[offs2] & 0x3f) | (bank2 << 6);
421            int flipx2 = spriteram[offs2] & 0x40;
422            int flipy2 = spriteram[offs2] & 0x80;
423            int sx2 = spriteram[offs2 + 3] + 1;
424            int sy2 = 240 - spriteram[offs2 + 1];
425
426            if (coll2 != 0) continue;
427
428            code2 |= rougien_gfxbank1 * 0x2800;
429            code2 |= rougien_gfxbank2 * 0x2400;
430
431            if (flip_screen_x_get())
432            {
433               flipx2 = !flipx2;
434               sx2 = 240 - sx2;
435            }
436
437            if (flip_screen_y_get())
438            {
439               flipy2 = !flipy2;
440               sy2 = 240 - sy2;
441            }
442
443            drawgfx(helper, machine->gfx[1], code2, 0, flipx2, flipy2, sx2, sy2,
444               &rect,TRANSPARENCY_PEN, 0);
445         }
446
447      drawgfx(helper2, machine->gfx[1], code, 0, flipx, flipy, sx, sy,
448            &rect,TRANSPARENCY_PEN, 0);
449
450      coll_bit3 |= collision_check(machine->colortable, &rect);
451   }
452
453   // check for bit 6
454
455   for (offs = spriteram_size - 4; offs >= 0; offs -= 4)
354456   {
355457      int attr = spriteram[offs + 2];
356458      int bank = (attr & 0x30) >> 4;
459      int coll = (attr & 0xc0) >> 6;
357460      int code = (spriteram[offs] & 0x3f) | (bank << 6);
358//      int color = attr & 0x0f;
359461      int flipx = spriteram[offs] & 0x40;
360462      int flipy = spriteram[offs] & 0x80;
361463      int sx = spriteram[offs + 3] + 1;
r2241r2242
363465
364466      rectangle rect;
365467
468      if (coll != 1) continue;
469
366470      code |= rougien_gfxbank1 * 0x2800;
367471      code |= rougien_gfxbank2 * 0x2400;
368472
r2241r2242
392496      if (rect.max_y > visarea->max_y)
393497         rect.max_y = visarea->max_y;
394498
395      // check collision sprite "sail" - sprite
499      // check collision sprite - sprite
396500
397501      fillbitmap(helper,0,&rect);
398502      fillbitmap(helper2,0,&rect);
399503
400      for (offs2 = spriteram_size - (4*6) - 4; offs2 >= 0; offs2 -= 4)
504      for (offs2 = spriteram_size - 4; offs2 >= 0; offs2 -= 4)
401505         if (offs != offs2)
402506         {
403507            int attr2 = spriteram[offs2 + 2];
404508            int bank2 = (attr2 & 0x30) >> 4;
509            int coll2 = (attr2 & 0xc0) >> 6;
405510            int code2 = (spriteram[offs2] & 0x3f) | (bank2 << 6);
406//              int color2 = attr2 & 0x0f;
407511            int flipx2 = spriteram[offs2] & 0x40;
408512            int flipy2 = spriteram[offs2] & 0x80;
409513            int sx2 = spriteram[offs2 + 3] + 1;
410514            int sy2 = 240 - spriteram[offs2 + 1];
411515
516            if (coll2 != 2) continue;
517
412518            code2 |= rougien_gfxbank1 * 0x2800;
413519            code2 |= rougien_gfxbank2 * 0x2400;
414520
r2241r2242
424530               sy2 = 240 - sy2;
425531            }
426532
427            drawgfx(helper, machine->gfx[1], code2, 1, flipx2, flipy2, sx2, sy2,
533            drawgfx(helper, machine->gfx[1], code2, 0, flipx2, flipy2, sx2, sy2,
428534               &rect,TRANSPARENCY_PEN, 0);
429535         }
430536
431         drawgfx(helper2, machine->gfx[1], code, 0, flipx, flipy, sx, sy,
537      drawgfx(helper2, machine->gfx[1], code, 0, flipx, flipy, sx, sy,
432538            &rect,TRANSPARENCY_PEN, 0);
433539
434         collision_sprite_sprite_wind |= collision_check(machine->colortable, &rect);
435      }
540      coll_bit6 |= collision_check(machine->colortable, &rect);
541   }
542
436543}
src/mame/video/dcon.c
r2241r2242
2121
2222WRITE16_HANDLER( dcon_control_w )
2323{
24   if (ACCESSING_LSB)
24   if (ACCESSING_BITS_0_7)
2525   {
2626      dcon_enable=data;
2727      if ((dcon_enable&4)==4)
src/mame/video/galaxian.c
r2241r2242
11/***************************************************************************
22
3  Galaxian hardware family
3    Galaxian-derived video hardware
44
5***************************************************************************/
5****************************************************************************
66
7#include "driver.h"
8#include "includes/galaxian.h"
7    Video timing:
98
10static const rectangle _spritevisiblearea =
11{
12   2*8+1, 32*8-1,
13   2*8,   30*8-1
14};
15static const rectangle _spritevisibleareaflipx =
16{
17   0*8, 30*8-2,
18   2*8, 30*8-1
19};
9        The master clock is an 18.432MHz crystal. It is divided by 3 by
10        a pair of J/K flip-flops to 6.144MHz. This 6MHz signal is used to
11        drive most of the video logic. Note that due to the way the
12        divide-by-3 circuit is implemented, the duty cycle of the 6MHz
13        signal is 66% (i.e., it is high for 2 18MHz clocks and low for 1).
14        This is important for accurate stars rendering.
2015
21static const rectangle* spritevisiblearea;
22static const rectangle* spritevisibleareaflipx;
2316
17    Horizontal timing:
2418
25#define STARS_COLOR_BASE       (memory_region_length(REGION_PROMS))
26#define BULLETS_COLOR_BASE      (STARS_COLOR_BASE + 64)
27#define BACKGROUND_COLOR_BASE   (BULLETS_COLOR_BASE + 2)
19        H counts from 010000000 (128) to 111111111 (511), giving 384
20        total H clocks per scanline
2821
22        However, the top bit is inverted to become 256H, so when reading
23        the schematics it's really counting from:
24            110000000 -> 111111111 (blanking period)
25        and then from:
26            000000000 -> 011111111 (main portion of screen = 256 pixels)
2927
30UINT8 *galaxian_videoram;
31UINT8 *galaxian_spriteram;
32UINT8 *galaxian_spriteram2;
33UINT8 *galaxian_attributesram;
34UINT8 *galaxian_bulletsram;
35UINT8 *rockclim_videoram;
36size_t galaxian_spriteram_size;
37size_t galaxian_spriteram2_size;
38size_t galaxian_bulletsram_size;
28        HBLANK is a flip-flop clocked by 2H:
29          * It is held clear when 256H = 0 (main portion of screen)
30          * The D input is connected to !(64H & 32H & 16H & 8H)
31          * It is clocked to 1 when H=130
32          * It is clocked to 0 when H=250
33          * This gives 264 total non-blanked pixels:
34              6 additional pixels on the left (H=250..255)
35              256 main area pixels (H=256..511)
36              2 additional pixels on the right (H=128..129)
3937
38        HSYNC is a flip-flop clocked by 16H:
39          * It is held clear when 256H = 0 (main portion of screen)
40          * The D input is connected to !(!64H & 32H)
41          * HSYNC is the /Q output
42          * It is clocked to 1 when H=176
43          * It is clocked to 0 when H=208
4044
41static TILE_GET_INFO( get_tile_info );
42static TILE_GET_INFO( rockclim_get_tile_info );
43static tilemap *bg_tilemap;
44static tilemap *rockclim_tilemap;
45static int mooncrst_gfxextend;
46static int spriteram2_present;
47static UINT8 gfxbank[5];
48static UINT8 flipscreen_x;
49static UINT8 flipscreen_y;
50static UINT8 color_mask;
51static tilemap *dambustr_tilemap2;
52static UINT8 *dambustr_videoram2;
53static void (*modify_charcode)(UINT16 *code,UINT8 x);      /* function to call to do character banking */
54static void  gmgalax_modify_charcode(UINT16 *code,UINT8 x);
55static void mooncrst_modify_charcode(UINT16 *code,UINT8 x);
56static void mooncrgx_modify_charcode(UINT16 *code,UINT8 x);
57static void  moonqsr_modify_charcode(UINT16 *code,UINT8 x);
58static void mshuttle_modify_charcode(UINT16 *code,UINT8 x);
59static void   pisces_modify_charcode(UINT16 *code,UINT8 x);
60static void mimonkey_modify_charcode(UINT16 *code,UINT8 x);
61static void  batman2_modify_charcode(UINT16 *code,UINT8 x);
62static void  mariner_modify_charcode(UINT16 *code,UINT8 x);
63static void  jumpbug_modify_charcode(UINT16 *code,UINT8 x);
64static void dambustr_modify_charcode(UINT16 *code,UINT8 x);
6545
66static void (*modify_spritecode)(UINT8 *spriteram,int*,int*,int*,int);   /* function to call to do sprite banking */
67static void  gmgalax_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs);
68static void mooncrst_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs);
69static void mooncrgx_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs);
70static void  moonqsr_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs);
71static void mshuttle_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs);
72static void  calipso_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs);
73static void   pisces_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs);
74static void mimonkey_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs);
75static void  batman2_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs);
76static void  jumpbug_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs);
77static void dkongjrm_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs);
78static void   ad2083_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs);
79static void dambustr_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs);
46    Vertical timing:
8047
81static void (*modify_color)(UINT8 *color);   /* function to call to do modify how the color codes map to the PROM */
82static void frogger_modify_color(UINT8 *color);
83static void gmgalax_modify_color(UINT8 *color);
84static void drivfrcg_modify_color(UINT8 *color);
48        V counts from 011111000 (248) to 111111111 (511), giving 264
49        total V clocks per frame
8550
86static void (*modify_ypos)(UINT8*);   /* function to call to do modify how vertical positioning bits are connected */
87static void frogger_modify_ypos(UINT8 *sy);
51        IMPORTANT: the V sync chain is clocked by HSYNC. This means
52        that for the first 48 H clocks of the blanking period, the
53        V counter is one behind. This is important to take into account
54        for sprite and missile positioning.
8855
89static TIMER_CALLBACK( stars_blink_callback );
90static TIMER_CALLBACK( stars_scroll_callback );
56        VBLANK is a flip-flop clocked by 16V:
57          * The D input is connected to !(128V & 64V & 32V)
58          * It is clocked to 1 when V=496
59          * It is clocked to 0 when V=272
60          * This gives 224 total non-blanked pixels
9161
92static void (*tilemap_set_scroll)( tilemap *, int col, int value );
62        VSYNC is set to !256V:
63          * It is set to 1 when V=248
64          * It is cleared to 0 when V=256
9365
94/* star circuit */
95#define STAR_COUNT  252
96struct star
97{
98   int x,y,color;
99};
100static struct star stars[STAR_COUNT];
101static int stars_colors_start;
102       UINT8 galaxian_stars_on;
103static INT32 stars_scrollpos;
104static UINT8 stars_blink_state;
105static emu_timer *stars_blink_timer;
106static emu_timer *stars_scroll_timer;
107static UINT8 timer_adjusted;
108       void galaxian_init_stars(running_machine *machine, int colors_offset);
109static void (*draw_stars)(running_machine *machine, bitmap_t *, const rectangle *);      /* function to call to draw the star layer */
110static void     noop_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
111       void galaxian_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
112static void scramble_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
113static void   rescue_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
114static void  mariner_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
115static void  jumpbug_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
116static void start_stars_blink_timer(double ra, double rb, double c);
117static void start_stars_scroll_timer(running_machine *machine);
11866
119/* bullets circuit */
120static UINT8 darkplnt_bullet_color;
121static void (*draw_bullets)(bitmap_t *,int,int,int,const rectangle *);   /* function to call to draw a bullet */
122static void galaxian_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect);
123static void gteikob2_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect);
124static void scramble_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect);
125static void   theend_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect);
126static void darkplnt_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect);
127static void dambustr_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect);
67    Sprites and missiles:
12868
129/* background circuit */
130static UINT8 background_enable;
131static UINT8 background_red, background_green, background_blue;
132static void (*draw_background)(bitmap_t *, const rectangle *cliprect);   /* function to call to draw the background */
133static void galaxian_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
134static void scramble_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
135static void  turtles_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
136static void  mariner_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
137static void  frogger_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
138static void stratgyx_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
139static void  minefld_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
140static void   rescue_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
141static void dambustr_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
69        During the HBLANK period, sprites and missiles are processed.
70        Sprites are rendered into the line buffer, which was cleared
71        during the visible portion of the previous scanline.
14272
143static UINT16 rockclim_v;
144static UINT16 rockclim_h;
145static int dambustr_bg_split_line;
146static int dambustr_bg_color_1;
147static int dambustr_bg_color_2;
148static int dambustr_bg_priority;
149static int dambustr_char_bank;
150static bitmap_t *dambustr_tmpbitmap;
73        It takes 8 H clocks to set up a sprite, and 16 to render it
74        to the line buffer. The setup clocks are overlapped with the
75        rendering clocks. In theory this would result in enough time
76        to render 128/16 = 8 sprites. However, the setup does not
77        begin until after HBLANK, so there is only enough time to
78        render the first 7 1/2 entries.
15179
80        Interleaved with the setup for sprites is setup for the
81        shell and missile rendering. Shells and missiles are rendered
82        realtime during the visible portion of the frame, and are
83        effectively color-ORed directly into the final RGB output.
84        During the HBLANK setup period, each shell/missile entry is
85        compared against the current V position; if an exact match
86        is found, the H position is loaded into a dedicated 8-bit
87        counter. The counter clocks each pixel during the active video
88        period; when it reaches $FC it enables the output until it
89        hits zero, at which point it shuts itself off. Because there
90        is only one counter for shells and one for missiles, only one
91        shell and one missile can be specified per scanline. The last
92        matching entry found will always win.
15293
94        The difference between shell and missile is that shells
95        populate the first 7 entries and are rendered as white,
96        whereas missiles populate the final entry and are rendered
97        as yellow.
15398
154/***************************************************************************
99        Here is the detailed sequence of events for sprite and
100        missile/shell rendering during the first 24 H clocks of
101        HBLANK:
155102
156  Convert the color PROMs into a more useable format.
103            H=080: HPOSI=objram[40], /VPL latches V+objram[40]
104            H=081: HPOSI=objram[40]
105            H=082: HPOSI=objram[41], /OBJ DATA L latches picture number, H/V flip
106            H=083: HPOSI=objram[41]
107            H=084: HPOSI=objram[42], /COL L latches low 3 bits as color
108            H=085: HPOSI=objram[42]
109            H=086: HPOSI=objram[43]
110            H=087: HPOSI=objram[43], /CNTR LD latches X position
111            <sprite 0 begins rendering>
112            H=088: HPOSI=objram[40], /VPL latches V+objram[40]
113            H=089: HPOSI=objram[40]
114            H=08A: HPOSI=objram[61]
115            H=08B: HPOSI=objram[61], MSLD is latched if Y position matches shell
116            H=08C: HPOSI=objram[42]
117            H=08D: HPOSI=objram[42]
118            H=08E: HPOSI=objram[63]
119            H=08F: HPOSI=objram[63], /SLD fires to latch down shell counter value
120            H=090: HPOSI=objram[44], /VPL latches V+objram[44]
121            H=091: HPOSI=objram[44]
122            H=092: HPOSI=objram[45], /OBJ DATA L latches picture number, H/V flip
123            H=093: HPOSI=objram[45]
124            H=094: HPOSI=objram[46], /COL L latches low 3 bits as color
125            H=095: HPOSI=objram[46]
126            H=096: HPOSI=objram[47]
127            H=097: HPOSI=objram[47], /CNTR LD latches X position
128            <sprite 1 begins rendering>
157129
158  Galaxian has one 32 bytes palette PROM, connected to the RGB output this way:
130  From this, you can see the object RAM layout looks like:
159131
160  bit 7 -- 220 ohm resistor  -- BLUE
161        -- 470 ohm resistor  -- BLUE
162        -- 220 ohm resistor  -- GREEN
163        -- 470 ohm resistor  -- GREEN
164        -- 1  kohm resistor  -- GREEN
165        -- 220 ohm resistor  -- RED
166        -- 470 ohm resistor  -- RED
167  bit 0 -- 1  kohm resistor  -- RED
132            objram[40] = vertical position of sprite 0
133            objram[41] = picture number and H/V flip of sprite 0
134            objram[42] = color of sprite 0
135            objram[43] = horizontal position of sprite 0
168136
169  The output of the background star generator is connected this way:
137            objram[61] = vertical position of shell 0
138            objram[63] = horizontal count until shell 0 starts rendering
170139
171  bit 5 -- 100 ohm resistor  -- BLUE
172        -- 150 ohm resistor  -- BLUE
173        -- 100 ohm resistor  -- GREEN
174        -- 150 ohm resistor  -- GREEN
175        -- 100 ohm resistor  -- RED
176  bit 0 -- 150 ohm resistor  -- RED
140        A vertical match for a sprite is true if ((V + vpos) & 0xf0) == 0xf0.
141        A vertical match for a shell/missile is if ((V + vpos) & 0xff) == 0xff.
177142
178  The blue background in Scramble and other games goes through a 390 ohm
179  resistor.
143        Overall, the process for sprites and missiles during HBLANK looks
144        like this:
180145
181  The bullet RGB outputs go through 100 ohm resistors.
146            H=080: begin setup sprite 0
147            H=082: begin HBLANK
148            H=088: begin render sprite 0; begin setup shell 0
149            H=090: begin setup sprite 1
150            H=098: begin render sprite 1; begin setup shell 1
151            H=0A0: begin setup sprite 2
152            H=0A8: begin render sprite 2; begin setup shell 2
153            H=0B0: VSYNC increments V counter; subsequent sprites match V+1
154            H=0B0: begin setup sprite 3
155            H=0B8: begin render sprite 3; begin setup shell 3
156            H=0C0: begin setup sprite 4
157            H=0C8: begin render sprite 4; begin setup shell 4
158            H=0D0: begin setup sprite 5
159            H=0D8: begin render sprite 5; begin setup shell 5
160            H=0E0: begin setup sprite 6
161            H=0E8: begin render sprite 6; begin setup shell 6
162            H=0F0: begin setup sprite 7
163            H=0F8: begin render sprite 7; begin setup missile
164            H=0FA: end HBLANK
165            H=100: finish render sprite 7 (only 1/2 way through)
182166
183  The RGB outputs have a 470 ohm pull-down each.
184167
185***************************************************************************/
186PALETTE_INIT( galaxian )
187{
188   int i;
189168
169       /VPL: H=xxxxxx000 -> latches sum of V+HPOSI for vertical positioning
170     /COL L: H=xxxxxx100 -> latches HPOSI into color register (low 3 bits)
171        /LD: H=xxxxxx111 -> shift register load from ROM
172  /CNTR CLR: H=0xxxx0111 -> resets line buffer counter to 0
173/OBJ DATA L: H=1xxxx0010 -> latches HPOSI into picture number latch
174   /CNTR LD: H=1xxxx0111 -> latches HPOSI into line buffer counter (sprite X position)
175       /SLD: H=1xxxx1111 -> latches down counter until shell (except when /MLD)
176       /MLD: H=1x1111111 -> latches down counter until missile
190177
191   /* first, the character/sprite palette */
192178
193   for (i = 0;i < memory_region_length(REGION_PROMS);i++)
194   {
195      int bit0,bit1,bit2,r,g,b;
196179
197      /* red component */
198      bit0 = BIT(*color_prom,0);
199      bit1 = BIT(*color_prom,1);
200      bit2 = BIT(*color_prom,2);
201      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
202      /* green component */
203      bit0 = BIT(*color_prom,3);
204      bit1 = BIT(*color_prom,4);
205      bit2 = BIT(*color_prom,5);
206      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
207      /* blue component */
208      bit0 = BIT(*color_prom,6);
209      bit1 = BIT(*color_prom,7);
210      b = 0x4f * bit0 + 0xa8 * bit1;
180VRAM addresses:
181         addr  video
182  VRA7 =  A9   SUM7
183  VRA8 =  A8   SUM6
184  VRA6 =  A7   SUM5
185  VRA5 =  A6   SUM4
186  VRA4 =  A5   SUM3
187  VRA3 =  A4   128HB
188  VRA0 =  A3    64HB
189  VRA1 =  A2    32HB
190  VRA2 =  A1    16HB
191  VRA9 =  A0     8HB
211192
212      palette_set_color_rgb(machine,i,r,g,b);
213      color_prom++;
214   }
193OBJRAM addresses:
194         addr 256H=0 256H=1
195   RA4 =  A0    4H     2H
196   RA7 =  A1    8HB    4H
197   RA1 =  A2   16HB   16HB
198   RA0 =  A3   32HB   32HB
199   RA5 =  A4   64HB   64HB
200   RA6 =  A5  128HB  (2H & 8HB)
201   RA3 =  A6  256H   256H
202   RA2 =  A7    0      0
215203
204H=80: 00,00,01,01,02,02,03,03 00,00,21,21,02,02,23,23
205H=90: 04,04,05,05,06,06,07,07 04,04,25,25,06,06,27,27
206H=A0: 08,08,09,09,0A,0A,0B,0B 08,08,29,29,0A,0A,2B,2B
207H=B0: 0C,0C,0D,0D,0E,0E,0F,0F 0C,0C,2D,2D,0E,0E,2F,2F
216208
217   galaxian_init_stars(machine, STARS_COLOR_BASE);
218209
219210
220   /* bullets - yellow and white */
221   palette_set_color(machine,BULLETS_COLOR_BASE+0,MAKE_RGB(0xef,0xef,0x00));
222   palette_set_color(machine,BULLETS_COLOR_BASE+1,MAKE_RGB(0xef,0xef,0xef));
223}
211***************************************************************************/
224212
225PALETTE_INIT( scramble )
226{
227   PALETTE_INIT_CALL(galaxian);
213#include "driver.h"
214#include "video/resnet.h"
215#include "includes/galaxian.h"
228216
229217
230   /* blue background - 390 ohm resistor */
231   palette_set_color(machine,BACKGROUND_COLOR_BASE,MAKE_RGB(0,0,0x56));
232}
233218
234PALETTE_INIT( moonwar )
235{
236   PALETTE_INIT_CALL(scramble);
237219
220/*************************************
221 *
222 *  Constants
223 *
224 *************************************/
238225
239   /* wire mod to connect the bullet blue output to the 220 ohm resistor */
240   palette_set_color(machine,BULLETS_COLOR_BASE+0,MAKE_RGB(0xef,0xef,0x97));
241}
226#define STAR_RNG_PERIOD      ((1 << 17) - 1)
227#define RGB_MAXIMUM         224
242228
243PALETTE_INIT( turtles )
244{
245   int i;
246229
247230
248   PALETTE_INIT_CALL(galaxian);
231/*************************************
232 *
233 *  Global variables
234 *
235 *************************************/
249236
237/* rendering callbacks */
238galaxian_draw_bullet_func galaxian_draw_bullet_ptr;
239galaxian_draw_background_func galaxian_draw_background_ptr;
250240
251   /*  The background color generator is connected this way:
241/* tile/sprite modification callbacks */
242galaxian_extend_tile_info_func galaxian_extend_tile_info_ptr;
243galaxian_extend_sprite_info_func galaxian_extend_sprite_info_ptr;
252244
253        RED   - 390 ohm resistor
254        GREEN - 470 ohm resistor
255        BLUE  - 390 ohm resistor */
245/* global tweaks */
246UINT8 galaxian_frogger_adjust;
247UINT8 galaxian_sfx_tilemap;
248UINT8 galaxian_sprite_clip_start;
249UINT8 galaxian_sprite_clip_end;
256250
257   for (i = 0; i < 8; i++)
258   {
259      int r = BIT(i,0) * 0x55;
260      int g = BIT(i,1) * 0x47;
261      int b = BIT(i,2) * 0x55;
262251
263      palette_set_color_rgb(machine,BACKGROUND_COLOR_BASE+i,r,g,b);
264   }
265}
266252
267PALETTE_INIT( stratgyx )
268{
269   int i;
253/*************************************
254 *
255 *  Local variables
256 *
257 *************************************/
270258
259static tilemap *bg_tilemap;
271260
272   PALETTE_INIT_CALL(galaxian);
261static UINT8 flipscreen_x;
262static UINT8 flipscreen_y;
273263
264static UINT8 background_enable;
265static UINT8 background_red;
266static UINT8 background_green;
267static UINT8 background_blue;
274268
275   /*  The background color generator is connected this way:
269static UINT32 star_rng_origin;
270static UINT32 star_rng_origin_frame;
271static rgb_t star_color[64];
272static UINT8 *stars;
273static UINT8 stars_enabled;
274static UINT8 stars_blink_state;
276275
277        RED   - 270 ohm resistor
278        GREEN - 560 ohm resistor
279        BLUE  - 470 ohm resistor */
276static rgb_t bullet_color[8];
280277
281   for (i = 0; i < 8; i++)
282   {
283      int r = BIT(i,0) * 0x7c;
284      int g = BIT(i,1) * 0x3c;
285      int b = BIT(i,2) * 0x47;
278static UINT8 gfxbank[5];
286279
287      palette_set_color_rgb(machine,BACKGROUND_COLOR_BASE+i,r,g,b);
288   }
289}
290280
291PALETTE_INIT( frogger )
292{
293   PALETTE_INIT_CALL(galaxian);
294281
282/*************************************
283 *
284 *  Function prototypes
285 *
286 *************************************/
295287
296   /* blue background - 470 ohm resistor */
297   palette_set_color(machine,BACKGROUND_COLOR_BASE,MAKE_RGB(0,0,0x47));
298}
288static void state_save_register(void);
289static TILE_GET_INFO( bg_get_tile_info );
299290
300PALETTE_INIT( rockclim )
301{
302   int i;
291static void sprites_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *spritebase);
303292
293static void stars_init(void);
294static void stars_update_origin(running_machine *machine);
295static void stars_draw_row(bitmap_t *bitmap, int maxx, int y, UINT32 star_offs, UINT8 starmask);
304296
305   /* first, the character/sprite palette */
297static void bullets_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *base);
306298
307   for (i = 0;i < memory_region_length(REGION_PROMS);i++)
308   {
309      int bit0,bit1,bit2,r,g,b;
310299
311      /* red component */
312      bit0 = BIT(*color_prom,0);
313      bit1 = BIT(*color_prom,1);
314      bit2 = BIT(*color_prom,2);
315      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
316      /* green component */
317      bit0 = BIT(*color_prom,3);
318      bit1 = BIT(*color_prom,4);
319      bit2 = BIT(*color_prom,5);
320      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
321      /* blue component */
322      bit0 = BIT(*color_prom,6);
323      bit1 = BIT(*color_prom,7);
324      b = 0x4f * bit0 + 0xa8 * bit1;
325300
326      palette_set_color_rgb(machine,i,r,g,b);
327      color_prom++;
328   }
329}
330/***************************************************************************
301/*************************************
302 *
303 *  Palette setup
304 *
305 *************************************/
331306
332  Convert the color PROMs into a more useable format.
307PALETTE_INIT( galaxian )
308{
309   static const int rgb_resistances[3] = { 1000, 470, 220 };
310   double rweights[3], gweights[3], bweights[2];
311   int i, minval, midval, maxval;
312   UINT8 starmap[4];
333313
334  Dark Planet has one 32 bytes palette PROM, connected to the RGB output this way:
314   /*
315        Sprite/tilemap colors are mapped through a color PROM as follows:
335316
336  bit 5 -- 220 ohm resistor  -- BLUE
337        -- 470 ohm resistor  -- BLUE
338        -- 1  kohm resistor  -- BLUE
339        -- 220 ohm resistor  -- RED
340        -- 470 ohm resistor  -- RED
341  bit 0 -- 1  kohm resistor  -- RED
317          bit 7 -- 220 ohm resistor  -- BLUE
318                -- 470 ohm resistor  -- BLUE
319                -- 220 ohm resistor  -- GREEN
320                -- 470 ohm resistor  -- GREEN
321                -- 1  kohm resistor  -- GREEN
322                -- 220 ohm resistor  -- RED
323                -- 470 ohm resistor  -- RED
324          bit 0 -- 1  kohm resistor  -- RED
342325
343  The bullet RGB outputs go through 100 ohm resistors.
326        In parallel with these resistors are a pair of 150 ohm and 100 ohm
327        resistors on each R,G,B component that are connected to the star
328        generator.
344329
345  The RGB outputs have a 470 ohm pull-down each.
330        And in parallel with the whole mess are a set of 100 ohm resistors
331        on each R,G,B component that are enabled when a shell/missile is
332        enabled.
346333
347***************************************************************************/
348PALETTE_INIT( darkplnt )
349{
350   int i;
334        When computing weights, we use RGB_MAXIMUM as the maximum to give
335        headroom for stars and shells/missiles. This is not fully accurate,
336        but if we included all possible sources in parallel, the brightness
337        of the main game would be very low to allow for all the oversaturation
338        of the stars and shells/missiles.
339    */
340   compute_resistor_weights(0,   RGB_MAXIMUM, -1.0,
341         3, &rgb_resistances[0], rweights, 470, 0,
342         3, &rgb_resistances[0], gweights, 470, 0,
343         2, &rgb_resistances[1], bweights, 470, 0);
351344
352
353   /* first, the character/sprite palette */
354
355   for (i = 0;i < 32;i++)
345   /* decode the palette first */
346   for (i = 0; i < memory_region_length(REGION_PROMS); i++)
356347   {
357      int bit0,bit1,bit2,r,g,b;
348      UINT8 bit0, bit1, bit2, r, g, b;
358349
359350      /* red component */
360      bit0 = BIT(*color_prom,0);
361      bit1 = BIT(*color_prom,1);
362      bit2 = BIT(*color_prom,2);
363      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
351      bit0 = BIT(color_prom[i],0);
352      bit1 = BIT(color_prom[i],1);
353      bit2 = BIT(color_prom[i],2);
354      r = combine_3_weights(rweights, bit0, bit1, bit2);
355
364356      /* green component */
365      g = 0x00;
357      bit0 = BIT(color_prom[i],3);
358      bit1 = BIT(color_prom[i],4);
359      bit2 = BIT(color_prom[i],5);
360      g = combine_3_weights(gweights, bit0, bit1, bit2);
361
366362      /* blue component */
367      bit0 = BIT(*color_prom,3);
368      bit1 = BIT(*color_prom,4);
369      bit2 = BIT(*color_prom,5);
370      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
363      bit0 = BIT(color_prom[i],6);
364      bit1 = BIT(color_prom[i],7);
365      b = combine_2_weights(bweights, bit0, bit1);
371366
372      palette_set_color_rgb(machine,i,r,g,b);
373      color_prom++;
367      palette_set_color(machine, i, MAKE_RGB(r,g,b));
374368   }
375369
370   /*
371        The maximum sprite/tilemap resistance is ~130 Ohms with all RGB
372        outputs enabled (1/(1/1000 + 1/470 + 1/220)). Since we normalized
373        to RGB_MAXIMUM, this maps RGB_MAXIMUM -> 130 Ohms.
376374
377   /* bullets - red and blue */
378   palette_set_color(machine,BULLETS_COLOR_BASE+0,MAKE_RGB(0xef,0x00,0x00));
379   palette_set_color(machine,BULLETS_COLOR_BASE+1,MAKE_RGB(0x00,0x00,0xef));
380}
375        The stars are at 150 Ohms for the LSB, and 100 Ohms for the MSB.
376        This means the 3 potential values are:
381377
382PALETTE_INIT( minefld )
383{
384   int i;
378            150 Ohms -> RGB_MAXIMUM * 130 / 150
379            100 Ohms -> RGB_MAXIMUM * 130 / 100
380             60 Ohms -> RGB_MAXIMUM * 130 / 60
385381
382        Since we can't saturate that high, we instead approximate this
383        by compressing the values proportionally into the 194->255 range.
384    */
385   minval = RGB_MAXIMUM * 130 / 150;
386   midval = RGB_MAXIMUM * 130 / 100;
387   maxval = RGB_MAXIMUM * 130 / 60;
386388
387   PALETTE_INIT_CALL(galaxian);
389   /* compute the values for each of 4 possible star values */
390   starmap[0] = 0;
391   starmap[1] = minval;
392   starmap[2] = minval + (255 - minval) * (midval - minval) / (maxval - minval);
393   starmap[3] = 255;
388394
395   /* generate the colors for the stars */
396   for (i = 0; i < 64; i++)
397   {
398      UINT8 bit0, bit1, r, g, b;
389399
390   /* set up background colors */
400      /* bit 5 = red @ 150 Ohm, bit 4 = red @ 100 Ohm */
401      bit0 = BIT(i,5);
402      bit1 = BIT(i,4);
403      r = starmap[(bit1 << 1) | bit0];
391404
392   /* graduated blue */
405      /* bit 3 = green @ 150 Ohm, bit 2 = green @ 100 Ohm */
406      bit0 = BIT(i,3);
407      bit1 = BIT(i,2);
408      g = starmap[(bit1 << 1) | bit0];
393409
394   for (i = 0; i < 128; i++)
395   {
396      int r = 0;
397      int g = i;
398      int b = i * 2;
399      palette_set_color_rgb(machine,BACKGROUND_COLOR_BASE+i,r,g,b);
400   }
410      /* bit 1 = blue @ 150 Ohm, bit 0 = blue @ 100 Ohm */
411      bit0 = BIT(i,1);
412      bit1 = BIT(i,0);
413      b = starmap[(bit1 << 1) | bit0];
401414
402   /* graduated brown */
403
404   for (i = 0; i < 128; i++)
405   {
406      int r = i * 1.5;
407      int g = i * 0.75;
408      int b = i / 2;
409      palette_set_color_rgb(machine,BACKGROUND_COLOR_BASE+128+i,r,g,b);
415      /* set the RGB color */
416      star_color[i] = MAKE_RGB(r, g, b);
410417   }
418
419   /* default bullet colors are white for the first 7, and yellow for the last one */
420   for (i = 0; i < 7; i++)
421      bullet_color[i] = MAKE_RGB(0xff,0xff,0xff);
422   bullet_color[7] = MAKE_RGB(0xff,0xff,0x00);
411423}
412424
413PALETTE_INIT( rescue )
414{
415   int i;
416425
417426
418   PALETTE_INIT_CALL(galaxian);
427/*************************************
428 *
429 *  Common video init
430 *
431 *************************************/
419432
420
421   /* set up background colors */
422
423   /* graduated blue */
424
425   for (i = 0; i < 128; i++)
433VIDEO_START( galaxian )
434{
435   /* create a tilemap for the background */
436   if (!galaxian_sfx_tilemap)
426437   {
427      int r = 0;
428      int g = i;
429      int b = i * 2;
430      palette_set_color_rgb(machine,BACKGROUND_COLOR_BASE+i,r,g,b);
438      /* normal galaxian hardware is row-based and individually scrolling columns */
439      bg_tilemap = tilemap_create(bg_get_tile_info, tilemap_scan_rows, GALAXIAN_XSCALE*8,8, 32,32);
440      tilemap_set_scroll_cols(bg_tilemap, 32);
441      tilemap_set_scrolldx(bg_tilemap, 0, -GALAXIAN_XSCALE * 128);
442      tilemap_set_scrolldy(bg_tilemap, 0, 8);
431443   }
432}
433
434PALETTE_INIT( mariner )
435{
436   int i;
437
438
439   PALETTE_INIT_CALL(galaxian);
440
441
442   /* set up background colors */
443
444   /* 16 shades of blue - the 4 bits are connected to the following resistors:
445
446        bit 0 -- 4.7 kohm resistor
447              -- 2.2 kohm resistor
448              -- 1   kohm resistor
449        bit 0 -- .47 kohm resistor */
450
451   for (i = 0; i < 16; i++)
444   else
452445   {
453      int r,g,b;
454
455      r = 0;
456      g = 0;
457      b = 0x0e * BIT(i,0) + 0x1f * BIT(i,1) + 0x43 * BIT(i,2) + 0x8f * BIT(i,3);
458
459      palette_set_color_rgb(machine,BACKGROUND_COLOR_BASE+i,r,g,b);
446      /* sfx hardware is column-based and individually scrolling rows */
447      bg_tilemap = tilemap_create(bg_get_tile_info, tilemap_scan_cols, GALAXIAN_XSCALE*8,8, 32,32);
448      tilemap_set_scroll_rows(bg_tilemap, 32);
449      tilemap_set_scrolldx(bg_tilemap, 0, -GALAXIAN_XSCALE * 128);
450      tilemap_set_scrolldy(bg_tilemap, 0, 8);
460451   }
461}
452   tilemap_set_transparent_pen(bg_tilemap, 0);
462453
454   /* initialize globals */
455   flipscreen_x = 0;
456   flipscreen_y = 0;
457   background_enable = 0;
458   background_blue = 0;
459   background_red = 0;
460   background_green = 0;
463461
464PALETTE_INIT( dambustr )
465{
466   int i;
462   /* initialize stars */
463   stars_init();
467464
468   PALETTE_INIT_CALL(galaxian);
469
470
471   /*
472    Assumption (not clear from the schematics):
473    The background color generator is connected this way:
474
475        RED   - 470 ohm resistor
476        GREEN - 470 ohm resistor
477        BLUE  - 470 ohm resistor */
478
479
480   for (i = 0; i < 8; i++)
481   {
482      int r = BIT(i,0) * 0x47;
483      int g = BIT(i,1) * 0x47;
484      int b = BIT(i,2) * 0x4f;
485      palette_set_color_rgb(machine,BACKGROUND_COLOR_BASE+i,r,g,b);
486   }
465   /* register for save states */
466   state_save_register();
487467}
488468
489469
490
491/***************************************************************************
492
493  Start the video hardware emulation.
494
495***************************************************************************/
496
497470static void state_save_register(void)
498471{
499   state_save_register_global_array(gfxbank);
500472   state_save_register_global(flipscreen_x);
501473   state_save_register_global(flipscreen_y);
502
503   state_save_register_global(galaxian_stars_on);
504   state_save_register_global(stars_scrollpos);
505   state_save_register_global(stars_blink_state);
506
507   state_save_register_global(darkplnt_bullet_color);
508
509474   state_save_register_global(background_enable);
510475   state_save_register_global(background_red);
511476   state_save_register_global(background_green);
512477   state_save_register_global(background_blue);
513}
514478
515static void video_start_common(running_machine *machine, tilemap_mapper_func get_memory_offset)
516{
517   bg_tilemap = tilemap_create(get_tile_info,get_memory_offset,8,8,32,32);
479   state_save_register_global_array(gfxbank);
518480
519   tilemap_set_transparent_pen(bg_tilemap,0);
520
521
522   modify_charcode = 0;
523   modify_spritecode = 0;
524   modify_color = 0;
525   modify_ypos = 0;
526
527   mooncrst_gfxextend = 0;
528
529   draw_bullets = 0;
530
531   draw_background = galaxian_draw_background;
532   background_enable = 0;
533   background_blue = 0;
534   background_red = 0;
535   background_green = 0;
536
537   draw_stars = noop_draw_stars;
538
539   flipscreen_x = 0;
540   flipscreen_y = 0;
541
542   spriteram2_present = 0;
543
544   spritevisiblearea      = &_spritevisiblearea;
545   spritevisibleareaflipx = &_spritevisibleareaflipx;
546
547   color_mask = (machine->gfx[0]->color_granularity == 4) ? 7 : 3;
548
549   state_save_register();
481   state_save_register_global(stars_enabled);
482   state_save_register_global(star_rng_origin);
483   state_save_register_global(star_rng_origin_frame);
484   state_save_register_global(stars_blink_state);
550485}
551486
552VIDEO_START( galaxian_plain )
553{
554   video_start_common(machine,tilemap_scan_rows);
555487
556   tilemap_set_scroll_cols(bg_tilemap, 32);
557   tilemap_set_scroll = tilemap_set_scrolly;
558}
559488
560VIDEO_START( galaxian )
561{
562   VIDEO_START_CALL(galaxian_plain);
489/*************************************
490 *
491 *  Common video update
492 *
493 *************************************/
563494
564   draw_stars = galaxian_draw_stars;
565
566   draw_bullets = galaxian_draw_bullets;
567}
568
569VIDEO_START( gmgalax )
495VIDEO_UPDATE( galaxian )
570496{
571   VIDEO_START_CALL(galaxian);
497   /* draw the background layer (including stars) */
498   (*galaxian_draw_background_ptr)(screen->machine, bitmap, cliprect);
572499
573   modify_charcode   = gmgalax_modify_charcode;
574   modify_spritecode = gmgalax_modify_spritecode;
575   modify_color      = gmgalax_modify_color;
576}
500   /* draw the tilemap characters over top */
501   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
577502
578VIDEO_START( mooncrst )
579{
580   VIDEO_START_CALL(galaxian);
503   /* render the sprites next */
504   sprites_draw(screen->machine, bitmap, cliprect, &spriteram[0x40]);
581505
582   modify_charcode   = mooncrst_modify_charcode;
583   modify_spritecode = mooncrst_modify_spritecode;
584}
506   /* if we have bullets to draw, render them following */
507   if (galaxian_draw_bullet_ptr != NULL)
508      bullets_draw(screen->machine, bitmap, cliprect, &spriteram[0x60]);
585509
586VIDEO_START( mooncrgx )
587{
588   VIDEO_START_CALL(galaxian);
589
590   modify_charcode   = mooncrgx_modify_charcode;
591   modify_spritecode = mooncrgx_modify_spritecode;
510   return 0;
592511}
593512
594VIDEO_START( moonqsr )
595{
596   VIDEO_START_CALL(galaxian);
597513
598   modify_charcode   = moonqsr_modify_charcode;
599   modify_spritecode = moonqsr_modify_spritecode;
600}
601514
602VIDEO_START( mshuttle )
603{
604   VIDEO_START_CALL(galaxian);
515/*************************************
516 *
517 *  Background tilemap
518 *
519 *************************************/
605520
606   modify_charcode   = mshuttle_modify_charcode;
607   modify_spritecode = mshuttle_modify_spritecode;
608}
609
610VIDEO_START( pisces )
521static TILE_GET_INFO( bg_get_tile_info )
611522{
612   VIDEO_START_CALL(galaxian);
613
614   modify_charcode   = pisces_modify_charcode;
615   modify_spritecode = pisces_modify_spritecode;
616}
617
618VIDEO_START( gteikob2 )
619{
620   VIDEO_START_CALL(pisces);
621
622   draw_bullets = gteikob2_draw_bullets;
623}
624
625VIDEO_START( batman2 )
626{
627   VIDEO_START_CALL(galaxian);
628
629   modify_charcode   = batman2_modify_charcode;
630   modify_spritecode = batman2_modify_spritecode;
631
632}
633
634VIDEO_START( scramble )
635{
636   VIDEO_START_CALL(galaxian_plain);
637
638   /* FIXME: This most probably needs to be adjusted
639     * again when RAW video params are added to scramble
640     */
641   tilemap_set_scrolldx(bg_tilemap, 0, 0);
642
643   draw_stars = scramble_draw_stars;
644
645   draw_bullets = scramble_draw_bullets;
646
647   draw_background = scramble_draw_background;
648}
649
650VIDEO_START( sfx )
651{
652   video_start_common(machine,tilemap_scan_cols);
653
654   tilemap_set_scroll_rows(bg_tilemap, 32);
655   tilemap_set_scroll = tilemap_set_scrollx;
656
657   draw_stars = scramble_draw_stars;
658
659   draw_bullets = scramble_draw_bullets;
660
661   draw_background = turtles_draw_background;
662}
663
664VIDEO_START( turtles )
665{
666   VIDEO_START_CALL(galaxian_plain);
667
668   draw_background = turtles_draw_background;
669}
670
671VIDEO_START( theend )
672{
673   VIDEO_START_CALL(galaxian);
674
675   draw_bullets = theend_draw_bullets;
676}
677
678VIDEO_START( darkplnt )
679{
680   VIDEO_START_CALL(galaxian_plain);
681
682   tilemap_set_scrolldx(bg_tilemap, 0, 0);
683   draw_bullets = darkplnt_draw_bullets;
684}
685
686VIDEO_START( rescue )
687{
688   VIDEO_START_CALL(scramble);
689
690   draw_stars = rescue_draw_stars;
691
692   draw_background = rescue_draw_background;
693}
694
695VIDEO_START( minefld )
696{
697   VIDEO_START_CALL(scramble);
698
699   draw_stars = rescue_draw_stars;
700
701   draw_background = minefld_draw_background;
702}
703
704VIDEO_START( stratgyx )
705{
706   VIDEO_START_CALL(galaxian_plain);
707
708   draw_background = stratgyx_draw_background;
709}
710
711VIDEO_START( ckongs )
712{
713   VIDEO_START_CALL(scramble);
714
715   modify_spritecode = mshuttle_modify_spritecode;
716}
717
718VIDEO_START( calipso )
719{
720   VIDEO_START_CALL(galaxian_plain);
721
722   draw_bullets = scramble_draw_bullets;
723
724   draw_background = scramble_draw_background;
725
726   modify_spritecode = calipso_modify_spritecode;
727}
728
729VIDEO_START( mariner )
730{
731   VIDEO_START_CALL(galaxian_plain);
732
733   draw_stars = mariner_draw_stars;
734
735   draw_bullets = scramble_draw_bullets;
736
737   draw_background = mariner_draw_background;
738
739   modify_charcode = mariner_modify_charcode;
740}
741
742VIDEO_START( froggers )
743{
744   VIDEO_START_CALL(galaxian_plain);
745
746   draw_background = frogger_draw_background;
747   modify_color = frogger_modify_color;
748}
749
750VIDEO_START( frogger )
751{
752   VIDEO_START_CALL(froggers);
753
754   modify_ypos = frogger_modify_ypos;
755}
756
757VIDEO_START( jumpbug )
758{
759   VIDEO_START_CALL(scramble);
760
761   draw_stars = jumpbug_draw_stars;
762
763   modify_charcode   = jumpbug_modify_charcode;
764   modify_spritecode = jumpbug_modify_spritecode;
765}
766
767VIDEO_START( azurian )
768{
769   VIDEO_START_CALL(galaxian_plain);
770
771   draw_stars = galaxian_draw_stars;
772   draw_bullets = scramble_draw_bullets; /* Shots are yellow like in Scramble */
773}
774
775VIDEO_START( mimonkey )
776{
777   VIDEO_START_CALL(scramble);
778
779   modify_charcode   = mimonkey_modify_charcode;
780   modify_spritecode = mimonkey_modify_spritecode;
781}
782
783VIDEO_START( dkongjrm )
784{
785   VIDEO_START_CALL(galaxian_plain);
786
787   modify_charcode   = pisces_modify_charcode;
788   modify_spritecode = dkongjrm_modify_spritecode;
789
790   spriteram2_present= 1;
791}
792
793VIDEO_START( newsin7 )
794{
795   VIDEO_START_CALL(scramble);
796
797   spritevisiblearea      = &_spritevisibleareaflipx;
798   spritevisibleareaflipx = &_spritevisiblearea;
799}
800
801VIDEO_START( scorpion )
802{
803   VIDEO_START_CALL(scramble);
804
805   modify_spritecode = batman2_modify_spritecode;
806}
807
808static void rockclim_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
809{
810   tilemap_draw(bitmap,cliprect,rockclim_tilemap, 0,0);
811}
812
813static void rockclim_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
814{
815   if (gfxbank[2])   *code|=0x40;
816}
817
818VIDEO_START( rockclim )
819{
820   VIDEO_START_CALL(galaxian);
821   rockclim_tilemap = tilemap_create(rockclim_get_tile_info,tilemap_scan_rows,8,8,64,32);
822   draw_background = rockclim_draw_background;
823   modify_charcode = mooncrst_modify_charcode;
824   modify_spritecode = rockclim_modify_spritecode;
825   rockclim_v = rockclim_h = 0;
826   state_save_register_global(rockclim_v);
827   state_save_register_global(rockclim_h);
828}
829
830static TILE_GET_INFO( drivfrcg_get_tile_info )
831{
832   int code = galaxian_videoram[tile_index];
833523   UINT8 x = tile_index & 0x1f;
834   UINT8 color = galaxian_attributesram[(x << 1) | 1] & 7;
835   UINT8 bank = galaxian_attributesram[(x << 1) | 1] & 0x30;
836524
837   code |= (bank << 4);
838   color |= ((galaxian_attributesram[(x << 1) | 1] & 0x40) >> 3);
525   UINT16 code = videoram[tile_index];
526   UINT8 attrib = spriteram[x*2+1];
527   UINT8 color = attrib & 7;
839528
529   if (galaxian_extend_tile_info_ptr != NULL)
530      (*galaxian_extend_tile_info_ptr)(&code, &color, attrib, x);
531
840532   SET_TILE_INFO(0, code, color, 0);
841533}
842534
843VIDEO_START( drivfrcg )
844{
845   bg_tilemap = tilemap_create(drivfrcg_get_tile_info,tilemap_scan_rows,8,8,32,32);
846535
847   tilemap_set_transparent_pen(bg_tilemap,0);
848   tilemap_set_scroll_cols(bg_tilemap, 32);
849   tilemap_set_scroll = tilemap_set_scrolly;
850
851   modify_charcode = 0;
852   modify_spritecode = mshuttle_modify_spritecode;
853   modify_color = drivfrcg_modify_color;
854   modify_ypos = 0;
855
856   mooncrst_gfxextend = 0;
857
858   draw_bullets = 0;
859
860   draw_background = galaxian_draw_background;
861   background_enable = 0;
862   background_blue = 0;
863   background_red = 0;
864   background_green = 0;
865
866   draw_stars = noop_draw_stars;
867
868   flipscreen_x = 0;
869   flipscreen_y = 0;
870
871   spriteram2_present = 0;
872
873   spritevisiblearea      = &_spritevisiblearea;
874   spritevisibleareaflipx = &_spritevisibleareaflipx;
875
876   color_mask = 0xff;
877
878   state_save_register();
879}
880
881VIDEO_START( ad2083 )
536WRITE8_HANDLER( galaxian_videoram_w )
882537{
883   bg_tilemap = tilemap_create(drivfrcg_get_tile_info,tilemap_scan_rows,8,8,32,32);
538   /* update any video up to the current scanline */
539   video_screen_update_now(machine->primary_screen);
884540
885   tilemap_set_transparent_pen(bg_tilemap,0);
886   tilemap_set_scroll_cols(bg_tilemap, 32);
887   tilemap_set_scroll = tilemap_set_scrolly;
888
889   modify_charcode = 0;
890   modify_spritecode = ad2083_modify_spritecode;
891   modify_color = 0;
892   modify_ypos = 0;
893
894   mooncrst_gfxextend = 0;
895
896   draw_bullets = scramble_draw_bullets;
897
898   draw_background = turtles_draw_background;
899   background_enable = 0;
900   background_blue = 0;
901   background_red = 0;
902   background_green = 0;
903
904   draw_stars = noop_draw_stars;
905
906   flipscreen_x = 0;
907   flipscreen_y = 0;
908
909   spriteram2_present = 0;
910
911   spritevisiblearea      = &_spritevisiblearea;
912   spritevisibleareaflipx = &_spritevisibleareaflipx;
913
914   color_mask = 7;
915
916   state_save_register();
541   /* store the data and mark the corresponding tile dirty */
542   videoram[offset] = data;
543   tilemap_mark_tile_dirty(bg_tilemap, offset);
917544}
918545
919UINT8 *racknrol_tiles_bank;
920546
921WRITE8_HANDLER( racknrol_tiles_bank_w )
547WRITE8_HANDLER( galaxian_objram_w )
922548{
923   racknrol_tiles_bank[offset] = data;
924   tilemap_mark_all_tiles_dirty(bg_tilemap);
925}
549   /* update any video up to the current scanline */
550   video_screen_update_now(machine->primary_screen);
926551
927static TILE_GET_INFO( racknrol_get_tile_info )
928{
929   int code = galaxian_videoram[tile_index];
930   UINT8 x = tile_index & 0x1f;
931   UINT8 color = galaxian_attributesram[(x << 1) | 1] & 7;
932   UINT8 bank = racknrol_tiles_bank[x] & 7;
552   /* store the data */
553   spriteram[offset] = data;
933554
934   code |= (bank << 8);
555   /* the first $40 bytes affect the tilemap */
556   if (offset < 0x40)
557   {
558      /* even entries control the scroll position */
559      if ((offset & 0x01) == 0)
560      {
561         /* Frogger: top and bottom 4 bits swapped entering the adder */
562         if (galaxian_frogger_adjust)
563            data = (data >> 4) | (data << 4);
564         if (!galaxian_sfx_tilemap)
565            tilemap_set_scrolly(bg_tilemap, offset >> 1, data);
566         else
567            tilemap_set_scrollx(bg_tilemap, offset >> 1, GALAXIAN_XSCALE*data);
568      }
935569
936   SET_TILE_INFO(0, code, color, 0);
570      /* odd entries control the color base for the row */
571      else
572      {
573         for (offset >>= 1; offset < 0x0400; offset += 32)
574            tilemap_mark_tile_dirty(bg_tilemap, offset);
575      }
576   }
937577}
938578
939VIDEO_START( racknrol )
940{
941   bg_tilemap = tilemap_create(racknrol_get_tile_info,tilemap_scan_rows,8,8,32,32);
942579
943   tilemap_set_transparent_pen(bg_tilemap,0);
944   tilemap_set_scroll_cols(bg_tilemap, 32);
945   tilemap_set_scroll = tilemap_set_scrolly;
946580
947   modify_charcode = 0;
948   modify_spritecode = 0;
949   modify_color = 0;
950   modify_ypos = 0;
581/*************************************
582 *
583 *  Sprite rendering
584 *
585 *************************************/
951586
952   mooncrst_gfxextend = 0;
953
954   draw_bullets = 0;
955
956   draw_background = galaxian_draw_background;
957   background_enable = 0;
958   background_blue = 0;
959   background_red = 0;
960   background_green = 0;
961
962   draw_stars = noop_draw_stars;
963
964   flipscreen_x = 0;
965   flipscreen_y = 0;
966
967   spriteram2_present = 0;
968
969   spritevisiblearea      = &_spritevisiblearea;
970   spritevisibleareaflipx = &_spritevisibleareaflipx;
971
972   color_mask = 0xff;
973
974   state_save_register();
975}
976
977VIDEO_START( bongo )
587static void sprites_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *spritebase)
978588{
979   VIDEO_START_CALL(galaxian_plain);
589   rectangle clip = *cliprect;
590   int sprnum;
980591
981   modify_spritecode = batman2_modify_spritecode;
982}
592   /* 16 of the 256 pixels of the sprites are hard-clipped at the line buffer */
593   /* according to the schematics, it should be the first 16 pixels; however, */
594   /* some bootlegs demonstrate that this can be shifted to other positions. */
595   clip.min_x = MAX(clip.min_x, galaxian_sprite_clip_start * GALAXIAN_XSCALE);
596   clip.max_x = MIN(clip.max_x, (galaxian_sprite_clip_end + 1) * GALAXIAN_XSCALE - 1);
983597
984static TILE_GET_INFO( dambustr_get_tile_info2 )
985{
986   UINT8 x = tile_index & 0x1f;
987
988   UINT16 code = dambustr_videoram2[tile_index];
989   UINT8 color = galaxian_attributesram[(x << 1) | 1] & color_mask;
990
991   if (modify_charcode)
598   /* The line buffer is only written if it contains a '0' currently; */
599   /* it is cleared during the visible area, and populated during HBLANK */
600   /* To simulate this, we render backwards so that lower numbered sprites */
601   /* have priority over higher numbered sprites. */
602   for (sprnum = 7; sprnum >= 0; sprnum--)
992603   {
993      modify_charcode(&code, x);
994   }
604      const UINT8 *base = &spritebase[sprnum * 4];
605      /* Frogger: top and bottom 4 bits swapped entering the adder */
606      UINT8 base0 = galaxian_frogger_adjust ? ((base[0] >> 4) | (base[0] << 4)) : base[0];
607      /* the first three sprites match against y-1 */
608      UINT8 sy = 240 - (base0 - (sprnum < 3));
609      UINT16 code = base[1] & 0x3f;
610      UINT8 flipx = base[1] & 0x40;
611      UINT8 flipy = base[1] & 0x80;
612      UINT8 color = base[2] & 7;
613      UINT8 sx = base[3];
995614
996   if (modify_color)
997   {
998      modify_color(&color);
999   }
615      /* extend the sprite information */
616      if (galaxian_extend_sprite_info_ptr != NULL)
617         (*galaxian_extend_sprite_info_ptr)(base, &sx, &sy, &flipx, &flipy, &code, &color);
1000618
1001   SET_TILE_INFO(0, code, color, 0);
1002}
619      /* apply flipscreen in X direction */
620      if (flipscreen_x)
621      {
622         sx = 240 - sx;
623         flipx = !flipx;
624      }
1003625
1004VIDEO_START( dambustr )
1005{
1006   VIDEO_START_CALL(galaxian);
626      /* apply flipscreen in Y direction */
627      if (flipscreen_y)
628      {
629         sy = 240 - sy;
630         flipy = !flipy;
631      }
1007632
1008   dambustr_bg_split_line = 0;
1009   dambustr_bg_color_1 = 0;
1010   dambustr_bg_color_2 = 0;
1011   dambustr_bg_priority = 0;
1012   dambustr_char_bank = 0;
1013
1014   draw_background = dambustr_draw_background;
1015
1016   modify_charcode   = dambustr_modify_charcode;
1017   modify_spritecode = dambustr_modify_spritecode;
1018
1019   draw_bullets = dambustr_draw_bullets;
1020
1021   /* allocate the temporary bitmap for the background priority */
1022   dambustr_tmpbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
1023
1024   /* make a copy of the tilemap to emulate background priority */
1025   dambustr_videoram2 = auto_malloc(0x0400);
1026   dambustr_tilemap2 = tilemap_create(dambustr_get_tile_info2,tilemap_scan_rows,8,8,32,32);
1027
1028   tilemap_set_transparent_pen(dambustr_tilemap2,0);
633      /* draw */
634      drawgfx(bitmap, machine->gfx[1],
635            code, color,
636            flipx, flipy,
637            GALAXIAN_H0START + GALAXIAN_XSCALE * sx, sy,
638            &clip,
639            TRANSPARENCY_PEN, 0);
640   }
1029641}
1030642
1031643
1032WRITE8_HANDLER( galaxian_videoram_w )
1033{
1034   galaxian_videoram[offset] = data;
1035   tilemap_mark_tile_dirty(bg_tilemap, offset);
1036}
1037644
1038READ8_HANDLER( galaxian_videoram_r )
1039{
1040   return galaxian_videoram[offset];
1041}
645/*************************************
646 *
647 *  Bullets rendering
648 *
649 *************************************/
1042650
1043
1044WRITE8_HANDLER( galaxian_attributesram_w )
651static void bullets_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *base)
1045652{
1046   if (galaxian_attributesram[offset] != data)
653   int y;
654
655   /* iterate over scanlines */
656   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
1047657   {
1048      if (offset & 0x01)
1049      {
1050         /* color change */
1051         int i;
658      UINT8 shell = 0xff, missile = 0xff;
659      UINT8 effy;
660      int which;
1052661
1053         for (i = offset >> 1; i < 0x0400; i += 32)
1054            tilemap_mark_tile_dirty(bg_tilemap, i);
1055      }
1056      else
1057      {
1058         if (modify_ypos)
662      /* the first 3 entries match Y-1 */
663      effy = flipscreen_y ? ((y - 1) ^ 255) : (y - 1);
664      for (which = 0; which < 3; which++)
665         if ((UINT8)(base[which*4+1] + effy) == 0xff)
666            shell = which;
667
668      /* remaining entries match Y */
669      effy = flipscreen_y ? (y ^ 255) : y;
670      for (which = 3; which < 8; which++)
671         if ((UINT8)(base[which*4+1] + effy) == 0xff)
1059672         {
1060            modify_ypos(&data);
673            if (which != 7)
674               shell = which;
675            else
676               missile = which;
1061677         }
1062678
1063         tilemap_set_scroll(bg_tilemap, offset >> 1, data);
1064      }
1065
1066      galaxian_attributesram[offset] = data;
679      /* draw the shell */
680      if (shell != 0xff)
681         (*galaxian_draw_bullet_ptr)(machine, bitmap, cliprect, shell, 255 - base[shell*4+3], y);
682      if (missile != 0xff)
683         (*galaxian_draw_bullet_ptr)(machine, bitmap, cliprect, missile, 255 - base[missile*4+3], y);
1067684   }
1068685}
1069686
1070687
688
689/*************************************
690 *
691 *  Screen orientation
692 *
693 *************************************/
694
1071695WRITE8_HANDLER( galaxian_flip_screen_x_w )
1072696{
1073697   if (flipscreen_x != (data & 0x01))
1074698   {
1075      flipscreen_x = data & 0x01;
699      video_screen_update_now(machine->primary_screen);
1076700
701      /* when the direction changes, we count a different number of clocks */
702      /* per frame, so we need to reset the origin of the stars to the current */
703      /* frame before we flip */
704      stars_update_origin(machine);
705
706      flipscreen_x = data & 0x01;
1077707      tilemap_set_flip(bg_tilemap, (flipscreen_x ? TILEMAP_FLIPX : 0) | (flipscreen_y ? TILEMAP_FLIPY : 0));
1078708   }
1079709}
r2241r2242
1082712{
1083713   if (flipscreen_y != (data & 0x01))
1084714   {
715      video_screen_update_now(machine->primary_screen);
1085716      flipscreen_y = data & 0x01;
1086
1087717      tilemap_set_flip(bg_tilemap, (flipscreen_x ? TILEMAP_FLIPX : 0) | (flipscreen_y ? TILEMAP_FLIPY : 0));
1088718   }
1089719}
1090720
1091
1092WRITE8_HANDLER( gteikob2_flip_screen_x_w )
721WRITE8_HANDLER( galaxian_flip_screen_xy_w )
1093722{
1094   galaxian_flip_screen_x_w(machine, offset, ~data);
723   galaxian_flip_screen_x_w(machine, offset, data);
724   galaxian_flip_screen_y_w(machine, offset, data);
1095725}
1096726
1097WRITE8_HANDLER( gteikob2_flip_screen_y_w )
1098{
1099   galaxian_flip_screen_y_w(machine, offset, ~data);
1100}
1101727
1102728
1103WRITE8_HANDLER( hotshock_flip_screen_w )
729/*************************************
730 *
731 *  Background controls
732 *
733 *************************************/
734
735WRITE8_HANDLER( galaxian_stars_enable_w )
1104736{
1105   galaxian_flip_screen_x_w(machine, offset, data);
1106   galaxian_flip_screen_y_w(machine, offset, data);
737   if ((stars_enabled ^ data) & 0x01)
738   video_screen_update_now(machine->primary_screen);
739   if (!stars_enabled && (data & 0x01))
740   {
741      /* on the rising edge of this, the CLR on the shift registers is released */
742      /* this resets the "origin" of this frame to 0 minus the number of clocks */
743      /* we have counted so far */
744      star_rng_origin = STAR_RNG_PERIOD - (video_screen_get_vpos(machine->primary_screen) * 512 + video_screen_get_hpos(machine->primary_screen));
745      star_rng_origin_frame = video_screen_get_frame_number(machine->primary_screen);
746   }
747   stars_enabled = data & 0x01;
1107748}
1108749
1109750
1110751WRITE8_HANDLER( scramble_background_enable_w )
1111752{
753   video_screen_update_now(machine->primary_screen);
1112754   background_enable = data & 0x01;
1113755}
1114756
757
1115758WRITE8_HANDLER( scramble_background_red_w )
1116759{
760   video_screen_update_now(machine->primary_screen);
1117761   background_red = data & 0x01;
1118762}
1119763
764
1120765WRITE8_HANDLER( scramble_background_green_w )
1121766{
767   video_screen_update_now(machine->primary_screen);
1122768   background_green = data & 0x01;
1123769}
1124770
771
1125772WRITE8_HANDLER( scramble_background_blue_w )
1126773{
774   video_screen_update_now(machine->primary_screen);
1127775   background_blue = data & 0x01;
1128776}
1129777
1130778
1131WRITE8_HANDLER( galaxian_stars_enable_w )
1132{
1133   galaxian_stars_on = data & 0x01;
1134779
1135   if (!galaxian_stars_on)
1136   {
1137      stars_scrollpos = 0;
1138   }
1139}
780/*************************************
781 *
782 *  Graphics banking
783 *
784 *************************************/
1140785
1141
1142WRITE8_HANDLER( darkplnt_bullet_color_w )
1143{
1144   darkplnt_bullet_color = data & 0x01;
1145}
1146
1147
1148
1149786WRITE8_HANDLER( galaxian_gfxbank_w )
1150787{
1151788   if (gfxbank[offset] != data)
1152789   {
790      video_screen_update_now(machine->primary_screen);
1153791      gfxbank[offset] = data;
1154
1155792      tilemap_mark_all_tiles_dirty(bg_tilemap);
1156793   }
1157794}
1158795
1159WRITE8_HANDLER( rockclim_videoram_w )
1160{
1161   rockclim_videoram[offset] = data;
1162   tilemap_mark_tile_dirty(rockclim_tilemap, offset);
1163}
1164796
1165WRITE8_HANDLER( rockclim_scroll_w )
1166{
1167   switch(offset&3)
1168   {
1169      case 0: rockclim_h=(rockclim_h&0xff00)|data;tilemap_set_scrollx(rockclim_tilemap , 0, rockclim_h );break;
1170      case 1:   rockclim_h=(rockclim_h&0xff)|(data<<8);tilemap_set_scrollx(rockclim_tilemap , 0, rockclim_h );break;
1171      case 2:   rockclim_v=(rockclim_v&0xff00)|data;tilemap_set_scrolly(rockclim_tilemap , 0, rockclim_v );break;
1172      case 3:   rockclim_v=(rockclim_v&0xff)|(data<<8);tilemap_set_scrolly(rockclim_tilemap , 0, rockclim_v );break;
1173   }
1174797
1175}
798/*************************************
799 *
800 *  Star initialization
801 *
802 *************************************/
1176803
1177
1178READ8_HANDLER( rockclim_videoram_r )
804static void stars_init(void)
1179805{
1180   return rockclim_videoram[offset];
1181}
806   UINT32 shiftreg;
807   int i;
1182808
809   /* reset the blink and enabled states */
810   stars_enabled = FALSE;
811   stars_blink_state = 0;
1183812
1184WRITE8_HANDLER( dambustr_bg_split_line_w )
1185{
1186   dambustr_bg_split_line = data;
1187}
1188
1189
1190WRITE8_HANDLER( dambustr_bg_color_w )
1191{
1192   dambustr_bg_color_1 = (BIT(data,2)<<2) | (BIT(data,1)<<1) | BIT(data,0);
1193   dambustr_bg_color_2 = (BIT(data,6)<<2) | (BIT(data,5)<<1) | BIT(data,4);
1194   dambustr_bg_priority = BIT(data,3);
1195   dambustr_char_bank = BIT(data,7);
1196   tilemap_mark_all_tiles_dirty(bg_tilemap);
1197}
1198
1199
1200
1201/* character banking functions */
1202
1203static void gmgalax_modify_charcode(UINT16 *code,UINT8 x)
1204{
1205   *code |= (gfxbank[0] << 9);
1206}
1207
1208static void mooncrst_modify_charcode(UINT16 *code,UINT8 x)
1209{
1210   if (gfxbank[2] && ((*code & 0xc0) == 0x80))
813   /* precalculate the RNG */
814   stars = auto_malloc(STAR_RNG_PERIOD);
815   shiftreg = 0;
816   for (i = 0; i < STAR_RNG_PERIOD; i++)
1211817   {
1212      *code = (*code & 0x3f) | (gfxbank[0] << 6) | (gfxbank[1] << 7) | 0x0100;
1213   }
1214}
818      /* stars are enabled if the upper 8 bits are 1 and the low bit is 0 */
819      int enabled = ((shiftreg & 0x1fe01) == 0x1fe00);
1215820
1216static void mooncrgx_modify_charcode(UINT16 *code,UINT8 x)
1217{
1218   if (gfxbank[2] && ((*code & 0xc0) == 0x80))
1219   {
1220      *code = (*code & 0x3f) | (gfxbank[1] << 6) | (gfxbank[0] << 7) | 0x0100;
1221   }
1222}
821      /* color comes from the 6 bits below the top 8 bits */
822      int color = (~shiftreg & 0x1f8) >> 3;
1223823
1224static void moonqsr_modify_charcode(UINT16 *code,UINT8 x)
1225{
1226   *code |= ((galaxian_attributesram[(x << 1) | 1] & 0x20) << 3);
1227}
824      /* store the color value in the low 6 bits and the enable in the upper bit */
825      stars[i] = color | (enabled << 7);
1228826
1229static void mshuttle_modify_charcode(UINT16 *code,UINT8 x)
1230{
1231   *code |= ((galaxian_attributesram[(x << 1) | 1] & 0x30) << 4);
1232}
1233
1234static void pisces_modify_charcode(UINT16 *code,UINT8 x)
1235{
1236   *code |= (gfxbank[0] << 8);
1237}
1238
1239static void mimonkey_modify_charcode(UINT16 *code,UINT8 x)
1240{
1241   *code |= (gfxbank[0] << 8) | (gfxbank[2] << 9);
1242}
1243
1244static void batman2_modify_charcode(UINT16 *code,UINT8 x)
1245{
1246   if (*code & 0x80)
1247   {
1248      *code |= (gfxbank[0] << 8);
827      /* the LFSR is fed based on the XOR of bit 12 and the inverse of bit 0 */
828      shiftreg = (shiftreg >> 1) | ((((shiftreg >> 12) ^ ~shiftreg) & 1) << 16);
1249829   }
1250830}
1251831
1252static void mariner_modify_charcode(UINT16 *code,UINT8 x)
1253{
1254   UINT8 *prom;
1255832
1256833
1257   /* bit 0 of the PROM controls character banking */
834/*************************************
835 *
836 *  Adjust the origin of stars
837 *
838 *************************************/
1258839
1259   prom = memory_region(REGION_USER2);
1260
1261   *code |= ((prom[x] & 0x01) << 8);
1262}
1263
1264static void jumpbug_modify_charcode(UINT16 *code,UINT8 x)
840static void stars_update_origin(running_machine *machine)
1265841{
1266   if (((*code & 0xc0) == 0x80) &&
1267       (gfxbank[2] & 0x01))
1268   {
1269      *code += 128 + (( gfxbank[0] & 0x01) << 6) +
1270                  (( gfxbank[1] & 0x01) << 7) +
1271                  ((~gfxbank[4] & 0x01) << 8);
1272   }
1273}
842   int curframe = video_screen_get_frame_number(machine->primary_screen);
1274843
1275
1276static void dambustr_modify_charcode(UINT16 *code,UINT8 x)
1277{
1278   if (dambustr_char_bank == 0) {   // text mode
1279      *code |= 0x0300;
1280   }
1281   else {            // graphics mode
1282      if (x == 28)      // only line #28 stays in text mode
1283         *code |= 0x0300;
1284      else
1285         *code &= 0x00ff;
1286   };
1287}
1288
1289
1290
1291/* sprite banking functions */
1292
1293static void gmgalax_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
1294{
1295   *code |= (gfxbank[0] << 7) | 0x40;
1296}
1297
1298static void mooncrst_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
1299{
1300   if (gfxbank[2] && ((*code & 0x30) == 0x20))
844   /* only update on a different frame */
845   if (curframe != star_rng_origin_frame)
1301846   {
1302      *code = (*code & 0x0f) | (gfxbank[0] << 4) | (gfxbank[1] << 5) | 0x40;
1303   }
1304}
847      /* The RNG period is 2^17-1; each frame, the shift register is clocked */
848      /* 512*256 = 2^17 times. This means that we clock one extra time each */
849      /* frame. However, if we are NOT flipped, there is a pair of D flip-flops */
850      /* at 6B which delay the count so that we count 512*256-2 = 2^17-2 times. */
851      /* In this case, we only one time less than the period each frame. Both */
852      /* of these off-by-one countings produce the horizontal star scrolling. */
853      int per_frame_delta = flipscreen_x ? 1 : -1;
854      int total_delta = per_frame_delta * (curframe - star_rng_origin_frame);
1305855
1306static void mooncrgx_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
1307{
1308   if (gfxbank[2] && ((*code & 0x30) == 0x20))
1309   {
1310      *code = (*code & 0x0f) | (gfxbank[1] << 4) | (gfxbank[0] << 5) | 0x40;
1311   }
1312}
856      /* we can't just use % here because mod of a negative number is undefined */
857      while (total_delta < 0)
858         total_delta += STAR_RNG_PERIOD;
1313859
1314static void moonqsr_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
1315{
1316   *code |= ((spriteram[offs + 2] & 0x20) << 1);
1317}
1318
1319static void mshuttle_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
1320{
1321   *code |= ((spriteram[offs + 2] & 0x30) << 2);
1322}
1323
1324static void calipso_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
1325{
1326   /* No flips */
1327   *code = spriteram[offs + 1];
1328   *flipx = 0;
1329   *flipy = 0;
1330}
1331
1332static void pisces_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
1333{
1334   *code |= (gfxbank[0] << 6);
1335}
1336
1337static void mimonkey_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
1338{
1339   *code |= (gfxbank[0] << 6) | (gfxbank[2] << 7);
1340}
1341
1342static void batman2_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
1343{
1344   /* only the upper 64 sprites are used */
1345   *code |= 0x40;
1346}
1347
1348static void jumpbug_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
1349{
1350   if (((*code & 0x30) == 0x20) &&
1351       (gfxbank[2] & 0x01) != 0)
1352   {
1353      *code += 32 + (( gfxbank[0] & 0x01) << 4) +
1354                 (( gfxbank[1] & 0x01) << 5) +
1355                 ((~gfxbank[4] & 0x01) << 6);
860      /* now that everything is positive, do the mod */
861      star_rng_origin = (star_rng_origin + total_delta) % STAR_RNG_PERIOD;
862      star_rng_origin_frame = curframe;
1356863   }
1357864}
1358865
1359static void dkongjrm_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
1360{
1361   /* No x flip */
1362   *code = (spriteram[offs + 1] & 0x7f) | 0x80;
1363   *flipx = 0;
1364}
1365866
1366static void ad2083_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
1367{
1368   /* No x flip */
1369   *code = (spriteram[offs + 1] & 0x7f) | ((spriteram[offs + 2] & 0x30) << 2);
1370   *flipx = 0;
1371}
1372867
1373static void dambustr_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
1374{
1375   *code += 0x40;
1376}
868/*************************************
869 *
870 *  Star blinking
871 *
872 *************************************/
1377873
1378
1379/* color PROM mapping functions */
1380
1381static void frogger_modify_color(UINT8 *color)
874TIMER_CALLBACK( galaxian_stars_blink_timer )
1382875{
1383   *color = ((*color >> 1) & 0x03) | ((*color << 2) & 0x04);
876   stars_blink_state++;
1384877}
1385878
1386static void gmgalax_modify_color(UINT8 *color)
1387{
1388   *color |= (gfxbank[0] << 3);
1389}
1390879
1391static void drivfrcg_modify_color(UINT8 *color)
1392{
1393   *color = ((*color & 0x40) >> 3) | (*color & 7);
1394}
1395880
1396/* y position mapping functions */
881/*************************************
882 *
883 *  Draw a row of stars
884 *
885 *************************************/
1397886
1398static void frogger_modify_ypos(UINT8 *sy)
887static void stars_draw_row(bitmap_t *bitmap, int maxx, int y, UINT32 star_offs, UINT8 starmask)
1399888{
1400   *sy = (*sy << 4) | (*sy >> 4);
1401}
889   int x;
1402890
891   /* ensure our star offset is valid */
892   star_offs %= STAR_RNG_PERIOD;
1403893
1404/* bullet drawing functions */
1405
1406static void galaxian_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect)
1407{
1408   int i;
1409
1410
1411   for (i = 0; i < 4; i++)
894   /* iterate over the specified number of 6MHz pixels */
895   for (x = 0; x < maxx; x++)
1412896   {
1413      x--;
897      /* stars are suppressed unless V1 ^ H8 == 1 */
898      int enable_star = (y ^ (x >> 3)) & 1;
899      UINT8 star;
1414900
1415      if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
1416      {
1417         int color;
901      /*
902            The RNG clock is the master clock (18MHz) ANDed with the pixel clock (6MHz).
903            The divide-by-3 circuit that produces the pixel clock generates a square wave
904            with a 2/3 duty cycle, so the result of the AND generates a clock like this:
905                        _   _   _   _   _   _   _   _
906              MASTER: _| |_| |_| |_| |_| |_| |_| |_| |
907                        _______     _______     ______
908              PIXEL:  _|       |___|       |___|
909                        _   _       _   _       _   _
910              RNG:    _| |_| |_____| |_| |_____| |_| |
1418911
912            Thus for each pixel, there are 3 master clocks and 2 RNG clocks, and the RNG
913            is clocked asymmetrically. To simulate this, we expand the horizontal screen
914            size by 3 and handle the first RNG clock with one pixel and the second RNG
915            clock with two pixels.
916        */
1419917
1420         /* yellow missile, white shells (this is the terminology on the schematics) */
1421         color = ((offs == 7*4) ? BULLETS_COLOR_BASE : BULLETS_COLOR_BASE + 1);
918      /* first RNG clock: one pixel */
919      star = stars[star_offs++];
920      if (star_offs >= STAR_RNG_PERIOD)
921         star_offs = 0;
922      if (enable_star && (star & 0x80) != 0 && (star & starmask) != 0)
923         *BITMAP_ADDR32(bitmap, y, GALAXIAN_XSCALE*x + 0) = star_color[star & 0x3f];
1422924
1423         *BITMAP_ADDR16(bitmap, y, x) = color;
1424      }
1425   }
1426}
1427
1428static void gteikob2_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect)
1429{
1430   galaxian_draw_bullets(bitmap, offs, 260 - x, y, cliprect);
1431}
1432
1433static void scramble_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect)
1434{
1435   if (flipscreen_x)  x++;
1436
1437   x = x - 6;
1438
1439   if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
1440      /* yellow bullets */
1441      *BITMAP_ADDR16(bitmap, y, x) = BULLETS_COLOR_BASE;
1442}
1443
1444static void darkplnt_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect)
1445{
1446   if (flipscreen_x)  x++;
1447
1448   x = x - 6;
1449
1450   if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
1451      *BITMAP_ADDR16(bitmap, y, x) = 32 + darkplnt_bullet_color;
1452}
1453
1454static void theend_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect)
1455{
1456   int i;
1457
1458
1459   /* same as Galaxian, but all bullets are yellow */
1460   for (i = 0; i < 4; i++)
1461   {
1462      x--;
1463
1464      if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
1465         *BITMAP_ADDR16(bitmap, y, x) = BULLETS_COLOR_BASE;
1466   }
1467}
1468
1469static void dambustr_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect)
1470{
1471   int i, color;
1472
1473   if (flip_screen_x_get())  x++;
1474
1475   x = x - 6;
1476
1477   /* bullets are 2 pixels wide */
1478   for (i = 0; i < 2; i++)
1479   {
1480      if (offs < 4*4)
925      /* second RNG clock: two pixels */
926      star = stars[star_offs++];
927      if (star_offs >= STAR_RNG_PERIOD)
928         star_offs = 0;
929      if (enable_star && (star & 0x80) != 0 && (star & starmask) != 0)
1481930      {
1482         color = BULLETS_COLOR_BASE;
1483         y--;
931         *BITMAP_ADDR32(bitmap, y, GALAXIAN_XSCALE*x + 1) = star_color[star & 0x3f];
932         *BITMAP_ADDR32(bitmap, y, GALAXIAN_XSCALE*x + 2) = star_color[star & 0x3f];
1484933      }
1485      else {
1486         color = BULLETS_COLOR_BASE + 1;
1487         x--;
1488      }
1489
1490      if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
1491         *BITMAP_ADDR16(bitmap, y, x) = color;
1492934   }
1493935}
1494936
1495937
1496938
1497/* background drawing functions */
939/*************************************
940 *
941 *  Background rendering
942 *
943 *************************************/
1498944
1499static void galaxian_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
945static int flip_and_clip(rectangle *draw, int xstart, int xend, const rectangle *cliprect)
1500946{
1501   /* plain black background */
1502   fillbitmap(bitmap,0,cliprect);
1503}
1504
1505static void scramble_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
1506{
1507   if (background_enable)
1508      fillbitmap(bitmap,BACKGROUND_COLOR_BASE,cliprect);
1509   else
1510      fillbitmap(bitmap,0,cliprect);
1511}
1512
1513static void turtles_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
1514{
1515   int color = (background_blue << 2) | (background_green << 1) | background_red;
1516
1517   fillbitmap(bitmap,BACKGROUND_COLOR_BASE + color,cliprect);
1518}
1519
1520static void frogger_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
1521{
1522   /* color split point verified on real machine */
1523   if (flipscreen_x)
947   *draw = *cliprect;
948   if (!flipscreen_x)
1524949   {
1525      plot_box(bitmap,   0, 0, 128, 256, 0);
1526      plot_box(bitmap, 128, 0, 128, 256, BACKGROUND_COLOR_BASE);
950      draw->min_x = xstart * GALAXIAN_XSCALE;
951      draw->max_x = xend * GALAXIAN_XSCALE + (GALAXIAN_XSCALE - 1);
1527952   }
1528953   else
1529954   {
1530      plot_box(bitmap,   0, 0, 128, 256, BACKGROUND_COLOR_BASE);
1531      plot_box(bitmap, 128, 0, 128, 256, 0);
955      draw->min_x = (xend ^ 255) * GALAXIAN_XSCALE;
956      draw->max_x = (xstart ^ 255) * GALAXIAN_XSCALE + (GALAXIAN_XSCALE - 1);
1532957   }
958   sect_rect(draw, cliprect);
959   return (draw->min_x <= draw->max_x);
1533960}
1534961
1535static void stratgyx_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
962
963void galaxian_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
1536964{
1537   UINT8 x;
1538   UINT8 *prom;
965   /* erase the background to black first */
966   fillbitmap(bitmap, RGB_BLACK, cliprect);
1539967
968   /* update the star origin to the current frame */
969   stars_update_origin(machine);
1540970
1541   /* the background PROM is connected the following way:
1542
1543       bit 0 = 0 enables the blue gun if BCB is asserted
1544       bit 1 = 0 enables the red gun if BCR is asserted and
1545                 the green gun if BCG is asserted
1546       bits 2-7 are unconnected */
1547
1548   prom = memory_region(REGION_USER1);
1549
1550   for (x = 0; x < 32; x++)
971   /* render stars if enabled */
972   if (stars_enabled)
1551973   {
1552      int sx,color;
974      int y;
1553975
1554
1555      color = 0;
1556
1557      if ((~prom[x] & 0x02) && background_red)   color |= 0x01;
1558      if ((~prom[x] & 0x02) && background_green) color |= 0x02;
1559      if ((~prom[x] & 0x01) && background_blue)  color |= 0x04;
1560
1561      if (flipscreen_x)
1562         sx = 8 * (31 - x);
1563      else
1564         sx = 8 * x;
1565
1566      plot_box(bitmap, sx, 0, 8, 256, BACKGROUND_COLOR_BASE + color);
976      /* iterate over scanlines */
977      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
978      {
979         UINT32 star_offs = star_rng_origin + y * 512;
980         stars_draw_row(bitmap, 256, y, star_offs, 0xff);
981      }
1567982   }
1568983}
1569984
1570static void minefld_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
1571{
1572   if (background_enable)
1573   {
1574      int x;
1575985
1576
1577      for (x = 0; x < 128; x++)
1578         plot_box(bitmap, x,       0, 1, 256, BACKGROUND_COLOR_BASE + x);
1579
1580      for (x = 0; x < 120; x++)
1581         plot_box(bitmap, x + 128, 0, 1, 256, BACKGROUND_COLOR_BASE + x + 128);
1582
1583      plot_box(bitmap, 248, 0, 16, 256, BACKGROUND_COLOR_BASE);
1584   }
1585   else
1586      fillbitmap(bitmap,0,cliprect);
1587}
1588
1589static void rescue_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
986void frogger_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
1590987{
1591   if (background_enable)
1592   {
1593      int x;
988   rectangle draw;
1594989
1595      for (x = 0; x < 128; x++)
1596         plot_box(bitmap, x,       0, 1, 256, BACKGROUND_COLOR_BASE + x);
990   /* color split point verified on real machine */
991   /* hmmm, according to schematics it is at 128+8; which is right? */
992   draw = *cliprect;
993   draw.max_x = MIN(draw.max_x, (128+8) * GALAXIAN_XSCALE - 1);
994   if (draw.min_x <= draw.max_x)
995      fillbitmap(bitmap, MAKE_RGB(0,0,0x47), &draw);
1597996
1598      for (x = 0; x < 120; x++)
1599         plot_box(bitmap, x + 128, 0, 1, 256, BACKGROUND_COLOR_BASE + x + 8);
1600
1601      plot_box(bitmap, 248, 0, 16, 256, BACKGROUND_COLOR_BASE);
1602   }
1603   else
1604      fillbitmap(bitmap,0,cliprect);
997   draw = *cliprect;
998   draw.min_x = MAX(draw.min_x, (128+8) * GALAXIAN_XSCALE);
999   if (draw.min_x <= draw.max_x)
1000      fillbitmap(bitmap, RGB_BLACK, &draw);
16051001}
16061002
1607static void mariner_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
1003
1004void amidar_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
16081005{
1609   UINT8 x;
1610   UINT8 *prom;
1006   const UINT8 *prom = memory_region(REGION_USER1);
1007   rectangle draw;
1008   int x;
16111009
1612
1613   /* the background PROM contains the color codes for each 8 pixel
1614       line (column) of the screen.  The first 0x20 bytes for unflipped,
1615       and the 2nd 0x20 bytes for flipped screen. */
1616
1617   prom = memory_region(REGION_USER1);
1618
1619   if (flipscreen_x)
1620   {
1621      for (x = 0; x < 32; x++)
1010   for (x = 0; x < 32; x++)
1011      if (flip_and_clip(&draw, x * 8, x * 8 + 7, cliprect))
16221012      {
1623         int color;
1013         /*
1014                The background PROM is connected the following way:
16241015
1625         if (x == 0)
1626            color = 0;
1627         else
1628            color = prom[0x20 + x - 1];
1016                   bit 0 = 0 enables the blue gun if BCB is asserted
1017                   bit 1 = 0 enables the red gun if BCR is asserted and
1018                             the green gun if BCG is asserted
1019                   bits 2-7 are unconnected
16291020
1630         plot_box(bitmap, 8 * (31 - x), 0, 8, 256, BACKGROUND_COLOR_BASE + color);
1631      }
1632   }
1633   else
1634   {
1635      for (x = 0; x < 32; x++)
1636      {
1637         int color;
1021                The background color generator is connected this way:
16381022
1639         if (x == 31)
1640            color = 0;
1641         else
1642            color = prom[x + 1];
1643
1644         plot_box(bitmap, 8 * x, 0, 8, 256, BACKGROUND_COLOR_BASE + color);
1023                    RED   - 270 ohm resistor
1024                    GREEN - 560 ohm resistor
1025                    BLUE  - 470 ohm resistor
1026            */
1027         UINT8 red = ((~prom[x] & 0x02) && background_red) ? 0x7c : 0x00;
1028         UINT8 green = ((~prom[x] & 0x02) && background_green) ? 0x3c : 0x00;
1029         UINT8 blue = ((~prom[x] & 0x01) && background_blue) ? 0x47 : 0x00;
1030         fillbitmap(bitmap, MAKE_RGB(red, green, blue), &draw);
16451031      }
1646   }
16471032}
16481033
1649static void dambustr_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
1650{
1651   int col1 = BACKGROUND_COLOR_BASE + dambustr_bg_color_1;
1652   int col2 = BACKGROUND_COLOR_BASE + dambustr_bg_color_2;
16531034
1654   if (flip_screen_x_get())
1655   {
1656      plot_box(bitmap,   0, 0, 256-dambustr_bg_split_line, 256, col2);
1657      plot_box(bitmap, 256-dambustr_bg_split_line, 0, dambustr_bg_split_line, 256, col1);
1658   }
1659   else
1660   {
1661      plot_box(bitmap,   0, 0, 256-dambustr_bg_split_line, 256, col1);
1662      plot_box(bitmap, 256-dambustr_bg_split_line, 0, dambustr_bg_split_line, 256, col2);
1663   }
1664
1665}
1666
1667static void dambustr_draw_upper_background(bitmap_t *bitmap, const rectangle *cliprect)
1035void turtles_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
16681036{
1669   static rectangle clip = { 0, 0, 0, 0 };
1037   /*
1038        The background color generator is connected this way:
16701039
1671   if (flip_screen_x_get())
1672   {
1673      clip.min_x = 254 - dambustr_bg_split_line;
1674      clip.max_x = dambustr_bg_split_line;
1675      clip.min_y = 0;
1676      clip.max_y = 255;
1677      copybitmap(bitmap, dambustr_tmpbitmap, 0, 0, 0, 0, &clip);
1678   }
1679   else
1680   {
1681      clip.min_x = 0;
1682      clip.max_x = 254 - dambustr_bg_split_line;
1683      clip.min_y = 0;
1684      clip.max_y = 255;
1685      copybitmap(bitmap, dambustr_tmpbitmap, 0, 0, 0, 0, &clip);
1686   }
1040            RED   - 390 ohm resistor
1041            GREEN - 470 ohm resistor
1042            BLUE  - 390 ohm resistor
1043    */
1044   fillbitmap(bitmap, MAKE_RGB(background_red * 0x55, background_green * 0x47, background_blue * 0x55), cliprect);
16871045}
16881046
16891047
1690
1691/* star drawing functions */
1692
1693void galaxian_init_stars(running_machine *machine, int colors_offset)
1048void scramble_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
16941049{
1695   int i;
1696   int total_stars;
1697   UINT32 generator;
1698   int x,y;
1050   /* blue background - 390 ohm resistor */
1051   fillbitmap(bitmap, background_enable ? MAKE_RGB(0,0,0x56) : RGB_BLACK, cliprect);
16991052
1053   /* update the star origin to the current frame */
1054   stars_update_origin(machine);
17001055
1701   galaxian_stars_on = 0;
1702   stars_blink_state = 0;
1703   stars_blink_timer = timer_alloc(stars_blink_callback, NULL);
1704   stars_scroll_timer = timer_alloc(stars_scroll_callback, NULL);
1705   timer_adjusted = 0;
1706   stars_colors_start = colors_offset;
1707
1708   for (i = 0;i < 64;i++)
1056   /* render stars if enabled */
1057   if (stars_enabled)
17091058   {
1710      int bits,r,g,b;
1711      static const int map[4] = { 0x00, 0x88, 0xcc, 0xff };
1059      int blink_state = stars_blink_state & 3;
1060      int y;
17121061
1713
1714      bits = (i >> 0) & 0x03;
1715      r = map[bits];
1716      bits = (i >> 2) & 0x03;
1717      g = map[bits];
1718      bits = (i >> 4) & 0x03;
1719      b = map[bits];
1720      palette_set_color_rgb(machine,colors_offset+i,r,g,b);
1721   }
1722
1723
1724   /* precalculate the star background */
1725
1726   total_stars = 0;
1727   generator = 0;
1728
1729   for (y = 0;y < 256;y++)
1730   {
1731      for (x = 0;x < 512;x++)
1062      /* iterate over scanlines */
1063      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
17321064      {
1733         UINT32 bit0;
1734
1735
1736         bit0 = ((~generator >> 16) & 0x01) ^ ((generator >> 4) & 0x01);
1737
1738         generator = (generator << 1) | bit0;
1739
1740         if (((~generator >> 16) & 0x01) && (generator & 0xff) == 0xff)
1065         /* blink state 2 suppressed stars when 2V == 0 */
1066         if (blink_state != 2 || (y & 2) != 0)
17411067         {
1742            int color;
1743
1744
1745            color = (~(generator >> 8)) & 0x3f;
1746            if (color)
1747            {
1748               stars[total_stars].x = x;
1749               stars[total_stars].y = y;
1750               stars[total_stars].color = color;
1751
1752               total_stars++;
1753            }
1068            /* blink states 0 and 1 suppress stars when certain bits of the color == 0 */
1069            static const UINT8 colormask_table[4] = { 0x20, 0x08, 0xff, 0xff };
1070            stars_draw_row(bitmap, 256, y, y * 512, colormask_table[blink_state]);
17541071         }
17551072      }
17561073   }
1757
1758   if (total_stars != STAR_COUNT)
1759   {
1760      fatalerror("total_stars = %d, STAR_COUNT = %d",total_stars,STAR_COUNT);
1761   }
17621074}
17631075
1764static void plot_star(bitmap_t *bitmap, int x, int y, int color, const rectangle *cliprect)
1765{
1766   if (flipscreen_x)
1767      x = 255 - x;
17681076
1769   if (flipscreen_y)
1770      y = 255 - y;
1771
1772   if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
1773      *BITMAP_ADDR16(bitmap, y, x) = stars_colors_start + color;
1774}
1775
1776static void noop_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
1077void jumpbug_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
17771078{
1778}
1079   /* blue background - 390 ohm resistor */
1080   fillbitmap(bitmap, background_enable ? MAKE_RGB(0,0,0x56) : RGB_BLACK, cliprect);
17791081
1780void galaxian_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
1781{
1782   int offs;
1082   /* update the star origin to the current frame */
1083   stars_update_origin(machine);
17831084
1784
1785   if (!timer_adjusted)
1085   /* render stars if enabled -- same as scramble but nothing in the status area */
1086   if (stars_enabled)
17861087   {
1787      start_stars_scroll_timer(machine);
1788      timer_adjusted = 1;
1789   }
1088      int blink_state = stars_blink_state & 3;
1089      int y;
17901090
1791
1792   for (offs = 0;offs < STAR_COUNT;offs++)
1793   {
1794      int x,y;
1795
1796
1797      x = ((stars[offs].x +   stars_scrollpos) & 0x01ff) >> 1;
1798      y = ( stars[offs].y + ((stars_scrollpos + stars[offs].x) >> 9)) & 0xff;
1799
1800      if ((y & 0x01) ^ ((x >> 3) & 0x01))
1091      /* iterate over scanlines */
1092      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
18011093      {
1802         plot_star(bitmap, x, y, stars[offs].color, cliprect);
1094         /* blink state 2 suppressed stars when 2V == 0 */
1095         if (blink_state != 2 || (y & 2) != 0)
1096         {
1097            /* blink states 0 and 1 suppress stars when certain bits of the color == 0 */
1098            static const UINT8 colormask_table[4] = { 0x20, 0x08, 0xff, 0xff };
1099            stars_draw_row(bitmap, 240, y, y * 512, colormask_table[blink_state]);
1100         }
18031101      }
18041102   }
18051103}
18061104
1807static void scramble_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
1808{
1809   int offs;
18101105
18111106
1812   if (!timer_adjusted)
1813   {
1814      start_stars_blink_timer(100000, 10000, 0.00001);
1815      timer_adjusted = 1;
1816   }
1107/*************************************
1108 *
1109 *  Bullet rendering
1110 *
1111 *************************************/
18171112
1818
1819   for (offs = 0;offs < STAR_COUNT;offs++)
1113INLINE void galaxian_draw_pixel(bitmap_t *bitmap, const rectangle *cliprect, int y, int x, rgb_t color)
1114{
1115   if (y >= cliprect->min_y && y <= cliprect->max_y)
18201116   {
1821      int x,y;
1117      x *= GALAXIAN_XSCALE;
1118      x += GALAXIAN_H0START;
1119      if (x >= cliprect->min_x && x <= cliprect->max_x)
1120         *BITMAP_ADDR32(bitmap, y, x) = color;
18221121
1122      x++;
1123      if (x >= cliprect->min_x && x <= cliprect->max_x)
1124         *BITMAP_ADDR32(bitmap, y, x) = color;
18231125
1824      x = stars[offs].x >> 1;
1825      y = stars[offs].y;
1826
1827      if ((y & 0x01) ^ ((x >> 3) & 0x01))
1828      {
1829         /* determine when to skip plotting */
1830         switch (stars_blink_state & 0x03)
1831         {
1832         case 0:
1833            if (!(stars[offs].color & 0x01))  continue;
1834            break;
1835         case 1:
1836            if (!(stars[offs].color & 0x04))  continue;
1837            break;
1838         case 2:
1839            if (!(stars[offs].y & 0x02))  continue;
1840            break;
1841         case 3:
1842            /* always plot */
1843            break;
1844         }
1845
1846         plot_star(bitmap, x, y, stars[offs].color, cliprect);
1847      }
1126      x++;
1127      if (x >= cliprect->min_x && x <= cliprect->max_x)
1128         *BITMAP_ADDR32(bitmap, y, x) = color;
18481129   }
18491130}
18501131
1851static void rescue_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
1132
1133void galaxian_draw_bullet(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
18521134{
1853   int offs;
1135   /*
1136        Both "shells" and "missiles" begin displaying when the horizontal counter
1137        reaches $FC, and they stop displaying when it reaches $00, resulting in
1138        4-pixel-long shots. The first 7 entries are called "shells" and render as
1139        white; the final entry is called a "missile" and renders as yellow.
1140    */
1141   x -= 4;
1142   galaxian_draw_pixel(bitmap, cliprect, y, x++, bullet_color[offs]);
1143   galaxian_draw_pixel(bitmap, cliprect, y, x++, bullet_color[offs]);
1144   galaxian_draw_pixel(bitmap, cliprect, y, x++, bullet_color[offs]);
1145   galaxian_draw_pixel(bitmap, cliprect, y, x++, bullet_color[offs]);
1146}
18541147
18551148
1856   /* same as Scramble, but only top (left) half of screen */
1857
1858   if (!timer_adjusted)
1149void mshuttle_draw_bullet(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
1150{
1151   /* verified by schematics:
1152        * both "W" and "Y" bullets are 4 pixels long
1153        * "W" bullets are enabled when H6 == 0, and are always purple
1154        * "Y" bullets are enabled when H6 == 1, and vary in color based on H4,H3,H2
1155    */
1156   static const rgb_t colors[8] =
18591157   {
1860      start_stars_blink_timer(100000, 10000, 0.00001);
1861      timer_adjusted = 1;
1862   }
1158      MAKE_RGB(0xff,0xff,0xff),
1159      MAKE_RGB(0xff,0xff,0x00),
1160      MAKE_RGB(0x00,0xff,0xff),
1161      MAKE_RGB(0x00,0xff,0x00),
1162      MAKE_RGB(0xff,0x00,0xff),
1163      MAKE_RGB(0xff,0x00,0x00),
1164      MAKE_RGB(0x00,0x00,0xff),
1165      MAKE_RGB(0x00,0x00,0x00)
1166   };
1167   --x;
1168   galaxian_draw_pixel(bitmap, cliprect, y, x, ((x & 0x40) == 0) ? colors[(x >> 2) & 7] : MAKE_RGB(0xff,0x00,0xff));
1169   --x;
1170   galaxian_draw_pixel(bitmap, cliprect, y, x, ((x & 0x40) == 0) ? colors[(x >> 2) & 7] : MAKE_RGB(0xff,0x00,0xff));
1171   --x;
1172   galaxian_draw_pixel(bitmap, cliprect, y, x, ((x & 0x40) == 0) ? colors[(x >> 2) & 7] : MAKE_RGB(0xff,0x00,0xff));
1173   --x;
1174   galaxian_draw_pixel(bitmap, cliprect, y, x, ((x & 0x40) == 0) ? colors[(x >> 2) & 7] : MAKE_RGB(0xff,0x00,0xff));
1175}
18631176
18641177
1865   for (offs = 0;offs < STAR_COUNT;offs++)
1866   {
1867      int x,y;
1178void scramble_draw_bullet(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
1179{
1180   /*
1181        Scramble only has "shells", which begin displaying when the counter
1182        reaches $FA, and stop displaying one pixel clock layer. All shells are
1183        rendered as yellow.
1184    */
1185   x -= 6;
1186   galaxian_draw_pixel(bitmap, cliprect, y, x, MAKE_RGB(0xff,0xff,0x00));
1187}
18681188
18691189
1870      x = stars[offs].x >> 1;
1871      y = stars[offs].y;
1872
1873      if ((x < 128) && ((y & 0x01) ^ ((x >> 3) & 0x01)))
1874      {
1875         /* determine when to skip plotting */
1876         switch (stars_blink_state & 0x03)
1877         {
1878         case 0:
1879            if (!(stars[offs].color & 0x01))  continue;
1880            break;
1881         case 1:
1882            if (!(stars[offs].color & 0x04))  continue;
1883            break;
1884         case 2:
1885            if (!(stars[offs].y & 0x02))  continue;
1886            break;
1887         case 3:
1888            /* always plot */
1889            break;
1890         }
1891
1892         plot_star(bitmap, x, y, stars[offs].color, cliprect);
1893      }
1894   }
1190void theend_draw_bullet(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
1191{
1192   /* Same as galaxian except blue/green are swapped */
1193   x -= 4;
1194   galaxian_draw_pixel(bitmap, cliprect, y, x++, MAKE_RGB(RGB_RED(bullet_color[offs]), RGB_BLUE(bullet_color[offs]), RGB_GREEN(bullet_color[offs])));
1195   galaxian_draw_pixel(bitmap, cliprect, y, x++, MAKE_RGB(RGB_RED(bullet_color[offs]), RGB_BLUE(bullet_color[offs]), RGB_GREEN(bullet_color[offs])));
1196   galaxian_draw_pixel(bitmap, cliprect, y, x++, MAKE_RGB(RGB_RED(bullet_color[offs]), RGB_BLUE(bullet_color[offs]), RGB_GREEN(bullet_color[offs])));
1197   galaxian_draw_pixel(bitmap, cliprect, y, x++, MAKE_RGB(RGB_RED(bullet_color[offs]), RGB_BLUE(bullet_color[offs]), RGB_GREEN(bullet_color[offs])));
18951198}
18961199
1897static void mariner_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
1898{
1899   int offs;
1900   UINT8 *prom;
19011200
19021201
1903   if (!timer_adjusted)
1904   {
1905      start_stars_scroll_timer(machine);
1906      timer_adjusted = 1;
1907   }
1202/*************************************
1203 *
1204 *  Generic extensions
1205 *
1206 *************************************/
19081207
1208void upper_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x)
1209{
1210   /* tiles are in the upper half of a larger ROM */
1211   *code += 0x100;
1212}
19091213
1910   /* bit 2 of the PROM controls star visibility */
19111214
1912   prom = memory_region(REGION_USER2);
1215void upper_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color)
1216{
1217   /* sprites are in the upper half of a larger ROM */
1218   *code += 0x40;
1219}
19131220
1914   for (offs = 0;offs < STAR_COUNT;offs++)
1915   {
1916      int x,y;
19171221
19181222
1919      x = ((stars[offs].x +   -stars_scrollpos) & 0x01ff) >> 1;
1920      y = ( stars[offs].y + ((-stars_scrollpos + stars[offs].x) >> 9)) & 0xff;
1223/*************************************
1224 *
1225 *  Frogger extensions
1226 *
1227 *************************************/
19211228
1922      if ((y & 0x01) ^ ((x >> 3) & 0x01))
1923      {
1924         if (prom[(x/8 + 1) & 0x1f] & 0x04)
1925         {
1926            plot_star(bitmap, x, y, stars[offs].color, cliprect);
1927         }
1928      }
1929   }
1229void frogger_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x)
1230{
1231   *color = ((*color >> 1) & 0x03) | ((*color << 2) & 0x04);
19301232}
19311233
1932static void jumpbug_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
1234void frogger_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color)
19331235{
1934   int offs;
1236   *color = ((*color >> 1) & 0x03) | ((*color << 2) & 0x04);
1237}
19351238
19361239
1937   if (!timer_adjusted)
1938   {
1939      start_stars_blink_timer(100000, 10000, 0.00001);
1940      start_stars_scroll_timer(machine);
1941      timer_adjusted = 1;
1942   }
19431240
1241/*************************************
1242 *
1243 *  Ghostmuncher Galaxian extensions
1244 *
1245 *************************************/
19441246
1945   for (offs = 0;offs < STAR_COUNT;offs++)
1946   {
1947      int x,y;
1948
1949
1950      x = stars[offs].x >> 1;
1951      y = stars[offs].y;
1952
1953      /* determine when to skip plotting */
1954      if ((y & 0x01) ^ ((x >> 3) & 0x01))
1955      {
1956         switch (stars_blink_state & 0x03)
1957         {
1958         case 0:
1959            if (!(stars[offs].color & 0x01))  continue;
1960            break;
1961         case 1:
1962            if (!(stars[offs].color & 0x04))  continue;
1963            break;
1964         case 2:
1965            if (!(stars[offs].y & 0x02))  continue;
1966            break;
1967         case 3:
1968            /* always plot */
1969            break;
1970         }
1971
1972         x = ((stars[offs].x +   stars_scrollpos) & 0x01ff) >> 1;
1973         y = ( stars[offs].y + ((stars_scrollpos + stars[offs].x) >> 9)) & 0xff;
1974
1975         /* no stars in the status area */
1976         if (x >= 240)  continue;
1977
1978         plot_star(bitmap, x, y, stars[offs].color, cliprect);
1979      }
1980   }
1247void gmgalax_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x)
1248{
1249   *code |= gfxbank[0] << 9;
1250//  *color |= gfxbank[0] << 3;
19811251}
19821252
1983
1984static TIMER_CALLBACK( stars_blink_callback )
1253void gmgalax_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color)
19851254{
1986   stars_blink_state++;
1255   *code |= (gfxbank[0] << 7) | 0x40;
1256   *color |= gfxbank[0] << 3;
19871257}
19881258
1989static void start_stars_blink_timer(double ra, double rb, double c)
1990{
1991   /* calculate the period using the formula given in the 555 datasheet */
19921259
1993   int period_in_ms = 693 * (ra + 2.0 * rb) * c;
19941260
1995   timer_adjust_periodic(stars_blink_timer, ATTOTIME_IN_MSEC(period_in_ms), 0, ATTOTIME_IN_MSEC(period_in_ms));
1996}
1261/*************************************
1262 *
1263 *  Pisces extensions
1264 *
1265 *************************************/
19971266
1998
1999static TIMER_CALLBACK( stars_scroll_callback )
1267void pisces_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x)
20001268{
2001   if (galaxian_stars_on)
2002   {
2003      stars_scrollpos++;
2004   }
1269   *code |= gfxbank[0] << 8;
20051270}
20061271
2007static void start_stars_scroll_timer(running_machine *machine)
1272void pisces_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color)
20081273{
2009   timer_adjust_periodic(stars_scroll_timer, video_screen_get_frame_period(machine->primary_screen), 0, video_screen_get_frame_period(machine->primary_screen));
1274   *code |= gfxbank[0] << 6;
20101275}
20111276
20121277
20131278
2014static TILE_GET_INFO( get_tile_info )
1279/*************************************
1280 *
1281 *  Batman Part 2 extensions
1282 *
1283 *************************************/
1284
1285void batman2_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x)
20151286{
2016   UINT8 x = tile_index & 0x1f;
1287   if (*code & 0x80)
1288      *code |= gfxbank[0] << 8;
1289}
20171290
2018   UINT16 code = galaxian_videoram[tile_index];
2019   UINT8 color = galaxian_attributesram[(x << 1) | 1] & color_mask;
20201291
2021   if (modify_charcode)
2022   {
2023      modify_charcode(&code, x);
2024   }
20251292
2026   if (modify_color)
2027   {
2028      modify_color(&color);
2029   }
1293/*************************************
1294 *
1295 *  Moon Cresta extensions
1296 *
1297 *************************************/
20301298
2031   SET_TILE_INFO(0, code, color, 0);
1299void mooncrst_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x)
1300{
1301   if (gfxbank[2] && (*code & 0xc0) == 0x80)
1302      *code = (*code & 0x3f) | (gfxbank[0] << 6) | (gfxbank[1] << 7) | 0x0100;
20321303}
20331304
2034static TILE_GET_INFO( rockclim_get_tile_info )
1305void mooncrst_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color)
20351306{
2036   UINT16 code = rockclim_videoram[tile_index];
2037   SET_TILE_INFO(2, code, 0, 0);
1307   if (gfxbank[2] && (*code & 0x30) == 0x20)
1308      *code = (*code & 0x0f) | (gfxbank[1] << 4) | (gfxbank[0] << 5) | 0x40;
20381309}
20391310
2040static void draw_bullets_common(bitmap_t *bitmap, const rectangle *cliprect)
2041{
2042   int offs;
20431311
20441312
2045   for (offs = 0;offs < galaxian_bulletsram_size;offs += 4)
2046   {
2047      UINT8 sx,sy;
1313/*************************************
1314 *
1315 *  Moon Quasar extensions
1316 *
1317 *************************************/
20481318
2049      sy = 255 - galaxian_bulletsram[offs + 1];
2050      sx = 255 - galaxian_bulletsram[offs + 3];
2051
2052      if (flipscreen_y)  sy = 255 - sy;
2053
2054      draw_bullets(bitmap, offs, sx, sy, cliprect);
2055   }
1319void moonqsr_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x)
1320{
1321   *code |= (attrib & 0x20) << 3;
20561322}
20571323
2058
2059static void draw_sprites(running_machine *machine, bitmap_t *bitmap, UINT8 *spriteram, size_t spriteram_size)
1324void moonqsr_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color)
20601325{
2061   int offs;
1326   *code |= (base[2] & 0x20) << 1;
1327}
20621328
20631329
2064   for (offs = spriteram_size - 4;offs >= 0;offs -= 4)
2065   {
2066      UINT8 sx,sy,color;
2067      int flipx,flipy,code;
20681330
1331/*************************************
1332 *
1333 *  Moon Shuttle extensions
1334 *
1335 *************************************/
20691336
2070      sx = spriteram[offs + 3] + 1;   /* the existence of +1 is supported by a LOT of games */
2071      sy = spriteram[offs];         /* Anteater, Mariner, for example */
2072      flipx = spriteram[offs + 1] & 0x40;
2073      flipy = spriteram[offs + 1] & 0x80;
2074      code = spriteram[offs + 1] & 0x3f;
2075      color = spriteram[offs + 2] & color_mask;
2076
2077      if (modify_spritecode)
2078      {
2079         modify_spritecode(spriteram, &code, &flipx, &flipy, offs);
2080      }
2081
2082      if (modify_color)
2083      {
2084         modify_color(&color);
2085      }
2086
2087      if (modify_ypos)
2088      {
2089         modify_ypos(&sy);
2090      }
2091
2092      if (flipscreen_x)
2093      {
2094         sx = 240 - sx;
2095         flipx = !flipx;
2096      }
2097
2098      if (flipscreen_y)
2099      {
2100         flipy = !flipy;
2101      }
2102      else
2103      {
2104         sy = 240 - sy;
2105      }
2106
2107
2108      /* In at least Amidar Turtles, sprites #0, #1 and #2 need to be moved */
2109      /* down (left) one pixel to be positioned correctly. */
2110      /* Note that the adjustment must be done AFTER handling flipscreen, thus */
2111      /* proving that this is a hardware related "feature" */
2112
2113      if (offs < 3*4)  sy++;
2114
2115
2116      drawgfx(bitmap,machine->gfx[1],
2117            code,color,
2118            flipx,flipy,
2119            sx,sy,
2120            flipscreen_x ? spritevisibleareaflipx : spritevisiblearea,TRANSPARENCY_PEN,0);
2121   }
1337void mshuttle_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x)
1338{
1339   *code |= (attrib & 0x30) << 4;
21221340}
21231341
2124
2125VIDEO_UPDATE( galaxian )
1342void mshuttle_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color)
21261343{
2127   draw_background(bitmap, cliprect);
1344   *code |= (base[2] & 0x30) << 2;
1345}
21281346
21291347
2130   if (galaxian_stars_on)
2131   {
2132      draw_stars(screen->machine, bitmap, cliprect);
2133   }
21341348
1349/*************************************
1350 *
1351 *  Jumpbug extensions
1352 *
1353 *************************************/
21351354
2136   tilemap_draw(bitmap, 0, bg_tilemap, 0, 0);
2137
2138
2139   if (draw_bullets)
2140   {
2141      draw_bullets_common(bitmap, cliprect);
2142   }
2143
2144
2145   draw_sprites(screen->machine, bitmap, galaxian_spriteram, galaxian_spriteram_size);
2146
2147   if (spriteram2_present)
2148   {
2149      draw_sprites(screen->machine, bitmap, galaxian_spriteram2, galaxian_spriteram2_size);
2150   }
2151   return 0;
1355void jumpbug_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x)
1356{
1357   if ((*code & 0xc0) == 0x80 && (gfxbank[2] & 0x01))
1358      *code += 128 + (( gfxbank[0] & 0x01) << 6) +
1359                  (( gfxbank[1] & 0x01) << 7) +
1360                  ((~gfxbank[4] & 0x01) << 8);
21521361}
21531362
2154
2155VIDEO_UPDATE( dambustr )
1363void jumpbug_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color)
21561364{
2157   int i, j;
2158   UINT8 color;
2159
2160   draw_background(bitmap, cliprect);
2161
2162   if (galaxian_stars_on)
1365   if ((*code & 0x30) == 0x20 && (gfxbank[2] & 0x01) != 0)
21631366   {
2164      draw_stars(screen->machine, bitmap, cliprect);
1367      *code += 32 + (( gfxbank[0] & 0x01) << 4) +
1368                 (( gfxbank[1] & 0x01) << 5) +
1369                 ((~gfxbank[4] & 0x01) << 6);
21651370   }
2166
2167   /* save the background for drawing it again later, if background has priority over characters */
2168   copybitmap(dambustr_tmpbitmap, bitmap, 0, 0, 0, 0, NULL);
2169
2170   tilemap_draw(bitmap, 0, bg_tilemap, 0, 0);
2171
2172   if (draw_bullets)
2173   {
2174      draw_bullets_common(bitmap, cliprect);
2175   }
2176
2177   draw_sprites(screen->machine, bitmap, galaxian_spriteram, galaxian_spriteram_size);
2178
2179   if (dambustr_bg_priority)
2180   {
2181      /* draw the upper part of the background, as it has priority */
2182      dambustr_draw_upper_background(bitmap, cliprect);
2183
2184      /* only rows with color code > 3 are stronger than the background */
2185      memset(dambustr_videoram2, 0x20, 0x0400);
2186      for (i=0; i<32; i++) {
2187         color = galaxian_attributesram[(i << 1) | 1] & color_mask;
2188         if (color > 3) {
2189            for (j=0; j<32; j++)
2190               dambustr_videoram2[32*j+i] = galaxian_videoram[32*j+i];
2191         };
2192      };
2193      tilemap_mark_all_tiles_dirty(dambustr_tilemap2);
2194      tilemap_draw(bitmap, 0, dambustr_tilemap2, 0, 0);
2195   };
2196
2197   return 0;
21981371}
2199
src/mame/video/toaplan1.c
r2241r2242
451451
452452WRITE16_HANDLER( rallybik_bcu_flipscreen_w )
453453{
454   if (ACCESSING_LSB && (data != bcu_flipscreen))
454   if (ACCESSING_BITS_0_7 && (data != bcu_flipscreen))
455455   {
456456      logerror("Setting BCU controller flipscreen port to %04x\n",data);
457457      bcu_flipscreen = data & 0x01;      /* 0x0001 = flip, 0x0000 = no flip */
r2241r2242
478478
479479WRITE16_HANDLER( toaplan1_bcu_flipscreen_w )
480480{
481   if (ACCESSING_LSB && (data != bcu_flipscreen))
481   if (ACCESSING_BITS_0_7 && (data != bcu_flipscreen))
482482   {
483483      logerror("Setting BCU controller flipscreen port to %04x\n",data);
484484      bcu_flipscreen = data & 0x01;      /* 0x0001 = flip, 0x0000 = no flip */
r2241r2242
505505
506506WRITE16_HANDLER( toaplan1_fcu_flipscreen_w )
507507{
508   if (ACCESSING_MSB)
508   if (ACCESSING_BITS_8_15)
509509   {
510510      logerror("Setting FCU controller flipscreen port to %04x\n",data);
511511      fcu_flipscreen = data & 0x8000;   /* 0x8000 = flip, 0x0000 = no flip */
src/mame/video/tmnt.c
r2241r2242
330330
331331WRITE16_HANDLER( tmnt_0a0000_w )
332332{
333   if (ACCESSING_LSB)
333   if (ACCESSING_BITS_0_7)
334334   {
335335      static int last;
336336
r2241r2242
356356
357357WRITE16_HANDLER( punkshot_0a0020_w )
358358{
359   if (ACCESSING_LSB)
359   if (ACCESSING_BITS_0_7)
360360   {
361361      static int last;
362362
r2241r2242
377377
378378WRITE16_HANDLER( lgtnfght_0a0018_w )
379379{
380   if (ACCESSING_LSB)
380   if (ACCESSING_BITS_0_7)
381381   {
382382      static int last;
383383
r2241r2242
399399
400400WRITE16_HANDLER( blswhstl_700300_w )
401401{
402   if (ACCESSING_LSB)
402   if (ACCESSING_BITS_0_7)
403403   {
404404      /* bit 0,1 = coin counter */
405405      coin_counter_w(0,data & 0x01);
r2241r2242
433433
434434WRITE16_HANDLER( glfgreat_122000_w )
435435{
436   if (ACCESSING_LSB)
436   if (ACCESSING_BITS_0_7)
437437   {
438438      /* bit 0,1 = coin counter */
439439      coin_counter_w(0,data & 0x01);
r2241r2242
454454
455455      /* other bits unknown */
456456   }
457   if (ACCESSING_MSB)
457   if (ACCESSING_BITS_8_15)
458458   {
459459      /* bit 8 = 53596 char/rom selection for ROM test */
460460      glfgreat_roz_rom_mode = data & 0x100;
r2241r2242
464464
465465WRITE16_HANDLER( ssriders_eeprom_w )
466466{
467   if (ACCESSING_LSB)
467   if (ACCESSING_BITS_0_7)
468468   {
469469      /* bit 0 is data */
470470      /* bit 1 is cs (active low) */
r2241r2242
485485
486486WRITE16_HANDLER( ssriders_1c0300_w )
487487{
488   if (ACCESSING_LSB)
488   if (ACCESSING_BITS_0_7)
489489   {
490490      /* bit 0,1 = coin counter */
491491      coin_counter_w(0,data & 0x01);
r2241r2242
501501
502502WRITE16_HANDLER( prmrsocr_122000_w )
503503{
504   if (ACCESSING_LSB)
504   if (ACCESSING_BITS_0_7)
505505   {
506506      /* bit 0,1 = coin counter */
507507      coin_counter_w(0,data & 0x01);
r2241r2242
531531
532532WRITE16_HANDLER( tmnt_priority_w )
533533{
534   if (ACCESSING_LSB)
534   if (ACCESSING_BITS_0_7)
535535   {
536536      /* bit 2/3 = priority; other bits unused */
537537      /* bit2 = PRI bit3 = PRI2
src/mame/video/segaic16.c
r2241r2242
34453445
34463446WRITE16_HANDLER( segaic16_road_control_0_w )
34473447{
3448   if (ACCESSING_LSB)
3448   if (ACCESSING_BITS_0_7)
34493449   {
34503450      road[0].control = data & ((road[0].type == SEGAIC16_ROAD_OUTRUN) ? 3 : 7);
34513451   }
src/mame/video/bionicc.c
r2241r2242
163163
164164WRITE16_HANDLER( bionicc_gfxctrl_w )
165165{
166   if (ACCESSING_MSB)
166   if (ACCESSING_BITS_8_15)
167167   {
168168      flip_screen_set(data & 0x0100);
169169
src/mame/video/psikyo.c
r2241r2242
105105WRITE32_HANDLER( psikyo_vram_0_w )
106106{
107107   COMBINE_DATA(&psikyo_vram_0[offset]);
108   if (ACCESSING_MSW32)
108   if (ACCESSING_BITS_16_31)
109109   {
110110      tilemap_mark_tile_dirty(tilemap_0_size0, offset*2);
111111      tilemap_mark_tile_dirty(tilemap_0_size1, offset*2);
r2241r2242
113113      tilemap_mark_tile_dirty(tilemap_0_size3, offset*2);
114114   }
115115
116   if (ACCESSING_LSW32)
116   if (ACCESSING_BITS_0_15)
117117   {
118118      tilemap_mark_tile_dirty(tilemap_0_size0, offset*2+1);
119119      tilemap_mark_tile_dirty(tilemap_0_size1, offset*2+1);
r2241r2242
125125WRITE32_HANDLER( psikyo_vram_1_w )
126126{
127127   COMBINE_DATA(&psikyo_vram_1[offset]);
128   if (ACCESSING_MSW32)
128   if (ACCESSING_BITS_16_31)
129129   {
130130      tilemap_mark_tile_dirty(tilemap_1_size0, offset*2);
131131      tilemap_mark_tile_dirty(tilemap_1_size1, offset*2);
r2241r2242
133133      tilemap_mark_tile_dirty(tilemap_1_size3, offset*2);
134134   }
135135
136   if (ACCESSING_LSW32)
136   if (ACCESSING_BITS_0_15)
137137   {
138138      tilemap_mark_tile_dirty(tilemap_1_size0, offset*2+1);
139139      tilemap_mark_tile_dirty(tilemap_1_size1, offset*2+1);
src/mame/video/model3.c
r2241r2242
659659
660660WRITE64_HANDLER( real3d_display_list_w )
661661{
662   if(!(mem_mask & U64(0xffffffff00000000))) {
662   if(ACCESSING_BITS_32_63) {
663663      display_list_ram[offset*2] = BYTE_REVERSE32((UINT32)(data >> 32));
664664   }
665   if(!(mem_mask & U64(0x00000000ffffffff))) {
665   if(ACCESSING_BITS_0_31) {
666666      display_list_ram[(offset*2)+1] = BYTE_REVERSE32((UINT32)(data));
667667   }
668668}
669669
670670WRITE64_HANDLER( real3d_polygon_ram_w )
671671{
672   if(!(mem_mask & U64(0xffffffff00000000))) {
672   if(ACCESSING_BITS_32_63) {
673673      polygon_ram[offset*2] = BYTE_REVERSE32((UINT32)(data >> 32));
674674   }
675   if(!(mem_mask & U64(0x00000000ffffffff))) {
675   if(ACCESSING_BITS_0_31) {
676676      polygon_ram[(offset*2)+1] = BYTE_REVERSE32((UINT32)(data));
677677   }
678678}
src/mame/video/cchasm.c
r2241r2242
107107
108108WRITE16_HANDLER( cchasm_refresh_control_w )
109109{
110   if (ACCESSING_MSB)
110   if (ACCESSING_BITS_8_15)
111111   {
112112      switch (data >> 8)
113113      {
src/mame/video/toaplan2.c
r2241r2242
705705
706706WRITE16_HANDLER( batrider_objectbank_w )
707707{
708   if (ACCESSING_LSB)
708   if (ACCESSING_BITS_0_7)
709709   {
710710      data &= 0xf;
711711      if (batrider_object_bank[offset] != data)
r2241r2242
813813
814814static void toaplan2_scroll_reg_select_w(offs_t offset, UINT16 data, UINT32 mem_mask, int controller)
815815{
816   if (ACCESSING_LSB)
816   if (ACCESSING_BITS_0_7)
817817   {
818818      toaplan2_scroll_reg[controller] = data & 0x8f;
819819      if (data & 0x70)
r2241r2242
10451045
10461046WRITE16_HANDLER( pipibibi_scroll_w )
10471047{
1048   if (ACCESSING_MSB && ACCESSING_LSB)
1048   if (ACCESSING_BITS_8_15 && ACCESSING_BITS_0_7)
10491049   {
10501050      switch(offset)
10511051      {
src/mame/video/wecleman.c
r2241r2242
2828   int line_offset;
2929
3030   const pen_t *pal_data;
31   rgb_t pal_base;
3132
3233   int x_offset, y_offset;
3334   int tile_width, tile_height;
r2241r2242
137138      code = source[0x06/2];
138139      zoom = source[0x08/2];
139140
140      sprite->pal_data = base_pal + ((source[0x0e/2] & 0xff) << 4);
141      sprite->pal_base = (source[0x0e/2] & 0xff) << 4;
142      sprite->pal_data = base_pal + sprite->pal_base;
141143
142144      gfx = (wecleman_gfx_bank[bank] << 15) + (code & 0x7fff);
143145
r2241r2242
198200}
199201
200202// draws a 8bpp palette sprites on a 16bpp direct RGB target (sub-par implementation)
201static void do_blit_zoom16(bitmap_t *bitmap, const rectangle *cliprect, struct sprite *sprite)
203static void do_blit_zoom32(bitmap_t *bitmap, const rectangle *cliprect, struct sprite *sprite)
202204{
203205#define PRECISION_X 20
204206#define PRECISION_Y 20
r2241r2242
275277   // pre-loop assignments and adjustments
276278   pal_base = sprite->pal_data;
277279
278   x1 -= dx;
279   x2 -= dx;
280   if (x1 > cliprect->min_x)
281   {
282      x1 -= dx;
283      x2 -= dx;
284   }
280285
281286   for (sy = y1; sy != y2; sy += dy)
282287   {
283288      UINT8 *row_base = sprite->pen_data + (src_f0y>>PRECISION_Y) * sprite->line_offset;
284      UINT16 *dst_ptr = BITMAP_ADDR16(bitmap, sy, 0);
285289      src_fpx = src_f0x;
286290
287      if (!sprite->shadow_mode)
291      if (bitmap->format == BITMAP_FORMAT_RGB32)   // Wec Le Mans
288292      {
289         for (sx = x1; sx != x2; sx += dx)
293         UINT32 *dst_ptr = BITMAP_ADDR32(bitmap, sy, 0);
294
295         if (!sprite->shadow_mode)
290296         {
291            int pix = row_base[src_fpx >> PRECISION_X];
292            if (pix & 0x80) break;
293            if (pix)
294               dst_ptr[sx] = pal_base[pix];
295            src_fpx += src_fdx;
297            for (sx = x1; sx != x2; sx += dx)
298            {
299               int pix = row_base[src_fpx >> PRECISION_X];
300               if (pix & 0x80) break;
301               if (pix)
302                  dst_ptr[sx] = pal_base[pix];
303               src_fpx += src_fdx;
304            }
296305         }
297      }
298      else if (gameid == 0)   // Wec Le Mans
299      {
300         for (sx = x1; sx != x2; sx += dx)
306         else
301307         {
302            int pix = row_base[src_fpx >> PRECISION_X];
303            if (pix & 0x80) break;
304            if (pix)
308            for (sx = x1; sx != x2; sx += dx)
305309            {
306               if (pix != 0xa)
307                  dst_ptr[sx] = pal_base[pix];
308               else
309                  dst_ptr[sx] = rgb_half[dst_ptr[sx]];
310               int pix = row_base[src_fpx >> PRECISION_X];
311               if (pix & 0x80) break;
312               if (pix)
313               {
314                  if (pix != 0xa)
315                     dst_ptr[sx] = pal_base[pix];
316                  else
317                     dst_ptr[sx] = (dst_ptr[sx] >> 1) & MAKE_RGB(0x7f,0x7f,0x7f);
318               }
319               src_fpx += src_fdx;
310320            }
311            src_fpx += src_fdx;
312321         }
313322      }
314323      else   // Hot Chase
315324      {
316         for (sx = x1; sx != x2; sx += dx)
325         UINT16 *dst_ptr = BITMAP_ADDR16(bitmap, sy, 0);
326         pen_t base = sprite->pal_base;
327
328         if (!sprite->shadow_mode)
317329         {
318            int pix = row_base[src_fpx >> PRECISION_X];
319            if (pix & 0x80) break;
320            if (pix)
330            for (sx = x1; sx != x2; sx += dx)
321331            {
322               if (pix != 0xa)
323                  dst_ptr[sx] = pal_base[pix];
324               else
325                  dst_ptr[sx] |= 0x800;
332               int pix = row_base[src_fpx >> PRECISION_X];
333               if (pix & 0x80) break;
334               if (pix)
335                  dst_ptr[sx] = base + pix;
336               src_fpx += src_fdx;
326337            }
327            src_fpx += src_fdx;
328338         }
339         else
340         {
341            for (sx = x1; sx != x2; sx += dx)
342            {
343               int pix = row_base[src_fpx >> PRECISION_X];
344               if (pix & 0x80) break;
345               if (pix)
346               {
347                  if (pix != 0xa)
348                     dst_ptr[sx] = base + pix;
349                  else
350                     dst_ptr[sx] |= 0x800;
351               }
352               src_fpx += src_fdx;
353            }
354         }
329355      }
330356
331357      src_f0y += src_fdy;
r2241r2242
340366   {
341367      sortsprite(spr_idx_list, spr_pri_list, spr_count);
342368
343      for (i=0; i<spr_count; i++) do_blit_zoom16(bitmap, cliprect, spr_ptr_list[spr_idx_list[i]]);
369      for (i=0; i<spr_count; i++) do_blit_zoom32(bitmap, cliprect, spr_ptr_list[spr_idx_list[i]]);
344370   }
345371   else   // Hot Chase
346372   {
347      for (i=0; i<spr_count; i++) do_blit_zoom16(bitmap, cliprect, spr_ptr_list[i]);
373      for (i=0; i<spr_count; i++) do_blit_zoom32(bitmap, cliprect, spr_ptr_list[i]);
348374   }
349375}
350376
r2241r2242
573599      // draw sky; each scanline is assumed to be dword aligned
574600      for (sy=cliprect->min_y-BMP_PAD; sy<DST_HEIGHT; sy++)
575601      {
576         UINT16 *dst = BITMAP_ADDR16(bitmap, sy+BMP_PAD, BMP_PAD);
577         UINT16 pix, road;
602         UINT32 *dst = BITMAP_ADDR32(bitmap, sy+BMP_PAD, BMP_PAD);
603         UINT32 pix;
604         UINT16 road;
578605
579606         road = wecleman_roadram[sy];
580607         if ((road>>8) != 0x02) continue;
r2241r2242
599626
600627      for (sy=cliprect->min_y-BMP_PAD; sy<DST_HEIGHT; sy++)
601628      {
602         UINT16 *dst = BITMAP_ADDR16(bitmap, sy+BMP_PAD, BMP_PAD);
603         UINT16 pix, road;
629         UINT32 *dst = BITMAP_ADDR32(bitmap, sy+BMP_PAD, BMP_PAD);
630         UINT32 pix;
631         UINT16 road;
604632
605633         road = wecleman_roadram[sy];
606634         if ((road>>8) != 0x04) continue;
r2241r2242
654682             int alpha, int pal_offset )   // alpha(0-3f), # of color codes to shift
655683{
656684   UINT8 *src_base, *src_ptr;
657   UINT16 *tmap_ptr, *dst_base, *dst_ptr;
685   UINT16 *tmap_ptr;
686   UINT32 *dst_base, *dst_ptr;
658687   const pen_t *pal_base, *pal_ptr;
659688
660689   int tilew, tileh;
661690   int tmskipx, tmskipy, tmscanx, tmmaskx, tmmasky;
662   int dx, dy, dst_pitch;
691   int dx, dy;
663692   int i, j, tx, ty;
664693
665694   if (alpha > 0x1f) return;
r2241r2242
680709
681710   src_base = gfx->gfxdata;
682711
683   dst_pitch = bitmap->rowpixels;
684   dst_base = (UINT16 *)bitmap->base + (y0+dy)*dst_pitch + (x0+dx);
712   dst_base = BITMAP_ADDR32(bitmap, y0+dy, x0+dx);
685713
686714   pal_base = machine->pens + pal_offset * gfx->color_granularity;
687715
r2241r2242
716744               {
717745                  UINT8 srcpix = *src_ptr++;
718746                  pen_t srcrgb = pal_ptr[srcpix];
719                  UINT16 dstrgb = dst_ptr[tx];
747                  UINT32 dstrgb = dst_ptr[tx];
720748                  int sr, sg, sb, dr, dg, db;
721749
722                  sr = (srcrgb >> 0) & 0x1f;
723                  sg = (srcrgb >> 5) & 0x1f;
724                  sb = (srcrgb >> 10) & 0x1f;
750                  sr = (srcrgb >> 3) & 0x1f;
751                  sg = (srcrgb >> 11) & 0x1f;
752                  sb = (srcrgb >> 19) & 0x1f;
725753
726                  dr = (dstrgb >> 0) & 0x1f;
727                  dg = (dstrgb >> 5) & 0x1f;
728                  db = (dstrgb >> 10) & 0x1f;
754                  dr = (dstrgb >> 3) & 0x1f;
755                  dg = (dstrgb >> 11) & 0x1f;
756                  db = (dstrgb >> 19) & 0x1f;
729757
730758                  dr = (t32x32pm[dr - sr + alpha] >> 5) + dr;
731759                  dg = (t32x32pm[dg - sg + alpha] >> 5) + dg;
732760                  db = (t32x32pm[db - sb + alpha] >> 5) + db;
733761
734                  dst_ptr[tx] = dr | (dg << 5) | (db << 10);
762                  dst_ptr[tx] = MAKE_RGB(pal5bit(db), pal5bit(dg), pal5bit(dr));
735763               }
736               dst_ptr += dst_pitch;
764               dst_ptr += bitmap->rowpixels;
737765            }
738766         }
739767
r2241r2242
744772            {
745773               for (tx = 0; tx < tilew; tx++)
746774                  dst_ptr[tx] = pal_ptr[*src_ptr++];
747               dst_ptr += dst_pitch;
775               dst_ptr += bitmap->rowpixels;
748776            }
749777         }
750778      }
751779
752      dst_base += dst_pitch * tileh;
780      dst_base += bitmap->rowpixels * tileh;
753781   }
754782}
755783
r2241r2242
828856
829857   // bit0-6: background transition, 0=off, 1=on
830858   // bit7: palette being changed, 0=no, 1=yes
831   if (ACCESSING_LSB)
859   if (ACCESSING_BITS_0_7)
832860   {
833861      if ((data & 0x7f) == 0 && !cloud_ds)
834862         cloud_ds = BLEND_INC;
r2241r2242
888916   UINT8 *buffer;
889917   int i, j;
890918
891   assert(video_screen_get_format(machine->primary_screen) == BITMAP_FORMAT_RGB15);
919   assert(video_screen_get_format(machine->primary_screen) == BITMAP_FORMAT_RGB32);
892920   buffer = auto_malloc(0x12c00);   // working buffer for sprite operations
893921
894922   gameid = 0;
src/mame/video/btoads.c
r2241r2242
8383
8484WRITE16_HANDLER( btoads_display_control_w )
8585{
86   if (ACCESSING_MSB)
86   if (ACCESSING_BITS_8_15)
8787   {
8888      /* allow multiple changes during display */
8989      int scanline = video_screen_get_vpos(machine->primary_screen);
r2241r2242
121121   video_screen_update_now(machine->primary_screen);
122122
123123   /* upper bits are Y scroll, lower bits are X scroll */
124   if (ACCESSING_MSB)
124   if (ACCESSING_BITS_8_15)
125125      yscroll0 = data >> 8;
126   if (ACCESSING_LSB)
126   if (ACCESSING_BITS_0_7)
127127      xscroll0 = data & 0xff;
128128}
129129
r2241r2242
134134   video_screen_update_now(machine->primary_screen);
135135
136136   /* upper bits are Y scroll, lower bits are X scroll */
137   if (ACCESSING_MSB)
137   if (ACCESSING_BITS_8_15)
138138      yscroll1 = data >> 8;
139   if (ACCESSING_LSB)
139   if (ACCESSING_BITS_0_7)
140140      xscroll1 = data & 0xff;
141141}
142142
r2241r2242
200200
201201WRITE16_HANDLER( btoads_vram_fg_display_w )
202202{
203   if (ACCESSING_LSB)
203   if (ACCESSING_BITS_0_7)
204204      vram_fg_display[offset] = data;
205205}
206206
207207
208208WRITE16_HANDLER( btoads_vram_fg_draw_w )
209209{
210   if (ACCESSING_LSB)
210   if (ACCESSING_BITS_0_7)
211211      vram_fg_draw[offset] = data;
212212}
213213
src/mame/video/tetrisp2.c
r2241r2242
105105
106106WRITE16_HANDLER( tetrisp2_priority_w )
107107{
108   if (ACCESSING_MSB)
108   if (ACCESSING_BITS_8_15)
109109   {
110110      data |= ((data & 0xff00) >> 8);
111111      tetrisp2_priority[offset] = data;
r2241r2242
115115
116116WRITE16_HANDLER( rockn_priority_w )
117117{
118   if (ACCESSING_MSB)
118   if (ACCESSING_BITS_8_15)
119119   {
120120      tetrisp2_priority[offset] = data;
121121   }
r2241r2242
123123
124124WRITE16_HANDLER( rocknms_sub_priority_w )
125125{
126   if (ACCESSING_MSB)
126   if (ACCESSING_BITS_8_15)
127127   {
128128      rocknms_sub_priority[offset] = data;
129129   }
src/mame/video/lastduel.c
r2241r2242
123123
124124WRITE16_HANDLER( lastduel_flip_w )
125125{
126   if (ACCESSING_LSB)
126   if (ACCESSING_BITS_0_7)
127127   {
128128      flip_screen_set(data & 0x01);
129129
src/mame/video/alpha68k.c
r2241r2242
5656WRITE16_HANDLER( alpha68k_videoram_w )
5757{
5858   /* Doh. */
59   if(ACCESSING_LSB)
60      if(ACCESSING_MSB)
59   if(ACCESSING_BITS_0_7)
60      if(ACCESSING_BITS_8_15)
6161         videoram16[offset] = data;
6262      else
6363         videoram16[offset] = data & 0xff;
src/mame/video/cischeat.c
r2241r2242
253253   switch (offset)
254254   {
255255       case 0x0000/2   :   // leds
256         if (ACCESSING_LSB)
256         if (ACCESSING_BITS_0_7)
257257         {
258258             coin_counter_w(0,new_data & 0x01);
259259             coin_counter_w(1,new_data & 0x02);
r2241r2242
266266         break;
267267
268268       case 0x0004/2   :   // motor (seat?)
269         if (ACCESSING_LSB)
269         if (ACCESSING_BITS_0_7)
270270            set_led_status(2, (new_data != old_data) ? 1 : 0);
271271          break;
272272
r2241r2242
347347   switch (offset)
348348   {
349349       case 0x0000/2   :   // leds
350         if (ACCESSING_LSB)
350         if (ACCESSING_BITS_0_7)
351351         {
352352             coin_counter_w(0,new_data & 0x01);
353353             coin_counter_w(1,new_data & 0x02);
r2241r2242
360360         break;
361361
362362       case 0x0004/2   :   // motor (seat?)
363         if (ACCESSING_LSB)
363         if (ACCESSING_BITS_0_7)
364364            set_led_status(2, (new_data != old_data) ? 1 : 0);
365365          break;
366366
r2241r2242
492492*/
493493      // "shudder" motors, leds
494494      case 0x0004/2   :
495         if (ACCESSING_LSB)
495         if (ACCESSING_BITS_0_7)
496496         {
497497             coin_counter_w(0,new_data & 0x01);
498498             coin_counter_w(1,new_data & 0x02);
r2241r2242
546546   switch (offset)
547547   {
548548      case 0x0000/2   :
549         if (ACCESSING_LSB)
549         if (ACCESSING_BITS_0_7)
550550         {
551551            cpunum_set_input_line(machine, 4,4,(new_data & 4)?ASSERT_LINE:CLEAR_LINE);
552552            cpunum_set_input_line(machine, 4,2,(new_data & 2)?ASSERT_LINE:CLEAR_LINE);
src/mame/video/galaxold.c
r0r2242
1/***************************************************************************
2
3  Galaxian hardware family
4
5***************************************************************************/
6
7#include "driver.h"
8#include "includes/galaxold.h"
9
10static const rectangle _spritevisiblearea =
11{
12   2*8+1, 32*8-1,
13   2*8,   30*8-1
14};
15static const rectangle _spritevisibleareaflipx =
16{
17   0*8, 30*8-2,
18   2*8, 30*8-1
19};
20
21static const rectangle* spritevisiblearea;
22static const rectangle* spritevisibleareaflipx;
23
24
25#define STARS_COLOR_BASE       (memory_region_length(REGION_PROMS))
26#define BULLETS_COLOR_BASE      (STARS_COLOR_BASE + 64)
27#define BACKGROUND_COLOR_BASE   (BULLETS_COLOR_BASE + 2)
28
29
30UINT8 *galaxold_videoram;
31UINT8 *galaxold_spriteram;
32UINT8 *galaxold_spriteram2;
33UINT8 *galaxold_attributesram;
34UINT8 *galaxold_bulletsram;
35UINT8 *rockclim_videoram;
36size_t galaxold_spriteram_size;
37size_t galaxold_spriteram2_size;
38size_t galaxold_bulletsram_size;
39
40
41static TILE_GET_INFO( get_tile_info );
42static TILE_GET_INFO( rockclim_get_tile_info );
43static tilemap *bg_tilemap;
44static tilemap *rockclim_tilemap;
45static int mooncrst_gfxextend;
46static int spriteram2_present;
47static UINT8 gfxbank[5];
48static UINT8 flipscreen_x;
49static UINT8 flipscreen_y;
50static UINT8 color_mask;
51static tilemap *dambustr_tilemap2;
52static UINT8 *dambustr_videoram2;
53static void (*modify_charcode)(UINT16 *code,UINT8 x);      /* function to call to do character banking */
54static void mooncrst_modify_charcode(UINT16 *code,UINT8 x);
55static void   pisces_modify_charcode(UINT16 *code,UINT8 x);
56static void mimonkey_modify_charcode(UINT16 *code,UINT8 x);
57static void  mariner_modify_charcode(UINT16 *code,UINT8 x);
58static void dambustr_modify_charcode(UINT16 *code,UINT8 x);
59
60static void (*modify_spritecode)(UINT8 *spriteram,int*,int*,int*,int);   /* function to call to do sprite banking */
61static void mshuttle_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs);
62static void  calipso_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs);
63static void mimonkey_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs);
64static void  batman2_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs);
65static void dkongjrm_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs);
66static void   ad2083_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs);
67static void dambustr_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs);
68
69static void (*modify_color)(UINT8 *color);   /* function to call to do modify how the color codes map to the PROM */
70static void drivfrcg_modify_color(UINT8 *color);
71
72static void (*modify_ypos)(UINT8*);   /* function to call to do modify how vertical positioning bits are connected */
73
74static TIMER_CALLBACK( stars_blink_callback );
75static TIMER_CALLBACK( stars_scroll_callback );
76
77static void (*tilemap_set_scroll)( tilemap *, int col, int value );
78
79/* star circuit */
80#define STAR_COUNT  252
81struct star
82{
83   int x,y,color;
84};
85static struct star stars[STAR_COUNT];
86static int stars_colors_start;
87       UINT8 galaxold_stars_on;
88static INT32 stars_scrollpos;
89static UINT8 stars_blink_state;
90static emu_timer *stars_blink_timer;
91static emu_timer *stars_scroll_timer;
92static UINT8 timer_adjusted;
93       void galaxold_init_stars(running_machine *machine, int colors_offset);
94static void (*draw_stars)(running_machine *machine, bitmap_t *, const rectangle *);      /* function to call to draw the star layer */
95static void     noop_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
96       void galaxold_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
97static void scramble_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
98static void   rescue_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
99static void  mariner_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
100static void start_stars_blink_timer(double ra, double rb, double c);
101static void start_stars_scroll_timer(running_machine *machine);
102
103/* bullets circuit */
104static UINT8 darkplnt_bullet_color;
105static void (*draw_bullets)(bitmap_t *,int,int,int,const rectangle *);   /* function to call to draw a bullet */
106static void galaxold_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect);
107static void scramble_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect);
108static void darkplnt_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect);
109static void dambustr_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect);
110
111/* background circuit */
112static UINT8 background_enable;
113static UINT8 background_red, background_green, background_blue;
114static void (*draw_background)(bitmap_t *, const rectangle *cliprect);   /* function to call to draw the background */
115static void galaxold_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
116static void scramble_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
117static void  turtles_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
118static void  mariner_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
119static void stratgyx_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
120static void  minefld_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
121static void   rescue_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
122static void dambustr_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
123
124static UINT16 rockclim_v;
125static UINT16 rockclim_h;
126static int dambustr_bg_split_line;
127static int dambustr_bg_color_1;
128static int dambustr_bg_color_2;
129static int dambustr_bg_priority;
130static int dambustr_char_bank;
131static bitmap_t *dambustr_tmpbitmap;
132
133
134
135/***************************************************************************
136
137  Convert the color PROMs into a more useable format.
138
139  Galaxian has one 32 bytes palette PROM, connected to the RGB output this way:
140
141  bit 7 -- 220 ohm resistor  -- BLUE
142        -- 470 ohm resistor  -- BLUE
143        -- 220 ohm resistor  -- GREEN
144        -- 470 ohm resistor  -- GREEN
145        -- 1  kohm resistor  -- GREEN
146        -- 220 ohm resistor  -- RED
147        -- 470 ohm resistor  -- RED
148  bit 0 -- 1  kohm resistor  -- RED
149
150  The output of the background star generator is connected this way:
151
152  bit 5 -- 100 ohm resistor  -- BLUE
153        -- 150 ohm resistor  -- BLUE
154        -- 100 ohm resistor  -- GREEN
155        -- 150 ohm resistor  -- GREEN
156        -- 100 ohm resistor  -- RED
157  bit 0 -- 150 ohm resistor  -- RED
158
159  The blue background in Scramble and other games goes through a 390 ohm
160  resistor.
161
162  The bullet RGB outputs go through 100 ohm resistors.
163
164  The RGB outputs have a 470 ohm pull-down each.
165
166***************************************************************************/
167PALETTE_INIT( galaxold )
168{
169   int i;
170
171
172   /* first, the character/sprite palette */
173
174   for (i = 0;i < memory_region_length(REGION_PROMS);i++)
175   {
176      int bit0,bit1,bit2,r,g,b;
177
178      /* red component */
179      bit0 = BIT(*color_prom,0);
180      bit1 = BIT(*color_prom,1);
181      bit2 = BIT(*color_prom,2);
182      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
183      /* green component */
184      bit0 = BIT(*color_prom,3);
185      bit1 = BIT(*color_prom,4);
186      bit2 = BIT(*color_prom,5);
187      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
188      /* blue component */
189      bit0 = BIT(*color_prom,6);
190      bit1 = BIT(*color_prom,7);
191      b = 0x4f * bit0 + 0xa8 * bit1;
192
193      palette_set_color_rgb(machine,i,r,g,b);
194      color_prom++;
195   }
196
197
198   galaxold_init_stars(machine, STARS_COLOR_BASE);
199
200
201   /* bullets - yellow and white */
202   palette_set_color(machine,BULLETS_COLOR_BASE+0,MAKE_RGB(0xef,0xef,0x00));
203   palette_set_color(machine,BULLETS_COLOR_BASE+1,MAKE_RGB(0xef,0xef,0xef));
204}
205
206PALETTE_INIT( scrambold )
207{
208   PALETTE_INIT_CALL(galaxold);
209
210
211   /* blue background - 390 ohm resistor */
212   palette_set_color(machine,BACKGROUND_COLOR_BASE,MAKE_RGB(0,0,0x56));
213}
214
215PALETTE_INIT( moonwar )
216{
217   PALETTE_INIT_CALL(scrambold);
218
219
220   /* wire mod to connect the bullet blue output to the 220 ohm resistor */
221   palette_set_color(machine,BULLETS_COLOR_BASE+0,MAKE_RGB(0xef,0xef,0x97));
222}
223
224PALETTE_INIT( stratgyx )
225{
226   int i;
227
228
229   PALETTE_INIT_CALL(galaxold);
230
231
232   /*  The background color generator is connected this way:
233
234        RED   - 270 ohm resistor
235        GREEN - 560 ohm resistor
236        BLUE  - 470 ohm resistor */
237
238   for (i = 0; i < 8; i++)
239   {
240      int r = BIT(i,0) * 0x7c;
241      int g = BIT(i,1) * 0x3c;
242      int b = BIT(i,2) * 0x47;
243
244      palette_set_color_rgb(machine,BACKGROUND_COLOR_BASE+i,r,g,b);
245   }
246}
247
248PALETTE_INIT( rockclim )
249{
250   int i;
251
252
253   /* first, the character/sprite palette */
254
255   for (i = 0;i < memory_region_length(REGION_PROMS);i++)
256   {
257      int bit0,bit1,bit2,r,g,b;
258
259      /* red component */
260      bit0 = BIT(*color_prom,0);
261      bit1 = BIT(*color_prom,1);
262      bit2 = BIT(*color_prom,2);
263      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
264      /* green component */
265      bit0 = BIT(*color_prom,3);
266      bit1 = BIT(*color_prom,4);
267      bit2 = BIT(*color_prom,5);
268      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
269      /* blue component */
270      bit0 = BIT(*color_prom,6);
271      bit1 = BIT(*color_prom,7);
272      b = 0x4f * bit0 + 0xa8 * bit1;
273
274      palette_set_color_rgb(machine,i,r,g,b);
275      color_prom++;
276   }
277}
278/***************************************************************************
279
280  Convert the color PROMs into a more useable format.
281
282  Dark Planet has one 32 bytes palette PROM, connected to the RGB output this way:
283
284  bit 5 -- 220 ohm resistor  -- BLUE
285        -- 470 ohm resistor  -- BLUE
286        -- 1  kohm resistor  -- BLUE
287        -- 220 ohm resistor  -- RED
288        -- 470 ohm resistor  -- RED
289  bit 0 -- 1  kohm resistor  -- RED
290
291  The bullet RGB outputs go through 100 ohm resistors.
292
293  The RGB outputs have a 470 ohm pull-down each.
294
295***************************************************************************/
296PALETTE_INIT( darkplnt )
297{
298   int i;
299
300
301   /* first, the character/sprite palette */
302
303   for (i = 0;i < 32;i++)
304   {
305      int bit0,bit1,bit2,r,g,b;
306
307      /* red component */
308      bit0 = BIT(*color_prom,0);
309      bit1 = BIT(*color_prom,1);
310      bit2 = BIT(*color_prom,2);
311      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
312      /* green component */
313      g = 0x00;
314      /* blue component */
315      bit0 = BIT(*color_prom,3);
316      bit1 = BIT(*color_prom,4);
317      bit2 = BIT(*color_prom,5);
318      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
319
320      palette_set_color_rgb(machine,i,r,g,b);
321      color_prom++;
322   }
323
324
325   /* bullets - red and blue */
326   palette_set_color(machine,BULLETS_COLOR_BASE+0,MAKE_RGB(0xef,0x00,0x00));
327   palette_set_color(machine,BULLETS_COLOR_BASE+1,MAKE_RGB(0x00,0x00,0xef));
328}
329
330PALETTE_INIT( minefld )
331{
332   int i;
333
334
335   PALETTE_INIT_CALL(galaxold);
336
337
338   /* set up background colors */
339
340   /* graduated blue */
341
342   for (i = 0; i < 128; i++)
343   {
344      int r = 0;
345      int g = i;
346      int b = i * 2;
347      palette_set_color_rgb(machine,BACKGROUND_COLOR_BASE+i,r,g,b);
348   }
349
350   /* graduated brown */
351
352   for (i = 0; i < 128; i++)
353   {
354      int r = i * 1.5;
355      int g = i * 0.75;
356      int b = i / 2;
357      palette_set_color_rgb(machine,BACKGROUND_COLOR_BASE+128+i,r,g,b);
358   }
359}
360
361PALETTE_INIT( rescue )
362{
363   int i;
364
365
366   PALETTE_INIT_CALL(galaxold);
367
368
369   /* set up background colors */
370
371   /* graduated blue */
372
373   for (i = 0; i < 128; i++)
374   {
375      int r = 0;
376      int g = i;
377      int b = i * 2;
378      palette_set_color_rgb(machine,BACKGROUND_COLOR_BASE+i,r,g,b);
379   }
380}
381
382PALETTE_INIT( mariner )
383{
384   int i;
385
386
387   PALETTE_INIT_CALL(galaxold);
388
389
390   /* set up background colors */
391
392   /* 16 shades of blue - the 4 bits are connected to the following resistors:
393
394        bit 0 -- 4.7 kohm resistor
395              -- 2.2 kohm resistor
396              -- 1   kohm resistor
397        bit 0 -- .47 kohm resistor */
398
399   for (i = 0; i < 16; i++)
400   {
401      int r,g,b;
402
403      r = 0;
404      g = 0;
405      b = 0x0e * BIT(i,0) + 0x1f * BIT(i,1) + 0x43 * BIT(i,2) + 0x8f * BIT(i,3);
406
407      palette_set_color_rgb(machine,BACKGROUND_COLOR_BASE+i,r,g,b);
408   }
409}
410
411
412PALETTE_INIT( dambustr )
413{
414   int i;
415
416   PALETTE_INIT_CALL(galaxold);
417
418
419   /*
420    Assumption (not clear from the schematics):
421    The background color generator is connected this way:
422
423        RED   - 470 ohm resistor
424        GREEN - 470 ohm resistor
425        BLUE  - 470 ohm resistor */
426
427
428   for (i = 0; i < 8; i++)
429   {
430      int r = BIT(i,0) * 0x47;
431      int g = BIT(i,1) * 0x47;
432      int b = BIT(i,2) * 0x4f;
433      palette_set_color_rgb(machine,BACKGROUND_COLOR_BASE+i,r,g,b);
434   }
435}
436
437
438PALETTE_INIT( turtles )
439{
440   int i;
441
442
443   PALETTE_INIT_CALL(galaxold);
444
445
446   /*  The background color generator is connected this way:
447
448        RED   - 390 ohm resistor
449        GREEN - 470 ohm resistor
450        BLUE  - 390 ohm resistor */
451
452   for (i = 0; i < 8; i++)
453   {
454      int r = BIT(i,0) * 0x55;
455      int g = BIT(i,1) * 0x47;
456      int b = BIT(i,2) * 0x55;
457
458      palette_set_color_rgb(machine,BACKGROUND_COLOR_BASE+i,r,g,b);
459   }
460}
461
462
463/***************************************************************************
464
465  Start the video hardware emulation.
466
467***************************************************************************/
468
469static void state_save_register(void)
470{
471   state_save_register_global_array(gfxbank);
472   state_save_register_global(flipscreen_x);
473   state_save_register_global(flipscreen_y);
474
475   state_save_register_global(galaxold_stars_on);
476   state_save_register_global(stars_scrollpos);
477   state_save_register_global(stars_blink_state);
478
479   state_save_register_global(darkplnt_bullet_color);
480
481   state_save_register_global(background_enable);
482   state_save_register_global(background_red);
483   state_save_register_global(background_green);
484   state_save_register_global(background_blue);
485}
486
487static void video_start_common(running_machine *machine, tilemap_mapper_func get_memory_offset)
488{
489   bg_tilemap = tilemap_create(get_tile_info,get_memory_offset,8,8,32,32);
490
491   tilemap_set_transparent_pen(bg_tilemap,0);
492
493
494   modify_charcode = 0;
495   modify_spritecode = 0;
496   modify_color = 0;
497   modify_ypos = 0;
498
499   mooncrst_gfxextend = 0;
500
501   draw_bullets = 0;
502
503   draw_background = galaxold_draw_background;
504   background_enable = 0;
505   background_blue = 0;
506   background_red = 0;
507   background_green = 0;
508
509   draw_stars = noop_draw_stars;
510
511   flipscreen_x = 0;
512   flipscreen_y = 0;
513
514   spriteram2_present = 0;
515
516   spritevisiblearea      = &_spritevisiblearea;
517   spritevisibleareaflipx = &_spritevisibleareaflipx;
518
519   color_mask = (machine->gfx[0]->color_granularity == 4) ? 7 : 3;
520
521   state_save_register();
522}
523
524VIDEO_START( galaxold_plain )
525{
526   video_start_common(machine,tilemap_scan_rows);
527
528   tilemap_set_scroll_cols(bg_tilemap, 32);
529   tilemap_set_scroll = tilemap_set_scrolly;
530}
531
532VIDEO_START( galaxold )
533{
534   VIDEO_START_CALL(galaxold_plain);
535
536   draw_stars = galaxold_draw_stars;
537
538   draw_bullets = galaxold_draw_bullets;
539}
540
541VIDEO_START( scrambold )
542{
543   VIDEO_START_CALL(galaxold_plain);
544
545   /* FIXME: This most probably needs to be adjusted
546     * again when RAW video params are added to scramble
547     */
548   tilemap_set_scrolldx(bg_tilemap, 0, 0);
549
550   draw_stars = scramble_draw_stars;
551
552   draw_bullets = scramble_draw_bullets;
553
554   draw_background = scramble_draw_background;
555}
556
557VIDEO_START( darkplnt )
558{
559   VIDEO_START_CALL(galaxold_plain);
560
561   tilemap_set_scrolldx(bg_tilemap, 0, 0);
562   draw_bullets = darkplnt_draw_bullets;
563}
564
565VIDEO_START( rescue )
566{
567   VIDEO_START_CALL(scrambold);
568
569   draw_stars = rescue_draw_stars;
570
571   draw_background = rescue_draw_background;
572}
573
574VIDEO_START( minefld )
575{
576   VIDEO_START_CALL(scrambold);
577
578   draw_stars = rescue_draw_stars;
579
580   draw_background = minefld_draw_background;
581}
582
583VIDEO_START( stratgyx )
584{
585   VIDEO_START_CALL(galaxold_plain);
586
587   draw_background = stratgyx_draw_background;
588}
589
590VIDEO_START( ckongs )
591{
592   VIDEO_START_CALL(scrambold);
593
594   modify_spritecode = mshuttle_modify_spritecode;
595}
596
597VIDEO_START( calipso )
598{
599   VIDEO_START_CALL(galaxold_plain);
600
601   draw_bullets = scramble_draw_bullets;
602
603   draw_background = scramble_draw_background;
604
605   modify_spritecode = calipso_modify_spritecode;
606}
607
608VIDEO_START( mariner )
609{
610   VIDEO_START_CALL(galaxold_plain);
611
612   draw_stars = mariner_draw_stars;
613
614   draw_bullets = scramble_draw_bullets;
615
616   draw_background = mariner_draw_background;
617
618   modify_charcode = mariner_modify_charcode;
619}
620
621VIDEO_START( mimonkey )
622{
623   VIDEO_START_CALL(scrambold);
624
625   modify_charcode   = mimonkey_modify_charcode;
626   modify_spritecode = mimonkey_modify_spritecode;
627}
628
629VIDEO_START( dkongjrm )
630{
631   VIDEO_START_CALL(galaxold_plain);
632
633   modify_charcode   = pisces_modify_charcode;
634   modify_spritecode = dkongjrm_modify_spritecode;
635
636   spriteram2_present= 1;
637}
638
639VIDEO_START( newsin7 )
640{
641   VIDEO_START_CALL(scrambold);
642
643   spritevisiblearea      = &_spritevisibleareaflipx;
644   spritevisibleareaflipx = &_spritevisiblearea;
645}
646
647VIDEO_START( scorpion )
648{
649   VIDEO_START_CALL(scrambold);
650
651   modify_spritecode = batman2_modify_spritecode;
652}
653
654static void pisces_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
655{
656   *code |= (gfxbank[0] << 6);
657}
658
659VIDEO_START( pisces )
660{
661   VIDEO_START_CALL(galaxold);
662
663   modify_charcode   = pisces_modify_charcode;
664   modify_spritecode = pisces_modify_spritecode;
665}
666
667static void theend_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect)
668{
669   int i;
670
671
672   /* same as Galaxian, but all bullets are yellow */
673   for (i = 0; i < 4; i++)
674   {
675      x--;
676
677      if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
678         *BITMAP_ADDR16(bitmap, y, x) = BULLETS_COLOR_BASE;
679   }
680}
681
682VIDEO_START( theend )
683{
684   VIDEO_START_CALL(galaxold);
685
686   draw_bullets = theend_draw_bullets;
687}
688
689static void mooncrst_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
690{
691   if (gfxbank[2] && ((*code & 0x30) == 0x20))
692   {
693      *code = (*code & 0x0f) | (gfxbank[0] << 4) | (gfxbank[1] << 5) | 0x40;
694   }
695}
696
697VIDEO_START( mooncrst )
698{
699   VIDEO_START_CALL(galaxold);
700
701   modify_charcode   = mooncrst_modify_charcode;
702   modify_spritecode = mooncrst_modify_spritecode;
703}
704
705static void batman2_modify_charcode(UINT16 *code,UINT8 x)
706{
707   if (*code & 0x80)
708   {
709      *code |= (gfxbank[0] << 8);
710   }
711}
712
713VIDEO_START( batman2 )
714{
715   VIDEO_START_CALL(galaxold);
716
717   modify_charcode   = batman2_modify_charcode;
718   modify_spritecode = batman2_modify_spritecode;
719
720}
721
722
723
724static void rockclim_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
725{
726   tilemap_draw(bitmap,cliprect,rockclim_tilemap, 0,0);
727}
728
729static void rockclim_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
730{
731   if (gfxbank[2])   *code|=0x40;
732}
733
734VIDEO_START( rockclim )
735{
736   VIDEO_START_CALL(galaxold);
737   rockclim_tilemap = tilemap_create(rockclim_get_tile_info,tilemap_scan_rows,8,8,64,32);
738   draw_background = rockclim_draw_background;
739   modify_charcode = mooncrst_modify_charcode;
740   modify_spritecode = rockclim_modify_spritecode;
741   rockclim_v = rockclim_h = 0;
742   state_save_register_global(rockclim_v);
743   state_save_register_global(rockclim_h);
744}
745
746static TILE_GET_INFO( drivfrcg_get_tile_info )
747{
748   int code = galaxold_videoram[tile_index];
749   UINT8 x = tile_index & 0x1f;
750   UINT8 color = galaxold_attributesram[(x << 1) | 1] & 7;
751   UINT8 bank = galaxold_attributesram[(x << 1) | 1] & 0x30;
752
753   code |= (bank << 4);
754   color |= ((galaxold_attributesram[(x << 1) | 1] & 0x40) >> 3);
755
756   SET_TILE_INFO(0, code, color, 0);
757}
758
759VIDEO_START( drivfrcg )
760{
761   bg_tilemap = tilemap_create(drivfrcg_get_tile_info,tilemap_scan_rows,8,8,32,32);
762
763   tilemap_set_transparent_pen(bg_tilemap,0);
764   tilemap_set_scroll_cols(bg_tilemap, 32);
765   tilemap_set_scroll = tilemap_set_scrolly;
766
767   modify_charcode = 0;
768   modify_spritecode = mshuttle_modify_spritecode;
769   modify_color = drivfrcg_modify_color;
770   modify_ypos = 0;
771
772   mooncrst_gfxextend = 0;
773
774   draw_bullets = 0;
775
776   draw_background = galaxold_draw_background;
777   background_enable = 0;
778   background_blue = 0;
779   background_red = 0;
780   background_green = 0;
781
782   draw_stars = noop_draw_stars;
783
784   flipscreen_x = 0;
785   flipscreen_y = 0;
786
787   spriteram2_present = 0;
788
789   spritevisiblearea      = &_spritevisiblearea;
790   spritevisibleareaflipx = &_spritevisibleareaflipx;
791
792   color_mask = 0xff;
793
794   state_save_register();
795}
796
797VIDEO_START( ad2083 )
798{
799   bg_tilemap = tilemap_create(drivfrcg_get_tile_info,tilemap_scan_rows,8,8,32,32);
800
801   tilemap_set_transparent_pen(bg_tilemap,0);
802   tilemap_set_scroll_cols(bg_tilemap, 32);
803   tilemap_set_scroll = tilemap_set_scrolly;
804
805   modify_charcode = 0;
806   modify_spritecode = ad2083_modify_spritecode;
807   modify_color = 0;
808   modify_ypos = 0;
809
810   mooncrst_gfxextend = 0;
811
812   draw_bullets = scramble_draw_bullets;
813
814   draw_background = turtles_draw_background;
815   background_enable = 0;
816   background_blue = 0;
817   background_red = 0;
818   background_green = 0;
819
820   draw_stars = noop_draw_stars;
821
822   flipscreen_x = 0;
823   flipscreen_y = 0;
824
825   spriteram2_present = 0;
826
827   spritevisiblearea      = &_spritevisiblearea;
828   spritevisibleareaflipx = &_spritevisibleareaflipx;
829
830   color_mask = 7;
831
832   state_save_register();
833}
834
835UINT8 *racknrol_tiles_bank;
836
837WRITE8_HANDLER( racknrol_tiles_bank_w )
838{
839   racknrol_tiles_bank[offset] = data;
840   tilemap_mark_all_tiles_dirty(bg_tilemap);
841}
842
843static TILE_GET_INFO( racknrol_get_tile_info )
844{
845   int code = galaxold_videoram[tile_index];
846   UINT8 x = tile_index & 0x1f;
847   UINT8 color = galaxold_attributesram[(x << 1) | 1] & 7;
848   UINT8 bank = racknrol_tiles_bank[x] & 7;
849
850   code |= (bank << 8);
851
852   SET_TILE_INFO(0, code, color, 0);
853}
854
855VIDEO_START( racknrol )
856{
857   bg_tilemap = tilemap_create(racknrol_get_tile_info,tilemap_scan_rows,8,8,32,32);
858
859   tilemap_set_transparent_pen(bg_tilemap,0);
860   tilemap_set_scroll_cols(bg_tilemap, 32);
861   tilemap_set_scroll = tilemap_set_scrolly;
862
863   modify_charcode = 0;
864   modify_spritecode = 0;
865   modify_color = 0;
866   modify_ypos = 0;
867
868   mooncrst_gfxextend = 0;
869
870   draw_bullets = 0;
871
872   draw_background = galaxold_draw_background;
873   background_enable = 0;
874   background_blue = 0;
875   background_red = 0;
876   background_green = 0;
877
878   draw_stars = noop_draw_stars;
879
880   flipscreen_x = 0;
881   flipscreen_y = 0;
882
883   spriteram2_present = 0;
884
885   spritevisiblearea      = &_spritevisiblearea;
886   spritevisibleareaflipx = &_spritevisibleareaflipx;
887
888   color_mask = 0xff;
889
890   state_save_register();
891}
892
893VIDEO_START( bongo )
894{
895   VIDEO_START_CALL(galaxold_plain);
896
897   modify_spritecode = batman2_modify_spritecode;
898}
899
900static TILE_GET_INFO( dambustr_get_tile_info2 )
901{
902   UINT8 x = tile_index & 0x1f;
903
904   UINT16 code = dambustr_videoram2[tile_index];
905   UINT8 color = galaxold_attributesram[(x << 1) | 1] & color_mask;
906
907   if (modify_charcode)
908   {
909      modify_charcode(&code, x);
910   }
911
912   if (modify_color)
913   {
914      modify_color(&color);
915   }
916
917   SET_TILE_INFO(0, code, color, 0);
918}
919
920VIDEO_START( dambustr )
921{
922   VIDEO_START_CALL(galaxold);
923
924   dambustr_bg_split_line = 0;
925   dambustr_bg_color_1 = 0;
926   dambustr_bg_color_2 = 0;
927   dambustr_bg_priority = 0;
928   dambustr_char_bank = 0;
929
930   draw_background = dambustr_draw_background;
931
932   modify_charcode   = dambustr_modify_charcode;
933   modify_spritecode = dambustr_modify_spritecode;
934
935   draw_bullets = dambustr_draw_bullets;
936
937   /* allocate the temporary bitmap for the background priority */
938   dambustr_tmpbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
939
940   /* make a copy of the tilemap to emulate background priority */
941   dambustr_videoram2 = auto_malloc(0x0400);
942   dambustr_tilemap2 = tilemap_create(dambustr_get_tile_info2,tilemap_scan_rows,8,8,32,32);
943
944   tilemap_set_transparent_pen(dambustr_tilemap2,0);
945}
946
947
948WRITE8_HANDLER( galaxold_videoram_w )
949{
950   galaxold_videoram[offset] = data;
951   tilemap_mark_tile_dirty(bg_tilemap, offset);
952}
953
954READ8_HANDLER( galaxold_videoram_r )
955{
956   return galaxold_videoram[offset];
957}
958
959
960WRITE8_HANDLER( galaxold_attributesram_w )
961{
962   if (galaxold_attributesram[offset] != data)
963   {
964      if (offset & 0x01)
965      {
966         /* color change */
967         int i;
968
969         for (i = offset >> 1; i < 0x0400; i += 32)
970            tilemap_mark_tile_dirty(bg_tilemap, i);
971      }
972      else
973      {
974         if (modify_ypos)
975         {
976            modify_ypos(&data);
977         }
978
979         tilemap_set_scroll(bg_tilemap, offset >> 1, data);
980      }
981
982      galaxold_attributesram[offset] = data;
983   }
984}
985
986
987WRITE8_HANDLER( galaxold_flip_screen_x_w )
988{
989   if (flipscreen_x != (data & 0x01))
990   {
991      flipscreen_x = data & 0x01;
992
993      tilemap_set_flip(bg_tilemap, (flipscreen_x ? TILEMAP_FLIPX : 0) | (flipscreen_y ? TILEMAP_FLIPY : 0));
994   }
995}
996
997WRITE8_HANDLER( galaxold_flip_screen_y_w )
998{
999   if (flipscreen_y != (data & 0x01))
1000   {
1001      flipscreen_y = data & 0x01;
1002
1003      tilemap_set_flip(bg_tilemap, (flipscreen_x ? TILEMAP_FLIPX : 0) | (flipscreen_y ? TILEMAP_FLIPY : 0));
1004   }
1005}
1006
1007
1008WRITE8_HANDLER( gteikob2_flip_screen_x_w )
1009{
1010   galaxold_flip_screen_x_w(machine, offset, ~data);
1011}
1012
1013WRITE8_HANDLER( gteikob2_flip_screen_y_w )
1014{
1015   galaxold_flip_screen_y_w(machine, offset, ~data);
1016}
1017
1018
1019WRITE8_HANDLER( hotshock_flip_screen_w )
1020{
1021   galaxold_flip_screen_x_w(machine, offset, data);
1022   galaxold_flip_screen_y_w(machine, offset, data);
1023}
1024
1025
1026WRITE8_HANDLER( scrambold_background_enable_w )
1027{
1028   background_enable = data & 0x01;
1029}
1030
1031WRITE8_HANDLER( scrambold_background_red_w )
1032{
1033   background_red = data & 0x01;
1034}
1035
1036WRITE8_HANDLER( scrambold_background_green_w )
1037{
1038   background_green = data & 0x01;
1039}
1040
1041WRITE8_HANDLER( scrambold_background_blue_w )
1042{
1043   background_blue = data & 0x01;
1044}
1045
1046
1047WRITE8_HANDLER( galaxold_stars_enable_w )
1048{
1049   galaxold_stars_on = data & 0x01;
1050
1051   if (!galaxold_stars_on)
1052   {
1053      stars_scrollpos = 0;
1054   }
1055}
1056
1057
1058WRITE8_HANDLER( darkplnt_bullet_color_w )
1059{
1060   darkplnt_bullet_color = data & 0x01;
1061}
1062
1063
1064
1065WRITE8_HANDLER( galaxold_gfxbank_w )
1066{
1067   if (gfxbank[offset] != data)
1068   {
1069      gfxbank[offset] = data;
1070
1071      tilemap_mark_all_tiles_dirty(bg_tilemap);
1072   }
1073}
1074
1075WRITE8_HANDLER( rockclim_videoram_w )
1076{
1077   rockclim_videoram[offset] = data;
1078   tilemap_mark_tile_dirty(rockclim_tilemap, offset);
1079}
1080
1081WRITE8_HANDLER( rockclim_scroll_w )
1082{
1083   switch(offset&3)
1084   {
1085      case 0: rockclim_h=(rockclim_h&0xff00)|data;tilemap_set_scrollx(rockclim_tilemap , 0, rockclim_h );break;
1086      case 1:   rockclim_h=(rockclim_h&0xff)|(data<<8);tilemap_set_scrollx(rockclim_tilemap , 0, rockclim_h );break;
1087      case 2:   rockclim_v=(rockclim_v&0xff00)|data;tilemap_set_scrolly(rockclim_tilemap , 0, rockclim_v );break;
1088      case 3:   rockclim_v=(rockclim_v&0xff)|(data<<8);tilemap_set_scrolly(rockclim_tilemap , 0, rockclim_v );break;
1089   }
1090
1091}
1092
1093
1094READ8_HANDLER( rockclim_videoram_r )
1095{
1096   return rockclim_videoram[offset];
1097}
1098
1099
1100WRITE8_HANDLER( dambustr_bg_split_line_w )
1101{
1102   dambustr_bg_split_line = data;
1103}
1104
1105
1106WRITE8_HANDLER( dambustr_bg_color_w )
1107{
1108   dambustr_bg_color_1 = (BIT(data,2)<<2) | (BIT(data,1)<<1) | BIT(data,0);
1109   dambustr_bg_color_2 = (BIT(data,6)<<2) | (BIT(data,5)<<1) | BIT(data,4);
1110   dambustr_bg_priority = BIT(data,3);
1111   dambustr_char_bank = BIT(data,7);
1112   tilemap_mark_all_tiles_dirty(bg_tilemap);
1113}
1114
1115
1116
1117/* character banking functions */
1118
1119static void mooncrst_modify_charcode(UINT16 *code,UINT8 x)
1120{
1121   if (gfxbank[2] && ((*code & 0xc0) == 0x80))
1122   {
1123      *code = (*code & 0x3f) | (gfxbank[0] << 6) | (gfxbank[1] << 7) | 0x0100;
1124   }
1125}
1126
1127static void pisces_modify_charcode(UINT16 *code,UINT8 x)
1128{
1129   *code |= (gfxbank[0] << 8);
1130}
1131
1132static void mimonkey_modify_charcode(UINT16 *code,UINT8 x)
1133{
1134   *code |= (gfxbank[0] << 8) | (gfxbank[2] << 9);
1135}
1136
1137static void mariner_modify_charcode(UINT16 *code,UINT8 x)
1138{
1139   UINT8 *prom;
1140
1141
1142   /* bit 0 of the PROM controls character banking */
1143
1144   prom = memory_region(REGION_USER2);
1145
1146   *code |= ((prom[x] & 0x01) << 8);
1147}
1148
1149static void dambustr_modify_charcode(UINT16 *code,UINT8 x)
1150{
1151   if (dambustr_char_bank == 0) {   // text mode
1152      *code |= 0x0300;
1153   }
1154   else {            // graphics mode
1155      if (x == 28)      // only line #28 stays in text mode
1156         *code |= 0x0300;
1157      else
1158         *code &= 0x00ff;
1159   };
1160}
1161
1162
1163
1164/* sprite banking functions */
1165
1166static void mshuttle_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
1167{
1168   *code |= ((spriteram[offs + 2] & 0x30) << 2);
1169}
1170
1171static void calipso_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
1172{
1173   /* No flips */
1174   *code = spriteram[offs + 1];
1175   *flipx = 0;
1176   *flipy = 0;
1177}
1178
1179static void mimonkey_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
1180{
1181   *code |= (gfxbank[0] << 6) | (gfxbank[2] << 7);
1182}
1183
1184static void batman2_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
1185{
1186   /* only the upper 64 sprites are used */
1187   *code |= 0x40;
1188}
1189
1190static void dkongjrm_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
1191{
1192   /* No x flip */
1193   *code = (spriteram[offs + 1] & 0x7f) | 0x80;
1194   *flipx = 0;
1195}
1196
1197static void ad2083_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
1198{
1199   /* No x flip */
1200   *code = (spriteram[offs + 1] & 0x7f) | ((spriteram[offs + 2] & 0x30) << 2);
1201   *flipx = 0;
1202}
1203
1204static void dambustr_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
1205{
1206   *code += 0x40;
1207}
1208
1209
1210/* color PROM mapping functions */
1211
1212static void drivfrcg_modify_color(UINT8 *color)
1213{
1214   *color = ((*color & 0x40) >> 3) | (*color & 7);
1215}
1216
1217/* y position mapping functions */
1218
1219
1220/* bullet drawing functions */
1221
1222static void galaxold_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect)
1223{
1224   int i;
1225
1226
1227   for (i = 0; i < 4; i++)
1228   {
1229      x--;
1230
1231      if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
1232      {
1233         int color;
1234
1235
1236         /* yellow missile, white shells (this is the terminology on the schematics) */
1237         color = ((offs == 7*4) ? BULLETS_COLOR_BASE : BULLETS_COLOR_BASE + 1);
1238
1239         *BITMAP_ADDR16(bitmap, y, x) = color;
1240      }
1241   }
1242}
1243
1244static void scramble_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect)
1245{
1246   if (flipscreen_x)  x++;
1247
1248   x = x - 6;
1249
1250   if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
1251      /* yellow bullets */
1252      *BITMAP_ADDR16(bitmap, y, x) = BULLETS_COLOR_BASE;
1253}
1254
1255static void darkplnt_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect)
1256{
1257   if (flipscreen_x)  x++;
1258
1259   x = x - 6;
1260
1261   if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
1262      *BITMAP_ADDR16(bitmap, y, x) = 32 + darkplnt_bullet_color;
1263}
1264
1265static void dambustr_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect)
1266{
1267   int i, color;
1268
1269   if (flip_screen_x_get())  x++;
1270
1271   x = x - 6;
1272
1273   /* bullets are 2 pixels wide */
1274   for (i = 0; i < 2; i++)
1275   {
1276      if (offs < 4*4)
1277      {
1278         color = BULLETS_COLOR_BASE;
1279         y--;
1280      }
1281      else {
1282         color = BULLETS_COLOR_BASE + 1;
1283         x--;
1284      }
1285
1286      if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
1287         *BITMAP_ADDR16(bitmap, y, x) = color;
1288   }
1289}
1290
1291
1292
1293/* background drawing functions */
1294
1295static void galaxold_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
1296{
1297   /* plain black background */
1298   fillbitmap(bitmap,0,cliprect);
1299}
1300
1301static void scramble_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
1302{
1303   if (background_enable)
1304      fillbitmap(bitmap,BACKGROUND_COLOR_BASE,cliprect);
1305   else
1306      fillbitmap(bitmap,0,cliprect);
1307}
1308
1309static void turtles_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
1310{
1311   int color = (background_blue << 2) | (background_green << 1) | background_red;
1312
1313   fillbitmap(bitmap,BACKGROUND_COLOR_BASE + color,cliprect);
1314}
1315
1316static void stratgyx_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
1317{
1318   UINT8 x;
1319   UINT8 *prom;
1320
1321
1322   /* the background PROM is connected the following way:
1323
1324       bit 0 = 0 enables the blue gun if BCB is asserted
1325       bit 1 = 0 enables the red gun if BCR is asserted and
1326                 the green gun if BCG is asserted
1327       bits 2-7 are unconnected */
1328
1329   prom = memory_region(REGION_USER1);
1330
1331   for (x = 0; x < 32; x++)
1332   {
1333      int sx,color;
1334
1335
1336      color = 0;
1337
1338      if ((~prom[x] & 0x02) && background_red)   color |= 0x01;
1339      if ((~prom[x] & 0x02) && background_green) color |= 0x02;
1340      if ((~prom[x] & 0x01) && background_blue)  color |= 0x04;
1341
1342      if (flipscreen_x)
1343         sx = 8 * (31 - x);
1344      else
1345         sx = 8 * x;
1346
1347      plot_box(bitmap, sx, 0, 8, 256, BACKGROUND_COLOR_BASE + color);
1348   }
1349}
1350
1351static void minefld_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
1352{
1353   if (background_enable)
1354   {
1355      int x;
1356
1357
1358      for (x = 0; x < 128; x++)
1359         plot_box(bitmap, x,       0, 1, 256, BACKGROUND_COLOR_BASE + x);
1360
1361      for (x = 0; x < 120; x++)
1362         plot_box(bitmap, x + 128, 0, 1, 256, BACKGROUND_COLOR_BASE + x + 128);
1363
1364      plot_box(bitmap, 248, 0, 16, 256, BACKGROUND_COLOR_BASE);
1365   }
1366   else
1367      fillbitmap(bitmap,0,cliprect);
1368}
1369
1370static void rescue_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
1371{
1372   if (background_enable)
1373   {
1374      int x;
1375
1376      for (x = 0; x < 128; x++)
1377         plot_box(bitmap, x,       0, 1, 256, BACKGROUND_COLOR_BASE + x);
1378
1379      for (x = 0; x < 120; x++)
1380         plot_box(bitmap, x + 128, 0, 1, 256, BACKGROUND_COLOR_BASE + x + 8);
1381
1382      plot_box(bitmap, 248, 0, 16, 256, BACKGROUND_COLOR_BASE);
1383   }
1384   else
1385      fillbitmap(bitmap,0,cliprect);
1386}
1387
1388static void mariner_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
1389{
1390   UINT8 x;
1391   UINT8 *prom;
1392
1393
1394   /* the background PROM contains the color codes for each 8 pixel
1395       line (column) of the screen.  The first 0x20 bytes for unflipped,
1396       and the 2nd 0x20 bytes for flipped screen. */
1397
1398   prom = memory_region(REGION_USER1);
1399
1400   if (flipscreen_x)
1401   {
1402      for (x = 0; x < 32; x++)
1403      {
1404         int color;
1405
1406         if (x == 0)
1407            color = 0;
1408         else
1409            color = prom[0x20 + x - 1];
1410
1411         plot_box(bitmap, 8 * (31 - x), 0, 8, 256, BACKGROUND_COLOR_BASE + color);
1412      }
1413   }
1414   else
1415   {
1416      for (x = 0; x < 32; x++)
1417      {
1418         int color;
1419
1420         if (x == 31)
1421            color = 0;
1422         else
1423            color = prom[x + 1];
1424
1425         plot_box(bitmap, 8 * x, 0, 8, 256, BACKGROUND_COLOR_BASE + color);
1426      }
1427   }
1428}
1429
1430static void dambustr_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
1431{
1432   int col1 = BACKGROUND_COLOR_BASE + dambustr_bg_color_1;
1433   int col2 = BACKGROUND_COLOR_BASE + dambustr_bg_color_2;
1434
1435   if (flip_screen_x_get())
1436   {
1437      plot_box(bitmap,   0, 0, 256-dambustr_bg_split_line, 256, col2);
1438      plot_box(bitmap, 256-dambustr_bg_split_line, 0, dambustr_bg_split_line, 256, col1);
1439   }
1440   else
1441   {
1442      plot_box(bitmap,   0, 0, 256-dambustr_bg_split_line, 256, col1);
1443      plot_box(bitmap, 256-dambustr_bg_split_line, 0, dambustr_bg_split_line, 256, col2);
1444   }
1445
1446}
1447
1448static void dambustr_draw_upper_background(bitmap_t *bitmap, const rectangle *cliprect)
1449{
1450   static rectangle clip = { 0, 0, 0, 0 };
1451
1452   if (flip_screen_x_get())
1453   {
1454      clip.min_x = 254 - dambustr_bg_split_line;
1455      clip.max_x = dambustr_bg_split_line;
1456      clip.min_y = 0;
1457      clip.max_y = 255;
1458      copybitmap(bitmap, dambustr_tmpbitmap, 0, 0, 0, 0, &clip);
1459   }
1460   else
1461   {
1462      clip.min_x = 0;
1463      clip.max_x = 254 - dambustr_bg_split_line;
1464      clip.min_y = 0;
1465      clip.max_y = 255;
1466      copybitmap(bitmap, dambustr_tmpbitmap, 0, 0, 0, 0, &clip);
1467   }
1468}
1469
1470
1471
1472/* star drawing functions */
1473
1474void galaxold_init_stars(running_machine *machine, int colors_offset)
1475{
1476   int i;
1477   int total_stars;
1478   UINT32 generator;
1479   int x,y;
1480
1481
1482   galaxold_stars_on = 0;
1483   stars_blink_state = 0;
1484   stars_blink_timer = timer_alloc(stars_blink_callback, NULL);
1485   stars_scroll_timer = timer_alloc(stars_scroll_callback, NULL);
1486   timer_adjusted = 0;
1487   stars_colors_start = colors_offset;
1488
1489   for (i = 0;i < 64;i++)
1490   {
1491      int bits,r,g,b;
1492      static const int map[4] = { 0x00, 0x88, 0xcc, 0xff };
1493
1494
1495      bits = (i >> 0) & 0x03;
1496      r = map[bits];
1497      bits = (i >> 2) & 0x03;
1498      g = map[bits];
1499      bits = (i >> 4) & 0x03;
1500      b = map[bits];
1501      palette_set_color_rgb(machine,colors_offset+i,r,g,b);
1502   }
1503
1504
1505   /* precalculate the star background */
1506
1507   total_stars = 0;
1508   generator = 0;
1509
1510   for (y = 0;y < 256;y++)
1511   {
1512      for (x = 0;x < 512;x++)
1513      {
1514         UINT32 bit0;
1515
1516
1517         bit0 = ((~generator >> 16) & 0x01) ^ ((generator >> 4) & 0x01);
1518
1519         generator = (generator << 1) | bit0;
1520
1521         if (((~generator >> 16) & 0x01) && (generator & 0xff) == 0xff)
1522         {
1523            int color;
1524
1525
1526            color = (~(generator >> 8)) & 0x3f;
1527            if (color)
1528            {
1529               stars[total_stars].x = x;
1530               stars[total_stars].y = y;
1531               stars[total_stars].color = color;
1532
1533               total_stars++;
1534            }
1535         }
1536      }
1537   }
1538
1539   if (total_stars != STAR_COUNT)
1540   {
1541      fatalerror("total_stars = %d, STAR_COUNT = %d",total_stars,STAR_COUNT);
1542   }
1543}
1544
1545static void plot_star(bitmap_t *bitmap, int x, int y, int color, const rectangle *cliprect)
1546{
1547   if (flipscreen_x)
1548      x = 255 - x;
1549
1550   if (flipscreen_y)
1551      y = 255 - y;
1552
1553   if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
1554      *BITMAP_ADDR16(bitmap, y, x) = stars_colors_start + color;
1555}
1556
1557static void noop_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
1558{
1559}
1560
1561void galaxold_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
1562{
1563   int offs;
1564
1565
1566   if (!timer_adjusted)
1567   {
1568      start_stars_scroll_timer(machine);
1569      timer_adjusted = 1;
1570   }
1571
1572
1573   for (offs = 0;offs < STAR_COUNT;offs++)
1574   {
1575      int x,y;
1576
1577
1578      x = ((stars[offs].x +   stars_scrollpos) & 0x01ff) >> 1;
1579      y = ( stars[offs].y + ((stars_scrollpos + stars[offs].x) >> 9)) & 0xff;
1580
1581      if ((y & 0x01) ^ ((x >> 3) & 0x01))
1582      {
1583         plot_star(bitmap, x, y, stars[offs].color, cliprect);
1584      }
1585   }
1586}
1587
1588static void scramble_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
1589{
1590   int offs;
1591
1592
1593   if (!timer_adjusted)
1594   {
1595      start_stars_blink_timer(100000, 10000, 0.00001);
1596      timer_adjusted = 1;
1597   }
1598
1599
1600   for (offs = 0;offs < STAR_COUNT;offs++)
1601   {
1602      int x,y;
1603
1604
1605      x = stars[offs].x >> 1;
1606      y = stars[offs].y;
1607
1608      if ((y & 0x01) ^ ((x >> 3) & 0x01))
1609      {
1610         /* determine when to skip plotting */
1611         switch (stars_blink_state & 0x03)
1612         {
1613         case 0:
1614            if (!(stars[offs].color & 0x01))  continue;
1615            break;
1616         case 1:
1617            if (!(stars[offs].color & 0x04))  continue;
1618            break;
1619         case 2:
1620            if (!(stars[offs].y & 0x02))  continue;
1621            break;
1622         case 3:
1623            /* always plot */
1624            break;
1625         }
1626
1627         plot_star(bitmap, x, y, stars[offs].color, cliprect);
1628      }
1629   }
1630}
1631
1632static void rescue_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
1633{
1634   int offs;
1635
1636
1637   /* same as Scramble, but only top (left) half of screen */
1638
1639   if (!timer_adjusted)
1640   {
1641      start_stars_blink_timer(100000, 10000, 0.00001);
1642      timer_adjusted = 1;
1643   }
1644
1645
1646   for (offs = 0;offs < STAR_COUNT;offs++)
1647   {
1648      int x,y;
1649
1650
1651      x = stars[offs].x >> 1;
1652      y = stars[offs].y;
1653
1654      if ((x < 128) && ((y & 0x01) ^ ((x >> 3) & 0x01)))
1655      {
1656         /* determine when to skip plotting */
1657         switch (stars_blink_state & 0x03)
1658         {
1659         case 0:
1660            if (!(stars[offs].color & 0x01))  continue;
1661            break;
1662         case 1:
1663            if (!(stars[offs].color & 0x04))  continue;
1664            break;
1665         case 2:
1666            if (!(stars[offs].y & 0x02))  continue;
1667            break;
1668         case 3:
1669            /* always plot */
1670            break;
1671         }
1672
1673         plot_star(bitmap, x, y, stars[offs].color, cliprect);
1674      }
1675   }
1676}
1677
1678static void mariner_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
1679{
1680   int offs;
1681   UINT8 *prom;
1682
1683
1684   if (!timer_adjusted)
1685   {
1686      start_stars_scroll_timer(machine);
1687      timer_adjusted = 1;
1688   }
1689
1690
1691   /* bit 2 of the PROM controls star visibility */
1692
1693   prom = memory_region(REGION_USER2);
1694
1695   for (offs = 0;offs < STAR_COUNT;offs++)
1696   {
1697      int x,y;
1698
1699
1700      x = ((stars[offs].x +   -stars_scrollpos) & 0x01ff) >> 1;
1701      y = ( stars[offs].y + ((-stars_scrollpos + stars[offs].x) >> 9)) & 0xff;
1702
1703      if ((y & 0x01) ^ ((x >> 3) & 0x01))
1704      {
1705         if (prom[(x/8 + 1) & 0x1f] & 0x04)
1706         {
1707            plot_star(bitmap, x, y, stars[offs].color, cliprect);
1708         }
1709      }
1710   }
1711}
1712
1713static TIMER_CALLBACK( stars_blink_callback )
1714{
1715   stars_blink_state++;
1716}
1717
1718static void start_stars_blink_timer(double ra, double rb, double c)
1719{
1720   /* calculate the period using the formula given in the 555 datasheet */
1721
1722   int period_in_ms = 693 * (ra + 2.0 * rb) * c;
1723
1724   timer_adjust_periodic(stars_blink_timer, ATTOTIME_IN_MSEC(period_in_ms), 0, ATTOTIME_IN_MSEC(period_in_ms));
1725}
1726
1727
1728static TIMER_CALLBACK( stars_scroll_callback )
1729{
1730   if (galaxold_stars_on)
1731   {
1732      stars_scrollpos++;
1733   }
1734}
1735
1736static void start_stars_scroll_timer(running_machine *machine)
1737{
1738   timer_adjust_periodic(stars_scroll_timer, video_screen_get_frame_period(machine->primary_screen), 0, video_screen_get_frame_period(machine->primary_screen));
1739}
1740
1741
1742
1743static TILE_GET_INFO( get_tile_info )
1744{
1745   UINT8 x = tile_index & 0x1f;
1746
1747   UINT16 code = galaxold_videoram[tile_index];
1748   UINT8 color = galaxold_attributesram[(x << 1) | 1] & color_mask;
1749
1750   if (modify_charcode)
1751   {
1752      modify_charcode(&code, x);
1753   }
1754
1755   if (modify_color)
1756   {
1757      modify_color(&color);
1758   }
1759
1760   SET_TILE_INFO(0, code, color, 0);
1761}
1762
1763static TILE_GET_INFO( rockclim_get_tile_info )
1764{
1765   UINT16 code = rockclim_videoram[tile_index];
1766   SET_TILE_INFO(2, code, 0, 0);
1767}
1768
1769static void draw_bullets_common(bitmap_t *bitmap, const rectangle *cliprect)
1770{
1771   int offs;
1772
1773
1774   for (offs = 0;offs < galaxold_bulletsram_size;offs += 4)
1775   {
1776      UINT8 sx,sy;
1777
1778      sy = 255 - galaxold_bulletsram[offs + 1];
1779      sx = 255 - galaxold_bulletsram[offs + 3];
1780
1781      if (flipscreen_y)  sy = 255 - sy;
1782
1783      draw_bullets(bitmap, offs, sx, sy, cliprect);
1784   }
1785}
1786
1787
1788static void draw_sprites(running_machine *machine, bitmap_t *bitmap, UINT8 *spriteram, size_t spriteram_size)
1789{
1790   int offs;
1791
1792
1793   for (offs = spriteram_size - 4;offs >= 0;offs -= 4)
1794   {
1795      UINT8 sx,sy,color;
1796      int flipx,flipy,code;
1797
1798
1799      sx = spriteram[offs + 3] + 1;   /* the existence of +1 is supported by a LOT of games */
1800      sy = spriteram[offs];         /* Anteater, Mariner, for example */
1801      flipx = spriteram[offs + 1] & 0x40;
1802      flipy = spriteram[offs + 1] & 0x80;
1803      code = spriteram[offs + 1] & 0x3f;
1804      color = spriteram[offs + 2] & color_mask;
1805
1806      if (modify_spritecode)
1807      {
1808         modify_spritecode(spriteram, &code, &flipx, &flipy, offs);
1809      }
1810
1811      if (modify_color)
1812      {
1813         modify_color(&color);
1814      }
1815
1816      if (modify_ypos)
1817      {
1818         modify_ypos(&sy);
1819      }
1820
1821      if (flipscreen_x)
1822      {
1823         sx = 240 - sx;
1824         flipx = !flipx;
1825      }
1826
1827      if (flipscreen_y)
1828      {
1829         flipy = !flipy;
1830      }
1831      else
1832      {
1833         sy = 240 - sy;
1834      }
1835
1836
1837      /* In at least Amidar Turtles, sprites #0, #1 and #2 need to be moved */
1838      /* down (left) one pixel to be positioned correctly. */
1839      /* Note that the adjustment must be done AFTER handling flipscreen, thus */
1840      /* proving that this is a hardware related "feature" */
1841
1842      if (offs < 3*4)  sy++;
1843
1844
1845      drawgfx(bitmap,machine->gfx[1],
1846            code,color,
1847            flipx,flipy,
1848            sx,sy,
1849            flipscreen_x ? spritevisibleareaflipx : spritevisiblearea,TRANSPARENCY_PEN,0);
1850   }
1851}
1852
1853
1854VIDEO_UPDATE( galaxold )
1855{
1856   draw_background(bitmap, cliprect);
1857
1858
1859   if (galaxold_stars_on)
1860   {
1861      draw_stars(screen->machine, bitmap, cliprect);
1862   }
1863
1864
1865   tilemap_draw(bitmap, 0, bg_tilemap, 0, 0);
1866
1867
1868   if (draw_bullets)
1869   {
1870      draw_bullets_common(bitmap, cliprect);
1871   }
1872
1873
1874   draw_sprites(screen->machine, bitmap, galaxold_spriteram, galaxold_spriteram_size);
1875
1876   if (spriteram2_present)
1877   {
1878      draw_sprites(screen->machine, bitmap, galaxold_spriteram2, galaxold_spriteram2_size);
1879   }
1880   return 0;
1881}
1882
1883
1884VIDEO_UPDATE( dambustr )
1885{
1886   int i, j;
1887   UINT8 color;
1888
1889   draw_background(bitmap, cliprect);
1890
1891   if (galaxold_stars_on)
1892   {
1893      draw_stars(screen->machine, bitmap, cliprect);
1894   }
1895
1896   /* save the background for drawing it again later, if background has priority over characters */
1897   copybitmap(dambustr_tmpbitmap, bitmap, 0, 0, 0, 0, NULL);
1898
1899   tilemap_draw(bitmap, 0, bg_tilemap, 0, 0);
1900
1901   if (draw_bullets)
1902   {
1903      draw_bullets_common(bitmap, cliprect);
1904   }
1905
1906   draw_sprites(screen->machine, bitmap, galaxold_spriteram, galaxold_spriteram_size);
1907
1908   if (dambustr_bg_priority)
1909   {
1910      /* draw the upper part of the background, as it has priority */
1911      dambustr_draw_upper_background(bitmap, cliprect);
1912
1913      /* only rows with color code > 3 are stronger than the background */
1914      memset(dambustr_videoram2, 0x20, 0x0400);
1915      for (i=0; i<32; i++) {
1916         color = galaxold_attributesram[(i << 1) | 1] & color_mask;
1917         if (color > 3) {
1918            for (j=0; j<32; j++)
1919               dambustr_videoram2[32*j+i] = galaxold_videoram[32*j+i];
1920         };
1921      };
1922      tilemap_mark_all_tiles_dirty(dambustr_tilemap2);
1923      tilemap_draw(bitmap, 0, dambustr_tilemap2, 0, 0);
1924   };
1925
1926   return 0;
1927}
1928
src/mame/video/welltris.c
r2241r2242
167167
168168WRITE16_HANDLER( welltris_palette_bank_w )
169169{
170   if (ACCESSING_LSB)
170   if (ACCESSING_BITS_0_7)
171171   {
172172      if (charpalettebank != (data & 0x03))
173173      {
r2241r2242
184184
185185WRITE16_HANDLER( welltris_gfxbank_w )
186186{
187   if (ACCESSING_LSB)
187   if (ACCESSING_BITS_0_7)
188188   {
189189      setbank(char_tilemap, 0, (data & 0xf0) >> 4);
190190      setbank(char_tilemap, 1, data & 0x0f);
src/mame/video/suna16.c
r2241r2242
6464
6565WRITE16_HANDLER( suna16_flipscreen_w )
6666{
67   if (ACCESSING_LSB)
67   if (ACCESSING_BITS_0_7)
6868   {
6969      flip_screen_set( data & 1 );
7070      color_bank =   ( data & 4 ) >> 2;
r2241r2242
7474
7575WRITE16_HANDLER( bestbest_flipscreen_w )
7676{
77   if (ACCESSING_LSB)
77   if (ACCESSING_BITS_0_7)
7878   {
7979      flip_screen_set( data & 0x10 );
8080//      color_bank =   ( data & 0x07 );
src/mame/video/seta.c
r2241r2242
277277        ---- ---- ---- -2--     Coin #0 Lock Out
278278        ---- ---- ---- --1-     Coin #1 Counter
279279        ---- ---- ---- ---0     Coin #0 Counter     */
280         if (ACCESSING_LSB)
280         if (ACCESSING_BITS_0_7)
281281         {
282282            seta_coin_lockout_w (data & 0x0f);
283283            if (sndti_exists(SOUND_X1_010, 0))
r2241r2242
288288         break;
289289
290290      case 2/2:
291         if (ACCESSING_LSB)
291         if (ACCESSING_BITS_0_7)
292292         {
293293            int new_bank;
294294
r2241r2242
419419
420420WRITE16_HANDLER( twineagl_tilebank_w )
421421{
422   if (ACCESSING_LSB)
422   if (ACCESSING_BITS_0_7)
423423   {
424424      data &= 0xff;
425425      if (twineagl_tilebank[offset] != data)
src/mame/video/nemesis.c
r2241r2242
8181
8282WRITE16_HANDLER( nemesis_gfx_flipx_w )
8383{
84   if (ACCESSING_LSB)
84   if (ACCESSING_BITS_0_7)
8585   {
8686      flipscreen = data & 0x01;
8787      if (flipscreen)
r2241r2242
100100
101101WRITE16_HANDLER( nemesis_gfx_flipy_w )
102102{
103   if (ACCESSING_LSB)
103   if (ACCESSING_BITS_0_7)
104104   {
105105      if (data & 0x01)
106106         tilemap_flip |= TILEMAP_FLIPY;
src/mame/video/goal92.c
r2241r2242
2121{
2222   COMBINE_DATA(&fg_bank);
2323
24   if(ACCESSING_LSB)
24   if(ACCESSING_BITS_0_7)
2525   {
2626      tilemap_mark_all_tiles_dirty(foreground_layer);
2727   }
src/mame/video/raiden.c
r2241r2242
9494   /* All other bits unknown - could be playfield enables */
9595
9696   /* Flipscreen */
97   if (offset==3 && ACCESSING_LSB) {
97   if (offset==3 && ACCESSING_BITS_0_7) {
9898      flipscreen=data&0x2;
9999      tilemap_set_flip(ALL_TILEMAPS,flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
100100   }
src/mame/video/realbrk.c
r2241r2242
3232
3333WRITE16_HANDLER( realbrk_flipscreen_w )
3434{
35   if (ACCESSING_LSB)
35   if (ACCESSING_BITS_0_7)
3636   {
3737      coin_counter_w(0,   data & 0x0001);
3838      coin_counter_w(1,   data & 0x0004);
r2241r2242
4040      flip_screen_set(   data & 0x0080);
4141   }
4242
43   if (ACCESSING_MSB)
43   if (ACCESSING_BITS_8_15)
4444   {
4545      disable_video   =   data & 0x8000;
4646   }
src/mame/video/m62.c
r2241r2242
406406   m62_background_hscroll = 0;
407407   m62_background_vscroll = 0;
408408
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
409412   register_savestate();
410413
411414   if( rows != 0 )
r2241r2242
455458   /* is the following right? */
456459   if( ( tile_index / 64 ) < 6 || ( ( color & 0x1f ) >> 1 ) > 0x0c )
457460   {
458      tileinfo->category = 1;
461      tileinfo->group = 1;
459462   }
460463   else
461464   {
462      tileinfo->category = 0;
465      tileinfo->group = 0;
463466   }
464467}
465468
r2241r2242
474477   {
475478      tilemap_set_scrollx( m62_background, i, m62_background_hscroll );
476479   }
477   tilemap_draw( bitmap, cliprect, m62_background, 0, 0 );
480   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_LAYER1, 0 );
478481   draw_sprites( screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00 );
479   tilemap_draw( bitmap, cliprect, m62_background, 1, 0 );
482   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_LAYER0, 0 );
480483   return 0;
481484}
482485
r2241r2242
501504   SET_TILE_INFO( 0, code | ( ( color & 0xc0 ) << 2 ), color & 0x1f, flags );
502505   if( ( ( color & 0x1f ) >> 1 ) >= 0x0c )
503506   {
504      tileinfo->category = 1;
507      tileinfo->group = 1;
505508   }
506509   else
507510   {
508      tileinfo->category = 0;
511      tileinfo->group = 0;
509512   }
510513}
511514
r2241r2242
514517   tilemap_set_scrollx( m62_background, 0, m62_background_hscroll );
515518   tilemap_set_scrolly( m62_background, 0, m62_background_vscroll );
516519
517   tilemap_draw( bitmap, cliprect, m62_background, 0, 0 );
520   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_LAYER1, 0 );
518521   draw_sprites( screen->machine, bitmap, cliprect, 0x0f, 0x10, 0x00 );
519   tilemap_draw( bitmap, cliprect, m62_background, 1, 0 );
522   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_LAYER0, 0 );
520523   draw_sprites( screen->machine, bitmap, cliprect, 0x0f, 0x10, 0x10 );
521524   return 0;
522525}
r2241r2242
541544   SET_TILE_INFO( 0, code | ( ( color & 0xc0 ) << 2 ), color & 0x1f, flags );
542545   if( ( ( color & 0x1f ) >> 1 ) >= 0x04 )
543546   {
544      tileinfo->category = 1;
547      tileinfo->group = 1;
545548   }
546549   else
547550   {
548      tileinfo->category = 0;
551      tileinfo->group = 0;
549552   }
550553}
551554
r2241r2242
569572   SET_TILE_INFO( 0, code | ( ( color & 0x40 ) << 3 ) | ( ( color & 0x10 ) << 4 ), color & 0x0f, flags );
570573   if( ( ( color & 0x1f ) >> 1 ) >= 0x04 )
571574   {
572      tileinfo->category = 1;
575      tileinfo->group = 1;
573576   }
574577   else
575578   {
576      tileinfo->category = 0;
579      tileinfo->group = 0;
577580   }
578581}
579582
r2241r2242
594597   tilemap_set_scrolly( m62_foreground, 0, 0 );
595598   tilemap_set_transparent_pen( m62_foreground, 0 );
596599
597   tilemap_draw( bitmap, cliprect, m62_background, 0, 0 );
600   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_LAYER1, 0 );
598601   draw_sprites( screen->machine, bitmap, cliprect, 0x0f, 0x10, 0x00 );
599   tilemap_draw( bitmap, cliprect, m62_background, 1, 0 );
602   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_LAYER0, 0 );
600603   draw_sprites( screen->machine, bitmap, cliprect, 0x0f, 0x10, 0x10 );
601604   tilemap_draw( bitmap, cliprect, m62_foreground, 0, 0 );
602605   return 0;
r2241r2242
624627{
625628   tilemap_set_scrollx( m62_background, 0, m62_background_hscroll );
626629
627   tilemap_draw( bitmap, cliprect, m62_background, 0, 0 );
630   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_OPAQUE, 0 );
628631   draw_sprites( screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00 );
629632   return 0;
630633}
r2241r2242
667670   tilemap_set_scrolly( m62_foreground, 0, 32 );
668671   tilemap_set_transparent_pen( m62_foreground, 0 );
669672
670   tilemap_draw( bitmap, cliprect, m62_background, 0, 0 );
673   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_OPAQUE, 0 );
671674   tilemap_draw( bitmap, cliprect, m62_foreground, 0, 0 );
672675   draw_sprites( screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00 );
673676   return 0;
r2241r2242
785788   tilemap_set_scrolly( m62_foreground, 0, 0 );
786789   tilemap_set_transparent_pen( m62_foreground, 0 );
787790
788   tilemap_draw( bitmap, cliprect, m62_background, 0, 0 );
791   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_OPAQUE, 0 );
789792   draw_sprites( screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00 );
790793   tilemap_draw( bitmap, cliprect, m62_foreground, 0, 0 );
791794   return 0;
r2241r2242
827830   tilemap_set_scrolly( m62_foreground, 0, 0 );
828831   tilemap_set_transparent_pen( m62_foreground, 0 );
829832
830   tilemap_draw( bitmap, cliprect, m62_background, 0, 0 );
833   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_OPAQUE, 0 );
831834   draw_sprites( screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00 );
832835   tilemap_draw( bitmap, cliprect, m62_foreground, 0, 0 );
833836   return 0;
r2241r2242
849852   SET_TILE_INFO( 0, code | ( ( color & 0x60 ) << 3 ), color & 0x1f, 0 );
850853   if( ( ( color & 0x1f ) >> 1 ) >= 0x08 )
851854   {
852      tileinfo->category = 1;
855      tileinfo->group = 1;
853856   }
854857   else
855858   {
856      tileinfo->category = 0;
859      tileinfo->group = 0;
857860   }
858861}
859862
r2241r2242
873876   tilemap_set_scrolly( m62_foreground, 0, 0 );
874877   tilemap_set_transparent_pen( m62_foreground, 0 );
875878
876   tilemap_draw( bitmap, cliprect, m62_background, 0, 0 );
879   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_LAYER1, 0 );
877880   draw_sprites( screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00 );
878   tilemap_draw( bitmap, cliprect, m62_background, 1, 0 );
881   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_LAYER0, 0 );
879882   tilemap_draw( bitmap, cliprect, m62_foreground, 0, 0 );
880883   return 0;
881884}
r2241r2242
901904   SET_TILE_INFO( 0, code | ( ( color & 0xc0 ) << 2 ) | ( ( color & 0x20 ) << 5 ), color & 0x1f, 0 );
902905   if( ( ( color & 0x1f ) >> 1 ) >= 0x08 )
903906   {
904      tileinfo->category = 1;
907      tileinfo->group = 1;
905908   }
906909   else
907910   {
908      tileinfo->category = 0;
911      tileinfo->group = 0;
909912   }
910913}
911914
r2241r2242
916919   {
917920      tilemap_set_scrollx( m62_background, i, horizon_scrollram[ i << 1 ] | ( horizon_scrollram[ ( i << 1 ) | 1 ] << 8 ) );
918921   }
919   tilemap_draw( bitmap, cliprect, m62_background, 0, 0 );
922   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_LAYER1, 0 );
920923   draw_sprites( screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00 );
921   tilemap_draw( bitmap, cliprect, m62_background, 1, 0 );
924   tilemap_draw( bitmap, cliprect, m62_background, TILEMAP_DRAW_LAYER0, 0 );
922925   return 0;
923926}
924927
src/mame/video/tail2nos.c
r2241r2242
9898
9999WRITE16_HANDLER( tail2nos_gfxbank_w )
100100{
101   if (ACCESSING_LSB)
101   if (ACCESSING_BITS_0_7)
102102   {
103103      int bank;
104104
src/mame/video/f1gp.c
r2241r2242
155155
156156WRITE16_HANDLER( f1gp_gfxctrl_w )
157157{
158   if (ACCESSING_LSB)
158   if (ACCESSING_BITS_0_7)
159159   {
160160      flipscreen = data & 0x20;
161161      gfxctrl = data & 0xdf;
r2241r2242
164164
165165WRITE16_HANDLER( f1gp2_gfxctrl_w )
166166{
167   if (ACCESSING_LSB)
167   if (ACCESSING_BITS_0_7)
168168   {
169169      flipscreen = data & 0x20;
170170
r2241r2242
174174      gfxctrl = data & 0xdf;
175175   }
176176
177   if (ACCESSING_MSB)
177   if (ACCESSING_BITS_8_15)
178178   {
179179      if (f1gp2_roz_bank != (data >> 8))
180180      {
src/mame/video/namcos2.c
r2241r2242
231231   if( (offset&0x1800) == 0x1800 )
232232   {
233233      offset &= 0x180f;
234      if( ACCESSING_LSB )
234      if( ACCESSING_BITS_0_7 )
235235      {
236236         namcos2_68k_palette_ram[offset] = data;
237237      }
src/mame/video/tatsumi.c
r2241r2242
155155
156156WRITE16_HANDLER( roundup5_crt_w )
157157{
158   if (offset==0 && ACCESSING_LSB)
158   if (offset==0 && ACCESSING_BITS_0_7)
159159      roundupt_crt_selected_reg=data&0x3f;
160   if (offset==1 && ACCESSING_LSB) {
160   if (offset==1 && ACCESSING_BITS_0_7) {
161161      roundupt_crt_reg[roundupt_crt_selected_reg]=data;
162162//      if (roundupt_crt_selected_reg!=0xa && roundupt_crt_selected_reg!=0xb && roundupt_crt_selected_reg!=29)
163163//      logerror("%08x:  Crt write %02x %02x\n",activecpu_get_pc(),roundupt_crt_selected_reg,data);
src/mame/video/konamiic.c
r2241r2242
22522252
22532253WRITE16_HANDLER( K052109_word_w )
22542254{
2255   if (ACCESSING_MSB)
2255   if (ACCESSING_BITS_8_15)
22562256      K052109_w(machine,offset,(data >> 8) & 0xff);
2257   if (ACCESSING_LSB)
2257   if (ACCESSING_BITS_0_7)
22582258      K052109_w(machine,offset + 0x2000,data & 0xff);
22592259}
22602260
r2241r2242
22652265
22662266WRITE16_HANDLER(K052109_lsb_w)
22672267{
2268   if(ACCESSING_LSB)
2268   if(ACCESSING_BITS_0_7)
22692269      K052109_w(machine, offset, data & 0xff);
22702270}
22712271
r2241r2242
26182618
26192619WRITE16_HANDLER( K051960_word_w )
26202620{
2621   if (ACCESSING_MSB)
2621   if (ACCESSING_BITS_8_15)
26222622      K051960_w(machine,offset*2,(data >> 8) & 0xff);
2623   if (ACCESSING_LSB)
2623   if (ACCESSING_BITS_0_7)
26242624      K051960_w(machine,offset*2 + 1,data & 0xff);
26252625}
26262626
r2241r2242
26912691
26922692WRITE16_HANDLER( K051937_word_w )
26932693{
2694   if (ACCESSING_MSB)
2694   if (ACCESSING_BITS_8_15)
26952695      K051937_w(machine,offset*2,(data >> 8) & 0xff);
2696   if (ACCESSING_LSB)
2696   if (ACCESSING_BITS_0_7)
26972697      K051937_w(machine,offset*2 + 1,data & 0xff);
26982698}
26992699
r2241r2242
31943194
31953195WRITE16_HANDLER( K053244_lsb_w )
31963196{
3197   if (ACCESSING_LSB)
3197   if (ACCESSING_BITS_0_7)
31983198      K053244_w(machine, offset, data & 0xff);
31993199}
32003200
r2241r2242
32053205
32063206WRITE16_HANDLER( K053244_word_w )
32073207{
3208   if (ACCESSING_MSB)
3208   if (ACCESSING_BITS_8_15)
32093209      K053244_w(machine, offset*2, (data >> 8) & 0xff);
3210   if (ACCESSING_LSB)
3210   if (ACCESSING_BITS_0_7)
32113211      K053244_w(machine, offset*2+1, data & 0xff);
32123212}
32133213
r2241r2242
41344134
41354135WRITE16_HANDLER( K053246_word_w )
41364136{
4137   if (ACCESSING_MSB)
4137   if (ACCESSING_BITS_8_15)
41384138      K053246_w(machine, offset<<1,(data >> 8) & 0xff);
4139   if (ACCESSING_LSB)
4139   if (ACCESSING_BITS_0_7)
41404140      K053246_w(machine, (offset<<1) + 1,data & 0xff);
41414141}
41424142
r2241r2242
51555155
51565156WRITE16_HANDLER( K053251_lsb_w )
51575157{
5158   if (ACCESSING_LSB)
5158   if (ACCESSING_BITS_0_7)
51595159      K053251_w(machine, offset, data & 0xff);
51605160}
51615161
51625162WRITE16_HANDLER( K053251_msb_w )
51635163{
5164   if (ACCESSING_MSB)
5164   if (ACCESSING_BITS_8_15)
51655165      K053251_w(machine, offset, (data >> 8) & 0xff);
51665166}
51675167
r2241r2242
52365236
52375237WRITE16_HANDLER( K054000_lsb_w )
52385238{
5239   if (ACCESSING_LSB)
5239   if (ACCESSING_BITS_0_7)
52405240      K054000_w(machine, offset, data & 0xff);
52415241}
52425242
r2241r2242
64196419
64206420WRITE32_HANDLER( K056832_b_long_w )
64216421{
6422   if (ACCESSING_MSW32)
6422   if (ACCESSING_BITS_16_31)
64236423   {
64246424      K056832_b_word_w(machine, offset<<1, data>>16, mem_mask >> 16);
64256425   }
6426   if (ACCESSING_LSW32)
6426   if (ACCESSING_BITS_0_15)
64276427   {
64286428      K056832_b_word_w(machine, (offset<<1)+1, data, mem_mask);
64296429   }
r2241r2242
71657165{
71667166   UINT8 regnum, regdat;
71677167
7168   if (!(mem_mask & 0xff000000))
7168   if (ACCESSING_BITS_24_31)
71697169   {
71707170      regnum = offset<<1;
71717171      regdat = data>>24;
71727172   }
71737173   else
71747174   {
7175      if (!(mem_mask & 0xff00))
7175      if (ACCESSING_BITS_8_15)
71767176      {
71777177         regnum = (offset<<1)+1;
71787178         regdat = data>>8;
r2241r2242
75257525
75267526WRITE16_HANDLER( K053250_0_w )
75277527{
7528   if (ACCESSING_LSB)
7528   if (ACCESSING_BITS_0_7)
75297529   {
75307530      // start LVC DMA transfer at the falling edge of control register's bit1
75317531      if (offset == 4 && !(data & 2) && (K053250_info.chip[0].regs[4] & 2)) K053250_dma(0, 1);
r2241r2242
75587558
75597559WRITE16_HANDLER( K053250_1_w )
75607560{
7561   if (ACCESSING_LSB)
7561   if (ACCESSING_BITS_0_7)
75627562   {
75637563      // start LVC DMA transfer at the falling edge of control register's bit1
75647564      if (offset == 4 && !(data & 2) && (K053250_info.chip[1].regs[4] & 2)) K053250_dma(1, 1);
src/mame/video/m72.c
r2241r2242
330330
331331WRITE16_HANDLER( m72_dmaon_w )
332332{
333   if (ACCESSING_LSB)
333   if (ACCESSING_BITS_0_7)
334334      memcpy(m72_spriteram,spriteram16,spriteram_size);
335335}
336336
337337
338338WRITE16_HANDLER( m72_port02_w )
339339{
340   if (ACCESSING_LSB)
340   if (ACCESSING_BITS_0_7)
341341   {
342342      if (data & 0xe0) logerror("write %02x to port 02\n",data);
343343
r2241r2242
363363
364364WRITE16_HANDLER( rtype2_port02_w )
365365{
366   if (ACCESSING_LSB)
366   if (ACCESSING_BITS_0_7)
367367   {
368368      if (data & 0xe0) logerror("write %02x to port 02\n",data);
369369
r2241r2242
387387/* the following is mostly a kludge. This register seems to be used for something else */
388388WRITE16_HANDLER( majtitle_gfx_ctrl_w )
389389{
390   if (ACCESSING_MSB)
390   if (ACCESSING_BITS_8_15)
391391   {
392392      if (data & 0xff00) majtitle_rowscroll = 1;
393393      else majtitle_rowscroll = 0;
src/mame/video/ohmygod.c
r2241r2242
5454
5555WRITE16_HANDLER( ohmygod_spritebank_w )
5656{
57   if (ACCESSING_MSB)
57   if (ACCESSING_BITS_8_15)
5858      spritebank = data & 0x8000;
5959}
6060
src/mame/video/snk68.c
r2241r2242
107107
108108WRITE16_HANDLER( pow_flipscreen16_w )
109109{
110   if (ACCESSING_LSB)
110   if (ACCESSING_BITS_0_7)
111111   {
112112       flip_screen_set(data & 0x08);
113113       sprite_flip=data&0x4;
src/mame/video/toobin.c
r2241r2242
140140{
141141   int i;
142142
143   if (ACCESSING_LSB)
143   if (ACCESSING_BITS_0_7)
144144   {
145145      brightness = (double)(~data & 0x1f) / 31.0;
146146
src/mame/video/legionna.c
r2241r2242
3232#ifdef UNUSED_FUNCTION
3333WRITE16_HANDLER( legionna_control_w )
3434{
35   if (ACCESSING_LSB)
35   if (ACCESSING_BITS_0_7)
3636   {
3737      legionna_enable=data;
3838      if ((legionna_enable&4)==4)
src/mame/video/mcr68.c
r2241r2242
304304VIDEO_UPDATE( mcr68 )
305305{
306306   /* draw the background */
307   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | 0, 0);
308   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | 1, 0);
307   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0);
309308
310309   /* draw the low-priority sprites */
311310   mcr68_update_sprites(screen->machine, bitmap, cliprect, 0);
src/mame/video/tecmo16.c
r2241r2242
413413                  }
414414                  pdrawgfx(bitmap,machine->gfx[2],
415415                        code + layout[y][x],
416                        color,
416                        machine->gfx[2]->color_base + color * machine->gfx[2]->color_granularity,
417417                        flipx,flipy,
418418                        sx,sy,
419                        cliprect,TRANSPARENCY_PEN,0,
419                        cliprect,TRANSPARENCY_PEN_RAW,0,
420420                        priority_mask);
421421
422422                  /* wrap around x */
423423                  pdrawgfx(bitmap,machine->gfx[2],
424424                        code + layout[y][x],
425                        color,
425                        machine->gfx[2]->color_base + color * machine->gfx[2]->color_granularity,
426426                        flipx,flipy,
427427                        sx-512,sy,
428                        cliprect,TRANSPARENCY_PEN,0,
428                        cliprect,TRANSPARENCY_PEN_RAW,0,
429429                        priority_mask);
430430
431431                  /* wrap around x */
432432                  pdrawgfx(bitmap,machine->gfx[2],
433433                        code + layout[y][x],
434                        color,
434                        machine->gfx[2]->color_base + color * machine->gfx[2]->color_granularity,
435435                        flipx,flipy,
436436                        sx+512,sy,
437                        cliprect,TRANSPARENCY_PEN,0,
437                        cliprect,TRANSPARENCY_PEN_RAW,0,
438438                        priority_mask);
439439               }
440440            }
r2241r2242
459459                  }
460460                  pdrawgfx(bitmap,machine->gfx[2],
461461                        code + layout[y][x],
462                        color,
462                        machine->gfx[2]->color_base + color * machine->gfx[2]->color_granularity,
463463                        flipx,flipy,
464464                        sx,sy,
465                        cliprect,TRANSPARENCY_PEN,0,
465                        cliprect,TRANSPARENCY_PEN_RAW,0,
466466                        priority_mask);
467467
468468                  /* wrap around x */
469469                  pdrawgfx(bitmap,machine->gfx[2],
470470                        code + layout[y][x],
471                        color,
471                        machine->gfx[2]->color_base + color * machine->gfx[2]->color_granularity,
472472                        flipx,flipy,
473473                        sx-512,sy,
474                        cliprect,TRANSPARENCY_PEN,0,
474                        cliprect,TRANSPARENCY_PEN_RAW,0,
475475                        priority_mask);
476476
477477                  /* wrap around x */
478478                  pdrawgfx(bitmap,machine->gfx[2],
479479                        code + layout[y][x],
480                        color,
480                        machine->gfx[2]->color_base + color * machine->gfx[2]->color_granularity,
481481                        flipx,flipy,
482482                        sx+512,sy,
483                        cliprect,TRANSPARENCY_PEN,0,
483                        cliprect,TRANSPARENCY_PEN_RAW,0,
484484                        priority_mask);
485485               }
486486            }
src/mame/video/toypop.c
r2241r2242
167167WRITE16_HANDLER( toypop_merged_background_w )
168168{
169169   // 0xabcd is written as 0x0a0b0c0d in the background image
170   if (ACCESSING_MSB)
170   if (ACCESSING_BITS_8_15)
171171      toypop_bg_image[2*offset] = ((data & 0xf00) >> 8) | ((data & 0xf000) >> 4);
172172
173   if (ACCESSING_LSB)
173   if (ACCESSING_BITS_0_7)
174174      toypop_bg_image[2*offset+1] = (data & 0xf) | ((data & 0xf0) << 4);
175175}
176176
src/mame/video/taito_z.c
r2241r2242
828828
829829WRITE16_HANDLER( contcirc_out_w )
830830{
831   if (ACCESSING_LSB)
831   if (ACCESSING_BITS_0_7)
832832   {
833833      /* bit 0 = reset sub CPU */
834834      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
src/mame/video/mappy.c
r2241r2242
533533{
534534   int x,y;
535535
536   tilemap_draw(bitmap,cliprect,bg_tilemap,0|TILEMAP_DRAW_OPAQUE,0);
537   tilemap_draw(bitmap,cliprect,bg_tilemap,1|TILEMAP_DRAW_OPAQUE,0);
536   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES,0);
538537
539538   fillbitmap(sprite_bitmap,15,cliprect);
540539   mappy_draw_sprites(screen->machine,sprite_bitmap,cliprect,0,0,15);
r2241r2242
560559   /* flip screen control is embedded in RAM */
561560   flip_screen_set(mappy_spriteram[0x1f7f-0x800] & 1);
562561
563   tilemap_draw(bitmap,cliprect,bg_tilemap,0|TILEMAP_DRAW_OPAQUE,0);
564   tilemap_draw(bitmap,cliprect,bg_tilemap,1|TILEMAP_DRAW_OPAQUE,0);
562   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES,0);
565563
566564   phozon_draw_sprites(screen->machine,bitmap,cliprect);
567565
r2241r2242
577575   for (offs = 2;offs < 34;offs++)
578576      tilemap_set_scrolly(bg_tilemap,offs,mappy_scroll);
579577
580   tilemap_draw(bitmap,cliprect,bg_tilemap,0|TILEMAP_DRAW_OPAQUE,0);
581   tilemap_draw(bitmap,cliprect,bg_tilemap,1|TILEMAP_DRAW_OPAQUE,0);
578   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES,0);
582579
583580   mappy_draw_sprites(screen->machine,bitmap,cliprect,0,0,15);
584581
src/mame/video/tigeroad.c
r2241r2242
1313{
1414   int bank;
1515
16   if (ACCESSING_MSB)
16   if (ACCESSING_BITS_8_15)
1717   {
1818      data = (data >> 8) & 0xff;
1919
src/mame/video/segas32.c
r2241r2242
503503
504504WRITE32_HANDLER( multi32_paletteram_0_w )
505505{
506   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
506   if (ACCESSING_BITS_0_15)
507507      common_paletteram_w(0, offset*2+0, data, mem_mask);
508   if ((mem_mask & 0xffff0000) != 0xffff0000)
508   if (ACCESSING_BITS_16_31)
509509      common_paletteram_w(0, offset*2+1, data >> 16, mem_mask >> 16);
510510}
511511
r2241r2242
519519
520520WRITE32_HANDLER( multi32_paletteram_1_w )
521521{
522   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
522   if (ACCESSING_BITS_0_15)
523523      common_paletteram_w(1, offset*2+0, data, mem_mask);
524   if ((mem_mask & 0xffff0000) != 0xffff0000)
524   if (ACCESSING_BITS_16_31)
525525      common_paletteram_w(1, offset*2+1, data >> 16, mem_mask >> 16);
526526}
527527
r2241r2242
567567
568568WRITE32_HANDLER( multi32_videoram_w )
569569{
570   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
570   if (ACCESSING_BITS_0_15)
571571      system32_videoram_w(machine, offset*2+0, data, mem_mask);
572   if ((mem_mask & 0xffff0000) != 0xffff0000)
572   if (ACCESSING_BITS_16_31)
573573      system32_videoram_w(machine, offset*2+1, data >> 16, mem_mask >> 16);
574574}
575575
r2241r2242
641641
642642WRITE16_HANDLER( system32_sprite_control_w )
643643{
644   if (ACCESSING_LSB)
644   if (ACCESSING_BITS_0_7)
645645      sprite_control[offset & 7] = data;
646646}
647647
r2241r2242
655655
656656WRITE32_HANDLER( multi32_sprite_control_w )
657657{
658   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
658   if (ACCESSING_BITS_0_15)
659659      system32_sprite_control_w(machine, offset*2+0, data, mem_mask);
660   if ((mem_mask & 0xffff0000) != 0xffff0000)
660   if (ACCESSING_BITS_16_31)
661661      system32_sprite_control_w(machine, offset*2+1, data >> 16, mem_mask >> 16);
662662}
663663
src/mame/video/badlands.c
r2241r2242
9898
9999WRITE16_HANDLER( badlands_pf_bank_w )
100100{
101   if (ACCESSING_LSB)
101   if (ACCESSING_BITS_0_7)
102102      if (playfield_tile_bank != (data & 1))
103103      {
104104         video_screen_update_partial(machine->primary_screen, video_screen_get_vpos(machine->primary_screen));
src/mame/video/kan_pand.c
r2241r2242
224224      return;
225225   }
226226
227   if (ACCESSING_MSB)
227   if (ACCESSING_BITS_8_15)
228228   {
229229      pandora_spriteram[offset] = (data>>8)&0xff;
230230   }
231231
232   if (ACCESSING_LSB)
232   if (ACCESSING_BITS_0_7)
233233   {
234234      pandora_spriteram[offset] = data&0xff;
235235   }
src/mame/video/equites.c
r2241r2242
162162
163163WRITE16_HANDLER(equites_fg_videoram_w)
164164{
165   if (ACCESSING_LSB)
165   if (ACCESSING_BITS_0_7)
166166   {
167167      equites_fg_videoram[offset] = data & 0xff;
168168
r2241r2242
179179
180180WRITE16_HANDLER(equites_bgcolor_w)
181181{
182   if (ACCESSING_MSB)
182   if (ACCESSING_BITS_8_15)
183183      bgcolor = data >> 8;
184184}
185185
186186WRITE16_HANDLER(equites_scrollreg_w)
187187{
188   if (ACCESSING_LSB)
188   if (ACCESSING_BITS_0_7)
189189      tilemap_set_scrolly(bg_tilemap, 0, data & 0xff);
190190
191   if (ACCESSING_MSB)
191   if (ACCESSING_BITS_8_15)
192192      tilemap_set_scrollx(bg_tilemap, 0, data >> 8);
193193}
194194
r2241r2242
222222
223223WRITE16_HANDLER(splndrbt_flip0_w)
224224{
225   if (ACCESSING_LSB)
225   if (ACCESSING_BITS_0_7)
226226      flip_screen_set(0);
227227
228   if (ACCESSING_MSB)
228   if (ACCESSING_BITS_8_15)
229229      bgcolor = data >> 8;
230230}
231231
232232WRITE16_HANDLER(splndrbt_flip1_w)
233233{
234   if (ACCESSING_LSB)
234   if (ACCESSING_BITS_0_7)
235235      flip_screen_set(1);
236236}
237237
src/mame/video/mystwarr.c
r2241r2242
395395
396396WRITE16_HANDLER(ddd_053936_enable_w)
397397{
398   if (ACCESSING_MSB)
398   if (ACCESSING_BITS_8_15)
399399   {
400400      roz_enable = data & 0x0100;
401401      roz_rombank = (data & 0xc000)>>14;
r2241r2242
410410
411411   if (offset == 1)
412412   {
413       if (ACCESSING_MSB) K053936GP_clip_enable(0, data & 0x0100);
413       if (ACCESSING_BITS_8_15) K053936GP_clip_enable(0, data & 0x0100);
414414   }
415415   else
416416   {
src/mame/video/quizpani.c
r2241r2242
5555
5656WRITE16_HANDLER( quizpani_tilesbank_w )
5757{
58   if (ACCESSING_LSB)
58   if (ACCESSING_BITS_0_7)
5959   {
6060      if(quizpani_txtbank != (data & 0x30)>>4)
6161      {
src/mame/video/konamigx.c
r2241r2242
446446   COMBINE_DATA(&paletteram32[offset]);
447447
448448   paletteram16 = (UINT16 *)paletteram32;
449   if (ACCESSING_MSW32)
449   if (ACCESSING_BITS_16_31)
450450      paletteram16_xRRRRRGGGGGBBBBB_word_w(machine, offset*2, data >> 16, mem_mask >> 16);
451   if (ACCESSING_LSW32)
451   if (ACCESSING_BITS_0_15)
452452      paletteram16_xRRRRRGGGGGBBBBB_word_w(machine, offset*2+1, data, mem_mask);
453453}
454454
r2241r2242
462462   COMBINE_DATA(&paletteram32[offset]);
463463
464464   paletteram16 = (UINT16 *)paletteram32;
465   if (ACCESSING_MSW32)
465   if (ACCESSING_BITS_16_31)
466466      paletteram16_xRRRRRGGGGGBBBBB_word_w(machine, offset*2, data >> 16, mem_mask >> 16);
467   if (ACCESSING_LSW32)
467   if (ACCESSING_BITS_0_15)
468468      paletteram16_xRRRRRGGGGGBBBBB_word_w(machine, offset*2+1, data, mem_mask);
469469}
470470
471471WRITE32_HANDLER( konamigx_tilebank_w )
472472{
473   if (!(mem_mask & 0xff000000))
473   if (ACCESSING_BITS_24_31)
474474      gx_tilebanks[offset*4] = (data>>24)&0xff;
475   if (!(mem_mask & 0xff0000))
475   if (ACCESSING_BITS_16_23)
476476      gx_tilebanks[offset*4+1] = (data>>16)&0xff;
477   if (!(mem_mask & 0xff00))
477   if (ACCESSING_BITS_8_15)
478478      gx_tilebanks[offset*4+2] = (data>>8)&0xff;
479   if (!(mem_mask & 0xff))
479   if (ACCESSING_BITS_0_7)
480480      gx_tilebanks[offset*4+3] = data&0xff;
481481}
482482
src/mame/video/ultraman.c
r2241r2242
8383
8484WRITE16_HANDLER( ultraman_gfxctrl_w )
8585{
86   if (ACCESSING_LSB)
86   if (ACCESSING_BITS_0_7)
8787   {
8888      /*  bit 0: enable wraparound for scr #1
8989            bit 1: msb of code for scr #1
src/mame/video/gotcha.c
r2241r2242
6363
6464WRITE16_HANDLER( gotcha_gfxbank_select_w )
6565{
66   if (ACCESSING_MSB)
66   if (ACCESSING_BITS_8_15)
6767      banksel = (data & 0x0300) >> 8;
6868}
6969
7070WRITE16_HANDLER( gotcha_gfxbank_w )
7171{
72   if (ACCESSING_MSB)
72   if (ACCESSING_BITS_8_15)
7373   {
7474      if (gfxbank[banksel] != ((data & 0x0f00) >> 8))
7575      {
src/mame/video/gberet.c
r2241r2242
170170
171171VIDEO_UPDATE( gberet )
172172{
173   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | 0, 0);
174   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | 1, 0);
173   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0);
175174   gberet_draw_sprites(screen->machine, bitmap, cliprect);
176175   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
177176   return 0;
r2241r2242
223222
224223VIDEO_UPDATE( gberetb )
225224{
226   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | 0, 0);
227   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | 1, 0);
225   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0);
228226   gberetb_draw_sprites(screen->machine, bitmap, cliprect);
229227   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
230228   return 0;
src/mame/video/cabal.c
r2241r2242
5454
5555WRITE16_HANDLER( cabal_flipscreen_w )
5656{
57   if (ACCESSING_LSB)
57   if (ACCESSING_BITS_0_7)
5858   {
5959      int flip = (data & 0x20) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0;
6060      tilemap_set_flip(background_layer,flip);
src/mame/video/cidelsa.c
r0r2242
1#include "driver.h"
2#include "video/cdp1869.h"
3#include "cidelsa.h"
4
5#define CIDELSA_PAGERAM_SIZE   0x400
6#define DRACO_PAGERAM_SIZE      0x800
7#define CIDELSA_CHARRAM_SIZE   0x800
8
9#define CIDELSA_PAGERAM_MASK   0x3ff
10#define DRACO_PAGERAM_MASK      0x7ff
11#define CIDELSA_CHARRAM_MASK   0x7ff
12
13#define SCREEN_TAG   "main"
14#define CDP1869_TAG   "cdp1869"
15
16/* Page RAM Access */
17
18static CDP1869_PAGE_RAM_READ(cidelsa_pageram_r)
19{
20   cidelsa_state *state = device->machine->driver_data;
21
22   UINT16 addr = pma & CIDELSA_PAGERAM_MASK;
23
24   if (BIT(pma, 10))
25   {
26      return 0xff;
27   }
28
29   return state->pageram[addr];
30}
31
32static CDP1869_PAGE_RAM_WRITE(cidelsa_pageram_w)
33{
34   cidelsa_state *state = device->machine->driver_data;
35
36   UINT16 addr = pma & CIDELSA_PAGERAM_MASK;
37
38   if (BIT(pma, 10))
39   {
40      return;
41   }
42
43   state->pageram[addr] = data;
44}
45
46static CDP1869_PAGE_RAM_READ(draco_pageram_r)
47{
48   cidelsa_state *state = device->machine->driver_data;
49
50   UINT16 addr = pma & DRACO_PAGERAM_MASK;
51
52   return state->pageram[addr];
53}
54
55static CDP1869_PAGE_RAM_WRITE(draco_pageram_w)
56{
57   cidelsa_state *state = device->machine->driver_data;
58
59   UINT16 addr = pma & DRACO_PAGERAM_MASK;
60
61   state->pageram[addr] = data;
62}
63
64/* Character RAM Access */
65
66static CDP1869_CHAR_RAM_READ(cidelsa_charram_r)
67{
68   cidelsa_state *state = device->machine->driver_data;
69
70   UINT8 column = BIT(pma, 10) ? 0xff : state->pageram[pma & CIDELSA_PAGERAM_MASK];
71   UINT16 addr = ((column << 3) | (cma & 0x07)) & CIDELSA_CHARRAM_MASK;
72
73   UINT8 data = state->charram[addr];
74   state->cdp1869_pcb = state->pcbram[addr];
75
76   return data;
77}
78
79static CDP1869_CHAR_RAM_WRITE(cidelsa_charram_w)
80{
81   cidelsa_state *state = device->machine->driver_data;
82
83   UINT8 column = BIT(pma, 10) ? 0xff : state->pageram[pma & CIDELSA_PAGERAM_MASK];
84   UINT16 addr = ((column << 3) | (cma & 0x07)) & CIDELSA_CHARRAM_MASK;
85
86   state->charram[addr] = data;
87   state->pcbram[addr] = state->cdp1802_q;
88}
89
90static CDP1869_CHAR_RAM_READ(draco_charram_r)
91{
92   cidelsa_state *state = device->machine->driver_data;
93
94   UINT8 column = state->pageram[pma & DRACO_PAGERAM_MASK];
95   UINT16 addr = ((column << 3) | (cma & 0x07)) & CIDELSA_CHARRAM_MASK;
96
97   UINT8 data = state->charram[addr];
98   state->cdp1869_pcb = state->pcbram[addr];
99
100   return data;
101}
102
103static CDP1869_CHAR_RAM_WRITE(draco_charram_w)
104{
105   cidelsa_state *state = device->machine->driver_data;
106
107   UINT8 column = state->pageram[pma & DRACO_PAGERAM_MASK];
108   UINT16 addr = ((column << 3) | (cma & 0x07)) & CIDELSA_CHARRAM_MASK;
109
110   state->charram[addr] = data;
111   state->pcbram[addr] = state->cdp1802_q;
112}
113
114/* Page Color Bit Access */
115
116static CDP1869_PCB_READ(cidelsa_pcb_r)
117{
118   cidelsa_state *state = device->machine->driver_data;
119
120   UINT8 column = state->pageram[pma & CIDELSA_PAGERAM_MASK];
121   UINT16 addr = ((column << 3) | (cma & 0x07)) & CIDELSA_CHARRAM_MASK;
122
123   return state->pcbram[addr];
124}
125
126static CDP1869_PCB_READ(draco_pcb_r)
127{
128   cidelsa_state *state = device->machine->driver_data;
129
130   UINT8 column = state->pageram[pma & DRACO_PAGERAM_MASK];
131   UINT16 addr = ((column << 3) | (cma & 0x07)) & CIDELSA_CHARRAM_MASK;
132
133   return state->pcbram[addr];
134}
135
136/* Predisplay Changed Handler */
137
138static CDP1869_ON_PRD_CHANGED(cidelsa_prd_changed)
139{
140   cidelsa_state *state = device->machine->driver_data;
141
142   // PRD is inverted
143
144   cpunum_set_input_line(device->machine, 0, INPUT_LINE_IRQ0, !prd);
145   state->cdp1869_prd = !prd;
146}
147
148static CDP1869_ON_PRD_CHANGED(draco_prd_changed)
149{
150   cidelsa_state *state = device->machine->driver_data;
151
152   state->cdp1869_prd = prd;
153}
154
155/* CDP1869 Interface */
156
157static const cdp1869_interface destryer_cdp1869_intf =
158{
159   SCREEN_TAG,
160   DESTRYER_CHR2,
161   0,
162   CDP1869_PAL,
163   cidelsa_pageram_r,
164   cidelsa_pageram_w,
165   cidelsa_pcb_r,
166   cidelsa_charram_r,
167   cidelsa_charram_w,
168   cidelsa_prd_changed,
169};
170
171static const cdp1869_interface altair_cdp1869_intf =
172{
173   SCREEN_TAG,
174   ALTAIR_CHR2,
175   0,
176   CDP1869_PAL,
177   cidelsa_pageram_r,
178   cidelsa_pageram_w,
179   cidelsa_pcb_r,
180   cidelsa_charram_r,
181   cidelsa_charram_w,
182   cidelsa_prd_changed,
183};
184
185static const cdp1869_interface draco_cdp1869_intf =
186{
187   SCREEN_TAG,
188   DRACO_CHR2,
189   0,
190   CDP1869_PAL,
191   draco_pageram_r,
192   draco_pageram_w,
193   draco_pcb_r,
194   draco_charram_r,
195   draco_charram_w,
196   draco_prd_changed,
197};
198
199/* Video Start */
200
201static VIDEO_START(cidelsa)
202{
203   cidelsa_state *state = machine->driver_data;
204
205   // allocate memory
206
207   state->pageram = auto_malloc(CIDELSA_PAGERAM_SIZE);
208   state->pcbram = auto_malloc(CIDELSA_CHARRAM_SIZE);
209   state->charram = auto_malloc(CIDELSA_CHARRAM_SIZE);
210
211   // register for save state
212
213   state_save_register_global(state->cdp1869_prd);
214   state_save_register_global(state->cdp1869_pcb);
215   state_save_register_global_pointer(state->pageram, CIDELSA_PAGERAM_SIZE);
216   state_save_register_global_pointer(state->pcbram, CIDELSA_CHARRAM_SIZE);
217   state_save_register_global_pointer(state->charram, CIDELSA_CHARRAM_SIZE);
218}
219
220static VIDEO_START(draco)
221{
222   cidelsa_state *state = machine->driver_data;
223
224   // allocate memory
225
226   state->pageram = auto_malloc(DRACO_PAGERAM_SIZE);
227   state->pcbram = auto_malloc(CIDELSA_CHARRAM_SIZE);
228   state->charram = auto_malloc(CIDELSA_CHARRAM_SIZE);
229
230   // register for save state
231
232   state_save_register_global(state->cdp1869_prd);
233   state_save_register_global(state->cdp1869_pcb);
234   state_save_register_global_pointer(state->pageram, DRACO_PAGERAM_SIZE);
235   state_save_register_global_pointer(state->pcbram, CIDELSA_CHARRAM_SIZE);
236   state_save_register_global_pointer(state->charram, CIDELSA_CHARRAM_SIZE);
237}
238
239/* Video Update */
240
241static VIDEO_UPDATE( cidelsa )
242{
243   const device_config *cdp1869 = device_list_find_by_tag(screen->machine->config->devicelist, CDP1869_VIDEO, CDP1869_TAG);
244
245   cdp1869_update(cdp1869, bitmap, cliprect);
246
247   return 0;
248}
249
250/* Machine Drivers */
251
252MACHINE_DRIVER_START( destryer_video )
253   MDRV_PALETTE_LENGTH(CDP1869_PALETTE_LENGTH)
254   MDRV_PALETTE_INIT(cdp1869)
255
256   MDRV_VIDEO_START(cidelsa)
257   MDRV_VIDEO_UPDATE(cidelsa)
258
259   MDRV_SCREEN_ADD(SCREEN_TAG, RASTER)
260   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
261   MDRV_SCREEN_RAW_PARAMS(DESTRYER_CHR2, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_PAL, CDP1869_SCANLINE_VBLANK_END_PAL, CDP1869_SCANLINE_VBLANK_START_PAL)
262   MDRV_SCREEN_DEFAULT_POSITION(1.226, 0.012, 1.4, 0.044)
263
264   MDRV_DEVICE_ADD(CDP1869_TAG, CDP1869_VIDEO)
265   MDRV_DEVICE_CONFIG(destryer_cdp1869_intf)
266MACHINE_DRIVER_END
267
268MACHINE_DRIVER_START( altair_video )
269   MDRV_PALETTE_LENGTH(CDP1869_PALETTE_LENGTH)
270   MDRV_PALETTE_INIT(cdp1869)
271
272   MDRV_VIDEO_START(cidelsa)
273   MDRV_VIDEO_UPDATE(cidelsa)
274
275   MDRV_SCREEN_ADD(SCREEN_TAG, RASTER)
276   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
277   MDRV_SCREEN_RAW_PARAMS(ALTAIR_CHR2, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_PAL, CDP1869_SCANLINE_VBLANK_END_PAL, CDP1869_SCANLINE_VBLANK_START_PAL)
278   MDRV_SCREEN_DEFAULT_POSITION(1.226, 0.012, 1.4, 0.044)
279
280   MDRV_DEVICE_ADD(CDP1869_TAG, CDP1869_VIDEO)
281   MDRV_DEVICE_CONFIG(altair_cdp1869_intf)
282MACHINE_DRIVER_END
283
284MACHINE_DRIVER_START( draco_video )
285   MDRV_PALETTE_LENGTH(CDP1869_PALETTE_LENGTH)
286   MDRV_PALETTE_INIT(cdp1869)
287
288   MDRV_VIDEO_START(draco)
289   MDRV_VIDEO_UPDATE(cidelsa)
290
291   MDRV_SCREEN_ADD(SCREEN_TAG, RASTER)
292   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
293   MDRV_SCREEN_RAW_PARAMS(DRACO_CHR2, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_PAL, CDP1869_SCANLINE_VBLANK_END_PAL, CDP1869_SCANLINE_VBLANK_START_PAL)
294   MDRV_SCREEN_DEFAULT_POSITION(1.226, 0.012, 1.360, 0.024)
295
296   MDRV_DEVICE_ADD(CDP1869_TAG, CDP1869_VIDEO)
297   MDRV_DEVICE_CONFIG(draco_cdp1869_intf)
298MACHINE_DRIVER_END
src/mame/video/m92.c
r2241r2242
8080   /* Sprite list size register - used in spriteroutine */
8181
8282   /* Sprite control - display all sprites, or partial list */
83   if (offset==2 && ACCESSING_LSB)
83   if (offset==2 && ACCESSING_BITS_0_7)
8484   {
8585      if ((data & 0xff) == 8)
8686         m92_sprite_list = (((0x100 - m92_spritecontrol[0]) & 0xff) * 4);
r2241r2242
119119        be a different motherboard revision (most games use M92-A-B top
120120        pcb, a M92-A-A revision could exist...).
121121    */
122   if (ACCESSING_LSB)
122   if (ACCESSING_BITS_0_7)
123123   {
124124      /* Access to upper palette bank */
125125      m92_palette_bank = (data >> 1) & 1;
src/mame/video/wwfwfest.c
r2241r2242
2424WRITE16_HANDLER( wwfwfest_fg0_videoram_w )
2525{
2626   /* Videoram is 8 bit, upper & lower byte writes end up in the same place */
27   if (ACCESSING_MSB && ACCESSING_LSB) {
27   if (ACCESSING_BITS_8_15 && ACCESSING_BITS_0_7) {
2828      COMBINE_DATA(&wwfwfest_fg0_videoram[offset]);
29   } else if (ACCESSING_MSB) {
29   } else if (ACCESSING_BITS_8_15) {
3030      wwfwfest_fg0_videoram[offset]=(data>>8)&0xff;
3131   } else {
3232      wwfwfest_fg0_videoram[offset]=data&0xff;
src/mame/video/shangha3.c
r2241r2242
9494
9595WRITE16_HANDLER( shangha3_flipscreen_w )
9696{
97   if (ACCESSING_LSB)
97   if (ACCESSING_BITS_0_7)
9898   {
9999      /* bit 7 flips screen, the rest seems to always be set to 0x7e */
100100      flip_screen_set(data & 0x80);
src/mame/video/taotaido.c
r2241r2242
2525/* sprite tile codes 0x4000 - 0x7fff get remapped according to the content of these registers */
2626WRITE16_HANDLER( taotaido_sprite_character_bank_select_w )
2727{
28   if(ACCESSING_MSB)
28   if(ACCESSING_BITS_8_15)
2929      taotaido_sprite_character_bank_select[offset*2] = data >> 8;
30   if(ACCESSING_LSB)
30   if(ACCESSING_BITS_0_7)
3131      taotaido_sprite_character_bank_select[offset*2+1] = data &0xff;
3232}
3333
r2241r2242
153153      case 5:
154154      case 6:
155155      case 7:
156         if(ACCESSING_MSB)
156         if(ACCESSING_BITS_8_15)
157157            taotaido_video_bank_select[(offset-4)*2] = data >> 8;
158         if(ACCESSING_LSB)
158         if(ACCESSING_BITS_0_7)
159159            taotaido_video_bank_select[(offset-4)*2+1] = data &0xff;
160160            tilemap_mark_all_tiles_dirty(bg_tilemap);
161161         break;
src/mame/video/m107.c
r2241r2242
303303
304304WRITE16_HANDLER( m107_spritebuffer_w )
305305{
306   if (ACCESSING_LSB) {
306   if (ACCESSING_BITS_0_7) {
307307//      logerror("%04x: buffered spriteram\n",activecpu_get_pc());
308308      memcpy(m107_spriteram,spriteram16,0x1000);
309309   }
src/mame/video/crshrace.c
r2241r2242
7272
7373WRITE16_HANDLER( crshrace_roz_bank_w )
7474{
75   if (ACCESSING_LSB)
75   if (ACCESSING_BITS_0_7)
7676   {
7777      if (roz_bank != (data & 0xff))
7878      {
r2241r2242
8585
8686WRITE16_HANDLER( crshrace_gfxctrl_w )
8787{
88   if (ACCESSING_LSB)
88   if (ACCESSING_BITS_0_7)
8989   {
9090      gfxctrl = data & 0xdf;
9191      flipscreen = data & 0x20;
src/mame/video/sf.c
r2241r2242
106106/* b5 = active background plane */
107107/* b6 = active middle plane */
108108/* b7 = active sprites */
109   if (ACCESSING_LSB)
109   if (ACCESSING_BITS_0_7)
110110   {
111111      sf_active = data & 0xff;
112112      flip_screen_set(data & 0x04);
src/mame/video/dooyong.c
r2241r2242
9494
9595WRITE16_HANDLER( dooyong_bgscroll16_w )
9696{
97   if (ACCESSING_LSB) dooyong_bgscroll8_w(machine, offset, data & 0x00ff);
97   if (ACCESSING_BITS_0_7) dooyong_bgscroll8_w(machine, offset, data & 0x00ff);
9898}
9999
100100WRITE16_HANDLER( dooyong_bg2scroll16_w )
101101{
102   if (ACCESSING_LSB) dooyong_bg2scroll8_w(machine, offset, data & 0x00ff);
102   if (ACCESSING_BITS_0_7) dooyong_bg2scroll8_w(machine, offset, data & 0x00ff);
103103}
104104
105105WRITE16_HANDLER( dooyong_fgscroll16_w )
106106{
107   if (ACCESSING_LSB) dooyong_fgscroll8_w(machine, offset, data & 0x00ff);
107   if (ACCESSING_BITS_0_7) dooyong_fgscroll8_w(machine, offset, data & 0x00ff);
108108}
109109
110110WRITE16_HANDLER( dooyong_fg2scroll16_w )
111111{
112   if (ACCESSING_LSB) dooyong_fg2scroll8_w(machine, offset, data & 0x00ff);
112   if (ACCESSING_BITS_0_7) dooyong_fg2scroll8_w(machine, offset, data & 0x00ff);
113113}
114114
115115
r2241r2242
188188
189189WRITE16_HANDLER( rshark_ctrl_w )
190190{
191   if (ACCESSING_LSB)
191   if (ACCESSING_BITS_0_7)
192192   {
193193      /* bit 0 flips screen */
194194      flip_screen_set(data & 0x0001);
src/mame/video/genesis.c
r2241r2242
373373         if (mem_mask)
374374         {
375375            data &= ~mem_mask;
376             if (ACCESSING_MSB)
376             if (ACCESSING_BITS_8_15)
377377                data |= data >> 8;
378378             else
379379                data |= data << 8;
r2241r2242
386386         if (mem_mask)
387387         {
388388            data &= ~mem_mask;
389             if (ACCESSING_MSB)
389             if (ACCESSING_BITS_8_15)
390390                data |= data >> 8;
391391             else
392392                data |= data << 8;
r2241r2242
398398      case 0x09:
399399      case 0x0a:
400400      case 0x0b:
401         if (ACCESSING_LSB && sndti_exists(SOUND_SN76496, 0))
401         if (ACCESSING_BITS_0_7 && sndti_exists(SOUND_SN76496, 0))
402402            SN76496_0_w(machine, 0, data & 0xff);
403403         break;
404404   }
src/mame/video/rpunch.c
r2241r2242
134134
135135WRITE16_HANDLER( rpunch_scrollreg_w )
136136{
137   if (ACCESSING_LSB && ACCESSING_MSB)
137   if (ACCESSING_BITS_0_7 && ACCESSING_BITS_8_15)
138138      switch (offset)
139139      {
140140         case 0:
r2241r2242
158158
159159WRITE16_HANDLER( rpunch_crtc_data_w )
160160{
161   if (ACCESSING_LSB)
161   if (ACCESSING_BITS_0_7)
162162   {
163163      data &= 0xff;
164164      switch (crtc_register)
r2241r2242
178178
179179WRITE16_HANDLER( rpunch_crtc_register_w )
180180{
181   if (ACCESSING_LSB)
181   if (ACCESSING_BITS_0_7)
182182      crtc_register = data & 0xff;
183183}
184184
185185
186186WRITE16_HANDLER( rpunch_ins_w )
187187{
188   if (ACCESSING_LSB)
188   if (ACCESSING_BITS_0_7)
189189   {
190190      if (offset == 0)
191191      {
src/mame/video/nmk16.c
r2241r2242
297297{
298298   static UINT8 scroll[4];
299299
300   if (ACCESSING_MSB)
300   if (ACCESSING_BITS_8_15)
301301   {
302302      scroll[offset] = (data >> 8) & 0xff;
303303
r2241r2242
310310
311311WRITE16_HANDLER( nmk_scroll_w )
312312{
313   if (ACCESSING_LSB)
313   if (ACCESSING_BITS_0_7)
314314   {
315315      static UINT8 scroll[4];
316316
r2241r2242
325325
326326WRITE16_HANDLER( nmk_scroll_2_w )
327327{
328   if (ACCESSING_LSB)
328   if (ACCESSING_BITS_0_7)
329329   {
330330      static UINT8 scroll[4];
331331
r2241r2242
369369
370370WRITE16_HANDLER( nmk_flipscreen_w )
371371{
372   if (ACCESSING_LSB)
372   if (ACCESSING_BITS_0_7)
373373      flip_screen_set(data & 0x01);
374374}
375375
376376WRITE16_HANDLER( nmk_tilebank_w )
377377{
378   if (ACCESSING_LSB)
378   if (ACCESSING_BITS_0_7)
379379   {
380380      if (bgbank != (data & 0xff))
381381      {
r2241r2242
387387
388388WRITE16_HANDLER( bioship_scroll_w )
389389{
390   if (ACCESSING_MSB)
390   if (ACCESSING_BITS_8_15)
391391      bioship_scroll[offset]=data>>8;
392392}
393393
394394WRITE16_HANDLER( bioship_bank_w )
395395{
396   if (ACCESSING_LSB)
396   if (ACCESSING_BITS_0_7)
397397   {
398398      if (bioship_background_bank != data)
399399      {
src/mame/tiny.mak
r2241r2242
8585# layout dependencies
8686#-------------------------------------------------
8787
88$(DRIVERS)/astrocde.o:   $(LAYOUT)/tenpindx.lh
88$(DRIVERS)/astrocde.o:   $(LAYOUT)/gorf.lh \
89                  $(LAYOUT)/tenpindx.lh
8990$(DRIVERS)/circus.o:   $(LAYOUT)/circus.lh \
9091                  $(LAYOUT)/crash.lh
src/mame/layout/armora.lay
r0r2242
1<mamelayout version="2">
2   <element name="overlay">
3      <rect>
4         <bounds left="0" top="0" right="512" bottom="35" />
5         <color red="0.60" green="0.60" blue="0.06" />
6      </rect>
7      <rect>
8         <bounds left="0" top="35" right="256" bottom="96" />
9         <color red="0.60" green="0.60" blue="0.06" />
10      </rect>
11      <rect>
12         <bounds left="256" top="35" right="450" bottom="96" />
13         <color red="0" green="0.235" blue="0.11" />
14      </rect>
15      <rect>
16         <bounds left="450" top="35" right="512" bottom="96" />
17         <color red="0.60" green="0.60" blue="0.06" />
18      </rect>
19      <rect>
20         <bounds left="0" top="96" right="256" bottom="128" />
21         <color red="0.60" green="0.60" blue="0.06" />
22      </rect>
23      <rect>
24         <bounds left="256" top="96" right="322" bottom="128" />
25         <color red="0" green="0.235" blue="0.11" />
26      </rect>
27      <rect>
28         <bounds left="322" top="96" right="416" bottom="128" />
29         <color red="0.60" green="0.60" blue="0.06" />
30      </rect>
31      <rect>
32         <bounds left="416" top="96" right="450" bottom="128" />
33         <color red="0" green="0.235" blue="0.11" />
34      </rect>
35      <rect>
36         <bounds left="450" top="96" right="512" bottom="128" />
37         <color red="0.60" green="0.60" blue="0.06" />
38      </rect>
39      <rect>
40         <bounds left="0" top="128" right="224" bottom="160" />
41         <color red="0.60" green="0.60" blue="0.06" />
42      </rect>
43      <rect>
44         <bounds left="224" top="128" right="322" bottom="160" />
45         <color red="0" green="0.235" blue="0.11" />
46      </rect>
47      <rect>
48         <bounds left="322" top="128" right="416" bottom="160" />
49         <color red="0.60" green="0.60" blue="0.06" />
50      </rect>
51      <rect>
52         <bounds left="416" top="128" right="450" bottom="160" />
53         <color red="0" green="0.235" blue="0.11" />
54      </rect>
55      <rect>
56         <bounds left="450" top="128" right="512" bottom="160" />
57         <color red="0.60" green="0.60" blue="0.06" />
58      </rect>
59      <rect>
60         <bounds left="0" top="160" right="192" bottom="192" />
61         <color red="0.60" green="0.60" blue="0.06" />
62      </rect>
63      <rect>
64         <bounds left="192" top="160" right="322" bottom="192" />
65         <color red="0" green="0.235" blue="0.11" />
66      </rect>
67      <rect>
68         <bounds left="322" top="160" right="384" bottom="192" />
69         <color red="0.60" green="0.60" blue="0.06" />
70      </rect>
71      <rect>
72         <bounds left="384" top="160" right="512" bottom="192" />
73         <color red="0" green="0.235" blue="0.11" />
74      </rect>
75
76      <rect>
77         <bounds left="0" top="192" right="35" bottom="226" />
78         <color red="0.60" green="0.60" blue="0.06" />
79      </rect>
80      <rect>
81         <bounds left="35" top="192" right="450" bottom="226" />
82         <color red="0" green="0.235" blue="0.11" />
83      </rect>
84      <rect>
85         <bounds left="450" top="192" right="512" bottom="226" />
86         <color red="0.60" green="0.60" blue="0.06" />
87      </rect>
88      <rect>
89         <bounds left="0" top="226" right="35" bottom="257" />
90         <color red="0.60" green="0.60" blue="0.06" />
91      </rect>
92      <rect>
93         <bounds left="35" top="226" right="416" bottom="257" />
94         <color red="0" green="0.235" blue="0.11" />
95      </rect>
96      <rect>
97         <bounds left="416" top="226" right="512" bottom="257" />
98         <color red="0.60" green="0.60" blue="0.06" />
99      </rect>
100      <rect>
101         <bounds left="0" top="257" right="35" bottom="318" />
102         <color red="0.60" green="0.60" blue="0.06" />
103      </rect>
104      <rect>
105         <bounds left="35" top="257" right="99" bottom="318" />
106         <color red="0" green="0.235" blue="0.11" />
107      </rect>
108      <rect>
109         <bounds left="99" top="257" right="288" bottom="318" />
110         <color red="0.60" green="0.60" blue="0.06" />
111      </rect>
112      <rect>
113         <bounds left="288" top="257" right="384" bottom="318" />
114         <color red="0" green="0.235" blue="0.11" />
115      </rect>
116      <rect>
117         <bounds left="384" top="257" right="512" bottom="318" />
118         <color red="0.60" green="0.60" blue="0.06" />
119      </rect>
120
121      <rect>
122         <bounds left="0" top="318" right="35" bottom="351" />
123         <color red="0.60" green="0.60" blue="0.06" />
124      </rect>
125      <rect>
126         <bounds left="35" top="318" right="224" bottom="351" />
127         <color red="0" green="0.235" blue="0.11" />
128      </rect>
129      <rect>
130         <bounds left="224" top="318" right="288" bottom="351" />
131         <color red="0.60" green="0.60" blue="0.06" />
132      </rect>
133      <rect>
134         <bounds left="288" top="318" right="512" bottom="351" />
135         <color red="0" green="0.235" blue="0.11" />
136      </rect>
137
138      <rect>
139         <bounds left="0" top="351" right="160" bottom="384" />
140         <color red="0.60" green="0.60" blue="0.06" />
141      </rect>
142      <rect>
143         <bounds left="160" top="351" right="512" bottom="384" />
144         <color red="0" green="0.235" blue="0.11" />
145      </rect>
146   </element>
147   <view name="Color_Overlay">
148      <overlay element="overlay">
149         <bounds x="0" y="0" width="512" height="384" />
150      </overlay>
151      <backdrop element="overlay">
152         <bounds x="0" y="0" width="512" height="384" />
153         <color alpha=".8" />
154      </backdrop>
155      <overlay element="overlay">
156         <bounds x="512" y="384" width="512" height="384" />
157         <orientation rotate="180" />
158      </overlay>
159      <backdrop element="overlay">
160         <bounds x="512" y="384" width="512" height="384" />
161         <color alpha=".8" />
162         <orientation rotate="180" />
163      </backdrop>
164      <overlay element="overlay">
165         <bounds x="512" y="0" width="512" height="384" />
166         <orientation flipx="yes" />
167      </overlay>
168      <backdrop element="overlay">
169         <bounds x="512" y="0" width="512" height="384" />
170         <color alpha=".8" />
171         <orientation flipx="yes" />
172      </backdrop>
173      <overlay element="overlay">
174         <bounds x="0" y="384" width="512" height="384" />
175         <orientation flipy="yes" />
176      </overlay>
177      <backdrop element="overlay">
178         <bounds x="0" y="384" width="512" height="384" />
179         <color alpha=".8" />
180         <orientation flipy="yes" />
181      </backdrop>
182      <screen index="0">
183                 <bounds x="0" y="0" width="1024" height="768" />
184      </screen>
185   </view>
186</mamelayout>
src/mame/drivers/bfcobra.c
r2241r2242
22
33    Bell-Fruit Cobra I/II and Viper Hardware
44
5    driver by Phil Bennett
5    driver by Phil Bennett and Anonymous
66
77    Games supported:
8        * A Question of Sport (two sets)
8        * A Question of Sport [2 sets]
9        * Beeline (non-working - missing disk)
910        * Every Second Counts
10        * Inquizitor (Viper hardware)
11        * Inquizitor (Viper hardware, non-working - missing disk)
1112        * Quizvaders
1213        * Treble Top
1314
r2241r2242
5455
5556    To do:
5657
57    * Verify blitter modes on real hardware and rewrite code
58    * Deduce unknown chipset accesses
58    * Complete blitter emulation
5959    * Cobra II support
60    * Implement Flare One DSP (although nothing seems to use it)
6160    * Hook up additional inputs, EM meters, lamps etc
62    * Remove a 'TODO' comment or thirty
6361
6462    Known issues:
6563
66    * trebltop: During the intro, DLT's signature is drawn incorrectly.
67    * escounts: Colours are completely wrong. Is there a palette register
68    somewhere that affects blitter/video output?
69    * qos: Game clock and score dividers aren't drawn (needs line draw mode)
70    * All games bar qos: NVRAM not saved.
64    * All games bar qos: NVRAM not saved
7165
66    * Viper does not have a colour palette - the Flare chipset drives RGB direct.
67      To fix this I set default values in the palette when the machine is initialised
68    * CPU execution rate is wrong, the hardware adds 1 TCycle to each access which is unaccounted for.
69    * Plane priority is probably wrong but it's only used in Treble Top.
70    * Blitter loop counts and step are wrong - they are 9 bit counts, not 8.
71    * Blitter emulation doesn't support hi-res mode (needed for Inquizitor)
72
7273******************************************************************************/
74
7375#include "driver.h"
7476#include "deprecat.h"
7577#include "machine/6850acia.h"
r2241r2242
8284/*
8385    Defines
8486*/
85#define Z80_XTAL   4000000
87#define Z80_XTAL   5910000      /* Unconfirmed */
8688#define M6809_XTAL   1000000
8789
8890
r2241r2242
9698static UINT8 v_scroll;
9799static UINT8 flip_8;
98100static UINT8 flip_22;
101static UINT8 videomode;
99102
100103/* UART source/sinks */
101104static UINT8 z80_m6809_line;
r2241r2242
103106static UINT8 data_r;
104107static UINT8 data_t;
105108
106static int   irq_state;
109static int irq_state;
107110static int acia_irq;
108111static int vblank_irq;
109112static int blitter_irq;
r2241r2242
139142
140143***************************************************************************/
141144
142#ifdef MAME_DEBUG
143static int DEBUG_BLITTER = 0;
144#endif
145
146/* Typedefs */
147145typedef union
148146{
149147#ifdef LSB_FIRST
148   struct { UINT16 loword, hiword ; } ;
150149   struct { UINT8 addr0, addr1, addr2; };
151150#else
151   struct { UINT16 hiword, loword ; } ;
152152   struct { UINT8 addr2, addr1, addr0; };
153153#endif
154154   UINT32 addr;
r2241r2242
160160#define CMD_PARRD      0x04      /* Never used? */
161161#define CMD_SRCUP      0x08
162162#define CMD_DSTUP      0x10
163#define CMD_SRCEN      0x20
164#define CMD_DSTEN      0x40
163#define CMD_LT0       0x20
164#define CMD_LT1         0x40
165165#define CMD_LINEDRAW   0x80
166166
167
167168/* All unconfirmed */
168169//#define SRCDST_CMP    0x10
169170//#define SRCDST_WRAP   0x20
r2241r2242
177178#define MODE_BITTOBYTE   0x04
178179#define MODE_PALREMAP   0x10
179180
180/* All unconfirmed */
181//#define CMPFUNC_EQ    0x01
182//#define CMPFUNC_NE    0x02
183//#define CMPFUNC_GT    0x04
184//#define CMPFUNC_PLANE 0x08
185
186#define CMPFUNC_EQ      0x08
181#define CMPFUNC_LT       0x01
182#define CMPFUNC_EQ       0x02
183#define CMPFUNC_GT       0x04
184#define CMPFUNC_BEQ      0x08
187185#define CMPFUNC_LOG0   0x10
188186#define CMPFUNC_LOG1   0x20
189187#define CMPFUNC_LOG2   0x40
r2241r2242
211209   UINT8      pattern;
212210} blitter;
213211
212#define LOOPTYPE ( ( blitter.command&0x60 ) >> 5 )
213
214214/*
215215    MUSIC Semiconductor TR9C1710 RAMDAC or equivalent
216216*/
r2241r2242
230230   UINT8   count_w;
231231} ramdac;
232232
233
234#define BLUE_0 0
235#define BLUE_1 1
236#define BLUE_2 2
237#define BLUE_3 3
238#define GREEN_0 ( 0 << 2 )
239#define GREEN_1 ( 1 << 2 )
240#define GREEN_2 ( 2 << 2 )
241#define GREEN_3 ( 3 << 2 )
242#define GREEN_4 ( 4 << 2 )
243#define GREEN_5 ( 5 << 2 )
244#define GREEN_6 ( 6 << 2 )
245#define GREEN_7 ( 7 << 2 )
246#define RED_0 ( 0 << 5 )
247#define RED_1 ( 1 << 5 )
248#define RED_2 ( 2 << 5 )
249#define RED_3 ( 3 << 5 )
250#define RED_4 ( 4 << 5 )
251#define RED_5 ( 5 << 5 )
252#define RED_6 ( 6 << 5 )
253#define RED_7 ( 7 << 5 )
254
255static UINT8 col4bit[16]=
256{
257   BLUE_0 | GREEN_0 | RED_0,
258   BLUE_1,
259   GREEN_2,
260   BLUE_1 | GREEN_2,
261   RED_2,
262   RED_2 | BLUE_1,
263   RED_2 | GREEN_2,
264   RED_2 | GREEN_2 | BLUE_1,
265   BLUE_2 | GREEN_5 | RED_5,
266   BLUE_3,
267   GREEN_7,
268   BLUE_3 | GREEN_7,
269   RED_7,
270   RED_7 | BLUE_3,
271   RED_7 | GREEN_7,
272   RED_7 | GREEN_7 | BLUE_3
273};
274
275static UINT8 col3bit[16]=
276{
277   0,
278   BLUE_3,
279   GREEN_7,
280   BLUE_3 | GREEN_7,
281   RED_7,
282   RED_7 | BLUE_3,
283   RED_7 | GREEN_7,
284   RED_7 | GREEN_7 | BLUE_3,
285   0,
286   BLUE_3,
287   GREEN_7,
288   BLUE_3 | GREEN_7,
289   RED_7,
290   RED_7 | BLUE_3,
291   RED_7 | GREEN_7,
292   RED_7 | GREEN_7 | BLUE_3
293};
294
295static UINT8 col8bit[256];
296static UINT8 col7bit[256];
297static UINT8 col6bit[256];
298static UINT8 col76index[] = {0, 2, 4, 7};
299
300
233301static VIDEO_UPDATE( bfcobra )
234302{
303   static int init_colour_indexes = 1;
235304   int x, y;
236305   UINT8  *src;
237306   UINT32 *dest;
238307   UINT32 offset;
308   UINT8 *hirescol;
309   UINT8 *lorescol;
239310
240   /* A bit dodgy */
311   /*
312        The following is a dirty hack to init the palette index tables
313        this should really be done elsewhere, preferably at compile time.
314    */
315   if (init_colour_indexes == 1)
316   {
317      init_colour_indexes = 0;
318
319      for (x = 0; x < 256; ++x)
320      {
321         UINT8 col;
322
323         col8bit[x] = x;
324         col = x & 0x7f;
325         col = (col & 0x1f) | (col76index[ ( (col & 0x60) >> 5 ) & 3] << 5);
326         col7bit[x] = col;
327
328         col = (col & 3) | (col76index[( (col & 0x0c) >> 2) & 3] << 2 ) |
329              (col76index[( (col & 0x30) >> 4) & 3] << 5 );
330         col6bit[x] = col;
331      }
332   }
333
334
335   /* Select screen has to be programmed into two registers */
336   /* No idea what happens if the registers are different */
241337   if (flip_8 & 0x40 && flip_22 & 0x40)
242338      offset = 0x10000;
243339   else
244340      offset = 0;
245341
342   if(videomode & 0x20)
343   {
344      hirescol = col3bit;
345      lorescol = col7bit;
346   }
347   else if(videomode & 0x40)
348   {
349      hirescol = col4bit;
350      lorescol = col6bit;
351   }
352   else
353   {
354      hirescol = col4bit;
355      lorescol = col8bit;
356   }
357
246358   for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
247359   {
248360      UINT16 y_offset = (y + v_scroll) * 256;
249361      src = &video_ram[offset + y_offset];
250362      dest = BITMAP_ADDR32(bitmap, y, 0);
251363
252      for (x = cliprect->min_x; x <= cliprect->max_x; ++x)
364      for (x = cliprect->min_x; x <= cliprect->max_x / 2; ++x)
253365      {
254366         UINT8 x_offset = x + h_scroll;
255367         UINT8 pen = *(src + x_offset);
256368
257         //*dest++ = screen->machine->pens[pen & ramdac.mask];
258         *dest++ = screen->machine->pens[pen];
369         if ( ( videomode & 0x81 ) == 1 || (videomode & 0x80 && pen & 0x80) )
370         {
371            *dest++ = screen->machine->pens[hirescol[pen & 0x0f]];
372            *dest++ = screen->machine->pens[hirescol[(pen >> 4) & 0x0f]];
373         }
374         else
375         {
376            *dest++ = screen->machine->pens[lorescol[pen]];
377            *dest++ = screen->machine->pens[lorescol[pen]];
378         }
259379      }
260380   }
261381
r2241r2242
296416{
297417#define BLITPRG_READ(x)      blitter.x = *(blitter_get_addr(blitter.program.addr++))
298418
419   int cycles_used = 0;
420
421
299422   do
300423   {
301424      UINT8 srcdata = 0;
r2241r2242
315438      BLITPRG_READ(step);
316439      BLITPRG_READ(pattern);
317440
318#ifdef MAME_DEBUG
441#if 0
442      /* This debug is now wrong ! */
319443      if (DEBUG_BLITTER)
320444      {
321445         mame_printf_debug("\nBlitter (%x): Running command from 0x%.5x\n\n", activecpu_get_previouspc(), blitter.program.addr - 12);
r2241r2242
325449            blitter.command & CMD_COLST ? "COLST" : "     ",
326450            blitter.command & CMD_PARRD ? "PARRD" : "     ",
327451            blitter.command & CMD_SRCUP ? "SRCUP" : "     ",
328            blitter.command & CMD_DSTUP ? "DSTUP" : "     ",
329            blitter.command & CMD_SRCEN ? "SRCEN" : "     ",
330            blitter.command & CMD_DSTEN ? "DSTEN" : "     ");
452            blitter.command & CMD_DSTUP ? "DSTUP" : "     ");
331453
332454         mame_printf_debug("Src Address Byte 0  %.2x\n",   blitter.source.addr0);
333455         mame_printf_debug("Src Address Byte 1  %.2x\n",   blitter.source.addr1);
r2241r2242
350472
351473      /* Ignore these writes */
352474      if (blitter.dest.addr == 0)
353      {
354475         return;
355      }
356476
357      /* Dirty hacks for Quizvaders */
358      if ( (blitter.command == 0x01) || (blitter.command == 0x19) )
359      {
360         blitter.command |= CMD_SRCEN;
361      }
362
363477      /* Begin outer loop */
364478      for (;;)
365479      {
366480         UINT8 innercnt = blitter.innercnt;
481         dstdata = blitter.pattern;
367482
368483         if (blitter.command & CMD_LINEDRAW)
369484         {
370            /*
371                    Line Drawing Mode
485            do
486            {
487               if (blitter.modectl & MODE_YFRAC)
488               {
489                  if (blitter.modectl & MODE_SSIGN )
490                     blitter.dest.addr0--;
491                  else
492                     blitter.dest.addr0++;
493               }
494               else
495               {
496                  if (blitter.modectl & MODE_DSIGN )
497                     blitter.dest.addr1--;
498                  else
499                     blitter.dest.addr1++;
500               }
501               if( blitter.source.addr0 < blitter.step )
502               {
372503
373                    x1 - x0
374                    y1 - y0
504                  blitter.source.addr0 -=blitter.step ;
505                  blitter.source.addr0 +=blitter.source.addr1;
375506
376                    d1 = bigger
377                    d2 = smaller
507                  if ( blitter.modectl & MODE_YFRAC )
508                  {
509                     if (blitter.modectl & MODE_DSIGN )
510                        blitter.dest.addr1--;
511                     else
512                        blitter.dest.addr1++;
513                  }
514                  else
515                  {
516                     if (blitter.modectl & MODE_SSIGN )
517                        blitter.dest.addr0--;
518                     else
519                        blitter.dest.addr0++;
520                  }
521               }
522               else
523               {
524                  blitter.source.addr0 -=blitter.step;
525               }
378526
379                    * SRC0 = d1/2
380                    * SRC1 = d1
381                    * Inner Count = d1
382                    * DST0 = X0
383                    * DST1 = Y0
384                    * Source control = LSB of d1
385                    * Step reg = d2
386                */
527               *blitter_get_addr(blitter.dest.addr) = blitter.pattern;
528               cycles_used++;
529
530            } while (--innercnt);
387531         }
388532         else do
389533         {
390         //  UINT32  srcaddr = 0;
391534            UINT8   inhibit = 0;
392535
393536            /* TODO: Set this correctly */
394537            UINT8   result = blitter.pattern;
395538
396            /* Source value is read only once in character mode */
397            if (blitter.modectl & MODE_BITTOBYTE && innercnt == blitter.innercnt)
539            if (LOOPTYPE == 3 && innercnt == blitter.innercnt)
398540            {
399               if (blitter.command & CMD_SRCEN)
400               {
401                  srcdata = *(blitter_get_addr(blitter.source.addr & 0xfffff));
402               }
541               srcdata = *(blitter_get_addr(blitter.source.addr & 0xfffff));
542               blitter.source.loword++;
543               cycles_used++;
403544            }
404545
405546            /* Enable source address read and increment? */
406            if ( !(blitter.modectl & (MODE_BITTOBYTE | MODE_PALREMAP)) )
547            if (!(blitter.modectl & (MODE_BITTOBYTE | MODE_PALREMAP)))
407548            {
408               if (blitter.command & CMD_SRCEN)
549               if (LOOPTYPE == 0 || LOOPTYPE == 1)
409550               {
410551                  srcdata = *(blitter_get_addr(blitter.source.addr & 0xfffff));
552                  cycles_used++;
411553
412                  /* TODO */
413554                  if (blitter.modectl & MODE_SSIGN)
414                     blitter.source.addr = (blitter.source.addr - 1) & 0xfffff;
555                     blitter.source.loword-- ;
415556                  else
416                     blitter.source.addr = (blitter.source.addr + 1) & 0xfffff;
557                     blitter.source.loword++;
417558
418559                  result = srcdata;
419560               }
420561            }
421562
422563            /* Read destination pixel? */
423            if (blitter.command & CMD_DSTEN)
564            if (LOOPTYPE == 0)
424565            {
425566               dstdata = *blitter_get_addr(blitter.dest.addr & 0xfffff);
567               cycles_used++;
426568            }
427569
428570            /* Inhibit depending on the bit selected by the inner count */
r2241r2242
431573            if (blitter.modectl & MODE_BITTOBYTE)
432574            {
433575               inhibit = !(srcdata & (1 << (8 - innercnt)));
576            }
434577
435               if (innercnt == 1)
578            if (blitter.compfunc & CMPFUNC_BEQ)
579            {
580               if (srcdata == blitter.pattern)
436581               {
437                  blitter.source.addr = (blitter.source.addr + 1) & 0xfffff;
582                  inhibit = 1;
583
584                  /* TODO: Resume from inhibit? */
585                  if (blitter.command & CMD_COLST)
586                     return;
438587               }
439588            }
589            if (blitter.compfunc & CMPFUNC_LT)
590            {
591               /* Might be wrong */
592               if ((srcdata & 0xc0) < (dstdata & 0xc0))
593               {
594                  inhibit = 1;
440595
441            if (blitter.compfunc & 0x08)
596                  /* TODO: Resume from inhibit? */
597                  if (blitter.command & CMD_COLST)
598                     return;
599               }
600            }
601            if (blitter.compfunc & CMPFUNC_EQ)
442602            {
443               if (srcdata == blitter.pattern)
603               if ((srcdata & 0xc0) == (dstdata & 0xc0))
444604               {
445605                  inhibit = 1;
446606
r2241r2242
449609                     return;
450610               }
451611            }
612            if (blitter.compfunc & CMPFUNC_GT)
613            {
614               /* Might be wrong */
615               if ((srcdata & 0xc0) > (dstdata & 0xc0))
616               {
617                  inhibit = 1;
452618
619                  /* TODO: Resume from inhibit? */
620                  if (blitter.command & CMD_COLST)
621                     return;
622               }
623            }
624
453625            /* Write the data if not inhibited */
454626            if (!inhibit)
455627            {
r2241r2242
464636                  UINT8 newcol = *(blitter_get_addr((blitter.source.addr + dest) & 0xfffff));
465637
466638                  *blitter_get_addr(blitter.dest.addr) = newcol;
639                  cycles_used += 3;
467640               }
468641               else
469642               {
470                  *blitter_get_addr(blitter.dest.addr) = result;
643                  UINT8 final_result = 0;
644
645                  if (blitter.compfunc & CMPFUNC_LOG3)
646                     final_result |= result & dstdata;
647
648                  if (blitter.compfunc & CMPFUNC_LOG2)
649                     final_result |= result & ~dstdata;
650
651                  if (blitter.compfunc & CMPFUNC_LOG1)
652                     final_result |= ~result & dstdata;
653
654                  if (blitter.compfunc & CMPFUNC_LOG0)
655                     final_result |= ~result & ~dstdata;
656
657                  *blitter_get_addr(blitter.dest.addr) = final_result;
658                  cycles_used++;
471659               }
472660            }
473661
474662            /* Update destination address */
475            blitter.dest.addr = (blitter.dest.addr + 1) & 0xfffff;
663            if (blitter.modectl & MODE_DSIGN)
664               blitter.dest.loword--;
665            else
666               blitter.dest.loword++;
667
476668         } while (--innercnt);
477669
478670         if (!--blitter.outercnt)
r2241r2242
482674         else
483675         {
484676            if (blitter.command & CMD_DSTUP)
485            {
486               blitter.dest.addr = (blitter.dest.addr + blitter.step) & 0xfffff;
487            }
677               blitter.dest.loword += blitter.step;
488678
489679            if (blitter.command & CMD_SRCUP)
490            {
491               blitter.source.addr = (blitter.source.addr + blitter.step) & 0xfffff;
492            }
680               blitter.source.loword += blitter.step;
493681
494682            if (blitter.command & CMD_PARRD)
495683            {
r2241r2242
504692      BLITPRG_READ(command);
505693
506694   } while (blitter.command  & CMD_RUN);
695
696   /* Burn Z80 cycles while blitter is in operation */
697   cpu_spinuntil_time( ATTOTIME_IN_NSEC( (1000000000 / Z80_XTAL)*cycles_used * 2 ) );
507698}
508699
509700
r2241r2242
550741
551742static WRITE8_HANDLER( ramdac_w )
552743{
744
553745   switch (offset & 3)
554746   {
555747      case 0:
r2241r2242
592784
593785    06  Interrupt status....................................WR
594786    07  Interrupt ack.......................................WR
787        Writing here sets the line number that vertical interrupt is generated at.
788        cmd1, bit2 is the 9th bit of the line number
595789        ???? Written with 0x21
596    08
597    09  ???? Linked with c001...............................W
790    08  cmd1                                                WR * bit 6 = screen select
791        bit2 = 9th bit of vertical interrupt line number
792        bit6 = 1 = select screen 1 else screen 0
793    09  cmd2 Linked with c001...............................W * bit 0 = 1 = hires
794        bit0=1=hi res else lo res (as long as bit7 is 0)
795        bit5=mask msb of each pixel
796        bit6=mask 2 msbits of each lores pixel
797        bit7=1=variable resolution - resolution is set by bit 7 of each vram byte.  bit7=1=2 hires pixels
598798    0A  ???? Written with 0 and 1...........................W
799        color of border
599800
600801    0B  Horizontal frame buffer scroll .....................W
601802    0C  Vertical frame buffer scroll .......................W
602803
603    0D  ???? Written with $FF...............................W
604    0E  ???? Written with $A2 (162).........................W
605    0F  ???? Written with $B4 (180).........................W
804    0D  Colour hold colour..................................W
805    0E  Palette value for hi-res magenta....................W
806    0F  Palette value for hi-res yellow?....................W
606807    14  ....................................................W
607808
608809    18  Blitter program low byte............................WR
r2241r2242
685886      case 0x03:
686887      {
687888         if (data > 0x3f)
688         {
689889            popmessage("%x: Unusual bank access (%x)\n", activecpu_get_previouspc(), data);
690         }
890
691891         data &= 0x3f;
692892         bank[offset] = data;
693893         z80_bank(offset, data);
694894         break;
695895      }
896
696897      case 0x08:
697898      {
698899         flip_8 = data;
699900         break;
700901      }
902      case 9:
903         videomode = data;
904         break;
905
701906      case 0x0B:
702907      {
703908         h_scroll = data;
r2241r2242
708913         v_scroll = data;
709914         break;
710915      }
916      case 0x0E:
917      {
918         col4bit[5] = data;
919         col3bit[5] = data;
920         col3bit[5 + 8] = data;
921         break;
922      }
923      case 0x0f:
924      {
925         col4bit[6] = data;
926         col3bit[6] = data;
927         col3bit[6 + 8] = data;
928         break;
929      }
711930      case 0x18:
712931      {
713932         blitter.program.addr0 = data;
r2241r2242
730949         if (data & CMD_RUN)
731950            RunBlit();
732951         else
733            mame_printf_debug ("Blitter stopped by IO.\n");
952            mame_printf_debug("Blitter stopped by IO.\n");
734953
735954         break;
736955      }
r2241r2242
9041123            {
9051124               fdc.byte_pos = 0;
9061125
907               if(fdc.sector == fdc.stop_track || ++fdc.sector == 11)
1126               if (fdc.sector == fdc.stop_track || ++fdc.sector == 11)
9081127               {
9091128                  /* End of read operation */
9101129                  fdc.MSR = 0xd0;
r2241r2242
10311250      //mame_printf_debug(" %x\n",data);
10321251   }
10331252
1034   if(fdc.cmd_cnt == fdc.cmd_len)
1253   if (fdc.cmd_cnt == fdc.cmd_len)
10351254   {
10361255      fdc.phase = fdc.next_phase;
10371256      fdc.cmd_cnt = 0;
r2241r2242
10691288
10701289static MACHINE_RESET( bfcobra )
10711290{
1291   unsigned int pal;
1292
1293   for (pal = 0; pal < 256; ++pal)
1294   {
1295      palette_set_color_rgb(Machine, pal, pal3bit((pal>>5)&7), pal3bit((pal>>2)&7), pal2bit(pal&3));
1296   }
1297
10721298   bank[0] = 1;
10731299   memset(&ramdac, 0, sizeof(ramdac));
10741300   reset_fdc();
r2241r2242
11491375        When a meter is triggered, the current drawn is sensed. If a meter
11501376        is connected, the /FIRQ line will be pulsed.
11511377    */
1152
1153   for (i = 0; i<8; i++)
1378   for (i = 0; i < 8; i++)
11541379    {
1155      if ( changed & (1 << i) )
1380      if (changed & (1 << i))
11561381      {
11571382         Mechmtr_update(i, cycles, data & (1 << i) );
11581383         cpunum_set_input_line(Machine, 1, M6809_FIRQ_LINE, PULSE_LINE );
r2241r2242
12471472   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
12481473
12491474   PORT_START_TAG("STROBE1")
1250   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("PASS") PORT_CODE(KEYCODE_A)
1251   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("CONTINUE") PORT_CODE(KEYCODE_S)
1252   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("COLLECT") PORT_CODE(KEYCODE_D)
1253   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("START")
1254   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("BONUS") PORT_CODE(KEYCODE_F)
1475   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Pass") PORT_CODE(KEYCODE_A)
1476   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Continue") PORT_CODE(KEYCODE_S)
1477   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Collect") PORT_CODE(KEYCODE_D)
1478   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Start")
1479   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Bonus") PORT_CODE(KEYCODE_F)
12551480//  PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 )
12561481//  PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 )
12571482//  PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 )
r2241r2242
15091734
15101735   /* TODO */
15111736   MDRV_SCREEN_ADD("main", RASTER)
1512   MDRV_SCREEN_REFRESH_RATE(60)
1737   MDRV_SCREEN_REFRESH_RATE(50)
15131738   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
15141739   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
1515   MDRV_SCREEN_SIZE(256, 256)
1516   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
1740   MDRV_SCREEN_SIZE(512, 256)
1741   MDRV_SCREEN_VISIBLE_AREA(0, 512 - 1, 0, 256 - 1)
15171742   MDRV_PALETTE_LENGTH(256)
15181743
15191744   MDRV_SPEAKER_STANDARD_MONO("mono")
r2241r2242
15781803   ROM_LOAD( "95000173.bin", 0x10000, 0x10000, CRC(8bda2c5e) SHA1(79aab5a2af7a5add5fe9132dc13bcc3705c6faf3) )
15791804ROM_END
15801805
1806ROM_START( beeline )
1807   ROM_REGION( 0x10000, REGION_CPU2, 0 )
1808   ROM_LOAD( "bln12int.a", 0x08000, 0x08000, CRC(cb97905e) SHA1(9725156bf64e53a56bc0f90795d4b07db41d059e) )
1809
1810   ROM_REGION( 0x20000, REGION_USER1, 0 )
1811   ROM_LOAD( "blncob.pa", 0x00000, 0x10000, CRC(8abc0017) SHA1(ecf6e7a4021b35295eb9bb9aed1b88fff27ffbd1) )
1812   ROM_LOAD( "blncob.pb", 0x10000, 0x10000, CRC(feb121fe) SHA1(e83bfd6db00a3264e5076f257e261a1cb4605a83) )
1813
1814   ROM_REGION( 0x1c2000, REGION_USER2, 0 )
1815   ROM_LOAD( "beedisk.img", 0x000000, 0x1c2000, NO_DUMP )
1816ROM_END
1817
15811818ROM_START( quizvadr )
15821819   ROM_REGION( 0x10000, REGION_CPU2, 0 )
15831820   ROM_LOAD( "q6809.bin", 0x08000, 0x8000, CRC(a74dff10) SHA1(87578694a022dc3d7ade9cc76d387c1ae5fc74d9) )
r2241r2242
16391876ROM_END
16401877
16411878GAME( 1989, inquiztr, 0,   bfcobra, bfcobra, bfcobra, ROT0, "BFM", "Inquizitor",                       GAME_NOT_WORKING )
1642GAME( 1990, escounts, 0,   bfcobra, bfcobra, bfcobra, ROT0, "BFM", "Every Second Counts (39-360-053)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS )
1879GAME( 1990, escounts, 0,   bfcobra, bfcobra, bfcobra, ROT0, "BFM", "Every Second Counts (39-360-053)", GAME_IMPERFECT_GRAPHICS )
16431880GAME( 1991, trebltop, 0,   bfcobra, bfcobra, bfcobra, ROT0, "BFM", "Treble Top (39-360-070)",          GAME_IMPERFECT_GRAPHICS )
1881GAME( 1991, beeline,  0,   bfcobra, bfcobra, bfcobra, ROT0, "BFM", "Beeline (39-360-075)",             GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS )
16441882GAME( 1991, quizvadr, 0,   bfcobra, bfcobra, bfcobra, ROT0, "BFM", "Quizvaders (39-360-078)",          GAME_IMPERFECT_GRAPHICS )
16451883GAME( 1992, qos,      0,   bfcobra, bfcobra, bfcobra, ROT0, "BFM", "A Question of Sport (39-960-107)", GAME_IMPERFECT_GRAPHICS )
16461884GAME( 1992, qosa,     qos, bfcobra, bfcobra, bfcobra, ROT0, "BFM", "A Question of Sport (39-960-099)", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/targeth.c
r2241r2242
7575{
7676   UINT8 *RAM = memory_region(REGION_SOUND1);
7777
78   if (ACCESSING_LSB){
78   if (ACCESSING_BITS_0_7){
7979      memcpy(&RAM[0x30000], &RAM[0x40000 + (data & 0x0f)*0x10000], 0x10000);
8080   }
8181}
src/mame/drivers/rainbow.c
r2241r2242
265265
266266static WRITE16_HANDLER( jumping_sound_w )
267267{
268   if (ACCESSING_LSB)
268   if (ACCESSING_BITS_0_7)
269269   {
270270      jumping_latch = data & 0xff; /*M68000 writes .b to $400007*/
271271      cpunum_set_input_line(Machine, 1,0,HOLD_LINE);
src/mame/drivers/galspnbl.c
r2241r2242
3636
3737static WRITE16_HANDLER( soundcommand_w )
3838{
39   if (ACCESSING_LSB)
39   if (ACCESSING_BITS_0_7)
4040   {
4141      soundlatch_w(machine,offset,data & 0xff);
4242      cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
src/mame/drivers/dynduke.c
r2241r2242
8484/* Input Ports */
8585
8686static INPUT_PORTS_START( dynduke )
87   SEIBU_COIN_INPUTS   // Must be port 0: coin inputs read through sound cpu
87   SEIBU_COIN_INPUTS   /* coin inputs read through sound cpu */
8888
8989   PORT_START_TAG("IN0")
9090   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY PORT_PLAYER(1)
src/mame/drivers/rungun.c
r2241r2242
123123      break;
124124
125125      case 0x06/2:
126         if (ACCESSING_LSB)
126         if (ACCESSING_BITS_0_7)
127127         {
128128            data = readinputport(1) | EEPROM_read_bit();
129129
r2241r2242
155155                bit7  : set before massive memory writes
156156                bit10 : IRQ5 ACK
157157            */
158         if (ACCESSING_LSB)
158         if (ACCESSING_BITS_0_7)
159159         {
160160            EEPROM_write_bit((data & 0x01) ? 1 : 0);
161161            EEPROM_set_cs_line((data & 0x02) ? CLEAR_LINE : ASSERT_LINE);
r2241r2242
180180
181181static WRITE16_HANDLER( sound_cmd1_w )
182182{
183   if (ACCESSING_MSB)
183   if (ACCESSING_BITS_8_15)
184184      soundlatch_w(machine, 0, data>>8);
185185}
186186
187187static WRITE16_HANDLER( sound_cmd2_w )
188188{
189   if (ACCESSING_MSB)
189   if (ACCESSING_BITS_8_15)
190190      soundlatch2_w(machine, 0, data>>8);
191191}
192192
193193static WRITE16_HANDLER( sound_irq_w )
194194{
195   if (ACCESSING_MSB)
195   if (ACCESSING_BITS_8_15)
196196      cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
197197}
198198
199199static READ16_HANDLER( sound_status_msb_r )
200200{
201   if (ACCESSING_MSB)
201   if (ACCESSING_BITS_8_15)
202202      return(rng_sound_status<<8);
203203
204204   return(0);
src/mame/drivers/madmotor.c
r2241r2242
4141
4242static WRITE16_HANDLER( madmotor_sound_w )
4343{
44   if (ACCESSING_LSB)
44   if (ACCESSING_BITS_0_7)
4545   {
4646      soundlatch_w(machine,0,data & 0xff);
4747      cpunum_set_input_line(machine, 1,0,HOLD_LINE);
src/mame/drivers/eprom.c
r2241r2242
119119static WRITE16_HANDLER( eprom_latch_w )
120120{
121121   /* reset extra CPU */
122   if (ACCESSING_LSB)
122   if (ACCESSING_BITS_0_7)
123123   {
124124      if (data & 1)
125125         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
src/mame/drivers/aerofgt.c
r2241r2242
105105
106106static WRITE16_HANDLER( sound_command_w )
107107{
108   if (ACCESSING_LSB)
108   if (ACCESSING_BITS_0_7)
109109   {
110110      pending_command = 1;
111111      soundlatch_w(machine,offset,data & 0xff);
r2241r2242
115115
116116static WRITE16_HANDLER( turbofrc_sound_command_w )
117117{
118   if (ACCESSING_MSB)
118   if (ACCESSING_BITS_8_15)
119119   {
120120      pending_command = 1;
121121      soundlatch_w(machine,offset,(data >> 8) & 0xff);
r2241r2242
349349   AM_RANGE(0x0fe400, 0x0fe401) AM_WRITENOP
350350   AM_RANGE(0x0fe402, 0x0fe403) AM_WRITENOP
351351   AM_RANGE(0x0ff000, 0x0fffff) AM_RAM AM_BASE(&aerofgt_rasterram)   /* used only for the scroll registers */
352   AM_RANGE(0x10b800, 0x10bfff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
352   AM_RANGE(0x108000, 0x10bfff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
353353ADDRESS_MAP_END
354354
355355static ADDRESS_MAP_START( wbbc97_map, ADDRESS_SPACE_PROGRAM, 16 )
src/mame/drivers/expro02.c
r2241r2242
228228
229229static WRITE16_HANDLER( galsnew_6295_bankswitch_w )
230230{
231   if (ACCESSING_MSB)
231   if (ACCESSING_BITS_8_15)
232232   {
233233      UINT8 *rom = memory_region(REGION_SOUND1);
234234      memcpy(&rom[0x30000],&rom[0x40000 + ((data >> 8) & 0x0f) * 0x10000],0x10000);
src/mame/drivers/ultrsprt.c
r2241r2242
5151{
5252   UINT32 r = 0;
5353
54   if (!(mem_mask & 0xff000000))
54   if (ACCESSING_BITS_24_31)
5555      r |= (((EEPROM_read_bit()) << 1) | (readinputport(6) << 3)) << 24;
5656
5757   return r;
r2241r2242
5959
6060static WRITE32_HANDLER( eeprom_w )
6161{
62   if (!(mem_mask & 0xff000000))
62   if (ACCESSING_BITS_24_31)
6363   {
6464      EEPROM_write_bit((data & 0x01000000) ? 1 : 0);
6565      EEPROM_set_clock_line((data & 0x02000000) ? CLEAR_LINE : ASSERT_LINE);
r2241r2242
107107   UINT16 r = 0;
108108   int reg = offset * 2;
109109
110   if (ACCESSING_MSB16)
110   if (ACCESSING_BITS_8_15)
111111      r |= K054539_0_r(machine, reg+0) << 8;
112112
113   if (ACCESSING_LSB16)
113   if (ACCESSING_BITS_0_7)
114114      r |= K054539_0_r(machine, reg+1) << 0;
115115
116116   return r;
r2241r2242
120120{
121121   int reg = offset * 2;
122122
123   if (ACCESSING_MSB16)
123   if (ACCESSING_BITS_8_15)
124124      K054539_0_w(machine, reg+0, (data >> 8) & 0xff);
125125
126   if (ACCESSING_LSB16)
126   if (ACCESSING_BITS_0_7)
127127      K054539_0_w(machine, reg+1, (data >> 0) & 0xff);
128128}
129129
r2241r2242
131131{
132132   UINT16 r = 0;
133133
134   if (!(mem_mask & 0xff00))
134   if (ACCESSING_BITS_8_15)
135135      r |= K056800_sound_r(machine, (offset*2)+0, 0xffff) << 8;
136136
137   if (!(mem_mask & 0x00ff))
137   if (ACCESSING_BITS_0_7)
138138      r |= K056800_sound_r(machine, (offset*2)+1, 0xffff) << 0;
139139
140140   return r;
r2241r2242
142142
143143static WRITE16_HANDLER( K056800_68k_w )
144144{
145   if (!(mem_mask & 0xff00))
145   if (ACCESSING_BITS_8_15)
146146      K056800_sound_w(machine, (offset*2)+0, (data >> 8) & 0xff, 0xffff);
147147
148   if (!(mem_mask & 0x00ff))
148   if (ACCESSING_BITS_0_7)
149149      K056800_sound_w(machine, (offset*2)+1, (data >> 0) & 0xff, 0xffff);
150150}
151151
src/mame/drivers/rampart.c
r2241r2242
9191
9292static WRITE16_HANDLER( adpcm_w )
9393{
94   if (ACCESSING_MSB)
94   if (ACCESSING_BITS_8_15)
9595      OKIM6295_data_0_w(machine, offset, (data >> 8) & 0xff);
9696}
9797
r2241r2242
105105
106106static WRITE16_HANDLER( ym2413_w )
107107{
108   if (ACCESSING_MSB)
108   if (ACCESSING_BITS_8_15)
109109   {
110110      if (offset & 1)
111111         YM2413_data_port_0_w(machine, 0, (data >> 8) & 0xff);
r2241r2242
141141    */
142142
143143   /* upper byte being modified? */
144   if (ACCESSING_MSB)
144   if (ACCESSING_BITS_8_15)
145145   {
146146      if (data & 0x1000)
147147         logerror("Color bank set to 1!\n");
r2241r2242
150150   }
151151
152152   /* lower byte being modified? */
153   if (ACCESSING_LSB)
153   if (ACCESSING_BITS_0_7)
154154   {
155155      atarigen_set_oki6295_vol(machine, (data & 0x0020) ? 100 : 0);
156156      if (!(data & 0x0010))
src/mame/drivers/snowbros.c
r2241r2242
7575
7676static WRITE16_HANDLER( snowbros_flipscreen_w )
7777{
78   if (ACCESSING_MSB)
78   if (ACCESSING_BITS_8_15)
7979      flip_screen_set(~data & 0x8000);
8080}
8181
r2241r2242
145145
146146static WRITE16_HANDLER( snowbros_68000_sound_w )
147147{
148   if (ACCESSING_LSB)
148   if (ACCESSING_BITS_0_7)
149149   {
150150      soundlatch_w(machine,offset,data & 0xff);
151151      cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
r2241r2242
154154
155155static WRITE16_HANDLER( semicom_soundcmd_w )
156156{
157   if (ACCESSING_LSB) soundlatch_w(machine,0,data & 0xff);
157   if (ACCESSING_BITS_0_7) soundlatch_w(machine,0,data & 0xff);
158158}
159159
160160
r2241r2242
287287
288288static WRITE16_HANDLER( twinadv_68000_sound_w )
289289{
290   if (ACCESSING_LSB)
290   if (ACCESSING_BITS_0_7)
291291   {
292292      soundlatch_w(machine,offset,data & 0xff);
293293      cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
src/mame/drivers/segaxbd.c
r2241r2242
329329   UINT8 oldval;
330330
331331   /* access is via the low 8 bits */
332   if (!ACCESSING_LSB)
332   if (!ACCESSING_BITS_0_7)
333333      return;
334334
335335   data &= 0xff;
r2241r2242
402402static WRITE16_HANDLER( iochip_1_w )
403403{
404404   /* access is via the low 8 bits */
405   if (!ACCESSING_LSB)
405   if (!ACCESSING_BITS_0_7)
406406      return;
407407
408408   data &= 0xff;
r2241r2242
417417
418418static WRITE16_HANDLER( iocontrol_w )
419419{
420   if (ACCESSING_LSB)
420   if (ACCESSING_BITS_0_7)
421421   {
422422      logerror("I/O chip force input = %d\n", data & 1);
423423      /* Racing Hero and ABCop set this and fouls up their output ports */
r2241r2242
436436static WRITE16_HANDLER( aburner2_iochip_0_D_w )
437437{
438438   /* access is via the low 8 bits */
439   if (!ACCESSING_LSB)
439   if (!ACCESSING_BITS_0_7)
440440      return;
441441
442442   iochip_regs[0][3] = data;
src/mame/drivers/nbmj9195.c
r2241r2242
173173{
174174   int portdata;
175175
176   if ((!strcmp(Machine->gamedrv->name, "mscoutm")) ||
177      (!strcmp(Machine->gamedrv->name, "imekura")) ||
178      (!strcmp(Machine->gamedrv->name, "mjegolf")))
176   if ((!strcmp(machine->gamedrv->name, "mscoutm")) ||
177      (!strcmp(machine->gamedrv->name, "imekura")) ||
178      (!strcmp(machine->gamedrv->name, "mjegolf")))
179179   {
180180
181181      switch (offset)
r2241r2242
352352
353353static void tmpz84c011_pio_w(running_machine *machine, int offset, int data)
354354{
355   if ((!strcmp(Machine->gamedrv->name, "imekura")) ||
356      (!strcmp(Machine->gamedrv->name, "mscoutm")) ||
357      (!strcmp(Machine->gamedrv->name, "mjegolf")))
355   if ((!strcmp(machine->gamedrv->name, "imekura")) ||
356      (!strcmp(machine->gamedrv->name, "mscoutm")) ||
357      (!strcmp(machine->gamedrv->name, "mjegolf")))
358358      {
359359
360360      switch (offset)
src/mame/drivers/sslam.c
r2241r2242
320320
321321static WRITE16_HANDLER( sslam_snd_w )
322322{
323   if (ACCESSING_LSB)
323   if (ACCESSING_BITS_0_7)
324324   {
325325      logerror("PC:%06x Writing %04x to Sound CPU\n",activecpu_get_previouspc(),data);
326326      if (data >= 0x40) {
src/mame/drivers/deadang.c
r2241r2242
9292/* Input Ports */
9393
9494static INPUT_PORTS_START( deadang )
95   SEIBU_COIN_INPUTS   /* Must be port 0: coin inputs read through sound cpu */
95   SEIBU_COIN_INPUTS   /* coin inputs read through sound cpu */
9696
9797   PORT_START   /* IN0 */
9898   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r2241r2242
130130   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
131131   PORT_DIPSETTING(    0x0040, DEF_STR( Off ) )
132132   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
133   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Cabinet) )
133   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Cabinet ) )
134134   PORT_DIPSETTING(    0x0080, DEF_STR( Upright ) )
135135   PORT_DIPSETTING(    0x0000, DEF_STR( Cocktail ) )
136136   /* Dip switch B */
r2241r2242
158158INPUT_PORTS_END
159159
160160static INPUT_PORTS_START( ghunter )
161   SEIBU_COIN_INPUTS   /* Must be port 0: coin inputs read through sound cpu */
161   SEIBU_COIN_INPUTS   /* coin inputs read through sound cpu */
162162
163163   PORT_START   /* IN0 */
164164   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r2241r2242
196196   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
197197   PORT_DIPSETTING(    0x0040, DEF_STR( Off ) )
198198   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
199   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Cabinet) )
199   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Cabinet ) )
200200   PORT_DIPSETTING(    0x0080, DEF_STR( Upright ) )
201201   PORT_DIPSETTING(    0x0000, DEF_STR( Cocktail ) )
202202   /* Dip switch B */
src/mame/drivers/galpani2.c
r2241r2242
4444static WRITE16_HANDLER(galpani2_eeprom_w)
4545{
4646   COMBINE_DATA( &eeprom_word );
47   if ( ACCESSING_LSB )
47   if ( ACCESSING_BITS_0_7 )
4848   {
4949      // latch the bit
5050      EEPROM_write_bit(data & 0x02);
r2241r2242
186186
187187static WRITE16_HANDLER( galpani2_coin_lockout_w )
188188{
189   if (ACCESSING_MSB)
189   if (ACCESSING_BITS_8_15)
190190   {
191191      coin_counter_w(0, data & 0x0100);
192192      coin_counter_w(1, data & 0x0200);
r2241r2242
200200
201201static WRITE16_HANDLER( galpani2_oki_0_bank_w )
202202{
203   if (ACCESSING_LSB)
203   if (ACCESSING_BITS_0_7)
204204   {
205205      UINT8 *ROM = memory_region(REGION_SOUND1);
206206      logerror("CPU #0 PC %06X : OKI 0 bank %08X\n",activecpu_get_pc(),data);
r2241r2242
210210
211211static WRITE16_HANDLER( galpani2_oki_1_bank_w )
212212{
213   if (ACCESSING_LSB)
213   if (ACCESSING_BITS_0_7)
214214   {
215215      OKIM6295_set_bank_base(1, 0x40000 * (data & 0xf) );
216216      logerror("CPU #0 PC %06X : OKI 1 bank %08X\n",activecpu_get_pc(),data);
src/mame/drivers/hornet.c
r2241r2242
593593   UINT32 r = 0;
594594   if (offset == 0)
595595   {
596      if (!(mem_mask & 0xff000000))
596      if (ACCESSING_BITS_24_31)
597597      {
598598         //printf("read sysreg 0\n");
599599         r |= readinputport(0) << 24;
600600      }
601      if (!(mem_mask & 0x00ff0000))
601      if (ACCESSING_BITS_16_23)
602602      {
603603         r |= readinputport(1) << 16;
604604      }
605      if (!(mem_mask & 0x0000ff00))
605      if (ACCESSING_BITS_8_15)
606606      {
607607         r |= readinputport(2) << 8;
608608      }
609      if (!(mem_mask & 0x000000ff))
609      if (ACCESSING_BITS_0_7)
610610      {
611611         r |= 0xf7;
612612      }
613613   }
614614   else if (offset == 1)
615615   {
616      if (!(mem_mask & 0xff000000))
616      if (ACCESSING_BITS_24_31)
617617      {
618618         r |= readinputport(3) << 24;
619619      }
r2241r2242
624624static WRITE32_HANDLER( sysreg_w )
625625{
626626   if( offset == 0 ) {
627      if (!(mem_mask & 0xff000000))
627      if (ACCESSING_BITS_24_31)
628628      {
629629         led_reg0 = (data >> 24) & 0xff;
630630      }
631      if (!(mem_mask & 0x00ff0000))
631      if (ACCESSING_BITS_16_23)
632632      {
633633         led_reg1 = (data >> 16) & 0xff;
634634      }
r2241r2242
636636   }
637637   if( offset == 1 )
638638   {
639      if (!(mem_mask & 0xff000000))
639      if (ACCESSING_BITS_24_31)
640640      {
641641      }
642      if (!(mem_mask & 0x000000ff))
642      if (ACCESSING_BITS_0_7)
643643      {
644644         if (data & 0x80)   /* CG Board 1 IRQ Ack */
645645         {
src/mame/drivers/exterm.c
r2241r2242
187187   /* All the outputs are activated on the rising edge */
188188   static UINT16 last = 0;
189189
190   if (ACCESSING_LSB)
190   if (ACCESSING_BITS_0_7)
191191   {
192192      /* Bit 0-1= Resets analog controls */
193193      if ((data & 0x0001) && !(last & 0x0001))
r2241r2242
196196         aimpos[1] = 0;
197197   }
198198
199   if (ACCESSING_MSB)
199   if (ACCESSING_BITS_8_15)
200200   {
201201      /* Bit 13 = Resets the slave CPU */
202202      if ((data & 0x2000) && !(last & 0x2000))
r2241r2242
222222
223223static WRITE16_HANDLER( sound_latch_w )
224224{
225   if (ACCESSING_LSB)
225   if (ACCESSING_BITS_0_7)
226226      timer_call_after_resynch(NULL, data & 0xff, sound_delayed_w);
227227}
228228
src/mame/drivers/mediagx.c
r2241r2242
6666#include "driver.h"
6767#include "deprecat.h"
6868#include "memconv.h"
69#include "devconv.h"
6970#include "machine/8237dma.h"
7071#include "machine/pic8259.h"
7172#include "machine/pit8253.h"
r2241r2242
465466{
466467   UINT32 r = 0;
467468   // 0x20 - 0x21, PIC
468   if ((mem_mask & 0x0000ffff) != 0xffff)
469   if (ACCESSING_BITS_0_15)
469470   {
470471      r |= pic8259_32le_0_r(machine, offset, mem_mask);
471472   }
472473
473474   // 0x22, 0x23, Cyrix configuration registers
474   if (!(mem_mask & 0x00ff0000))
475   if (ACCESSING_BITS_16_23)
475476   {
476477
477478   }
478   if (!(mem_mask & 0xff000000))
479   if (ACCESSING_BITS_24_31)
479480   {
480481      r |= mediagx_config_reg_r() << 24;
481482   }
r2241r2242
485486static WRITE32_HANDLER( io20_w )
486487{
487488   // 0x20 - 0x21, PIC
488   if ((mem_mask & 0x0000ffff) != 0xffff)
489   if (ACCESSING_BITS_0_15)
489490   {
490491      pic8259_32le_0_w(machine, offset, data, mem_mask);
491492   }
492493
493494   // 0x22, 0x23, Cyrix configuration registers
494   if (!(mem_mask & 0x00ff0000))
495   if (ACCESSING_BITS_16_23)
495496   {
496497      mediagx_config_reg_sel = (data >> 16) & 0xff;
497498   }
498   if (!(mem_mask & 0xff000000))
499   if (ACCESSING_BITS_24_31)
499500   {
500501      mediagx_config_reg_w((data >> 24) & 0xff);
501502   }
r2241r2242
505506{
506507   UINT32 r = 0;
507508
508   if (!(mem_mask & 0x0000ff00))
509   if (ACCESSING_BITS_8_15)
509510   {
510511      UINT8 nibble = parallel_latched;//(readinputport(parallel_pointer / 3) >> (4 * (parallel_pointer % 3))) & 15;
511512      r |= ((~nibble & 0x08) << 12) | ((nibble & 0x07) << 11);
r2241r2242
525526
526527        //r |= control_read << 8;*/
527528   }
528   if (!(mem_mask & 0x00ff0000))
529   if (ACCESSING_BITS_16_23)
529530   {
530531      r |= parport & 0xff0000;
531532   }
r2241r2242
537538{
538539   COMBINE_DATA( &parport );
539540
540   if (!(mem_mask & 0x000000ff))
541   if (ACCESSING_BITS_0_7)
541542   {
542543      /*
543544            Controls:
r2241r2242
698699{
699700   if (offset == 0)
700701   {
701      if (!(mem_mask & 0xffff0000))
702      if (ACCESSING_BITS_16_31)
702703      {
703704         UINT16 ldata = (data >> 16) & 0xffff;
704705         dacl[dacl_ptr++] = ldata;
705706      }
706      if (!(mem_mask & 0x0000ffff))
707      if (ACCESSING_BITS_0_15)
707708      {
708709         UINT16 rdata = data & 0xffff;
709710         dacr[dacr_ptr++] = rdata;
r2241r2242
718719   }
719720}
720721
722DEV_READWRITE8TO32LE( mediagx_pit8254_32le, pit8253_r, pit8253_w )
723
724
721725/*****************************************************************************/
722726
723727static ADDRESS_MAP_START( mediagx_map, ADDRESS_SPACE_PROGRAM, 32 )
r2241r2242
736740static ADDRESS_MAP_START(mediagx_io, ADDRESS_SPACE_IO, 32)
737741   AM_RANGE(0x0000, 0x001f) AM_READWRITE(dma8237_32le_0_r,         dma8237_32le_0_w)
738742   AM_RANGE(0x0020, 0x0023) AM_READWRITE(io20_r, io20_w)
739   AM_RANGE(0x0040, 0x005f) AM_READWRITE(pit8253_32le_0_r,         pit8253_32le_0_w)
743   AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE(PIT8254, "pit8254", mediagx_pit8254_32le_r, mediagx_pit8254_32le_w)
740744   AM_RANGE(0x0060, 0x006f) AM_READWRITE(kbdc8042_32le_r,         kbdc8042_32le_w)
741745   AM_RANGE(0x0070, 0x007f) AM_READWRITE(mc146818_port32le_r,      mc146818_port32le_w)
742746   AM_RANGE(0x0080, 0x009f) AM_READWRITE(at_page32_r,            at_page32_w)
r2241r2242
860864   ide_controller_reset(0);
861865}
862866
867static PIT8253_OUTPUT_CHANGED( pc_timer0_w )
868{
869   pic8259_set_irq_line(0, 0, state);
870}
871
872
873static const struct pit8253_config mediagx_pit8254_config =
874{
875   {
876      {
877         4772720/4,            /* heartbeat IRQ */
878         pc_timer0_w,
879         NULL
880      }, {
881         4772720/4,            /* dram refresh */
882         NULL,
883         NULL
884      }, {
885         4772720/4,            /* pio port c pin 4, and speaker polling enough */
886         NULL,
887         NULL
888      }
889   }
890};
891
892
863893static MACHINE_DRIVER_START(mediagx)
864894
865895   /* basic machine hardware */
r2241r2242
869899
870900   MDRV_MACHINE_RESET(mediagx)
871901
902   MDRV_DEVICE_ADD( "pit8254", PIT8254 )
903   MDRV_DEVICE_CONFIG( mediagx_pit8254_config )
904
872905   MDRV_NVRAM_HANDLER( mc146818 )
873906
874907    /* video hardware */
r2241r2242
927960
928961static void init_mediagx(running_machine *machine)
929962{
930   init_pc_common(PCCOMMON_KEYBOARD_AT | PCCOMMON_DMA8237_AT | PCCOMMON_TIMER_8254);
963   init_pc_common(PCCOMMON_KEYBOARD_AT | PCCOMMON_DMA8237_AT);
931964   mc146818_init(MC146818_STANDARD);
932965
933966   pci_init();
src/mame/drivers/policetr.c
r2241r2242
178178   COMBINE_DATA(&control_data);
179179
180180   /* handle EEPROM I/O */
181   if (!(mem_mask & 0x00ff0000))
181   if (ACCESSING_BITS_16_23)
182182   {
183183      EEPROM_write_bit(data & 0x00800000);
184184      EEPROM_set_cs_line((data & 0x00200000) ? CLEAR_LINE : ASSERT_LINE);
src/mame/drivers/seibuspi.c
r2241r2242
824824
825825static WRITE32_HANDLER( sound_fifo_w )
826826{
827   if( (mem_mask & 0xff) == 0 ) {
827   if( ACCESSING_BITS_0_7 ) {
828828      z80_fifoin_push(data & 0xff);
829829   }
830830}
r2241r2242
852852
853853static WRITE32_HANDLER( ds2404_reset_w )
854854{
855   if( ACCESSING_LSB32 ) {
855   if( ACCESSING_BITS_0_7 ) {
856856      DS2404_1W_reset_w(machine, offset, data);
857857   }
858858}
859859
860860static READ32_HANDLER( ds2404_data_r )
861861{
862   if( ACCESSING_LSB32 ) {
862   if( ACCESSING_BITS_0_7 ) {
863863      return DS2404_data_r(machine, offset);
864864   }
865865   return 0;
r2241r2242
867867
868868static WRITE32_HANDLER( ds2404_data_w )
869869{
870   if( ACCESSING_LSB32 ) {
870   if( ACCESSING_BITS_0_7 ) {
871871      DS2404_data_w(machine, offset, data);
872872   }
873873}
874874
875875static WRITE32_HANDLER( ds2404_clk_w )
876876{
877   if( ACCESSING_LSB32 ) {
877   if( ACCESSING_BITS_0_7 ) {
878878      DS2404_clk_w(machine, offset, data);
879879   }
880880}
r2241r2242
882882static WRITE32_HANDLER( eeprom_w )
883883{
884884   // tile banks
885   if( !(mem_mask & 0x00ff0000) ) {
885   if( ACCESSING_BITS_16_23 ) {
886886      rf2_set_layer_banks(data >> 16);
887887      EEPROM_write_bit((data & 0x800000) ? 1 : 0);
888888      EEPROM_set_clock_line((data & 0x400000) ? ASSERT_LINE : CLEAR_LINE);
r2241r2242
896896
897897static WRITE32_HANDLER( z80_prg_fifo_w )
898898{
899   if( ACCESSING_LSB32 ) {
899   if( ACCESSING_BITS_0_7 ) {
900900      if (z80_prg_fifo_pos<0x40000) z80_rom[z80_prg_fifo_pos] = data & 0xff;
901901      z80_prg_fifo_pos++;
902902   }
r2241r2242
905905static WRITE32_HANDLER( z80_enable_w )
906906{
907907   // tile banks
908   if( !(mem_mask & 0x00ff0000) ) {
908   if( ACCESSING_BITS_16_23 ) {
909909      rf2_set_layer_banks(data >> 16);
910910   }
911911
912912logerror("z80 data = %08x mask = %08x\n",data,mem_mask);
913   if( !(mem_mask & 0x000000ff) ) {
913   if( ACCESSING_BITS_0_7 ) {
914914      if( data & 0x1 ) {
915915         z80_prg_fifo_pos = 0;
916916         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE );
r2241r2242
922922
923923static READ32_HANDLER( spi_controls1_r )
924924{
925   if( ACCESSING_LSB32 ) {
925   if( ACCESSING_BITS_0_7 ) {
926926      return (readinputport(1) << 8) | readinputport(0) | 0xffff0000;
927927   }
928928   return 0xffffffff;
r2241r2242
930930
931931static READ32_HANDLER( spi_controls2_r )
932932{
933   if( ACCESSING_LSB32 ) {
933   if( ACCESSING_BITS_0_7 ) {
934934      return ((readinputport(2) | 0xffffff00) & ~0x40) | (EEPROM_read_bit() << 6);
935935   }
936936   return 0xffffffff;
r2241r2242
948948
949949static WRITE32_HANDLER( spi_6295_0_w )
950950{
951   if( ACCESSING_LSB32 ) {
951   if( ACCESSING_BITS_0_7 ) {
952952      OKIM6295_data_0_w(machine, 0, data & 0xff);
953953   }
954954}
955955
956956static WRITE32_HANDLER( spi_6295_1_w )
957957{
958   if( ACCESSING_LSB32 ) {
958   if( ACCESSING_BITS_0_7 ) {
959959      OKIM6295_data_1_w(machine, 0, data & 0xff);
960960   }
961961}
r2241r2242
17951795   MDRV_SCREEN_ADD("main", RASTER)
17961796   MDRV_SCREEN_REFRESH_RATE(54)
17971797   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
1798   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
1798   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
17991799   MDRV_SCREEN_SIZE(64*8, 32*8)
18001800   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1)
18011801
r2241r2242
21082108   MDRV_SCREEN_ADD("main", RASTER)
21092109   MDRV_SCREEN_REFRESH_RATE(54)
21102110   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
2111   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
2111   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
21122112   MDRV_SCREEN_SIZE(64*8, 32*8)
21132113   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1)
21142114
src/mame/drivers/coolpool.c
r2241r2242
192192static WRITE16_HANDLER( nvram_data_w )
193193{
194194   /* only the low 8 bits matter */
195   if (ACCESSING_LSB)
195   if (ACCESSING_BITS_0_7)
196196   {
197197      if (nvram_write_enable)
198198         generic_nvram16[offset] = data & 0xff;
src/mame/drivers/powerins.c
r2241r2242
6060
6161static WRITE16_HANDLER( powerins_okibank_w )
6262{
63   if (ACCESSING_LSB)
63   if (ACCESSING_BITS_0_7)
6464   {
6565      UINT8 *RAM = memory_region(REGION_SOUND1);
6666      int new_bank = data & 0x7;
r2241r2242
7575
7676static WRITE16_HANDLER( powerins_soundlatch_w )
7777{
78   if (ACCESSING_LSB)
78   if (ACCESSING_BITS_0_7)
7979   {
8080      soundlatch_w(machine, 0, data & 0xff);
8181   }
src/mame/drivers/suprnova.c
r2241r2242
380380   switch(adr) {
381381   case 0x28:
382382   case 0x2a:
383      return (UINT16)mame_rand(Machine);
383      return (UINT16)mame_rand(machine);
384384   case 0x00:
385385   case 0x10:
386386      return (UINT16)hit.x_in;
r2241r2242
732732{
733733   switch(offset) {
734734   case 2:
735      if(((mem_mask & 0xff000000) == 0))
735      if(ACCESSING_BITS_24_31)
736736      { /* Coin Lock/Count */
737737//          coin_counter_w(0, data & 0x01000000);
738738//          coin_counter_w(1, data & 0x02000000);
739739//          coin_lockout_w(0, ~data & 0x04000000);
740740//          coin_lockout_w(1, ~data & 0x08000000); // Works in puzzloop, others behave strange.
741741      }
742      if(((mem_mask & 0x00ff0000) == 0))
742      if(ACCESSING_BITS_16_23)
743743      { /* Analogue Input Select */
744744      }
745      if(((mem_mask & 0x0000ff00) == 0))
745      if(ACCESSING_BITS_8_15)
746746      { /* Extended Output - Port A, Mahjong inputs, Comms etc. */
747747      }
748      if(((mem_mask & 0x000000ff) == 0))
748      if(ACCESSING_BITS_0_7)
749749      { /* Extended Output - Port B */
750750      }
751751   break;
752752   case 3:
753      if(((mem_mask & 0x0000ff00) == 0))
753      if(ACCESSING_BITS_8_15)
754754      { /* Interrupt Clear, do we need these? */
755755/*          if(data&0x01)
756                cpunum_set_input_line(Machine, 0,1,CLEAR_LINE);
756                cpunum_set_input_line(machine, 0,1,CLEAR_LINE);
757757            if(data&0x02)
758                cpunum_set_input_line(Machine, 0,3,CLEAR_LINE);
758                cpunum_set_input_line(machine, 0,3,CLEAR_LINE);
759759            if(data&0x04)
760                cpunum_set_input_line(Machine, 0,5,CLEAR_LINE);
760                cpunum_set_input_line(machine, 0,5,CLEAR_LINE);
761761            if(data&0x08)
762                cpunum_set_input_line(Machine, 0,7,CLEAR_LINE);
762                cpunum_set_input_line(machine, 0,7,CLEAR_LINE);
763763            if(data&0x10)
764                cpunum_set_input_line(Machine, 0,9,CLEAR_LINE);
764                cpunum_set_input_line(machine, 0,9,CLEAR_LINE);
765765            if(data&0x20)
766                cpunum_set_input_line(Machine, 0,0xb,CLEAR_LINE);
766                cpunum_set_input_line(machine, 0,0xb,CLEAR_LINE);
767767            if(data&0x40)
768                cpunum_set_input_line(Machine, 0,0xd,CLEAR_LINE);
768                cpunum_set_input_line(machine, 0,0xd,CLEAR_LINE);
769769            if(data&0x80)
770                cpunum_set_input_line(Machine, 0,0xf,CLEAR_LINE);*/
770                cpunum_set_input_line(machine, 0,0xf,CLEAR_LINE);*/
771771
772772         /* idle skip for vblokbrk/sarukani, i can't find a better place to put it :-( but i think it works ok unless its making the game too fast */
773773         if (activecpu_get_pc()==0x04013B44)
774774         {
775            if (!strcmp(Machine->gamedrv->name,"vblokbrk") ||
776               !strcmp(Machine->gamedrv->name,"sarukani"))
775            if (!strcmp(machine->gamedrv->name,"vblokbrk") ||
776               !strcmp(machine->gamedrv->name,"sarukani"))
777777               cpu_spinuntil_int();
778778         }
779779
r2241r2242
795795   mame_system_time systime;
796796   long value;
797797
798   mame_get_base_datetime(Machine, &systime);
798   mame_get_base_datetime(machine, &systime);
799799   // The clock is not y2k-compatible, wrap back 10 years, screw the leap years
800800   //  tm->tm_year -= 10;
801801
r2241r2242
852852
853853static WRITE32_HANDLER( skns_ymz280_w )
854854{
855   if ((mem_mask & 0xff000000) == 0)
855   if (ACCESSING_BITS_24_31)
856856      YMZ280B_register_0_w(machine,offset,(data >> 24) & 0xff);
857   if ((mem_mask & 0x00ff0000) == 0)
857   if (ACCESSING_BITS_16_23)
858858      YMZ280B_data_0_w(machine,offset,(data >> 16) & 0xff);
859859}
860860
src/mame/drivers/seta2.c
r2241r2242
423423
424424static WRITE16_HANDLER( seta2_sound_bank_w )
425425{
426   if (ACCESSING_LSB)
426   if (ACCESSING_BITS_0_7)
427427   {
428428      UINT8 *ROM = memory_region( REGION_SOUND1 );
429429      int banks = (memory_region_length( REGION_SOUND1 ) - 0x100000) / 0x20000;
r2241r2242
443443
444444static WRITE16_HANDLER( grdians_lockout_w )
445445{
446   if (ACCESSING_LSB)
446   if (ACCESSING_BITS_0_7)
447447   {
448448      // initially 0, then either $25 (coin 1) or $2a (coin 2)
449449      coin_counter_w(0,data & 0x01);   // or 0x04
r2241r2242
575575
576576static WRITE16_HANDLER( mj4simai_keyboard_w )
577577{
578   if (ACCESSING_LSB)
578   if (ACCESSING_BITS_0_7)
579579      keyboard_row = data & 0xff;
580580}
581581
r2241r2242
691691
692692static WRITE16_HANDLER( pzlbowl_coin_counter_w )
693693{
694   if (ACCESSING_LSB)
694   if (ACCESSING_BITS_0_7)
695695   {
696696      coin_counter_w(0,data & 0x10);
697697      coin_counter_w(1,data & 0x20);
r2241r2242
780780
781781static WRITE16_HANDLER( samshoot_coin_w )
782782{
783   if (ACCESSING_LSB)
783   if (ACCESSING_BITS_0_7)
784784   {
785785      coin_counter_w(0, data & 0x10);
786786      coin_counter_w(1, data & 0x20);
r2241r2242
20962096   ROM_LOAD( "u18.bin", 0x100000, 0x200000, CRC(de4e65e2) SHA1(82d4e590c714b3e9bf0ffaf1500deb24fd315595) )
20972097ROM_END
20982098
2099ROM_START( deerhunt ) /* Deer Hunting USA V4.3 (11/1/2000) */
2099ROM_START( deerhunt ) /* Deer Hunting USA V4.3 (11/1/2000) - The "E05" breaks version label conventions but is correct & verified */
21002100   ROM_REGION( 0x200000, REGION_CPU1, 0 )      /* TMP68301 Code */
2101   ROM_LOAD16_BYTE( "as0906e01-v4_3.u06", 0x000000, 0x100000, CRC(20c81f17) SHA1(d41d93d6ee88738cec55f7bf3ce6be1dbec68e09) )
2102   ROM_LOAD16_BYTE( "as0907e01-v4_3.u07", 0x000001, 0x100000, CRC(1731aa2a) SHA1(cffae7a99a7f960a62ef0c4454884df17a93c1a6) )
2101   ROM_LOAD16_BYTE( "as0906e05.u06", 0x000000, 0x100000, CRC(20c81f17) SHA1(d41d93d6ee88738cec55f7bf3ce6be1dbec68e09) ) /* CRC16 694E printed on label */
2102   ROM_LOAD16_BYTE( "as0907e05.u07", 0x000001, 0x100000, CRC(1731aa2a) SHA1(cffae7a99a7f960a62ef0c4454884df17a93c1a6) ) /* CRC16 5D89 printed on label */
21032103
21042104   ROM_REGION( 0x2000000, REGION_GFX1, ROMREGION_DISPOSE )   /* Sprites */
21052105   ROM_LOAD( "as0901m01.u38", 0x0000000, 0x800000, CRC(1d6acf8f) SHA1(6f61fe21bebb7c87e8e6c3ef3ba73b8cf327dde9) )
r2241r2242
21142114
21152115ROM_START( deerhuna ) /* Deer Hunting USA V4.2 (xx/x/2000) */
21162116   ROM_REGION( 0x200000, REGION_CPU1, 0 )      /* TMP68301 Code */
2117   ROM_LOAD16_BYTE( "as0906e01-v4_2.u06", 0x000000, 0x100000, CRC(bb3af36f) SHA1(f04071347e8ad361bf666fcb6c0136e522f19d47) )
2118   ROM_LOAD16_BYTE( "as0907e01-v4_2.u07", 0x000001, 0x100000, CRC(83f02117) SHA1(70fc2291bc93af3902aae88688be6a8078f7a07e) )
2117   ROM_LOAD16_BYTE( "as0906e04-v4_2.u06", 0x000000, 0x100000, CRC(bb3af36f) SHA1(f04071347e8ad361bf666fcb6c0136e522f19d47) ) /* CRC16 6640 printed on label */
2118   ROM_LOAD16_BYTE( "as0907e04-v4_2.u07", 0x000001, 0x100000, CRC(83f02117) SHA1(70fc2291bc93af3902aae88688be6a8078f7a07e) ) /* CRC16 595A printed on label */
21192119
21202120   ROM_REGION( 0x2000000, REGION_GFX1, ROMREGION_DISPOSE )   /* Sprites */
21212121   ROM_LOAD( "as0901m01.u38", 0x0000000, 0x800000, CRC(1d6acf8f) SHA1(6f61fe21bebb7c87e8e6c3ef3ba73b8cf327dde9) )
r2241r2242
21302130
21312131ROM_START( deerhunb ) /* Deer Hunting USA V4.0 (6/15/2000) */
21322132   ROM_REGION( 0x200000, REGION_CPU1, 0 )      /* TMP68301 Code */
2133   ROM_LOAD16_BYTE( "as0906e01-v4.u06", 0x000000, 0x100000, CRC(07d9b64a) SHA1(f9aac644aab920bbac84b14836ee589ccd51f6db) )
2134   ROM_LOAD16_BYTE( "as0907e01-v4.u07", 0x000001, 0x100000, CRC(19973d08) SHA1(da1cc02ce480a62ccaf94d0af1246a340f054b43) )
2133   ROM_LOAD16_BYTE( "as0906e04.u06", 0x000000, 0x100000, CRC(07d9b64a) SHA1(f9aac644aab920bbac84b14836ee589ccd51f6db) ) /* CRC16 7BBB printed on label */
2134   ROM_LOAD16_BYTE( "as0907e04.u07", 0x000001, 0x100000, CRC(19973d08) SHA1(da1cc02ce480a62ccaf94d0af1246a340f054b43) ) /* CRC16 4C78 printed on label */
21352135
21362136   ROM_REGION( 0x2000000, REGION_GFX1, ROMREGION_DISPOSE )   /* Sprites */
21372137   ROM_LOAD( "as0901m01.u38", 0x0000000, 0x800000, CRC(1d6acf8f) SHA1(6f61fe21bebb7c87e8e6c3ef3ba73b8cf327dde9) )
r2241r2242
21442144   ROM_LOAD( "as0905m01.u18", 0x100000, 0x400000, CRC(8d8165bb) SHA1(aca7051613d260734ee787b4c3db552c336bd600) )
21452145ROM_END
21462146
2147   /* There are known versions 3.x of Deer Hunting USA.... just none are currently dumped.  roms should be "AS0906 E03 U06" & "AS0907 E03 U07" */
2148
2149ROM_START( deerhunc ) /* Deer Hunting USA V2.x - No version number is printed to screen but "E02" in EPROM label signifies V2 */
2150   ROM_REGION( 0x200000, REGION_CPU1, 0 )      /* TMP68301 Code */
2151   ROM_LOAD16_BYTE( "as0906e02.u06", 0x000000, 0x100000, CRC(190cca42) SHA1(aef63f5e8c71ed0156b8b0104c5d23872c119167) ) /* Version in program code is listed as 0.00 */
2152   ROM_LOAD16_BYTE( "as0907e02.u07", 0x000001, 0x100000, CRC(9de2b901) SHA1(d271bc54c41e30c0d9962eedd22f3ef2b7b8c9e5) ) /* Verified with two different sets of chips */
2153
2154   ROM_REGION( 0x2000000, REGION_GFX1, ROMREGION_DISPOSE )   /* Sprites */
2155   ROM_LOAD( "as0901m01.u38", 0x0000000, 0x800000, CRC(1d6acf8f) SHA1(6f61fe21bebb7c87e8e6c3ef3ba73b8cf327dde9) )
2156   ROM_LOAD( "as0902m01.u39", 0x0800000, 0x800000, CRC(c7ca2128) SHA1(86be3a3ec2f86f61acfa3d4d261faea3c27dc378) )
2157   ROM_LOAD( "as0903m01.u40", 0x1000000, 0x800000, CRC(e8ef81b3) SHA1(97666942ca6cca5b8ea6451314a2aaabad9e06ba) )
2158   ROM_LOAD( "as0904m01.u41", 0x1800000, 0x800000, CRC(d0f97fdc) SHA1(776c9d42d03a9f61155521212305e1ed696eaf47) )
2159
2160   ROM_REGION( 0x500000, REGION_SOUND1, 0 )   /* Samples */
2161   /* Leave 1MB empty (addressable by the chip) */
2162   ROM_LOAD( "as0905m01.u18", 0x100000, 0x400000, CRC(8d8165bb) SHA1(aca7051613d260734ee787b4c3db552c336bd600) )
2163ROM_END
2164
21472165ROM_START( turkhunt ) /* V1.0 is currently the only known version */
21482166   ROM_REGION( 0x200000, REGION_CPU1, 0 )      /* TMP68301 Code */
21492167   ROM_LOAD16_BYTE( "asx906e01.u06", 0x000000, 0x100000, CRC(c96266e1) SHA1(0ca462b3b0f27198e36384eee6ea5c5d4e7e1293) )
r2241r2242
22182236GAME( 2000, deerhunt, 0,        samshoot, deerhunt, 0, ROT0, "Sammy USA Corporation", "Deer Hunting USA V4.3",                        GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
22192237GAME( 2000, deerhuna, deerhunt, samshoot, deerhunt, 0, ROT0, "Sammy USA Corporation", "Deer Hunting USA V4.2",                        GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
22202238GAME( 2000, deerhunb, deerhunt, samshoot, deerhunt, 0, ROT0, "Sammy USA Corporation", "Deer Hunting USA V4.0",                        GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
2239GAME( 2000, deerhunc, deerhunt, samshoot, deerhunt, 0, ROT0, "Sammy USA Corporation", "Deer Hunting USA V2",                          GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
22212240GAME( 2001, turkhunt, 0,        samshoot, turkhunt, 0, ROT0, "Sammy USA Corporation", "Turkey Hunting USA V1.0",                      GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
22222241GAME( 2001, wschamp,  0,        samshoot, wschamp,  0, ROT0, "Sammy USA Corporation", "Wing Shooting Championship V2.0",              GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
22232242GAME( 2001, wschampa, wschamp,  samshoot, wschamp,  0, ROT0, "Sammy USA Corporation", "Wing Shooting Championship V1.01",             GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/witch.c
r2241r2242
443443   AM_RANGE(0xc800, 0xcbff) AM_READWRITE(gfx1_vram_r, gfx1_vram_w) AM_BASE(&gfx1_vram)
444444   AM_RANGE(0xcc00, 0xcfff) AM_READWRITE(gfx1_cram_r, gfx1_cram_w) AM_BASE(&gfx1_cram)
445445   AM_RANGE(0xd000, 0xdfff) AM_RAM AM_BASE(&sprite_ram)
446   AM_RANGE(0xe000, 0xe7ff) AM_READWRITE(SMH_RAM, paletteram_xBBBBBGGGGGRRRRR_split1_w) AM_BASE(&paletteram)
447   AM_RANGE(0xe800, 0xefff) AM_READWRITE(SMH_RAM, paletteram_xBBBBBGGGGGRRRRR_split2_w) AM_BASE(&paletteram_2)
446   AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split1_w) AM_BASE(&paletteram)
447   AM_RANGE(0xe800, 0xefff) AM_RAM AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split2_w) AM_BASE(&paletteram_2)
448448   AM_RANGE(0xf000, 0xf0ff) AM_RAM AM_SHARE(1)
449449   AM_RANGE(0xf100, 0xf17f) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
450450   AM_RANGE(0xf180, 0xffff) AM_RAM AM_SHARE(2)
src/mame/drivers/flkatck.c
r2241r2242
2626extern UINT8 *k007121_ram;
2727extern int flkatck_irq_enabled;
2828
29static int multiply_reg[2];
30
2931/***************************************************************************/
3032
3133static MACHINE_RESET( flkatck )
r2241r2242
9294   }
9395}
9496
97/* Protection - an external multiplyer connected to the sound CPU */
98static READ8_HANDLER( multiply_r )
99{
100   return (multiply_reg[0] * multiply_reg[1]) & 0xFF;
101}
102
103static WRITE8_HANDLER( multiply_w )
104{
105   multiply_reg[offset] = data;
106}
107
108
95109static ADDRESS_MAP_START( flkatck_readmem, ADDRESS_SPACE_PROGRAM, 8 )
96110   AM_RANGE(0x0000, 0x03ff) AM_READ(SMH_RAM)
97111   AM_RANGE(0x0400, 0x041f) AM_READ(flkatck_ls138_r)         /* inputs + DIPS */
r2241r2242
116130static ADDRESS_MAP_START( flkatck_readmem_sound, ADDRESS_SPACE_PROGRAM, 8 )
117131   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)            /* ROM */
118132   AM_RANGE(0x8000, 0x87ff) AM_READ(SMH_RAM)            /* RAM */
119   AM_RANGE(0x9000, 0x9000) AM_READ(SMH_RAM)            /* ??? */
120   AM_RANGE(0x9001, 0x9001) AM_READ(SMH_RAM)            /* ??? */
133   AM_RANGE(0x9000, 0x9000) AM_READ(multiply_r)            /* ??? */
134//  AM_RANGE(0x9001, 0x9001) AM_READ(SMH_RAM)               /* ??? */
121135   AM_RANGE(0x9004, 0x9004) AM_READ(SMH_RAM)            /* ??? */
122136   AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r)         /* soundlatch_r */
123137   AM_RANGE(0xb000, 0xb00d) AM_READ(K007232_read_port_0_r)   /* 007232 registers */
r2241r2242
127141static ADDRESS_MAP_START( flkatck_writemem_sound, ADDRESS_SPACE_PROGRAM, 8 )
128142   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)               /* ROM */
129143   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM)               /* RAM */
130   AM_RANGE(0x9000, 0x9000) AM_WRITE(SMH_RAM)               /* ??? */
131   AM_RANGE(0x9001, 0x9001) AM_WRITE(SMH_RAM)               /* ??? */
144   AM_RANGE(0x9000, 0x9001) AM_WRITE(multiply_w)               /* ??? */
145//  AM_RANGE(0x9001, 0x9001) AM_WRITE(SMH_RAM)                  /* ??? */
132146   AM_RANGE(0x9006, 0x9006) AM_WRITE(SMH_RAM)               /* ??? */
133147   AM_RANGE(0xb000, 0xb00d) AM_WRITE(K007232_write_port_0_w)    /* 007232 registers */
134148   AM_RANGE(0xc000, 0xc000) AM_WRITE(YM2151_register_port_0_w)   /* YM2151 */
src/mame/drivers/namcofl.c
r2241r2242
159159
160160static WRITE32_HANDLER( namcofl_sysreg_w )
161161{
162   if ((offset == 2) && !(mem_mask & 0xff))  // address space configuration
162   if ((offset == 2) && ACCESSING_BITS_0_7)  // address space configuration
163163   {
164164      if (data == 0)   // RAM at 00000000, ROM at 10000000
165165      {
r2241r2242
178178{
179179   COMBINE_DATA(&paletteram32[offset]);
180180
181   if ((offset == 0x1808/4) && ACCESSING_MSW32)
181   if ((offset == 0x1808/4) && ACCESSING_BITS_16_31)
182182   {
183183      UINT16 v = paletteram32[offset] >> 16;
184184      UINT16 triggerscanline=(((v>>8)&0xff)|((v&0xff)<<8))-(32+1);
r2241r2242
363363
364364   MDRV_SCREEN_ADD("main", RASTER)
365365   MDRV_SCREEN_REFRESH_RATE(60)
366   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
366   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
367367   MDRV_SCREEN_SIZE(NAMCONB1_HTOTAL, NAMCONB1_VTOTAL)
368368   MDRV_SCREEN_VISIBLE_AREA(0, NAMCONB1_HBSTART-1, 0, NAMCONB1_VBSTART-1)
369369
src/mame/drivers/volfied.c
r2241r2242
6868                MEMORY STRUCTURES
6969***********************************************************/
7070
71static ADDRESS_MAP_START( volfied_readmem, ADDRESS_SPACE_PROGRAM, 16 )
72   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)    /* program */
73   AM_RANGE(0x080000, 0x0fffff) AM_READ(SMH_ROM)    /* tiles   */
74   AM_RANGE(0x100000, 0x103fff) AM_READ(SMH_RAM)    /* main    */
75   AM_RANGE(0x200000, 0x203fff) AM_READ(PC090OJ_word_0_r)
76   AM_RANGE(0x400000, 0x47ffff) AM_READ(volfied_video_ram_r)
77   AM_RANGE(0x500000, 0x503fff) AM_READ(SMH_RAM)
78   AM_RANGE(0xd00000, 0xd00001) AM_READ(volfied_video_ctrl_r)
79   AM_RANGE(0xe00002, 0xe00003) AM_READ(taitosound_comm16_lsb_r)
80   AM_RANGE(0xf00000, 0xf007ff) AM_READ(volfied_cchip_ram_r)
81   AM_RANGE(0xf00802, 0xf00803) AM_READ(volfied_cchip_ctrl_r)
82ADDRESS_MAP_END
83
84static ADDRESS_MAP_START( volfied_writemem, ADDRESS_SPACE_PROGRAM, 16 )
85   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)    /* program */
86   AM_RANGE(0x080000, 0x0fffff) AM_WRITE(SMH_ROM)    /* tiles   */
87   AM_RANGE(0x100000, 0x103fff) AM_WRITE(SMH_RAM)    /* main    */
88   AM_RANGE(0x200000, 0x203fff) AM_WRITE(PC090OJ_word_0_w)
89   AM_RANGE(0x400000, 0x47ffff) AM_WRITE(volfied_video_ram_w)
90   AM_RANGE(0x500000, 0x503fff) AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
71static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
72   AM_RANGE(0x000000, 0x03ffff) AM_ROM      /* program */
73   AM_RANGE(0x080000, 0x0fffff) AM_ROM      /* tiles   */
74   AM_RANGE(0x100000, 0x103fff) AM_RAM      /* main    */
75   AM_RANGE(0x200000, 0x203fff) AM_READWRITE(PC090OJ_word_0_r, PC090OJ_word_0_w)
76   AM_RANGE(0x400000, 0x47ffff) AM_READWRITE(volfied_video_ram_r, volfied_video_ram_w)
77   AM_RANGE(0x500000, 0x503fff) AM_RAM AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
9178   AM_RANGE(0x600000, 0x600001) AM_WRITE(volfied_video_mask_w)
9279   AM_RANGE(0x700000, 0x700001) AM_WRITE(volfied_sprite_ctrl_w)
93   AM_RANGE(0xd00000, 0xd00001) AM_WRITE(volfied_video_ctrl_w)
80   AM_RANGE(0xd00000, 0xd00001) AM_READWRITE(volfied_video_ctrl_r, volfied_video_ctrl_w)
9481   AM_RANGE(0xe00000, 0xe00001) AM_WRITE(taitosound_port16_lsb_w)
95   AM_RANGE(0xe00002, 0xe00003) AM_WRITE(taitosound_comm16_lsb_w)
96   AM_RANGE(0xf00000, 0xf007ff) AM_WRITE(volfied_cchip_ram_w)
97   AM_RANGE(0xf00802, 0xf00803) AM_WRITE(volfied_cchip_ctrl_w)
82   AM_RANGE(0xe00002, 0xe00003) AM_READWRITE(taitosound_comm16_lsb_r, taitosound_comm16_lsb_w)
83   AM_RANGE(0xf00000, 0xf007ff) AM_READWRITE(volfied_cchip_ram_r, volfied_cchip_ram_w)
84   AM_RANGE(0xf00802, 0xf00803) AM_READWRITE(volfied_cchip_ctrl_r, volfied_cchip_ctrl_w)
9885   AM_RANGE(0xf00c00, 0xf00c01) AM_WRITE(volfied_cchip_bank_w)
9986ADDRESS_MAP_END
10087
101static ADDRESS_MAP_START( z80_readmem, ADDRESS_SPACE_PROGRAM, 8 )
102   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
103   AM_RANGE(0x8000, 0x87ff) AM_READ(SMH_RAM)
104   AM_RANGE(0x8801, 0x8801) AM_READ(taitosound_slave_comm_r)
105   AM_RANGE(0x9000, 0x9000) AM_READ(YM2203_status_port_0_r)
106   AM_RANGE(0x9001, 0x9001) AM_READ(YM2203_read_port_0_r)
107ADDRESS_MAP_END
108
109static ADDRESS_MAP_START( z80_writemem, ADDRESS_SPACE_PROGRAM, 8 )
110   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
111   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM)
88static ADDRESS_MAP_START( z80_map, ADDRESS_SPACE_PROGRAM, 8 )
89   AM_RANGE(0x0000, 0x7fff) AM_ROM
90   AM_RANGE(0x8000, 0x87ff) AM_RAM
11291   AM_RANGE(0x8800, 0x8800) AM_WRITE(taitosound_slave_port_w)
113   AM_RANGE(0x8801, 0x8801) AM_WRITE(taitosound_slave_comm_w)
114   AM_RANGE(0x9000, 0x9000) AM_WRITE(YM2203_control_port_0_w)
115   AM_RANGE(0x9001, 0x9001) AM_WRITE(YM2203_write_port_0_w)
92   AM_RANGE(0x8801, 0x8801) AM_READWRITE(taitosound_slave_comm_r, taitosound_slave_comm_w)
93   AM_RANGE(0x9000, 0x9000) AM_READWRITE(YM2203_status_port_0_r, YM2203_control_port_0_w)
94   AM_RANGE(0x9001, 0x9001) AM_READWRITE(YM2203_read_port_0_r, YM2203_write_port_0_w)
11695   AM_RANGE(0x9800, 0x9800) AM_WRITE(SMH_NOP)    /* ? */
11796ADDRESS_MAP_END
11897
r2241r2242
264243
265244   /* basic machine hardware */
266245   MDRV_CPU_ADD(M68000, 8000000)   /* 8MHz */
267   MDRV_CPU_PROGRAM_MAP(volfied_readmem,volfied_writemem)
246   MDRV_CPU_PROGRAM_MAP(main_map,0)
268247   MDRV_CPU_VBLANK_INT("main", irq4_line_hold)
269248
270249   MDRV_CPU_ADD(Z80, 4000000)   /* sound CPU, required to run the game */
271   MDRV_CPU_PROGRAM_MAP(z80_readmem,z80_writemem)
250   MDRV_CPU_PROGRAM_MAP(z80_map,0)
272251
273252   MDRV_INTERLEAVE(20)
274253
src/mame/drivers/megadriv.c
r2241r2242
895895   {
896896      case 0x00:
897897      case 0x02:
898         if (!ACCESSING_MSB)
898         if (!ACCESSING_BITS_8_15)
899899         {
900900            data = (data&0x00ff) | data<<8;
901901         //  mame_printf_debug("8-bit write VDP data port access, offset %04x data %04x mem_mask %04x\n",offset,data,mem_mask);
902902         }
903         else if (!ACCESSING_LSB)
903         else if (!ACCESSING_BITS_0_7)
904904         {
905905            data = (data&0xff00) | data>>8;
906906         //  mame_printf_debug("8-bit write VDP data port access, offset %04x data %04x mem_mask %04x\n",offset,data,mem_mask);
r2241r2242
910910
911911      case 0x04:
912912      case 0x06:
913         if ((!ACCESSING_MSB) || (!ACCESSING_LSB)) mame_printf_debug("8-bit write VDP control port access, offset %04x data %04x mem_mask %04x\n",offset,data,mem_mask);
913         if ((!ACCESSING_BITS_8_15) || (!ACCESSING_BITS_0_7)) mame_printf_debug("8-bit write VDP control port access, offset %04x data %04x mem_mask %04x\n",offset,data,mem_mask);
914914         megadriv_vdp_ctrl_port_w(data);
915915         break;
916916
r2241r2242
925925      case 0x12:
926926      case 0x14:
927927      case 0x16:
928         if (ACCESSING_LSB) SN76496_0_w(machine, 0, data & 0xff);
929         //if (ACCESSING_MSB) SN76496_0_w(machine, 0, (data >>8) & 0xff);
928         if (ACCESSING_BITS_0_7) SN76496_0_w(machine, 0, data & 0xff);
929         //if (ACCESSING_BITS_8_15) SN76496_0_w(machine, 0, (data >>8) & 0xff);
930930         break;
931931
932932      default:
r2241r2242
12931293
12941294      case 0x00:
12951295      case 0x02:
1296         if ((!ACCESSING_MSB) || (!ACCESSING_LSB)) mame_printf_debug("8-bit VDP read data port access, offset %04x mem_mask %04x\n",offset,mem_mask);
1296         if ((!ACCESSING_BITS_8_15) || (!ACCESSING_BITS_0_7)) mame_printf_debug("8-bit VDP read data port access, offset %04x mem_mask %04x\n",offset,mem_mask);
12971297         retvalue = megadriv_vdp_data_port_r();
12981298         break;
12991299
13001300      case 0x04:
13011301      case 0x06:
1302      //  if ((!ACCESSING_MSB) || (!ACCESSING_LSB)) mame_printf_debug("8-bit VDP read control port access, offset %04x mem_mask %04x\n",offset,mem_mask);
1302      //  if ((!ACCESSING_BITS_8_15) || (!ACCESSING_BITS_0_7)) mame_printf_debug("8-bit VDP read control port access, offset %04x mem_mask %04x\n",offset,mem_mask);
13031303         retvalue = megadriv_vdp_ctrl_port_r();
13041304      //  retvalue = mame_rand(Machine);
13051305      //  mame_printf_debug("%06x: Read Control Port at scanline %d hpos %d (return %04x)\n",activecpu_get_pc(),genesis_scanline_counter, get_hposition(),retvalue);
r2241r2242
13091309      case 0x0a:
13101310      case 0x0c:
13111311      case 0x0e:
1312      //  if ((!ACCESSING_MSB) || (!ACCESSING_LSB)) mame_printf_debug("8-bit VDP read HV counter port access, offset %04x mem_mask %04x\n",offset,mem_mask);
1312      //  if ((!ACCESSING_BITS_8_15) || (!ACCESSING_BITS_0_7)) mame_printf_debug("8-bit VDP read HV counter port access, offset %04x mem_mask %04x\n",offset,mem_mask);
13131313         retvalue = megadriv_read_hv_counters();
13141314      //  retvalue = mame_rand(Machine);
13151315      //  mame_printf_debug("%06x: Read HV counters at scanline %d hpos %d (return %04x)\n",activecpu_get_pc(),genesis_scanline_counter, get_hposition(),retvalue);
r2241r2242
13341334      switch (offset)
13351335      {
13361336         case 0:
1337            if (ACCESSING_MSB)    return YM2612_status_port_0_A_r(machine, 0) << 8;
1337            if (ACCESSING_BITS_8_15)    return YM2612_status_port_0_A_r(machine, 0) << 8;
13381338            else              return YM2612_status_port_0_A_r(machine, 0);
13391339            break;
13401340         case 1:
1341            if (ACCESSING_MSB)   return YM2612_status_port_0_A_r(machine, 0) << 8;
1341            if (ACCESSING_BITS_8_15)   return YM2612_status_port_0_A_r(machine, 0) << 8;
13421342            else             return YM2612_status_port_0_A_r(machine, 0);
13431343            break;
13441344      }
r2241r2242
13621362      switch (offset)
13631363      {
13641364         case 0:
1365            if (ACCESSING_MSB)   YM2612_control_port_0_A_w   (machine, 0,   (data >> 8) & 0xff);
1365            if (ACCESSING_BITS_8_15)   YM2612_control_port_0_A_w   (machine, 0,   (data >> 8) & 0xff);
13661366            else             YM2612_data_port_0_A_w      (machine, 0,   (data >> 0) & 0xff);
13671367            break;
13681368         case 1:
1369            if (ACCESSING_MSB)   YM2612_control_port_0_B_w   (machine, 0,   (data >> 8) & 0xff);
1369            if (ACCESSING_BITS_8_15)   YM2612_control_port_0_B_w   (machine, 0,   (data >> 8) & 0xff);
13701370            else             YM2612_data_port_0_B_w      (machine, 0,   (data >> 0) & 0xff);
13711371            break;
13721372      }
r2241r2242
21892189   if ((genz80.z80_has_bus==0) && (genz80.z80_is_reset==0))
21902190   {
21912191
2192      if (!ACCESSING_LSB) // byte (MSB) access
2192      if (!ACCESSING_BITS_0_7) // byte (MSB) access
21932193      {
21942194         genz80.z80_prgram[(offset<<1)] = (data & 0xff00) >> 8;
21952195      }
2196      else if (!ACCESSING_MSB)
2196      else if (!ACCESSING_BITS_8_15)
21972197      {
21982198         genz80.z80_prgram[(offset<<1)^1] = (data & 0x00ff);
21992199      }
r2241r2242
22242224
22252225
22262226   /* Check if the 68k has the z80 bus */
2227   if (!ACCESSING_LSB) // byte (MSB) access
2227   if (!ACCESSING_BITS_0_7) // byte (MSB) access
22282228   {
22292229      if (genz80.z80_has_bus || genz80.z80_is_reset) retvalue = nextvalue | 0x0100;
22302230      else retvalue = (nextvalue & 0xfeff);
r2241r2242
22332233      return retvalue;
22342234
22352235   }
2236   else if (!ACCESSING_MSB) // is this valid?
2236   else if (!ACCESSING_BITS_8_15) // is this valid?
22372237   {
22382238      //logerror("%06x: 68000 check z80 Bus (byte LSB access) %04x\n", activecpu_get_pc(),mem_mask);
22392239      if (genz80.z80_has_bus || genz80.z80_is_reset) retvalue = 0x0001;
r2241r2242
22562256static WRITE16_HANDLER( megadriv_68k_req_z80_bus )
22572257{
22582258   /* Request the Z80 bus, allows 68k to read/write Z80 address space */
2259   if (!ACCESSING_LSB) // byte access
2259   if (!ACCESSING_BITS_0_7) // byte access
22602260   {
22612261      if (data & 0x0100)
22622262      {
r2241r2242
22722272
22732273      }
22742274   }
2275   else if (!ACCESSING_MSB) // is this valid?
2275   else if (!ACCESSING_BITS_8_15) // is this valid?
22762276   {
22772277      if (data & 0x0001)
22782278      {
r2241r2242
23062306
23072307static WRITE16_HANDLER ( megadriv_68k_req_z80_reset )
23082308{
2309   if (!ACCESSING_LSB) // byte access
2309   if (!ACCESSING_BITS_0_7) // byte access
23102310   {
23112311      if (data & 0x0100)
23122312      {
r2241r2242
23222322         sndti_reset(SOUND_YM2612, 0);
23232323      }
23242324   }
2325   else if (!ACCESSING_MSB) // is this valid?
2325   else if (!ACCESSING_BITS_8_15) // is this valid?
23262326   {
23272327      if (data & 0x0001)
23282328      {
src/mame/drivers/itech32.c
r2241r2242
543543
544544static WRITE16_HANDLER( sound_data_w )
545545{
546   if (ACCESSING_LSB)
546   if (ACCESSING_BITS_0_7)
547547      timer_call_after_resynch(NULL, data & 0xff, delayed_sound_data_w);
548548}
549549
r2241r2242
556556
557557static WRITE32_HANDLER( sound_data32_w )
558558{
559   if (!(mem_mask & 0x00ff0000))
559   if (ACCESSING_BITS_16_23)
560560      timer_call_after_resynch(NULL, (data >> 16) & 0xff, delayed_sound_data_w);
561561}
562562
r2241r2242
890890
891891static READ32_HANDLER( test1_r )
892892{
893   if (!(mem_mask & 0xff000000) && !written[0x100 + offset*4+0]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0x100 + offset*4+0);
894   if (!(mem_mask & 0x00ff0000) && !written[0x100 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0x100 + offset*4+1);
895   if (!(mem_mask & 0x0000ff00) && !written[0x100 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0x100 + offset*4+2);
896   if (!(mem_mask & 0x000000ff) && !written[0x100 + offset*4+3]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0x100 + offset*4+3);
893   if (ACCESSING_BITS_24_31 && !written[0x100 + offset*4+0]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0x100 + offset*4+0);
894   if (ACCESSING_BITS_16_23 && !written[0x100 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0x100 + offset*4+1);
895   if (ACCESSING_BITS_8_15 && !written[0x100 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0x100 + offset*4+2);
896   if (ACCESSING_BITS_0_7 && !written[0x100 + offset*4+3]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0x100 + offset*4+3);
897897   return ((UINT32 *)main_ram)[0x100/4 + offset];
898898}
899899
900900static WRITE32_HANDLER( test1_w )
901901{
902   if (!(mem_mask & 0xff000000)) written[0x100 + offset*4+0] = 1;
903   if (!(mem_mask & 0x00ff0000)) written[0x100 + offset*4+1] = 1;
904   if (!(mem_mask & 0x0000ff00)) written[0x100 + offset*4+2] = 1;
905   if (!(mem_mask & 0x000000ff)) written[0x100 + offset*4+3] = 1;
902   if (ACCESSING_BITS_24_31) written[0x100 + offset*4+0] = 1;
903   if (ACCESSING_BITS_16_23) written[0x100 + offset*4+1] = 1;
904   if (ACCESSING_BITS_8_15) written[0x100 + offset*4+2] = 1;
905   if (ACCESSING_BITS_0_7) written[0x100 + offset*4+3] = 1;
906906   COMBINE_DATA(&((UINT32 *)main_ram)[0x100/4 + offset]);
907907}
908908
909909static READ32_HANDLER( test2_r )
910910{
911   if (!(mem_mask & 0xff000000) && !written[0xc00 + offset*4+0]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0xc00 + offset*4+0);
912   if (!(mem_mask & 0x00ff0000) && !written[0xc00 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0xc00 + offset*4+1);
913   if (!(mem_mask & 0x0000ff00) && !written[0xc00 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0xc00 + offset*4+2);
914   if (!(mem_mask & 0x000000ff) && !written[0xc00 + offset*4+3]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0xc00 + offset*4+3);
911   if (ACCESSING_BITS_24_31 && !written[0xc00 + offset*4+0]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0xc00 + offset*4+0);
912   if (ACCESSING_BITS_16_23 && !written[0xc00 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0xc00 + offset*4+1);
913   if (ACCESSING_BITS_8_15 && !written[0xc00 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0xc00 + offset*4+2);
914   if (ACCESSING_BITS_0_7 && !written[0xc00 + offset*4+3]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0xc00 + offset*4+3);
915915   return ((UINT32 *)main_ram)[0xc00/4 + offset];
916916}
917917
918918static WRITE32_HANDLER( test2_w )
919919{
920   if (!(mem_mask & 0xff000000)) written[0xc00 + offset*4+0] = 1;
921   if (!(mem_mask & 0x00ff0000)) written[0xc00 + offset*4+1] = 1;
922   if (!(mem_mask & 0x0000ff00)) written[0xc00 + offset*4+2] = 1;
923   if (!(mem_mask & 0x000000ff)) written[0xc00 + offset*4+3] = 1;
920   if (ACCESSING_BITS_24_31) written[0xc00 + offset*4+0] = 1;
921   if (ACCESSING_BITS_16_23) written[0xc00 + offset*4+1] = 1;
922   if (ACCESSING_BITS_8_15) written[0xc00 + offset*4+2] = 1;
923   if (ACCESSING_BITS_0_7) written[0xc00 + offset*4+3] = 1;
924924   COMBINE_DATA(&((UINT32 *)main_ram)[0xc00/4 + offset]);
925925}
926926#endif
src/mame/drivers/filetto.c
r2241r2242
384384   return mame_rand(Machine);
385385}
386386
387static void pc_timer0_w(int state)
387static PIT8253_OUTPUT_CHANGED( pc_timer0_w )
388388{
389389   //if (state)
390390   //  pic8259_0_issue_irq(0);
r2241r2242
392392
393393static const struct pit8253_config pc_pit8253_config =
394394{
395   TYPE8253,
396395   {
397396      {
398397         4772720/4,            /* heartbeat IRQ */
r2241r2242
405404      }, {
406405         4772720/4,            /* pio port c pin 4, and speaker polling enough */
407406         NULL,
408         NULL//pc_sh_speaker_change_clock
407         NULL
409408      }
410409   }
411410};
r2241r2242
654653static MACHINE_RESET(filetto)
655654{
656655   ppi8255_init(&filetto_ppi8255_intf);
657   pit8253_init(1, &pc_pit8253_config);
658656}
659657
660658/*
r2241r2242
739737   MDRV_CPU_IO_MAP(filetto_io,0)
740738   MDRV_CPU_VBLANK_INT_HACK(filetto_irq,200)
741739
740   MDRV_DEVICE_ADD( "pit8253", PIT8253 )
741   MDRV_DEVICE_CONFIG( pc_pit8253_config )
742
742743   MDRV_GFXDECODE(filetto)
743744
744745   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/ashnojoe.c
r2241r2242
107107
108108static WRITE16_HANDLER( ashnojoe_soundlatch_w )
109109{
110   if(ACCESSING_LSB)
110   if(ACCESSING_BITS_0_7)
111111   {
112112      soundlatch_w(machine,0,data & 0xff);
113113      //needed?
src/mame/drivers/terracre.c
r2241r2242
183183
184184static WRITE16_HANDLER( amazon_protection_w )
185185{
186   if( ACCESSING_LSB )
186   if( ACCESSING_BITS_0_7 )
187187   {
188188      if( offset==1 )
189189      {
src/mame/drivers/undrfire.c
r2241r2242
11/***************************************************************************
22
33    Underfire                           (c) 1993 Taito
4    Chase Bombers                       (c) 1994 Taito
45
56    Driver by Bryan McPhail & David Graves.
67
7    Board Info:
8    Board Info (Underfire):
89
910        TC0470LIN : ?
1011        TC0480SCP : known tilemap chip
r2241r2242
115116need to reproduce the $18141a calculations.
116117
117118
119Info (Chase Bombers)
120
121Chase Bombers
122Taito, 1994
123
124Runs on hardware similar to Ground Effects
125
126
127PCB Layout
128----------
129
130MAIN PCB-D
131K1100809A
132J1100342A
133|----------------------------------------------------------------------------------------------|
134|           C5                              C6                             SMC_COM20020  LANOUT|
135| 68EC020   61256     68EC000  61256            68EC000      61256      MB8421                 |
136|           61256              61256                         61256                       LANIN |
137|           61256                     61256                  PAL                               |
138|           61256    PAL              61256                  PAL                               |
139|                    PAL                                     PAL        MB8421                 |
140|                    40MHz                                                                     |
141|                                                                  MC68681                     |
142|                                           TC511664-80     MB3771                             |
143|                                                                                            P1|
144|  MACH120   MACH120                                                                           |
145|                                     ENSONIC         30.4761MHz  16MHz   ADC0809              |
146|                                     ESP-R6                                                   |
147|                                                       ENSONIC                                |
148|                                     ENSONIC           5701     DSW1(8)  TC0510NIO            |
149|                                     OTIS-R2                                                 Z|
150|                                                         93C46                                |
151|           C3                              C4                                                 |
152|                                                                                              |
153|  61256                                                                                     |-|
154|  61256                                                                                     |
155|                                                                                            |-|
156|                TC0480SCP        TC0620SCC           TC0360PRI                                |
157|                                                                                              |
158|                                                                                TC0650FDA     |
159|  2018                                                                  61256                 |
160|                                                                        61256                 |
161|  2018     2088             61256                                       61256                G|
162|                            61256                    TC0580PIV                                |
163|  2018     2088                                                                               |
164|                                                                                              |
165|  2018                                                             TL074    TL074   TDA1543   |
166|           TC0570SPC         TC0470LIN               514256  514256                           |
167|  2018                                               514256  514256        TA8221   TD62064 |-|
168|                                                     514256  514256                 TD62064 |
169|  2018                                                               MB87078        TD62064 |-|
170|           C1                              C2                                                 |
171|----------------------------------------------------------------------------------------------|
172Notes:
173      ROM board plugs into C* connectors
174      No clocks for now, PCB has light corrosion and will need extensive cleaning before it can be powered up.
175
176ROM Board
177---------
178
179PCB Numbers - ROM.PCB
180              K9100508A
181              J9100367A
182
183Board contains only 29 ROMs and not much else.
184
185
186
118187***************************************************************************/
119188
120189#include "driver.h"
r2241r2242
129198
130199VIDEO_START( undrfire );
131200VIDEO_UPDATE( undrfire );
201VIDEO_UPDATE( cbombers );
132202
133203static UINT16 coin_word;
134204static UINT16 port_sel = 0;
r2241r2242
136206static int frame_counter=0;
137207
138208static UINT32 *undrfire_ram;   /* will be read in video for gun target calcs */
209static UINT32 *shared_ram;
139210
140
141211/***********************************************************
142212                COLOR RAM
143213
r2241r2242
241311   {
242312      case 0x00:
243313      {
244         if (ACCESSING_MSB32)   /* $500000 is watchdog */
314         if (ACCESSING_BITS_24_31)   /* $500000 is watchdog */
245315         {
246316            watchdog_reset(machine);
247317         }
248318
249         if (ACCESSING_LSB32)
319         if (ACCESSING_BITS_0_7)
250320         {
251321            EEPROM_set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
252322            EEPROM_write_bit(data & 0x40);
r2241r2242
259329
260330      case 0x01:
261331      {
262         if (ACCESSING_MSB32)
332         if (ACCESSING_BITS_24_31)
263333         {
264334            coin_lockout_w(0,~data & 0x01000000);
265335            coin_lockout_w(1,~data & 0x02000000);
r2241r2242
272342}
273343
274344
345static READ16_HANDLER( shared_ram_r )
346{
347   if ((offset&1)==0) return (shared_ram[offset/2]&0xffff0000)>>16;
348   return (shared_ram[offset/2]&0x0000ffff);
349}
350
351static WRITE16_HANDLER( shared_ram_w )
352{
353   if ((offset&1)==0) {
354      if (ACCESSING_BITS_8_15)
355         shared_ram[offset/2]=(shared_ram[offset/2]&0x00ffffff)|((data&0xff00)<<16);
356      if (ACCESSING_BITS_0_7)
357         shared_ram[offset/2]=(shared_ram[offset/2]&0xff00ffff)|((data&0x00ff)<<16);
358   } else {
359      if (ACCESSING_BITS_8_15)
360         shared_ram[offset/2]=(shared_ram[offset/2]&0xffff00ff)|((data&0xff00)<< 0);
361      if (ACCESSING_BITS_0_7)
362         shared_ram[offset/2]=(shared_ram[offset/2]&0xffffff00)|((data&0x00ff)<< 0);
363   }
364}
365
366
367
275368/* Some unknown hardware byte mapped at $600002-5 */
276369
277370static READ32_HANDLER( unknown_hardware_r )
r2241r2242
338431
339432static WRITE32_HANDLER( rotate_control_w )   /* only a guess that it's rotation */
340433{
341      if (ACCESSING_LSW32)
434      if (ACCESSING_BITS_0_15)
342435      {
343436         undrfire_rotate_ctrl[port_sel] = data;
344437         return;
345438      }
346439
347      if (ACCESSING_MSW32)
440      if (ACCESSING_BITS_16_31)
348441      {
349442         port_sel = (data &0x70000) >> 16;
350443      }
r2241r2242
367460*/
368461}
369462
463static WRITE32_HANDLER( cbombers_cpua_ctrl_w )
464{
465   cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (data &0x1000) ? CLEAR_LINE : ASSERT_LINE);
466}
370467
371468/***********************************************************
372469             MEMORY STRUCTURES
r2241r2242
410507ADDRESS_MAP_END
411508
412509
510
511static ADDRESS_MAP_START( cbombers_readmem, ADDRESS_SPACE_PROGRAM, 32 )
512   AM_RANGE(0x000000, 0x1fffff) AM_READ(SMH_ROM)
513   AM_RANGE(0x200000, 0x21ffff) AM_READ(SMH_RAM)   /* main CPUA ram */
514   AM_RANGE(0x300000, 0x303fff) AM_READ(SMH_RAM)   /* Sprite ram */
515   AM_RANGE(0x800000, 0x80ffff) AM_READ(TC0480SCP_long_r)
516   AM_RANGE(0x830000, 0x83002f) AM_READ(TC0480SCP_ctrl_long_r)
517//  AM_RANGE(0x340000, 0x340003) AM_READ(superchs_stick_r)  /* stick coord read */
518
519   AM_RANGE(0x500000, 0x500007) AM_READ(undrfire_input_r)
520   AM_RANGE(0xc00000, 0xc00007) AM_READ(undrfire_input_r)
521
522   AM_RANGE(0x700000, 0x7007ff) AM_READ(SMH_RAM)   /* Sound shared ram */
523
524   AM_RANGE(0x900000, 0x90ffff) AM_READ(SMH_RAM)
525   AM_RANGE(0xa00000, 0xa0ffff) AM_READ(SMH_RAM)   /* Palette ram */
526      AM_RANGE(0xe00000, 0xe0ffff) AM_READ(SMH_RAM)   /* Shared ram */
527
528ADDRESS_MAP_END
529
530static ADDRESS_MAP_START( cbombers_writemem, ADDRESS_SPACE_PROGRAM, 32 )
531   AM_RANGE(0x000000, 0x1fffff) AM_WRITE(SMH_ROM)
532   AM_RANGE(0x200000, 0x21ffff) AM_WRITE(SMH_RAM)// AM_BASE(&superchs_ram)
533   AM_RANGE(0x300000, 0x303fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram32) AM_SIZE(&spriteram_size)
534   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(TC0480SCP_long_w)
535   AM_RANGE(0x830000, 0x83002f) AM_WRITE(TC0480SCP_ctrl_long_w)
536
537   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(TC0100SCN_long_w)   /* piv tilemaps */
538   AM_RANGE(0x920000, 0x92000f) AM_WRITE(TC0100SCN_ctrl_long_w)
539
540   AM_RANGE(0x400000, 0x400003) AM_WRITE(cbombers_cpua_ctrl_w)
541   AM_RANGE(0x2c0000, 0x2c07ff) AM_WRITE(SMH_RAM) AM_BASE(&f3_shared_ram)
542//  AM_RANGE(0x340000, 0x340003) AM_WRITE(superchs_stick_w) /* stick int request */
543
544//  AM_RANGE(0x500000, 0x500003) AM_WRITE(MWA32_NOP)
545   AM_RANGE(0x500000, 0x500007) AM_WRITE(undrfire_input_w)   /* eerom etc. */
546
547//  AM_RANGE(0x600000, 0x600007) AM_WRITE(unknown_int_req_w)    /* int request for unknown hardware */
548
549   AM_RANGE(0x700000, 0x7007ff) AM_WRITE(SMH_RAM) AM_BASE(&f3_shared_ram)
550
551   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(SMH_RAM)
552   AM_RANGE(0xa00000, 0xa0ffff) AM_WRITE(color_ram_w) AM_BASE(&paletteram32)
553   AM_RANGE(0xe00000, 0xe0ffff) AM_WRITE(SMH_RAM) AM_BASE(&shared_ram)
554
555ADDRESS_MAP_END
556
557static ADDRESS_MAP_START( cbombers_cpub_readmem, ADDRESS_SPACE_PROGRAM, 16 )
558   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
559   AM_RANGE(0x400000, 0x40ffff) AM_READ(SMH_RAM)   /* local ram */
560   AM_RANGE(0x800000, 0x80ffff) AM_READ(shared_ram_r)
561//  AM_RANGE(0xa00000, 0xa001ff) AM_READ(SMH_RAM)
562ADDRESS_MAP_END
563
564static ADDRESS_MAP_START( cbombers_cpub_writemem, ADDRESS_SPACE_PROGRAM, 16 )
565   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
566   AM_RANGE(0x400000, 0x40ffff) AM_WRITE(SMH_RAM)
567//  AM_RANGE(0x600000, 0x60ffff) AM_WRITE(TC0480SCP_word_w) /* Only written upon errors */
568   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(shared_ram_w)
569//  AM_RANGE(0xa00000, 0xa001ff) AM_WRITE(SMH_RAM)  /* Extra road control?? */
570ADDRESS_MAP_END
571
572
573
413574/***********************************************************
414575             INPUT PORTS (dips in eprom)
415576***********************************************************/
r2241r2242
483644
484645
485646
647static INPUT_PORTS_START( cbombers )
648   PORT_START_TAG("IN0")
649   PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_UNKNOWN )
650   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_UNKNOWN )
651   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_UNKNOWN )
652   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1)   /* ? where is freeze input */
653   PORT_BIT( 0x0010, IP_ACTIVE_LOW,  IPT_UNKNOWN )
654   PORT_BIT( 0x0020, IP_ACTIVE_LOW,  IPT_UNKNOWN )
655   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_UNKNOWN )
656   PORT_BIT( 0x0080, IP_ACTIVE_LOW,  IPT_UNKNOWN )
657   PORT_BIT( 0x0100, IP_ACTIVE_LOW,  IPT_BUTTON4 ) PORT_PLAYER(1) // Nitro
658   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_BUTTON3 ) PORT_PLAYER(1) // Shift
659   PORT_BIT( 0x0400, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_PLAYER(1) // Accel
660   PORT_BIT( 0x0800, IP_ACTIVE_LOW,  IPT_BUTTON2 ) PORT_PLAYER(1) // Brake
661   PORT_BIT( 0x1000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
662   PORT_BIT( 0x2000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
663   PORT_BIT( 0x4000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
664   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
665
666   PORT_START_TAG("IN1")
667   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* Frame counter */
668   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_UNKNOWN )
669   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_UNKNOWN )
670   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_UNKNOWN )
671   PORT_BIT( 0x0010, IP_ACTIVE_LOW,  IPT_UNKNOWN )
672   PORT_BIT( 0x0020, IP_ACTIVE_LOW,  IPT_UNKNOWN )
673   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_UNKNOWN )
674   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* reserved for EEROM */
675   PORT_BIT( 0x0100, IP_ACTIVE_LOW,  IPT_UNKNOWN )
676   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_UNKNOWN )
677   PORT_BIT( 0x0400, IP_ACTIVE_LOW,  IPT_UNKNOWN )
678   PORT_BIT( 0x0800, IP_ACTIVE_LOW,  IPT_UNKNOWN )
679   PORT_BIT( 0x1000, IP_ACTIVE_LOW,  IPT_START1 )
680   PORT_BIT( 0x2000, IP_ACTIVE_LOW,  IPT_START2 )
681   PORT_BIT( 0x4000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
682   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
683
684   PORT_START_TAG("IN2")
685   PORT_SERVICE_NO_TOGGLE(0x01, IP_ACTIVE_LOW)
686   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_SERVICE1 )
687   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_COIN1 )
688   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_COIN2 )
689   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_UNKNOWN )
690   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_UNKNOWN )
691   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN )
692   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
693
694   /* Gun inputs (real range is 0-0xffff: we use standard 0-255 and shift later) */
695
696   PORT_START_TAG("IN3")   /* IN 3, P1X */
697   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, -1.0, 0.0, 0) PORT_SENSITIVITY(20) PORT_KEYDELTA(25) PORT_REVERSE PORT_PLAYER(1)
698
699   PORT_START_TAG("IN4")   /* IN 4, P1Y */
700   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(20) PORT_KEYDELTA(25) PORT_PLAYER(1)
701
702   PORT_START_TAG("IN5")   /* IN 5, P2X */
703   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, -1.0, 0.0, 0) PORT_SENSITIVITY(20) PORT_KEYDELTA(25) PORT_REVERSE PORT_PLAYER(2)
704
705   PORT_START_TAG("IN6")   /* IN 6, P2Y */
706   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(20) PORT_KEYDELTA(25) PORT_PLAYER(2)
707
708   PORT_START_TAG("FAKE")
709   PORT_BIT(    0x01, 0x00, IPT_DIPSWITCH_NAME ) PORT_NAME("Show gun target") PORT_CODE(KEYCODE_F1) PORT_TOGGLE
710   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
711   PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
712INPUT_PORTS_END
713
714
486715/**********************************************************
487716                GFX DECODING
488717**********************************************************/
r2241r2242
527756   GFXDECODE_ENTRY( REGION_GFX3, 0x0, pivlayout,         0, 512 )
528757GFXDECODE_END
529758
759static GFXDECODE_START( cbombers )
760   GFXDECODE_ENTRY( REGION_GFX2, 0x0, tile16x16_layout,  0, 512 )
761   GFXDECODE_ENTRY( REGION_GFX1, 0x0, charlayout,        0x1000, 512 )
762   GFXDECODE_ENTRY( REGION_GFX3, 0x0, pivlayout,         0, 512 )
763GFXDECODE_END
530764
531765/***********************************************************
532766                 MACHINE DRIVERS
r2241r2242
577811MACHINE_DRIVER_END
578812
579813
814static MACHINE_DRIVER_START( cbombers )
580815
816   /* basic machine hardware */
817   MDRV_CPU_ADD(M68EC020, 16000000)   /* 16 MHz */
818   MDRV_CPU_PROGRAM_MAP(cbombers_readmem, cbombers_writemem)
819   MDRV_CPU_VBLANK_INT("main", irq4_line_hold)
820
821   TAITO_F3_SOUND_SYSTEM_CPU(16000000)
822
823   MDRV_CPU_ADD(M68000, 16000000)   /* 16 MHz */
824   MDRV_CPU_PROGRAM_MAP(cbombers_cpub_readmem, cbombers_cpub_writemem)
825   MDRV_CPU_VBLANK_INT("main", irq4_line_hold)
826
827   MDRV_INTERLEAVE(8)   /* CPU slices - Need to interleave Cpu's 1 & 3 */
828
829   MDRV_MACHINE_RESET(undrfire)
830   MDRV_NVRAM_HANDLER(undrfire)
831
832   /* video hardware */
833   MDRV_SCREEN_ADD("main", RASTER)
834   MDRV_SCREEN_REFRESH_RATE(60)
835   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
836   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
837   MDRV_SCREEN_SIZE(40*8, 32*8)
838   MDRV_SCREEN_VISIBLE_AREA(0, 40*8-1, 3*8, 32*8-1)
839
840
841   MDRV_GFXDECODE(cbombers)
842   MDRV_PALETTE_LENGTH(16384)
843
844   MDRV_VIDEO_START(undrfire)
845   MDRV_VIDEO_UPDATE(cbombers)
846
847   /* sound hardware */
848   TAITO_F3_SOUND_SYSTEM_ES5505(13343000)
849MACHINE_DRIVER_END
850
851
581852/***************************************************************************
582853                    DRIVERS
583854***************************************************************************/
r2241r2242
691962   ROM_LOAD16_BYTE( "d67-02", 0xc00000, 0x200000, CRC(fceb715e) SHA1(9326513acb0696669d4f2345649ab37c8c6ed171) )
692963ROM_END
693964
965ROM_START( cbombers )
966   ROM_REGION( 0x200000, REGION_CPU1, 0 )   /* 2048K for 68020 code (CPU A) */
967   ROM_LOAD32_BYTE( "d83_39.ic17", 0x00000, 0x80000, CRC(b9f48284) SHA1(acc5d412e8900dda483a89a1ac1febd6d5735f3c) )
968   ROM_LOAD32_BYTE( "d83_41.ic4",  0x00001, 0x80000, CRC(a2f4c8be) SHA1(0f8f3b5ecff34d8c35af1ab11bb5528b52e30109) )
969   ROM_LOAD32_BYTE( "d83_40.ic3",  0x00002, 0x80000, CRC(b05f59ea) SHA1(e46a31737f44be2a3d478b8010fe0d6383290e03) )
970   ROM_LOAD32_BYTE( "d83_38.ic16", 0x00003, 0x80000, CRC(0a10616c) SHA1(c9cfc8c870f8a989f004d2db4f6fb76e5b7b7f9b) )
694971
972   ROM_REGION( 0x140000, REGION_CPU2, 0 )   /* Sound cpu */
973   ROM_LOAD16_BYTE( "d83_26.ic37", 0x100000, 0x20000, CRC(4f49b484) SHA1(96daa3cb7fa4aae3aedc91ec27d85945311dfcc9) )
974   ROM_LOAD16_BYTE( "d83_27.ic38", 0x100001, 0x20000, CRC(2aa1a237) SHA1(b809f75bbbbb4eb5d0df725aaa31aae8a6fba552) )
975
976   ROM_REGION( 0x40000, REGION_CPU3, 0 )   /* 256K for 68000 code (CPU B) */
977   ROM_LOAD16_BYTE( "d83_28.ic26", 0x00001, 0x20000, CRC(06328ef7) SHA1(90a14649e56221e47b87958896f6eae4556265c2) )
978   ROM_LOAD16_BYTE( "d83_29.ic27", 0x00000, 0x20000, CRC(771b4080) SHA1(a47c3a6abc07a6a61b694d32baa0ad4c25045841) )
979
980   ROM_REGION( 0x400000, REGION_GFX1, ROMREGION_DISPOSE )
981   ROM_LOAD16_BYTE( "d83_04.ic8", 0x000000, 0x200000, CRC(79f36cce) SHA1(2c8dc4cd5c4aa335c1e45888f5947acf94fa628a) )
982   ROM_LOAD16_BYTE( "d83_05.ic7", 0x000001, 0x200000, CRC(7787e495) SHA1(1758de5fdd1d12727368d08d7d4752c3756fc23e) )
983
984   ROM_REGION( 0x1800000, REGION_GFX2, ROMREGION_DISPOSE )
985   ROM_LOAD32_BYTE( "d83_06.ic28", 0x000003, 0x200000, CRC(4b71944e) SHA1(e8ed190280c7378fb4edcb192cef0d4d62582ad5) )
986   ROM_LOAD32_BYTE( "d83_07.ic30", 0x000002, 0x200000, CRC(29861b61) SHA1(76562b0243c1bc38623c0ef9d20de7572a979e37) )
987   ROM_LOAD32_BYTE( "d83_08.ic32", 0x000001, 0x200000, CRC(a0e81e01) SHA1(96ad8cfc849caaf85350cfc7cf23ad23635a3813) )
988   ROM_LOAD32_BYTE( "d83_09.ic45", 0x000000, 0x200000, CRC(7e4dec50) SHA1(4d8c1be739d425d8ded07774094b775f35a915bf) )
989   ROM_LOAD32_BYTE( "d83_11.ic41", 0x800003, 0x100000, CRC(a790e490) SHA1(9c57405ef2ef3368eb0958a3e43601110c1cc90d) )
990   ROM_LOAD32_BYTE( "d83_12.ic29", 0x800002, 0x100000, CRC(2f237b0d) SHA1(2ecb947671d263a77510bfebda03f883b55b8df4) )
991   ROM_LOAD32_BYTE( "d83_13.ic31", 0x800001, 0x100000, CRC(c2cceeb6) SHA1(3ec932655326caed13a40394bbf8e8baf836de2a) )
992   ROM_LOAD32_BYTE( "d83_14.ic44", 0x800000, 0x100000, CRC(8b6f4f12) SHA1(6a28004d287f00627622376aa3d6704f2684a6f3) )
993   ROM_LOAD32_BYTE( "d83_10.ic43", 0xc00000, 0x200000, CRC(36c440a0) SHA1(31685d3cdf4e39e1365df7e6a588c28f95d7e0a8) )
994   ROM_LOAD32_BYTE( "d83_15.ic42", 0x1400000, 0x100000, CRC(1b71175e) SHA1(60ad38ce97fd7995ff2f29d6b1a3b873dc2f0eb3) )
995
996   ROM_REGION( 0x400000, REGION_GFX3, ROMREGION_DISPOSE )
997   ROM_LOAD16_BYTE( "d83_16.ic19", 0x000000, 0x100000, CRC(d364cf1e) SHA1(ee43f50edf50ec840acfb98b1314140ee9693839) )
998   ROM_LOAD16_BYTE( "d83_17.ic5",  0x000001, 0x100000, CRC(0ffe737c) SHA1(5923a4edf9d0c8339f793840c2bdc691e2c651e6) )
999   ROM_LOAD       ( "d83_18.ic6",  0x300000, 0x100000, CRC(87979155) SHA1(0ffafa970f9f9c98f8938104b97e63d2b5757804) )
1000   ROM_FILL       (                0x200000, 0x100000, 0 )
1001
1002   ROM_REGION16_LE( 0x80000, REGION_USER1, 0 )
1003   ROM_LOAD16_BYTE( "d83_31.ic10", 0x000001, 0x40000, CRC(85c37961) SHA1(15ea5c4904d910575e984e146c8941dff913d45f) )
1004   ROM_LOAD16_BYTE( "d83_32.ic11", 0x000000, 0x40000, CRC(b0db2559) SHA1(2bfae2dbe164b42e95d0a93fab82b7040c3fbc56) )
1005
1006   ROM_REGION( 0x40000, REGION_USER2, 0 )
1007   ROM_LOAD( "d83_30.ic9", 0x00000,  0x40000,  CRC(eb86dc67) SHA1(31c7b6f30ff912fafed4b87ce8bf603ee17d1664) )
1008
1009   ROM_REGION16_BE( 0x1000000, REGION_SOUND1 , ROMREGION_ERASE00 )
1010   ROM_LOAD16_BYTE( "d83_01.ic40", 0xc00000, 0x200000, CRC(912799f4) SHA1(22f69e61519d2cddcfc4e4c9601e78a9d5265d5b) )
1011   ROM_LOAD16_BYTE( "d83_02.ic39", 0x000000, 0x200000, CRC(2abca020) SHA1(3491a95651ca89b7fe6d040b8576fa7646bfe84b) )
1012   ROM_RELOAD     (                0x400000, 0x200000 )
1013   ROM_LOAD16_BYTE( "d83_03.ic18", 0x800000, 0x200000, CRC(1b2d9ec3) SHA1(ead6b5542ad3987ef0f9ea01ce7f960abc9119b3) )
1014ROM_END
1015
1016
1017
6951018static READ32_HANDLER( main_cycle_r )
6961019{
6971020   int ptr;
r2241r2242
7371060}
7381061
7391062
1063static DRIVER_INIT( cbombers )
1064{
1065   UINT32 offset,i;
1066   UINT8 *gfx = memory_region(REGION_GFX3);
1067   int size=memory_region_length(REGION_GFX3);
1068   int data;
1069
1070
1071   /* make piv tile GFX format suitable for gfxdecode */
1072   offset = size/2;
1073   for (i = size/2+size/4; i<size; i++)
1074   {
1075      int d1,d2,d3,d4;
1076
1077      /* Expand 2bits into 4bits format */
1078      data = gfx[i];
1079      d1 = (data>>0) & 3;
1080      d2 = (data>>2) & 3;
1081      d3 = (data>>4) & 3;
1082      d4 = (data>>6) & 3;
1083
1084      gfx[offset] = (d1<<2) | (d2<<6);
1085      offset++;
1086
1087      gfx[offset] = (d3<<2) | (d4<<6);
1088      offset++;
1089   }
1090}
1091
1092
1093
7401094GAME( 1993, undrfire, 0,        undrfire, undrfire, undrfire, ROT0, "Taito Corporation Japan", "Under Fire (World)", 0 )
7411095GAME( 1993, undrfiru, undrfire, undrfire, undrfire, undrfire, ROT0, "Taito America Corporation", "Under Fire (US)", 0 )
7421096GAME( 1993, undrfirj, undrfire, undrfire, undrfire, undrfire, ROT0, "Taito Corporation", "Under Fire (Japan)", 0 )
1097GAME( 1994, cbombers, 0,        cbombers, cbombers, cbombers, ROT0, "Taito Corporation", "Chase Bombers", GAME_NOT_WORKING )
src/mame/drivers/deco32.c
r2241r2242
359359
360360static WRITE32_HANDLER( fghthist_eeprom_w )
361361{
362   if (ACCESSING_LSB32) {
362   if (ACCESSING_BITS_0_7) {
363363      EEPROM_set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
364364      EEPROM_write_bit(data & 0x10);
365365      EEPROM_set_cs_line((data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
366366   }
367   else if (mem_mask&0x0000ff00)
367   else if (!ACCESSING_BITS_8_15)
368368   {
369369      // Volume port
370370   }
r2241r2242
434434
435435static WRITE32_HANDLER( dragngun_eeprom_w )
436436{
437   if (ACCESSING_LSB32) {
437   if (ACCESSING_BITS_0_7) {
438438      EEPROM_set_clock_line((data & 0x2) ? ASSERT_LINE : CLEAR_LINE);
439439      EEPROM_write_bit(data & 0x1);
440440      EEPROM_set_cs_line((data & 0x4) ? CLEAR_LINE : ASSERT_LINE);
r2241r2242
635635
636636static WRITE32_HANDLER( nslasher_eeprom_w )
637637{
638   if (ACCESSING_LSB32)
638   if (ACCESSING_BITS_0_7)
639639   {
640640      EEPROM_set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
641641      EEPROM_write_bit(data & 0x10);
src/mame/drivers/vertigo.c
r2241r2242
2323 *
2424 *************************************/
2525
26static READ16_DEVICE_HANDLER( vertigo_pit8254_lsb_r ) { return pit8253_r( device, offset ); }
27static WRITE16_DEVICE_HANDLER( vertigo_pit8254_lsb_w ) { if (ACCESSING_BITS_0_7) pit8253_w(device, offset, data); }
28
2629static ADDRESS_MAP_START( vertigo_map, ADDRESS_SPACE_PROGRAM, 16 )
2730   AM_RANGE(0x000000, 0x000007) AM_ROM
2831   AM_RANGE(0x000008, 0x001fff) AM_RAM AM_MIRROR(0x010000)
r2241r2242
3538   AM_RANGE(0x004050, 0x00405f) AM_READWRITE(SMH_RAM, vertigo_audio_w) AM_MIRROR(0x001000)
3639   AM_RANGE(0x004060, 0x00406f) AM_WRITE(vertigo_motor_w) AM_MIRROR(0x001000)
3740   AM_RANGE(0x004070, 0x00407f) AM_WRITE(vertigo_wsot_w) AM_MIRROR(0x001000)
38   AM_RANGE(0x006000, 0x006007) AM_READWRITE(pit8253_0_lsb_r, pit8253_0_lsb_w)
41   AM_RANGE(0x006000, 0x006007) AM_DEVREADWRITE(PIT8254, "pit8254", vertigo_pit8254_lsb_r, vertigo_pit8254_lsb_w)
3942   AM_RANGE(0x007000, 0x0073ff) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size)
4043   AM_RANGE(0x800000, 0x81ffff) AM_ROM
4144ADDRESS_MAP_END
r2241r2242
108111
109112   MDRV_IMPORT_FROM(exidy440_audio)
110113
114   MDRV_DEVICE_ADD( "pit8254", PIT8254 )
115   MDRV_DEVICE_CONFIG( vertigo_pit8254_config )
116
111117   /* motor controller */
112118   /*
113119    MDRV_CPU_ADD(M6805, 1000000)
src/mame/drivers/grchamp.c
r2241r2242
202202{
203203   static const UINT8 ls247_map[16] =
204204      { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x58,0x4c,0x62,0x69,0x78,0x00 };
205   grchamp_state *state = Machine->driver_data;
205   grchamp_state *state = machine->driver_data;
206206
207207   switch (offset)
208208   {
r2241r2242
354354
355355static READ8_HANDLER( pc3259_0_r )
356356{
357   grchamp_state *state = Machine->driver_data;
357   grchamp_state *state = machine->driver_data;
358358   return get_pc3259_bits(state, 0);
359359}
360360
361361
362362static READ8_HANDLER( pc3259_1_r )
363363{
364   grchamp_state *state = Machine->driver_data;
364   grchamp_state *state = machine->driver_data;
365365   return get_pc3259_bits(state, 1);
366366}
367367
368368
369369static READ8_HANDLER( pc3259_2_r )
370370{
371   grchamp_state *state = Machine->driver_data;
371   grchamp_state *state = machine->driver_data;
372372   return get_pc3259_bits(state, 2);
373373}
374374
375375
376376static READ8_HANDLER( pc3259_3_r )
377377{
378   grchamp_state *state = Machine->driver_data;
378   grchamp_state *state = machine->driver_data;
379379   return get_pc3259_bits(state, 3);
380380}
381381
r2241r2242
389389
390390static READ8_HANDLER( sub_to_main_comm_r )
391391{
392   grchamp_state *state = Machine->driver_data;
392   grchamp_state *state = machine->driver_data;
393393   return state->comm_latch;
394394}
395395
r2241r2242
410410
411411static READ8_HANDLER( main_to_sub_comm_r )
412412{
413   grchamp_state *state = Machine->driver_data;
413   grchamp_state *state = machine->driver_data;
414414   return state->comm_latch2[offset];
415415}
416416
src/mame/drivers/goodejan.c
r2241r2242
124124ADDRESS_MAP_END
125125
126126static INPUT_PORTS_START( goodejan )
127   /* Must be port 0: coin inputs read through sound cpu */
128   SEIBU_COIN_INPUTS
127   SEIBU_COIN_INPUTS   /* coin inputs read through sound cpu */
129128
130129   PORT_START
131130   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
src/mame/drivers/gaiden.c
r2241r2242
163163
164164static WRITE16_HANDLER( gaiden_sound_command_w )
165165{
166   if (ACCESSING_LSB) soundlatch_w(machine,0,data & 0xff);   /* Ninja Gaiden */
167   if (ACCESSING_MSB) soundlatch_w(machine,0,data >> 8);   /* Tecmo Knight */
166   if (ACCESSING_BITS_0_7) soundlatch_w(machine,0,data & 0xff);   /* Ninja Gaiden */
167   if (ACCESSING_BITS_8_15) soundlatch_w(machine,0,data >> 8);   /* Tecmo Knight */
168168   cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
169169}
170170
171171static WRITE16_HANDLER( drgnbowl_sound_command_w )
172172{
173   if (ACCESSING_MSB)
173   if (ACCESSING_BITS_8_15)
174174   {
175175      soundlatch_w(machine,0,data >> 8);
176176      cpunum_set_input_line(machine, 1,0,HOLD_LINE);
r2241r2242
187187
188188static WRITE16_HANDLER( wildfang_protection_w )
189189{
190   if (ACCESSING_MSB)
190   if (ACCESSING_BITS_8_15)
191191   {
192192      static int jumpcode;
193193      static const int jumppoints[] =
r2241r2242
321321
322322static WRITE16_HANDLER( raiga_protection_w )
323323{
324   if (ACCESSING_MSB)
324   if (ACCESSING_BITS_8_15)
325325   {
326326      static int jumpcode;
327327
src/mame/drivers/zaxxon.c
r2241r2242
475475static ADDRESS_MAP_START( zaxxon_map, ADDRESS_SPACE_PROGRAM, 8 )
476476   AM_RANGE(0x0000, 0x5fff) AM_ROM
477477   AM_RANGE(0x6000, 0x6fff) AM_RAM
478   AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x1c00) AM_READWRITE(SMH_RAM, zaxxon_videoram_w) AM_BASE(&videoram)
478   AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x1c00) AM_RAM AM_WRITE(zaxxon_videoram_w) AM_BASE(&videoram)
479479   AM_RANGE(0xa000, 0xa0ff) AM_MIRROR(0x1f00) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
480480   AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x18fc) AM_READ_PORT("SW00")
481481   AM_RANGE(0xc001, 0xc001) AM_MIRROR(0x18fc) AM_READ_PORT("SW01")
r2241r2242
498498static ADDRESS_MAP_START( congo_map, ADDRESS_SPACE_PROGRAM, 8 )
499499   AM_RANGE(0x0000, 0x7fff) AM_ROM
500500   AM_RANGE(0x8000, 0x8fff) AM_RAM
501   AM_RANGE(0xa000, 0xa3ff) AM_MIRROR(0x1800) AM_READWRITE(SMH_RAM, zaxxon_videoram_w) AM_BASE(&videoram)
502   AM_RANGE(0xa400, 0xa7ff) AM_MIRROR(0x1800) AM_READWRITE(SMH_RAM, congo_colorram_w) AM_BASE(&colorram)
501   AM_RANGE(0xa000, 0xa3ff) AM_MIRROR(0x1800) AM_RAM AM_WRITE(zaxxon_videoram_w) AM_BASE(&videoram)
502   AM_RANGE(0xa400, 0xa7ff) AM_MIRROR(0x1800) AM_RAM AM_WRITE(congo_colorram_w) AM_BASE(&colorram)
503503   AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x1fc4) AM_READ_PORT("SW00")
504504   AM_RANGE(0xc001, 0xc001) AM_MIRROR(0x1fc4) AM_READ_PORT("SW01")
505505   AM_RANGE(0xc002, 0xc002) AM_MIRROR(0x1fc4) AM_READ_PORT("DSW02")
src/mame/drivers/xtheball.c
r2241r2242
125125
126126static WRITE16_HANDLER( dac_w )
127127{
128   if (ACCESSING_MSB)
128   if (ACCESSING_BITS_8_15)
129129      DAC_data_w(0, data >> 8);
130130}
131131
r2241r2242
139139
140140static WRITE16_HANDLER( bit_controls_w )
141141{
142   if (ACCESSING_LSB)
142   if (ACCESSING_BITS_0_7)
143143   {
144144      if (bitvals[offset] != (data & 1))
145145      {
src/mame/drivers/vegas.c
r2241r2242
13411341
13421342static WRITE32_HANDLER( sio_irq_clear_w )
13431343{
1344   if (!(mem_mask & 0x000000ff))
1344   if (ACCESSING_BITS_0_7)
13451345   {
13461346      sio_irq_clear = data;
13471347
r2241r2242
13701370
13711371static WRITE32_HANDLER( sio_irq_enable_w )
13721372{
1373   if (!(mem_mask & 0x000000ff))
1373   if (ACCESSING_BITS_0_7)
13741374   {
13751375      sio_irq_enable = data;
13761376      update_sio_irqs();
r2241r2242
13921392
13931393static WRITE32_HANDLER( sio_led_w )
13941394{
1395   if (!(mem_mask & 0x000000ff))
1395   if (ACCESSING_BITS_0_7)
13961396      sio_led_state = data;
13971397}
13981398
r2241r2242
14121412
14131413static WRITE32_HANDLER( sio_w )
14141414{
1415   if (!(mem_mask & 0x000000ff)) offset += 0;
1416   if (!(mem_mask & 0x0000ff00)) offset += 1;
1417   if (!(mem_mask & 0x00ff0000)) offset += 2;
1418   if (!(mem_mask & 0xff000000)) offset += 3;
1415   if (ACCESSING_BITS_0_7) offset += 0;
1416   if (ACCESSING_BITS_8_15) offset += 1;
1417   if (ACCESSING_BITS_16_23) offset += 2;
1418   if (ACCESSING_BITS_24_31) offset += 3;
14191419   if (LOG_SIO && offset != 0)
14201420      logerror("%08X:sio write to offset %X = %02X\n", activecpu_get_pc(), offset, data >> (offset*8));
14211421   if (offset < 4)
r2241r2242
14281428static READ32_HANDLER( sio_r )
14291429{
14301430   UINT32 result = 0;
1431   if (!(mem_mask & 0x000000ff)) offset += 0;
1432   if (!(mem_mask & 0x0000ff00)) offset += 1;
1433   if (!(mem_mask & 0x00ff0000)) offset += 2;
1434   if (!(mem_mask & 0xff000000)) offset += 3;
1431   if (ACCESSING_BITS_0_7) offset += 0;
1432   if (ACCESSING_BITS_8_15) offset += 1;
1433   if (ACCESSING_BITS_16_23) offset += 2;
1434   if (ACCESSING_BITS_24_31) offset += 3;
14351435   if (offset < 4)
14361436      result = sio_data[0] | (sio_data[1] << 8) | (sio_data[2] << 16) | (sio_data[3] << 24);
14371437   if (LOG_SIO && offset != 2)
r2241r2242
15071507static READ32_HANDLER( ethernet_r )
15081508{
15091509   UINT32 result = 0;
1510   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
1510   if (ACCESSING_BITS_0_15)
15111511      result |= smc91c94_r(machine, offset * 2 + 0, mem_mask);
1512   if ((mem_mask & 0xffff0000) != 0xffff0000)
1512   if (ACCESSING_BITS_16_31)
15131513      result |= smc91c94_r(machine, offset * 2 + 1, mem_mask >> 16) << 16;
15141514   return result;
15151515}
r2241r2242
15171517
15181518static WRITE32_HANDLER( ethernet_w )
15191519{
1520   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
1520   if (ACCESSING_BITS_0_15)
15211521      smc91c94_w(machine, offset * 2 + 0, data, mem_mask);
1522   if ((mem_mask & 0xffff0000) != 0xffff0000)
1522   if (ACCESSING_BITS_16_31)
15231523      smc91c94_w(machine, offset * 2 + 1, data >> 16, mem_mask >> 16);
15241524}
15251525
src/mame/drivers/tecmo.c
r2241r2242
566566static MACHINE_DRIVER_START( rygar )
567567
568568   /* basic machine hardware */
569   MDRV_CPU_ADD_TAG("main", Z80, 4000000)
569   MDRV_CPU_ADD_TAG("main", Z80, XTAL_24MHz/4) /* verified on pcb */
570570   MDRV_CPU_PROGRAM_MAP(readmem,rygar_writemem)
571571   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
572572
573   MDRV_CPU_ADD_TAG("sound", Z80, 4000000)
573   MDRV_CPU_ADD_TAG("sound", Z80, XTAL_4MHz) /* verified on pcb */
574574   /* audio CPU */
575575   MDRV_CPU_PROGRAM_MAP(rygar_sound_readmem,rygar_sound_writemem)
576576
r2241r2242
591591   /* sound hardware */
592592   MDRV_SPEAKER_STANDARD_MONO("mono")
593593
594   MDRV_SOUND_ADD(YM3812, 4000000)
594   MDRV_SOUND_ADD(YM3812, XTAL_4MHz) /* verified on pcb */
595595   MDRV_SOUND_CONFIG(ym3812_interface)
596596   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
597597
598   MDRV_SOUND_ADD(MSM5205, 384000)
598   MDRV_SOUND_ADD(MSM5205, XTAL_400kHz) /* verified on pcb, even if schematics shows a 384khz resonator */
599599   MDRV_SOUND_CONFIG(msm5205_interface)
600600   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
601601MACHINE_DRIVER_END
src/mame/drivers/galpanic.c
r2241r2242
161161
162162static WRITE16_HANDLER( galpanic_6295_bankswitch_w )
163163{
164   if (ACCESSING_MSB)
164   if (ACCESSING_BITS_8_15)
165165   {
166166      UINT8 *rom = memory_region(REGION_SOUND1);
167167
r2241r2242
174174
175175static WRITE16_HANDLER( galpania_6295_bankswitch_w )
176176{
177   if (ACCESSING_MSB)
177   if (ACCESSING_BITS_8_15)
178178   {
179179      UINT8 *rom = memory_region(REGION_SOUND1);
180180
r2241r2242
185185#ifdef UNUSED_FUNCTION
186186static WRITE16_HANDLER( galpania_misc_w )
187187{
188   if (ACCESSING_LSB)
188   if (ACCESSING_BITS_0_7)
189189   {
190190      pandora_set_clear_bitmap( data & 0x0004 );
191191   }
r2241r2242
196196
197197static WRITE16_HANDLER( galpanic_coin_w )
198198{
199   if (ACCESSING_MSB)
199   if (ACCESSING_BITS_8_15)
200200   {
201201      coin_counter_w(0, data & 0x100);
202202      coin_counter_w(1, data & 0x200);
src/mame/drivers/segaybd.c
r2241r2242
217217
218218static WRITE16_HANDLER( sound_data_w )
219219{
220   if (ACCESSING_LSB)
220   if (ACCESSING_BITS_0_7)
221221      timer_call_after_resynch(NULL, data & 0xff, delayed_sound_data_w);
222222}
223223
r2241r2242
344344static READ16_HANDLER( analog_r )
345345{
346346   int result = 0xff;
347   if (ACCESSING_LSB)
347   if (ACCESSING_BITS_0_7)
348348   {
349349      result = analog_data[offset & 3] & 0x80;
350350      analog_data[offset & 3] <<= 1;
src/mame/drivers/shuuz.c
r2241r2242
126126
127127static WRITE16_HANDLER( adpcm_w )
128128{
129   if (ACCESSING_LSB)
129   if (ACCESSING_BITS_0_7)
130130      OKIM6295_data_0_w(machine, offset, data & 0xff);
131131}
132132
src/mame/drivers/segaorun.c
r2241r2242
411411   switch (offset & 0x70/2)
412412   {
413413      case 0x00/2:
414         if (ACCESSING_LSB)
414         if (ACCESSING_BITS_0_7)
415415            ppi8255_0_w(machine, offset & 3, data);
416416         return;
417417
418418      case 0x20/2:
419         if (ACCESSING_LSB)
419         if (ACCESSING_BITS_0_7)
420420         {
421421            /* Output port:
422422                    D7: /MUTE
src/mame/drivers/gticlub.c
r2241r2242
283283   UINT32 r = 0;
284284   if (offset == 0)
285285   {
286      if (!(mem_mask & 0xff000000))
286      if (ACCESSING_BITS_24_31)
287287      {
288288         r |= readinputport(0) << 24;
289289      }
290      if (!(mem_mask & 0x00ff0000))
290      if (ACCESSING_BITS_16_23)
291291      {
292292         r |= readinputport(1) << 16;
293293      }
294      if (!(mem_mask & 0x0000ff00))
294      if (ACCESSING_BITS_8_15)
295295      {
296296         r |= (adc1038_sars_r() << 7) << 8;
297297      }
298      if (!(mem_mask & 0x000000ff))
298      if (ACCESSING_BITS_0_7)
299299      {
300300         r |= readinputport(3) << 0;
301301      }
r2241r2242
303303   }
304304   else if (offset == 1)
305305   {
306      if (!(mem_mask & 0xff000000) )
306      if (ACCESSING_BITS_24_31 )
307307      {
308308         // 7        0
309309         // |?????ae?|
r2241r2242
328328{
329329   if (offset == 0)
330330   {
331      if( !(mem_mask & 0xff000000) )
331      if( ACCESSING_BITS_24_31 )
332332      {
333333         gticlub_led_reg0 = (data >> 24) & 0xff;
334334      }
335      if( !(mem_mask & 0x00ff0000) )
335      if( ACCESSING_BITS_16_23 )
336336      {
337337         gticlub_led_reg1 = (data >> 16) & 0xff;
338338      }
339      if( !(mem_mask & 0x000000ff) )
339      if( ACCESSING_BITS_0_7 )
340340      {
341341         EEPROM_write_bit((data & 0x01) ? 1 : 0);
342342         EEPROM_set_clock_line((data & 0x02) ? ASSERT_LINE : CLEAR_LINE);
r2241r2242
345345   }
346346   if( offset == 1 )
347347   {
348      if (!(mem_mask & 0xff000000))
348      if (ACCESSING_BITS_24_31)
349349      {
350350         if (data & 0x80000000)   /* CG Board 1 IRQ Ack */
351351         {
r2241r2242
414414   UINT32 r = 0;
415415   int reg = offset * 4;
416416
417   if (!(mem_mask & 0xff000000))
417   if (ACCESSING_BITS_24_31)
418418   {
419419      r |= K056230_r(reg+0) << 24;
420420   }
421   if (!(mem_mask & 0x00ff0000))
421   if (ACCESSING_BITS_16_23)
422422   {
423423      r |= K056230_r(reg+1) << 16;
424424   }
425   if (!(mem_mask & 0x0000ff00))
425   if (ACCESSING_BITS_8_15)
426426   {
427427      r |= K056230_r(reg+2) << 8;
428428   }
429   if (!(mem_mask & 0x000000ff))
429   if (ACCESSING_BITS_0_7)
430430   {
431431      r |= K056230_r(reg+3) << 0;
432432   }
r2241r2242
438438{
439439   int reg = offset * 4;
440440
441   if (!(mem_mask & 0xff000000))
441   if (ACCESSING_BITS_24_31)
442442   {
443443      K056230_w(reg+0, (data >> 24) & 0xff);
444444   }
445   if (!(mem_mask & 0x00ff0000))
445   if (ACCESSING_BITS_16_23)
446446   {
447447      K056230_w(reg+1, (data >> 16) & 0xff);
448448   }
449   if (!(mem_mask & 0x0000ff00))
449   if (ACCESSING_BITS_8_15)
450450   {
451451      K056230_w(reg+2, (data >> 8) & 0xff);
452452   }
453   if (!(mem_mask & 0x000000ff))
453   if (ACCESSING_BITS_0_7)
454454   {
455455      K056230_w(reg+3, (data >> 0) & 0xff);
456456   }
src/mame/drivers/foodf.c
r2241r2242
173173
174174static WRITE16_HANDLER( digital_w )
175175{
176   if (ACCESSING_LSB)
176   if (ACCESSING_BITS_0_7)
177177   {
178178      foodf_set_flip(data & 0x01);
179179
r2241r2242
223223static READ16_HANDLER( pokey2_word_r ) { return pokey2_r(machine, offset); }
224224static READ16_HANDLER( pokey3_word_r ) { return pokey3_r(machine, offset); }
225225
226static WRITE16_HANDLER( pokey1_word_w ) { if (ACCESSING_LSB) pokey1_w(machine, offset, data & 0xff); }
227static WRITE16_HANDLER( pokey2_word_w ) { if (ACCESSING_LSB) pokey2_w(machine, offset, data & 0xff); }
228static WRITE16_HANDLER( pokey3_word_w ) { if (ACCESSING_LSB) pokey3_w(machine, offset, data & 0xff); }
226static WRITE16_HANDLER( pokey1_word_w ) { if (ACCESSING_BITS_0_7) pokey1_w(machine, offset, data & 0xff); }
227static WRITE16_HANDLER( pokey2_word_w ) { if (ACCESSING_BITS_0_7) pokey2_w(machine, offset, data & 0xff); }
228static WRITE16_HANDLER( pokey3_word_w ) { if (ACCESSING_BITS_0_7) pokey3_w(machine, offset, data & 0xff); }
229229
230230
231231
src/mame/drivers/namcona1.c
r2241r2242
2323
2424- Emeralda:
2525    After selecting the game type, tilemap scrolling is briefly incorrect
26    Shadow sprites, if enabled, make the score display invisible
2726    The demo sprites are incorrect, you should see a dolphin speaking
2827    the instructions and the playfield is wrong.
2928    Byte 0x25 of the NVRAM controls the FBI logo. 0x00 is on, 0x01 is off
r2241r2242
264263
265264static WRITE16_HANDLER( namcona1_nvram_w )
266265{
267   if( ACCESSING_LSB )
266   if( ACCESSING_BITS_0_7 )
268267   {
269268      namcona1_nvmem[offset] = data&0xff;
270269   }
r2241r2242
727726   old_count = count;
728727   do
729728   {
730      count = mame_rand(Machine);
729      count = mame_rand(machine);
731730   } while( old_count == count );
732731
733732   switch( namcona1_gametype )
r2241r2242
798797   default:
799798      return 0;
800799   }
801   return mame_rand(Machine)&0xffff;
800   return mame_rand(machine)&0xffff;
802801} /* custom_key_r */
803802
804803static WRITE16_HANDLER( custom_key_w )
r2241r2242
10541053
10551054/***************************************************************/
10561055
1057static WRITE16_HANDLER( bogus_w )
1058{
1059//  DEBUGGER_BREAK;
1060}
1061static READ16_HANDLER( bogus_r )
1062{
1063//  DEBUGGER_BREAK;
1064   return 0;
1065}
1066
10671056// MCU "mailslot" handler - has 8 16-bit slots mirrored
10681057static UINT16 mcu_mailbox[8];
10691058
r2241r2242
10761065{
10771066//  logerror("mailbox_w_68k: %x @ %x\n", data, offset);
10781067
1079   if (offset == 4) cpunum_set_input_line(Machine, 1, M37710_LINE_IRQ0, HOLD_LINE);
1068   if (offset == 4) cpunum_set_input_line(machine, 1, M37710_LINE_IRQ0, HOLD_LINE);
10801069
10811070   COMBINE_DATA(&mcu_mailbox[offset%8]);
10821071}
r2241r2242
10861075   COMBINE_DATA(&mcu_mailbox[offset%8]);
10871076}
10881077
1089static ADDRESS_MAP_START( namcona1_mcu_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1078static ADDRESS_MAP_START( namcona1_main_map, ADDRESS_SPACE_PROGRAM, 16 )
10901079   AM_RANGE(0x000000, 0x07ffff) AM_RAM AM_BASE(&namcona1_workram)
1091   AM_RANGE(0x080000, 0x3f7fff) AM_READ(bogus_r)
1092   AM_RANGE(0x3f8000, 0x3fffff) AM_READ(mcu_mailbox_r)
1080   AM_RANGE(0x3f8000, 0x3fffff) AM_READWRITE(mcu_mailbox_r, mcu_mailbox_w_68k)
10931081   AM_RANGE(0x400000, 0xbfffff) AM_ROM AM_REGION(REGION_CPU1, 0x280000)   /* data */
10941082   AM_RANGE(0xc00000, 0xdfffff) AM_ROM AM_REGION(REGION_CPU1, 0x080000)   /* code */
1095   AM_RANGE(0xe00000, 0xe00fff) AM_READ(namcona1_nvram_r)
1096   AM_RANGE(0xe40000, 0xe4000f) AM_READ(custom_key_r)
1097   AM_RANGE(0xe40010, 0xeffeff) AM_READ(bogus_r)
1098   AM_RANGE(0xefff00, 0xefffff) AM_READ(namcona1_vreg_r)
1099   AM_RANGE(0xf00000, 0xf01fff) AM_READ(namcona1_paletteram_r)
1100   AM_RANGE(0xf02000, 0xf3ffff) AM_READ(bogus_r)
1101   AM_RANGE(0xf40000, 0xf7ffff) AM_READ(namcona1_gfxram_r)
1102   AM_RANGE(0xf80000, 0xfeffff) AM_READ(bogus_r)
1103   AM_RANGE(0xff0000, 0xff7fff) AM_READ(namcona1_videoram_r)
1104   AM_RANGE(0xff8000, 0xffdfff) AM_READ(SMH_RAM)      /* spare videoram */
1105   AM_RANGE(0xffe000, 0xffefff) AM_READ(SMH_RAM)      /* scroll registers */
1106   AM_RANGE(0xfff000, 0xffffff) AM_READ(SMH_RAM)      /* spriteram */
1083   AM_RANGE(0xe00000, 0xe00fff) AM_READWRITE(namcona1_nvram_r, namcona1_nvram_w)
1084   AM_RANGE(0xe40000, 0xe4000f) AM_READWRITE(custom_key_r, custom_key_w)
1085   AM_RANGE(0xefff00, 0xefffff) AM_READWRITE(namcona1_vreg_r, namcona1_vreg_w) AM_BASE(&namcona1_vreg)
1086   AM_RANGE(0xf00000, 0xf01fff) AM_READWRITE(namcona1_paletteram_r, namcona1_paletteram_w) AM_BASE(&paletteram16)
1087   AM_RANGE(0xf40000, 0xf7ffff) AM_READWRITE(namcona1_gfxram_r, namcona1_gfxram_w)
1088   AM_RANGE(0xff0000, 0xff7fff) AM_READWRITE(namcona1_videoram_r, namcona1_videoram_w) AM_BASE(&videoram16)
1089   AM_RANGE(0xff8000, 0xffdfff) AM_RAM AM_BASE(&namcona1_sparevram)   /* spare videoram */
1090   AM_RANGE(0xffe000, 0xffefff) AM_RAM   AM_BASE(&namcona1_scroll)      /* scroll registers */
1091   AM_RANGE(0xfff000, 0xffffff) AM_RAM   AM_BASE(&spriteram16)         /* spriteram */
11071092ADDRESS_MAP_END
11081093
1109static ADDRESS_MAP_START( namcona1_mcu_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1110   AM_RANGE(0x000000, 0x07ffff) AM_RAM
1111   AM_RANGE(0x080000, 0x3f7fff) AM_WRITE(bogus_w)
1112   AM_RANGE(0x3f8000, 0x3fffff) AM_WRITE(mcu_mailbox_w_68k)
1113   AM_RANGE(0x400000, 0xdfffff) AM_WRITE(SMH_ROM) /* data + code */
1114   AM_RANGE(0xe00000, 0xe00fff) AM_WRITE(namcona1_nvram_w)
1115   AM_RANGE(0xe01000, 0xe3ffff) AM_WRITE(bogus_w)
1116   AM_RANGE(0xe40000, 0xe4000f) AM_WRITE(custom_key_w)
1117   AM_RANGE(0xe40010, 0xeffeff) AM_WRITE(bogus_w)
1118   AM_RANGE(0xefff00, 0xefffff) AM_WRITE(namcona1_vreg_w) AM_BASE(&namcona1_vreg)
1119   AM_RANGE(0xf00000, 0xf01fff) AM_WRITE(namcona1_paletteram_w) AM_BASE(&paletteram16)
1120   AM_RANGE(0xf02000, 0xf3ffff) AM_WRITE(bogus_w)
1121   AM_RANGE(0xf40000, 0xf7ffff) AM_WRITE(namcona1_gfxram_w)
1122   AM_RANGE(0xf80000, 0xfeffff) AM_WRITE(bogus_w)
1123   AM_RANGE(0xff0000, 0xff7fff) AM_WRITE(namcona1_videoram_w) AM_BASE(&videoram16)
1124   AM_RANGE(0xff8000, 0xffdfff) AM_WRITE(SMH_RAM) AM_BASE(&namcona1_sparevram)
1125   AM_RANGE(0xffe000, 0xffefff) AM_WRITE(SMH_RAM) AM_BASE(&namcona1_scroll)
1126   AM_RANGE(0xfff000, 0xffffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16)
1127ADDRESS_MAP_END
1128
11291094/* ----- NA-1 MCU handling ----------------------------------- */
11301095
11311096static READ16_HANDLER( na1mcu_shared_r )
r2241r2242
11591124
11601125static WRITE16_HANDLER(snd_w)
11611126{
1162   if (ACCESSING_LSB16)
1127   if (ACCESSING_BITS_0_7)
11631128   {
11641129      C140_w(machine,(offset*2)+1, data);
11651130   }
11661131
1167   if (ACCESSING_MSB16)
1132   if (ACCESSING_BITS_8_15)
11681133   {
11691134      C140_w(machine,(offset*2), data>>8);
11701135   }
r2241r2242
11941159      logerror("launching 68k, PC=%x\n", activecpu_get_pc());
11951160
11961161      // reset and launch the 68k
1197      cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, CLEAR_LINE);
1162      cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, CLEAR_LINE);
11981163   }
11991164
12001165   mcu_port4 = data;
r2241r2242
13121277   {
13131278      simulate_mcu();
13141279   }
1315   if( mEnableInterrupts )
1280   if(1)// mEnableInterrupts )
13161281   {
13171282      if( (namcona1_vreg[0x1a/2]&(1<<level))==0 )
13181283      {
r2241r2242
13451310static MACHINE_DRIVER_START( namcona1 )
13461311   /* basic machine hardware */
13471312   MDRV_CPU_ADD(M68000, 50113000/4)
1348   MDRV_CPU_PROGRAM_MAP(namcona1_mcu_readmem,namcona1_mcu_writemem)
1313   MDRV_CPU_PROGRAM_MAP(namcona1_main_map,0)
13491314   MDRV_CPU_VBLANK_INT_HACK(namcona1_interrupt,5)
13501315
13511316   MDRV_CPU_ADD(M37710, 50113000/4)
r2241r2242
13961361
13971362static ADDRESS_MAP_START( namcona2_readmem, ADDRESS_SPACE_PROGRAM, 16 )
13981363   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_RAM)      /* work RAM */
1399   AM_RANGE(0x080000, 0x3fffff) AM_READ(bogus_r)
14001364   AM_RANGE(0x400000, 0xbfffff) AM_ROM AM_REGION(REGION_CPU1, 0x280000)   /* data */
14011365   AM_RANGE(0xc00000, 0xdfffff) AM_ROM AM_REGION(REGION_CPU1, 0x080000)   /* code */
14021366   AM_RANGE(0xe00000, 0xe00fff) AM_READ(namcona1_nvram_r)
14031367   AM_RANGE(0xe40000, 0xe4000f) AM_READ(custom_key_r)
1404   AM_RANGE(0xe40010, 0xeffeff) AM_READ(bogus_r)
14051368   AM_RANGE(0xefff00, 0xefffff) AM_READ(namcona1_vreg_r)
14061369   AM_RANGE(0xf00000, 0xf01fff) AM_READ(namcona1_paletteram_r)
1407   AM_RANGE(0xf02000, 0xf3ffff) AM_READ(bogus_r)
14081370   AM_RANGE(0xf40000, 0xf7ffff) AM_READ(namcona1_gfxram_r)
1409   AM_RANGE(0xf80000, 0xfeffff) AM_READ(bogus_r)
14101371   AM_RANGE(0xff0000, 0xff7fff) AM_READ(namcona1_videoram_r)
14111372   AM_RANGE(0xff8000, 0xffdfff) AM_READ(SMH_RAM)      /* spare videoram */
14121373   AM_RANGE(0xffe000, 0xffefff) AM_READ(SMH_RAM)      /* scroll registers */
r2241r2242
14161377static ADDRESS_MAP_START( namcona2_writemem, ADDRESS_SPACE_PROGRAM, 16 )
14171378   AM_RANGE(0x000000, 0x000fff) AM_WRITE(namcona1_mcu_w) AM_BASE(&mcu_ram)
14181379   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_RAM) AM_BASE(&namcona1_workram)
1419   AM_RANGE(0x080000, 0x3f8007) AM_WRITE(bogus_w)
14201380   AM_RANGE(0x3f8008, 0x3f8009) AM_WRITE(mcu_command_w)
1421   AM_RANGE(0x3f800a, 0x3fffff) AM_WRITE(bogus_w)
14221381   AM_RANGE(0x400000, 0xdfffff) AM_WRITE(SMH_ROM) /* data + code */
14231382   AM_RANGE(0xe00000, 0xe00fff) AM_WRITE(namcona1_nvram_w)
1424   AM_RANGE(0xe01000, 0xe3ffff) AM_WRITE(bogus_w)
14251383   AM_RANGE(0xe40000, 0xe4000f) AM_WRITE(custom_key_w)
1426   AM_RANGE(0xe40010, 0xeffeff) AM_WRITE(bogus_w)
14271384   AM_RANGE(0xefff00, 0xefffff) AM_WRITE(namcona1_vreg_w) AM_BASE(&namcona1_vreg)
14281385   AM_RANGE(0xf00000, 0xf01fff) AM_WRITE(namcona1_paletteram_w) AM_BASE(&paletteram16)
1429   AM_RANGE(0xf02000, 0xf3ffff) AM_WRITE(bogus_w)
14301386   AM_RANGE(0xf40000, 0xf7ffff) AM_WRITE(namcona1_gfxram_w)
1431   AM_RANGE(0xf80000, 0xfeffff) AM_WRITE(bogus_w)
14321387   AM_RANGE(0xff0000, 0xff7fff) AM_WRITE(namcona1_videoram_w) AM_BASE(&videoram16)
14331388   AM_RANGE(0xff8000, 0xffdfff) AM_WRITE(SMH_RAM) AM_BASE(&namcona1_sparevram)
14341389   AM_RANGE(0xffe000, 0xffefff) AM_WRITE(SMH_RAM) AM_BASE(&namcona1_scroll)
src/mame/drivers/armedf.c
r2241r2242
233233
234234static WRITE16_HANDLER( sound_command_w )
235235{
236   if (ACCESSING_LSB)
236   if (ACCESSING_BITS_0_7)
237237      soundlatch_w(machine,0,((data & 0x7f) << 1) | 1);
238238}
239239
src/mame/drivers/dkong.c
r2241r2242
21542154   ROM_LOAD( "v-2n.bpr",  0x0200, 0x0100, CRC(dbf185bf) SHA1(2697a991a4afdf079dd0b7e732f71c7618f43b70) )   /* character color codes on a per-column basis */
21552155ROM_END
21562156
2157/* only the graphic roms differ from dkongjrb but it's a common bootleg */
2158ROM_START( jrking )
2159   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2160   ROM_LOAD( "b5.bin",    0x0000, 0x1000, CRC(ec7e097f) SHA1(c10885d8724434030094a106c5b6de7fa6976d0f) )
2161   ROM_CONTINUE(          0x3000, 0x1000 )
2162   ROM_LOAD( "c5.bin",    0x2000, 0x0800, CRC(c0a18f0d) SHA1(6d7396b98c0a7fa508dc233f90e5a8359439c97b) )
2163   ROM_CONTINUE(          0x4800, 0x0800 )
2164   ROM_CONTINUE(          0x1000, 0x0800 )
2165   ROM_CONTINUE(          0x5800, 0x0800 )
2166   ROM_LOAD( "e5.bin",    0x4000, 0x0800, CRC(a81dd00c) SHA1(ec507d963151bb8fcee13a47d7f93aa4cd089b7e) )
2167   ROM_CONTINUE(          0x2800, 0x0800 )
2168   ROM_CONTINUE(          0x5000, 0x0800 )
2169   ROM_CONTINUE(          0x1800, 0x0800 )
2170
2171   ROM_REGION( 0x1000, REGION_CPU2, 0 )   /* sound */
2172   ROM_LOAD( "h3.bin",       0x0000, 0x1000, CRC(715da5f8) SHA1(f708c3fd374da65cbd9fe2e191152f5d865414a0) )
2173
2174   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
2175   ROM_LOAD( "n3.bin",    0x0000, 0x1000, CRC(7110715d) SHA1(6d848563bf01b347e374d5cae23e09806e28ea6d) )
2176   ROM_LOAD( "p3.bin",    0x1000, 0x1000, CRC(46476016) SHA1(5af29f816e53fd344d114ebf2369e29359e08ce0) )
2177
2178   ROM_REGION( 0x4000, REGION_GFX2, ROMREGION_DISPOSE )
2179   ROM_LOAD( "c7.bin",     0x0000, 0x1000, CRC(9f531527) SHA1(6b426cea91135ae1924506f964d856fc475c08e1) )
2180   ROM_LOAD( "d7.bin",     0x1000, 0x1000, CRC(32fbd41b) SHA1(1f98facc2c20dc4b8722085f269f123601382994) )
2181   ROM_LOAD( "e7.bin",     0x2000, 0x1000, CRC(2286bf8e) SHA1(7511e83aa5a4de988048fc2db4de7b3d5aabee8c) )
2182   ROM_LOAD( "f7.bin",     0x3000, 0x1000, CRC(627007a0) SHA1(f71091b65978f7f386ba3c30a3ffe824412bbe67) )
2183
2184   ROM_REGION( 0x0300, REGION_PROMS, 0 )
2185   ROM_LOAD( "c-2e.bpr",  0x0000, 0x0100, CRC(463dc7ad) SHA1(b2c9f22facc8885be2d953b056eb8dcddd4f34cb) )   /* palette low 4 bits (inverted) */
2186   ROM_LOAD( "c-2f.bpr",  0x0100, 0x0100, CRC(47ba0042) SHA1(dbec3f4b8013628c5b8f83162e5f8b1f82f6ee5f) )   /* palette high 4 bits (inverted) */
2187   ROM_LOAD( "v-2n.bpr",  0x0200, 0x0100, CRC(dbf185bf) SHA1(2697a991a4afdf079dd0b7e732f71c7618f43b70) )   /* character color codes on a per-column basis */
2188ROM_END
2189
21572190ROM_START( dkongjre )
21582191   ROM_REGION( 0x10000, REGION_CPU1, 0 )
21592192   ROM_LOAD( "djr1-c.5b",    0x0000, 0x1000, CRC(ffe9e1a5) SHA1(715dc79d85169b4c1faf43458592e69b434afefd) )
r2241r2242
28492882GAME( 1982, dkngjnrj, dkongjr,  dkongjr,  dkongjr,        0,  ROT90, "Nintendo", "Donkey Kong Junior (Japan?)", GAME_SUPPORTS_SAVE )
28502883GAME( 1982, dkongjrb, dkongjr,  dkongjr,  dkongjr,        0,  ROT90, "bootleg", "Donkey Kong Jr. (bootleg)", GAME_SUPPORTS_SAVE )
28512884GAME( 1982, dkongjre, dkongjr,  dkongjr,  dkongjr,        0,  ROT90, "Nintendo of America", "Donkey Kong Junior (Easy)", GAME_SUPPORTS_SAVE )
2885GAME( 1982, jrking,   dkongjr,  dkongjr,  dkongjr,        0,  ROT90, "bootleg", "Junior King (bootleg of Donkey Kong Jr.)", GAME_SUPPORTS_SAVE )
28522886
28532887GAME( 1983, dkong3,   0,        dkong3,   dkong3,         0,  ROT90, "Nintendo of America", "Donkey Kong 3 (US)", GAME_SUPPORTS_SAVE )
28542888GAME( 1983, dkong3j,  dkong3,   dkong3,   dkong3,         0,  ROT90, "Nintendo", "Donkey Kong 3 (Japan)", GAME_SUPPORTS_SAVE )
src/mame/drivers/ddenlovr.c
r2241r2242
224224
225225static WRITE16_HANDLER( ddenlovr16_bgcolor_w )
226226{
227   if (ACCESSING_LSB)
227   if (ACCESSING_BITS_0_7)
228228      ddenlovr_bgcolor_w(machine,offset,data);
229229}
230230
r2241r2242
241241
242242static WRITE16_HANDLER( ddenlovr16_priority_w )
243243{
244   if (ACCESSING_LSB)
244   if (ACCESSING_BITS_0_7)
245245      ddenlovr_priority_w(machine,offset,data);
246246}
247247
r2241r2242
259259
260260static WRITE16_HANDLER( ddenlovr16_layer_enable_w )
261261{
262   if (ACCESSING_LSB)
262   if (ACCESSING_BITS_0_7)
263263      ddenlovr_layer_enable_w(machine,offset,data);
264264}
265265
r2241r2242
11191119
11201120static WRITE16_HANDLER( ddenlovr_blitter_w )
11211121{
1122   if (ACCESSING_LSB)
1122   if (ACCESSING_BITS_0_7)
11231123      blitter_w(machine, 0,offset,data & 0xff,0);
11241124}
11251125
11261126
11271127static WRITE16_HANDLER( ddenlovr_blitter_irq_ack_w )
11281128{
1129   if (ACCESSING_LSB)
1129   if (ACCESSING_BITS_0_7)
11301130   {
11311131      if (data & 1)
11321132      {
r2241r2242
13121312
13131313static WRITE16_HANDLER( ddenlovr_coincounter_0_w )
13141314{
1315   if (ACCESSING_LSB)
1315   if (ACCESSING_BITS_0_7)
13161316      coin_counter_w(0, data & 1);
13171317}
13181318static WRITE16_HANDLER( ddenlovr_coincounter_1_w )
13191319{
1320   if (ACCESSING_LSB)
1320   if (ACCESSING_BITS_0_7)
13211321      coin_counter_w(1, data & 1);
13221322}
13231323
r2241r2242
13441344
13451345static WRITE16_HANDLER( ddenlovr_palette_w )
13461346{
1347   if (ACCESSING_LSB)
1347   if (ACCESSING_BITS_0_7)
13481348      rongrong_palette_w(machine,offset,data & 0xff);
13491349}
13501350
r2241r2242
13881388
13891389static WRITE16_HANDLER( ddenlovr16_palette_base_w )
13901390{
1391   if (ACCESSING_LSB)
1391   if (ACCESSING_BITS_0_7)
13921392      ddenlovr_palette_base[offset] = data & 0xff;
13931393}
13941394
13951395static WRITE16_HANDLER( ddenlovr16_palette_mask_w )
13961396{
1397   if (ACCESSING_LSB)
1397   if (ACCESSING_BITS_0_7)
13981398      ddenlovr_palette_mask[offset] = data & 0xff;
13991399}
14001400
14011401static WRITE16_HANDLER( ddenlovr16_transparency_pen_w )
14021402{
1403   if (ACCESSING_LSB)
1403   if (ACCESSING_BITS_0_7)
14041404      ddenlovr_transparency_pen[offset] = data & 0xff;
14051405}
14061406
14071407static WRITE16_HANDLER( ddenlovr16_transparency_mask_w )
14081408{
1409   if (ACCESSING_LSB)
1409   if (ACCESSING_BITS_0_7)
14101410      ddenlovr_transparency_mask[offset] = data & 0xff;
14111411}
14121412
r2241r2242
14181418
14191419static WRITE16_HANDLER( ddenlovr_oki_bank_w )
14201420{
1421   if (ACCESSING_LSB)
1421   if (ACCESSING_BITS_0_7)
14221422      OKIM6295_set_bank_base(0, (data & 7) * 0x40000);
14231423}
14241424
r2241r2242
14271427
14281428static WRITE16_HANDLER( quiz365_oki_bank1_w )
14291429{
1430   if (ACCESSING_LSB)
1430   if (ACCESSING_BITS_0_7)
14311431   {
14321432      okibank = (okibank & 2) | (data & 1);
14331433      OKIM6295_set_bank_base(0, okibank * 0x40000);
r2241r2242
14361436
14371437static WRITE16_HANDLER( quiz365_oki_bank2_w )
14381438{
1439   if (ACCESSING_LSB)
1439   if (ACCESSING_BITS_0_7)
14401440   {
14411441      okibank = (okibank & 1) | ((data & 1) << 1);
14421442      OKIM6295_set_bank_base(0, okibank * 0x40000);
r2241r2242
14651465
14661466static WRITE16_HANDLER( ddenlovr_select_16_w )
14671467{
1468   if (ACCESSING_LSB)
1468   if (ACCESSING_BITS_0_7)
14691469      ddenlovr_select = data;
14701470}
14711471
r2241r2242
14761476
14771477static WRITE16_HANDLER( ddenlovr_select2_16_w )
14781478{
1479   if (ACCESSING_LSB)
1479   if (ACCESSING_BITS_0_7)
14801480      ddenlovr_select2 = data;
14811481}
14821482
r2241r2242
15401540
15411541static WRITE16_HANDLER( quiz365_coincounter_w )
15421542{
1543   if (ACCESSING_LSB)
1543   if (ACCESSING_BITS_0_7)
15441544   {
15451545      if (ddenlovr_select2 == 0x1c)
15461546      {
r2241r2242
16231623
16241624static WRITE16_HANDLER( ddenlvrj_coincounter_w )
16251625{
1626   if (ACCESSING_LSB)
1626   if (ACCESSING_BITS_0_7)
16271627   {
16281628      coin_counter_w(0, data & 0x01);
16291629      coin_counter_w(1, data & 0x04);
r2241r2242
17491749
17501750static WRITE16_HANDLER( nettoqc_coincounter_w )
17511751{
1752   if (ACCESSING_LSB)
1752   if (ACCESSING_BITS_0_7)
17531753   {
17541754      coin_counter_w(0, data & 0x01);
17551755      coin_counter_w(1, data & 0x04);
r2241r2242
17591759
17601760static WRITE16_HANDLER( nettoqc_oki_bank_w )
17611761{
1762   if (ACCESSING_LSB)
1762   if (ACCESSING_BITS_0_7)
17631763      OKIM6295_set_bank_base(0, (data & 3) * 0x40000);
17641764}
17651765
src/mame/drivers/kaneko16.c
r2241r2242
248248
249249static WRITE16_HANDLER( kaneko16_coin_lockout_w )
250250{
251   if (ACCESSING_MSB)
251   if (ACCESSING_BITS_8_15)
252252   {
253253      coin_counter_w(0,   data  & 0x0100);
254254      coin_counter_w(1,   data  & 0x0200);
r2241r2242
270270
271271static WRITE16_HANDLER( kaneko16_soundlatch_w )
272272{
273   if (ACCESSING_MSB)
273   if (ACCESSING_BITS_8_15)
274274   {
275275      soundlatch_w(machine, 0, (data & 0xff00) >> 8 );
276276      cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
r2241r2242
297297   /* Each 2149 register is mapped to a different address */
298298   AY8910_control_port_0_w(machine,0,offset);
299299   /* The registers are mapped to odd addresses, except one! */
300   if (ACCESSING_LSB)   AY8910_write_port_0_w(machine,0, data       & 0xff);
300   if (ACCESSING_BITS_0_7)   AY8910_write_port_0_w(machine,0, data       & 0xff);
301301   else            AY8910_write_port_0_w(machine,0,(data >> 8) & 0xff);
302302}
303303static WRITE16_HANDLER( kaneko16_YM2149_1_w )
r2241r2242
305305   /* Each 2149 register is mapped to a different address */
306306   AY8910_control_port_1_w(machine,0,offset);
307307   /* The registers are mapped to odd addresses, except one! */
308   if (ACCESSING_LSB)   AY8910_write_port_1_w(machine,0, data       & 0xff);
308   if (ACCESSING_BITS_0_7)   AY8910_write_port_1_w(machine,0, data       & 0xff);
309309   else            AY8910_write_port_1_w(machine,0,(data >> 8) & 0xff);
310310}
311311
r2241r2242
331331
332332static WRITE16_HANDLER( kaneko16_eeprom_w )
333333{
334   if (ACCESSING_LSB)
334   if (ACCESSING_BITS_0_7)
335335   {
336336      // latch the bit
337337      EEPROM_write_bit(data & 0x02);
r2241r2242
343343      EEPROM_set_clock_line((data & 0x01) ? ASSERT_LINE : CLEAR_LINE );
344344   }
345345
346   if (ACCESSING_MSB)
346   if (ACCESSING_BITS_8_15)
347347   {
348348      coin_counter_w(0, data & 0x0100);
349349      coin_counter_w(1, data & 0x0200);
r2241r2242
402402
403403static WRITE16_HANDLER( bakubrkr_oki_bank_sw )
404404{
405   if (ACCESSING_LSB) {
405   if (ACCESSING_BITS_0_7) {
406406      OKIM6295_set_bank_base(0, 0x40000 * (data & 0x7) );
407407      logerror("PC:%06X  Selecting OKI bank %02X\n",activecpu_get_pc(),data&0xff);
408408   }
r2241r2242
472472
473473static WRITE16_HANDLER( bloodwar_oki_0_bank_w )
474474{
475   if (ACCESSING_LSB)
475   if (ACCESSING_BITS_0_7)
476476   {
477477      OKIM6295_set_bank_base(0, 0x40000 * (data & 0xf) );
478478//      logerror("CPU #0 PC %06X : OKI0  bank %08X\n",activecpu_get_pc(),data);
r2241r2242
481481
482482static WRITE16_HANDLER( bloodwar_oki_1_bank_w )
483483{
484   if (ACCESSING_LSB)
484   if (ACCESSING_BITS_0_7)
485485   {
486486      OKIM6295_set_bank_base(1, 0x40000 * data );
487487//      logerror("CPU #0 PC %06X : OKI1  bank %08X\n",activecpu_get_pc(),data);
r2241r2242
490490
491491static WRITE16_HANDLER( bloodwar_coin_lockout_w )
492492{
493   if (ACCESSING_MSB)
493   if (ACCESSING_BITS_8_15)
494494   {
495495      coin_counter_w(0, data & 0x0100);
496496      coin_counter_w(1, data & 0x0200);
r2241r2242
542542
543543static WRITE16_HANDLER( bonkadv_oki_0_bank_w )
544544{
545   if (ACCESSING_LSB)
545   if (ACCESSING_BITS_0_7)
546546   {
547547      OKIM6295_set_bank_base(0, 0x40000 * (data & 0xF));
548548      logerror("CPU #0 PC %06X : OKI0  bank %08X\n",activecpu_get_pc(),data);
r2241r2242
551551
552552static WRITE16_HANDLER( bonkadv_oki_1_bank_w )
553553{
554   if (ACCESSING_LSB)
554   if (ACCESSING_BITS_0_7)
555555   {
556556      OKIM6295_set_bank_base(1, 0x40000 * data );
557557      logerror("CPU #0 PC %06X : OKI1  bank %08X\n",activecpu_get_pc(),data);
r2241r2242
611611
612612static WRITE16_HANDLER( gtmr_oki_0_bank_w )
613613{
614   if (ACCESSING_LSB)
614   if (ACCESSING_BITS_0_7)
615615   {
616616      OKIM6295_set_bank_base(0, 0x40000 * (data & 0xF) );
617617//      logerror("CPU #0 PC %06X : OKI0 bank %08X\n",activecpu_get_pc(),data);
r2241r2242
620620
621621static WRITE16_HANDLER( gtmr_oki_1_bank_w )
622622{
623   if (ACCESSING_LSB)
623   if (ACCESSING_BITS_0_7)
624624   {
625625      OKIM6295_set_bank_base(1, 0x40000 * (data & 0x1) );
626626//      logerror("CPU #0 PC %06X : OKI1 bank %08X\n",activecpu_get_pc(),data);
r2241r2242
629629
630630static WRITE16_HANDLER( gtmr_oki_0_data_w )
631631{
632   if (ACCESSING_LSB)
632   if (ACCESSING_BITS_0_7)
633633   {
634634      OKIM6295_data_0_w(machine,0,data);
635635//      logerror("CPU #0 PC %06X : OKI0 <- %08X\n",activecpu_get_pc(),data);
r2241r2242
638638
639639static WRITE16_HANDLER( gtmr_oki_1_data_w )
640640{
641   if (ACCESSING_LSB)
641   if (ACCESSING_BITS_0_7)
642642   {
643643      OKIM6295_data_1_w(machine,0,data);
644644//      logerror("CPU #0 PC %06X : OKI1 <- %08X\n",activecpu_get_pc(),data);
r2241r2242
796796/* Untested */
797797static WRITE16_HANDLER( shogwarr_oki_bank_w )
798798{
799   if (ACCESSING_LSB)
799   if (ACCESSING_BITS_0_7)
800800   {
801801      OKIM6295_set_bank_base(0, 0x10000 * ((data >> 0) & 0x3) );
802802      OKIM6295_set_bank_base(1, 0x10000 * ((data >> 4) & 0x3) );
src/mame/drivers/cybertnk.c
r2241r2242
301301   {
302302      case 0:
303303         // sound data
304         if (ACCESSING_LSB)
304         if (ACCESSING_BITS_0_7)
305305            cpunum_set_input_line(Machine, 2, 0, HOLD_LINE);
306306         else
307307            LOG_UNKNOWN_WRITE
308308         break;
309309
310310      case 2:
311         if (ACCESSING_LSB)
311         if (ACCESSING_BITS_0_7)
312312            ;//watchdog ? written in similar context to CPU1 @ 0x140002
313313         else
314314            LOG_UNKNOWN_WRITE
315315         break;
316316
317317      case 6:
318         if (ACCESSING_LSB)
318         if (ACCESSING_BITS_0_7)
319319            ;//select controller device
320320         else
321321            ;//blank inputs
322322         break;
323323
324324      case 8:
325         if (ACCESSING_MSB)
325         if (ACCESSING_BITS_8_15)
326326            ;//blank inputs
327327         else
328328            LOG_UNKNOWN_WRITE
329329         break;
330330
331331      case 0xc:
332         if (ACCESSING_LSB)
332         if (ACCESSING_BITS_0_7)
333333            // This seems to only be written after each irq1 and irq2
334334            logerror("irq wrote %04x\n", data);
335335         else
r2241r2242
337337         break;
338338
339339      case 0xd4:
340         if ( ACCESSING_LSB )
340         if ( ACCESSING_BITS_0_7 )
341341            ;// controller device data
342342         else
343343            LOG_UNKNOWN_WRITE
src/mame/drivers/gauntlet.c
r2241r2242
209209
210210static WRITE16_HANDLER( sound_reset_w )
211211{
212   if (ACCESSING_LSB)
212   if (ACCESSING_BITS_0_7)
213213   {
214214      int oldword = sound_reset_val;
215215      COMBINE_DATA(&sound_reset_val);
src/mame/drivers/mpu4.c
r2241r2242
1/***************************************************************************
1/***********************************************************************************************************
22  Barcrest MPU4 highly preliminary driver by J.Wallace, and Anonymous.
33  This is the core driver, no game specific stuff should go in here.
44
r2241r2242
239239
240240TODO: - Fix lamp timing, MAME doesn't update fast enough to see everything
241241      - Distinguish door switches using manual
242*****************************************************************************************/
242***********************************************************************************************************/
243243
244244#include "driver.h"
245245#include "machine/6821pia.h"
246246#include "machine/6840ptm.h"
247247
248// MPU4
249248#include "deprecat.h"
250249#include "timer.h"
251250#include "cpu/m6809/m6809.h"
252251#include "sound/ay8910.h"
253#include "machine/steppers.h"   // stepper motor
254#include "machine/roc10937.h"   // vfd
252#include "machine/steppers.h"
253#include "machine/roc10937.h"
255254#include "machine/meters.h"
256255
257256#ifdef MAME_DEBUG
r2241r2242
266265#define LOG_IC3(x)   do { if (MPU4VERBOSE) logerror x; } while (0)
267266#define LOG_IC8(x)   do { if (MPU4VERBOSE) logerror x; } while (0)
268267
269#ifndef AWP_VIDEO //Defined for fruit machines with mechanical reels
268#ifndef AWP_VIDEO /*Defined for fruit machines with mechanical reels*/
270269#define draw_reel(x)
271270#else
272271#define draw_reel(x) awp_draw_reel x
r2241r2242
274273#include "mpu4.lh"
275274#include "connect4.lh"
276275#define MPU4_MASTER_CLOCK (6880000)
277// local vars /////////////////////////////////////////////////////////////
276
277/* local vars */
278278static int mod_number;
279279static int mmtr_data;
280280static int alpha_data_line;
r2241r2242
297297static emu_timer *ic24_timer;
298298static TIMER_CALLBACK( ic24_timeout );
299299
300static int   input_strobe;     // IC23 74LS138 A = CA2 IC7, B = CA2 IC4, C = CA2 IC8
300
301/* 32 multiplexed inputs - but a further 8 possible per AUX.
302Two connectors 'orange' (sampled every 8ms) and 'black' (sampled every 16ms)
303Each connector carries two banks of eight inputs and two enable signals */
304static int     input_strobe;     /* IC23 74LS138 A = CA2 IC7, B = CA2 IC4, C = CA2 IC8 */
301305static UINT8  lamp_strobe,lamp_strobe2;
302306static UINT8  lamp_data;
303static UINT8  aydata;
307static UINT8  ay_data;
304308
305309extern const UINT8 MPU4_chr_lut[72];
306310static UINT8 MPU4_chr_data[72];
307static UINT8 led_segs[8];
308static UINT8 Lamps[128];      // 128 multiplexed lamps
309                        // 32  multiplexed inputs - but a further 8 possible per AUX.
310                        // Two connectors 'orange' (sampled every 8ms) and 'black' (sampled every 16ms)
311                        // Each connector carries two banks of eight inputs and two enable signals
311
312static UINT8 Lamps[128];      /* 128 multiplexed lamps */
312313static int optic_pattern;
313314
315/* Lookup table for CHR data */
316const UINT8 MPU4_chr_lut[72]= {   0x00,0x1A,0x04,0x10,0x18,0x0F,0x13,0x1B,
317                        0x03,0x07,0x17,0x1D,0x36,0x35,0x2B,0x28,
318                        0x39,0x21,0x22,0x25,0x2C,0x29,0x31,0x34,
319                        0x0A,0x1F,0x06,0x0E,0x1C,0x12,0x1E,0x0D,
320                        0x14,0x0A,0x19,0x15,0x06,0x0F,0x08,0x1B,
321                        0x1E,0x04,0x01,0x0C,0x18,0x1A,0x11,0x0B,
322                        0x03,0x17,0x10,0x1D,0x0E,0x07,0x12,0x09,
323                        0x0D,0x1F,0x16,0x05,0x13,0x1C,0x02,0x00,
324                        0x00,0x01,0x04,0x09,0x10,0x19,0x24,0x31};
325
314326/*
315327LED Segments related to pins (5 is not connected):
316328Unlike the controllers emulated in the layout code, each
r2241r2242
3303428 display enables (pins 10 - 17)
331343*/
332344
345static UINT8 led_segs[8];
346
347
348/* Process lamp and LED data for output system */
333349static void mpu4_draw_led(UINT8 id, UINT8 value)
334350{
335351   output_set_digit_value(id,value);
336352}
337353
354
338355static void draw_lamps(void)
339356{
340357   int i;
341358
342   for (i=0; i<8; i++)
359   for (i = 0; i < 8; i++)
343360   {
344361      output_set_lamp_value((8*input_strobe)+i, (Lamps[(8*input_strobe)+i]));
345362      output_set_lamp_value((8*input_strobe)+i+64, (Lamps[(8*input_strobe)+i+64]));
346363   }
347364}
348365
366
349367static void update_lamps(void)
350368{
351369   int i;
352370
353   for (i=0; i<8; i++)
371   for (i = 0; i < 8; i++)
354372   {
355373      Lamps[(8*input_strobe)+i]    = (lamp_strobe  & (1 << i)) != 0;
356374      Lamps[(8*input_strobe)+i+64] = (lamp_strobe2 & (1 << i)) != 0;
r2241r2242
358376
359377   if (led_extend)
360378   {
361      //Some games uses 'programmable' displays, built from lights.
379      /* Some games uses 'programmable' LED displays, built from light display lines. */
362380      UINT8 pled_segs[2] = {0,0};
363381
364382      static const int lamps1[8] = { 106, 107, 108, 109, 104, 105, 110, 133 };
365383      static const int lamps2[8] = { 114, 115, 116, 117, 112, 113, 118, 119 };
366384
367      for (i=0; i<8; i++)
385      for (i = 0; i < 8; i++)
368386      {
369387         if (output_get_lamp_value(lamps1[i])) pled_segs[0] |= (1 << i);
370388         if (output_get_lamp_value(lamps2[i])) pled_segs[1] |= (1 << i);
r2241r2242
376394   draw_lamps();
377395}
378396
379///////////////////////////////////////////////////////////////////////////
380// called if board is reset ///////////////////////////////////////////////
381///////////////////////////////////////////////////////////////////////////
382397
398/* called if board is reset */
383399static void mpu4_stepper_reset(void)
384400{
385   int pattern = 0,i;
386   for ( i = 0; i < 6; i++)
401   int pattern = 0,reel;
402   for (reel = 0; reel < 6; reel++)
387403   {
388      Stepper_reset_position(i);
389      if ( Stepper_optic_state(i) ) pattern |= 1<<i;
404      Stepper_reset_position(reel);
405      if (Stepper_optic_state(reel)) pattern |= 1<<reel;
390406   }
391407   optic_pattern = pattern;
392408}
393409
410
394411static MACHINE_RESET( mpu4 )
395412{
396   ROC10937_reset(0);   // reset display1
413   ROC10937_reset(0);   /* reset display1 */
397414
398415   mpu4_stepper_reset();
399416
r2241r2242
410427
411428   prot_col  = 0;
412429
413// init rom bank ////////////////////////////////////////////////////////
414
430/* init rom bank, some games don't set this */
415431   {
416432      UINT8 *rom = memory_region(REGION_CPU1);
417433
r2241r2242
422438
423439}
424440
425///////////////////////////////////////////////////////////////////////////
426441
442/* 6809 IRQ handler */
427443static void cpu0_irq(int state)
428444{
429   // The PIA and PTM IRQ lines are all connected to a common PCB track,
430   // leading directly to the 6809 IRQ line.
445   /* The PIA and PTM IRQ lines are all connected to a common PCB track, leading directly to the 6809 IRQ line. */
431446   int combined_state = pia_get_irq_a(0) | pia_get_irq_b(0) |
432447                   pia_get_irq_a(1) | pia_get_irq_b(1) |
433448                   pia_get_irq_a(2) | pia_get_irq_b(2) |
r2241r2242
448463   }
449464}
450465
451///////////////////////////////////////////////////////////////////////////
466
467/* Bankswitching */
452468static WRITE8_HANDLER( bankswitch_w )
453469{
454470   memory_set_bank(1,data & 0x07);
455471}
456472
473
457474static READ8_HANDLER( bankswitch_r )
458475{
459476   return memory_get_bank(1);
460477}
461478
462// IC2 6840 PTM handler ///////////////////////////////////////////////////////
463479
480/* IC2 6840 PTM handler */
464481static WRITE8_HANDLER( ic2_o1_callback )
465482{
466483   ptm6840_set_c2(0,data);
467484
468   // copy output value to IC2 c2
469   // this output is the clock for timer2,
470   // the output from timer2 is the input clock for timer3
471   // the output from timer3 is used as a square wave for the alarm output
472   // and as an external clock source for timer 1!
485   /* copy output value to IC2 c2
486    this output is the clock for timer2 */
473487}
474488
489
475490static WRITE8_HANDLER( ic2_o2_callback )
476491{
477   pia_set_input_ca1(0, data); // copy output value to IC3 ca1
478   ptm6840_set_c3(   0, data); // copy output value to IC2 c3
492   pia_set_input_ca1(0, data); /* copy output value to IC3 ca1 */
493
494   /* the output from timer2 is the input clock for timer3 */
495   ptm6840_set_c3(   0, data);
479496}
480497
498
481499static WRITE8_HANDLER( ic2_o3_callback )
482500{
483   ptm6840_set_c1(   0, data); // copy output value to IC2 c1
501   /* the output from timer3 is used as a square wave for the alarm output
502    and as an external clock source for timer 1! */
503
504   ptm6840_set_c1(   0, data);
484505}
485506
507
486508static const ptm6840_interface ptm_ic2_intf =
487509{
488510   MPU4_MASTER_CLOCK/4,
r2241r2242
491513   cpu0_irq
492514};
493515
494/***************************************************************************
495    6821 PIA handlers
496***************************************************************************/
497516
498// IC3
517/* 6821 PIA handlers */
518/* IC3, lamp data lines + alpha numeric display */
499519static WRITE8_HANDLER( pia_ic3_porta_w )
500520{
501521   LOG_IC3(("%04x IC3 PIA Port A Set to %2x (lamp strobes 1 - 9)\n", activecpu_get_previouspc(),data));
r2241r2242
507527   }
508528}
509529
530
510531static WRITE8_HANDLER( pia_ic3_portb_w )
511532{
512533   LOG_IC3(("%04x IC3 PIA Port B Set to %2x  (lamp strobes 10 - 17)\n", activecpu_get_previouspc(),data));
r2241r2242
518539   }
519540}
520541
542
521543static WRITE8_HANDLER( pia_ic3_ca2_w )
522544{
523545   LOG_IC3(("%04x IC3 PIA Write CA2 (alpha data), %02X\n", activecpu_get_previouspc(),data));
r2241r2242
526548   ROC10937_draw_16seg(0);
527549}
528550
551
529552static WRITE8_HANDLER( pia_ic3_cb2_w )
530553{
531554   LOG_IC3(("%04x IC3 PIA Write CB (alpha reset), %02X\n",activecpu_get_previouspc(),data));
r2241r2242
534557   ROC10937_draw_16seg(0);
535558}
536559
537// IC3, lamp data lines + alpha numeric display
538560
539561static const pia6821_interface pia_ic3_intf =
540562{
r2241r2242
543565   /*irqs   : A/B             */ cpu0_irq, cpu0_irq
544566};
545567
546/*---------------------------------------
547   IC23 emulation
548  ---------------------------------------
568/*
569IC23 emulation
570
549571IC23 is a 74LS138 1-of-8 Decoder
550572
551It is used as a multiplexer for the LEDs, lamp selects and inputs.
552*/
573It is used as a multiplexer for the LEDs, lamp selects and inputs.*/
553574
554575static void ic23_update(void)
555576{
r2241r2242
576597      input_strobe = 0x00;
577598   }
578599}
579/*---------------------------------------
580   IC24 emulation
581  ---------------------------------------
600
601
602/*
603IC24 emulation
604
582605IC24 is a 74LS122 pulse generator
583606
584CLEAR and B2 are tied high and A1 and A2 tied low, meaning any pulse on B1 will give a low pulse on the output pin.
607CLEAR and B2 are tied high and A1 and A2 tied low, meaning any pulse
608on B1 will give a low pulse on the output pin.
585609*/
586
587610static void ic24_output(int data)
588611{
589612   IC23G2A = data;
590613   ic23_update();
591614}
592615
616
593617static void ic24_setup(void)
594618{
595619   if (IC23GA)
r2241r2242
603627   }
604628}
605629
630
606631static TIMER_CALLBACK( ic24_timeout )
607632{
608633   ic23_active=0;
609634   ic24_output(1);
610635}
611636
612// IC4
613637
638/* IC4 IC4, 7 seg leds, 50Hz timer reel sensors, current sensors */
614639static WRITE8_HANDLER( pia_ic4_porta_w )
615640{
616641   if(ic23_active)
r2241r2242
620645   }
621646}
622647
648
623649static READ8_HANDLER( pia_ic4_portb_r )
624650{
625651   if ( serial_data )
r2241r2242
633659      pia_set_input_cb1(1, 0);
634660   }
635661
636   if ( optic_pattern & 0x01 ) ic4_input_b |=  0x40; // reel A tab
662   if ( optic_pattern & 0x01 ) ic4_input_b |=  0x40; /* reel A tab */
637663   else                        ic4_input_b &= ~0x40;
638664
639   if ( optic_pattern & 0x02 ) ic4_input_b |=  0x20; // reel B tab
665   if ( optic_pattern & 0x02 ) ic4_input_b |=  0x20; /* reel B tab */
640666   else                        ic4_input_b &= ~0x20;
641667
642   if ( optic_pattern & 0x04 ) ic4_input_b |=  0x10; // reel C tab
668   if ( optic_pattern & 0x04 ) ic4_input_b |=  0x10; /* reel C tab */
643669   else                        ic4_input_b &= ~0x10;
644670
645   if ( optic_pattern & 0x08 ) ic4_input_b |=  0x08; // reel D tab
671   if ( optic_pattern & 0x08 ) ic4_input_b |=  0x08; /* reel D tab */
646672   else                        ic4_input_b &= ~0x08;
647673
648   if ( signal_50hz )          ic4_input_b |=  0x04; // 50 Hz
674   if ( signal_50hz )          ic4_input_b |=  0x04; /* 50 Hz */
649675   else                          ic4_input_b &= ~0x04;
650676
651   // if ( lamp_overcurrent  ) ic4_input_b |= 0x02;
652   // if ( lamp_undercurrent ) ic4_input_b |= 0x01;
677   #ifdef UNUSED_FUNCTION
678   if ( lamp_overcurrent  ) ic4_input_b |= 0x02;
679   if ( lamp_undercurrent ) ic4_input_b |= 0x01;
680   #endif
653681
654682   LOG_IC3(("%04x IC4 PIA Read of Port B %x\n",activecpu_get_previouspc(),ic4_input_b));
655683   return ic4_input_b;
656684}
657685
686
658687static WRITE8_HANDLER( pia_ic4_ca2_w )
659688{
660689   LOG_IC3(("%04x IC4 PIA Write CA (input MUX strobe /LED B), %02X\n", activecpu_get_previouspc(),data));
r2241r2242
663692   ic23_update();
664693}
665694
666// IC4, 7 seg leds, 50Hz timer reel sensors, current sensors
667695
668696static const pia6821_interface pia_ic4_intf =
669697{
r2241r2242
672700   /*irqs   : A/B             */ cpu0_irq, cpu0_irq
673701};
674702
675//IC5
703
704/* IC5, AUX ports, coin lockouts and AY sound chip select (MODs below 4 only) */
676705static READ8_HANDLER( pia_ic5_porta_r )
677706{
678707   LOG(("%04x IC5 PIA Read of Port A (AUX1)\n",activecpu_get_previouspc()));
679//  popmessage("%d",(pia_get_output_a(2) & 0x01));
680708   return readinputportbytag("AUX1");
681709}
682710
711
683712static READ8_HANDLER( pia_ic5_portb_r )
684713{
685714   LOG(("%04x IC5 PIA Read of Port B (coin input AUX2)\n",activecpu_get_previouspc()));
r2241r2242
690719   return readinputportbytag("AUX2");
691720}
692721
722
693723static WRITE8_HANDLER( pia_ic5_ca2_w )
694724{
695725   LOG(("%04x IC5 PIA Write CA2 (Serial Tx) %2x\n",activecpu_get_previouspc(),data));
696726   serial_data = data;
697727}
698728
729
699730/* ---------------------------------------
700731   AY Chip sound function selection -
701732   ---------------------------------------
r2241r2242
7177481    0         | Write to selected PSG register. When set, the PSG will take the data at Port A and write it into the selected PSG register.
7187491    1         | Select PSG register. When set, the PSG will take the data at Port A and select a register.
719750*/
751
720752/* PSG function selected */
721
722753static void update_ay(running_machine *machine)
723754{
724755   if (!pia_get_output_cb2(2))
r2241r2242
742773            break;
743774           }
744775           case 0x03:
745         {/* CA2 = 1 CB2 = 1? : The register will now be selected and the user can read from or write to it.  The register will remain selected until another is chosen.*/
746              AY8910_control_port_0_w(machine, 0, pia_get_output_a(3));
776         {/* CA2 = 1 CB2 = 1? : The register will now be selected and the user can read from or write to it.
777             The register will remain selected until another is chosen.*/
778            AY8910_control_port_0_w(machine, 0, pia_get_output_a(3));
747779            LOG(("AY Chip Select \n"));
748780            break;
749781           }
r2241r2242
753785         }
754786      }
755787   }
756
757788}
758789
790
759791static WRITE8_HANDLER( pia_ic5_cb2_w )
760792{
761793    update_ay(machine);
762794}
763795
796
764797static const pia6821_interface pia_ic5_intf =
765798{
766799   /*inputs : A/B,CA/B1,CA/B2 */ pia_ic5_porta_r, pia_ic5_portb_r, 0, 0, 0, 0,
r2241r2242
768801   /*irqs   : A/B             */ cpu0_irq, cpu0_irq
769802};
770803
771//IC6
804
805/* IC6, Reel A and B and AY registers (MODs below 4 only) */
772806static WRITE8_HANDLER( pia_ic6_portb_w )
773807{
774808   LOG(("%04x IC6 PIA Port B Set to %2x (Reel A and B)\n", activecpu_get_previouspc(),data));
775809   Stepper_update(0, data & 0x0F );
776810   Stepper_update(1, (data>>4) & 0x0F );
777811
778//  if ( pia_get_output_cb2(1))
812/*  if ( pia_get_output_cb2(1)) */
779813   {
780814      if ( Stepper_optic_state(0) ) optic_pattern |=  0x01;
781815      else                          optic_pattern &= ~0x01;
r2241r2242
787821   draw_reel((1));
788822}
789823
824
790825static WRITE8_HANDLER( pia_ic6_porta_w )
791826{
792827   LOG(("%04x IC6 PIA Write A %2x\n", activecpu_get_previouspc(),data));
793828   if (mod_number <4)
794829   {
795        aydata = data;
830        ay_data = data;
796831       update_ay(machine);
797832   }
798833}
799834
835
800836static WRITE8_HANDLER( pia_ic6_ca2_w )
801837{
802838   LOG(("%04x IC6 PIA write CA2 %2x (AY8913 BC1)\n", activecpu_get_previouspc(),data));
r2241r2242
808844   }
809845}
810846
847
811848static WRITE8_HANDLER( pia_ic6_cb2_w )
812849{
813850   LOG(("%04x IC6 PIA write CB2 %2x (AY8913 BCDIR)\n", activecpu_get_previouspc(),data));
r2241r2242
819856   }
820857}
821858
859
822860static const pia6821_interface pia_ic6_intf =
823861{
824862   /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0,
r2241r2242
826864   /*irqs   : A/B             */ cpu0_irq, cpu0_irq
827865};
828866
829//IC7
867
868/* IC7 Reel C and D, mechanical meters/Reel E and F, input strobe bit A */
830869static WRITE8_HANDLER( pia_ic7_porta_w )
831870{
832871   LOG(("%04x IC7 PIA Port A Set to %2x (Reel C and D)\n", activecpu_get_previouspc(),data));
833872   Stepper_update(2, data & 0x0F );
834873   Stepper_update(3, (data >> 4)& 0x0F );
835874
836//  if ( pia_get_output_cb2(1))
875/*  if ( pia_get_output_cb2(1)) */
837876   {
838877      if ( Stepper_optic_state(2) ) optic_pattern |=  0x04;
839878      else                          optic_pattern &= ~0x04;
r2241r2242
844883   draw_reel((3));
845884}
846885
886
847887static WRITE8_HANDLER( pia_ic7_portb_w )
848888{
849   int i;
889   int meter;
850890   long cycles  = ATTOTIME_TO_CYCLES(0, timer_get_time() );
851891
852// The meters are connected to a voltage drop sensor, where current
853// flowing through them also passes through pin B7, meaning that when
854// any meter is activated, pin B7 goes high.
855// As for why they connected this to an output port rather than using
856// CB1, no idea.
857// This appears to have confounded the schematic drawer, who has assumed that
858// all eight meters are driven from this port, giving the 8 line driver chip
859// 9 connections in total.
892/* The meters are connected to a voltage drop sensor, where current
893flowing through them also passes through pin B7, meaning that when
894any meter is activated, pin B7 goes high.
895As for why they connected this to an output port rather than using
896CB1, no idea.
897This appears to have confounded the schematic drawer, who has assumed that
898all eight meters are driven from this port, giving the 8 line driver chip
8999 connections in total. */
860900
861901   mmtr_data = data;
862902   if (mmtr_data)
863903   {
864      pia_set_input_b(4,mmtr_data|0x80);
865      for (i=0; i<8; i++)
866      if ( mmtr_data & (1 << i) )   Mechmtr_update(i, cycles, mmtr_data & (1 << i) );
904      pia_set_input_b(4, mmtr_data | 0x80);
905      for (meter = 0; meter < 8; meter ++)
906      if (mmtr_data & (1 << meter))   Mechmtr_update(meter, cycles, mmtr_data & (1 << meter));
867907   }
868908   else
869909   {
870      pia_set_input_b(4,mmtr_data&~0x80);
910      pia_set_input_b(4, mmtr_data &~0x80);
871911   }
872912
873913   LOG(("%04x IC7 PIA Port B Set to %2x (Meters, Reel E and F)\n", activecpu_get_previouspc(),data));
874914}
875915
916
876917static WRITE8_HANDLER( pia_ic7_ca2_w )
877918{
878919   LOG(("%04x IC7 PIA write CA2 %2x (input strobe bit 0 / LED A)\n", activecpu_get_previouspc(),data));
r2241r2242
882923   ic23_update();
883924}
884925
926
885927static WRITE8_HANDLER( pia_ic7_cb2_w )
886928{
887// The eighth meter is connected here, because the voltage sensor
888// is on PB7.
929/* The eighth meter is connected here, because the voltage sensor
930is on PB7. */
889931   long cycles  = ATTOTIME_TO_CYCLES(0, timer_get_time() );
890932   if (data)
891933   {
r2241r2242
895937   LOG(("%04x IC7 PIA write CB2 %2x \n", activecpu_get_previouspc(),data));
896938}
897939
940
898941static const pia6821_interface pia_ic7_intf =
899942{
900943   /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0,
r2241r2242
902945   /*irqs   : A/B             */ cpu0_irq, cpu0_irq
903946};
904947
948
949/* IC8, Inputs, TRIACS, alpha clock */
905950static READ8_HANDLER( pia_ic8_porta_r )
906951{
907952   static const UINT8 ports[8] = { 0, 1, 2, 3, 0, 1, 4, 5 };
908953   int input_read = ports[input_strobe];
909954
910955   LOG_IC8(("%04x IC8 PIA Read of Port A (MUX input data)\n",activecpu_get_previouspc()));
911// The orange inputs are polled twice as often as the black ones, for reasons of efficiency.
912// This is achieved via connecting every input line to an AND gate, thus allowing two strobes
913// to represent each orange input bank (strobes are active low).
956/* The orange inputs are polled twice as often as the black ones, for reasons of efficiency.
957   This is achieved via connecting every input line to an AND gate, thus allowing two strobes
958   to represent each orange input bank (strobes are active low). */
914959   pia_set_input_cb1(2, (readinputportbytag("AUX2") & 0x80));
915960   return readinputport(input_read);
916961}
917962
963
918964static WRITE8_HANDLER( pia_ic8_portb_w )
919965{
920966   int i;
921967   LOG_IC8(("%04x IC8 PIA Port B Set to %2x (OUTPUT PORT, TRIACS)\n", activecpu_get_previouspc(),data));
922   for (i=0; i<8; i++)
968   for (i = 0; i < 8; i++)
923969      if ( data & (1 << i) )      output_set_indexed_value("triac", i, data & (1 << i));
924970}
925971
972
926973static WRITE8_HANDLER( pia_ic8_ca2_w )
927974{
928975   LOG_IC8(("%04x IC8 PIA write CA2 (input_strobe bit 2 / LED C) %02X\n", activecpu_get_previouspc(), data & 0xFF));
r2241r2242
931978   ic23_update();
932979}
933980
981
934982static WRITE8_HANDLER( pia_ic8_cb2_w )
935983{
936984   LOG_IC8(("%04x IC8 PIA write CB2 (alpha clock) %02X\n", activecpu_get_previouspc(), data & 0xFF));
r2241r2242
943991   ROC10937_draw_16seg(0);
944992}
945993
994
946995static const pia6821_interface pia_ic8_intf =
947996{
948997   /*inputs : A/B,CA/B1,CA/B2 */ pia_ic8_porta_r, 0, 0, 0, 0, 0,
r2241r2242
9511000};
9521001
9531002
954// input ports for MPU4 board ////////////////////////////////////////
955
1003/* input ports for MPU4 board */
9561004static INPUT_PORTS_START( mpu4 )
9571005   PORT_START_TAG("ORANGE1")
9581006   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("00")
r2241r2242
10651113   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("20p")PORT_IMPULSE(5)
10661114   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("50p")PORT_IMPULSE(5)
10671115   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")PORT_IMPULSE(5)
1068
10691116INPUT_PORTS_END
10701117
1118
10711119static INPUT_PORTS_START( connect4 )
10721120   PORT_START_TAG("ORANGE1")
10731121   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("00")
r2241r2242
11801228   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("20p")PORT_IMPULSE(5)
11811229   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("50p")PORT_IMPULSE(5)
11821230   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")PORT_IMPULSE(5)
1183
11841231INPUT_PORTS_END
11851232
1233
1234/* Common configurations */
11861235static void mpu4_config_common(void)
11871236{
11881237   pia_config(0,&pia_ic3_intf);
r2241r2242
11931242   pia_config(5,&pia_ic8_intf);
11941243
11951244   ic24_timer = timer_alloc(ic24_timeout, NULL);
1196   // setup ptm ////////////////////////////////////////////////////////////
1245   /* setup 6840ptm */
11971246   ptm6840_config(0, &ptm_ic2_intf );
11981247}
11991248
r2241r2242
12051254   serial_card_connected=0;
12061255   mod_number=2;
12071256
1208// setup 8 mechanical meters ////////////////////////////////////////////
1257   /* setup 8 mechanical meters */
12091258   Mechmtr_init(8);
12101259
1211// setup 4 default 96 half step reels ///////////////////////////////////
1260   /* setup 4 reels */
12121261   Stepper_init(0, BARCREST_48STEP_REEL);
12131262   Stepper_init(1, BARCREST_48STEP_REEL);
12141263   Stepper_init(2, BARCREST_48STEP_REEL);
12151264   Stepper_init(3, BARCREST_48STEP_REEL);
12161265
1217// setup the standard oki MSC1937 display ///////////////////////////////
1266   /* setup the standard oki MSC1937 display */
12181267   ROC10937_init(0, MSC1937,0);
12191268}
12201269
1270
12211271/*
12221272Characteriser (CHR)
12231273
r2241r2242
12641314      }
12651315      else
12661316      {
1267         for ( x = prot_col; x < 64; x++ )
1317         for (x = prot_col; x < 64; x++)
12681318         {
12691319            if   (MPU4_chr_lut[(x)] == call)
12701320            {
r2241r2242
12791329   else if (offset == 2)
12801330   {
12811331      LOG_CHR(("Characteriser write 2 data %02X\n",data));
1282      for ( x = lamp_col; x < 16; x++ )
1332      for (x = lamp_col; x < 16; x++)
12831333      {
12841334         if   (MPU4_chr_lut[(64+x)] == call)
12851335         {
r2241r2242
12951345   }
12961346}
12971347
1348
12981349static READ8_HANDLER( characteriser_r )
12991350{
13001351   LOG_CHR(("Characteriser read offset %02X \n",offset));
r2241r2242
13121363   return 0;
13131364}
13141365
1315// generate a 50 Hz signal (based on an RC time) //////////////////////////
1366
1367/* generate a 50 Hz signal (based on an RC time) */
13161368static TIMER_DEVICE_CALLBACK( gen_50hz )
13171369{
1318   // Although reported as a '50Hz' signal, the fact that both rising and
1319   // falling edges of the pulse are used, the timer actually gives a 100Hz
1320   // oscillating signal.
1370   /* Although reported as a '50Hz' signal, the fact that both rising and
1371    falling edges of the pulse are used, the timer actually gives a 100Hz
1372    oscillating signal.*/
13211373   signal_50hz = signal_50hz?0:1;
13221374
1323   pia_set_input_ca1(1,signal_50hz);   // signal is connected to IC4 CA1
1375   pia_set_input_ca1(1,signal_50hz);   /* signal is connected to IC4 CA1 */
13241376}
13251377
1378
13261379static ADDRESS_MAP_START( mod2_memmap, ADDRESS_SPACE_PROGRAM, 8 )
13271380   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
13281381   AM_RANGE(0x0800, 0x0810) AM_READWRITE(characteriser_r,characteriser_w)
13291382
1330   AM_RANGE(0x0850, 0x0850) AM_READWRITE(bankswitch_r,bankswitch_w)   // write bank (rom page select)
1383   AM_RANGE(0x0850, 0x0850) AM_READWRITE(bankswitch_r,bankswitch_w)   /* write bank (rom page select) */
13311384
1332//  AM_RANGE(0x08E0, 0x08E7) AM_READWRITE(68681_duart_r,68681_duart_w)
1385/*  AM_RANGE(0x08E0, 0x08E7) AM_READWRITE(68681_duart_r,68681_duart_w) */
13331386
1334   AM_RANGE(0x0900, 0x0907) AM_READWRITE(ptm6840_0_r,ptm6840_0_w)  // 6840PTM
1387   AM_RANGE(0x0900, 0x0907) AM_READWRITE(ptm6840_0_r,ptm6840_0_w)  /* 6840PTM */
13351388
1336   AM_RANGE(0x0A00, 0x0A03) AM_READWRITE(pia_0_r,pia_0_w)        // PIA6821 IC3
1337   AM_RANGE(0x0B00, 0x0B03) AM_READWRITE(pia_1_r,pia_1_w)        // PIA6821 IC4
1338   AM_RANGE(0x0C00, 0x0C03) AM_READWRITE(pia_2_r,pia_2_w)        // PIA6821 IC5
1339   AM_RANGE(0x0D00, 0x0D03) AM_READWRITE(pia_3_r,pia_3_w)      // PIA6821 IC6
1340   AM_RANGE(0x0E00, 0x0E03) AM_READWRITE(pia_4_r,pia_4_w)      // PIA6821 IC7
1341   AM_RANGE(0x0F00, 0x0F03) AM_READWRITE(pia_5_r,pia_5_w)      // PIA6821 IC8
1389   AM_RANGE(0x0A00, 0x0A03) AM_READWRITE(pia_0_r,pia_0_w)        /* PIA6821 IC3 */
1390   AM_RANGE(0x0B00, 0x0B03) AM_READWRITE(pia_1_r,pia_1_w)        /* PIA6821 IC4 */
1391   AM_RANGE(0x0C00, 0x0C03) AM_READWRITE(pia_2_r,pia_2_w)        /* PIA6821 IC5 */
1392   AM_RANGE(0x0D00, 0x0D03) AM_READWRITE(pia_3_r,pia_3_w)      /* PIA6821 IC6 */
1393   AM_RANGE(0x0E00, 0x0E03) AM_READWRITE(pia_4_r,pia_4_w)      /* PIA6821 IC7 */
1394   AM_RANGE(0x0F00, 0x0F03) AM_READWRITE(pia_5_r,pia_5_w)      /* PIA6821 IC8 */
13421395
1343   AM_RANGE(0x1000, 0xffff) AM_READ(SMH_BANK1)   // 64k  paged ROM (4 pages)
1396   AM_RANGE(0x1000, 0xffff) AM_READ(SMH_BANK1)   /* 64k  paged ROM (4 pages)  */
13441397ADDRESS_MAP_END
13451398
1346// machine driver for barcrest mpu4 board /////////////////////////////////
13471399
1400/* machine driver for MOD 2 board */
13481401static MACHINE_DRIVER_START( mpu4mod2 )
13491402
13501403   MDRV_MACHINE_START(mpu4mod2)
r2241r2242
13581411   MDRV_SOUND_ADD_TAG("AY8913",AY8913, MPU4_MASTER_CLOCK/4)
13591412   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
13601413
1361   MDRV_NVRAM_HANDLER(generic_0fill)               // load/save nv RAM
1414   MDRV_NVRAM_HANDLER(generic_0fill)
13621415
1363   /* video hardware */
13641416   MDRV_DEFAULT_LAYOUT(layout_mpu4)
13651417MACHINE_DRIVER_END
13661418
1367   const UINT8 MPU4_chr_lut[72]= {   0x00,0x1A,0x04,0x10,0x18,0x0F,0x13,0x1B,
1368                           0x03,0x07,0x17,0x1D,0x36,0x35,0x2B,0x28,
1369                           0x39,0x21,0x22,0x25,0x2C,0x29,0x31,0x34,
1370                           0x0A,0x1F,0x06,0x0E,0x1C,0x12,0x1E,0x0D,
1371                           0x14,0x0A,0x19,0x15,0x06,0x0F,0x08,0x1B,
1372                           0x1E,0x04,0x01,0x0C,0x18,0x1A,0x11,0x0B,
1373                           0x03,0x17,0x10,0x1D,0x0E,0x07,0x12,0x09,
1374                           0x0D,0x1F,0x16,0x05,0x13,0x1C,0x02,0x00,
1375                           0x00,0x01,0x04,0x09,0x10,0x19,0x24,0x31};
13761419
13771420#include "drivers/mpu4drvr.c"
src/mame/drivers/20pacgal.c
r2241r2242
3131***************************************************************************/
3232
3333#include "driver.h"
34#include "deprecat.h"
3534#include "machine/eeprom.h"
3635#include "sound/namco.h"
3736#include "sound/dac.h"
r2241r2242
6463   cpu_interrupt_enable(0, bit);
6564
6665   if (!bit)
67      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE );
66      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE );
6867}
6968
7069
r2241r2242
161160
162161static WRITE8_HANDLER( rom_bank_select_w )
163162{
164   _20pacgal_state *state = Machine->driver_data;
163   _20pacgal_state *state = machine->driver_data;
165164
166165   state->game_selected = data & 1;
167166
r2241r2242
172171
173172static WRITE8_HANDLER( rom_48000_w )
174173{
175   _20pacgal_state *state = Machine->driver_data;
174   _20pacgal_state *state = machine->driver_data;
176175
177176   if (state->game_selected)
178177   {
src/mame/drivers/spbactn.c
r2241r2242
137137
138138static WRITE16_HANDLER( soundcommand_w )
139139{
140   if (ACCESSING_LSB)
140   if (ACCESSING_BITS_0_7)
141141   {
142142      soundlatch_w(machine,offset,data & 0xff);
143143      cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
src/mame/drivers/system16.c
r2241r2242
209209
210210static WRITE16_HANDLER( sys16_3d_coinctrl_w )
211211{
212   if( ACCESSING_LSB )
212   if( ACCESSING_BITS_0_7 )
213213{
214214      coinctrl = data&0xff;
215215      sys16_refreshenable = coinctrl & 0x10;
r2241r2242
409409
410410static WRITE16_HANDLER( sound_command_w )
411411{
412   if( ACCESSING_LSB )
412   if( ACCESSING_BITS_0_7 )
413413{
414414      soundlatch_w( machine,0,data&0xff );
415415      cpunum_set_input_line(machine, 1, 0, HOLD_LINE );
r2241r2242
418418
419419static WRITE16_HANDLER( sound_command_nmi_w )
420420{
421   if( ACCESSING_LSB )
421   if( ACCESSING_BITS_0_7 )
422422{
423423      soundlatch_w( machine,0,data&0xff );
424424      cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
r2241r2242
430430
431431static WRITE16_HANDLER( sys16_coinctrl_w )
432432{
433   if( ACCESSING_LSB )
433   if( ACCESSING_BITS_0_7 )
434434{
435435      coinctrl = data&0xff;
436436      sys16_refreshenable = coinctrl & 0x20;
r2241r2242
502502
503503static WRITE16_HANDLER( sys16_tilebank_w )
504504{
505   if(ACCESSING_LSB)
505   if(ACCESSING_BITS_0_7)
506506   {
507507      switch(offset & 1)
508508      {
r2241r2242
891891
892892static WRITE16_HANDLER( eswat_tilebank0_w )
893893{
894   if( ACCESSING_LSB )
894   if( ACCESSING_BITS_0_7 )
895895   {
896896      eswat_tilebank0 = data&0xff;
897897   }
r2241r2242
12281228static WRITE16_HANDLER( ga_sound_command_w )
12291229{
12301230   COMBINE_DATA( &sys16_workingram[(0xecfc-0xc000)/2] );
1231   if( ACCESSING_MSB )
1231   if( ACCESSING_BITS_8_15 )
12321232{
12331233      soundlatch_w( machine,0,data>>8 );
12341234      cpunum_set_input_line(Machine, 1, 0, HOLD_LINE );
src/mame/drivers/deniam.c
r2241r2242
5454
5555static WRITE16_HANDLER( sound_command_w )
5656{
57   if (ACCESSING_MSB)
57   if (ACCESSING_BITS_8_15)
5858   {
5959      soundlatch_w(machine,offset,(data >> 8) & 0xff);
6060      cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
r2241r2242
6868
6969static WRITE16_HANDLER( deniam16c_oki_rom_bank_w )
7070{
71   if (ACCESSING_LSB)
71   if (ACCESSING_BITS_0_7)
7272      OKIM6295_set_bank_base(0,(data & 0x01) ? 0x40000 : 0x00000);
7373}
7474
r2241r2242
8080
8181static WRITE16_HANDLER( YM3812_control_port_0_msb_w )
8282{
83   if (ACCESSING_MSB)
83   if (ACCESSING_BITS_8_15)
8484      YM3812_control_port_0_w(machine,0,(data >> 8) & 0xff);
8585}
8686
8787static WRITE16_HANDLER( YM3812_write_port_0_msb_w )
8888{
89   if (ACCESSING_MSB)
89   if (ACCESSING_BITS_8_15)
9090      YM3812_write_port_0_w(machine,0,(data >> 8) & 0xff);
9191}
9292
src/mame/drivers/limenko.c
r2241r2242
6161   UINT16 paldata;
6262   COMBINE_DATA(&paletteram32[offset]);
6363
64   if(ACCESSING_LSW32)
64   if(ACCESSING_BITS_0_15)
6565   {
6666      paldata = paletteram32[offset] & 0x7fff;
6767      palette_set_color_rgb(Machine, offset * 2 + 1, pal5bit(paldata >> 0), pal5bit(paldata >> 5), pal5bit(paldata >> 10));
6868   }
6969
70   if(ACCESSING_MSW32)
70   if(ACCESSING_BITS_16_31)
7171   {
7272      paldata = (paletteram32[offset] >> 16) & 0x7fff;
7373      palette_set_color_rgb(Machine, offset * 2 + 0, pal5bit(paldata >> 0), pal5bit(paldata >> 5), pal5bit(paldata >> 10));
src/mame/drivers/wwfsstar.c
r2241r2242
7878 Pretty Straightforward
7979*******************************************************************************/
8080
81static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 16 )
82   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)   /* Rom */
83   AM_RANGE(0x080000, 0x080fff) AM_READ(SMH_RAM)   /* FG0 Ram */
84   AM_RANGE(0x0c0000, 0x0c0fff) AM_READ(SMH_RAM)   /* BG0 Ram */
85   AM_RANGE(0x100000, 0x1003ff) AM_READ(SMH_RAM)   /* SPR Ram */
86   AM_RANGE(0x180000, 0x180001) AM_READ(input_port_3_word_r)   /* DSW0 */
87   AM_RANGE(0x180002, 0x180003) AM_READ(input_port_4_word_r)   /* DSW1 */
88   AM_RANGE(0x180004, 0x180005) AM_READ(input_port_0_word_r)   /* CTRLS0 */
89   AM_RANGE(0x180006, 0x180007) AM_READ(input_port_1_word_r)   /* CTRLS1 */
90   AM_RANGE(0x180008, 0x180009) AM_READ(input_port_2_word_r_cust)   /* MISC */
91   AM_RANGE(0x1c0000, 0x1c3fff) AM_READ(SMH_RAM)   /* Work Ram */
92ADDRESS_MAP_END
93
94static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 16 )
95   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)   /* Rom */
96   AM_RANGE(0x080000, 0x080fff) AM_WRITE(wwfsstar_fg0_videoram_w) AM_BASE(&wwfsstar_fg0_videoram)   /* FG0 Ram */
97   AM_RANGE(0x0c0000, 0x0c0fff) AM_WRITE(wwfsstar_bg0_videoram_w) AM_BASE(&wwfsstar_bg0_videoram)   /* BG0 Ram */
98   AM_RANGE(0x100000, 0x1003ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16)   /* SPR Ram */
81static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
82   AM_RANGE(0x000000, 0x03ffff) AM_ROM
83   AM_RANGE(0x080000, 0x080fff) AM_RAM AM_WRITE(wwfsstar_fg0_videoram_w) AM_BASE(&wwfsstar_fg0_videoram)   /* FG0 Ram */
84   AM_RANGE(0x0c0000, 0x0c0fff) AM_RAM AM_WRITE(wwfsstar_bg0_videoram_w) AM_BASE(&wwfsstar_bg0_videoram)   /* BG0 Ram */
85   AM_RANGE(0x100000, 0x1003ff) AM_RAM AM_BASE(&spriteram16)      /* SPR Ram */
9986   AM_RANGE(0x140000, 0x140fff) AM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE(&paletteram16)
10087   AM_RANGE(0x180000, 0x180003) AM_WRITE(wwfsstar_irqack_w)
88   AM_RANGE(0x180000, 0x180001) AM_READ(input_port_3_word_r)      /* DSW0 */
89   AM_RANGE(0x180002, 0x180003) AM_READ(input_port_4_word_r)      /* DSW1 */
90   AM_RANGE(0x180004, 0x180005) AM_READ(input_port_0_word_r)      /* CTRLS0 */
10191   AM_RANGE(0x180004, 0x180007) AM_WRITE(wwfsstar_scrollwrite)
92   AM_RANGE(0x180006, 0x180007) AM_READ(input_port_1_word_r)      /* CTRLS1 */
93   AM_RANGE(0x180008, 0x180009) AM_READ(input_port_2_word_r_cust)   /* MISC */
10294   AM_RANGE(0x180008, 0x180009) AM_WRITE(wwfsstar_soundwrite)
10395   AM_RANGE(0x18000a, 0x18000b) AM_WRITE(wwfsstar_flipscreen_w)
104   AM_RANGE(0x1c0000, 0x1c3fff) AM_WRITE(SMH_RAM)   /* Work Ram */
96   AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM      /* Work Ram */
10597ADDRESS_MAP_END
10698
107static ADDRESS_MAP_START( readmem_sound, ADDRESS_SPACE_PROGRAM, 8 )
108   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
109   AM_RANGE(0x8000, 0x87ff) AM_READ(SMH_RAM)
110   AM_RANGE(0x8801, 0x8801) AM_READ(YM2151_status_port_0_r)
111   AM_RANGE(0x9800, 0x9800) AM_READ(OKIM6295_status_0_r)
99static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
100   AM_RANGE(0x0000, 0x7fff) AM_ROM
101   AM_RANGE(0x8000, 0x87ff) AM_RAM
102   AM_RANGE(0x8800, 0x8800) AM_WRITE(YM2151_register_port_0_w)
103   AM_RANGE(0x8801, 0x8801) AM_READWRITE(YM2151_status_port_0_r,YM2151_data_port_0_w)
104   AM_RANGE(0x9800, 0x9800) AM_READWRITE(OKIM6295_status_0_r,OKIM6295_data_0_w)
112105   AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r)
113106ADDRESS_MAP_END
114107
115static ADDRESS_MAP_START( writemem_sound, ADDRESS_SPACE_PROGRAM, 8 )
116   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
117   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM)
118   AM_RANGE(0x8800, 0x8800) AM_WRITE(YM2151_register_port_0_w)
119   AM_RANGE(0x8801, 0x8801) AM_WRITE(YM2151_data_port_0_w)
120   AM_RANGE(0x9800, 0x9800) AM_WRITE(OKIM6295_data_0_w)
121ADDRESS_MAP_END
122108
123
124109/*******************************************************************************
125110 Read / Write Handlers
126111********************************************************************************
r2241r2242
361346
362347   /* basic machine hardware */
363348   MDRV_CPU_ADD(M68000, 10000000)
364   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
349   MDRV_CPU_PROGRAM_MAP(main_map,0)
365350   MDRV_CPU_VBLANK_INT_HACK(wwfsstars_interrupt,272)
366351
367352   MDRV_CPU_ADD(Z80, 3579545)
368   MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound)
353   MDRV_CPU_PROGRAM_MAP(sound_map,0)
369354
370355   /* video hardware */
371356   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/model1.c
r2241r2242
689689
690690static WRITE16_HANDLER( bank_w )
691691{
692   if(ACCESSING_LSB) {
692   if(ACCESSING_BITS_0_7) {
693693      switch(data & 0xf) {
694694      case 0x1: // 100000-1fffff data roms banking
695695         memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x1000000 + 0x100000*((data >> 4) & 0xf));
src/mame/drivers/taito_b.c
r2241r2242
362362
363363static WRITE16_HANDLER( gain_control_w )
364364{
365   if (ACCESSING_MSB)
365   if (ACCESSING_BITS_8_15)
366366   {
367367      if (offset==0)
368368      {
r2241r2242
429429{
430430   COMBINE_DATA(&eep_latch);
431431
432    if (ACCESSING_MSB)
432    if (ACCESSING_BITS_8_15)
433433    {
434434      data >>= 8; /*M68k byte write*/
435435
src/mame/drivers/viper.c
r2241r2242
180180{
181181   UINT64 r = 0;
182182
183   if (!(mem_mask & U64(0x00000000ffff0000)))
183   if (ACCESSING_BITS_16_31)
184184   {
185185      switch (offset & 0xf)
186186      {
r2241r2242
201201
202202static WRITE64_HANDLER(cf_card_data_w)
203203{
204   if (!(mem_mask & U64(0x00000000ffff0000)))
204   if (ACCESSING_BITS_16_31)
205205   {
206206      switch (offset & 0xf)
207207      {
r2241r2242
223223{
224224   UINT64 r = 0;
225225
226   if (!(mem_mask & U64(0x00000000ffff0000)))
226   if (ACCESSING_BITS_16_31)
227227   {
228228      if (cf_card_ide)
229229      {
r2241r2242
286286{
287287   //printf("compact_flash_w: %08X%08X, %08X, %08X%08X at %08X\n", (UINT32)(data>>32), (UINT32)(data), offset, (UINT32)(mem_mask >> 32), (UINT32)(mem_mask), activecpu_get_pc());
288288
289   if (!(mem_mask & U64(0x00000000ffff0000)))
289   if (ACCESSING_BITS_16_31)
290290   {
291291      if (offset < 0x10)
292292      {
r2241r2242
357357
358358static WRITE64_HANDLER(unk2_w)
359359{
360   if (!(mem_mask & U64(0xff00000000000000)))
360   if (ACCESSING_BITS_56_63)
361361   {
362362      cf_card_ide = 0;
363363   }
r2241r2242
370370{
371371   UINT64 r = 0;
372372
373   if (!(mem_mask & U64(0x00000000ffff0000)))
373   if (ACCESSING_BITS_16_31)
374374   {
375375      int reg = (offset >> 4) & 0x7;
376376
r2241r2242
382382
383383static WRITE64_HANDLER(ata_w)
384384{
385   if (!(mem_mask & U64(0x00000000ffff0000)))
385   if (ACCESSING_BITS_16_31)
386386   {
387387      int reg = (offset >> 4) & 0x7;
388388
r2241r2242
396396   UINT64 r = 0;
397397   //return 0;//U64(0x0000400000000000);
398398
399   if (!(mem_mask & U64(0x0000ff0000000000)))
399   if (ACCESSING_BITS_40_47)
400400   {
401401      r |= (UINT64)(unk1_bit << 5) << 40;
402402   }
r2241r2242
406406
407407static WRITE64_HANDLER(unk1a_w)
408408{
409   if (!(mem_mask & U64(0xff00000000000000)))
409   if (ACCESSING_BITS_56_63)
410410   {
411411      unk1_bit = 1;
412412   }
r2241r2242
414414
415415static WRITE64_HANDLER(unk1b_w)
416416{
417   if (!(mem_mask & U64(0xff00000000000000)))
417   if (ACCESSING_BITS_56_63)
418418   {
419419      unk1_bit = 0;
420420   }
r2241r2242
563563{
564564   UINT64 r = 0;
565565
566   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
566   if (ACCESSING_BITS_32_63)
567567   {
568568      r |= (UINT64)timekeeper_0_32be_r(machine, (offset * 2) + 0, (UINT32)(mem_mask >> 32)) << 32;
569569   }
570   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
570   if (ACCESSING_BITS_0_31)
571571   {
572572      r |= timekeeper_0_32be_r(machine, (offset * 2) + 1, (UINT32)(mem_mask));
573573   }
r2241r2242
577577
578578static WRITE64_HANDLER(m48t58_w)
579579{
580   if (!(mem_mask & U64(0xffffffff00000000)))
580   if (ACCESSING_BITS_32_63)
581581   {
582582      timekeeper_0_32be_w(machine, (offset * 2) + 0, (UINT32)(data >> 32), (UINT32)(mem_mask >> 32));
583583   }
584   if (!(mem_mask & U64(0x00000000ffffffff)))
584   if (ACCESSING_BITS_0_31)
585585   {
586586      timekeeper_0_32be_w(machine, (offset * 2) + 1, (UINT32)(data), (UINT32)(mem_mask));
587587   }
src/mame/drivers/qdrmfgp.c
r2241r2242
176176
177177static READ16_HANDLER( sndram_r )
178178{
179   if (ACCESSING_LSB16)
179   if (ACCESSING_BITS_0_7)
180180         return sndram[offset];
181181
182182   return 0;
r2241r2242
184184
185185static WRITE16_HANDLER( sndram_w )
186186{
187   if (ACCESSING_LSB16)
187   if (ACCESSING_BITS_0_7)
188188   {
189189      sndram[offset] = data & 0xff;
190190      if (offset >= 0x40000)
r2241r2242
194194
195195static READ16_HANDLER( k054539_word_r )
196196{
197   if (ACCESSING_LSB16)
197   if (ACCESSING_BITS_0_7)
198198      return K054539_0_r(machine, offset);
199199
200200   return 0;
r2241r2242
202202
203203static WRITE16_HANDLER( k054539_word_w )
204204{
205   if (ACCESSING_LSB16)
205   if (ACCESSING_BITS_0_7)
206206      K054539_0_w(machine, offset, data);
207207}
208208
src/mame/drivers/cps1.c
r2241r2242
238238
239239static WRITE16_HANDLER( cps1_sound_fade_w )
240240{
241   if (ACCESSING_LSB)
241   if (ACCESSING_BITS_0_7)
242242      cps1_sound_fade_timer = data & 0xff;
243243}
244244
r2241r2242
249249
250250static WRITE16_HANDLER( cps1_sound_command_w )
251251{
252   if (ACCESSING_LSB)
252   if (ACCESSING_BITS_0_7)
253253      soundlatch_w(machine,0,data & 0xff);
254254}
255255
r2241r2242
257257{
258258//  popmessage("coinctrl %04x",data);
259259
260   if (ACCESSING_MSB)
260   if (ACCESSING_BITS_8_15)
261261   {
262262      coin_counter_w(0,data & 0x0100);
263263      coin_counter_w(1,data & 0x0200);
r2241r2242
265265      coin_lockout_w(1,~data & 0x0800);
266266   }
267267
268   if (ACCESSING_LSB)
268   if (ACCESSING_BITS_0_7)
269269   {
270270      /* mercs sets bit 0 */
271271      set_led_status(0,data & 0x02);
r2241r2242
276276
277277static WRITE16_HANDLER( cpsq_coinctrl2_w )
278278{
279   if (ACCESSING_LSB)
279   if (ACCESSING_BITS_0_7)
280280   {
281281      coin_counter_w(2,data & 0x01);
282282      coin_lockout_w(2,~data & 0x02);
r2241r2242
339339
340340WRITE16_HANDLER( qsound_sharedram1_w )
341341{
342   if (ACCESSING_LSB)
342   if (ACCESSING_BITS_0_7)
343343      qsound_sharedram1[offset] = data;
344344}
345345
r2241r2242
350350
351351static WRITE16_HANDLER( qsound_sharedram2_w )
352352{
353   if (ACCESSING_LSB)
353   if (ACCESSING_BITS_0_7)
354354      qsound_sharedram2[offset] = data;
355355}
356356
r2241r2242
434434
435435WRITE16_HANDLER( cps1_eeprom_port_w )
436436{
437   if (ACCESSING_LSB)
437   if (ACCESSING_BITS_0_7)
438438   {
439439      /*
440440        bit 0 = data
r2241r2242
34753475   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 2*8, 30*8-1 )
34763476
34773477   MDRV_GFXDECODE(cps1)
3478   MDRV_PALETTE_LENGTH(4096)
3478   MDRV_PALETTE_LENGTH(0xc00)
34793479
34803480   MDRV_VIDEO_START(cps1)
34813481   MDRV_VIDEO_EOF(cps1)
src/mame/drivers/yunsun16.c
r2241r2242
114114
115115static WRITE16_HANDLER( yunsun16_sound_bank_w )
116116{
117   if (ACCESSING_LSB)
117   if (ACCESSING_BITS_0_7)
118118   {
119119      int bank = data & 3;
120120      UINT8 *dst   = memory_region(REGION_SOUND1);
r2241r2242
134134   AM_RANGE(0x800102, 0x800103) AM_WRITE(SMH_NOP                        )   // ? $9080
135135   AM_RANGE(0x800104, 0x800105) AM_WRITE(SMH_NOP                        )   // ? $90c0
136136   AM_RANGE(0x80010a, 0x80010b) AM_WRITE(SMH_NOP                        )   // ? $9000
137   AM_RANGE(0x80010c, 0x80010f) AM_WRITE(SMH_RAM) AM_BASE(&yunsun16_scroll_1   )   // Scrolling
138   AM_RANGE(0x800114, 0x800117) AM_WRITE(SMH_RAM) AM_BASE(&yunsun16_scroll_0   )   // Scrolling
139   AM_RANGE(0x800154, 0x800155) AM_WRITE(SMH_RAM) AM_BASE(&yunsun16_priority   )   // Priority
137   AM_RANGE(0x80010c, 0x80010f) AM_RAM AM_BASE(&yunsun16_scroll_1            )   // Scrolling
138   AM_RANGE(0x800114, 0x800117) AM_RAM AM_BASE(&yunsun16_scroll_0            )   // Scrolling
139   AM_RANGE(0x800154, 0x800155) AM_RAM AM_BASE(&yunsun16_priority            )   // Priority
140140   AM_RANGE(0x800180, 0x800181) AM_WRITE(yunsun16_sound_bank_w               )   // Sound
141141   AM_RANGE(0x800188, 0x800189) AM_READWRITE(OKIM6295_status_0_lsb_r, OKIM6295_data_0_lsb_w   )   // Sound
142142   AM_RANGE(0x8001fe, 0x8001ff) AM_WRITE(SMH_NOP                                    )   // ? 0 (during int)
143   AM_RANGE(0x900000, 0x903fff) AM_READWRITE(SMH_RAM, paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)   // Palette
144   AM_RANGE(0x908000, 0x90bfff) AM_READWRITE(SMH_RAM, yunsun16_vram_1_w) AM_BASE(&yunsun16_vram_1   )   // Layer 1
145   AM_RANGE(0x90c000, 0x90ffff) AM_READWRITE(SMH_RAM, yunsun16_vram_0_w) AM_BASE(&yunsun16_vram_0   )   // Layer 0
143   AM_RANGE(0x900000, 0x903fff) AM_RAM AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)   // Palette
144   AM_RANGE(0x908000, 0x90bfff) AM_RAM AM_WRITE(yunsun16_vram_1_w) AM_BASE(&yunsun16_vram_1   )   // Layer 1
145   AM_RANGE(0x90c000, 0x90ffff) AM_RAM AM_WRITE(yunsun16_vram_0_w) AM_BASE(&yunsun16_vram_0   )   // Layer 0
146146   AM_RANGE(0x910000, 0x910fff) AM_RAM   AM_BASE(&spriteram16) AM_SIZE(&spriteram_size               )   // Sprites
147147   AM_RANGE(0xff0000, 0xffffff) AM_RAM
148148ADDRESS_MAP_END
r2241r2242
150150
151151static WRITE16_HANDLER( magicbub_sound_command_w )
152152{
153   if (ACCESSING_LSB)
153   if (ACCESSING_BITS_0_7)
154154   {
155155/*
156156HACK: the game continuously sends this. It'll play the oki sample
src/mame/drivers/scobra.c
r2241r2242
4747
4848#include "driver.h"
4949#include "machine/8255ppi.h"
50#include "galaxian.h"
50#include "galaxold.h"
5151#include "sound/ay8910.h"
5252
5353static const gfx_layout scobra_charlayout =
r2241r2242
131131static ADDRESS_MAP_START( type1_readmem, ADDRESS_SPACE_PROGRAM, 8 )
132132   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
133133   AM_RANGE(0x8000, 0x8bff) AM_READ(SMH_RAM)
134   AM_RANGE(0x8c00, 0x8fff) AM_READ(galaxian_videoram_r)   /* mirror */
134   AM_RANGE(0x8c00, 0x8fff) AM_READ(galaxold_videoram_r)   /* mirror */
135135   AM_RANGE(0x9000, 0x90ff) AM_READ(SMH_RAM)
136136   AM_RANGE(0x9800, 0x9803) AM_READ(ppi8255_0_r)
137137   AM_RANGE(0xa000, 0xa003) AM_READ(ppi8255_1_r)
r2241r2242
141141static ADDRESS_MAP_START( type1_writemem, ADDRESS_SPACE_PROGRAM, 8 )
142142   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
143143   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM)
144   AM_RANGE(0x8800, 0x8bff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
145   AM_RANGE(0x8c00, 0x8fff) AM_WRITE(galaxian_videoram_w)   /* mirror */
146   AM_RANGE(0x9000, 0x903f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
147   AM_RANGE(0x9040, 0x905f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
148   AM_RANGE(0x9060, 0x907f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
144   AM_RANGE(0x8800, 0x8bff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
145   AM_RANGE(0x8c00, 0x8fff) AM_WRITE(galaxold_videoram_w)   /* mirror */
146   AM_RANGE(0x9000, 0x903f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
147   AM_RANGE(0x9040, 0x905f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
148   AM_RANGE(0x9060, 0x907f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
149149   AM_RANGE(0x9080, 0x90ff) AM_WRITE(SMH_RAM)
150150   AM_RANGE(0x9800, 0x9803) AM_WRITE(ppi8255_0_w)
151151   AM_RANGE(0xa000, 0xa003) AM_WRITE(ppi8255_1_w)
152   AM_RANGE(0xa801, 0xa801) AM_WRITE(galaxian_nmi_enable_w)
153   AM_RANGE(0xa802, 0xa802) AM_WRITE(galaxian_coin_counter_w)
154   AM_RANGE(0xa804, 0xa804) AM_WRITE(galaxian_stars_enable_w)
155   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxian_flip_screen_x_w)
156   AM_RANGE(0xa807, 0xa807) AM_WRITE(galaxian_flip_screen_y_w)
152   AM_RANGE(0xa801, 0xa801) AM_WRITE(galaxold_nmi_enable_w)
153   AM_RANGE(0xa802, 0xa802) AM_WRITE(galaxold_coin_counter_w)
154   AM_RANGE(0xa804, 0xa804) AM_WRITE(galaxold_stars_enable_w)
155   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_x_w)
156   AM_RANGE(0xa807, 0xa807) AM_WRITE(galaxold_flip_screen_y_w)
157157ADDRESS_MAP_END
158158
159159static ADDRESS_MAP_START( type2_readmem, ADDRESS_SPACE_PROGRAM, 8 )
160160   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
161161   AM_RANGE(0x8000, 0x88ff) AM_READ(SMH_RAM)
162162   AM_RANGE(0x9000, 0x93ff) AM_READ(SMH_RAM)
163   AM_RANGE(0x9400, 0x97ff) AM_READ(galaxian_videoram_r)   /* mirror */
163   AM_RANGE(0x9400, 0x97ff) AM_READ(galaxold_videoram_r)   /* mirror */
164164   AM_RANGE(0x9800, 0x9800) AM_READ(watchdog_reset_r)
165165   AM_RANGE(0xa000, 0xa00f) AM_READ(scobra_type2_ppi8255_0_r)
166166   AM_RANGE(0xa800, 0xa80f) AM_READ(scobra_type2_ppi8255_1_r)
r2241r2242
169169static ADDRESS_MAP_START( type2_writemem, ADDRESS_SPACE_PROGRAM, 8 )
170170   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
171171   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM)
172   AM_RANGE(0x8800, 0x883f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
173   AM_RANGE(0x8840, 0x885f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
174   AM_RANGE(0x8860, 0x887f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
172   AM_RANGE(0x8800, 0x883f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
173   AM_RANGE(0x8840, 0x885f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
174   AM_RANGE(0x8860, 0x887f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
175175   AM_RANGE(0x8880, 0x88ff) AM_WRITE(SMH_RAM)
176   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
177   AM_RANGE(0x9400, 0x97ff) AM_WRITE(galaxian_videoram_w)   /* mirror */
176   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
177   AM_RANGE(0x9400, 0x97ff) AM_WRITE(galaxold_videoram_w)   /* mirror */
178178   AM_RANGE(0xa000, 0xa00f) AM_WRITE(scobra_type2_ppi8255_0_w)
179179   AM_RANGE(0xa800, 0xa80f) AM_WRITE(scobra_type2_ppi8255_1_w)
180   AM_RANGE(0xb000, 0xb000) AM_WRITE(galaxian_stars_enable_w)
181   AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxian_nmi_enable_w)
182   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxian_coin_counter_0_w)
183   AM_RANGE(0xb008, 0xb008) AM_WRITE(galaxian_coin_counter_1_w)
184   AM_RANGE(0xb00c, 0xb00c) AM_WRITE(galaxian_flip_screen_y_w)
185   AM_RANGE(0xb00e, 0xb00e) AM_WRITE(galaxian_flip_screen_x_w)
180   AM_RANGE(0xb000, 0xb000) AM_WRITE(galaxold_stars_enable_w)
181   AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxold_nmi_enable_w)
182   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxold_coin_counter_0_w)
183   AM_RANGE(0xb008, 0xb008) AM_WRITE(galaxold_coin_counter_1_w)
184   AM_RANGE(0xb00c, 0xb00c) AM_WRITE(galaxold_flip_screen_y_w)
185   AM_RANGE(0xb00e, 0xb00e) AM_WRITE(galaxold_flip_screen_x_w)
186186ADDRESS_MAP_END
187187
188188static ADDRESS_MAP_START( hustler_readmem, ADDRESS_SPACE_PROGRAM, 8 )
r2241r2242
197197static ADDRESS_MAP_START( hustler_writemem, ADDRESS_SPACE_PROGRAM, 8 )
198198   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
199199   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM)
200   AM_RANGE(0x8800, 0x8bff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
201   AM_RANGE(0x9000, 0x903f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
202   AM_RANGE(0x9040, 0x905f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
203   AM_RANGE(0x9060, 0x907f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
200   AM_RANGE(0x8800, 0x8bff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
201   AM_RANGE(0x9000, 0x903f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
202   AM_RANGE(0x9040, 0x905f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
203   AM_RANGE(0x9060, 0x907f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
204204   AM_RANGE(0x9080, 0x90ff) AM_WRITE(SMH_RAM)
205   AM_RANGE(0xa802, 0xa802) AM_WRITE(galaxian_flip_screen_x_w)
206   AM_RANGE(0xa804, 0xa804) AM_WRITE(galaxian_nmi_enable_w)
207   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxian_flip_screen_y_w)
205   AM_RANGE(0xa802, 0xa802) AM_WRITE(galaxold_flip_screen_x_w)
206   AM_RANGE(0xa804, 0xa804) AM_WRITE(galaxold_nmi_enable_w)
207   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_y_w)
208208   AM_RANGE(0xa80e, 0xa80e) AM_WRITE(SMH_NOP)   /* coin counters */
209209   AM_RANGE(0xd000, 0xd01f) AM_WRITE(hustler_ppi8255_0_w)
210210   AM_RANGE(0xe000, 0xe01f) AM_WRITE(hustler_ppi8255_1_w)
r2241r2242
222222static ADDRESS_MAP_START( hustlerb_writemem, ADDRESS_SPACE_PROGRAM, 8 )
223223   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
224224   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM)
225   AM_RANGE(0x8800, 0x8bff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
226   AM_RANGE(0x9000, 0x903f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
227   AM_RANGE(0x9040, 0x905f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
228   AM_RANGE(0x9060, 0x907f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
225   AM_RANGE(0x8800, 0x8bff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
226   AM_RANGE(0x9000, 0x903f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
227   AM_RANGE(0x9040, 0x905f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
228   AM_RANGE(0x9060, 0x907f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
229229   AM_RANGE(0x9080, 0x90ff) AM_WRITE(SMH_RAM)
230   AM_RANGE(0xa801, 0xa801) AM_WRITE(galaxian_nmi_enable_w)
230   AM_RANGE(0xa801, 0xa801) AM_WRITE(galaxold_nmi_enable_w)
231231   AM_RANGE(0xa802, 0xa802) AM_WRITE(SMH_NOP)   /* coin counters */
232   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxian_flip_screen_y_w)
233   AM_RANGE(0xa807, 0xa807) AM_WRITE(galaxian_flip_screen_x_w)
232   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_y_w)
233   AM_RANGE(0xa807, 0xa807) AM_WRITE(galaxold_flip_screen_x_w)
234234   AM_RANGE(0xc100, 0xc103) AM_WRITE(ppi8255_0_w)
235235   AM_RANGE(0xc200, 0xc203) AM_WRITE(ppi8255_1_w)
236236ADDRESS_MAP_END
r2241r2242
238238static ADDRESS_MAP_START( mimonkey_readmem, ADDRESS_SPACE_PROGRAM, 8 )
239239   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
240240   AM_RANGE(0x8000, 0x8bff) AM_READ(SMH_RAM)
241   AM_RANGE(0x8c00, 0x8fff) AM_READ(galaxian_videoram_r)   /* mirror */
241   AM_RANGE(0x8c00, 0x8fff) AM_READ(galaxold_videoram_r)   /* mirror */
242242   AM_RANGE(0x9000, 0x90ff) AM_READ(SMH_RAM)
243243   AM_RANGE(0x9800, 0x9803) AM_READ(ppi8255_0_r)
244244   AM_RANGE(0xa000, 0xa003) AM_READ(ppi8255_1_r)
r2241r2242
249249static ADDRESS_MAP_START( mimonkey_writemem, ADDRESS_SPACE_PROGRAM, 8 )
250250   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
251251   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM)
252   AM_RANGE(0x8800, 0x8bff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
253   AM_RANGE(0x8c00, 0x8fff) AM_WRITE(galaxian_videoram_w)   /* mirror */
254   AM_RANGE(0x9000, 0x903f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
255   AM_RANGE(0x9040, 0x905f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
256   AM_RANGE(0x9060, 0x907f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
252   AM_RANGE(0x8800, 0x8bff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
253   AM_RANGE(0x8c00, 0x8fff) AM_WRITE(galaxold_videoram_w)   /* mirror */
254   AM_RANGE(0x9000, 0x903f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
255   AM_RANGE(0x9040, 0x905f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
256   AM_RANGE(0x9060, 0x907f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
257257   AM_RANGE(0x9080, 0x90ff) AM_WRITE(SMH_RAM)
258258   AM_RANGE(0x9800, 0x9803) AM_WRITE(ppi8255_0_w)
259259   AM_RANGE(0xa000, 0xa003) AM_WRITE(ppi8255_1_w)
260   AM_RANGE(0xa801, 0xa801) AM_WRITE(galaxian_nmi_enable_w)
261   AM_RANGE(0xa800, 0xa802) AM_WRITE(galaxian_gfxbank_w)
262   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxian_flip_screen_x_w)
263   AM_RANGE(0xa807, 0xa807) AM_WRITE(galaxian_flip_screen_y_w)
260   AM_RANGE(0xa801, 0xa801) AM_WRITE(galaxold_nmi_enable_w)
261   AM_RANGE(0xa800, 0xa802) AM_WRITE(galaxold_gfxbank_w)
262   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_x_w)
263   AM_RANGE(0xa807, 0xa807) AM_WRITE(galaxold_flip_screen_y_w)
264264   AM_RANGE(0xc000, 0xffff) AM_WRITE(SMH_ROM)
265265ADDRESS_MAP_END
266266
r2241r2242
326326   AM_RANGE(0x2000, 0x20ff) AM_READ(SMH_RAM)
327327   AM_RANGE(0x4600, 0x4fff) AM_READ(SMH_ROM)
328328   AM_RANGE(0x6400, 0x7aff) AM_READ(SMH_ROM)
329   AM_RANGE(0x7c00, 0x7fff) AM_READ(galaxian_videoram_r)   /* mirror */
329   AM_RANGE(0x7c00, 0x7fff) AM_READ(galaxold_videoram_r)   /* mirror */
330330   AM_RANGE(0x8300, 0x98ff) AM_READ(SMH_ROM)
331331   AM_RANGE(0xa300, 0xa7ff) AM_READ(SMH_ROM)
332332   AM_RANGE(0xf521, 0xf521) AM_READ(watchdog_reset_r)
r2241r2242
339339static ADDRESS_MAP_START( anteatg_writemem, ADDRESS_SPACE_PROGRAM, 8 )
340340   AM_RANGE(0x0000, 0x03ff) AM_WRITE(SMH_ROM)
341341   AM_RANGE(0x0400, 0x0bff) AM_WRITE(SMH_RAM)
342   AM_RANGE(0x0c00, 0x0fff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
343   AM_RANGE(0x2000, 0x203f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
344   AM_RANGE(0x2040, 0x205f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
345   AM_RANGE(0x2060, 0x207f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
342   AM_RANGE(0x0c00, 0x0fff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
343   AM_RANGE(0x2000, 0x203f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
344   AM_RANGE(0x2040, 0x205f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
345   AM_RANGE(0x2060, 0x207f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
346346   AM_RANGE(0x2080, 0x20ff) AM_WRITE(SMH_RAM)
347347   AM_RANGE(0x2423, 0x2423) AM_WRITE(anteatg_ppi8255_1_reg3_w)
348348   AM_RANGE(0x2450, 0x2450) AM_WRITE(anteatg_ppi8255_1_reg0_w)
349349   AM_RANGE(0x2511, 0x2511) AM_WRITE(anteatg_ppi8255_1_reg1_w)
350   AM_RANGE(0x2621, 0x2621) AM_WRITE(galaxian_nmi_enable_w)
351   AM_RANGE(0x2624, 0x2624) AM_WRITE(galaxian_stars_enable_w)
352   AM_RANGE(0x2647, 0x2647) AM_WRITE(galaxian_flip_screen_y_w)
353   AM_RANGE(0x2653, 0x2653) AM_WRITE(scramble_background_enable_w)
354   AM_RANGE(0x2702, 0x2702) AM_WRITE(galaxian_coin_counter_w)
355   AM_RANGE(0x2736, 0x2736) AM_WRITE(galaxian_flip_screen_x_w)
350   AM_RANGE(0x2621, 0x2621) AM_WRITE(galaxold_nmi_enable_w)
351   AM_RANGE(0x2624, 0x2624) AM_WRITE(galaxold_stars_enable_w)
352   AM_RANGE(0x2647, 0x2647) AM_WRITE(galaxold_flip_screen_y_w)
353   AM_RANGE(0x2653, 0x2653) AM_WRITE(scrambold_background_enable_w)
354   AM_RANGE(0x2702, 0x2702) AM_WRITE(galaxold_coin_counter_w)
355   AM_RANGE(0x2736, 0x2736) AM_WRITE(galaxold_flip_screen_x_w)
356356   AM_RANGE(0x4600, 0x4fff) AM_WRITE(SMH_ROM)
357357   AM_RANGE(0x6400, 0x7aff) AM_WRITE(SMH_ROM)
358   AM_RANGE(0x7c00, 0x7fff) AM_WRITE(galaxian_videoram_w)   /* mirror */
358   AM_RANGE(0x7c00, 0x7fff) AM_WRITE(galaxold_videoram_w)   /* mirror */
359359   AM_RANGE(0x8300, 0x98ff) AM_WRITE(SMH_ROM)
360360   AM_RANGE(0xa300, 0xa7ff) AM_WRITE(SMH_ROM)
361361   AM_RANGE(0xf612, 0xf612) AM_WRITE(anteatg_ppi8255_0_reg0_w)
r2241r2242
380380static ADDRESS_MAP_START( anteatgb_writemem, ADDRESS_SPACE_PROGRAM, 8 )
381381   AM_RANGE(0x0000, 0x03ff) AM_WRITE(SMH_ROM)
382382   AM_RANGE(0x0400, 0x0bff) AM_WRITE(SMH_RAM)
383   AM_RANGE(0x0c00, 0x0fff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
384   AM_RANGE(0x1200, 0x123f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
385   AM_RANGE(0x1240, 0x125f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
386   AM_RANGE(0x1260, 0x127f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
383   AM_RANGE(0x0c00, 0x0fff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
384   AM_RANGE(0x1200, 0x123f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
385   AM_RANGE(0x1240, 0x125f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
386   AM_RANGE(0x1260, 0x127f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
387387   AM_RANGE(0x1280, 0x12ff) AM_WRITE(SMH_RAM)
388   AM_RANGE(0x1171, 0x1171) AM_WRITE(galaxian_nmi_enable_w)
389   AM_RANGE(0x1174, 0x1174) AM_WRITE(galaxian_stars_enable_w)
390   AM_RANGE(0x1177, 0x1177) AM_WRITE(galaxian_flip_screen_y_w)
391   AM_RANGE(0x1173, 0x1173) AM_WRITE(scramble_background_enable_w)
392   AM_RANGE(0x1172, 0x1172) AM_WRITE(galaxian_coin_counter_w)
393   AM_RANGE(0x1176, 0x1176) AM_WRITE(galaxian_flip_screen_x_w)
388   AM_RANGE(0x1171, 0x1171) AM_WRITE(galaxold_nmi_enable_w)
389   AM_RANGE(0x1174, 0x1174) AM_WRITE(galaxold_stars_enable_w)
390   AM_RANGE(0x1177, 0x1177) AM_WRITE(galaxold_flip_screen_y_w)
391   AM_RANGE(0x1173, 0x1173) AM_WRITE(scrambold_background_enable_w)
392   AM_RANGE(0x1172, 0x1172) AM_WRITE(galaxold_coin_counter_w)
393   AM_RANGE(0x1176, 0x1176) AM_WRITE(galaxold_flip_screen_x_w)
394394   AM_RANGE(0x4600, 0x4fff) AM_WRITE(SMH_ROM)
395395   AM_RANGE(0x6400, 0x7aff) AM_WRITE(SMH_ROM)
396396   AM_RANGE(0x8300, 0x98ff) AM_WRITE(SMH_ROM)
r2241r2242
14041404   MDRV_GFXDECODE(scobra)
14051405   MDRV_PALETTE_LENGTH(32+64+2+1)   /* 32 for characters, 64 for stars, 2 for bullets, 1 for background */
14061406
1407   MDRV_PALETTE_INIT(scramble)
1408   MDRV_VIDEO_START(scramble)
1409   MDRV_VIDEO_UPDATE(galaxian)
1407   MDRV_PALETTE_INIT(scrambold)
1408   MDRV_VIDEO_START(scrambold)
1409   MDRV_VIDEO_UPDATE(galaxold)
14101410
14111411   /* sound hardware */
14121412   MDRV_SPEAKER_STANDARD_MONO("mono")
r2241r2242
14281428   /* video hardware */
14291429   MDRV_PALETTE_LENGTH(32+64+2)   /* 32 for characters, 64 for stars, 2 for bullets */
14301430
1431   MDRV_PALETTE_INIT(galaxian)
1431   MDRV_PALETTE_INIT(galaxold)
14321432   MDRV_VIDEO_START(theend)
14331433MACHINE_DRIVER_END
14341434
r2241r2242
15611561   MDRV_GFXDECODE(scobra)
15621562   MDRV_PALETTE_LENGTH(32+64+2)   /* 32 for characters, 64 for stars, 2 for bullets */
15631563
1564   MDRV_PALETTE_INIT(galaxian)
1565   MDRV_VIDEO_START(scramble)
1566   MDRV_VIDEO_UPDATE(galaxian)
1564   MDRV_PALETTE_INIT(galaxold)
1565   MDRV_VIDEO_START(scrambold)
1566   MDRV_VIDEO_UPDATE(galaxold)
15671567
15681568   /* sound hardware */
15691569   MDRV_SPEAKER_STANDARD_MONO("mono")
r2241r2242
22212221ROM_END
22222222
22232223
2224GAME( 1981, scobra,   0,        type1,    scobra,   scobra,       ROT90,  "Konami", "Super Cobra", GAME_SUPPORTS_SAVE )
2225GAME( 1981, scobras,  scobra,   type1,    scobras,  scobra,       ROT90,  "[Konami] (Stern license)", "Super Cobra (Stern)", GAME_SUPPORTS_SAVE )
2226GAME( 1981, scobrase, scobra,   type1,    scobras,  scobra,       ROT90,  "[Konami] (Sega license)", "Super Cobra (Sega)", GAME_SUPPORTS_SAVE )
2227GAME( 1981, scobrab,  scobra,   type1,    scobras,  scobra,       ROT90,  "bootleg", "Super Cobra (bootleg)", GAME_SUPPORTS_SAVE )
22282224GAME( 1981, stratgyx, 0,        stratgyx, stratgyx, stratgyx,     ROT0,   "Konami", "Strategy X", GAME_SUPPORTS_SAVE )
22292225GAME( 1981, stratgys, stratgyx, stratgyx, stratgyx, stratgyx,     ROT0,   "[Konami] (Stern license)", "Strategy X (Stern)", GAME_SUPPORTS_SAVE )
2230GAME( 1981, armorcar, 0,        armorcar, armorcar, scramble_ppi, ROT90,  "Stern", "Armored Car (set 1)", GAME_SUPPORTS_SAVE )
2231GAME( 1981, armorca2, armorcar, armorcar, armorcar, scramble_ppi, ROT90,  "Stern", "Armored Car (set 2)", GAME_SUPPORTS_SAVE )
22322226GAME( 1981, moonwar,  0,        moonwar,  moonwar,  moonwar,      ROT90,  "Stern", "Moonwar", GAME_SUPPORTS_SAVE )
22332227GAME( 1981, moonwara, moonwar,  moonwar,  moonwara, moonwar,      ROT90,  "Stern", "Moonwar (older)", GAME_SUPPORTS_SAVE )
22342228GAME( 1984, spdcoin,  0,        type1,    spdcoin,  scramble_ppi, ROT90,  "Stern", "Speed Coin (prototype)", GAME_SUPPORTS_SAVE )
22352229GAME( 1982, darkplnt, 0,        darkplnt, darkplnt, darkplnt,     ROT180, "Stern", "Dark Planet", GAME_SUPPORTS_SAVE )
2236GAME( 1982, tazmania, 0,        type1,    tazmania, scobra,       ROT90,  "Stern", "Tazz-Mania (set 1)", GAME_SUPPORTS_SAVE )
22372230GAME( 1982, tazmani2, tazmania, type2,    tazmania, tazmani2,     ROT90,  "Stern", "Tazz-Mania (set 2)", GAME_SUPPORTS_SAVE )
22382231GAME( 1982, calipso,  0,        calipso,  calipso,  scobra,       ROT90,  "[Stern] (Tago license)", "Calipso", GAME_SUPPORTS_SAVE )
2239GAME( 1982, anteater, 0,        type1,    anteater, anteater,     ROT90,  "[Stern] (Tago license)", "Anteater", GAME_SUPPORTS_SAVE )
22402232GAME( 1983, anteatg,  anteater, anteatg,  anteatg,  scramble_ppi, ROT90,  "TV-Tuning (F.E.G. license)", "Ameisenbaer (German)", GAME_SUPPORTS_SAVE )
22412233GAME( 1983, anteatgb, anteater, anteatgb, anteatgb, scramble_ppi, ROT90,  "Free Enterprise Games", "The Anteater (UK)", GAME_SUPPORTS_SAVE )
22422234GAME( 1982, rescue,   0,        rescue,   rescue,   rescue,       ROT90,  "Stern", "Rescue", GAME_SUPPORTS_SAVE )
22432235GAME( 1982, aponow,   rescue,   rescue,   rescue,   rescue,       ROT90,  "bootleg", "Apocaljpse Now", GAME_SUPPORTS_SAVE )
22442236GAME( 1983, minefld,  0,        minefld,  minefld,  minefld,      ROT90,  "Stern", "Minefield", GAME_SUPPORTS_SAVE )
2245GAME( 1982, losttomb, 0,        type1,    losttomb, losttomb,     ROT90,  "Stern", "Lost Tomb (easy)", GAME_SUPPORTS_SAVE )
2246GAME( 1982, losttmbh, losttomb, type1,    losttomb, losttomb,     ROT90,  "Stern", "Lost Tomb (hard)", GAME_SUPPORTS_SAVE )
22472237GAME( 198?, superbon, 0,        type1,    superbon, superbon,     ROT90,  "bootleg", "Super Bond", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
22482238GAME( 1981, hustler,  0,        hustler,  hustler,  hustler,      ROT90,  "Konami", "Video Hustler", GAME_SUPPORTS_SAVE )
22492239GAME( 1981, billiard, hustler,  hustler,  hustler,  billiard,     ROT90,  "bootleg", "The Billiards", GAME_SUPPORTS_SAVE )
src/mame/drivers/wiz.c
r2241r2242
225225   coin_counter_w(offset,data);
226226}
227227
228static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
229   AM_RANGE(0x0000, 0xbfff) AM_READ(SMH_ROM)
230   AM_RANGE(0xc000, 0xc7ff) AM_READ(SMH_RAM)
231   AM_RANGE(0xd000, 0xd85f) AM_READ(SMH_RAM)
232   AM_RANGE(0xe000, 0xe85f) AM_READ(SMH_RAM)
233   AM_RANGE(0xf000, 0xf000) AM_READ(input_port_2_r)   /* DSW0 */
234   AM_RANGE(0xf008, 0xf008) AM_READ(input_port_3_r)   /* DSW1 */
235   AM_RANGE(0xf010, 0xf010) AM_READ(input_port_0_r)   /* IN0 */
236   AM_RANGE(0xf018, 0xf018) AM_READ(input_port_1_r)   /* IN1 */
237   AM_RANGE(0xf800, 0xf800) AM_READ(watchdog_reset_r)
238ADDRESS_MAP_END
239
240static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
241   AM_RANGE(0x0000, 0xbfff) AM_WRITE(SMH_ROM)
242   AM_RANGE(0xc000, 0xc7ff) AM_WRITE(SMH_RAM)
228static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
229   AM_RANGE(0x0000, 0xbfff) AM_ROM
230   AM_RANGE(0xc000, 0xc7ff) AM_RAM
243231   AM_RANGE(0xc800, 0xc801) AM_WRITE(wiz_coin_counter_w)
244   AM_RANGE(0xd000, 0xd3ff) AM_WRITE(SMH_RAM) AM_BASE(&wiz_videoram2)
245   AM_RANGE(0xd400, 0xd7ff) AM_WRITE(SMH_RAM) AM_BASE(&wiz_colorram2)
246   AM_RANGE(0xd800, 0xd83f) AM_WRITE(SMH_RAM) AM_BASE(&wiz_attributesram2)
247   AM_RANGE(0xd840, 0xd85f) AM_WRITE(SMH_RAM) AM_BASE(&spriteram_2) AM_SIZE(&spriteram_size)
248   AM_RANGE(0xe000, 0xe3ff) AM_WRITE(SMH_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
249   AM_RANGE(0xe400, 0xe7ff) AM_WRITE(SMH_RAM) AM_BASE(&colorram)
250   AM_RANGE(0xe800, 0xe83f) AM_WRITE(SMH_RAM) AM_BASE(&wiz_attributesram)
251   AM_RANGE(0xe840, 0xe85f) AM_WRITE(SMH_RAM) AM_BASE(&spriteram)
252   AM_RANGE(0xf000, 0xf000) AM_WRITE(SMH_RAM) AM_BASE(&wiz_sprite_bank)
232   AM_RANGE(0xd000, 0xd3ff) AM_BASE(&wiz_videoram2)               /* Fallthrough */
233   AM_RANGE(0xd400, 0xd7ff) AM_BASE(&wiz_colorram2)
234   AM_RANGE(0xd800, 0xd83f) AM_BASE(&wiz_attributesram2)
235   AM_RANGE(0xd840, 0xd85f) AM_BASE(&spriteram_2) AM_SIZE(&spriteram_size)
236   AM_RANGE(0xd000, 0xd85f) AM_RAM
237   AM_RANGE(0xe000, 0xe3ff) AM_BASE(&videoram) AM_SIZE(&videoram_size)   /* Fallthrough */
238   AM_RANGE(0xe400, 0xe7ff) AM_BASE(&colorram)
239   AM_RANGE(0xe800, 0xe83f) AM_BASE(&wiz_attributesram)
240   AM_RANGE(0xe840, 0xe85f) AM_BASE(&spriteram)
241   AM_RANGE(0xe000, 0xe85f) AM_RAM
242   AM_RANGE(0xf000, 0xf000) AM_READ(input_port_2_r)   /* DSW0 */
243   AM_RANGE(0xf000, 0xf000) AM_RAM AM_BASE(&wiz_sprite_bank)
253244   AM_RANGE(0xf001, 0xf001) AM_WRITE(interrupt_enable_w)
254245   AM_RANGE(0xf002, 0xf003) AM_WRITE(wiz_palettebank_w)
255246   AM_RANGE(0xf004, 0xf005) AM_WRITE(wiz_char_bank_select_w)
256247   AM_RANGE(0xf006, 0xf006) AM_WRITE(wiz_flipx_w)
257248   AM_RANGE(0xf007, 0xf007) AM_WRITE(wiz_flipy_w)
258   AM_RANGE(0xf008, 0xf00f) AM_WRITE(SMH_NOP)         // initialized by Stinger/Scion
259   AM_RANGE(0xf800, 0xf80f) AM_WRITE(sound_command_w)   // sound registers
249   AM_RANGE(0xf008, 0xf008) AM_READ(input_port_3_r)   /* DSW1 */
250   AM_RANGE(0xf008, 0xf00f) AM_WRITE(SMH_NOP)         /* initialized by Stinger/Scion */
251   AM_RANGE(0xf010, 0xf010) AM_READ(input_port_0_r)   /* IN0 */
252   AM_RANGE(0xf018, 0xf018) AM_READ(input_port_1_r)   /* IN1 */
253   AM_RANGE(0xf800, 0xf800) AM_READ(watchdog_reset_r)
254   AM_RANGE(0xf800, 0xf80f) AM_WRITE(sound_command_w)   /* sound registers */
260255   AM_RANGE(0xf818, 0xf818) AM_WRITE(wiz_bgcolor_w)
261256ADDRESS_MAP_END
262257
263
264static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
265   AM_RANGE(0x0000, 0x1fff) AM_READ(SMH_ROM)
266   AM_RANGE(0x2000, 0x23ff) AM_READ(SMH_RAM)
267   AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r)   /* Stinger/Scion */
268   AM_RANGE(0x7000, 0x7000) AM_READ(soundlatch_r)   /* Wiz */
269ADDRESS_MAP_END
270
271static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
272   AM_RANGE(0x2000, 0x23ff) AM_WRITE(SMH_RAM)
273   AM_RANGE(0x3000, 0x3000) AM_WRITE(interrupt_enable_w)         /* Stinger/Scion */
258static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
259   AM_RANGE(0x0000, 0x1fff) AM_ROM
260   AM_RANGE(0x2000, 0x23ff) AM_RAM
261   AM_RANGE(0x3000, 0x3000) AM_READWRITE(soundlatch_r,interrupt_enable_w)   /* Stinger/Scion */
274262   AM_RANGE(0x4000, 0x4000) AM_WRITE(AY8910_control_port_2_w)
275263   AM_RANGE(0x4001, 0x4001) AM_WRITE(AY8910_write_port_2_w)
276264   AM_RANGE(0x5000, 0x5000) AM_WRITE(AY8910_control_port_0_w)
277265   AM_RANGE(0x5001, 0x5001) AM_WRITE(AY8910_write_port_0_w)
278   AM_RANGE(0x6000, 0x6000) AM_WRITE(AY8910_control_port_1_w)   /* Wiz only */
279   AM_RANGE(0x6001, 0x6001) AM_WRITE(AY8910_write_port_1_w)      /* Wiz only */
280   AM_RANGE(0x7000, 0x7000) AM_WRITE(interrupt_enable_w)         /* Wiz */
266   AM_RANGE(0x6000, 0x6000) AM_WRITE(AY8910_control_port_1_w)            /* Wiz only */
267   AM_RANGE(0x6001, 0x6001) AM_WRITE(AY8910_write_port_1_w)            /* Wiz only */
268   AM_RANGE(0x7000, 0x7000) AM_READWRITE(soundlatch_r,interrupt_enable_w)   /* Wiz */
281269ADDRESS_MAP_END
282270
283271
r2241r2242
705693
706694   /* basic machine hardware */
707695   MDRV_CPU_ADD(Z80, 18432000/6)   /* 3.072 MHz ??? */
708   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
696   MDRV_CPU_PROGRAM_MAP(main_map,0)
709697   MDRV_CPU_VBLANK_INT("main", nmi_line_pulse)
710698
711699   MDRV_CPU_ADD(Z80, 14318000/8)   /* ? */
712700   /* audio CPU */
713   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
701   MDRV_CPU_PROGRAM_MAP(sound_map,0)
714702   MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,4)   /* ??? */
715703
716704   /* video hardware */
src/mame/drivers/stactics.c
r2241r2242
4141****************************************************************************/
4242
4343#include "driver.h"
44#include "deprecat.h"
4544#include "stactics.h"
4645#include "stactics.lh"
4746
r2241r2242
6564
6665static READ8_HANDLER( vert_pos_r )
6766{
68   stactics_state *state = Machine->driver_data;
67   stactics_state *state = machine->driver_data;
6968
7069    return 0x70 - state->vert_pos;
7170}
r2241r2242
7372
7473static READ8_HANDLER( horiz_pos_r )
7574{
76   stactics_state *state = Machine->driver_data;
75   stactics_state *state = machine->driver_data;
7776
7877    return state->horiz_pos + 0x88;
7978}
src/mame/drivers/mermaid.c
r2241r2242
1010        * Rougien
1111
1212    Known issues:
13        * Hardware collision detection is not implemented.
1413        * Are the stars really supposed to go up in Rougien?
1514
1615
src/mame/drivers/gaelco3d.c
r2241r2242
253253{
254254   cpunum_set_input_line(Machine, 0, 2, CLEAR_LINE);
255255}
256static WRITE32_HANDLER( irq_ack_020_w ) { if ((mem_mask & 0xffff0000) != 0xffff0000) irq_ack_w(machine, offset, data >> 16, mem_mask >> 16); }
256static WRITE32_HANDLER( irq_ack_020_w ) { if (ACCESSING_BITS_16_31) irq_ack_w(machine, offset, data >> 16, mem_mask >> 16); }
257257
258258
259259
r2241r2242
276276
277277static WRITE16_HANDLER( eeprom_data_w )
278278{
279   if (!(mem_mask & 0xff))
279   if (ACCESSING_BITS_0_7)
280280      EEPROM_write_bit(data & 0x01);
281281}
282static WRITE32_HANDLER( eeprom_data_020_w ) { if ((mem_mask & 0xffff) != 0xffff) eeprom_data_w(machine, offset, data, mem_mask); }
282static WRITE32_HANDLER( eeprom_data_020_w ) { if (ACCESSING_BITS_0_15) eeprom_data_w(machine, offset, data, mem_mask); }
283283
284284
285285static WRITE16_HANDLER( eeprom_clock_w )
286286{
287   if (!(mem_mask & 0xff))
287   if (ACCESSING_BITS_0_7)
288288      EEPROM_set_clock_line((data & 0x01) ? ASSERT_LINE : CLEAR_LINE);
289289}
290static WRITE32_HANDLER( eeprom_clock_020_w ) { if ((mem_mask & 0xffff) != 0xffff) eeprom_clock_w(machine, offset, data, mem_mask); }
290static WRITE32_HANDLER( eeprom_clock_020_w ) { if (ACCESSING_BITS_0_15) eeprom_clock_w(machine, offset, data, mem_mask); }
291291
292292
293293static WRITE16_HANDLER( eeprom_cs_w )
294294{
295   if (!(mem_mask & 0xff))
295   if (ACCESSING_BITS_0_7)
296296      EEPROM_set_cs_line((data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
297297}
298static WRITE32_HANDLER( eeprom_cs_020_w ) { if ((mem_mask & 0xffff) != 0xffff) eeprom_cs_w(machine, offset, data, mem_mask); }
298static WRITE32_HANDLER( eeprom_cs_020_w ) { if (ACCESSING_BITS_0_15) eeprom_cs_w(machine, offset, data, mem_mask); }
299299
300300
301301
r2241r2242
316316static WRITE16_HANDLER( sound_data_w )
317317{
318318   logerror("%06X:sound_data_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
319   if (!(mem_mask & 0xff))
319   if (ACCESSING_BITS_0_7)
320320      timer_call_after_resynch(NULL, data & 0xff, delayed_sound_w);
321321}
322static WRITE32_HANDLER( sound_data_020_w ) { if ((mem_mask & 0xffff0000) != 0xffff0000) sound_data_w(machine, offset, data >> 16, mem_mask >> 16); }
322static WRITE32_HANDLER( sound_data_020_w ) { if (ACCESSING_BITS_16_31) sound_data_w(machine, offset, data >> 16, mem_mask >> 16); }
323323
324324
325325static READ16_HANDLER( sound_data_r )
r2241r2242
333333static READ16_HANDLER( sound_status_r )
334334{
335335   logerror("%06X:sound_status_r(%02X) = %02X\n", activecpu_get_pc(), offset, sound_status);
336   if (!(mem_mask & 0xff))
336   if (ACCESSING_BITS_0_7)
337337      return sound_status;
338338   return 0xffff;
339339}
340static READ32_HANDLER( sound_status_020_r ) { if ((mem_mask & 0x0000ffff) != 0x0000ffff) return sound_status_r(machine, offset, mem_mask); return ~0; }
340static READ32_HANDLER( sound_status_020_r ) { if (ACCESSING_BITS_0_15) return sound_status_r(machine, offset, mem_mask); return ~0; }
341341
342342
343343static WRITE16_HANDLER( sound_status_w )
r2241r2242
370370static WRITE16_HANDLER( analog_port_clock_w )
371371{
372372   /* a zero/one combo is written here to clock the next analog port bit */
373   if (!(mem_mask & 0xff))
373   if (ACCESSING_BITS_0_7)
374374   {
375375      if (!(data & 0xff))
376376      {
r2241r2242
383383   else
384384      logerror("%06X:analog_port_clock_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
385385}
386static WRITE32_HANDLER( analog_port_clock_020_w ) { if ((mem_mask & 0xffff) != 0xffff) analog_port_clock_w(machine, offset, data, mem_mask); }
386static WRITE32_HANDLER( analog_port_clock_020_w ) { if (ACCESSING_BITS_0_15) analog_port_clock_w(machine, offset, data, mem_mask); }
387387
388388
389389static WRITE16_HANDLER( analog_port_latch_w )
390390{
391391   /* a zero is written here to read the analog ports, and a one is written when finished */
392   if (!(mem_mask & 0xff))
392   if (ACCESSING_BITS_0_7)
393393   {
394394      if (!(data & 0xff))
395395      {
r2241r2242
402402   else
403403      logerror("%06X:analog_port_latch_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
404404}
405static WRITE32_HANDLER( analog_port_latch_020_w ) { if ((mem_mask & 0xffff) != 0xffff) analog_port_latch_w(machine, offset, data, mem_mask); }
405static WRITE32_HANDLER( analog_port_latch_020_w ) { if (ACCESSING_BITS_0_15) analog_port_latch_w(machine, offset, data, mem_mask); }
406406
407407
408408
r2241r2242
446446   logerror("%06X:tms_reset_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
447447      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data == 0xffff) ? CLEAR_LINE : ASSERT_LINE);
448448}
449static WRITE32_HANDLER( tms_reset_020_w ) { if ((mem_mask & 0xffff) != 0xffff) tms_reset_w(machine, offset, data, mem_mask); }
449static WRITE32_HANDLER( tms_reset_020_w ) { if (ACCESSING_BITS_0_15) tms_reset_w(machine, offset, data, mem_mask); }
450450
451451
452452static WRITE16_HANDLER( tms_irq_w )
r2241r2242
454454   /* this is written twice, 0,1, in quick succession */
455455   /* done after uploading, and after modifying the comm area */
456456   logerror("%06X:tms_irq_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
457   if (!(mem_mask & 0xff))
457   if (ACCESSING_BITS_0_7)
458458      cpunum_set_input_line(Machine, 1, 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
459459}
460static WRITE32_HANDLER( tms_irq_020_w ) { if ((mem_mask & 0xffff) != 0xffff) tms_irq_w(machine, offset, data, mem_mask); }
460static WRITE32_HANDLER( tms_irq_020_w ) { if (ACCESSING_BITS_0_15) tms_irq_w(machine, offset, data, mem_mask); }
461461
462462
463463static WRITE16_HANDLER( tms_control3_w )
464464{
465465   logerror("%06X:tms_control3_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
466466}
467static WRITE32_HANDLER( tms_control3_020_w ) { if ((mem_mask & 0xffff) != 0xffff) tms_control3_w(machine, offset, data, mem_mask); }
467static WRITE32_HANDLER( tms_control3_020_w ) { if (ACCESSING_BITS_0_15) tms_control3_w(machine, offset, data, mem_mask); }
468468
469469
470470static WRITE16_HANDLER( tms_comm_w )
r2241r2242
667667static WRITE32_HANDLER( unknown_107_w )
668668{
669669   /* arbitrary data written */
670   if (!(mem_mask & 0xff))
670   if (ACCESSING_BITS_0_7)
671671      logerror("%06X:unknown_107_w = %02X\n", activecpu_get_pc(), data & 0xff);
672672   else
673673      logerror("%06X:unknown_107_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
r2241r2242
676676static WRITE32_HANDLER( unknown_127_w )
677677{
678678   /* arbitrary data written */
679   if (!(mem_mask & 0xff))
679   if (ACCESSING_BITS_0_7)
680680      logerror("%06X:unknown_127_w = %02X\n", activecpu_get_pc(), data & 0xff);
681681   else
682682      logerror("%06X:unknown_127_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
r2241r2242
685685static WRITE32_HANDLER( unknown_137_w )
686686{
687687   /* only written $00 or $ff */
688   if (!(mem_mask & 0xff))
688   if (ACCESSING_BITS_0_7)
689689      logerror("%06X:unknown_137_w = %02X\n", activecpu_get_pc(), data & 0xff);
690690   else
691691      logerror("%06X:unknown_137_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
r2241r2242
694694static WRITE32_HANDLER( unknown_13a_w )
695695{
696696   /* only written $0000 or $0001 */
697   if (!(mem_mask & 0xffff))
697   if (ACCESSING_BITS_0_15)
698698      logerror("%06X:unknown_13a_w = %04X\n", activecpu_get_pc(), data & 0xffff);
699699   else
700700      logerror("%06X:unknown_13a_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
r2241r2242
705705{
706706   /* this has $00 written during an IRQ 6, then reset to $ff afterwards */
707707   /* LED??? */
708   if (!(mem_mask & 0xff))
708   if (ACCESSING_BITS_0_7)
709709      set_led_status(0, data != 0);
710710}
711static WRITE32_HANDLER( led_0_020_w ) { if ((mem_mask & 0xffff) != 0xffff) led_0_w(machine, offset, data, mem_mask); }
711static WRITE32_HANDLER( led_0_020_w ) { if (ACCESSING_BITS_0_15) led_0_w(machine, offset, data, mem_mask); }
712712
713713
714714static WRITE16_HANDLER( led_1_w )
715715{
716716   /* LED??? -- only written $00 or $ff */
717   if (!(mem_mask & 0xff))
717   if (ACCESSING_BITS_0_7)
718718      set_led_status(1, data != 0);
719719}
720static WRITE32_HANDLER( led_1_020_w ) { if ((mem_mask & 0xffff) != 0xffff) led_1_w(machine, offset, data, mem_mask); }
720static WRITE32_HANDLER( led_1_020_w ) { if (ACCESSING_BITS_0_15) led_1_w(machine, offset, data, mem_mask); }
721721
722722
723723
r2241r2242
959959   MDRV_SCREEN_ADD("main", RASTER)
960960   MDRV_SCREEN_REFRESH_RATE(60)
961961   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
962   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
962   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
963963   MDRV_SCREEN_SIZE(576, 432)
964964   MDRV_SCREEN_VISIBLE_AREA(0, 575, 0, 431)
965965
966966   MDRV_PALETTE_LENGTH(32768)
967967
968   MDRV_PALETTE_INIT(RRRRR_GGGGG_BBBBB)
968969   MDRV_VIDEO_START(gaelco3d)
969970   MDRV_VIDEO_UPDATE(gaelco3d)
970971
src/mame/drivers/namcos11.c
r2241r2242
648648{
649649   verboselog( 2, "bankswitch_rom32_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
650650
651   if( ACCESSING_LSW32 )
651   if( ACCESSING_BITS_0_15 )
652652   {
653653      bankswitch_rom8( ( offset * 2 ), data & 0xffff );
654654   }
655   if( ACCESSING_MSW32 )
655   if( ACCESSING_BITS_16_31 )
656656   {
657657      bankswitch_rom8( ( offset * 2 ) + 1, data >> 16 );
658658   }
r2241r2242
662662{
663663   verboselog( 2, "bankswitch_rom64_upper_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
664664
665   if( ACCESSING_LSW32 )
665   if( ACCESSING_BITS_0_15 )
666666   {
667667      m_n_bankoffset = 0;
668668   }
669   if( ACCESSING_MSW32 )
669   if( ACCESSING_BITS_16_31 )
670670   {
671671      m_n_bankoffset = 16;
672672   }
r2241r2242
682682{
683683   verboselog( 2, "bankswitch_rom64_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
684684
685   if( ACCESSING_LSW32 )
685   if( ACCESSING_BITS_0_15 )
686686   {
687687      bankswitch_rom64( ( offset * 2 ), data & 0xffff );
688688   }
689   if( ACCESSING_MSW32 )
689   if( ACCESSING_BITS_16_31 )
690690   {
691691      bankswitch_rom64( ( offset * 2 ) + 1, data >> 16 );
692692   }
r2241r2242
694694
695695static WRITE32_HANDLER( lightgun_w )
696696{
697   if( ACCESSING_LSW32 )
697   if( ACCESSING_BITS_0_15 )
698698   {
699699      output_set_value( "led0", !( data & 0x08 ) );
700700      output_set_value( "led1", !( data & 0x04 ) );
r2241r2242
703703
704704      verboselog( 1, "lightgun_w: outputs (%08x %08x)\n", data, mem_mask );
705705   }
706   if( ACCESSING_MSW32 )
706   if( ACCESSING_BITS_16_31 )
707707   {
708708      verboselog( 2, "lightgun_w: start reading (%08x %08x)\n", data, mem_mask );
709709   }
src/mame/drivers/dcon.c
r2241r2242
106106   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
107107
108108static INPUT_PORTS_START( dcon )
109   SEIBU_COIN_INPUTS   /* Must be port 0: coin inputs read through sound cpu */
109   SEIBU_COIN_INPUTS   /* coin inputs read through sound cpu */
110110
111111   PORT_START
112112   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
r2241r2242
164164INPUT_PORTS_END
165165
166166static INPUT_PORTS_START( sdgndmps )
167   SEIBU_COIN_INPUTS   /* Must be port 0: coin inputs read through sound cpu */
167   SEIBU_COIN_INPUTS   /* coin inputs read through sound cpu */
168168
169169   PORT_START
170170   PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coin_B ) )
r2241r2242
202202   PORT_DIPSETTING(      0x0090, DEF_STR( 1C_7C ) )
203203   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
204204   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
205   PORT_DIPSETTING(      0x0200, "2" )
206   PORT_DIPSETTING(      0x0300, "3" )
207   PORT_DIPSETTING(      0x0100, "4" )
205208   PORT_DIPSETTING(      0x0000, "6" )
206   PORT_DIPSETTING(      0x0100, "4" )
207   PORT_DIPSETTING(      0x0300, "3" )
208   PORT_DIPSETTING(      0x0200, "2" )
209209   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
210210   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
211211   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r2241r2242
416416
417417
418418GAME( 1991, sdgndmps, 0, sdgndmps, sdgndmps, sdgndmps, ROT0, "Banpresto / Bandai", "SD Gundam Psycho Salamander no Kyoui", GAME_NO_COCKTAIL )
419GAME( 1992, dcon,     0, dcon,     dcon,     0, ROT0, "Success",            "D-Con", GAME_NO_COCKTAIL )
419GAME( 1992, dcon,     0, dcon,     dcon,     0,        ROT0, "Success",            "D-Con", GAME_NO_COCKTAIL )
src/mame/drivers/kickgoal.c
r2241r2242
163163
164164WRITE16_HANDLER( kickgoal_snd_w )
165165{
166   if (ACCESSING_LSB)
166   if (ACCESSING_BITS_0_7)
167167   {
168168      logerror("PC:%06x Writing %04x to Sound CPU\n",activecpu_get_previouspc(),data);
169169      if (data >= 0x40) {
r2241r2242
218218{
219219   logerror("PC:%06x Writing %04x to Sound CPU - mask %04x\n",activecpu_get_previouspc(),data,mem_mask);
220220
221   if (!ACCESSING_LSB) data >>= 8;
221   if (!ACCESSING_BITS_0_7) data >>= 8;
222222
223223   switch (data)
224224   {
r2241r2242
465465
466466static READ16_HANDLER( kickgoal_eeprom_r )
467467{
468   if (ACCESSING_LSB)
468   if (ACCESSING_BITS_0_7)
469469   {
470470      return EEPROM_read_bit();
471471   }
r2241r2242
475475
476476static WRITE16_HANDLER( kickgoal_eeprom_w )
477477{
478   if (ACCESSING_LSB)
478   if (ACCESSING_BITS_0_7)
479479   {
480480      switch (offset)
481481      {
src/mame/drivers/itech8.c
r2241r2242
855855
856856static WRITE16_HANDLER( sound_data16_w )
857857{
858   if (ACCESSING_MSB)
858   if (ACCESSING_BITS_8_15)
859859      sound_data_w(machine, 0, data >> 8);
860860}
861861
862862
863863static WRITE16_HANDLER( grom_bank16_w )
864864{
865   if (ACCESSING_MSB)
865   if (ACCESSING_BITS_8_15)
866866      *itech8_grom_bank = data >> 8;
867867}
868868
869869
870870static WRITE16_HANDLER( display_page16_w )
871871{
872   if (ACCESSING_MSB)
872   if (ACCESSING_BITS_8_15)
873873      itech8_page_w(machine, 0, ~data >> 8);
874874}
875875
876876
877877static WRITE16_HANDLER( tms34061_latch16_w )
878878{
879   if (ACCESSING_MSB)
879   if (ACCESSING_BITS_8_15)
880880      tms34061_latch_w(machine, 0, data >> 8);
881881}
882882
r2241r2242
889889
890890static WRITE16_HANDLER( palette16_w )
891891{
892   if (ACCESSING_MSB)
892   if (ACCESSING_BITS_8_15)
893893      itech8_palette_w(machine, offset / 8, data >> 8);
894894}
895895
src/mame/drivers/galaxian.c
r2241r2242
11/***************************************************************************
22
3 Galaxian/Moon Cresta hardware
3    Galaxian-derived hardware
44
5    Galaxian is the root hardware for many, many systems developed in the
6    1980-1982 timeframe. The basic design, which originated with Namco(?),
7    was replicated, tweaked, bootlegged, and used numerous times.
58
9    The basic hardware design comprises three sections on a single PCB:
10    a CPU section, a sound section, and a video section.
11
12    The CPU section is based around a Z80 (though there are modified
13    designed that changed this to an S2650). The base galaxian hardware
14    is designed to allow access to up to 16k of program ROM and 2k of
15    working RAM.
16
17    The sound section consists of three parts. The first part is
18    a programmable 8-bit down counter that clocks a 4-bit counter which
19    generates a primitive waveform whose shape is hardcoded but can be
20    controlled by a pair of variable resistors. The second part is
21    a set of three 555 timers which can be individually enabled and
22    combined to produce square waves at fixed separated pitches. A
23    fourth 555 timer is configured via a 4-bit frequency parameter to
24    control the overall pitch of the other three. Finally, two single
25    bit-triggered noise circuits are available. A 17-bit noise LFSR
26    (which also generates stars for the video circuit) feeds into both
27    circuits. A "HIT" line enables a simple on/off control of one
28    filtered output, while a "FIRE" line triggers a fixed short duration
29    pulse (controlled by another 555 timer) of modulated noise.
30
31    See video/galaxian.c for a description of the video section.
32
33****************************************************************************
34
35    Schematics are known to exist for these games:
36        * Galaxian
37        * Moon Alien Part 2
38        * King and Balloon
39
40        * Moon Cresta
41        * Moon Shuttle
42
43        * Frogger
44        * Amidar
45        * Turtles
46
47        * Scramble
48        * The End
49
50        * Super Cobra
51        * Dark Planet
52        * Lost Tomb
53
54        * Dambusters
55
56****************************************************************************
57
658Main clock: XTAL = 18.432 MHz
759Z80 Clock: XTAL/6 = 3.072 MHz
860Horizontal video frequency: HSYNC = XTAL/3/192/2 = 16 kHz
r2241r2242
2274
2375- Problems with Galaxian based on the observation of a real machine:
2476
25  - Starfield is incorrect.  The speed and flashing frequency is fine, but the
26    stars appear in different positions.
2777  - Background humming is incorrect.  It's faster on a real machine
2878  - Explosion sound is much softer.  Filter involved?
2979
r2241r2242
3585------------------------------
3686
3787mooncrst    Nichibutsu     - later revision with better demo mode and
38                         text for docking. Encrypted. No ROM/RAM check
88                              text for docking. Encrypted. No ROM/RAM check
3989mooncrsu    Nichibutsu USA - later revision with better demo mode and
40                         text for docking. Unencrypted. No ROM/RAM check
90                              text for docking. Unencrypted. No ROM/RAM check
4191mooncrsa    Nichibutsu     - older revision with better demo mode and
42                         text for docking. Encrypted. No ROM/RAM check
92                              text for docking. Encrypted. No ROM/RAM check
4393mooncrs2    Nichibutsu     - probably first revision (no patches) and ROM/RAM check code.
44                             This came from a bootleg board, with the logos erased
45                         from the graphics
94                              This came from a bootleg board, with the logos erased
95                              from the graphics
4696mooncrsg    Gremlin        - same docking text as mooncrst
4797mooncrsb    bootleg of mooncrs2. ROM/RAM check erased.
4898
4999
50Stephh's additional notes (based on the games Z80 code and some tests) for "Moon Cresta" and its numerous clones :
51
52a) 'mooncrst'
53
54  - made by Nichibutsu
55  - inputs :
56      * player 1 controls are used by player 1
57      * player 2 controls are used by player 2, even in an "upright" cabinet
58  - 2 coins slots with different settings :
59      * coin A : 1C_1C / 2C_1C / 3C_1C / 4C_1C
60      * coin B : 1C_1C / 1C_2C / 1C_3C / "Free Play"
61  - no writes to 0xa003, so no coin counters
62  - bonus life at 30000 or 50000 based on a Dip Switch
63  - possible partial Japanese text based on a Dip Switch
64  - hi-score : 11 chars (even if only 10 will be displayed), 60 seconds to enter
65  - players bullet speed : 4 pixels - lower limit : 0x04
66  - ingame bug : if you reset the game when screen is flipped, it isn't flipped back
67  - driver possible bug (which occurs for all "Moon Cresta" sets but 'mooncrgx') :
68    when the screen is flipped, sprites are too shifted (see for example player 2
69    score which misses ending '0') while bullets shall be good
70    as a consequence, square around letters is wrong when entering player name
71    for hi-score table when screen is flipped
72
73b) 'mooncrsu'
74
75  - made by Nichibutsu
76  - very similar to 'mooncrst' with the only following differences :
77      * additional "USA" display after "Nichibutsu" (which is shifted left)
78      * writes to 0xb000 to 0xb0ff on reset ('mooncrst' only writes to 0xb000),
79        so there is no screen flipped ingame bug as in 'mooncrst'
80
81c) 'mooncrsa'
82
83  - made by Nichibutsu
84  - additional "(c)" display before "Nichibutsu"
85  - "(c) 1980 NIHON BUSSAN CO. , LTD" display replaced with "May 1980" in yellow
86  - code at 0x1f00 has been removed ! I can't determine was is was supposed to do,
87    but it's based on number of enemies left (stored at 0x823c) and possible time
88    spent on the level (stored at 0x8226). Any hint is fully welcome !
89  - this version is easier than 'mooncrst' : look at high nibbles that are stored
90    at 0x809b and 0x809c via code at 0x0cb8 (0x01 and 0x02 instead of 0x11 and 0x12).
91  - 2 coins slots, but same settings : 1C_1C / 1C_2C / 1C_3C / "Free Play"
92  - same other infos as in 'mooncrst'
93  - same ingame bug as in 'mooncrst'
94
95d) 'mooncrs2'
96
97  - bootleg (possibily based on a Gremlin version we don't have)
98  - heavily based on 'mooncrsa' with additional RAM/ROM check routine at 0x3ea1
99  - some "chars" have been erased from the GFX ROMS but some routines which
100    "prints" them are still there (but there are less than in 'mooncrsa')
101  - same other infos as in 'mooncrst'
102  - due to numerous writes in the RAM/ROM check routine, there is no screen flipped
103    ingame bug as in 'mooncrst'
104
105e) 'mooncrsb'
106
107  - bootleg (possibily based on a Gremlin version we don't have)
108  - the only difference with 'mooncrs2' is that RAM/ROM check routine at 0x3ea1
109    has completely been "noped" and the jump at address 0x0004 has been changed
110  - all "chars" from the GFX ROMS haven't been erased, so you can see the top
111    of the "Gremlin" logo as copyright and hi-scores names
112  - same ingame bug as in 'mooncrst'
113
114f) 'mooncrs3'
115
116  - bootleg
117  - very similar to 'mooncrs2' with the only following differences :
118      * checksum of ROM area 0x0000-0x3fff is computed, but the result is discarded
119        (see "xor a" operation at 0x3fc0 instead of "and a")
120      * coins stuff is different (see below)
121  - 2 coins slots with different settings (same as 'mooncrst') :
122      * coin A : 1C_1C / 2C_1C / 3C_1C / 4C_1C
123      * coin B : 1C_1C / 1C_2C / 1C_3C / "Free Play"
124  - there are writes to 0xa003 (check code at 0x1b8e and 0x1b9e) which occur
125    when you insert a coin, but I can't confirm it's related to coin counters
126    as the same value is written when you press COIN1 or COIN2
127
128g) 'mooncrsg'
129
130  - made by Gremlin
131  - there are MANY changes and additions, and I wonder if there's such a Nichibutsu set;
132    anyway, closest set to this one seems to be 'mooncrst'
133  - Gremin "logo" on 2 lines instead of Nichibutsu copyright messages (2 lines)
134  - additional test for IN0 bit 7 (code at 0x0174) which always adds 1 credit
135  - there are writes to 0xa003 (check code at 0x0158 and 0x0160) which occur
136    when you insert a coin, but I can't confirm it's related to coin counters
137    as the same value is written when you press COIN1 or COIN2
138  - only English text (Dip Switch has no effect due to code at 0x2f77)
139  - hi-score : 3 chars, 10 seconds to enter
140  - same difficulty as in 'monncrst' (but stored at 0x809e and 0x809f)
141  - same other infos as in 'mooncrst'
142  - same ingame bug as in 'mooncrst'
143
144h) 'fantazia'
145
146  - made by Subelectro
147  - closest set to this one seems to be 'mooncrsb'
148  - all intro texts have been changed as well as colors
149  - inputs :
150      * player 1 controls are used by player 1
151      * player 2 controls are used by player 2, only in a "cocktail" cabinet
152    look at additional routine at 0x29e0
153  - 2 coins slots with different settings (inverted coin A/B compared to 'mooncrst') :
154      * coin A : 1C_1C / 1C_2C / 1C_3C / "Free Play"
155      * coin B : 1C_1C / 2C_1C / 3C_1C / 4C_1C
156  - only English text (Dip Switch has no effect due to code at 0x2f53)
157  - hi-score : 3 chars, 60 seconds to enter
158  - same other infos as in 'mooncrst'
159  - same ingame bug as in 'mooncrst'
160
161i) 'eagle'
162
163  - made by Centuri
164  - very similar to 'mooncrsb' with the only following differences :
165      * only 3 chars for hi-score instead of 11
166      * all other changes are modified "strings" to be displayed
167        (the intro texts but copyright remains though) as well as
168        new GFX (I can't test the sound for now to check)
169  - same ingame bug as in 'mooncrst'
170
171j) 'eagle2'
172
173  - made by Centuri
174  - very similar to 'eagle' with the only following differences :
175      * only 20 seconds to enter hi-score instead of 60
176      * coins stuff is different (see below)
177      * one GFX ROM is slighlty different
178  - 2 coins slots, but same settings : 1C_1C / 2C_1C / 3C_1C / 4C_1C
179  - previous "Coin B" Dip Switch is now only tested to see if in "Freeplay" mode
180  - same ingame bug as in 'mooncrst'
181
182k) 'eagle3'
183
184  - made by Centuri
185  - PRG ROMS are the same as for 'eagle' while two GFX ROMS are slighly different
186    (so the game is having 'mooncrst' ships and 'eagle' enemies)
187  - same ingame bug as in 'mooncrst'
188
189l) 'spctbird'
190
191  - made by Fortrek
192  - very similar to 'mooncrsb' with the only following difference :
193      * coins stuff is different (same as in 'eagle2' - see below)
194  - 2 coins slots, but same settings : 1C_1C / 2C_1C / 3C_1C / 4C_1C
195  - previous "Coin B" Dip Switch is now only tested to see if in "Freeplay" mode
196  - same ingame bug as in 'mooncrst'
197
198m) 'smooncrs'
199
200  - made par Gremlin (bootleg based on a Nichibutsu version we don't have ?)
201  - same RAM/ROM check routine as in 'mooncrs2' (so there is no screen flipped
202    ingame bug as in 'mooncrst'), but LOTS of new features !
203  - only top of the Gremlin logo is displayed and it is also used for hi-scores
204  - all intro texts have been changed
205  - "2'ST" instead of "2'ND" and "RECORD" instead of "HI-SCORE"
206  - additional "PLAYER 1/2" messages when player changes
207  - inputs : player 1 controls are used by players 1 and 2, even in a "cocktail"
208    cabinet (player 2 inputs are never read due to code at 0x2b1c and 0x3313)
209  - 2 coins slots with different settings :
210      * coin A : 1C_1C / 2C_1C / 3C_1C / 4C_1C
211      * coin B : 1C_1C / 1C_2C / 1C_3C / "Free Play"
212    additional wrong (Spanish) text displayed when "Coin B" set to 1C_1C
213    (check additional code at 0x0fae) :
214      * if "Coin A" set to 4C_1C, "1 MONEDA 1 PARTIDA" on one line
215      * if "Coin A" set to 2C_1C, "1 MONEDA 1 PARTIDA" on one line
216        and "2 MONEDAS 3 PARTIDAS" on another line below
217    when "Coin B" set to "Free Play", "CREDIT 04" instead of "FREE PLAY" string
218    (even if this number of credits is decremented when you press a START button,
219     it is put back to 04 when the game is over for all players)
220  - additional "POR" display after the number of credits
221  - bonus life always 50000 due to code at 0x2f68
222  - only English text due to code at 0x2f53
223  - hi-score : 3 chars, 60 seconds to enter
224  - players bullet speed : 9 or 12 pixels (using previous "Language" Dip Switch) -
225    lower limit : 0x0f (see additional routine at 0x0007 and call from 0x3407)
226  - game difficulty using previous "Bonus Life" Dip Switch (code at 0x2962)
227    however, even with "Easy" difficulty, the game is much harder as in 'mooncrs2'
228    as enemies as enemies move much faster and as they shoot on some levels
229  - docking stage is harder has there are gaps of 2 pixels instead of 1
230  - when you complete the 8 stages, "O.K." "FANTASTIC" messages on 2 lines
231    instead of "FAR OUT !" message on 1 line
232  - same ingame bug as in 'mooncrst'
233  - another ingame bug : when in "cocktail mode", "PLAYER 1/2" messages are
234    displayed BEFORE the screen is flipped (back)
235  - driver other bugs :
236      * when screen is flipped, player's bullets aren't displayed
237      * when screen is flipped, enemies' bullets aren't flipped
238
239n) 'spcdrag'
240
241  - bootleg
242  - heavily based on 'smooncrs' (so there's a RAM/ROM check) but some differences though
243  - same intro texts as in 'mooncrs2'
244  - 2 coins slots with different settings :
245      * coin A : 1C_1C / 2C_1C / 3C_1C / 4C_1C
246      * coin B : 1C_2C / 1C_3C / 1C_4C / "Free Play"
247    additional wrong (Engrish) text displayed when "Coin B" set to 1C_2C
248    (check additional code at 0x0fae) :
249      * if "Coin A" set to 4C_1C, "1 COIN   1 PLAY   " on one line
250      * if "Coin A" set to 2C_1C, "1 COIN   1 PLAY   " on one line
251        and "2 COINS   3 PLAYES  " (notice the spelling) on another line below
252    when "Coin B" set to "Free Play", "CREDIT 04" instead of "FREE PLAY" string
253    (even if this number of credits is decremented when you press a START button,
254     it is put back to 04 when the game is over for all players)
255  - "CAP 2" display instead of "POR" after the number of credits
256  - hi-score : 11 chars (even if only 10 will be displayed), 60 seconds to enter
257    (same as in 'mooncrs2')
258  - players bullet speed : 6 or 9 pixels (using previous "Language" Dip Switch) -
259    lower limit : 0x04 (instead of speed 9/12 and lower limit 0x0f)
260  - even if there's also the "Difficulty" Dip Switch, the game is a little bit easier
261    (enemies speed is slower and docking stage is back to 1 pixel to fit 'mooncrs2')
262  - when you complete the 8 stages, same "FAR OUT !" message as in 'mooncrs2'
263  - driver bug : even if player's bullets are displayed when screen is flipped as in
264    other sets, enemies' bullets are still not flipped as in 'smooncrs'
265
266o) 'spcdraga'
267
268  - bootleg ? (there's a Nichibutsu logo which is displayed in the "title" screen
269    as well as in the hi-scores)
270  - very similar to 'spcdrag' with the only following (comestical) differences :
271      * unused routine at 0x37a8 has been "noped"
272      * no text after the number of credits
273      * all texts have been translated to Spanish
274
275p) 'mooncrgx'
276
277  - bootleg on "Galaxian" hardware
278  - very similar to 'mooncrsb' with the only following differences :
279      * all unused routines have been "noped"
280      * settings are different (see below)
281  - 2 coins slots with different settings :
282      * coin A : 1C_1C / 2C_1C
283      * coin B : 1C_3C / 1C_5C
284  - there are writes to 0x6003 when you press COIN1 but not when you press COIN2
285  - there are also writes to (unmapped) 0x6804 when you press either COIN1 or COIN2 :
286      * when you press COIN1, 0x00 is written once
287      * when you press COIN2, 0x01 is written 5 times, then 0x00 is written once
288  - only English text (Dip Switch has no effect due to code at 0x2f4b)
289  - no ingame bug due to code at 0x2f77
290  - driver possible bug : while sprites are now correct when screen is flipped,
291    they are too shifted when screen is not flipped (again, see for example player 2
292    score which misses ending '0') while bullets shall be good
293    as a consequence, square around letters is wrong when entering player name
294    for hi-score table when screen not is flipped
295
296
297100Notes about 'azurian' :
298101-----------------------
299102
300103  bit 6 of IN1 is linked with bit 2 of IN2 (check code at 0x05b3) to set difficulty :
301104
302    bit 6  bit 2        contents of
303     IN1     IN2          0x40f4            consequences                   difficulty
105    bit 6  bit 2    contents of
106     IN1     IN2          0x40f4            consequences            difficulty
304107
305108     OFF     OFF             2          aliens move 2 frames out of 3       easy
306109     ON      OFF             4          aliens move 4 frames out of 5       hard
r2241r2242
314117    - alien 3 moves when 0x4064 != 0 else contents of 0x40f4 is stored at 0x4064
315118
316119
120Notes about 'smooncrs' :
121------------------------
122
123  Due to code at 0x2b1c and 0x3306, the game ALWAYS checks the inputs for player 1
124  (even for player 2 when "Cabinet" Dip Switch is set to "Cocktail")
125
126
317127Notes about 'scorpnmc' :
318128-----------------------
319129
r2241r2242
324134  the screens remains flipped (the "flip screen" routine doesn't seem to be called) !
325135
326136
327
328137Notes about 'frogg' :
329138---------------------
330139
r2241r2242
336145  bit 5 of IN1 is tested if "Cabinet" Dip Switch is set to "Cocktail".
337146
338147
339
340148TO DO :
341149-------
342150
r2241r2242
355163***************************************************************************/
356164
357165#include "driver.h"
358#include "deprecat.h"
359166#include "cpu/z80/z80.h"
360167#include "cpu/s2650/s2650.h"
361168#include "galaxian.h"
169#include "machine/8255ppi.h"
362170#include "sound/ay8910.h"
363171#include "sound/sn76496.h"
364172#include "sound/dac.h"
365#include "sound/flt_rc.h"
366173#include "includes/cclimber.h"
174#include "sound/discrete.h"
367175
368176
177#define KONAMI_SOUND_CLOCK      14318000
178
179
180
369181/*************************************
370182 *
371 *  Constants
183 *  Globals
372184 *
373185 *************************************/
374186
375#define MASTER_CLOCK      (18432000)
187static UINT8 gmgalax_selected_game;
188static UINT8 zigzag_ay8910_latch;
189static UINT8 kingball_speech_dip;
190static UINT8 kingball_sound;
191static UINT8 mshuttle_ay8910_cs;
192static UINT8 scorpion_sound_data;
376193
377#define PIXEL_CLOCK         (MASTER_CLOCK/3)
194static UINT16 protection_state;
195static UINT8 protection_result;
378196
379/* H counts from 128->511, HBLANK starts at 128 and ends at 256 */
380#define HTOTAL            (384)
381#define HBEND            (0)      /*(256)*/
382#define HBSTART            (256)   /*(128)*/
197static UINT8 konami_sound_control;
198static UINT8 sfx_sample_control;
383199
384#define VTOTAL            (264)
385#define VBEND            (16)
386#define VBSTART            (224+16)
200static UINT8 irq_enabled;
201static int irq_line;
387202
388203
389204
390/* Send sound data to the sound cpu and cause an nmi */
391static WRITE8_HANDLER( checkman_sound_command_w )
205/*************************************
206 *
207 *  Interrupts
208 *
209 *************************************/
210
211static INTERRUPT_GEN( interrupt_gen )
392212{
393   soundlatch_w (machine,0,data);
394   cpunum_set_input_line (machine, 1, INPUT_LINE_NMI, PULSE_LINE);
213   /* interrupt line is clocked at VBLANK */
214   /* a flip-flop at 6F is held in the preset state based on the NMI ON signal */
215   if (irq_enabled)
216      cpunum_set_input_line(machine, 0, irq_line, ASSERT_LINE);
395217}
396218
397static READ8_HANDLER( drivfrcg_port0_r )
219
220static WRITE8_HANDLER( irq_enable_w )
398221{
399   switch (activecpu_get_pc())
400   {
401      case 0x002e:
402      case 0x0297:
403         return 0x01;
404   }
222   /* the latched D0 bit here goes to the CLEAR line on the interrupt flip-flop */
223   irq_enabled = data & 1;
405224
406    return 0;
225   /* if CLEAR is held low, we must make sure the interrupt signal is clear */
226   if (!irq_enabled)
227      cpunum_set_input_line(machine, 0, irq_line, CLEAR_LINE);
407228}
408229
409230
410static ADDRESS_MAP_START( galaxian_readmem, ADDRESS_SPACE_PROGRAM, 8 )
411   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
412   AM_RANGE(0x4000, 0x47ff) AM_READ(SMH_RAM)
413   AM_RANGE(0x5000, 0x53ff) AM_READ(SMH_RAM)
414   AM_RANGE(0x5400, 0x57ff) AM_READ(galaxian_videoram_r)
415   AM_RANGE(0x5800, 0x58ff) AM_READ(SMH_RAM)
416   AM_RANGE(0x6000, 0x6000) AM_READ(input_port_0_r)
417   AM_RANGE(0x6800, 0x6800) AM_READ(input_port_1_r)
418   AM_RANGE(0x7000, 0x7000) AM_READ(input_port_2_r)
419   AM_RANGE(0x7800, 0x7fff) AM_READ(watchdog_reset_r)
420   AM_RANGE(0xfffc, 0xffff) AM_READ(SMH_RAM)
421ADDRESS_MAP_END
422231
423static ADDRESS_MAP_START( galaxian_writemem, ADDRESS_SPACE_PROGRAM, 8 )
424   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
425   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM)
426   AM_RANGE(0x5000, 0x53ff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
427   AM_RANGE(0x5800, 0x583f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
428   AM_RANGE(0x5840, 0x585f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
429   AM_RANGE(0x5860, 0x587f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
430   AM_RANGE(0x5880, 0x58ff) AM_WRITE(SMH_RAM)
431   AM_RANGE(0x6000, 0x6001) AM_WRITE(galaxian_leds_w)
432   AM_RANGE(0x6002, 0x6002) AM_WRITE(galaxian_coin_lockout_w)
433   AM_RANGE(0x6003, 0x6003) AM_WRITE(galaxian_coin_counter_w)
434   AM_RANGE(0x6004, 0x6007) AM_WRITE(galaxian_lfo_freq_w)
435   AM_RANGE(0x6800, 0x6802) AM_WRITE(galaxian_background_enable_w)
436   AM_RANGE(0x6803, 0x6803) AM_WRITE(galaxian_noise_enable_w)
437   AM_RANGE(0x6805, 0x6805) AM_WRITE(galaxian_shoot_enable_w)
438   AM_RANGE(0x6806, 0x6807) AM_WRITE(galaxian_vol_w)
439   AM_RANGE(0x7001, 0x7001) AM_WRITE(galaxian_nmi_enable_w)
440   AM_RANGE(0x7004, 0x7004) AM_WRITE(galaxian_stars_enable_w)
441   AM_RANGE(0x7006, 0x7006) AM_WRITE(galaxian_flip_screen_x_w)
442   AM_RANGE(0x7007, 0x7007) AM_WRITE(galaxian_flip_screen_y_w)
443   AM_RANGE(0x7800, 0x7800) AM_WRITE(galaxian_pitch_w)
444   AM_RANGE(0xfffc, 0xffff) AM_WRITE(SMH_RAM)
445ADDRESS_MAP_END
232/*************************************
233 *
234 *  DRIVER latch control
235 *
236 *************************************/
446237
238static WRITE8_HANDLER( start_lamp_w )
239{
240   /* offset 0 = 1P START LAMP */
241   /* offset 1 = 2P START LAMP */
242   set_led_status(offset, data & 1);
243}
447244
448static ADDRESS_MAP_START( gmgalax_readmem, ADDRESS_SPACE_PROGRAM, 8 )
449   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_BANK1)   /* banked code */
450   AM_RANGE(0x4000, 0x47ff) AM_READ(SMH_RAM)
451   AM_RANGE(0x5000, 0x53ff) AM_READ(SMH_RAM)
452   AM_RANGE(0x5400, 0x57ff) AM_READ(galaxian_videoram_r)
453   AM_RANGE(0x5800, 0x58ff) AM_READ(SMH_RAM)
454   AM_RANGE(0x6000, 0x6000) AM_READ(gmgalax_input_port_0_r)
455   AM_RANGE(0x6800, 0x6800) AM_READ(gmgalax_input_port_1_r)
456   AM_RANGE(0x7000, 0x7000) AM_READ(gmgalax_input_port_2_r)
457   AM_RANGE(0x7800, 0x78ff) AM_READ(watchdog_reset_r)
458ADDRESS_MAP_END
459245
246static WRITE8_HANDLER( coin_lock_w )
247{
248   /* many variants and bootlegs don't have this */
249   coin_lockout_global_w(~data & 1);
250}
460251
461static ADDRESS_MAP_START( mooncrst_readmem, ADDRESS_SPACE_PROGRAM, 8 )
462   AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM)
463   AM_RANGE(0x8000, 0x87ff) AM_READ(SMH_RAM)
464   AM_RANGE(0x9000, 0x93ff) AM_READ(SMH_RAM)
465   AM_RANGE(0x9400, 0x97ff) AM_READ(galaxian_videoram_r)
466   AM_RANGE(0x9800, 0x98ff) AM_READ(SMH_RAM)
467   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
468   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)
469   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)
470   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
471ADDRESS_MAP_END
472252
473static ADDRESS_MAP_START( mooncrst_writemem, ADDRESS_SPACE_PROGRAM, 8 )
474   AM_RANGE(0x0000, 0x5fff) AM_WRITE(SMH_ROM)
475   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM)
476   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
477   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
478   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
479   AM_RANGE(0x9860, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
480   AM_RANGE(0x9880, 0x98ff) AM_WRITE(SMH_RAM)
481   AM_RANGE(0xa003, 0xa003) AM_WRITE(galaxian_coin_counter_w)
482   AM_RANGE(0xa004, 0xa007) AM_WRITE(galaxian_lfo_freq_w)
483   AM_RANGE(0xa800, 0xa802) AM_WRITE(galaxian_background_enable_w)
484   AM_RANGE(0xa803, 0xa803) AM_WRITE(galaxian_noise_enable_w)
485   AM_RANGE(0xa805, 0xa805) AM_WRITE(galaxian_shoot_enable_w)
486   AM_RANGE(0xa806, 0xa807) AM_WRITE(galaxian_vol_w)
487   AM_RANGE(0xb000, 0xb000) AM_WRITE(galaxian_nmi_enable_w)
488   AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxian_stars_enable_w)
489   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxian_flip_screen_x_w)
490   AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxian_flip_screen_y_w)
491   AM_RANGE(0xb800, 0xb800) AM_WRITE(galaxian_pitch_w)
492ADDRESS_MAP_END
253static WRITE8_HANDLER( coin_count_0_w )
254{
255   coin_counter_w(0, data & 1);
256}
493257
494static ADDRESS_MAP_START( rockclim_readmem, ADDRESS_SPACE_PROGRAM, 8 )
495   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
496   AM_RANGE(0x4000, 0x47ff) AM_READ(rockclim_videoram_r)
497   AM_RANGE(0x5000, 0x53ff) AM_READ(SMH_RAM)
498   AM_RANGE(0x6000, 0x7fff) AM_READ(SMH_ROM)
499   AM_RANGE(0x8000, 0x87ff) AM_READ(SMH_RAM)
500   AM_RANGE(0x8800, 0x8800) AM_READ(input_port_3_r)
501   AM_RANGE(0x9000, 0x93ff) AM_READ(SMH_RAM)
502   AM_RANGE(0x9400, 0x97ff) AM_READ(galaxian_videoram_r)
503   AM_RANGE(0x9800, 0x98ff) AM_READ(SMH_RAM)
504   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
505   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)
506   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)
507   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
508ADDRESS_MAP_END
509258
510static ADDRESS_MAP_START( rockclim_writemem, ADDRESS_SPACE_PROGRAM, 8 )
511   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
512   AM_RANGE(0x4000, 0x47ff) AM_WRITE(rockclim_videoram_w) AM_BASE(&rockclim_videoram)//4800 - 4803 = bg scroll ?
513   AM_RANGE(0x4800, 0x4803) AM_WRITE(rockclim_scroll_w)
514   AM_RANGE(0x5000, 0x53ff) AM_WRITE(SMH_RAM)//?
515   AM_RANGE(0x6000, 0x7fff) AM_WRITE(SMH_ROM)
516   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM)
517   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
518   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
519   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
520   AM_RANGE(0x9860, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
521   AM_RANGE(0x9880, 0x98ff) AM_WRITE(SMH_RAM)
522   AM_RANGE(0xa000, 0xa002) AM_WRITE(galaxian_gfxbank_w)// a002 - sprite bank
523   AM_RANGE(0xa003, 0xa003) AM_WRITE(galaxian_coin_counter_w)
524   AM_RANGE(0xa004, 0xa007) AM_WRITE(galaxian_lfo_freq_w)
525   AM_RANGE(0xa800, 0xa802) AM_WRITE(galaxian_background_enable_w)
526   AM_RANGE(0xa803, 0xa803) AM_WRITE(galaxian_noise_enable_w)
527   AM_RANGE(0xa805, 0xa805) AM_WRITE(galaxian_shoot_enable_w)
528   AM_RANGE(0xa806, 0xa807) AM_WRITE(galaxian_vol_w)
529   AM_RANGE(0xb000, 0xb000) AM_WRITE(galaxian_nmi_enable_w)
530   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxian_flip_screen_x_w)
531   AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxian_flip_screen_y_w)
532   AM_RANGE(0xb800, 0xb800) AM_WRITE(galaxian_pitch_w)
533ADDRESS_MAP_END
259static WRITE8_HANDLER( coin_count_1_w )
260{
261   coin_counter_w(1, data & 1);
262}
534263
535264
536static ADDRESS_MAP_START( mshuttle_writemem, ADDRESS_SPACE_PROGRAM, 8 )
537   AM_RANGE(0x0000, 0x4fff) AM_WRITE(SMH_ROM)
538   AM_RANGE(0x8000, 0x83ff) AM_WRITE(SMH_RAM)
539   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
540   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
541   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
542   AM_RANGE(0x9860, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
543   AM_RANGE(0x9880, 0x98ff) AM_WRITE(SMH_RAM)
544   AM_RANGE(0xa000, 0xa000) AM_WRITE(galaxian_nmi_enable_w)
545   AM_RANGE(0xa001, 0xa001) AM_WRITE(galaxian_flip_screen_x_w)
546   AM_RANGE(0xa002, 0xa002) AM_WRITE(galaxian_flip_screen_y_w)
547   AM_RANGE(0xa004, 0xa004) AM_WRITE(cclimber_sample_trigger_w)
548   AM_RANGE(0xa800, 0xa800) AM_WRITE(cclimber_sample_rate_w)
549   AM_RANGE(0xb000, 0xb000) AM_WRITE(cclimber_sample_volume_w)
550ADDRESS_MAP_END
551265
552static ADDRESS_MAP_START( mshuttle_readport, ADDRESS_SPACE_IO, 8 )
553   ADDRESS_MAP_GLOBAL_MASK(0xff)
554   AM_RANGE(0x0c, 0x0c) AM_READ(AY8910_read_port_0_r)
555ADDRESS_MAP_END
266/*************************************
267 *
268 *  General Konami sound I/O
269 *
270 *************************************/
556271
557static ADDRESS_MAP_START( mshuttle_writeport, ADDRESS_SPACE_IO, 8 )
558   ADDRESS_MAP_GLOBAL_MASK(0xff)
559   AM_RANGE(0x08, 0x08) AM_WRITE(AY8910_control_port_0_w)
560   AM_RANGE(0x09, 0x09) AM_WRITE(AY8910_write_port_0_w)
561ADDRESS_MAP_END
272static READ8_HANDLER( konami_ay8910_r )
273{
274   /* the decoding here is very simplistic, and you can address both simultaneously */
275   UINT8 result = 0xff;
276   if (offset & 0x20) result &= AY8910_read_port_0_r(machine, 0);
277   if (offset & 0x80) result &= AY8910_read_port_1_r(machine, 0);
278   return result;
279}
562280
563281
564static ADDRESS_MAP_START( skybase_writemem, ADDRESS_SPACE_PROGRAM, 8 )
565   AM_RANGE(0x0000, 0x5fff) AM_WRITE(SMH_ROM)
566   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM)
567   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
568   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
569   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
570   AM_RANGE(0x9860, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
571   AM_RANGE(0x9880, 0x98ff) AM_WRITE(SMH_RAM)
572   AM_RANGE(0xa002, 0xa002) AM_WRITE(galaxian_gfxbank_w)
573   AM_RANGE(0xa004, 0xa007) AM_WRITE(galaxian_lfo_freq_w)
574   AM_RANGE(0xa800, 0xa802) AM_WRITE(galaxian_background_enable_w)
575   AM_RANGE(0xa803, 0xa803) AM_WRITE(galaxian_noise_enable_w)
576   AM_RANGE(0xa805, 0xa805) AM_WRITE(galaxian_shoot_enable_w)
577   AM_RANGE(0xa806, 0xa807) AM_WRITE(galaxian_vol_w)
578   AM_RANGE(0xb000, 0xb000) AM_WRITE(galaxian_nmi_enable_w)
579   AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxian_stars_enable_w)
580   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxian_flip_screen_x_w)
581   AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxian_flip_screen_y_w)
582   AM_RANGE(0xb800, 0xb800) AM_WRITE(galaxian_pitch_w)
583ADDRESS_MAP_END
282static WRITE8_HANDLER( konami_ay8910_w )
283{
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);
289}
584290
585291
586static ADDRESS_MAP_START( scramblb_readmem, ADDRESS_SPACE_PROGRAM, 8 )
587   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
588   AM_RANGE(0x4000, 0x4bff) AM_READ(SMH_RAM)
589   AM_RANGE(0x5000, 0x50ff) AM_READ(SMH_RAM)
590   AM_RANGE(0x6000, 0x6000) AM_READ(input_port_0_r)
591   AM_RANGE(0x6800, 0x6800) AM_READ(input_port_1_r)
592   AM_RANGE(0x7000, 0x7000) AM_READ(input_port_2_r)
593   AM_RANGE(0x7800, 0x7800) AM_READ(watchdog_reset_r)
594   AM_RANGE(0x8102, 0x8102) AM_READ(scramblb_protection_1_r)
595   AM_RANGE(0x8202, 0x8202) AM_READ(scramblb_protection_2_r)
596ADDRESS_MAP_END
292static WRITE8_HANDLER( konami_sound_control_w )
293{
294   UINT8 old = konami_sound_control;
295   konami_sound_control = data;
597296
598static ADDRESS_MAP_START( scramblb_writemem, ADDRESS_SPACE_PROGRAM, 8 )
599   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
600   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM)
601   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
602   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
603   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
604   AM_RANGE(0x5060, 0x507f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
605   AM_RANGE(0x5080, 0x50ff) AM_WRITE(SMH_RAM)
606   AM_RANGE(0x6000, 0x6001) AM_WRITE(SMH_NOP)  /* sound triggers */
607   AM_RANGE(0x6003, 0x6003) AM_WRITE(galaxian_coin_counter_w)
608   AM_RANGE(0x6004, 0x6007) AM_WRITE(galaxian_lfo_freq_w)
609   AM_RANGE(0x6800, 0x6802) AM_WRITE(galaxian_background_enable_w)
610   AM_RANGE(0x6803, 0x6803) AM_WRITE(galaxian_noise_enable_w)
611   AM_RANGE(0x6805, 0x6805) AM_WRITE(galaxian_shoot_enable_w)
612   AM_RANGE(0x6806, 0x6807) AM_WRITE(galaxian_vol_w)
613   AM_RANGE(0x7001, 0x7001) AM_WRITE(galaxian_nmi_enable_w)
614   AM_RANGE(0x7002, 0x7002) AM_WRITE(galaxian_coin_counter_w)
615   AM_RANGE(0x7003, 0x7003) AM_WRITE(scramble_background_enable_w)
616   AM_RANGE(0x7004, 0x7004) AM_WRITE(galaxian_stars_enable_w)
617   AM_RANGE(0x7006, 0x7006) AM_WRITE(galaxian_flip_screen_x_w)
618   AM_RANGE(0x7007, 0x7007) AM_WRITE(galaxian_flip_screen_y_w)
619   AM_RANGE(0x7800, 0x7800) AM_WRITE(galaxian_pitch_w)
620ADDRESS_MAP_END
297   /* the inverse of bit 3 clocks the flip flop to signal an INT */
298   /* it is automatically cleared on the acknowledge */
299   if ((old & 0x08) && !(data & 0x08))
300      cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
621301
302   /* bit 4 is sound disable */
303   sound_global_enable(~data & 0x10);
304}
622305
623306
624static READ8_HANDLER( scramb2_protection_r ) { return 0x25; }
625static READ8_HANDLER( scramb2_port0_r ) { return (readinputport(0)>>offset)&0x1; }
626static READ8_HANDLER( scramb2_port1_r ) { return (readinputport(1)>>offset)&0x1; }
627static READ8_HANDLER( scramb2_port2_r ) { return (readinputport(2)>>offset)&0x1; }
307static READ8_HANDLER( konami_sound_timer_r )
308{
309   /*
310        The timer is clocked at KONAMI_SOUND_CLOCK and cascades through a
311        series of counters. It first encounters a chained pair of 4-bit
312        counters in an LS393, which produce an effective divide-by-256. Next
313        it enters the divide-by-2 counter in an LS93, followed by the
314        divide-by-8 counter. Finally, it clocks a divide-by-5 counter in an
315        LS90, followed by the divide-by-2 counter. This produces an effective
316        period of 16*16*2*8*5*2 = 40960 clocks.
628317
629static ADDRESS_MAP_START( scramb2_readmem, ADDRESS_SPACE_PROGRAM, 8 )
630   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
631   AM_RANGE(0x4000, 0x4bff) AM_READ(SMH_RAM)
632   AM_RANGE(0x5000, 0x50ff) AM_READ(SMH_RAM)
633   AM_RANGE(0x5800, 0x5fff) AM_READ(scramb2_protection_r) // must return 0x25
634   AM_RANGE(0x6000, 0x6007) AM_READ(scramb2_port0_r) // reads from 8 addresses, 1 bit per address
635   AM_RANGE(0x6800, 0x6807) AM_READ(scramb2_port1_r) // reads from 8 addresses, 1 bit per address
636   AM_RANGE(0x7000, 0x7007) AM_READ(watchdog_reset_r)
637   AM_RANGE(0x7800, 0x7807) AM_READ(scramb2_port2_r) // reads from 8 addresses, 1 bit per address
638ADDRESS_MAP_END
318        The clock for the sound CPU comes from output C of the first
319        divide-by-16 counter, or KONAMI_SOUND_CLOCK/8. To recover the
320        current counter index, we use the sound cpu clock times 8 mod
321        16*16*2*8*5*2.
322    */
323   UINT32 cycles = (cpunum_gettotalcycles(1) * 8) % (UINT64)(16*16*2*8*5*2);
324   UINT8 hibit = 0;
639325
640static ADDRESS_MAP_START( scramb2_writemem, ADDRESS_SPACE_PROGRAM, 8 )
641   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
642   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM)
643   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
644   AM_RANGE(0x4c00, 0x4fff) AM_WRITE(galaxian_videoram_w) // mirror
645   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
646   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
647   AM_RANGE(0x5060, 0x507f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
648   AM_RANGE(0x5080, 0x50ff) AM_WRITE(SMH_RAM)
649   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxian_nmi_enable_w)
650   AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxian_coin_counter_w)
651   AM_RANGE(0x6804, 0x6804) AM_WRITE(galaxian_stars_enable_w)
652   AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxian_flip_screen_x_w)
653   AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxian_flip_screen_y_w)
654   AM_RANGE(0x7006, 0x7006) AM_WRITE(SMH_NOP)
655   AM_RANGE(0x7007, 0x7007) AM_WRITE(SMH_NOP)
656   AM_RANGE(0x7800, 0x7800) AM_WRITE(galaxian_pitch_w)
657ADDRESS_MAP_END
326   /* separate the high bit from the others */
327   if (cycles >= 16*16*2*8*5)
328   {
329      hibit = 1;
330      cycles -= 16*16*2*8*5;
331   }
658332
333   /* the top bits of the counter index map to various bits here */
334   return (hibit << 7) |         /* B7 is the output of the final divide-by-2 counter */
335         (BIT(cycles,14) << 6) |   /* B6 is the high bit of the divide-by-5 counter */
336         (BIT(cycles,13) << 5) |   /* B5 is the 2nd highest bit of the divide-by-5 counter */
337         (BIT(cycles,11) << 4) |   /* B4 is the high bit of the divide-by-8 counter */
338         0x0e;               /* assume remaining bits are high, except B0 which is grounded */
339}
659340
660341
661static ADDRESS_MAP_START( jumpbug_readmem, ADDRESS_SPACE_PROGRAM, 8 )
662   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
663   AM_RANGE(0x4000, 0x4bff) AM_READ(SMH_RAM)
664   AM_RANGE(0x4c00, 0x4fff) AM_READ(galaxian_videoram_r)
665   AM_RANGE(0x5000, 0x50ff) AM_READ(SMH_RAM)
666   AM_RANGE(0x6000, 0x6000) AM_READ(input_port_0_r)
667   AM_RANGE(0x6800, 0x6800) AM_READ(input_port_1_r)
668   AM_RANGE(0x7000, 0x7000) AM_READ(input_port_2_r)
669   AM_RANGE(0x8000, 0xafff) AM_READ(SMH_ROM)
670   AM_RANGE(0xb000, 0xbfff) AM_READ(jumpbug_protection_r)
671ADDRESS_MAP_END
342static WRITE8_HANDLER( konami_sound_filter_w )
343{
344   int which, chan;
672345
673static ADDRESS_MAP_START( jumpbug_writemem, ADDRESS_SPACE_PROGRAM, 8 )
674   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
675   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM)
676   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
677   AM_RANGE(0x4c00, 0x4fff) AM_WRITE(galaxian_videoram_w)
678   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
679   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
680   AM_RANGE(0x5060, 0x507f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
681   AM_RANGE(0x5080, 0x50ff) AM_WRITE(SMH_RAM)
682   AM_RANGE(0x5800, 0x5800) AM_WRITE(AY8910_write_port_0_w)
683   AM_RANGE(0x5900, 0x5900) AM_WRITE(AY8910_control_port_0_w)
684   AM_RANGE(0x6002, 0x6006) AM_WRITE(galaxian_gfxbank_w)
685   AM_RANGE(0x7001, 0x7001) AM_WRITE(galaxian_nmi_enable_w)
686   AM_RANGE(0x7002, 0x7002) AM_WRITE(galaxian_coin_counter_w)
687   AM_RANGE(0x7004, 0x7004) AM_WRITE(galaxian_stars_enable_w)
688   AM_RANGE(0x7006, 0x7006) AM_WRITE(galaxian_flip_screen_x_w)
689   AM_RANGE(0x7007, 0x7007) AM_WRITE(galaxian_flip_screen_y_w)
690   AM_RANGE(0x8000, 0xafff) AM_WRITE(SMH_ROM)
691ADDRESS_MAP_END
346   /* the offset is used as data, 6 channels * 2 bits each */
347   for (which = 0; which < 2; which++)
348      if (sndti_exists(SOUND_AY8910, which))
349         for (chan = 0; chan < 3; chan++)
350         {
351            UINT8 bits = (offset >> (2 * chan + 6 * (1 - which))) & 3;
692352
353            /* low bit goes to 0.22uF capacitor = 220000pF  */
354            /* high bit goes to 0.047uF capacitor = 47000pF */
355            discrete_sound_w(machine, NODE(3 * which + chan + 11), bits);
356         }
357}
693358
694static ADDRESS_MAP_START( checkman_writemem, ADDRESS_SPACE_PROGRAM, 8 )
695   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
696   AM_RANGE(0x8000, 0x83ff) AM_WRITE(SMH_RAM)
697   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
698   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
699   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
700   AM_RANGE(0x9860, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
701   AM_RANGE(0x9880, 0x98ff) AM_WRITE(SMH_RAM)
702   AM_RANGE(0xa004, 0xa007) AM_WRITE(galaxian_lfo_freq_w)
703   AM_RANGE(0xa800, 0xa802) AM_WRITE(galaxian_background_enable_w)
704   AM_RANGE(0xa803, 0xa803) AM_WRITE(galaxian_noise_enable_w)
705   AM_RANGE(0xa805, 0xa805) AM_WRITE(galaxian_shoot_enable_w)
706   AM_RANGE(0xa806, 0xa807) AM_WRITE(galaxian_vol_w)
707   AM_RANGE(0xb001, 0xb001) AM_WRITE(galaxian_nmi_enable_w)
708   AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxian_stars_enable_w)
709   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxian_flip_screen_x_w)
710   AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxian_flip_screen_y_w)
711   AM_RANGE(0xb800, 0xb800) AM_WRITE(galaxian_pitch_w)
712ADDRESS_MAP_END
713359
714static ADDRESS_MAP_START( checkmaj_writemem, ADDRESS_SPACE_PROGRAM, 8 )
715   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
716   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM)
717   AM_RANGE(0x5000, 0x53ff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
718   AM_RANGE(0x5800, 0x583f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
719   AM_RANGE(0x5840, 0x585f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
720   AM_RANGE(0x5860, 0x587f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
721   AM_RANGE(0x5880, 0x58ff) AM_WRITE(SMH_RAM)
722   AM_RANGE(0x7001, 0x7001) AM_WRITE(galaxian_nmi_enable_w)
723   AM_RANGE(0x7006, 0x7006) AM_WRITE(galaxian_flip_screen_x_w)
724   AM_RANGE(0x7007, 0x7007) AM_WRITE(galaxian_flip_screen_y_w)
725   AM_RANGE(0x7800, 0x7800) AM_WRITE(checkman_sound_command_w)
726ADDRESS_MAP_END
360static READ8_HANDLER( konami_porta_0_r )
361{
362//  logerror("%04X:ppi0_porta_r\n", activecpu_get_pc());
363   return readinputportbytag("IN0");
364}
727365
728366
729static ADDRESS_MAP_START( checkman_writeport, ADDRESS_SPACE_IO, 8 )
730   ADDRESS_MAP_GLOBAL_MASK(0xff)
731   AM_RANGE(0, 0) AM_WRITE(checkman_sound_command_w)
732ADDRESS_MAP_END
367static READ8_HANDLER( konami_portb_0_r )
368{
369//  logerror("%04X:ppi0_portb_r\n", activecpu_get_pc());
370   return readinputportbytag("IN1");
371}
733372
734373
735static ADDRESS_MAP_START( checkman_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
736   AM_RANGE(0x0000, 0x0fff) AM_READ(SMH_ROM)
737   AM_RANGE(0x2000, 0x23ff) AM_READ(SMH_RAM)
738ADDRESS_MAP_END
374static READ8_HANDLER( konami_portc_0_r )
375{
376   logerror("%04X:ppi0_portc_r\n", activecpu_get_pc());
377   return readinputportbytag("IN2");
378}
739379
740static ADDRESS_MAP_START( checkman_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
741   AM_RANGE(0x0000, 0x0fff) AM_WRITE(SMH_ROM)
742   AM_RANGE(0x2000, 0x23ff) AM_WRITE(SMH_RAM)
743ADDRESS_MAP_END
744380
381static READ8_HANDLER( konami_portc_1_r )
382{
383   logerror("%04X:ppi1_portc_r\n", activecpu_get_pc());
384   return readinputportbytag("IN3");
385}
745386
746static ADDRESS_MAP_START( checkman_sound_readport, ADDRESS_SPACE_IO, 8 )
747   ADDRESS_MAP_GLOBAL_MASK(0xff)
748   AM_RANGE(0x03, 0x03) AM_READ(soundlatch_r)
749   AM_RANGE(0x06, 0x06) AM_READ(AY8910_read_port_0_r)
750ADDRESS_MAP_END
751387
752static ADDRESS_MAP_START( checkman_sound_writeport, ADDRESS_SPACE_IO, 8 )
753   ADDRESS_MAP_GLOBAL_MASK(0xff)
754   AM_RANGE(0x04, 0x04) AM_WRITE(AY8910_control_port_0_w)
755   AM_RANGE(0x05, 0x05) AM_WRITE(AY8910_write_port_0_w)
756ADDRESS_MAP_END
388static WRITE8_HANDLER( konami_portc_0_w )
389{
390   logerror("%04X:ppi0_portc_w = %02X\n", activecpu_get_pc(), data);
391}
757392
758393
759static ADDRESS_MAP_START( checkmaj_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
760   AM_RANGE(0x0000, 0x0fff) AM_READ(SMH_ROM)
761   AM_RANGE(0x8000, 0x83ff) AM_READ(SMH_RAM)
762   AM_RANGE(0xa002, 0xa002) AM_READ(AY8910_read_port_0_r)
763ADDRESS_MAP_END
394static WRITE8_HANDLER( konami_portc_1_w )
395{
396   logerror("%04X:ppi1_portc_w = %02X\n", activecpu_get_pc(), data);
397}
764398
765static ADDRESS_MAP_START( checkmaj_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
766   AM_RANGE(0x0000, 0x0fff) AM_WRITE(SMH_ROM)
767   AM_RANGE(0x8000, 0x83ff) AM_WRITE(SMH_RAM)
768   AM_RANGE(0xa000, 0xa000) AM_WRITE(AY8910_control_port_0_w)
769   AM_RANGE(0xa001, 0xa001) AM_WRITE(AY8910_write_port_0_w)
770ADDRESS_MAP_END
771399
400static const ppi8255_interface konami_ppi8255_intf =
401{
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 */
409};
772410
773static ADDRESS_MAP_START( kingball_writemem, ADDRESS_SPACE_PROGRAM, 8 )
774   AM_RANGE(0x0000, 0x2fff) AM_WRITE(SMH_ROM)
775   AM_RANGE(0x8000, 0x83ff) AM_WRITE(SMH_RAM)
776   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
777   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
778   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
779   AM_RANGE(0x9860, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
780   AM_RANGE(0x9880, 0x98ff) AM_WRITE(SMH_RAM)
781   AM_RANGE(0xa000, 0xa001) AM_WRITE(galaxian_leds_w)
782   AM_RANGE(0xa002, 0xa002) AM_WRITE(galaxian_coin_lockout_w)
783   AM_RANGE(0xa003, 0xa003) AM_WRITE(galaxian_coin_counter_w)
784   AM_RANGE(0xa004, 0xa007) AM_WRITE(galaxian_lfo_freq_w)
785   AM_RANGE(0xa800, 0xa802) AM_WRITE(galaxian_background_enable_w)
786   AM_RANGE(0xa803, 0xa803) AM_WRITE(galaxian_noise_enable_w)
787   AM_RANGE(0xa805, 0xa805) AM_WRITE(galaxian_shoot_enable_w)
788   AM_RANGE(0xa806, 0xa807) AM_WRITE(galaxian_vol_w) //
789   AM_RANGE(0xb000, 0xb000) AM_WRITE(kingball_sound1_w)
790   AM_RANGE(0xb001, 0xb001) AM_WRITE(galaxian_nmi_enable_w)
791   AM_RANGE(0xb002, 0xb002) AM_WRITE(kingball_sound2_w)
792   AM_RANGE(0xb003, 0xb003) AM_WRITE(kingball_speech_dip_w)
793   AM_RANGE(0xb004, 0xb004) AM_WRITE(SMH_NOP)               /* noise generator enable */
794   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxian_flip_screen_x_w)
795   AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxian_flip_screen_y_w)
796   AM_RANGE(0xb800, 0xb800) AM_WRITE(galaxian_pitch_w)
797ADDRESS_MAP_END
798411
799static ADDRESS_MAP_START( kingball_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
800   AM_RANGE(0x0000, 0x1fff) AM_READ(SMH_ROM)
801ADDRESS_MAP_END
802412
803static ADDRESS_MAP_START( kingball_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
804   AM_RANGE(0x0000, 0x1fff) AM_WRITE(SMH_ROM)
805ADDRESS_MAP_END
413/*************************************
414 *
415 *  The End I/O
416 *
417 *************************************/
806418
807static ADDRESS_MAP_START( kingball_sound_readport, ADDRESS_SPACE_IO, 8 )
808   ADDRESS_MAP_GLOBAL_MASK(0xff)
809   AM_RANGE(0x00, 0x00) AM_READ(soundlatch_r)
810ADDRESS_MAP_END
811
812static ADDRESS_MAP_START( kingball_sound_writeport, ADDRESS_SPACE_IO, 8 )
813   ADDRESS_MAP_GLOBAL_MASK(0xff)
814   AM_RANGE(0x00, 0x00) AM_WRITE(DAC_0_data_w)
815ADDRESS_MAP_END
816
817
818static ADDRESS_MAP_START( _4in1_readmem, ADDRESS_SPACE_PROGRAM, 8 )
819   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_BANK1)   /* banked game code */
820   AM_RANGE(0x4000, 0x47ff) AM_READ(SMH_RAM)
821   AM_RANGE(0x5000, 0x53ff) AM_READ(SMH_RAM)
822   AM_RANGE(0x5400, 0x57ff) AM_READ(galaxian_videoram_r)
823   AM_RANGE(0x5800, 0x58ff) AM_READ(SMH_RAM)
824   AM_RANGE(0x6000, 0x6000) AM_READ(input_port_0_r)
825   AM_RANGE(0x6800, 0x6800) AM_READ(_4in1_input_port_1_r)
826   AM_RANGE(0x7000, 0x7000) AM_READ(_4in1_input_port_2_r)
827   AM_RANGE(0x7800, 0x78ff) AM_READ(watchdog_reset_r)
828   AM_RANGE(0xc000, 0xdfff) AM_READ(SMH_ROM)   /* fixed menu code */
829ADDRESS_MAP_END
830
831static ADDRESS_MAP_START( _4in1_writemem, ADDRESS_SPACE_PROGRAM, 8 )
832   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)   /* banked game code */
833   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM)
834   AM_RANGE(0x5000, 0x53ff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
835   AM_RANGE(0x5800, 0x583f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
836   AM_RANGE(0x5840, 0x585f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
837   AM_RANGE(0x5860, 0x587f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
838   AM_RANGE(0x5880, 0x58ff) AM_WRITE(SMH_RAM)
839   AM_RANGE(0x6000, 0x6001) AM_WRITE(galaxian_leds_w)
840//  AM_RANGE(0x6002, 0x6002) AM_WRITE(galaxian_coin_lockout_w)
841   AM_RANGE(0x6003, 0x6003) AM_WRITE(galaxian_coin_counter_w)
842   AM_RANGE(0x6004, 0x6007) AM_WRITE(galaxian_lfo_freq_w)
843   AM_RANGE(0x6800, 0x6802) AM_WRITE(galaxian_background_enable_w)
844//  AM_RANGE(0x6803, 0x6803) AM_WRITE(galaxian_noise_enable_w) /* not hooked up? */
845   AM_RANGE(0x6805, 0x6805) AM_WRITE(galaxian_shoot_enable_w)
846   AM_RANGE(0x6806, 0x6807) AM_WRITE(galaxian_vol_w)
847   AM_RANGE(0x7001, 0x7001) AM_WRITE(galaxian_nmi_enable_w)
848   AM_RANGE(0x7004, 0x7004) AM_WRITE(galaxian_stars_enable_w)
849   AM_RANGE(0x7006, 0x7006) AM_WRITE(galaxian_flip_screen_x_w)
850   AM_RANGE(0x7007, 0x7007) AM_WRITE(galaxian_flip_screen_y_w)
851   AM_RANGE(0x7800, 0x7800) AM_WRITE(galaxian_pitch_w)
852   AM_RANGE(0x8000, 0x8000) AM_WRITE(_4in1_bank_w)
853   AM_RANGE(0xc000, 0xdfff) AM_WRITE(SMH_ROM) /* Fixed Menu Code */
854ADDRESS_MAP_END
855
856
857static ADDRESS_MAP_START( bagmanmc_readmem, ADDRESS_SPACE_PROGRAM, 8 )
858   AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM)
859   AM_RANGE(0x6000, 0x67ff) AM_READ(SMH_RAM)
860   AM_RANGE(0x9000, 0x93ff) AM_READ(SMH_RAM)
861   AM_RANGE(0x9400, 0x97ff) AM_READ(galaxian_videoram_r)
862   AM_RANGE(0x9800, 0x98ff) AM_READ(SMH_RAM)
863   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
864   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)
865   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)
866   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
867ADDRESS_MAP_END
868
869static ADDRESS_MAP_START( bagmanmc_writemem, ADDRESS_SPACE_PROGRAM, 8 )
870   AM_RANGE(0x0000, 0x5fff) AM_WRITE(SMH_ROM)
871   AM_RANGE(0x6000, 0x67ff) AM_WRITE(SMH_RAM)
872   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
873   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
874   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
875   AM_RANGE(0x9860, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
876   AM_RANGE(0x9880, 0x98ff) AM_WRITE(SMH_RAM)
877   AM_RANGE(0xa003, 0xa003) AM_WRITE(galaxian_coin_counter_w)
878   AM_RANGE(0xa803, 0xa803) AM_WRITE(galaxian_noise_enable_w)
879   AM_RANGE(0xb001, 0xb001) AM_WRITE(galaxian_nmi_enable_w)
880   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxian_flip_screen_x_w)
881   AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxian_flip_screen_y_w)
882   AM_RANGE(0xb800, 0xb800) AM_WRITE(galaxian_pitch_w)
883ADDRESS_MAP_END
884
885static int latch;
886
887static WRITE8_HANDLER( zigzag_8910_latch_w )
419static READ8_HANDLER( theend_ppi8255_r )
888420{
889   latch = offset;
421   /* the decoding here is very simplistic, and you can address both simultaneously */
422   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);
425   return result;
890426}
891427
892static WRITE8_HANDLER( zigzag_8910_data_trigger_w )
428
429static WRITE8_HANDLER( theend_ppi8255_w )
893430{
894   AY8910_write_port_0_w(machine,0,latch);
431   /* 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);
895434}
896435
897static WRITE8_HANDLER( zigzag_8910_control_trigger_w )
436
437static WRITE8_HANDLER( theend_coin_counter_w )
898438{
899   AY8910_control_port_0_w(machine,0,latch);
439   coin_counter_w(0, data & 0x80);
900440}
901441
902static ADDRESS_MAP_START( zigzag_readmem, ADDRESS_SPACE_PROGRAM, 8 )
903   AM_RANGE(0x0000, 0x1fff) AM_READ(SMH_ROM)
904   AM_RANGE(0x2000, 0x2fff) AM_READ(SMH_BANK1)
905   AM_RANGE(0x3000, 0x3fff) AM_READ(SMH_BANK2)
906   AM_RANGE(0x4000, 0x47ff) AM_READ(SMH_RAM)
907   AM_RANGE(0x5000, 0x53ff) AM_READ(SMH_RAM)
908   AM_RANGE(0x5800, 0x58ff) AM_READ(SMH_RAM)
909   AM_RANGE(0x6000, 0x6000) AM_READ(input_port_0_r)
910   AM_RANGE(0x6800, 0x6800) AM_READ(input_port_1_r)
911   AM_RANGE(0x7000, 0x7000) AM_READ(input_port_2_r)
912   AM_RANGE(0x7800, 0x7800) AM_READ(watchdog_reset_r)
913ADDRESS_MAP_END
914442
915static ADDRESS_MAP_START( zigzag_writemem, ADDRESS_SPACE_PROGRAM, 8 )
916   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
917   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM)
918   AM_RANGE(0x4800, 0x4800) AM_WRITE(SMH_NOP)   /* part of the 8910 interface */
919   AM_RANGE(0x4801, 0x4801) AM_WRITE(zigzag_8910_data_trigger_w)
920   AM_RANGE(0x4803, 0x4803) AM_WRITE(zigzag_8910_control_trigger_w)
921   AM_RANGE(0x4900, 0x49ff) AM_WRITE(zigzag_8910_latch_w)
922   AM_RANGE(0x4a00, 0x4a00) AM_WRITE(SMH_NOP)   /* part of the 8910 interface */
923   AM_RANGE(0x5000, 0x53ff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
924   AM_RANGE(0x5800, 0x583f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
925   AM_RANGE(0x5840, 0x587f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)   /* no bulletsram, all sprites */
926   AM_RANGE(0x5880, 0x58ff) AM_WRITE(SMH_RAM)
927   AM_RANGE(0x7001, 0x7001) AM_WRITE(galaxian_nmi_enable_w)
928   AM_RANGE(0x7002, 0x7002) AM_WRITE(zigzag_sillyprotection_w)
929   AM_RANGE(0x7006, 0x7006) AM_WRITE(galaxian_flip_screen_x_w)
930   AM_RANGE(0x7007, 0x7007) AM_WRITE(galaxian_flip_screen_y_w)
931ADDRESS_MAP_END
932443
444/*************************************
445 *
446 *  Scramble I/O
447 *
448 *************************************/
933449
934static ADDRESS_MAP_START( scorpnmc_readmem, ADDRESS_SPACE_PROGRAM, 8 )
935   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
936   AM_RANGE(0x4000, 0x47ff) AM_READ(SMH_RAM)
937   AM_RANGE(0x5000, 0x67ff) AM_READ(SMH_ROM)
938   AM_RANGE(0x9000, 0x93ff) AM_READ(SMH_RAM)
939   AM_RANGE(0x9400, 0x97ff) AM_READ(galaxian_videoram_r)
940   AM_RANGE(0x9800, 0x98ff) AM_READ(SMH_RAM)
941   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
942   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)
943   AM_RANGE(0xb001, 0xb001) AM_READ(input_port_2_r)
944   AM_RANGE(0xb002, 0xb002) AM_READ(input_port_3_r)
945   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
946ADDRESS_MAP_END
947
948static ADDRESS_MAP_START( scorpnmc_writemem, ADDRESS_SPACE_PROGRAM, 8 )
949   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
950   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM)
951   AM_RANGE(0x5000, 0x67ff) AM_WRITE(SMH_ROM)
952   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
953   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
954   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
955   AM_RANGE(0x9860, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
956   AM_RANGE(0x9880, 0x98ff) AM_WRITE(SMH_RAM)
957   AM_RANGE(0xa003, 0xa003) AM_WRITE(galaxian_coin_counter_w)
958   AM_RANGE(0xa004, 0xa007) AM_WRITE(galaxian_lfo_freq_w)
959   AM_RANGE(0xa800, 0xa802) AM_WRITE(galaxian_background_enable_w)
960   AM_RANGE(0xa803, 0xa803) AM_WRITE(galaxian_noise_enable_w)
961   AM_RANGE(0xa805, 0xa805) AM_WRITE(galaxian_shoot_enable_w)
962   AM_RANGE(0xa806, 0xa807) AM_WRITE(galaxian_vol_w)
963   AM_RANGE(0xb001, 0xb001) AM_WRITE(galaxian_nmi_enable_w)
964   AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxian_stars_enable_w)
965   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxian_flip_screen_x_w)
966   AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxian_flip_screen_y_w)
967   AM_RANGE(0xb800, 0xb800) AM_WRITE(galaxian_pitch_w)
968ADDRESS_MAP_END
969
970
971static ADDRESS_MAP_START( dkongjrm_readmem, ADDRESS_SPACE_PROGRAM, 8 )
972   AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM)
973   AM_RANGE(0x6000, 0x6fff) AM_READ(SMH_RAM)
974   AM_RANGE(0x7000, 0x7fff) AM_READ(SMH_ROM)
975   AM_RANGE(0x9000, 0x93ff) AM_READ(SMH_RAM)
976   AM_RANGE(0xa000, 0xa0ff) AM_READ(input_port_0_r)
977   AM_RANGE(0xa800, 0xa8ff) AM_READ(input_port_1_r)
978   AM_RANGE(0xb000, 0xb0ff) AM_READ(input_port_2_r)
979   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
980ADDRESS_MAP_END
981
982static ADDRESS_MAP_START( dkongjrm_writemem, ADDRESS_SPACE_PROGRAM, 8 )
983   AM_RANGE(0x0000, 0x5fff) AM_WRITE(SMH_ROM)
984   AM_RANGE(0x6000, 0x6fff) AM_WRITE(SMH_RAM)
985   AM_RANGE(0x7000, 0x7fff) AM_WRITE(SMH_ROM)
986   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
987   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
988   AM_RANGE(0x9840, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
989   AM_RANGE(0x98c0, 0x98ff) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram2) AM_SIZE(&galaxian_spriteram2_size)
990   AM_RANGE(0xa003, 0xa003) AM_WRITE(galaxian_coin_counter_w)
991  //AM_RANGE(0xa004, 0xa007) AM_WRITE(galaxian_lfo_freq_w)
992   AM_RANGE(0xa800, 0xa802) AM_WRITE(galaxian_background_enable_w)
993   AM_RANGE(0xa803, 0xa803) AM_WRITE(galaxian_noise_enable_w)
994  //AM_RANGE(0xa805, 0xa805) AM_WRITE(galaxian_shoot_enable_w)
995   AM_RANGE(0xa806, 0xa807) AM_WRITE(galaxian_vol_w)
996   AM_RANGE(0xb000, 0xb000) AM_WRITE(galaxian_gfxbank_w)
997   AM_RANGE(0xb001, 0xb001) AM_WRITE(galaxian_nmi_enable_w)
998  //AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxian_stars_enable_w)
999   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxian_flip_screen_x_w)
1000   AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxian_flip_screen_y_w)
1001   AM_RANGE(0xb800, 0xb800) AM_WRITE(galaxian_pitch_w)
1002ADDRESS_MAP_END
1003
1004
1005static ADDRESS_MAP_START( ozon1_readmem, ADDRESS_SPACE_PROGRAM, 8 )
1006   AM_RANGE(0x0000, 0x2fff) AM_READ(SMH_ROM)
1007   AM_RANGE(0x4000, 0x4200) AM_READ(SMH_RAM)
1008   AM_RANGE(0x4300, 0x43ff) AM_READ(SMH_RAM)
1009   AM_RANGE(0x4800, 0x4bff) AM_READ(galaxian_videoram_r)
1010   AM_RANGE(0x5000, 0x503f) AM_READ(SMH_RAM)
1011   AM_RANGE(0x5040, 0x505f) AM_READ(SMH_RAM)
1012   AM_RANGE(0x8100, 0x8100) AM_READ(input_port_0_r)
1013   AM_RANGE(0x8101, 0x8101) AM_READ(input_port_1_r)
1014   AM_RANGE(0x8102, 0x8102) AM_READ(input_port_2_r)
1015ADDRESS_MAP_END
1016
1017static ADDRESS_MAP_START( ozon1_writemem, ADDRESS_SPACE_PROGRAM, 8 )
1018   AM_RANGE(0x0000, 0x2fff) AM_WRITE(SMH_ROM)
1019   AM_RANGE(0x4000, 0x4200) AM_WRITE(SMH_RAM)
1020   AM_RANGE(0x4300, 0x43ff) AM_WRITE(SMH_RAM)
1021   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
1022   AM_RANGE(0x4c00, 0x4fff) AM_WRITE(galaxian_videoram_w)
1023   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
1024   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
1025   AM_RANGE(0x6801, 0x6801) AM_WRITE(SMH_NOP) //continuosly 0 and 1
1026   AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxian_coin_counter_w)
1027   AM_RANGE(0x6806, 0x6806) AM_WRITE(SMH_NOP) //only one 0 at reset
1028   AM_RANGE(0x6807, 0x6807) AM_WRITE(SMH_NOP) //only one 0 at reset
1029   AM_RANGE(0x8103, 0x8103) AM_WRITE(SMH_NOP) //only one 9b at reset
1030ADDRESS_MAP_END
1031
1032static ADDRESS_MAP_START( ozon1_writeport, ADDRESS_SPACE_IO, 8 )
1033   ADDRESS_MAP_GLOBAL_MASK(0xff)
1034   AM_RANGE(0x00, 0x00) AM_WRITE(AY8910_write_port_0_w)
1035   AM_RANGE(0x01, 0x01) AM_WRITE(AY8910_control_port_0_w)
1036ADDRESS_MAP_END
1037
1038static ADDRESS_MAP_START( drivfrcg, ADDRESS_SPACE_PROGRAM, 8 )
1039   AM_RANGE(0x0000, 0x0fff) AM_ROM
1040   AM_RANGE(0x1480, 0x14bf) AM_MIRROR(0x6000) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
1041   AM_RANGE(0x14c0, 0x14ff) AM_MIRROR(0x6000) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
1042   AM_RANGE(0x1500, 0x1500) AM_MIRROR(0x6000) AM_READ(input_port_0_r)
1043   AM_RANGE(0x1503, 0x1503) AM_MIRROR(0x6000) AM_WRITE(galaxian_coin_counter_w)
1044   AM_RANGE(0x1580, 0x1580) AM_MIRROR(0x6000) AM_READ(input_port_1_r)
1045   AM_RANGE(0x1580, 0x1582) AM_MIRROR(0x6000) AM_WRITE(galaxian_background_enable_w)
1046   AM_RANGE(0x1583, 0x1583) AM_MIRROR(0x6000) AM_WRITE(SMH_NOP)
1047   AM_RANGE(0x1585, 0x1585) AM_MIRROR(0x6000) AM_WRITE(SMH_NOP)
1048   AM_RANGE(0x1586, 0x1587) AM_MIRROR(0x6000) AM_WRITE(galaxian_lfo_freq_w)
1049   AM_RANGE(0x1600, 0x1600) AM_MIRROR(0x6000) AM_READWRITE(input_port_2_r, galaxian_pitch_w)
1050   AM_RANGE(0x1700, 0x1700) AM_MIRROR(0x6000) AM_READWRITE(input_port_3_r, SMH_NOP)
1051   AM_RANGE(0x1701, 0x1701) AM_MIRROR(0x6000) AM_WRITE(SMH_NOP)
1052   AM_RANGE(0x1704, 0x1707) AM_MIRROR(0x6000) AM_WRITE(galaxian_vol_w)
1053   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
1054   AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
1055   AM_RANGE(0x2000, 0x2fff) AM_ROM
1056   AM_RANGE(0x4000, 0x4fff) AM_ROM
1057   AM_RANGE(0x6000, 0x6fff) AM_ROM
1058ADDRESS_MAP_END
1059
1060static ADDRESS_MAP_START( drivfrcg_io, ADDRESS_SPACE_IO, 8 )
1061   AM_RANGE(0x00, 0x00) AM_READ(drivfrcg_port0_r)
1062   AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READWRITE(input_port_4_r, SMH_NOP)
1063ADDRESS_MAP_END
1064
1065static ADDRESS_MAP_START( bongo, ADDRESS_SPACE_PROGRAM, 8 )
1066   AM_RANGE(0x0000, 0x5fff) AM_ROM
1067   AM_RANGE(0x8000, 0x83ff) AM_RAM
1068   AM_RANGE(0x8400, 0x87ff) AM_WRITE(SMH_NOP) // not used
1069   AM_RANGE(0x9000, 0x93ff) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&galaxian_videoram)
1070   AM_RANGE(0x9400, 0x97ff) AM_WRITE(SMH_NOP) // not used
1071   AM_RANGE(0x9800, 0x983f) AM_READWRITE(SMH_RAM, galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
1072   AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
1073   AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
1074   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
1075   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)
1076   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)
1077   AM_RANGE(0xb001, 0xb001) AM_WRITE(galaxian_nmi_enable_w)
1078   AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxian_stars_enable_w)
1079   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxian_flip_screen_x_w)
1080   AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxian_flip_screen_y_w)
1081   AM_RANGE(0xb800, 0xb800) AM_READWRITE(watchdog_reset_r, SMH_NOP)
1082ADDRESS_MAP_END
1083
1084static ADDRESS_MAP_START( bongo_io, ADDRESS_SPACE_IO, 8 )
1085   ADDRESS_MAP_GLOBAL_MASK(0xff)
1086   AM_RANGE(0x00, 0x00) AM_WRITE(AY8910_control_port_0_w)
1087   AM_RANGE(0x01, 0x01) AM_WRITE(AY8910_write_port_0_w)
1088   AM_RANGE(0x02, 0x02) AM_READ(AY8910_read_port_0_r)
1089ADDRESS_MAP_END
1090
1091
1092static ADDRESS_MAP_START( hunchbkg, ADDRESS_SPACE_PROGRAM, 8 )
1093   AM_RANGE(0x0000, 0x0fff) AM_ROM
1094   AM_RANGE(0x1480, 0x14bf) AM_MIRROR(0x6000) AM_READWRITE(SMH_RAM, galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
1095   AM_RANGE(0x14c0, 0x14ff) AM_MIRROR(0x6000) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
1096   AM_RANGE(0x1500, 0x1500) AM_MIRROR(0x6000) AM_READ(input_port_0_r)
1097   AM_RANGE(0x1503, 0x1503) AM_MIRROR(0x6000) AM_WRITE(galaxian_coin_counter_w)
1098   AM_RANGE(0x1580, 0x1580) AM_MIRROR(0x6000) AM_READ(input_port_1_r)
1099   AM_RANGE(0x1580, 0x1582) AM_MIRROR(0x6000) AM_WRITE(galaxian_background_enable_w)
1100   AM_RANGE(0x1583, 0x1583) AM_MIRROR(0x6000) AM_WRITE(SMH_NOP)
1101   AM_RANGE(0x1584, 0x1587) AM_MIRROR(0x6000) AM_WRITE(galaxian_lfo_freq_w)
1102   AM_RANGE(0x1600, 0x1600) AM_MIRROR(0x6000) AM_READ(input_port_2_r)
1103   AM_RANGE(0x1600, 0x1601) AM_MIRROR(0x6000) AM_WRITE(SMH_NOP)
1104   AM_RANGE(0x1604, 0x1604) AM_MIRROR(0x6000) AM_WRITE(SMH_NOP)
1105   AM_RANGE(0x1606, 0x1606) AM_MIRROR(0x6000) AM_WRITE(galaxian_flip_screen_x_w)
1106   AM_RANGE(0x1607, 0x1607) AM_MIRROR(0x6000) AM_WRITE(galaxian_flip_screen_y_w)
1107   AM_RANGE(0x1680, 0x1680) AM_MIRROR(0x6000) AM_READWRITE(SMH_NOP, galaxian_pitch_w)
1108   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
1109   AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
1110   AM_RANGE(0x2000, 0x2fff) AM_ROM
1111   AM_RANGE(0x4000, 0x4fff) AM_ROM
1112   AM_RANGE(0x6000, 0x6fff) AM_ROM
1113ADDRESS_MAP_END
1114
1115static ADDRESS_MAP_START( hunchbkg_io, ADDRESS_SPACE_IO, 8 )
1116   AM_RANGE(S2650_DATA_PORT,  S2650_DATA_PORT) AM_READ(SMH_NOP) // not used
1117   AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ(input_port_3_r)
1118ADDRESS_MAP_END
1119
1120static ADDRESS_MAP_START( harem_cpu1, ADDRESS_SPACE_PROGRAM, 8 )
1121   AM_RANGE(0x0000, 0x1fff) AM_ROM
1122   AM_RANGE(0x2000, 0x27ff) AM_RAM
1123   AM_RANGE(0x4000, 0x47ff) AM_RAM
1124   AM_RANGE(0x4800, 0x4fff) AM_READWRITE(galaxian_videoram_r, galaxian_videoram_w) AM_BASE(&galaxian_videoram)
1125   AM_RANGE(0x5000, 0x5000) AM_WRITENOP
1126   AM_RANGE(0x5800, 0x5800) AM_READWRITE(SMH_NOP, interrupt_enable_w)
1127   AM_RANGE(0x5801, 0x5807) AM_WRITENOP
1128   AM_RANGE(0x6101, 0x6101) AM_READ(input_port_0_r)
1129   AM_RANGE(0x6102, 0x6102) AM_READ(input_port_1_r)
1130   AM_RANGE(0x6103, 0x6103) AM_WRITENOP
1131   AM_RANGE(0x6200, 0x6203) AM_WRITENOP AM_BASE(&galaxian_attributesram)
1132   AM_RANGE(0x8000, 0x9fff) AM_ROM
1133   AM_RANGE(0xffe6, 0xffff) AM_RAM AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
1134ADDRESS_MAP_END
1135
1136static ADDRESS_MAP_START( harem_cpu2, ADDRESS_SPACE_PROGRAM, 8 )
1137   AM_RANGE(0x0000, 0x2fff) AM_ROM
1138   AM_RANGE(0x8000, 0x83ff) AM_RAM
1139   AM_RANGE(0xa000, 0xa000) AM_WRITENOP
1140ADDRESS_MAP_END
1141
1142static ADDRESS_MAP_START( harem_cpu2_io, ADDRESS_SPACE_IO, 8 )
1143   ADDRESS_MAP_GLOBAL_MASK(0xff)
1144   AM_RANGE(0x04, 0x04) AM_WRITE(AY8910_control_port_0_w)
1145   AM_RANGE(0x08, 0x08) AM_WRITE(AY8910_write_port_0_w)
1146   AM_RANGE(0x10, 0x10) AM_WRITE(AY8910_control_port_1_w)
1147   AM_RANGE(0x20, 0x20) AM_WRITE(AY8910_write_port_1_w)
1148   AM_RANGE(0x40, 0x40) AM_WRITE(AY8910_control_port_2_w)
1149   AM_RANGE(0x80, 0x80) AM_WRITE(AY8910_write_port_2_w)
1150   AM_RANGE(0x80, 0x80) AM_READ(soundlatch_r)
1151ADDRESS_MAP_END
1152
1153static ADDRESS_MAP_START( tazzmang, ADDRESS_SPACE_PROGRAM, 8 )
1154   AM_RANGE(0x0000, 0x5fff) AM_ROM
1155   AM_RANGE(0x7000, 0x7000) AM_READ(input_port_2_r) /* mirror */
1156   AM_RANGE(0x8000, 0x87ff) AM_RAM
1157   AM_RANGE(0x8800, 0x883f) AM_READWRITE(SMH_RAM, galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
1158   AM_RANGE(0x8840, 0x885f) AM_RAM AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
1159   AM_RANGE(0x8860, 0x887f) AM_RAM AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
1160   AM_RANGE(0x8880, 0x8bff) AM_WRITENOP
1161   AM_RANGE(0x9000, 0x93ff) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&galaxian_videoram)
1162   AM_RANGE(0x9800, 0x9800) AM_READ(watchdog_reset_r)
1163   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
1164   AM_RANGE(0xa7ff, 0xa7ff) AM_READ(input_port_0_r) /* mirror */
1165   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r) AM_WRITE(galaxian_background_enable_w)
1166   AM_RANGE(0xa803, 0xa803) AM_WRITE(galaxian_coin_counter_w)
1167   AM_RANGE(0xa805, 0xa805) AM_WRITE(galaxian_shoot_enable_w)
1168   AM_RANGE(0xa806, 0xa807) AM_WRITE(galaxian_vol_w)
1169   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)
1170   AM_RANGE(0xb001, 0xb001) AM_WRITE(galaxian_nmi_enable_w)
1171   AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxian_stars_enable_w)
1172   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxian_flip_screen_x_w)
1173   AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxian_flip_screen_y_w)
1174   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r) AM_WRITE(galaxian_pitch_w)
1175ADDRESS_MAP_END
1176
1177static ADDRESS_MAP_START( racknrol, ADDRESS_SPACE_PROGRAM, 8 )
1178   AM_RANGE(0x0000, 0x0fff) AM_ROM
1179   AM_RANGE(0x1400, 0x143f) AM_MIRROR(0x6000) AM_READWRITE(SMH_RAM, galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
1180   AM_RANGE(0x1440, 0x14bf) AM_MIRROR(0x6000) AM_RAM AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
1181   AM_RANGE(0x14c0, 0x14ff) AM_MIRROR(0x6000) AM_RAM
1182   AM_RANGE(0x1500, 0x1500) AM_MIRROR(0x6000) AM_READ(input_port_0_r)
1183   AM_RANGE(0x1580, 0x1580) AM_MIRROR(0x6000) AM_READ(input_port_1_r)
1184   AM_RANGE(0x1600, 0x1600) AM_MIRROR(0x6000) AM_READ(input_port_2_r)
1185   AM_RANGE(0x1600, 0x1601) AM_MIRROR(0x6000) AM_WRITENOP
1186   AM_RANGE(0x1606, 0x1606) AM_MIRROR(0x6000) AM_WRITE(galaxian_flip_screen_x_w)
1187   AM_RANGE(0x1607, 0x1607) AM_MIRROR(0x6000) AM_WRITE(galaxian_flip_screen_y_w)
1188   AM_RANGE(0x1680, 0x1680) AM_MIRROR(0x6000) AM_READNOP
1189//  AM_RANGE(0x1700, 0x1700) AM_MIRROR(0x6000) AM_READ(trvchlng_question_r)
1190//  AM_RANGE(0x1701, 0x1703) AM_MIRROR(0x6000) AM_READ(trvchlng_question_w)
1191   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
1192   AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
1193   AM_RANGE(0x2000, 0x2fff) AM_ROM
1194   AM_RANGE(0x4000, 0x4fff) AM_ROM
1195   AM_RANGE(0x6000, 0x6fff) AM_ROM
1196ADDRESS_MAP_END
1197
1198static ADDRESS_MAP_START( racknrol_io, ADDRESS_SPACE_IO, 8 )
1199   AM_RANGE(0x1d, 0x1d) AM_WRITE(SN76496_0_w)
1200   AM_RANGE(0x1e, 0x1e) AM_WRITE(SN76496_1_w)
1201   AM_RANGE(0x1f, 0x1f) AM_WRITE(SN76496_2_w)
1202   AM_RANGE(0x20, 0x3f) AM_WRITE(racknrol_tiles_bank_w) AM_BASE(&racknrol_tiles_bank)
1203   AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ(input_port_3_r)
1204ADDRESS_MAP_END
1205
1206static ADDRESS_MAP_START( ckongg_readmem, ADDRESS_SPACE_PROGRAM, 8 )
1207
1208   AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM)
1209   AM_RANGE(0x6000, 0x6fff) AM_READ(SMH_RAM)
1210   AM_RANGE(0x9000, 0x93ff) AM_READ(galaxian_videoram_r)
1211   AM_RANGE(0x9800, 0x98ff) AM_READ(SMH_RAM)
1212   AM_RANGE(0xc000, 0xc000) AM_READ(input_port_0_r)
1213   AM_RANGE(0xc400, 0xc400) AM_READ(input_port_1_r)
1214   AM_RANGE(0xc800, 0xc800) AM_READ(input_port_2_r)
1215   AM_RANGE(0xcc00, 0xcc00) AM_READ(watchdog_reset_r)
1216
1217ADDRESS_MAP_END
1218
1219static ADDRESS_MAP_START( ckongg_writemem, ADDRESS_SPACE_PROGRAM, 8 )
1220   AM_RANGE(0x0000, 0x5fff) AM_WRITE(SMH_ROM)
1221   AM_RANGE(0x6000, 0x6fff) AM_WRITE(SMH_RAM)
1222   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
1223   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
1224   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
1225   AM_RANGE(0x9860, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
1226   AM_RANGE(0x9880, 0x98ff) AM_WRITE(SMH_RAM)
1227   AM_RANGE(0xc000, 0xc001) AM_WRITE(galaxian_leds_w)
1228   AM_RANGE(0xc002, 0xc002) AM_WRITE(galaxian_coin_lockout_w)
1229   AM_RANGE(0xc003, 0xc003) AM_WRITE(galaxian_coin_counter_w)
1230   AM_RANGE(0xc004, 0xc007) AM_WRITE(galaxian_lfo_freq_w)
1231   AM_RANGE(0xc400, 0xc402) AM_WRITE(galaxian_background_enable_w)
1232   AM_RANGE(0xc403, 0xc403) AM_WRITE(galaxian_noise_enable_w)
1233   AM_RANGE(0xc405, 0xc405) AM_WRITE(galaxian_shoot_enable_w)
1234   AM_RANGE(0xc406, 0xc407) AM_WRITE(galaxian_vol_w)
1235   AM_RANGE(0xc801, 0xc801) AM_WRITE(galaxian_nmi_enable_w)
1236   AM_RANGE(0xc804, 0xc804) AM_WRITE(SMH_NOP) // link cut
1237   AM_RANGE(0xc806, 0xc806) AM_WRITE(galaxian_flip_screen_x_w)
1238   AM_RANGE(0xc807, 0xc807) AM_WRITE(galaxian_flip_screen_y_w)
1239   AM_RANGE(0xcc00, 0xcc00) AM_WRITE(galaxian_pitch_w)
1240ADDRESS_MAP_END
1241
1242static ADDRESS_MAP_START( kkgalax_readmem, ADDRESS_SPACE_PROGRAM, 8 )
1243
1244   AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM)
1245   AM_RANGE(0x6000, 0x6fff) AM_READ(SMH_RAM)
1246   AM_RANGE(0x9000, 0x93ff) AM_READ(galaxian_videoram_r)
1247   AM_RANGE(0x9800, 0x98ff) AM_READ(SMH_RAM)
1248   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
1249   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)
1250   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)
1251//  AM_RANGE(0xcc00, 0xcc00) AM_READ(watchdog_reset_r)
1252
1253ADDRESS_MAP_END
1254
1255static ADDRESS_MAP_START( kkgalax_writemem, ADDRESS_SPACE_PROGRAM, 8 )
1256   AM_RANGE(0x0000, 0x5fff) AM_WRITE(SMH_NOP)
1257   AM_RANGE(0x6000, 0x6fff) AM_WRITE(SMH_RAM)
1258   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
1259   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
1260   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
1261   AM_RANGE(0x9860, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
1262   AM_RANGE(0x9880, 0x98ff) AM_WRITE(SMH_RAM)
1263//  AM_RANGE(0xc000, 0xc001) AM_WRITE(galaxian_leds_w)
1264//  AM_RANGE(0xc002, 0xc002) AM_WRITE(galaxian_coin_lockout_w)
1265//  AM_RANGE(0xc003, 0xc003) AM_WRITE(galaxian_coin_counter_w)
1266//  AM_RANGE(0xc004, 0xc007) AM_WRITE(galaxian_lfo_freq_w)
1267//  AM_RANGE(0xc400, 0xc402) AM_WRITE(galaxian_background_enable_w)
1268//  AM_RANGE(0xc403, 0xc403) AM_WRITE(galaxian_noise_enable_w)
1269//  AM_RANGE(0xc405, 0xc405) AM_WRITE(galaxian_shoot_enable_w)
1270//  AM_RANGE(0xc406, 0xc407) AM_WRITE(galaxian_vol_w)
1271   AM_RANGE(0xb001, 0xb001) AM_WRITE(galaxian_nmi_enable_w)
1272//  AM_RANGE(0xc804, 0xc804) AM_WRITE(SMH_NOP) // link cut
1273//  AM_RANGE(0xc806, 0xc806) AM_WRITE(galaxian_flip_screen_x_w)
1274//  AM_RANGE(0xc807, 0xc807) AM_WRITE(galaxian_flip_screen_y_w)
1275//  AM_RANGE(0xcc00, 0xcc00) AM_WRITE(galaxian_pitch_w)
1276ADDRESS_MAP_END
1277
1278static READ8_HANDLER( hexpoola_data_port_r )
450static WRITE8_HANDLER( scramble_protection_w )
1279451{
1280   switch (activecpu_get_pc())
452   /*
453        This is not fully understood; the low 4 bits of port C are
454        inputs; the upper 4 bits are outputs. Scramble main set always
455        writes sequences of 3 or more nibbles to the low port and
456        expects certain results in the upper nibble afterwards.
457    */
458   protection_state = (protection_state << 4) | (data & 0x0f);
459   switch (protection_state & 0xfff)
1281460   {
1282      case 0x0022:
1283         return 0;
461      /* scramble */
462      case 0xf09:      protection_result = 0xff;   break;
463      case 0xa49:      protection_result = 0xbf;   break;
464      case 0x319:      protection_result = 0x4f;   break;
465      case 0x5c9:      protection_result = 0x6f;   break;
1284466
1285      case 0x0031:
1286         return 1;
467      /* scrambls */
468      case 0x246:      protection_result ^= 0x80;   break;
469      case 0xb5f:      protection_result = 0x6f;   break;
1287470   }
1288
1289    return 0;
1290471}
1291472
1292static ADDRESS_MAP_START( hexpoola_io, ADDRESS_SPACE_IO, 8 )
1293   AM_RANGE(0x00, 0x00) AM_READNOP
1294   AM_RANGE(0x20, 0x3f) AM_WRITE(racknrol_tiles_bank_w) AM_BASE(&racknrol_tiles_bank)
1295   AM_RANGE(S2650_DATA_PORT, S2650_DATA_PORT) AM_READWRITE(hexpoola_data_port_r, SN76496_0_w)
1296   AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ(input_port_3_r)
1297ADDRESS_MAP_END
1298473
1299#define GAL_IN0\
1300   PORT_START_TAG("IN0")\
1301   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )\
1302   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )\
1303   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY\
1304   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY\
1305   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )\
1306   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )\
1307   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )\
1308   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )\
1309   PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )\
1310   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
474static READ8_HANDLER( scramble_protection_r )
475{
476   return protection_result;
477}
1311478
1312#define GAL_IN1\
1313   PORT_START_TAG("IN1")\
1314   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )\
1315   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )\
1316   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL\
1317   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL\
1318   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL\
1319   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )\
1320   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )\
1321   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )\
1322   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )\
1323   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )\
1324   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
1325479
1326static INPUT_PORTS_START( galaxian )
1327GAL_IN0
1328GAL_IN1
480static CUSTOM_INPUT( scramble_protection_alt_r )
481{
482   /*
483        There are two additional bits that are derived from bit 7 of
484        the protection result. This is just a guess but works well enough
485        to boot scrambls.
486    */
487   return (protection_result >> 7) & 1;
488}
1329489
1330   PORT_START_TAG("DSW0")
1331   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ) )
1332   PORT_DIPSETTING(    0x00, "7000" )
1333   PORT_DIPSETTING(    0x01, "10000" )
1334   PORT_DIPSETTING(    0x02, "12000" )
1335   PORT_DIPSETTING(    0x03, "20000" )
1336   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )
1337   PORT_DIPSETTING(    0x00, "2" )
1338   PORT_DIPSETTING(    0x04, "3" )
1339   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
1340   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1341   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1342   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1343INPUT_PORTS_END
1344490
1345static INPUT_PORTS_START( galtaito )
1346   PORT_START_TAG("IN0")
1347   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1348   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1349   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
1350   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1351   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1352   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Cabinet ) )
1353   PORT_DIPSETTING(    0x20, DEF_STR( Upright ) )
1354   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
1355   PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
1356   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1357491
1358GAL_IN1
492/*************************************
493 *
494 *  Explorer I/O
495 *
496 *************************************/
1359497
1360   PORT_START_TAG("DSW0")
1361   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) )
1362   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1363   PORT_DIPSETTING(    0x01, "4000" )
1364   PORT_DIPSETTING(    0x02, "5000" )
1365   PORT_DIPSETTING(    0x03, "7000" )
1366   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
1367   PORT_DIPSETTING(    0x00, "3" )
1368   PORT_DIPSETTING(    0x04, "5" )
1369   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
1370   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1371   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1372   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1373INPUT_PORTS_END
498static WRITE8_HANDLER( explorer_sound_control_w )
499{
500   cpunum_set_input_line(machine, 1, 0, ASSERT_LINE);
501}
1374502
1375static INPUT_PORTS_START( superg )
1376GAL_IN0
1377GAL_IN1
1378503
1379   PORT_START_TAG("DSW0")
1380   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) )
1381   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1382   PORT_DIPSETTING(    0x01, "4000" )
1383   PORT_DIPSETTING(    0x02, "5000" )
1384   PORT_DIPSETTING(    0x03, "7000" )
1385   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
1386   PORT_DIPSETTING(    0x00, "3" )
1387   PORT_DIPSETTING(    0x04, "5" )
1388   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
1389   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1390   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1391   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1392INPUT_PORTS_END
504static READ8_HANDLER( explorer_sound_latch_r )
505{
506   cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
507   return soundlatch_r(machine, 0);
508}
1393509
1394static INPUT_PORTS_START( swarm )
1395GAL_IN0
1396GAL_IN1
1397510
1398   PORT_START_TAG("DSW0")
1399   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ) )
1400   PORT_DIPSETTING(    0x01, "10000" )
1401   PORT_DIPSETTING(    0x02, "20000" )
1402   PORT_DIPSETTING(    0x03, "40000" )
1403   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1404   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
1405   PORT_DIPSETTING(    0x00, "3" )
1406   PORT_DIPSETTING(    0x04, "4" )
1407   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Difficulty ) )   /* aliens "flying" simultaneously */
1408   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )            /* less aliens */
1409   PORT_DIPSETTING(    0x08, DEF_STR( Hard ) )            /* more aliens */
1410   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1411INPUT_PORTS_END
1412511
1413static INPUT_PORTS_START( gmgalax )
1414   PORT_START_TAG("GMIN0")      /* Ghost Muncher - IN0 */
1415   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1416   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_4WAY PORT_COCKTAIL
1417   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
1418   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1419   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
1420   PORT_DIPNAME( 0x20, 0x00, "Ghost Muncher - Cabinet" )   PORT_CONDITION("FAKE",0x01,PORTCOND_NOTEQUALS,0x01)
1421   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1422   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
1423   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
1424   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
512/*************************************
513 *
514 *  SF-X I/O
515 *
516 *************************************/
1425517
1426   PORT_START_TAG("GMIN1")      /* Ghost Muncher - IN1 */
1427   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1428   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1429   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
1430   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1431   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
1432   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
1433   PORT_DIPNAME( 0xc0, 0x40, "Ghost Muncher - Bonus Life" )   PORT_CONDITION("FAKE",0x01,PORTCOND_NOTEQUALS,0x01)
1434   PORT_DIPSETTING(    0x40, "10000" )
1435   PORT_DIPSETTING(    0x80, "15000" )
1436   PORT_DIPSETTING(    0xc0, "20000" )
1437   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
518static READ8_HANDLER( sfx_sample_io_r )
519{
520   /* the decoding here is very simplistic, and you can address both simultaneously */
521   UINT8 result = 0xff;
522   if (offset & 0x04) result &= ppi8255_2_r(machine, offset & 3);
523   return result;
524}
1438525
1439   PORT_START_TAG("GMDSW0")      /* Ghost Muncher - DSW0 */
1440   PORT_DIPNAME( 0x03, 0x02, "Ghost Muncher - Coinage" )   PORT_CONDITION("FAKE",0x01,PORTCOND_NOTEQUALS,0x01)
1441   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
1442   PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
1443   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
1444   PORT_DIPSETTING(    0x03, DEF_STR( Free_Play ) )
1445   PORT_DIPNAME( 0x0c, 0x04, "Ghost Muncher - Lives" )   PORT_CONDITION("FAKE",0x01,PORTCOND_NOTEQUALS,0x01)
1446   PORT_DIPSETTING(    0x0c, "1" )
1447   PORT_DIPSETTING(    0x08, "2" )
1448   PORT_DIPSETTING(    0x04, "3" )
1449   PORT_DIPSETTING(    0x00, "5" )
1450   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1451526
1452   PORT_START_TAG("IN0")      /* Galaxian - IN0 */
1453   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1454   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1455   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
1456   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1457   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1458   PORT_DIPNAME( 0x20, 0x00, "Galaxian - Cabinet" )   PORT_CONDITION("FAKE",0x01,PORTCOND_EQUALS,0x01)
1459   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1460   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
1461   PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
1462   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
527static WRITE8_HANDLER( sfx_sample_io_w )
528{
529   /* the decoding here is very simplistic, and you can address both simultaneously */
530   if (offset & 0x04) ppi8255_2_w(machine, offset & 3, data);
531   if (offset & 0x10) DAC_0_signed_data_w(machine, offset, data);
532}
1463533
1464   PORT_START_TAG("IN1")      /* Galaxian - IN1 */
1465   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1466   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1467   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
1468   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
1469   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1470   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
1471   PORT_DIPNAME( 0xc0, 0x00, "Galaxian - Coinage" )   PORT_CONDITION("FAKE",0x01,PORTCOND_EQUALS,0x01)
1472   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
1473   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1474   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
1475   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
1476534
1477   PORT_START_TAG("DSW0")      /* Galaxian - DSW0 */
1478   PORT_DIPNAME( 0x03, 0x01, "Galaxian - Bonus Life" )   PORT_CONDITION("FAKE",0x01,PORTCOND_EQUALS,0x01)
1479   PORT_DIPSETTING(    0x01, "4000" )
1480   PORT_DIPSETTING(    0x02, "5000" )
1481   PORT_DIPSETTING(    0x03, "7000" )
1482   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1483   PORT_DIPNAME( 0x04, 0x00, "Galaxian - Lives" )   PORT_CONDITION("FAKE",0x01,PORTCOND_EQUALS,0x01)
1484   PORT_DIPSETTING(    0x00, "3" )
1485   PORT_DIPSETTING(    0x04, "5" )
1486   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
1487   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1488   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1489   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
535static WRITE8_HANDLER( sfx_sample_control_w )
536{
537   UINT8 old = sfx_sample_control;
538   sfx_sample_control = data;
1490539
1491   PORT_START_TAG("FAKE")      /* fake - game select */
1492   PORT_BIT( 0x01, 0x00, IPT_DIPSWITCH_NAME ) PORT_NAME("Game Select") PORT_CODE(KEYCODE_F1) PORT_TOGGLE
1493   PORT_DIPSETTING( 0x00, "Ghost Muncher" )
1494   PORT_DIPSETTING( 0x01, "Galaxian" )
1495INPUT_PORTS_END
540   /* the inverse of bit 0 clocks the flip flop to signal an INT */
541   /* it is automatically cleared on the acknowledge */
542   if ((old & 0x01) && !(data & 0x01))
543      cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
544}
1496545
1497static INPUT_PORTS_START( zerotime )
1498GAL_IN0
1499   PORT_START_TAG("IN1")
1500   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1501   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1502   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
1503   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
1504   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1505   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
1506   PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Coinage ) )
1507   PORT_DIPSETTING(    0x40, "A 1C/1C 2C/2C  B 1C/2C" )
1508   PORT_DIPSETTING(    0xc0, "A 1C/1C 2C/3C  B 1C/3C" )
1509   PORT_DIPSETTING(    0x00, "A 1C/2C 2C/4C  B 1C/4C" )
1510   PORT_DIPSETTING(    0x80, "A 1C/2C 2C/5C  B 1C/5C" )
1511546
1512   PORT_START_TAG("DSW0")
1513   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Bonus_Life ) )
1514   PORT_DIPSETTING(    0x03, "6000" )
1515   PORT_DIPSETTING(    0x02, "7000" )
1516   PORT_DIPSETTING(    0x01, "9000" )
1517   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1518   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
1519   PORT_DIPSETTING(    0x00, "3" )
1520   PORT_DIPSETTING(    0x04, "5" )
1521   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Difficulty ) )   /* player's bullet speed */
1522   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )            /* gap of 6 pixels */
1523   PORT_DIPSETTING(    0x08, DEF_STR( Hard ) )            /* gap of 8 pixels */
1524   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1525INPUT_PORTS_END
547static const ppi8255_interface sfx_ppi8255_intf =
548{
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 */
556};
1526557
1527#define PISCES_COMMON\
1528   PORT_START_TAG("IN0")\
1529   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 )\
1530   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )\
1531   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY\
1532   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY\
1533   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )\
1534   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )\
1535   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )\
1536   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )\
1537   PORT_START_TAG("IN1")\
1538   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )\
1539   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )\
1540   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL\
1541   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL\
1542   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL\
1543   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )\
1544   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Lives ) )\
1545   PORT_DIPSETTING(    0x00, "3" )\
1546   PORT_DIPSETTING(    0x40, "4" )\
1547   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )\
1548   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )\
1549   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
1550558
1551559
1552static INPUT_PORTS_START( pisces )
1553PISCES_COMMON
560/*************************************
561 *
562 *  Frogger I/O
563 *
564 *************************************/
1554565
1555   PORT_START_TAG("DSW0")
1556   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
1557   PORT_DIPSETTING(    0x00, "10000" )
1558   PORT_DIPSETTING(    0x01, "20000" )
1559   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Coinage ) )
1560   PORT_DIPSETTING(    0x02, "A 2C/1C  B 1C/3C" )
1561   PORT_DIPSETTING(    0x00, "A 1C/1C  B 1C/6C" )
1562   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Difficulty ) )
1563   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
1564   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
1565   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
1566   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1567   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1568   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1569INPUT_PORTS_END
566static READ8_HANDLER( frogger_ppi8255_r )
567{
568   /* the decoding here is very simplistic, and you can address both simultaneously */
569   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);
572   return result;
573}
1570574
1571/* Same as 'pisces', but different "Coinage" Dip Switch */
1572static INPUT_PORTS_START( piscesb )
1573PISCES_COMMON
1574   PORT_START_TAG("DSW0")
1575   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
1576   PORT_DIPSETTING(    0x00, "10000" )
1577   PORT_DIPSETTING(    0x01, "20000" )
1578   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Coinage ) )
1579   PORT_DIPSETTING(    0x02, "A 2C/1C  B 1C/2C 2C/5C" )
1580   PORT_DIPSETTING(    0x00, "A 1C/1C  B 1C/5C" )
1581   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Difficulty ) )
1582   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
1583   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
1584   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
1585   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1586   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1587   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1588INPUT_PORTS_END
1589575
1590#define GTEIKOB_COMMON\
1591   PORT_START_TAG("IN0")\
1592   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )\
1593   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )\
1594   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY\
1595   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY\
1596   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )\
1597   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )\
1598   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )      /* Not tested due to code removed at 0x00ab, 0x1b26 and 0x1c97*/\
1599   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )      /* Not tested due to code removed at 0x1901*/\
1600   PORT_START_TAG("IN1")\
1601   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )\
1602   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )\
1603   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL\
1604   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL\
1605   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL\
1606   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )\
1607   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_A ) )\
1608   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )\
1609   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )\
1610   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coin_B ) )\
1611   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )\
1612   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
576static WRITE8_HANDLER( frogger_ppi8255_w )
577{
578   /* 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);
581}
1613582
1614static INPUT_PORTS_START( gteikokb )
1615GTEIKOB_COMMON
1616   PORT_START_TAG("DSW0")
1617   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
1618   PORT_DIPSETTING(    0x00, "7000" )
1619   PORT_DIPSETTING(    0x01, DEF_STR( None ) )
1620   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) )      // Not read due to code at 0x012b
1621   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1622   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1623   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
1624   PORT_DIPSETTING(    0x00, "3" )
1625   PORT_DIPSETTING(    0x04, "5" )
1626   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
1627   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1628   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
1629   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1630INPUT_PORTS_END
1631583
1632/* same as gteikokb with cabinet reversed */
1633static INPUT_PORTS_START( gteikob2 )
1634GTEIKOB_COMMON
1635   PORT_START_TAG("DSW0")
1636   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
1637   PORT_DIPSETTING(    0x00, "7000" )
1638   PORT_DIPSETTING(    0x01, DEF_STR( None ) )
1639   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) )      // Not read due to code at 0x012b
1640   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1641   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1642   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
1643   PORT_DIPSETTING(    0x00, "3" )
1644   PORT_DIPSETTING(    0x04, "5" )
1645   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
1646   PORT_DIPSETTING(    0x08, DEF_STR( Upright ) )
1647   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
1648   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1649INPUT_PORTS_END
584static READ8_HANDLER( frogger_ay8910_r )
585{
586   /* the decoding here is very simplistic */
587   UINT8 result = 0xff;
588   if (offset & 0x40) result &= AY8910_read_port_0_r(machine, 0);
589   return result;
590}
1650591
1651static INPUT_PORTS_START( spacbatt )
1652GAL_IN0
1653592
1654   PORT_START_TAG("IN1")
1655   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1656   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1657   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
1658   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
1659   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1660   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
1661   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
1662   PORT_DIPSETTING(    0x40, "A 2C/1C  B 1C/3C" )
1663   PORT_DIPSETTING(    0x00, "A 1C/1C  B 1C/6C" )
1664   PORT_DIPSETTING(    0x80, "A 1C/2C  B 1C/6C" )
1665   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
593static WRITE8_HANDLER( frogger_ay8910_w )
594{
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);
598}
1666599
1667   PORT_START_TAG("DSW0")
1668   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) )
1669   PORT_DIPSETTING(    0x01, "4000" )
1670   PORT_DIPSETTING(    0x02, "5000" )
1671   PORT_DIPSETTING(    0x03, "7000" )
1672   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1673   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
1674   PORT_DIPSETTING(    0x00, "3" )
1675   PORT_DIPSETTING(    0x04, "5" )
1676   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
1677   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1678   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1679   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1680INPUT_PORTS_END
1681600
1682static INPUT_PORTS_START( batman2 )
1683   PORT_START_TAG("IN0")
1684   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1685   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1686   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
1687   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1688   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1689   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
1690   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
1691   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 )
601static READ8_HANDLER( frogger_sound_timer_r )
602{
603   /* same as regular Konami sound but with bits 3,5 swapped */
604   UINT8 konami_value = konami_sound_timer_r(machine, 0);
605   return BITSWAP8(konami_value, 7,6,3,4,5,2,1,0);
606}
1692607
1693   PORT_START_TAG("IN1")
1694   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1695   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1696   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
1697   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
1698   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1699   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
1700   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_A ) )
1701   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
1702   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
1703   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coin_B ) )
1704   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
1705   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
1706608
1707   PORT_START_TAG("DSW0")
1708   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
1709   PORT_DIPSETTING(    0x00, "30000" )
1710   PORT_DIPSETTING(    0x01, "50000" )
1711   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) )
1712   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1713   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1714   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
1715   PORT_DIPSETTING(    0x00, "3" )
1716   PORT_DIPSETTING(    0x04, "5" )
1717   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
1718   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1719   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
1720   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1721INPUT_PORTS_END
609static WRITE8_HANDLER( froggrmc_sound_control_w )
610{
611   cpunum_set_input_line(machine, 1, 0, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
612}
1722613
1723static INPUT_PORTS_START( warofbug )
1724   PORT_START_TAG("IN0")
1725   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1726   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1727   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
1728   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1729   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1730   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
1731   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1732   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
1733   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
1734   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
1735614
1736   PORT_START_TAG("IN1")
1737   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1738   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1739   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1740   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1741   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1742   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1743   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
1744   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
1745   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1746//  PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
1747   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
1748615
1749   PORT_START_TAG("DSW0")
1750   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
1751   PORT_DIPSETTING(    0x00, "1" )
1752   PORT_DIPSETTING(    0x01, "2" )
1753   PORT_DIPSETTING(    0x02, "3" )
1754   PORT_DIPSETTING(    0x03, "4" )
1755   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
1756   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1757   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1758   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Bonus_Life ) )
1759   PORT_DIPSETTING(    0x08, "500000" )
1760   PORT_DIPSETTING(    0x00, "750000" )
1761   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1762INPUT_PORTS_END
616/*************************************
617 *
618 *  Frog (Falcon) I/O
619 *
620 *************************************/
1763621
1764static INPUT_PORTS_START( redufo )
1765GAL_IN0
622static READ8_HANDLER( frogf_ppi8255_r )
623{
624   /* the decoding here is very simplistic, and you can address both simultaneously */
625   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);
628   return result;
629}
1766630
1767   PORT_START_TAG("IN1")
1768   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1769   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1770   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
1771   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
1772   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1773   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
1774   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
1775   PORT_DIPSETTING(    0x40, "A 2C/1C  B 1C/3C" )
1776   PORT_DIPSETTING(    0x00, "A 1C/1C  B 1C/6C" )
1777   PORT_DIPSETTING(    0x80, "A 1C/2C  B 1C/12C" )
1778   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
1779631
1780   PORT_START_TAG("DSW0")
1781   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) )
1782   PORT_DIPSETTING(    0x01, "4000" )
1783   PORT_DIPSETTING(    0x02, "5000" )
1784   PORT_DIPSETTING(    0x03, "7000" )
1785   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1786   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
1787   PORT_DIPSETTING(    0x00, "3" )
1788   PORT_DIPSETTING(    0x04, "5" )
1789   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
1790   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1791INPUT_PORTS_END
632static WRITE8_HANDLER( frogf_ppi8255_w )
633{
634   /* 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);
637}
1792638
1793static INPUT_PORTS_START( exodus )
1794   PORT_START_TAG("IN0")
1795   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1796   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1797   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
1798   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1799   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1800   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
1801   PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
1802   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )      // Not tested due to code removed at 0x1901 and 0x191a
1803639
1804   PORT_START_TAG("IN1")
1805   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1806   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1807   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
1808   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
1809   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1810   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
1811   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_B ) )
1812   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
1813   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
1814   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coin_A ) )
1815   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
1816   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
1817640
1818   PORT_START_TAG("DSW0")
1819   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
1820   PORT_DIPSETTING(    0x00, "7000" )
1821   PORT_DIPSETTING(    0x01, DEF_STR( None ) )
1822   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) )      // Not read due to code at 0x012b
1823   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1824   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1825   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
1826   PORT_DIPSETTING(    0x00, "3" )
1827   PORT_DIPSETTING(    0x04, "5" )
1828   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
1829   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1830   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
1831   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1832INPUT_PORTS_END
641/*************************************
642 *
643 *  Turtles I/O
644 *
645 *************************************/
1833646
1834static INPUT_PORTS_START( streakng )
1835   PORT_START_TAG("IN0")
1836   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1837   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_4WAY PORT_COCKTAIL
1838   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
1839   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1840   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
1841   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
1842   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1843   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
1844   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
1845   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
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); }
1846651
1847   PORT_START_TAG("IN1")
1848   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1849   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1850   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
1851   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1852   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
1853   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
1854   PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Bonus_Life ) )
1855   PORT_DIPSETTING(    0x40, "10000" )
1856   PORT_DIPSETTING(    0x80, "15000" )
1857   PORT_DIPSETTING(    0xc0, "20000" )
1858   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1859652
1860   PORT_START_TAG("DSW0")
1861   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Coinage ) )
1862   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
1863   PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
1864   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
1865   PORT_DIPSETTING(    0x03, DEF_STR( Free_Play ) )
1866   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ) )
1867   PORT_DIPSETTING(    0x0c, "1" )
1868   PORT_DIPSETTING(    0x08, "2" )
1869   PORT_DIPSETTING(    0x04, "3" )
1870   PORT_DIPSETTING(    0x00, "5" )
1871   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1872INPUT_PORTS_END
1873653
1874static INPUT_PORTS_START( pacmanbl )
1875   PORT_START_TAG("IN0")
1876   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1877   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1878   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
1879   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1880   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
1881   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
1882   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
1883   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
654/*************************************
655 *
656 *  Scorpion sound I/O
657 *
658 *************************************/
1884659
1885   PORT_START_TAG("IN1")
1886   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1887   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1888   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
1889   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1890   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
1891   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
1892   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_A ) )
1893   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
1894   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
1895   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coin_B ) )
1896   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
1897   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
660static READ8_HANDLER( scorpion_ay8910_r )
661{
662   /* the decoding here is very simplistic, and you can address both simultaneously */
663   UINT8 result = 0xff;
664   if (offset & 0x08) result &= AY8910_read_port_2_r(machine, 0);
665   if (offset & 0x20) result &= AY8910_read_port_0_r(machine, 0);
666   if (offset & 0x80) result &= AY8910_read_port_1_r(machine, 0);
667   return result;
668}
1898669
1899   PORT_START_TAG("DSW0")
1900   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
1901   PORT_DIPSETTING(    0x00, "15000" )
1902   PORT_DIPSETTING(    0x01, "20000" )
1903   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Difficulty ) )
1904   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
1905   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
1906   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
1907   PORT_DIPSETTING(    0x00, "3" )
1908   PORT_DIPSETTING(    0x04, "5" )
1909   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
1910   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1911   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
1912   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1913INPUT_PORTS_END
1914670
1915static INPUT_PORTS_START( devilfsg )
1916   PORT_START_TAG("IN0")
1917   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1918   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1919   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
1920   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1921   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1922   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
1923   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
1924   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
671static WRITE8_HANDLER( scorpion_ay8910_w )
672{
673   /* the decoding here is very simplistic, and you can address all six simultaneously */
674   if (offset & 0x04) AY8910_control_port_2_w(machine, 0, data);
675   if (offset & 0x08) AY8910_write_port_2_w(machine, 0, data);
676   if (offset & 0x10) AY8910_control_port_0_w(machine, 0, data);
677   if (offset & 0x20) AY8910_write_port_0_w(machine, 0, data);
678   if (offset & 0x40) AY8910_control_port_1_w(machine, 0, data);
679   if (offset & 0x80) AY8910_write_port_1_w(machine, 0, data);
680}
1925681
1926   PORT_START_TAG("IN1")
1927   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1928   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1929   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
1930   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1931   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1932   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
1933   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_A ) )
1934   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
1935   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
1936   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coin_B ) )
1937   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
1938   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
1939682
1940   PORT_START_TAG("DSW0")
1941   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
1942   PORT_DIPSETTING(    0x00, "10000" )
1943   PORT_DIPSETTING(    0x01, "15000" )
1944   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
1945   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
1946   PORT_DIPSETTING(    0x00, "4" )
1947   PORT_DIPSETTING(    0x04, "5" )
1948   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
1949   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1950   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
1951   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1952INPUT_PORTS_END
683static READ8_HANDLER( scorpion_protection_r )
684{
685   UINT16 paritybits;
686   UINT8 parity = 0;
1953687
1954static INPUT_PORTS_START( zigzag )
1955   PORT_START_TAG("IN0")
1956   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1957   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1958   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
1959   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1960   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1961   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
1962   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
1963   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
688   /* compute parity of the current (bitmask & $CE29) */
689   for (paritybits = protection_state & 0xce29; paritybits != 0; paritybits >>= 1)
690      if (paritybits & 1)
691         parity++;
1964692
1965   PORT_START_TAG("IN1")
1966   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1967   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1968   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
1969   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1970   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1971   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
1972   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
1973   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
1974   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1975   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
1976   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
693   /* only the low bit matters for protection, but bit 2 is also checked */
694   return parity;
695}
1977696
1978   PORT_START_TAG("DSW0")
1979   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) )
1980   PORT_DIPSETTING(    0x00, "3" )
1981   PORT_DIPSETTING(    0x01, "4" )
1982   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) )
1983   PORT_DIPSETTING(    0x02, DEF_STR( Upright ) )
1984   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
1985   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
1986   PORT_DIPSETTING(    0x00, "10000 60000" )
1987   PORT_DIPSETTING(    0x04, "20000 60000" )
1988   PORT_DIPSETTING(    0x08, "30000 60000" )
1989   PORT_DIPSETTING(    0x0c, "40000 60000" )
1990   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1991INPUT_PORTS_END
1992697
1993static INPUT_PORTS_START( scramblb )
1994   PORT_START_TAG("IN0")
1995   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1996   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1997   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
1998   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1999   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
2000   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
2001   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
2002   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
698static WRITE8_HANDLER( scorpion_protection_w )
699{
700   /* bit 5 low is a reset */
701   if (!(data & 0x20))
702      protection_state = 0x0000;
2003703
2004   PORT_START_TAG("IN1")
2005   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2006   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2007   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
2008   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
2009   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
2010   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
2011   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
2012   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
2013   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
2014   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
704   /* bit 4 low is a clock */
705   if (!(data & 0x10))
706   {
707      /* each clock shifts left one bit and ORs in the inverse of the parity */
708      protection_state = (protection_state << 1) | (~scorpion_protection_r(machine, 0) & 1);
709   }
710}
2015711
2016   PORT_START_TAG("IN2")
2017   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) )
2018   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2019   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
2020   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
2021   PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
2022   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Lives ) )
2023   PORT_DIPSETTING(    0x00, "3" )
2024   PORT_DIPSETTING(    0x04, "4" )
2025   PORT_DIPSETTING(    0x08, "5" )
2026   PORT_DIPSETTING(    0x0c, "255 (Cheat)")
2027   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2028INPUT_PORTS_END
2029712
713static READ8_HANDLER( scorpion_sound_status_r )
714{
715   logerror("%04X:scorpion_sound_status_r()\n", safe_activecpu_get_pc());
716   return 1;
717}
2030718
2031/* the cocktail controls only seem to be used in upright mode, is the flip flag wrong for this bootleg? */
2032static INPUT_PORTS_START( scramb2 )
2033   PORT_START_TAG("IN0")
2034   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
2035   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
2036    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
2037   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
2038   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
2039   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
2040    PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
2041    PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
2042    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2043    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
2044719
2045   PORT_START_TAG("IN1")
2046   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
2047   PORT_DIPSETTING(    0x00, "3" )
2048   PORT_DIPSETTING(    0x01, "4" )
2049   PORT_DIPSETTING(    0x02, "5" )
2050   PORT_DIPSETTING(    0x03, "255 (Cheat)")
2051   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
2052   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
2053   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
2054   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
2055   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
2056   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
720static WRITE8_HANDLER( scorpion_sound_data_w )
721{
722   scorpion_sound_data = data;
723//  logerror("%04X:scorpion_sound_data_w(%02X)\n", safe_activecpu_get_pc(), data);
724}
2057725
2058   PORT_START_TAG("IN2")
2059   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
2060   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
2061   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2062   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
2063   PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )
2064   PORT_DIPSETTING(    0x06, DEF_STR( 1C_4C ) )
2065   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
2066   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
2067   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
2068   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
2069    PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
2070    PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
2071    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2072   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
2073    PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
2074    PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
2075    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2076INPUT_PORTS_END
2077726
727static WRITE8_HANDLER( scorpion_sound_control_w )
728{
729   if (!(data & 0x04))
730      mame_printf_debug("Secondary sound = %02X\n", scorpion_sound_data);
731//  logerror("%04X:scorpion_sound_control_w(%02X)\n", safe_activecpu_get_pc(), data);
732}
2078733
2079static INPUT_PORTS_START( jumpbug )
2080   PORT_START_TAG("IN0")
2081   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2082   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
2083   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
2084   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
2085   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
2086   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
2087   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
2088   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
2089   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
2090   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
2091734
2092   PORT_START_TAG("IN1")
2093   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2094   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2095   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
2096   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
2097   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
2098   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
2099   PORT_DIPNAME( 0x40, 0x00, "Difficulty ?" )
2100   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
2101   PORT_DIPSETTING(    0x40, DEF_STR( Easy ) )
2102   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
2103735
2104   PORT_START_TAG("DSW0")
2105   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
2106   PORT_DIPSETTING(    0x01, "3" )
2107   PORT_DIPSETTING(    0x02, "4" )
2108   PORT_DIPSETTING(    0x03, "5" )
2109   PORT_DIPSETTING(    0x00, "Infinite (Cheat)")
2110   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )
2111   PORT_DIPSETTING(    0x04, "A 2C/1C  B 2C/1C" )
2112   PORT_DIPSETTING(    0x08, "A 2C/1C  B 1C/3C" )
2113   PORT_DIPSETTING(    0x00, "A 1C/1C  B 1C/1C" )
2114   PORT_DIPSETTING(    0x0c, "A 1C/1C  B 1C/6C" )
2115   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2116INPUT_PORTS_END
736/*************************************
737 *
738 *  Ghostmuncher Galaxian I/O
739 *
740 *************************************/
2117741
2118static INPUT_PORTS_START( levers )
2119   PORT_START_TAG("IN0")
2120   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2121   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
2122   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
2123   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2124   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2125   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2126   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
2127   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
742static INPUT_CHANGED( gmgalax_game_changed )
743{
744   /* new value is the selected game */
745   gmgalax_selected_game = newval;
2128746
2129   PORT_START_TAG("IN1")
2130   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2131   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2132   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
2133   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
2134   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2135   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
2136   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2137   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
747   /* select the bank and graphics bank based on it */
748   memory_set_bank(1, gmgalax_selected_game);
749   galaxian_gfxbank_w(machine, 0, gmgalax_selected_game);
2138750
2139   PORT_START_TAG("DSW0")
2140   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )   /* probably unused */
2141   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2142   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2143   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )  /* probably unused */
2144   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2145   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2146   PORT_DIPNAME( 0x04, 0x00, "Leave On")   /* used - MUST be ON */
2147   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
2148   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2149   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Free_Play ) )
2150   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2151   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
2152   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )   /* probably unused */
2153   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
2154   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2155   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )  /* probably unused */
2156   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
2157   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2158   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )   /* probably unused */
2159   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2160   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2161   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )   /* probably unused */
2162   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2163   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2164INPUT_PORTS_END
751   /* reset the starts */
752   galaxian_stars_enable_w(machine, 0, 0);
2165753
2166static INPUT_PORTS_START( azurian )
2167   PORT_START_TAG("IN0")
2168   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
2169   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
2170   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
2171   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
2172   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 )
2173   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 )
2174   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
2175   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
754   /* reset the CPU */
755   cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE);
756}
2176757
2177   PORT_START_TAG("IN1")
2178   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2179   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2180   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
2181   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
2182   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
2183   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
2184   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL )      /* "linked" with bit 2 of IN2 */
2185   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Lives ) )
2186   PORT_DIPSETTING(    0x00, "3" )
2187   PORT_DIPSETTING(    0x80, "5" )
2188758
2189   PORT_START_TAG("IN2")
2190   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) )
2191   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
2192   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2193   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Bonus_Life ) )
2194   PORT_DIPSETTING(    0x00, "5000" )
2195   PORT_DIPSETTING(    0x02, "7000" )
2196   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL )      /* "linked" with bit 6 of IN1 */
2197   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
2198   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
2199   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
2200   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
759static CUSTOM_INPUT( gmgalax_port_r )
760{
761   const char *portname = param;
762   if (gmgalax_selected_game != 0)
763      portname += strlen(portname) + 1;
764   return readinputportbytag(portname);
765}
2201766
2202   PORT_START_TAG("FAKE")      /* fake port to handle routine at 0x05b3 that stores value at 0x40f4 */
2203   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Difficulty ) )
2204   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
2205   PORT_DIPSETTING(    0x01, DEF_STR( Normal ) )
2206   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
2207   PORT_DIPSETTING(    0x00, DEF_STR( Very_Hard ) )
2208INPUT_PORTS_END
2209767
2210static INPUT_PORTS_START( orbitron )
2211   PORT_START_TAG("IN0")
2212   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2213   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
2214   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
2215   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
2216   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
2217   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
2218   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
2219   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
2220768
2221   PORT_START_TAG("IN1")
2222   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2223   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2224   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
2225   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
2226   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
2227   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Coinage ) )      /* Routine at 0x00e1 */
2228   PORT_DIPSETTING(    0x00, "A 2C/1C  B 1C/3C" )
2229//  PORT_DIPSETTING(    0x20, "A 2C/1C  B 1C/3C" )
2230   PORT_DIPSETTING(    0x40, "A 1C/1C  B 1C/6C" )
2231//  PORT_DIPSETTING(    0x60, "A 1C/1C  B 1C/6C" )
2232   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
769/*************************************
770 *
771 *  Zig Zag I/O
772 *
773 *************************************/
2233774
2234   PORT_START_TAG("DSW0")
2235   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) )
2236   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2237   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
2238   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) )
2239   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2240   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
2241   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
2242   PORT_DIPSETTING(    0x04, "2" )
2243   PORT_DIPSETTING(    0x00, "3" )
2244   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
2245   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
2246   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
2247   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2248INPUT_PORTS_END
775static WRITE8_HANDLER( zigzag_bankswap_w )
776{
777   memory_set_bank(1, data & 1);
778   memory_set_bank(2, ~data & 1);
779}
2249780
2250static INPUT_PORTS_START( blkhole )
2251   PORT_START_TAG("IN0")
2252   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2253   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
2254   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
2255   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
2256   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
2257   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2258   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
2259   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
2260781
2261   PORT_START_TAG("IN1")
2262   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2263   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2264   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
2265   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
2266   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
2267   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2268   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
2269   PORT_DIPSETTING(    0xc0, DEF_STR( 2C_1C ) )
2270   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2271   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
2272   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
782static WRITE8_HANDLER( zigzag_ay8910_w )
783{
784   switch (offset & 0x300)
785   {
786      case 0x000:
787         /* control lines */
788         /* bit 0 = WRITE */
789         /* bit 1 = C/D */
790         if ((offset & 1) != 0)
791         {
792            if ((offset & 2) == 0)
793               AY8910_write_port_0_w(machine, 0, zigzag_ay8910_latch);
794            else
795               AY8910_control_port_0_w(machine, 0, zigzag_ay8910_latch);
796         }
797         break;
2273798
2274   PORT_START_TAG("DSW0")
2275   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
2276   PORT_DIPSETTING(    0x00, "5000" )
2277   PORT_DIPSETTING(    0x01, "10000" )
2278   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) )
2279   PORT_DIPSETTING(    0x02, DEF_STR( Upright ) )
2280   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
2281   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
2282   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2283   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
2284   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
2285   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2286   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
2287   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2288INPUT_PORTS_END
799      case 0x100:
800         /* data latch */
801         zigzag_ay8910_latch = offset & 0xff;
802         break;
2289803
2290static INPUT_PORTS_START( checkman )
2291   PORT_START_TAG("IN0")
2292   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 )
2293   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
2294   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
2295   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
2296   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL PORT_NAME("P2 Tiles Right")
2297   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
2298   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL
2299   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
804      case 0x200:
805         /* unknown */
806         break;
807   }
808}
2300809
2301   PORT_START_TAG("IN1")
2302   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Start 1 / P1 Tiles Left")/* also p1 tiles left */
2303   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("Start 2 / P1 Tiles Right")/* also p1 tiles right */
2304   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
2305   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
2306   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL PORT_NAME("P2 Tiles Left")/* p2 tiles left */
2307   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL
2308   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coinage ) )
2309   PORT_DIPSETTING(    0x40, "A 2C/1C  B 1C/3C" )
2310   PORT_DIPSETTING(    0x00, "A 1C/1C  B 1C/6C" )
2311   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
2312   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
2313   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
2314810
2315   PORT_START_TAG("DSW0")
2316   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
2317   PORT_DIPSETTING(    0x00, "3" )
2318   PORT_DIPSETTING(    0x01, "4" )
2319   PORT_DIPSETTING(    0x02, "5" )
2320   PORT_DIPSETTING(    0x03, "6" )
2321   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Bonus_Life ) )
2322   PORT_DIPSETTING(    0x00, "100000" )
2323   PORT_DIPSETTING(    0x04, "200000" )
2324   PORT_DIPNAME( 0x08, 0x00, "Difficulty Increases At Level" )
2325   PORT_DIPSETTING(    0x08, "3" )
2326   PORT_DIPSETTING(    0x00, "5" )
2327   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2328INPUT_PORTS_END
2329811
2330static INPUT_PORTS_START( checkmaj )
2331   PORT_START_TAG("IN0")
2332   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2333   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
2334   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
2335   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
2336   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
2337   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_COCKTAIL PORT_NAME("P2 Tiles Right")
2338   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL
2339   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
812/*************************************
813 *
814 *  Azurian I/O
815 *
816 *************************************/
2340817
2341   PORT_START_TAG("IN1")
2342   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2343   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2344   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
2345   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
2346   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL
2347   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_COCKTAIL PORT_NAME("P2 Tiles Left")
2348   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coinage ) )
2349   PORT_DIPSETTING(    0x40, "A 2C/1C  B 1C/3C" )
2350   PORT_DIPSETTING(    0x00, "A 1C/1C  B 1C/6C" )
2351   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
2352   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
2353   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
818static CUSTOM_INPUT( azurian_port_r )
819{
820   return (readinputportbytag("FAKE") >> (FPTR)param) & 1;
821}
2354822
2355   PORT_START_TAG("DSW")
2356    PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
2357   PORT_DIPSETTING(    0x00, "3" )
2358   PORT_DIPSETTING(    0x01, "4" )
2359   PORT_DIPSETTING(    0x02, "5" )
2360   PORT_DIPSETTING(    0x03, "6" )
2361   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Bonus_Life ) )
2362   PORT_DIPSETTING(    0x00, "100000" )
2363   PORT_DIPSETTING(    0x04, "200000" )
2364   PORT_DIPNAME( 0x08, 0x00, "Difficulty Increases At Level" )
2365   PORT_DIPSETTING(    0x08, "3" )
2366   PORT_DIPSETTING(    0x00, "5" )
2367   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Tiles Right")
2368   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Tiles Left")
2369INPUT_PORTS_END
2370823
2371static INPUT_PORTS_START( dingo )
2372   PORT_START_TAG("IN0")
2373   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2374   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
2375   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
2376   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
2377   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
2378   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL   /* 1st Button 1 */
2379   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL
2380   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
2381824
2382   PORT_START_TAG("IN1")
2383   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2384   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2385   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
2386   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
2387   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL
2388   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL   /* 2nd Button 1 */
2389   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
2390   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
2391   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
2392   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coinage ) )
2393   PORT_DIPSETTING(    0x80, "A 1C/1C  B 1C/5C" )
2394   PORT_DIPSETTING(    0x00, "A 2C/1C  B 1C/3C" )
825/*************************************
826 *
827 *  King & Balloon I/O
828 *
829 *************************************/
2395830
2396   PORT_START_TAG("DSW")
2397   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Difficulty ) )
2398   PORT_DIPSETTING(    0x00, DEF_STR( Easiest ) )
2399   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
2400   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
2401   PORT_DIPSETTING(    0x03, DEF_STR( Hardest ) )
2402    PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
2403   PORT_DIPSETTING(    0x00, "3" )
2404   PORT_DIPSETTING(    0x04, "4" )
2405   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )
2406   PORT_DIPSETTING(    0x00, "20000" )
2407   PORT_DIPSETTING(    0x08, "40000" )
2408   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )   /* Yes, the game reads both of these */
2409   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 )   /* Check code at 0x22e1 */
2410INPUT_PORTS_END
831static CUSTOM_INPUT( kingball_muxbit_r )
832{
833   /* multiplex the service mode switch with a speech DIP switch */
834   return (readinputportbytag("FAKE") >> kingball_speech_dip) & 1;
835}
2411836
2412#define MOON_IN0\
2413   PORT_START_TAG("IN0")\
2414   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )\
2415   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )\
2416   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY\
2417   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY\
2418   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )\
2419   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )\
2420   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )\
2421   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )\
2422   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* "reset" on schematics */\
2423   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
2424837
2425static INPUT_PORTS_START( mooncrst )
2426MOON_IN0
2427   PORT_START_TAG("IN1")
2428   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2429   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2430   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
2431   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
2432   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
2433   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2434   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )
2435   PORT_DIPSETTING(    0x00, "30000" )
2436   PORT_DIPSETTING(    0x40, "50000" )
2437   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )
2438   PORT_DIPSETTING(    0x80, DEF_STR( English ) )
2439   PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
838static CUSTOM_INPUT( kingball_noise_r )
839{
840   /* bit 5 is the NOISE line from the sound circuit.  The code just verifies
841       that it's working, doesn't actually use return value, so we can just use
842       rand() */
843   return mame_rand(machine) & 1;
844}
2440845
2441   PORT_START_TAG("DSW")
2442   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
2443   PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
2444   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
2445   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
2446   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2447   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_B ) )
2448   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2449   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
2450   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
2451   PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
2452   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2453INPUT_PORTS_END
2454846
2455static INPUT_PORTS_START( mooncrsa )
2456MOON_IN0
2457   PORT_START_TAG("IN1")
2458   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2459   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2460   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
2461   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
2462   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
2463   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2464   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )
2465   PORT_DIPSETTING(    0x00, "30000" )
2466   PORT_DIPSETTING(    0x40, "50000" )
2467   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )
2468   PORT_DIPSETTING(    0x80, DEF_STR( English ) )
2469   PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
847static WRITE8_HANDLER( kingball_speech_dip_w )
848{
849   kingball_speech_dip = data;
850}
2470851
2471   PORT_START_TAG("DSW")
2472//  PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )           Not used due to code at 0x01c0
2473//  PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
2474//  PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
2475//  PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
2476//  PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2477   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )
2478   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2479   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
2480   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
2481   PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
2482   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2483INPUT_PORTS_END
2484852
2485static INPUT_PORTS_START( mooncrsg )
2486   PORT_START_TAG("IN0")
2487   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2488   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
2489   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
2490   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
2491   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
2492   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
2493   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
2494   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
2495   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* "reset" on schematics */
2496   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
853static WRITE8_HANDLER( kingball_sound1_w )
854{
855   kingball_sound = (kingball_sound & ~0x01) | data;
856}
2497857
2498   PORT_START_TAG("IN1")
2499   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2500   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2501   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
2502   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
2503   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
2504   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2505   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )
2506   PORT_DIPSETTING(    0x00, "30000" )
2507   PORT_DIPSETTING(    0x40, "50000" )
2508//  PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )         Always non-Japanese due to code at 0x2f77
2509//  PORT_DIPSETTING(    0x80, DEF_STR( English ) )
2510//  PORT_DIPSETTING(    0x00, DEF_STR( English ) )
2511858
2512   PORT_START_TAG("DSW")
2513   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
2514   PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
2515   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
2516   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
2517   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2518   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_B ) )
2519   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2520   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
2521   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
2522   PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
2523   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2524INPUT_PORTS_END
859static WRITE8_HANDLER( kingball_sound2_w )
860{
861   kingball_sound = (kingball_sound & ~0x02) | (data << 1);
862   soundlatch_w(machine, 0, kingball_sound | 0xf0);
863}
2525864
2526static INPUT_PORTS_START( fantazia )
2527MOON_IN0
2528   PORT_START_TAG("IN1")
2529   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2530   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2531   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
2532   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
2533   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
2534   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2535   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )
2536   PORT_DIPSETTING(    0x00, "30000" )
2537   PORT_DIPSETTING(    0x40, "50000" )
2538//  PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )         Always non-Japanese due to code at 0x2f53
2539//  PORT_DIPSETTING(    0x80, DEF_STR( English ) )
2540//  PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
2541865
2542   PORT_START_TAG("DSW")
2543   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_B ) )
2544   PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
2545   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
2546   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
2547   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2548   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_A ) )
2549   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2550   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
2551   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
2552   PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
2553   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2554INPUT_PORTS_END
866static WRITE8_HANDLER( kingball_dac_w )
867{
868   DAC_0_data_w(machine, offset, data ^ 0xff);
869}
2555870
2556static INPUT_PORTS_START( eagle )
2557MOON_IN0
2558   PORT_START_TAG("IN1")
2559   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2560   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2561   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
2562   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
2563   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
2564   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2565   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )
2566   PORT_DIPSETTING(    0x00, "30000" )
2567   PORT_DIPSETTING(    0x40, "50000" )
2568   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )
2569   PORT_DIPSETTING(    0x80, DEF_STR( English ) )
2570   PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
2571871
2572   PORT_START_TAG("DSW")
2573//  PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )           Not used due to code at 0x01c0
2574//  PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
2575//  PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
2576//  PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
2577//  PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2578   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )
2579   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2580   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
2581   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
2582   PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
2583   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2584INPUT_PORTS_END
2585872
2586static INPUT_PORTS_START( eagle2 )
2587MOON_IN0
2588   PORT_START_TAG("IN1")
2589   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2590   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2591   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
2592   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
2593   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
2594   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2595   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )
2596   PORT_DIPSETTING(    0x00, "30000" )
2597   PORT_DIPSETTING(    0x40, "50000" )
2598   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )
2599   PORT_DIPSETTING(    0x80, DEF_STR( English ) )
2600   PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
873/*************************************
874 *
875 *  Moon Shuttle I/O
876 *
877 *************************************/
2601878
2602   PORT_START_TAG("DSW")
2603   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) )
2604   PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
2605   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
2606   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
2607   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2608//  PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_B ) )           Not used due to code at 0x01c0,
2609//  PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )            but "Free Play" is checked
2610//  PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
2611//  PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
2612//  PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
2613   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Free_Play ) )
2614   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2615//  PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
2616//  PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2617   PORT_DIPSETTING(    0x0c, DEF_STR( On ) )
2618   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2619INPUT_PORTS_END
879static WRITE8_HANDLER( mshuttle_ay8910_cs_w )
880{
881   mshuttle_ay8910_cs = data & 1;
882}
2620883
2621static INPUT_PORTS_START( smooncrs )
2622MOON_IN0
2623   PORT_START_TAG("IN1")
2624   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2625   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2626   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )         /* Not read due to code at 0x2b1c and 0x3313 */
2627   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )         /* Not read due to code at 0x2b1c and 0x3313 */
2628   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )         /* Not read due to code at 0x2b1c and 0x3313 */
2629   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2630//  PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )       Always '50000' due to code at 0x2f68
2631//  PORT_DIPSETTING(    0x00, "30000" )
2632//  PORT_DIPSETTING(    0x40, "50000" )
2633//  PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )         Always non-Japanese due to code at 0x2f53
2634//  PORT_DIPSETTING(    0x80, DEF_STR( English ) )
2635//  PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
2636   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )      /* code at 0x2962 */
2637   PORT_DIPSETTING(    0x40, DEF_STR( Easy ) )
2638   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
2639   PORT_DIPNAME( 0x80, 0x80, "Player's Bullet Speed" )      /* code at 0x0007 */
2640   PORT_DIPSETTING(    0x00, "Slow" )
2641   PORT_DIPSETTING(    0x80, "Fast" )
2642884
2643   PORT_START_TAG("DSW")
2644   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )         /* see notes */
2645   PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
2646   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
2647   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
2648   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2649   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_B ) )
2650   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2651   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
2652   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
2653   PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
2654   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2655INPUT_PORTS_END
885static WRITE8_HANDLER( mshuttle_ay8910_control_w )
886{
887   if (!mshuttle_ay8910_cs)
888      AY8910_control_port_0_w(machine, offset, data);
889}
2656890
2657static INPUT_PORTS_START( spcdrag )
2658MOON_IN0
2659   PORT_START_TAG("IN1")
2660   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2661   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2662   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )         /* Not read due to code at 0x2b1c and 0x3313 */
2663   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )         /* Not read due to code at 0x2b1c and 0x3313 */
2664   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )         /* Not read due to code at 0x2b1c and 0x3313 */
2665   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2666//  PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )       Always '50000' due to code at 0x2f68
2667//  PORT_DIPSETTING(    0x00, "30000" )
2668//  PORT_DIPSETTING(    0x40, "50000" )
2669//  PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )         Always non-Japanese due to code at 0x2f53
2670//  PORT_DIPSETTING(    0x80, DEF_STR( English ) )
2671//  PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
2672   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )      /* code at 0x2962 */
2673   PORT_DIPSETTING(    0x40, DEF_STR( Easy ) )
2674   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
2675   PORT_DIPNAME( 0x80, 0x80, "Player's Bullet Speed" )      /* code at 0x0007 */
2676   PORT_DIPSETTING(    0x00, "Slow" )
2677   PORT_DIPSETTING(    0x80, "Fast" )
2678891
2679   PORT_START_TAG("DSW")
2680   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )         /* see notes */
2681   PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
2682   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
2683   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
2684   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2685   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_B ) )
2686   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
2687   PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )
2688   PORT_DIPSETTING(    0x08, DEF_STR( 1C_4C ) )
2689   PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
2690   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2691INPUT_PORTS_END
892static WRITE8_HANDLER( mshuttle_ay8910_data_w )
893{
894   if (!mshuttle_ay8910_cs)
895      AY8910_write_port_0_w(machine, offset, data);
896}
2692897
2693static INPUT_PORTS_START( mooncrgx )
2694   PORT_START_TAG("IN0")
2695   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2696   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
2697   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
2698   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
2699   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
2700   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2701   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
2702   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
2703898
2704   PORT_START_TAG("IN1")
2705   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2706   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2707   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
2708   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
2709   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
2710   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2711   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_A ) )
2712   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
2713   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
2714   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coin_B ) )
2715   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
2716   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
899static READ8_HANDLER( mshuttle_ay8910_data_r )
900{
901   if (!mshuttle_ay8910_cs)
902      return AY8910_read_port_0_r(machine, offset);
903   return 0xff;
904}
2717905
2718   PORT_START_TAG("DSW")
2719   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Bonus_Life ) )
2720   PORT_DIPSETTING(    0x01, "30000" )
2721   PORT_DIPSETTING(    0x00, "50000" )
2722   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) )
2723   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2724   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
2725//  PORT_DIPNAME( 0x04, 0x04, DEF_STR( Language ) )         Always non-Japanese due to code removed at 0x2f4b
2726//  PORT_DIPSETTING(    0x04, DEF_STR( English ) )
2727//  PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
2728   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
2729   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
2730   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
2731   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2732INPUT_PORTS_END
2733906
2734static INPUT_PORTS_START( skybase )
2735   PORT_START_TAG("IN0")
2736   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2737   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
2738   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
2739   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
2740   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
2741   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Cabinet ) )
2742   PORT_DIPSETTING(    0x20, DEF_STR( Upright ) )
2743   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
2744   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
2745   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
2746907
2747   PORT_START_TAG("IN1")
2748   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2749   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2750   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
2751   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
2752   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
2753   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2754    PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
2755   PORT_DIPSETTING(    0x80, "1C/1C (2 to start)" )
2756   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2757   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
2758   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
908/*************************************
909 *
910 *  Jump Bug I/O
911 *
912 *************************************/
2759913
2760   PORT_START_TAG("IN2")
2761   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
2762   PORT_DIPSETTING(    0x00, "3" )
2763   PORT_DIPSETTING(    0x01, "4" )
2764   PORT_DIPSETTING(    0x02, "5" )
2765   PORT_DIPSETTING(    0x03, "Infinite (Cheat)")
2766   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
2767   PORT_DIPSETTING(    0x00, "10000" )
2768   PORT_DIPSETTING(    0x04, "15000" )
2769   PORT_DIPSETTING(    0x08, "20000" )
2770   PORT_DIPSETTING(    0x0c, DEF_STR( None ) )
2771   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
2772   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2773   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 )
2774   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
2775INPUT_PORTS_END
914static READ8_HANDLER( jumpbug_protection_r )
915{
916   switch (offset)
917   {
918      case 0x0114:  return 0x4f;
919      case 0x0118:  return 0xd3;
920      case 0x0214:  return 0xcf;
921      case 0x0235:  return 0x02;
922      case 0x0311:  return 0xff;  /* not checked */
923   }
924   logerror("Unknown protection read. Offset: %04X  PC=%04X\n",0xb000+offset,activecpu_get_pc());
925   return 0xff;
926}
2776927
2777static INPUT_PORTS_START( omega )
2778   PORT_START_TAG("IN0")
2779   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2780   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
2781   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
2782   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
2783   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
2784   PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED )
2785928
2786   PORT_START_TAG("IN1")
2787   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2788   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2789   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
2790   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
2791   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
2792   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2793   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_A ) )
2794   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
2795   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
2796   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coin_B ) )
2797   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
2798   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
2799929
2800   PORT_START_TAG("DSW")
2801   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
2802   PORT_DIPSETTING(    0x00, "10000" )
2803   PORT_DIPSETTING(    0x01, "20000" )
2804   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
2805   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
2806   PORT_DIPSETTING(    0x00, "3" )
2807   PORT_DIPSETTING(    0x04, "5" )
2808   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
2809   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
2810   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
2811   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2812INPUT_PORTS_END
930/*************************************
931 *
932 *  Checkman I/O
933 *
934 *************************************/
2813935
2814static INPUT_PORTS_START( moonqsr )
2815   PORT_START_TAG("IN0")
2816   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2817   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
2818   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
2819   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
2820   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
2821   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
2822   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
2823   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
2824   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* "reset" on schematics */
2825   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
936static WRITE8_HANDLER( checkman_sound_command_w )
937{
938   soundlatch_w(machine, 0, data);
939   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
940}
2826941
2827   PORT_START_TAG("IN1")
2828   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2829   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2830   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
2831   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
2832   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
2833   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2834   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Difficulty ) )
2835   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
2836   PORT_DIPSETTING(    0x40, DEF_STR( Medium ) )
2837   PORT_DIPSETTING(    0x80, DEF_STR( Hard ) )
2838   PORT_DIPSETTING(    0xc0, DEF_STR( Hardest ) )
2839942
2840   PORT_START_TAG("DSW")
2841   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
2842   PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
2843   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
2844   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
2845   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2846   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_B ) )
2847   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2848   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
2849   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
2850   PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
2851   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2852INPUT_PORTS_END
943static TIMER_CALLBACK( checkmaj_irq0_gen )
944{
945   cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
946}
2853947
2854static INPUT_PORTS_START( moonal2 )
2855GAL_IN0
2856GAL_IN1
2857   PORT_START_TAG("DSW")
2858   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ) )
2859   PORT_DIPSETTING(    0x01, "4000" )
2860   PORT_DIPSETTING(    0x02, "5000" )
2861   PORT_DIPSETTING(    0x03, "7000" )
2862   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
2863   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
2864   PORT_DIPSETTING(    0x00, "3" )
2865   PORT_DIPSETTING(    0x04, "5" )
2866   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
2867   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2868   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
2869   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2870INPUT_PORTS_END
2871948
2872static INPUT_PORTS_START( mshuttle )
2873   PORT_START_TAG("IN0")
2874   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
2875   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
2876   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
2877   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
2878   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
2879   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
2880   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2881   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
949static READ8_HANDLER( checkmaj_protection_r )
950{
951   switch (activecpu_get_pc())
952   {
953      case 0x0f15:  return 0xf5;
954      case 0x0f8f:  return 0x7c;
955      case 0x10b3:  return 0x7c;
956      case 0x10e0:  return 0x00;
957      case 0x10f1:  return 0xaa;
958      case 0x1402:  return 0xaa;
959      default:
960         logerror("Unknown protection read. PC=%04X\n",activecpu_get_pc());
961   }
2882962
2883   PORT_START_TAG("IN1")
2884   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2885   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2886   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL
2887   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL
2888   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
2889   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
2890   PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
2891   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )
2892   PORT_DIPSETTING(    0x80, DEF_STR( Upright ) )
2893   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
963   return 0;
964}
2894965
2895   PORT_START_TAG("DSW")
2896   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
2897   PORT_DIPSETTING(    0x00, "3" )
2898   PORT_DIPSETTING(    0x01, "4" )
2899   PORT_DIPSETTING(    0x02, "5" )
2900   PORT_DIPSETTING(    0x03, "6" )
2901   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Bonus_Life ) )
2902   PORT_DIPSETTING(    0x00, "20000" )
2903   PORT_DIPSETTING(    0x04, "30000" )
2904   PORT_DIPNAME( 0x18, 0x00, DEF_STR( Coin_A ) )
2905   PORT_DIPSETTING(    0x18, DEF_STR( 4C_1C ) )
2906   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
2907   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
2908   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2909   PORT_DIPNAME( 0x60, 0x00, DEF_STR( Coin_B ) )
2910   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2911   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
2912   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
2913   PORT_DIPSETTING(    0x60, DEF_STR( 1C_4C ) )
2914   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
2915   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2916   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
2917INPUT_PORTS_END
2918966
2919static INPUT_PORTS_START( kingball )
2920GAL_IN0
2921   /* Relating to above port:Hack? - possibly multiplexed via writes to $b003 */
2922   //PORT_DIPNAME( 0x80, 0x80, "Speech" )
2923   //PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2924   //PORT_DIPSETTING(    0x80, DEF_STR( On ) )
2925967
2926   PORT_START_TAG("IN1")
2927   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2928   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2929   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
2930   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
2931   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
2932   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* NOISE line */
2933   PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Coinage ) )
2934   PORT_DIPSETTING(    0xc0, DEF_STR( 2C_1C ) )
2935   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
2936   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
2937   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
968/*************************************
969 *
970 *  Dingo I/O
971 *
972 *************************************/
2938973
2939   PORT_START_TAG("DSW")
2940   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ) )
2941   PORT_DIPSETTING(    0x00, "10000" )
2942   PORT_DIPSETTING(    0x01, "12000" )
2943   PORT_DIPSETTING(    0x02, "15000" )
2944   PORT_DIPSETTING(    0x03, DEF_STR( None ) )
2945   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )
2946   PORT_DIPSETTING(    0x00, "2" )
2947   PORT_DIPSETTING(    0x04, "3" )
2948   PORT_DIPNAME( 0xf8, 0x00, DEF_STR( Unknown ) )
2949   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2950   PORT_DIPSETTING(    0xf8, DEF_STR( On ) )
974static READ8_HANDLER( dingo_3000_r )
975{
976   return 0xaa;
977}
2951978
2952   PORT_START_TAG("FAKE")
2953   /* Hack? - possibly multiplexed via writes to $b003 - marked as SLAM */
2954   PORT_DIPNAME( 0x01, 0x01, "Speech" )
2955   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2956   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
2957INPUT_PORTS_END
2958979
2959static INPUT_PORTS_START( scorpnmc )
2960   PORT_START_TAG("IN0")      /* 0xa000 */
2961   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 )      // COIN2? (it ALWAYS adds 1 credit)
2962   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
2963   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
2964   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
2965   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
2966   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
2967   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
2968   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
980static READ8_HANDLER( dingo_3035_r )
981{
982   return 0x8c;
983}
2969984
2970   PORT_START_TAG("IN1")      /* 0xa800 */
2971   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Start 1 / P1 Button 1")      /* also P1 Button 1 */
2972   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("Start 2 / P1 Button 2")      /* also P1 Button 2 */
2973   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
2974   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
2975   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
2976   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
2977   PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Difficulty ) )   // Check code at 0x0118
2978   PORT_DIPSETTING(   0x00, DEF_STR( Easy ) )
2979   PORT_DIPSETTING(   0x40, DEF_STR( Normal ) )
2980   PORT_DIPSETTING(   0x80, DEF_STR( Hard ) )
2981   PORT_DIPSETTING(   0xc0, DEF_STR( Hardest ) )
2982985
2983   PORT_START_TAG("DSW0")      /* DSW0? - 0xb001 */
2984   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
2985   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
2986   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ) )      // Check code at 0x00eb
2987   PORT_DIPSETTING(   0x00, "2" )
2988   PORT_DIPSETTING(   0x04, "3" )
2989   PORT_DIPSETTING(   0x08, "4" )
2990   PORT_DIPSETTING(   0x0c, "5" )
2991   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
2992   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2993   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
2994   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
986static READ8_HANDLER( dingoe_3001_r )
987{
988   return 0xaa;
989}
2995990
2996   PORT_START_TAG("DSW1")      /* DSW1? - 0xb002 */
2997   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )      // Check code at 0x00fe
2998   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
2999   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
3000   PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
3001   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
3002   PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
3003   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
3004   PORT_DIPSETTING(    0x06, DEF_STR( 1C_3C ) )
3005   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
3006   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
3007   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
3008   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
3009   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
3010INPUT_PORTS_END
3011991
3012static INPUT_PORTS_START( frogg )
3013   PORT_START_TAG("IN0")
3014   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
3015   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
3016   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
3017   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
3018   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
3019   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_SPECIAL )      // See notes
3020   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
3021   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
3022992
3023   PORT_START_TAG("IN1")
3024   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
3025   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
3026   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
3027   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
3028   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
3029   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_SPECIAL )      // See notes
3030   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) )
3031   PORT_DIPSETTING(   0xc0, "3" )
3032   PORT_DIPSETTING(   0x40, "5" )
3033   PORT_DIPSETTING(   0x80, "7" )
3034   PORT_DIPSETTING(   0x00, "255 (Cheat)")
993/*************************************
994 *
995 *  Memory maps
996 *
997 *************************************/
3035998
3036   PORT_START_TAG("DSW0")
3037   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )      // also affects coinage (see 'res' intruction at 0x3084)
3038   PORT_DIPSETTING(   0x01, DEF_STR( Upright ) )
3039   PORT_DIPSETTING(   0x00, DEF_STR( Cocktail ) )
3040   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) )      // not tested due to code at 0x3084
3041   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3042   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
3043   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Coinage ) )      // when "Cabinet" Dip Switch set to "Upright"
3044   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )      // "A 1/1 B 1/6" if "Cabinet" Dip Switch set to "Cocktail"
3045   PORT_DIPSETTING(    0x04, DEF_STR( 1C_1C ) )      // "A 2/1 B 1/3" if "Cabinet" Dip Switch set to "Cocktail"
3046   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
3047   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
3048   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
3049   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
3050   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
3051INPUT_PORTS_END
999/*
10000000-3fff
30521001
3053static INPUT_PORTS_START( 4in1 )
3054   PORT_START_TAG("IN0")
3055   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
3056   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
3057   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
3058   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
3059   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
3060   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
3061   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
3062   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
3063   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
3064   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
30651002
3066   PORT_START_TAG("IN1")
3067   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
3068   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
3069   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
3070   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
3071   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
3072   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
3073   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_SPECIAL )   // See fake ports
10034000-7fff
1004  4000-47ff -> RAM read/write (10 bits = 0x400)
1005  4800-4fff -> n/c
1006  5000-57ff -> /VRAM RD or /VRAM WR (10 bits = 0x400)
1007  5800-5fff -> /OBJRAM RD or /OBJRAM WR (8 bits = 0x100)
1008  6000-67ff -> /SW0 or /DRIVER
1009  6800-6fff -> /SW1 or /SOUND
1010  7000-77ff -> /DIPSW or LATCH
1011  7800-7fff -> /WDR or /PITCH
30741012
3075   PORT_START_TAG("DSW0")
3076   PORT_BIT( 0x3b, IP_ACTIVE_HIGH, IPT_SPECIAL )   // See fake ports
3077   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
3078   PORT_DIPSETTING(    0x00, "3" )         // 2 when continue (Scramble PT2)
3079   PORT_DIPSETTING(    0x04, "5" )         // 2 when continue (Scramble PT2)
3080   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
1013/DRIVER: (write 6000-67ff)
1014  D0 = data bit
1015  A0-A2 = decoder
1016  6000 -> 1P START
1017  6001 -> 2P START
1018  6002 -> COIN LOCKOUT
1019  6003 -> COIN COUNTER
1020  6004 -> 1M resistor (controls 555 timer @ 9R)
1021  6005 -> 470k resistor (controls 555 timer @ 9R)
1022  6006 -> 220k resistor (controls 555 timer @ 9R)
1023  6007 -> 100k resistor (controls 555 timer @ 9R)
30811024
3082   PORT_START_TAG("FAKE1")      /* The Ghost Muncher PT3 - FAKE DSW0 (bits 0 to 5) and IN1 (bits 6 and 7) */
3083   PORT_DIPNAME( 0x03, 0x00, "Bonus Life (GM PT3)" )
3084   PORT_DIPSETTING(    0x01, "10000" )
3085   PORT_DIPSETTING(    0x02, "15000" )
3086   PORT_DIPSETTING(    0x03, "20000" )
3087   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
3088   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL )   // Lives
3089//  PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
3090//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3091//  PORT_DIPSETTING(    0x08, DEF_STR( On ) )
3092//  PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) )
3093//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3094//  PORT_DIPSETTING(    0x10, DEF_STR( On ) )
3095//  PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) )
3096//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3097//  PORT_DIPSETTING(    0x20, DEF_STR( On ) )
3098   PORT_DIPNAME( 0xc0, 0x00, "Coinage (GM PT3)" )
3099   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
3100   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
3101   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
3102   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
1025/SOUND: (write 6800-6fff)
1026  D0 = data bit
1027  A0-A2 = decoder
1028  6800 -> FS1 (enables 555 timer at 8R)
1029  6801 -> FS2 (enables 555 timer at 8S)
1030  6802 -> FS3 (enables 555 timer at 8T)
1031  6803 -> HIT
1032  6804 -> n/c
1033  6805 -> FIRE
1034  6806 -> VOL1
1035  6807 -> VOL2
31031036
3104   PORT_START_TAG("FAKE2")      /* Scramble PT2 - FAKE DSW0 (bits 0 to 5) and IN1 (bits 6 and 7) */
3105//  PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) )
3106//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3107//  PORT_DIPSETTING(    0x01, DEF_STR( On ) )
3108//  PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) )
3109//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3110//  PORT_DIPSETTING(    0x02, DEF_STR( On ) )
3111   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL )   // Lives
3112   PORT_DIPNAME( 0x08, 0x00, "Allow Continue (S PT2)" )
3113   PORT_DIPSETTING(    0x08, DEF_STR( No ) )
3114   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
3115   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )   // Scramble PT2 - Check code at 0x00c2
3116   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3117   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
3118   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )   // Scramble PT2 - Check code at 0x00cc
3119   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3120   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
3121   PORT_DIPNAME( 0xc0, 0x00, "Coinage (S PT2)" )
3122   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
3123   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
3124   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
3125   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
1037LATCH: (write 7000-77ff)
1038  D0 = data bit
1039  A0-A2 = decoder
1040  7000 -> n/c
1041  7001 -> NMI ON
1042  7002 -> n/c
1043  7003 -> n/c
1044  7004 -> STARS ON
1045  7005 -> n/c
1046  7006 -> HFLIP
1047  7007 -> VFLIP
31261048
3127   PORT_START_TAG("FAKE3")      /* Galaxian PT5 - FAKE DSW0 (bits 0 to 5) and IN1 (bits 6 and 7) */
3128   PORT_DIPNAME( 0x03, 0x00, "Bonus Life (G PT5)" )
3129   PORT_DIPSETTING(    0x01, "4000" )
3130   PORT_DIPSETTING(    0x02, "5000" )
3131   PORT_DIPSETTING(    0x03, "7000" )
3132   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
3133   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL )   // Lives
3134//  PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
3135//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3136//  PORT_DIPSETTING(    0x08, DEF_STR( On ) )
3137//  PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) )
3138//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3139//  PORT_DIPSETTING(    0x10, DEF_STR( On ) )
3140//  PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) )
3141//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3142//  PORT_DIPSETTING(    0x20, DEF_STR( On ) )
3143   PORT_DIPNAME( 0xc0, 0x00, "Coinage (G PT5)" )
3144   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
3145   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
3146//  PORT_DIPSETTING(    0x80, DEF_STR( 1C_1C ) )
3147   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
3148
3149   PORT_START_TAG("FAKE4")      /* Galactic Convoy - FAKE DSW0 (bits 0 to 5) and IN1 (bits 6 and 7) */
3150   PORT_DIPNAME( 0x01, 0x00, "Bonus Life (GC)" )
3151   PORT_DIPSETTING(    0x00, "50000" )
3152   PORT_DIPSETTING(    0x01, "80000" )
3153//  PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) )
3154//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3155//  PORT_DIPSETTING(    0x02, DEF_STR( On ) )
3156   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL )   // Lives
3157//  PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
3158//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3159//  PORT_DIPSETTING(    0x08, DEF_STR( On ) )
3160//  PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) )
3161//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3162//  PORT_DIPSETTING(    0x10, DEF_STR( On ) )
3163//  PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) )
3164//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3165//  PORT_DIPSETTING(    0x20, DEF_STR( On ) )
3166   PORT_DIPNAME( 0xc0, 0x00, "Coinage (GC)" )
3167   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
3168   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
3169//  PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )    // 1 credit for 1st coin !
3170   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
3171INPUT_PORTS_END
3172
3173static INPUT_PORTS_START( bagmanmc )
3174   PORT_START_TAG("IN0")
3175   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
3176   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
3177   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
3178   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
3179   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
3180   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
3181   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
3182   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 )
3183
3184   PORT_START_TAG("IN1")
3185   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START2 )
3186   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
3187   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
3188   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
3189   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
3190   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
3191   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3192   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )
3193   PORT_DIPSETTING(   0x80, DEF_STR( Upright ) )
3194   PORT_DIPSETTING(   0x00, DEF_STR( Cocktail ) )
3195
3196   PORT_START_TAG("DSW")
3197   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
3198   PORT_DIPSETTING(   0x03, "2" )
3199   PORT_DIPSETTING(   0x02, "3" )
3200   PORT_DIPSETTING(   0x01, "4" )
3201   PORT_DIPSETTING(   0x00, "5" )
3202   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Coinage ) )
3203   PORT_DIPSETTING(   0x00, "A 2C/1C  B 1C/1C" )
3204   PORT_DIPSETTING(   0x04, "A 1C/1C  B 1C/2C" )
3205   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Difficulty ) )
3206   PORT_DIPSETTING(   0x18, DEF_STR( Easy ) )
3207   PORT_DIPSETTING(   0x10, DEF_STR( Medium ) )
3208   PORT_DIPSETTING(   0x08, DEF_STR( Hard ) )
3209   PORT_DIPSETTING(   0x00, DEF_STR( Hardest ) )
3210   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Language ) )
3211   PORT_DIPSETTING(   0x20, DEF_STR( English ) )
3212   PORT_DIPSETTING(   0x00, DEF_STR( French ) )
3213   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Bonus_Life ) )
3214   PORT_DIPSETTING(   0x40, "30000" )
3215   PORT_DIPSETTING(   0x00, "40000" )
3216   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )   // Check code at 0x2d78 and 0x2e6b
3217   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
3218   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
3219INPUT_PORTS_END
3220
3221static INPUT_PORTS_START( dkongjrm )
3222   PORT_START_TAG("IN0")
3223   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
3224   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3225   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
3226   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
3227   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
3228   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 )
3229   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
3230   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
3231
3232   PORT_START_TAG("IN1")
3233   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
3234   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
3235   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
3236   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
3237   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
3238   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
3239   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
3240   PORT_DIPSETTING(   0xc0, DEF_STR( 3C_1C ) )
3241   PORT_DIPSETTING(   0x40, DEF_STR( 2C_1C ) )
3242   PORT_DIPSETTING(   0x00, DEF_STR( 1C_1C ) )
3243   PORT_DIPSETTING(   0x80, DEF_STR( 1C_2C ) )
3244
3245   PORT_START_TAG("IN2")
3246   PORT_DIPNAME( 0x01, 0x00, "Coin Multiplier" )
3247   PORT_DIPSETTING(    0x00, "*1" )
3248   PORT_DIPSETTING(    0x01, "*2" )
3249   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Lives ) )
3250   PORT_DIPSETTING(   0x00, "3" )
3251   PORT_DIPSETTING(   0x02, "4" )
3252   PORT_DIPSETTING(   0x04, "5" )
3253   PORT_DIPSETTING(   0x06, "6" )
3254   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
3255   PORT_DIPSETTING(   0x08, DEF_STR( Upright ) )
3256   PORT_DIPSETTING(   0x00, DEF_STR( Cocktail ) )
3257   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
3258INPUT_PORTS_END
3259
3260static INPUT_PORTS_START( rockclim )
3261
3262   PORT_START_TAG("IN0")
3263   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
3264   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
3265   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_LEFT ) PORT_8WAY
3266   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_RIGHT ) PORT_8WAY
3267   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_UP ) PORT_8WAY
3268   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_DOWN ) PORT_8WAY
3269   PORT_DIPNAME( 0x40, 0x40, "Unknown 1" ) //code at $7713
3270   PORT_DIPSETTING(    0x00, "0" )
3271   PORT_DIPSETTING(    0x40, "1" )
3272
3273   PORT_START_TAG("IN1")
3274   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
3275   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
3276   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_LEFT  ) PORT_8WAY
3277   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_RIGHT  ) PORT_8WAY
3278   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_UP ) PORT_8WAY
3279   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_DOWN ) PORT_8WAY
3280   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Bonus_Life ) )
3281   PORT_DIPSETTING(    0x00, "30,000" )
3282   PORT_DIPSETTING(    0x40, "50,000" )
3283   PORT_DIPNAME( 0x80, 0x80, "Coin Slots" )
3284   PORT_DIPSETTING(    0x00, "2" )
3285   PORT_DIPSETTING(    0x80, "1" )
3286
3287   PORT_START_TAG("DSW0")
3288   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
3289   PORT_DIPSETTING(    0x00, "3" )
3290   PORT_DIPSETTING(    0x01, "4" )
3291   PORT_DIPSETTING(    0x02, "5" )
3292   PORT_DIPSETTING(    0x03, "6" )
3293
3294   PORT_START_TAG("DSW1")
3295   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
3296   PORT_DIPSETTING(    0x00, DEF_STR( 9C_1C ) )
3297   PORT_DIPSETTING(    0x01, DEF_STR( 8C_1C ) )
3298   PORT_DIPSETTING(    0x02, DEF_STR( 7C_1C ) )
3299   PORT_DIPSETTING(    0x03, DEF_STR( 6C_1C ) )
3300   PORT_DIPSETTING(    0x04, DEF_STR( 5C_1C ) )
3301   PORT_DIPSETTING(    0x05, DEF_STR( 4C_1C ) )
3302   PORT_DIPSETTING(    0x06, DEF_STR( 3C_1C ) )
3303   PORT_DIPSETTING(    0x07, DEF_STR( 2C_1C ) )
3304   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
3305   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
3306   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
3307   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
3308   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
3309   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
3310   PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
3311   PORT_DIPSETTING(    0x08, DEF_STR( 1C_8C ) )
3312   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
3313   PORT_DIPSETTING(    0x00, DEF_STR( 9C_1C ) )
3314   PORT_DIPSETTING(    0x10, DEF_STR( 8C_1C ) )
3315   PORT_DIPSETTING(    0x20, DEF_STR( 7C_1C ) )
3316   PORT_DIPSETTING(    0x30, DEF_STR( 6C_1C ) )
3317   PORT_DIPSETTING(    0x40, DEF_STR( 5C_1C ) )
3318   PORT_DIPSETTING(    0x50, DEF_STR( 4C_1C ) )
3319   PORT_DIPSETTING(    0x60, DEF_STR( 3C_1C ) )
3320   PORT_DIPSETTING(    0x70, DEF_STR( 2C_1C ) )
3321   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
3322   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
3323   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
3324   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
3325   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
3326   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
3327   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
3328   PORT_DIPSETTING(    0x80, DEF_STR( 1C_8C ) )
3329
3330INPUT_PORTS_END
3331
3332/*
3333
3334Game bug:
3335- you can insert 99 credits 3 times consecutively, then it resets
3336
1049/PITCH: (write 7800-7fff)
1050  loads latch at 9J
33371051*/
3338static INPUT_PORTS_START( ozon1 )
3339   PORT_START_TAG("IN0")
3340   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
3341   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
3342   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
3343   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
3344   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
3345   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
3346   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
3347   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
33481052
3349   PORT_START_TAG("IN1")
3350   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
3351   PORT_DIPSETTING(    0x00, "3" )
3352   PORT_DIPSETTING(    0x01, "4" )
3353   PORT_DIPSETTING(    0x02, "5" )
3354   PORT_DIPSETTING(    0x03, "6" )
3355   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
3356   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
3357   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
3358   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
3359   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
3360   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1053/* map derived from schematics */
1054static ADDRESS_MAP_START( galaxian_map, ADDRESS_SPACE_PROGRAM, 8 )
1055   ADDRESS_MAP_UNMAP_HIGH
1056   AM_RANGE(0x0000, 0x3fff) AM_ROM
1057   AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0400) AM_RAM
1058   AM_RANGE(0x5000, 0x53ff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram)
1059   AM_RANGE(0x5800, 0x58ff) AM_MIRROR(0x0700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram)
1060   AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x07ff) AM_READ_PORT("IN0")
1061   AM_RANGE(0x6000, 0x6001) AM_MIRROR(0x07f8) AM_WRITE(start_lamp_w)
1062   AM_RANGE(0x6002, 0x6002) AM_MIRROR(0x07f8) AM_WRITE(coin_lock_w)
1063   AM_RANGE(0x6003, 0x6003) AM_MIRROR(0x07f8) AM_WRITE(coin_count_0_w)
1064   AM_RANGE(0x6004, 0x6007) AM_MIRROR(0x07f8) AM_WRITE(galaxian_lfo_freq_w)
1065   AM_RANGE(0x6800, 0x6800) AM_MIRROR(0x07ff) AM_READ_PORT("IN1")
1066   AM_RANGE(0x6800, 0x6807) AM_MIRROR(0x07f8) AM_WRITE(galaxian_sound_w)
1067   AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x07ff) AM_READ_PORT("IN2")
1068   AM_RANGE(0x7001, 0x7001) AM_MIRROR(0x07f8) AM_WRITE(irq_enable_w)
1069   AM_RANGE(0x7004, 0x7004) AM_MIRROR(0x07f8) AM_WRITE(galaxian_stars_enable_w)
1070   AM_RANGE(0x7006, 0x7006) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_x_w)
1071   AM_RANGE(0x7007, 0x7007) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_y_w)
1072   AM_RANGE(0x7800, 0x7800) AM_MIRROR(0x07ff) AM_WRITE(galaxian_pitch_w)
1073   AM_RANGE(0x7800, 0x7800) AM_MIRROR(0x07ff) AM_READ(watchdog_reset_r)
1074ADDRESS_MAP_END
33611075
3362   PORT_START_TAG("DSW")
3363   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
3364   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3365   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
3366   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
3367   PORT_DIPSETTING(    0x00, "A 1C/1C  B 2C/1C" )
3368   PORT_DIPSETTING(    0x02, "A 1C/2C  B 1C/1C" ) // when you insert a coin with COIN2 it starts an infinite loop
3369   PORT_DIPSETTING(    0x04, "A 1C/3C  B 3C/1C" )
3370   PORT_DIPSETTING(    0x06, "A 1C/4C  B 4C/1C" )
3371   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
3372   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3373   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
3374   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
3375   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3376   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
3377   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
3378   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3379   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
3380   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
3381   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3382   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
3383   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
3384   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3385   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
3386INPUT_PORTS_END
33871076
3388static INPUT_PORTS_START( ladybugg )
3389   PORT_START_TAG("IN0")
3390   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
3391   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
3392   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
3393   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
3394   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3395   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
3396   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3397   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
1077/* map derived from schematics */
1078static ADDRESS_MAP_START( mooncrst_map, ADDRESS_SPACE_PROGRAM, 8 )
1079   ADDRESS_MAP_UNMAP_HIGH
1080   AM_RANGE(0x0000, 0x3fff) AM_ROM
1081   AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x0400) AM_RAM
1082   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram)
1083   AM_RANGE(0x9800, 0x98ff) AM_MIRROR(0x0700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram)
1084   AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x07ff) AM_READ_PORT("IN0")
1085   AM_RANGE(0xa000, 0xa002) AM_MIRROR(0x07f8) AM_WRITE(galaxian_gfxbank_w)
1086   AM_RANGE(0xa003, 0xa003) AM_MIRROR(0x07f8) AM_WRITE(coin_count_0_w)
1087   AM_RANGE(0xa004, 0xa007) AM_MIRROR(0x07f8) AM_WRITE(galaxian_lfo_freq_w)
1088   AM_RANGE(0xa800, 0xa800) AM_MIRROR(0x07ff) AM_READ_PORT("IN1")
1089   AM_RANGE(0xa800, 0xa807) AM_MIRROR(0x07f8) AM_WRITE(galaxian_sound_w)
1090   AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x07ff) AM_READ_PORT("IN2")
1091   AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x07f8) AM_WRITE(irq_enable_w)
1092   AM_RANGE(0xb004, 0xb004) AM_MIRROR(0x07f8) AM_WRITE(galaxian_stars_enable_w)
1093   AM_RANGE(0xb006, 0xb006) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_x_w)
1094   AM_RANGE(0xb007, 0xb007) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_y_w)
1095   AM_RANGE(0xb800, 0xb800) AM_MIRROR(0x07ff) AM_WRITE(galaxian_pitch_w)
1096   AM_RANGE(0xb800, 0xb800) AM_MIRROR(0x07ff) AM_READ(watchdog_reset_r)
1097ADDRESS_MAP_END
33981098
3399   PORT_START_TAG("IN1")
3400   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
3401   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
3402   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
3403   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
3404   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL
3405   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL /* 2nd Button 1 */
3406   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
3407   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
3408   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
3409   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coinage ) )
3410   PORT_DIPSETTING(    0x80, "A 1C/1C  B 1C/5C" )
3411   PORT_DIPSETTING(    0x00, "A 2C/1C  B 1C/3C" )
34121099
3413   PORT_START_TAG("DSW")
3414   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Difficulty ) )
3415   PORT_DIPSETTING(    0x00, DEF_STR( Easiest ) )
3416   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
3417   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
3418   PORT_DIPSETTING(    0x03, DEF_STR( Hardest ) )
3419   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
3420   PORT_DIPSETTING(    0x00, "3" )
3421   PORT_DIPSETTING(    0x04, "4" )
3422   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )
3423   PORT_DIPSETTING(    0x00, "20000" )
3424   PORT_DIPSETTING(    0x08, "40000" )
3425   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* Yes, the game reads both of these */
3426   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* Check code at 0x22e1 */
3427INPUT_PORTS_END
1100/* map derived from schematics */
1101#if 0
1102static ADDRESS_MAP_START( dambustr_map, ADDRESS_SPACE_PROGRAM, 8 )
1103   ADDRESS_MAP_UNMAP_HIGH
1104   AM_RANGE(0x0000, 0x7fff) AM_ROM
1105//  AM_RANGE(0x8000, 0x8000) AM_WRITE(dambustr_bg_color_w)
1106//  AM_RANGE(0x8001, 0x8001) AM_WRITE(dambustr_bg_split_line_w)
1107   AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x0400) AM_RAM
1108   AM_RANGE(0xd000, 0xd3ff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram)
1109   AM_RANGE(0xd800, 0xd8ff) AM_MIRROR(0x0700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram)
1110   AM_RANGE(0xe000, 0xe000) AM_MIRROR(0x07ff) AM_READ_PORT("IN0")
1111   AM_RANGE(0xe004, 0xe007) AM_MIRROR(0x07f8) AM_WRITE(galaxian_lfo_freq_w)
1112   AM_RANGE(0xe800, 0xe800) AM_MIRROR(0x07ff) AM_READ_PORT("IN1")
1113   AM_RANGE(0xe800, 0xe807) AM_MIRROR(0x07f8) AM_WRITE(galaxian_sound_w)
1114   AM_RANGE(0xf000, 0xf000) AM_MIRROR(0x07ff) AM_READ_PORT("IN2")
1115   AM_RANGE(0xf001, 0xf001) AM_MIRROR(0x07f8) AM_WRITE(irq_enable_w)
1116   AM_RANGE(0xf004, 0xf004) AM_MIRROR(0x07f8) AM_WRITE(galaxian_stars_enable_w)
1117   AM_RANGE(0xf006, 0xf006) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_x_w)
1118   AM_RANGE(0xf007, 0xf007) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_y_w)
1119   AM_RANGE(0xf800, 0xf800) AM_MIRROR(0x07ff) AM_READ(watchdog_reset_r)
1120   AM_RANGE(0xf800, 0xf800) AM_MIRROR(0x07ff) AM_WRITE(galaxian_pitch_w)
1121ADDRESS_MAP_END
1122#endif
34281123
3429static INPUT_PORTS_START( vpool )
3430   PORT_START_TAG("IN0")
3431   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
3432   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
3433   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
3434   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
3435   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
3436   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
3437   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
3438   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3439   PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
3440   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
34411124
3442   PORT_START_TAG("IN1")
3443   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
3444   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
3445   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
3446   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
3447   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
3448   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
3449   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
3450   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3451   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
3452   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
3453   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3454   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
3455   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3456   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1125/* map derived from schematics */
1126static ADDRESS_MAP_START( theend_map, ADDRESS_SPACE_PROGRAM, 8 )
1127   ADDRESS_MAP_UNMAP_HIGH
1128   AM_RANGE(0x0000, 0x3fff) AM_ROM
1129   AM_RANGE(0x4000, 0x47ff) AM_RAM
1130   AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram)
1131   AM_RANGE(0x5000, 0x50ff) AM_MIRROR(0x0700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram)
1132   AM_RANGE(0x6801, 0x6801) AM_MIRROR(0x07f8) AM_WRITE(irq_enable_w)
1133   AM_RANGE(0x6802, 0x6802) AM_MIRROR(0x07f8) AM_WRITE(coin_count_0_w)
1134   AM_RANGE(0x6803, 0x6803) AM_MIRROR(0x07f8) AM_WRITE(scramble_background_enable_w)
1135   AM_RANGE(0x6804, 0x6804) AM_MIRROR(0x07f8) AM_WRITE(galaxian_stars_enable_w)
1136   AM_RANGE(0x6805, 0x6805) AM_MIRROR(0x07f8) //POUT2
1137   AM_RANGE(0x6806, 0x6806) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_x_w)
1138   AM_RANGE(0x6807, 0x6807) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_y_w)
1139   AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x07ff) AM_READ(watchdog_reset_r)
1140   AM_RANGE(0x8000, 0xffff) AM_READWRITE(theend_ppi8255_r, theend_ppi8255_w)
1141ADDRESS_MAP_END
34571142
3458   PORT_START_TAG("DSW0")
3459   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
3460   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
3461   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3462   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
3463   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
3464   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3465   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
3466   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
3467   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3468   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
3469   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
3470   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3471   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
3472   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
3473   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3474   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
3475   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
3476   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3477   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
3478   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
3479   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3480   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
3481   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3482   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3483INPUT_PORTS_END
34841143
3485static INPUT_PORTS_START( drivfrcg )
3486   PORT_START_TAG("IN0")
3487   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
3488   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
3489   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
3490   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
3491   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3492   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3493   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3494   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1144/* map derived from schematics */
1145static ADDRESS_MAP_START( scobra_map, ADDRESS_SPACE_PROGRAM, 8 )
1146   ADDRESS_MAP_UNMAP_HIGH
1147   AM_RANGE(0x0000, 0x7fff) AM_ROM
1148   AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x4000) AM_RAM
1149   AM_RANGE(0x8800, 0x8bff) AM_MIRROR(0x4400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram)
1150   AM_RANGE(0x9000, 0x90ff) AM_MIRROR(0x4700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram)
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)
1153   AM_RANGE(0xa801, 0xa801) AM_MIRROR(0x47f8) AM_WRITE(irq_enable_w)
1154   AM_RANGE(0xa802, 0xa802) AM_MIRROR(0x47f8) AM_WRITE(coin_count_0_w)
1155   AM_RANGE(0xa803, 0xa803) AM_MIRROR(0x47f8) AM_WRITE(scramble_background_enable_w)
1156   AM_RANGE(0xa804, 0xa804) AM_MIRROR(0x47f8) AM_WRITE(galaxian_stars_enable_w)
1157   AM_RANGE(0xa805, 0xa805) AM_MIRROR(0x47f8) /* POUT2 */
1158   AM_RANGE(0xa806, 0xa806) AM_MIRROR(0x47f8) AM_WRITE(galaxian_flip_screen_x_w)
1159   AM_RANGE(0xa807, 0xa807) AM_MIRROR(0x47f8) AM_WRITE(galaxian_flip_screen_y_w)
1160   AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x47ff) AM_READ(watchdog_reset_r)
1161ADDRESS_MAP_END
34951162
3496   PORT_START_TAG("IN1")
3497   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 )
3498   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 )
3499   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3500   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3501   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3502   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3503   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coinage ) )
3504   PORT_DIPSETTING(    0x40, "A 2C/1C  B 1C/3C" )
3505   PORT_DIPSETTING(    0x00, "A 1C/1C  B 1C/5C" )
3506   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
35071163
3508   PORT_START_TAG("DSW0")
3509   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
3510   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3511   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
3512   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
3513   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3514   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
3515   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
3516   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3517   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
3518   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
3519   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3520   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
3521   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
3522   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3523   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
3524   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
3525   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3526   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
3527   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
3528   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3529   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
3530   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
3531   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3532   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1164/* map derived from schematics */
1165static ADDRESS_MAP_START( frogger_map, ADDRESS_SPACE_PROGRAM, 8 )
1166   ADDRESS_MAP_UNMAP_HIGH
1167   AM_RANGE(0x0000, 0x3fff) AM_ROM
1168   AM_RANGE(0x8000, 0x87ff) AM_RAM
1169   AM_RANGE(0x8800, 0x8800) AM_MIRROR(0x07ff) AM_READ(watchdog_reset_r)
1170   AM_RANGE(0xa800, 0xabff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram)
1171   AM_RANGE(0xb000, 0xb0ff) AM_MIRROR(0x0700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram)
1172   AM_RANGE(0xb808, 0xb808) AM_MIRROR(0x07e3) AM_WRITE(irq_enable_w)
1173   AM_RANGE(0xb80c, 0xb80c) AM_MIRROR(0x07e3) AM_WRITE(galaxian_flip_screen_y_w)
1174   AM_RANGE(0xb810, 0xb810) AM_MIRROR(0x07e3) AM_WRITE(galaxian_flip_screen_x_w)
1175   AM_RANGE(0xb818, 0xb818) AM_MIRROR(0x07e3) AM_WRITE(coin_count_0_w)   /* IOPC7 */
1176   AM_RANGE(0xb81c, 0xb81c) AM_MIRROR(0x07e3) AM_WRITE(coin_count_1_w)   /* POUT1 */
1177   AM_RANGE(0xc000, 0xffff) AM_READWRITE(frogger_ppi8255_r, frogger_ppi8255_w)
1178ADDRESS_MAP_END
35331179
3534   PORT_START_TAG("DSW1")
3535   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
3536   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3537   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
3538   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
3539   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3540   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
3541   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
3542   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3543   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
3544   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
3545   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3546   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
3547   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
3548   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3549   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
3550   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
3551   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3552   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
3553   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
3554   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3555   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
3556   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
3557   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3558   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
35591180
3560   PORT_START_TAG("SENSE")
3561   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
3562INPUT_PORTS_END
1181/* map derived from schematics */
1182static ADDRESS_MAP_START( turtles_map, ADDRESS_SPACE_PROGRAM, 8 )
1183   ADDRESS_MAP_UNMAP_HIGH
1184   AM_RANGE(0x0000, 0x7fff) AM_ROM
1185   AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x4000) AM_RAM
1186   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x4400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram)
1187   AM_RANGE(0x9800, 0x98ff) AM_MIRROR(0x4700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram)
1188   AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x47c7) AM_WRITE(scramble_background_red_w)
1189   AM_RANGE(0xa008, 0xa008) AM_MIRROR(0x47c7) AM_WRITE(irq_enable_w)
1190   AM_RANGE(0xa010, 0xa010) AM_MIRROR(0x47c7) AM_WRITE(galaxian_flip_screen_y_w)
1191   AM_RANGE(0xa018, 0xa018) AM_MIRROR(0x47c7) AM_WRITE(galaxian_flip_screen_x_w)
1192   AM_RANGE(0xa020, 0xa020) AM_MIRROR(0x47c7) AM_WRITE(scramble_background_green_w)
1193   AM_RANGE(0xa028, 0xa028) AM_MIRROR(0x47c7) AM_WRITE(scramble_background_blue_w)
1194   AM_RANGE(0xa030, 0xa030) AM_MIRROR(0x47c7) AM_WRITE(coin_count_0_w)
1195   AM_RANGE(0xa038, 0xa038) AM_MIRROR(0x47c7) AM_WRITE(coin_count_1_w)
1196   AM_RANGE(0xa800, 0xa800) AM_MIRROR(0x47ff) AM_READ(watchdog_reset_r)
1197   AM_RANGE(0xb000, 0xb03f) AM_MIRROR(0x47cf) AM_READWRITE(turtles_ppi8255_0_r, turtles_ppi8255_0_w)
1198   AM_RANGE(0xb800, 0xb83f) AM_MIRROR(0x47cf) AM_READWRITE(turtles_ppi8255_1_r, turtles_ppi8255_1_w)
1199ADDRESS_MAP_END
35631200
3564static INPUT_PORTS_START( bongo )
3565   PORT_START_TAG("IN0")
3566   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
3567   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // coin? it jumps to an unmapped area at $C003
3568   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
3569   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
3570   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3571   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
3572   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3573   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
35741201
3575   PORT_START_TAG("IN1")
3576   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
3577   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
3578   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
3579   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
3580   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3581   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL
3582   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3583   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1202/* this is the same as theend, except for separate RGB background controls
1203   and some extra ROM space at $7000 and $C000 */
1204static ADDRESS_MAP_START( sfx_map, ADDRESS_SPACE_PROGRAM, 8 )
1205   AM_RANGE(0x0000, 0x3fff) AM_ROM
1206   AM_RANGE(0x4000, 0x47ff) AM_RAM
1207   AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram)
1208   AM_RANGE(0x5000, 0x50ff) AM_MIRROR(0x0700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram)
1209   AM_RANGE(0x6800, 0x6800) AM_MIRROR(0x07f8) AM_WRITE(scramble_background_red_w)
1210   AM_RANGE(0x6801, 0x6801) AM_MIRROR(0x07f8) AM_WRITE(irq_enable_w)
1211   AM_RANGE(0x6802, 0x6802) AM_MIRROR(0x07f8) AM_WRITE(coin_count_0_w)
1212   AM_RANGE(0x6803, 0x6803) AM_MIRROR(0x07f8) AM_WRITE(scramble_background_blue_w)
1213   AM_RANGE(0x6804, 0x6804) AM_MIRROR(0x07f8) AM_WRITE(galaxian_stars_enable_w)
1214   AM_RANGE(0x6805, 0x6805) AM_MIRROR(0x07f8) AM_WRITE(scramble_background_green_w)
1215   AM_RANGE(0x6806, 0x6806) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_x_w)
1216   AM_RANGE(0x6807, 0x6807) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_y_w)
1217   AM_RANGE(0x7000, 0x7fff) AM_ROM
1218   AM_RANGE(0x8000, 0xbfff) AM_READWRITE(theend_ppi8255_r, theend_ppi8255_w)
1219   AM_RANGE(0xc000, 0xefff) AM_ROM
1220ADDRESS_MAP_END
35841221
3585   PORT_START_TAG("DSW0")
3586   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
3587   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3588   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
3589   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
3590   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3591   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
3592   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
3593   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3594   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
3595   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
3596   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3597   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
3598   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
3599   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3600   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
3601   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
3602   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3603   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
3604   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
3605   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3606   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
3607   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
3608   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3609   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
36101222
3611   PORT_START_TAG("DSW1")
3612   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
3613   PORT_DIPSETTING(    0x0, DEF_STR( Off ) )
3614   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
3615   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Lives ) )
3616   PORT_DIPSETTING(    0x00, "2" )
3617   PORT_DIPSETTING(    0x02, "3" )
3618   PORT_DIPSETTING(    0x04, "4" )
3619   PORT_DIPSETTING(    0x06, "5" )
3620   PORT_DIPNAME( 0x08, 0x00, "Infinite Lives" )
3621   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3622   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
3623   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
3624   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3625   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
3626   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
3627   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3628   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
3629   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coinage ) )
3630   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
3631   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
3632   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
3633   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
3634   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
3635INPUT_PORTS_END
1223/* changes from galaxian map:
1224    galaxian sound removed
1225    $4800-$57ff: cointains video and object RAM (normally at $5000-$5fff)
1226    $5800-$5fff: AY-8910 access added
1227    $6002-$6006: graphics banking controls replace coin lockout, coin counter, and lfo
1228    $7002: coin counter (moved from $6003)
1229    $8000-$afff: additional ROM area
1230    $b000-$bfff: protection
1231*/
1232static ADDRESS_MAP_START( jumpbug_map, ADDRESS_SPACE_PROGRAM, 8 )
1233   ADDRESS_MAP_UNMAP_HIGH
1234   AM_RANGE(0x0000, 0x3fff) AM_ROM
1235   AM_RANGE(0x4000, 0x47ff) AM_RAM
1236   AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram)
1237   AM_RANGE(0x5000, 0x50ff) AM_MIRROR(0x0700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram)
1238   AM_RANGE(0x5800, 0x5800) AM_MIRROR(0x00ff) AM_WRITE(AY8910_write_port_0_w)
1239   AM_RANGE(0x5900, 0x5900) AM_MIRROR(0x00ff) AM_WRITE(AY8910_control_port_0_w)
1240   AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x07ff) AM_READ_PORT("IN0")
1241   AM_RANGE(0x6002, 0x6006) AM_MIRROR(0x07f8) AM_WRITE(galaxian_gfxbank_w)
1242   AM_RANGE(0x6800, 0x6800) AM_MIRROR(0x07ff) AM_READ_PORT("IN1")
1243   AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x07ff) AM_READ_PORT("IN2")
1244   AM_RANGE(0x7001, 0x7001) AM_MIRROR(0x07f8) AM_WRITE(irq_enable_w)
1245   AM_RANGE(0x7002, 0x7002) AM_MIRROR(0x07f8) AM_WRITE(coin_count_0_w)
1246   AM_RANGE(0x7004, 0x7004) AM_MIRROR(0x07f8) AM_WRITE(galaxian_stars_enable_w)
1247   AM_RANGE(0x7006, 0x7006) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_x_w)
1248   AM_RANGE(0x7007, 0x7007) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_y_w)
1249   AM_RANGE(0x8000, 0xafff) AM_ROM
1250   AM_RANGE(0xb000, 0xbfff) AM_READ(jumpbug_protection_r)
1251ADDRESS_MAP_END
36361252
3637static INPUT_PORTS_START( hunchbkg )
3638   PORT_START_TAG("IN0")
3639   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
3640   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
3641   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1)
3642   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1)
3643   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3644   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3645   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
3646   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1)
36471253
3648   PORT_START_TAG("IN1")
3649   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Start 1 / P1 Button 1") PORT_PLAYER(1)
3650   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Start 2 / P1 Button 1") PORT_PLAYER(1)
3651   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
3652   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
3653   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3654   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
3655   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3656   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1254static ADDRESS_MAP_START( frogf_map, ADDRESS_SPACE_PROGRAM, 8 )
1255   ADDRESS_MAP_UNMAP_HIGH
1256   AM_RANGE(0x0000, 0x3fff) AM_ROM
1257   AM_RANGE(0x8000, 0x87ff) AM_RAM
1258   AM_RANGE(0x8800, 0x8bff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram)
1259   AM_RANGE(0x9000, 0x90ff) AM_MIRROR(0x0700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram)
1260   AM_RANGE(0xa802, 0xa802) AM_MIRROR(0x07f1) AM_WRITE(galaxian_flip_screen_x_w)
1261   AM_RANGE(0xa804, 0xa804) AM_MIRROR(0x07f1) AM_WRITE(irq_enable_w)
1262   AM_RANGE(0xa806, 0xa806) AM_MIRROR(0x07f1) AM_WRITE(galaxian_flip_screen_y_w)
1263   AM_RANGE(0xa808, 0xa808) AM_MIRROR(0x07f1) AM_WRITE(coin_count_1_w)
1264   AM_RANGE(0xa80e, 0xa80e) AM_MIRROR(0x07f1) AM_WRITE(coin_count_0_w)
1265   AM_RANGE(0xb800, 0xb800) AM_MIRROR(0x07ff) AM_READ(watchdog_reset_r)
1266   AM_RANGE(0xc000, 0xffff) AM_READWRITE(frogf_ppi8255_r, frogf_ppi8255_w)
1267ADDRESS_MAP_END
36571268
3658   PORT_START_TAG("DSW0")
3659   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
3660   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
3661   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
3662   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
3663   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3664   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
3665   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
3666   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3667   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
3668   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
3669   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3670   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
3671   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
3672   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3673   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
3674   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
3675   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3676   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
3677   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
3678   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3679   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
3680   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
3681   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3682   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
36831269
3684   PORT_START_TAG("SENSE")
3685   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
3686INPUT_PORTS_END
1270/* mooncrst */
1271static ADDRESS_MAP_START( mshuttle_map, ADDRESS_SPACE_PROGRAM, 8 )
1272   ADDRESS_MAP_UNMAP_HIGH
1273   AM_RANGE(0x0000, 0x7fff) AM_ROM
1274   AM_RANGE(0x8000, 0x83ff) AM_RAM
1275   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_READWRITE(SMH_RAM, galaxian_videoram_w) AM_BASE(&videoram)
1276   AM_RANGE(0x9800, 0x98ff) AM_MIRROR(0x0700) AM_READWRITE(SMH_RAM, galaxian_objram_w) AM_BASE(&spriteram)
1277   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0")
1278   AM_RANGE(0xa000, 0xa000) AM_WRITE(irq_enable_w)
1279   AM_RANGE(0xa001, 0xa001) AM_WRITE(galaxian_stars_enable_w)
1280   AM_RANGE(0xa002, 0xa002) AM_WRITE(galaxian_flip_screen_xy_w)
1281   AM_RANGE(0xa004, 0xa004) AM_WRITE(cclimber_sample_trigger_w)
1282   AM_RANGE(0xa007, 0xa007) AM_WRITE(mshuttle_ay8910_cs_w)
1283   AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN1")
1284   AM_RANGE(0xa800, 0xa800) AM_WRITE(cclimber_sample_rate_w)
1285   AM_RANGE(0xb000, 0xb000) AM_READ_PORT("IN2")
1286   AM_RANGE(0xb000, 0xb000) AM_WRITE(cclimber_sample_volume_w)
1287   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
1288ADDRESS_MAP_END
36871289
3688static INPUT_PORTS_START( harem )
3689   PORT_START_TAG("IN0")//Change tag when major usage uncovered.
3690   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
3691   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
3692   PORT_DIPSETTING(   0x01, DEF_STR( On ) )
3693   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
3694   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
3695   PORT_DIPSETTING(   0x02, DEF_STR( On ) )
3696   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
3697   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
3698   PORT_DIPSETTING(   0x04, DEF_STR( On ) )
3699   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
3700   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
3701   PORT_DIPSETTING(   0x08, DEF_STR( On ) )
3702   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
3703   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
3704   PORT_DIPSETTING(   0x10, DEF_STR( On ) )
3705   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
3706   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
3707   PORT_DIPSETTING(   0x20, DEF_STR( On ) )
3708   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
3709   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
3710   PORT_DIPSETTING(   0x40, DEF_STR( On ) )
3711   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
3712   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
3713   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
1290static ADDRESS_MAP_START( mshuttle_portmap, ADDRESS_SPACE_IO, 8 )
1291   ADDRESS_MAP_UNMAP_HIGH
1292   ADDRESS_MAP_GLOBAL_MASK(0x0f)
1293   AM_RANGE(0x08, 0x08) AM_WRITE(mshuttle_ay8910_control_w)
1294   AM_RANGE(0x09, 0x09) AM_WRITE(mshuttle_ay8910_data_w)
1295   AM_RANGE(0x0c, 0x0c) AM_READ(mshuttle_ay8910_data_r)
1296ADDRESS_MAP_END
37141297
3715   PORT_START_TAG("IN1")
3716   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
3717   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
3718   PORT_DIPSETTING(   0x01, DEF_STR( On ) )
3719   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
3720   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
3721   PORT_DIPSETTING(   0x02, DEF_STR( On ) )
3722   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
3723   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
3724   PORT_DIPSETTING(   0x04, DEF_STR( On ) )
3725   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
3726   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
3727   PORT_DIPSETTING(   0x08, DEF_STR( On ) )
3728   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
3729   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
3730   PORT_DIPSETTING(   0x10, DEF_STR( On ) )
3731   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
3732   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
3733   PORT_DIPSETTING(   0x20, DEF_STR( On ) )
3734   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
3735   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
3736   PORT_DIPSETTING(   0x40, DEF_STR( On ) )
3737   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
3738   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
3739   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
3740INPUT_PORTS_END
37411298
3742static INPUT_PORTS_START( tazzmang )
3743   PORT_START
3744   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
3745   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
3746   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
3747   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
3748   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
3749   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3750   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
3751   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
37521299
3753   PORT_START
3754   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Start 1 / P1 and P2 Button 2")
3755   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
3756   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
3757   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
3758   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
3759   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3760   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
3761   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1300/*************************************
1301 *
1302 *  Sound CPU memory maps
1303 *
1304 *************************************/
37621305
3763   PORT_START
3764   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
3765   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
3766   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
3767   PORT_DIPNAME( 0x06, 0x04, DEF_STR( Coinage ) )
3768   PORT_DIPSETTING(    0x00, "A 4C/1C  B 1C/4C" )
3769   PORT_DIPSETTING(    0x02, "A 3C/1C  B 1C/3C" )
3770   PORT_DIPSETTING(    0x06, "A 2C/1C  B 1C/2C" )
3771   PORT_DIPSETTING(    0x04, "A 1C/1C  B 1C/1C" )
3772   PORT_DIPNAME( 0x08, 0x00, "3" )
3773   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3774   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
3775   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
3776   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3777   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
3778   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
3779   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3780   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
3781   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
3782   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3783   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
3784   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
3785   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3786   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
3787INPUT_PORTS_END
1306/* Konami Frogger with 1 x AY-8910A */
1307static ADDRESS_MAP_START( frogger_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
1308   ADDRESS_MAP_GLOBAL_MASK(0x7fff)
1309   AM_RANGE(0x0000, 0x1fff) AM_ROM
1310   AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x1c00) AM_RAM
1311    AM_RANGE(0x6000, 0x6fff) AM_MIRROR(0x1000) AM_WRITE(konami_sound_filter_w)
1312ADDRESS_MAP_END
37881313
3789static INPUT_PORTS_START( racknrol )
3790   PORT_START_TAG("IN0")
3791   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
3792   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
3793   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
3794   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
3795   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
3796   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
3797   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3798   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
1314static ADDRESS_MAP_START( frogger_sound_portmap, ADDRESS_SPACE_IO, 8 )
1315   ADDRESS_MAP_GLOBAL_MASK(0xff)
1316   AM_RANGE(0x00, 0xff) AM_READWRITE(frogger_ay8910_r, frogger_ay8910_w)
1317ADDRESS_MAP_END
37991318
3800   PORT_START_TAG("IN1")
3801   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
3802   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
3803   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
3804   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3805   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
3806   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
3807   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3808   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
3809   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
3810   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3811   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
3812   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
3813   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3814   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
3815   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
3816   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3817   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
3818   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
3819   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3820   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
38211319
3822   PORT_START_TAG("DSW0")
3823   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
3824   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3825   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
3826   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
3827   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3828   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
3829   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
3830   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3831   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
3832   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
3833   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3834   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
3835   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
3836   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3837   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
3838   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
3839   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3840   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
3841   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
3842   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3843   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
3844   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
3845   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3846   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1320/* Konami generic with 2 x AY-8910A */
1321static ADDRESS_MAP_START( konami_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
1322   AM_RANGE(0x0000, 0x2fff) AM_ROM
1323   AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x6c00) AM_RAM
1324    AM_RANGE(0x9000, 0x9fff) AM_MIRROR(0x6000) AM_WRITE(konami_sound_filter_w)
1325ADDRESS_MAP_END
38471326
3848   PORT_START_TAG("SENSE")
3849   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
3850INPUT_PORTS_END
1327static ADDRESS_MAP_START( konami_sound_portmap, ADDRESS_SPACE_IO, 8 )
1328   ADDRESS_MAP_GLOBAL_MASK(0xff)
1329   AM_RANGE(0x00, 0xff) AM_READWRITE(konami_ay8910_r, konami_ay8910_w)
1330ADDRESS_MAP_END
38511331
3852static INPUT_PORTS_START( trvchlng )
3853   PORT_START_TAG("IN0")
3854   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
3855   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
3856   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 )
3857   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 )
3858   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3859   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON4)
3860   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3861   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 )
38621332
3863   PORT_START_TAG("IN1")
3864   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
3865   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
3866   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
3867   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3868   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
3869   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
3870   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3871   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
3872   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
3873   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3874   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
3875   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
3876   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3877   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
3878   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
3879   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3880   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
3881   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
3882   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3883   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1333/* Checkman with 1 x AY-8910A */
1334static ADDRESS_MAP_START( checkman_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
1335   ADDRESS_MAP_UNMAP_HIGH
1336   AM_RANGE(0x0000, 0x0fff) AM_ROM
1337   AM_RANGE(0x2000, 0x23ff) AM_RAM
1338ADDRESS_MAP_END
38841339
3885   PORT_START_TAG("DSW0")
3886   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
3887   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3888   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
3889   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
3890   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3891   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
3892   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
3893   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3894   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
3895   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
3896   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3897   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
3898   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
3899   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3900   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
3901   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
3902   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3903   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
3904   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
3905   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3906   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
3907   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
3908   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3909   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1340static ADDRESS_MAP_START( checkman_sound_portmap, ADDRESS_SPACE_IO, 8 )
1341   ADDRESS_MAP_UNMAP_HIGH
1342   ADDRESS_MAP_GLOBAL_MASK(0xff)
1343   AM_RANGE(0x03, 0x03) AM_READ(soundlatch_r)
1344   AM_RANGE(0x04, 0x04) AM_WRITE(AY8910_control_port_0_w)
1345   AM_RANGE(0x05, 0x05) AM_WRITE(AY8910_write_port_0_w)
1346   AM_RANGE(0x06, 0x06) AM_READ(AY8910_read_port_0_r)
1347ADDRESS_MAP_END
39101348
3911   PORT_START_TAG("SENSE")
3912   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
3913INPUT_PORTS_END
39141349
3915static INPUT_PORTS_START( catacomb )
3916   PORT_START_TAG("IN0")
3917   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
3918   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
3919   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
3920   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
3921   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
3922   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
3923   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
3924   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
3925   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
3926   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3927   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
3928   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
3929   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3930   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1350/* Checkman alternate with 1 x AY-8910A */
1351static ADDRESS_MAP_START( checkmaj_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
1352   ADDRESS_MAP_UNMAP_HIGH
1353   AM_RANGE(0x0000, 0x0fff) AM_ROM
1354   AM_RANGE(0x8000, 0x83ff) AM_RAM
1355   AM_RANGE(0xa000, 0xa000) AM_WRITE(AY8910_control_port_0_w)
1356   AM_RANGE(0xa001, 0xa001) AM_WRITE(AY8910_write_port_0_w)
1357   AM_RANGE(0xa002, 0xa002) AM_READ(AY8910_read_port_0_r)
1358ADDRESS_MAP_END
39311359
3932   PORT_START_TAG("IN1")
3933   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
3934   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
3935   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
3936   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
3937   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
3938   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
3939   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3940   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
3941   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_A ) )
3942   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
3943   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
3944   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coin_B ) )
3945   PORT_DIPSETTING(    0x00, DEF_STR( 1C_3C ) )
3946   PORT_DIPSETTING(    0x80, DEF_STR( 1C_5C ) )
39471360
3948   PORT_START_TAG("DSW0")
3949   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
3950   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3951   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
3952   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
3953   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3954   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
3955   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )
3956   PORT_DIPSETTING(    0x04, "3" )
3957   PORT_DIPSETTING(    0x00, "5" )
3958   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
3959   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3960   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
3961   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
3962   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3963   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
3964   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
3965   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3966   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
3967   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
3968   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3969   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
3970   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
3971   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3972   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1361/* King and Balloon with DAC */
1362static ADDRESS_MAP_START( kingball_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
1363   ADDRESS_MAP_UNMAP_HIGH
1364   ADDRESS_MAP_GLOBAL_MASK(0x3fff)
1365   AM_RANGE(0x0000, 0x1fff) AM_ROM
1366   AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x1c00) AM_RAM
1367ADDRESS_MAP_END
39731368
3974   PORT_START_TAG("SENSE")
3975   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
3976INPUT_PORTS_END
1369static ADDRESS_MAP_START( kingball_sound_portmap, ADDRESS_SPACE_IO, 8 )
1370   ADDRESS_MAP_UNMAP_HIGH
1371   ADDRESS_MAP_GLOBAL_MASK(0xff)
1372   AM_RANGE(0x00, 0x00) AM_MIRROR(0xff) AM_READWRITE(soundlatch_r, kingball_dac_w)
1373ADDRESS_MAP_END
39771374
3978static INPUT_PORTS_START( luctoday )
3979   PORT_START_TAG("IN0") //These inputs are clearly wrong, they need a full test
3980   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
3981   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3982   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )PORT_2WAY PORT_NAME("Add Credit to Bet")
3983   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )PORT_2WAY PORT_NAME("Remove Credit from Bet")
3984   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
3985   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3986   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
3987   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BILL1 )
39881375
3989   PORT_START_TAG("IN1")
3990   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
3991   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
3992   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
3993   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
3994   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
3995   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
3996   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
3997   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
1376/* SF-X sample player */
1377static ADDRESS_MAP_START( sfx_sample_map, ADDRESS_SPACE_PROGRAM, 8 )
1378   AM_RANGE(0x0000, 0x5fff) AM_ROM
1379   AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x6c00) AM_RAM
1380ADDRESS_MAP_END
39981381
3999   PORT_START_TAG("DSW0")
4000   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
4001   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
4002   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
4003   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
4004   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
4005INPUT_PORTS_END
1382static ADDRESS_MAP_START( sfx_sample_portmap, ADDRESS_SPACE_IO, 8 )
1383   ADDRESS_MAP_GLOBAL_MASK(0xff)
1384   AM_RANGE(0x00, 0xff) AM_READWRITE(sfx_sample_io_r, sfx_sample_io_w)
1385ADDRESS_MAP_END
40061386
4007static INPUT_PORTS_START( ckongg )
4008   PORT_START_TAG("IN0")
4009   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
4010   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
4011   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
4012   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
4013   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
4014   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
4015   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 )
4016   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 )
40171387
4018   PORT_START_TAG("IN1")
4019   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
4020   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
4021   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
4022   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
4023   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
4024   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
4025   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
4026   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
4027   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
4028//      PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
4029   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
40301388
4031   PORT_START_TAG("DSW0")
4032   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
4033   PORT_DIPSETTING(    0x00, "1" )
4034   PORT_DIPSETTING(    0x01, "2" )
4035   PORT_DIPSETTING(    0x02, "3" )
4036   PORT_DIPSETTING(    0x03, "4" )
4037   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
4038   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
4039   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
4040   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Bonus_Life ) )
4041   PORT_DIPSETTING(    0x08, "500000" )
4042   PORT_DIPSETTING(    0x00, "750000" )
4043   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
4044INPUT_PORTS_END
1389/*************************************
1390 *
1391 *  Graphics layouts
1392 *
1393 *************************************/
40451394
4046/* not correct */
4047static INPUT_PORTS_START( kkgalax )
4048   PORT_START_TAG("IN0")
4049   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
4050   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
4051   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
4052   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
4053   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
4054   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
4055   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
4056   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
4057
4058   PORT_START_TAG("IN1")
4059   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // button 1 and start 1
4060   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL // button 1 and start 2?
4061   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
4062   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
4063   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
4064   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
4065   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
4066   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
4067   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
4068//  PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
4069   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
4070
4071   PORT_START_TAG("DSW0")
4072   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
4073   PORT_DIPSETTING(    0x00, "1" )
4074   PORT_DIPSETTING(    0x01, "2" )
4075   PORT_DIPSETTING(    0x02, "3" )
4076   PORT_DIPSETTING(    0x03, "4" )
4077   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
4078   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
4079   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
4080   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Bonus_Life ) )
4081   PORT_DIPSETTING(    0x08, "500000" )
4082   PORT_DIPSETTING(    0x00, "750000" )
4083   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
4084INPUT_PORTS_END
4085
4086static INPUT_PORTS_START( porter )
4087   PORT_START_TAG("IN0")\
4088   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
4089   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
4090   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
4091   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
4092   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
4093    PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
4094    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
4095    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4096   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
4097    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
4098    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4099   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
4100
4101   PORT_START_TAG("IN1")
4102   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // and START
4103   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) // and START2
4104   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
4105   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
4106   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
4107    PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
4108    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
4109    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4110    PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
4111    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
4112    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4113    PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
4114    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4115    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4116
4117   PORT_START_TAG("DSW")
4118    PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
4119   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4120    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4121    PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
4122    PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
4123    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4124    PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
4125    PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
4126    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4127    PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
4128    PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
4129    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4130    PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
4131    PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
4132    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4133    PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
4134    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
4135    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4136    PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
4137    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
4138    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4139    PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
4140    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4141    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4142INPUT_PORTS_END
4143
41441395static const gfx_layout galaxian_charlayout =
41451396{
41461397   8,8,
41471398   RGN_FRAC(1,2),
41481399   2,
41491400   { RGN_FRAC(0,2), RGN_FRAC(1,2) },
4150   { 0, 1, 2, 3, 4, 5, 6, 7 },
4151   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
1401   { STEP8(0,1) },
1402   { STEP8(0,8) },
41521403   8*8
41531404};
1405
41541406static const gfx_layout galaxian_spritelayout =
41551407{
41561408   16,16,
41571409   RGN_FRAC(1,2),
41581410   2,
41591411   { RGN_FRAC(0,2), RGN_FRAC(1,2) },
4160   { 0, 1, 2, 3, 4, 5, 6, 7,
4161         8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
4162   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
4163         16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
4164   32*8
1412   { STEP8(0,1), STEP8(8*8,1) },
1413   { STEP8(0,8), STEP8(16*8,8) },
1414   16*16
41651415};
41661416
4167static const gfx_layout pacmanbl_charlayout =
1417
1418
1419/*************************************
1420 *
1421 *  Graphics decoding
1422 *
1423 *************************************/
1424
1425GFXDECODE_START(galaxian)
1426   GFXDECODE_SCALE(REGION_GFX1, 0x0000, galaxian_charlayout,   0, 8, GALAXIAN_XSCALE,1)
1427   GFXDECODE_SCALE(REGION_GFX1, 0x0000, galaxian_spritelayout, 0, 8, GALAXIAN_XSCALE,1)
1428GFXDECODE_END
1429
1430GFXDECODE_START(gmgalax)
1431   GFXDECODE_SCALE(REGION_GFX1, 0x0000, galaxian_charlayout,   0, 16, GALAXIAN_XSCALE,1)
1432   GFXDECODE_SCALE(REGION_GFX1, 0x0000, galaxian_spritelayout, 0, 16, GALAXIAN_XSCALE,1)
1433GFXDECODE_END
1434
1435/* separate character and sprite ROMs */
1436GFXDECODE_START(pacmanbl)
1437   GFXDECODE_SCALE(REGION_GFX1, 0x0000, galaxian_charlayout,   0, 8, GALAXIAN_XSCALE,1)
1438   GFXDECODE_SCALE(REGION_GFX2, 0x0000, galaxian_spritelayout, 0, 8, GALAXIAN_XSCALE,1)
1439GFXDECODE_END
1440
1441
1442
1443/*************************************
1444 *
1445 *  Sound configuration
1446 *
1447 *************************************/
1448
1449static struct AY8910interface frogger_ay8910_interface =
41681450{
4169   8,8,
4170   256,
4171   2,
4172   { 0, 256*8*8 },
4173   { 0, 1, 2, 3, 4, 5, 6, 7 },
4174   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
4175   8*8
1451   soundlatch_r,
1452   frogger_sound_timer_r
41761453};
4177static const gfx_layout pacmanbl_spritelayout =
1454
1455static struct AY8910interface konami_ay8910_interface =
41781456{
4179   16,16,
4180   64,
4181   2,
4182   { 0, 64*16*16 },
4183   { 0, 1, 2, 3, 4, 5, 6, 7,
4184         8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
4185   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
4186         16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
4187   32*8
1457   soundlatch_r,
1458   konami_sound_timer_r
41881459};
41891460
4190static const gfx_layout bagmanmc_charlayout =
1461static struct AY8910interface explorer_ay8910_interface_1 =
41911462{
4192   8,8,
4193   512,
4194   2,
4195   { 0, 512*8*8 },
4196   { 0, 1, 2, 3, 4, 5, 6, 7 },
4197   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
4198   8*8
1463   konami_sound_timer_r
41991464};
42001465
4201static const gfx_layout _4in1_charlayout =
1466static struct AY8910interface explorer_ay8910_interface_2 =
42021467{
4203   8,8,
4204   1024,
4205   2,
4206   { 0, 1024*8*8 },
4207   { 0, 1, 2, 3, 4, 5, 6, 7 },
4208   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
4209   8*8
1468   explorer_sound_latch_r
42101469};
4211static const gfx_layout _4in1_spritelayout =
1470
1471static struct AY8910interface sfx_ay8910_interface =
42121472{
4213   16,16,
4214   256,
4215   2,
4216   { 0, 256*16*16 },
4217   { 0, 1, 2, 3, 4, 5, 6, 7,
4218         8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
4219   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
4220         16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
4221   32*8
1473   0,
1474   0,
1475   soundlatch2_w,
1476   sfx_sample_control_w
42221477};
42231478
4224static const gfx_layout rockclim_charlayout =
1479static struct AY8910interface scorpion_ay8910_interface =
42251480{
4226   8,8,
4227   256,
4228   4,//?
4229   { 4, 0,4096*8+4,4096*8 },
4230   { 3, 2, 1, 0,11 ,10, 9, 8 },
4231   { 0*8*2, 1*8*2, 2*8*2, 3*8*2, 4*8*2, 5*8*2, 6*8*2, 7*8*2 },
4232   8*8*2
1481   0,
1482   0,
1483   scorpion_sound_data_w,
1484   scorpion_sound_control_w,
42331485};
42341486
4235static GFXDECODE_START( rockclim )
4236   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, galaxian_charlayout,   32, 8 )
4237   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, galaxian_spritelayout, 32, 8 )
4238   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, rockclim_charlayout, 0, 1 )
4239GFXDECODE_END
1487static struct AY8910interface checkmaj_ay8910_interface =
1488{
1489   soundlatch_r
1490};
42401491
42411492
1493static const discrete_mixer_desc konami_sound_mixer_desc =
1494   {DISC_MIXER_IS_RESISTOR,
1495      {RES_K(5.1), RES_K(5.1), RES_K(5.1), RES_K(5.1), RES_K(5.1), RES_K(5.1)},
1496      {0,0,0,0,0,0},   /* no variable resistors   */
1497      {0,0,0,0,0,0},  /* no node capacitors      */
1498      0, RES_K(200),  /* actually after an opamp */
1499      0,
1500      CAP_U(0.15),
1501      0, 1};
42421502
1503static DISCRETE_SOUND_START( konami_sound )
42431504
4244static GFXDECODE_START( galaxian )
4245   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, galaxian_charlayout,   0, 8 )
4246   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, galaxian_spritelayout, 0, 8 )
4247GFXDECODE_END
1505   DISCRETE_INPUTX_STREAM(NODE_01, 0, 1.0, 0)
1506   DISCRETE_INPUTX_STREAM(NODE_02, 1, 1.0, 0)
1507   DISCRETE_INPUTX_STREAM(NODE_03, 2, 1.0, 0)
42481508
4249static GFXDECODE_START( gmgalax )
4250   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, galaxian_charlayout,   0, 16 )
4251   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, galaxian_spritelayout, 0, 16 )
4252GFXDECODE_END
1509   DISCRETE_INPUTX_STREAM(NODE_04, 3, 1.0, 0)
1510   DISCRETE_INPUTX_STREAM(NODE_05, 4, 1.0, 0)
1511   DISCRETE_INPUTX_STREAM(NODE_06, 5, 1.0, 0)
42531512
4254/* separate character and sprite ROMs */
4255static GFXDECODE_START( pacmanbl )
4256   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, pacmanbl_charlayout,   0, 8 )
4257   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, pacmanbl_spritelayout, 0, 8 )
4258GFXDECODE_END
1513   DISCRETE_INPUT_DATA(NODE_11)
1514   DISCRETE_INPUT_DATA(NODE_12)
1515   DISCRETE_INPUT_DATA(NODE_13)
42591516
4260static GFXDECODE_START( bagmanmc )
4261   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, bagmanmc_charlayout,    0, 8 )
4262   GFXDECODE_ENTRY( REGION_GFX1, 0x2000, pacmanbl_spritelayout, 0, 8 )
4263GFXDECODE_END
1517   DISCRETE_INPUT_DATA(NODE_14)
1518   DISCRETE_INPUT_DATA(NODE_15)
1519   DISCRETE_INPUT_DATA(NODE_16)
42641520
4265static GFXDECODE_START( _4in1 )
4266   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, _4in1_charlayout,      0, 8 )
4267   GFXDECODE_ENTRY( REGION_GFX1, 0x4000, _4in1_spritelayout,    0, 8 )
4268GFXDECODE_END
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)
42691524
4270static const struct AY8910interface checkmaj_ay8910_interface =
4271{
4272   soundlatch_r
4273};
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)
42741528
4275static const struct AY8910interface bongo_ay8910_interface =
4276{
4277   input_port_3_r
4278};
1529   DISCRETE_MIXER6(NODE_30, 1, NODE_21, NODE_22, NODE_23, NODE_24, NODE_25, NODE_26, &konami_sound_mixer_desc)
42791530
1531   /* FIXME the amplifier M51516L has a decay circuit */
1532   /* This is handled with sound_global_enable but    */
1533   /* belongs here.                                   */
42801534
1535   DISCRETE_OUTPUT(NODE_30, 5.0 )
1536
1537DISCRETE_SOUND_END
1538
1539
1540
1541/*************************************
1542 *
1543 *  Core machine driver pieces
1544 *
1545 *************************************/
1546
42811547static MACHINE_DRIVER_START( galaxian_base )
42821548
42831549   /* basic machine hardware */
4284   MDRV_CPU_ADD_TAG("main", Z80, PIXEL_CLOCK/2)   /* 3.072 MHz */
4285   MDRV_CPU_PROGRAM_MAP(galaxian_readmem,galaxian_writemem)
1550   MDRV_CPU_ADD_TAG("main", Z80, GALAXIAN_PIXEL_CLOCK/3/2)
1551   MDRV_CPU_PROGRAM_MAP(galaxian_map,0)
1552   MDRV_CPU_VBLANK_INT("main", interrupt_gen)
42861553
4287   MDRV_MACHINE_RESET(galaxian)
1554   MDRV_WATCHDOG_VBLANK_INIT(8)
42881555
42891556   /* video hardware */
42901557   MDRV_GFXDECODE(galaxian)
4291   MDRV_PALETTE_LENGTH(32+2+64)      /* 32 for the characters, 2 for the bullets, 64 for the stars */
1558   MDRV_PALETTE_LENGTH(32)
42921559
42931560   MDRV_SCREEN_ADD("main", RASTER)
4294   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
4295   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
1561   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
1562   MDRV_SCREEN_RAW_PARAMS(GALAXIAN_PIXEL_CLOCK, GALAXIAN_HTOTAL, GALAXIAN_HBEND, GALAXIAN_HBSTART, GALAXIAN_VTOTAL, GALAXIAN_VBEND, GALAXIAN_VBSTART)
42961563
42971564   MDRV_PALETTE_INIT(galaxian)
42981565   MDRV_VIDEO_START(galaxian)
42991566   MDRV_VIDEO_UPDATE(galaxian)
43001567
1568   /* blinking frequency is determined by 555 counter with Ra=100k, Rb=10k, C=10uF */
1569   MDRV_TIMER_ADD_PERIODIC("stars", galaxian_stars_blink_timer, NSEC(PERIOD_OF_555_ASTABLE_NSEC(100000, 10000, 0.00001)))
1570
43011571   /* sound hardware */
43021572   MDRV_SPEAKER_STANDARD_MONO("mono")
43031573MACHINE_DRIVER_END
43041574
43051575
4306static MACHINE_DRIVER_START( galaxian )
1576static MACHINE_DRIVER_START( galaxian_sound )
43071577
4308   /* basic machine hardware */
4309   MDRV_IMPORT_FROM(galaxian_base)
4310
43111578   /* sound hardware */
43121579   MDRV_SOUND_ADD(SAMPLES, 0)
4313   MDRV_SOUND_CONFIG(galaxian_samples_interface)
1580   MDRV_SOUND_CONFIG(galaxian_custom_interface)
43141581   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
43151582MACHINE_DRIVER_END
43161583
43171584
4318static MACHINE_DRIVER_START( gmgalax )
1585static MACHINE_DRIVER_START( konami_sound_1x_ay8910 )
43191586
4320   /* basic machine hardware */
4321   MDRV_IMPORT_FROM(galaxian)
4322   MDRV_CPU_MODIFY("main")
4323   MDRV_CPU_PROGRAM_MAP(gmgalax_readmem,galaxian_writemem)
4324   MDRV_CPU_VBLANK_INT("main", gmgalax_vh_interrupt)
1587   /* 2nd CPU to drive sound */
1588   MDRV_CPU_ADD_TAG("sound", Z80, KONAMI_SOUND_CLOCK/8)
1589   MDRV_CPU_PROGRAM_MAP(frogger_sound_map,0)
1590   MDRV_CPU_IO_MAP(frogger_sound_portmap,0)
43251591
4326   /* video hardware */
4327   MDRV_GFXDECODE(gmgalax)
4328   MDRV_PALETTE_LENGTH(64+2+64)      /* 64 for the characters, 2 for the bullets, 64 for the stars */
1592   /* sound hardware */
1593   MDRV_SOUND_ADD_TAG("8910.0", AY8910, KONAMI_SOUND_CLOCK/8)
1594   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)
43291598
4330   MDRV_VIDEO_START(gmgalax)
1599   MDRV_SOUND_ADD_TAG("konami", DISCRETE, 0)
1600   MDRV_SOUND_CONFIG_DISCRETE(konami_sound)
1601   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
43311602MACHINE_DRIVER_END
43321603
43331604
4334static MACHINE_DRIVER_START( pisces )
1605static MACHINE_DRIVER_START( konami_sound_2x_ay8910 )
43351606
4336   /* basic machine hardware */
4337   MDRV_IMPORT_FROM(galaxian)
1607   /* 2nd CPU to drive sound */
1608   MDRV_CPU_ADD_TAG("sound", Z80, KONAMI_SOUND_CLOCK/8)
1609   MDRV_CPU_PROGRAM_MAP(konami_sound_map,0)
1610   MDRV_CPU_IO_MAP(konami_sound_portmap,0)
43381611
4339   /* video hardware */
4340   MDRV_VIDEO_START(pisces)
4341MACHINE_DRIVER_END
1612   /* sound hardware */
1613   MDRV_SOUND_ADD_TAG("8910.0", AY8910, KONAMI_SOUND_CLOCK/8)
1614   MDRV_SOUND_ROUTE_EX(0, "konami", 1.0, 0)
1615   MDRV_SOUND_ROUTE_EX(1, "konami", 1.0, 1)
1616   MDRV_SOUND_ROUTE_EX(2, "konami", 1.0, 2)
43421617
1618   MDRV_SOUND_ADD_TAG("8910.1", AY8910, KONAMI_SOUND_CLOCK/8)
1619   MDRV_SOUND_CONFIG(konami_ay8910_interface)
1620   MDRV_SOUND_ROUTE_EX(0, "konami", 1.0, 3)
1621   MDRV_SOUND_ROUTE_EX(1, "konami", 1.0, 4)
1622   MDRV_SOUND_ROUTE_EX(2, "konami", 1.0, 5)
43431623
4344static MACHINE_DRIVER_START( gteikob2 )
4345
4346   /* basic machine hardware */
4347   MDRV_IMPORT_FROM(galaxian)
4348
4349   /* video hardware */
4350   MDRV_VIDEO_START(gteikob2)
1624   MDRV_SOUND_ADD_TAG("konami", DISCRETE, 0)
1625   MDRV_SOUND_CONFIG_DISCRETE(konami_sound)
1626   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
43511627MACHINE_DRIVER_END
43521628
43531629
4354static MACHINE_DRIVER_START( batman2 )
43551630
4356   /* basic machine hardware */
4357   MDRV_IMPORT_FROM(galaxian)
1631/*************************************
1632 *
1633 *  Machine drivers
1634 *
1635 *************************************/
43581636
4359   /* video hardware */
4360   MDRV_VIDEO_START(batman2)
1637static MACHINE_DRIVER_START( galaxian )
1638   MDRV_IMPORT_FROM(galaxian_base)
1639   MDRV_IMPORT_FROM(galaxian_sound)
43611640MACHINE_DRIVER_END
43621641
43631642
4364static MACHINE_DRIVER_START( mooncrgx )
4365
4366   /* basic machine hardware */
4367   MDRV_IMPORT_FROM(galaxian)
4368
4369   /* video hardware */
4370   MDRV_VIDEO_START(mooncrgx)
4371MACHINE_DRIVER_END
4372
4373
43741643static MACHINE_DRIVER_START( pacmanbl )
4375
4376   /* basic machine hardware */
43771644   MDRV_IMPORT_FROM(galaxian)
43781645
4379   /* video hardware */
1646   /* separate tile/sprite ROMs */
43801647   MDRV_GFXDECODE(pacmanbl)
43811648MACHINE_DRIVER_END
43821649
43831650
4384static MACHINE_DRIVER_START( devilfsg )
1651static MACHINE_DRIVER_START( zigzag )
1652   MDRV_IMPORT_FROM(galaxian_base)
43851653
4386   /* basic machine hardware */
4387   MDRV_IMPORT_FROM(galaxian)
4388   MDRV_CPU_MODIFY("main")
4389
4390   MDRV_MACHINE_RESET(devilfsg)
4391
4392   /* video hardware */
1654   /* separate tile/sprite ROMs */
43931655   MDRV_GFXDECODE(pacmanbl)
4394MACHINE_DRIVER_END
43951656
4396
4397static MACHINE_DRIVER_START( mooncrst )
4398
4399   /* basic machine hardware */
4400   MDRV_IMPORT_FROM(galaxian)
4401   MDRV_CPU_MODIFY("main")
4402   MDRV_CPU_PROGRAM_MAP(mooncrst_readmem,mooncrst_writemem)
4403
4404   /* video hardware */
4405   MDRV_VIDEO_START(mooncrst)
4406MACHINE_DRIVER_END
4407
4408
4409static MACHINE_DRIVER_START( skybase )
4410
4411   /* basic machine hardware */
4412   MDRV_IMPORT_FROM(galaxian)
4413   MDRV_CPU_MODIFY("main")
4414   MDRV_CPU_PROGRAM_MAP(mooncrst_readmem,skybase_writemem)
4415
4416   /* video hardware */
4417   MDRV_VIDEO_START(pisces)
4418MACHINE_DRIVER_END
4419
4420
4421static MACHINE_DRIVER_START( moonqsr )
4422
4423   /* basic machine hardware */
4424   MDRV_IMPORT_FROM(galaxian)
4425   MDRV_CPU_MODIFY("main")
4426   MDRV_CPU_PROGRAM_MAP(mooncrst_readmem,mooncrst_writemem)
4427
4428   /* video hardware */
4429   MDRV_VIDEO_START(moonqsr)
4430MACHINE_DRIVER_END
4431
4432
4433static MACHINE_DRIVER_START( mshuttle )
4434
4435   /* basic machine hardware */
4436   MDRV_IMPORT_FROM(galaxian_base)
4437   MDRV_CPU_MODIFY("main")
4438   MDRV_CPU_PROGRAM_MAP(mooncrst_readmem,mshuttle_writemem)
4439   MDRV_CPU_IO_MAP(mshuttle_readport,mshuttle_writeport)
4440
4441   MDRV_MACHINE_RESET(devilfsg)
4442
4443   /* video hardware */
4444   MDRV_VIDEO_START(mshuttle)
4445
44461657   /* sound hardware */
4447   MDRV_SOUND_ADD(AY8910, PIXEL_CLOCK/4)
4448   MDRV_SOUND_CONFIG(cclimber_ay8910_interface)
1658   MDRV_SOUND_ADD(AY8910, 1789750)
44491659   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
4450
4451   MDRV_SOUND_ADD(SAMPLES, 0)
4452   MDRV_SOUND_CONFIG(cclimber_samples_interface)
4453   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
44541660MACHINE_DRIVER_END
44551661
44561662
4457static MACHINE_DRIVER_START( scramblb )
4458
4459   /* basic machine hardware */
1663static MACHINE_DRIVER_START( gmgalax )
44601664   MDRV_IMPORT_FROM(galaxian)
4461   MDRV_CPU_MODIFY("main")
4462   MDRV_CPU_PROGRAM_MAP(scramblb_readmem,scramblb_writemem)
44631665
4464   /* video hardware */
4465   MDRV_PALETTE_LENGTH(32+2+64+1)   /* 32 for the characters, 2 for the bullets, 64 for the stars, 1 for background */
4466
4467   MDRV_PALETTE_INIT(scramble)
4468   MDRV_VIDEO_START(scramble)
1666   /* banked video hardware */
1667   MDRV_GFXDECODE(gmgalax)
1668   MDRV_PALETTE_LENGTH(64)
44691669MACHINE_DRIVER_END
44701670
4471static MACHINE_DRIVER_START( scramb2 )
44721671
4473   /* basic machine hardware */
1672static MACHINE_DRIVER_START( mooncrst )
44741673   MDRV_IMPORT_FROM(galaxian)
4475   MDRV_CPU_MODIFY("main")
4476   MDRV_CPU_PROGRAM_MAP(scramb2_readmem,scramb2_writemem)
44771674
4478   /* video hardware */
4479   MDRV_PALETTE_LENGTH(32+2+64+1)   /* 32 for the characters, 2 for the bullets, 64 for the stars, 1 for background */
4480
4481   MDRV_PALETTE_INIT(scramble)
4482   MDRV_VIDEO_START(scramble)
4483MACHINE_DRIVER_END
4484
4485
4486
4487static MACHINE_DRIVER_START( zigzag )
4488
4489   /* basic machine hardware */
4490   MDRV_IMPORT_FROM(galaxian_base)
1675   /* alternate memory map */
44911676   MDRV_CPU_MODIFY("main")
4492   MDRV_CPU_PROGRAM_MAP(zigzag_readmem,zigzag_writemem)
4493
4494   /* video hardware */
4495   MDRV_GFXDECODE(pacmanbl)
4496   MDRV_PALETTE_LENGTH(32+2+64)   /* 32 for the characters, 2 for the bullets, 64 for the stars */
4497
4498
4499   MDRV_VIDEO_START(galaxian_plain)
4500
4501   /* sound hardware */
4502   MDRV_SOUND_ADD(AY8910, 1789750)
4503   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1677   MDRV_CPU_PROGRAM_MAP(mooncrst_map,0)
45041678MACHINE_DRIVER_END
45051679
45061680
45071681static MACHINE_DRIVER_START( jumpbug )
1682   MDRV_IMPORT_FROM(galaxian_base)
45081683
1684   MDRV_WATCHDOG_VBLANK_INIT(0)
1685
45091686   /* basic machine hardware */
4510   MDRV_IMPORT_FROM(galaxian_base)
45111687   MDRV_CPU_MODIFY("main")
4512   MDRV_CPU_PROGRAM_MAP(jumpbug_readmem,jumpbug_writemem)
1688   MDRV_CPU_PROGRAM_MAP(jumpbug_map,0)
45131689
4514   /* video hardware */
4515   MDRV_PALETTE_LENGTH(32+2+64)   /* 32 for the characters, 2 for the bullets, 64 for the stars */
4516
4517   MDRV_VIDEO_START(jumpbug)
4518
45191690   /* sound hardware */
45201691   MDRV_SOUND_ADD(AY8910, 1789750)
45211692   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
45221693MACHINE_DRIVER_END
45231694
45241695
4525static MACHINE_DRIVER_START( azurian )
4526   /* basic machine hardware */
4527   MDRV_IMPORT_FROM(galaxian)
4528
4529   /* video hardware */
4530   MDRV_VIDEO_START(azurian)
4531MACHINE_DRIVER_END
4532
4533
45341696static MACHINE_DRIVER_START( checkman )
1697   MDRV_IMPORT_FROM(mooncrst)
45351698
45361699   /* basic machine hardware */
4537   MDRV_IMPORT_FROM(galaxian_base)
4538   MDRV_CPU_MODIFY("main")
4539   MDRV_CPU_PROGRAM_MAP(mooncrst_readmem,checkman_writemem)
4540   MDRV_CPU_IO_MAP(0,checkman_writeport)
4541
4542   MDRV_CPU_ADD(Z80, 1620000)
4543   /* audio CPU */   /* 1.62 MHz */
4544   MDRV_CPU_PROGRAM_MAP(checkman_sound_readmem,checkman_sound_writemem)
4545   MDRV_CPU_IO_MAP(checkman_sound_readport,checkman_sound_writeport)
1700   MDRV_CPU_ADD(Z80, 1620000)   /* 1.62 MHz */
1701   MDRV_CPU_PROGRAM_MAP(checkman_sound_map,0)
1702   MDRV_CPU_IO_MAP(checkman_sound_portmap,0)
45461703   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)   /* NMIs are triggered by the main CPU */
45471704
4548   /* video hardware */
4549   MDRV_PALETTE_LENGTH(32+2+64)   /* 32 for the characters, 2 for the bullets, 64 for the stars */
4550
4551   MDRV_VIDEO_START(mooncrst)
4552
45531705   /* sound hardware */
45541706   MDRV_SOUND_ADD(AY8910, 1789750)
45551707   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
4556
4557   MDRV_SOUND_ADD(SAMPLES, 0)
4558   MDRV_SOUND_CONFIG(galaxian_samples_interface)
4559   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
45601708MACHINE_DRIVER_END
45611709
45621710
45631711static MACHINE_DRIVER_START( checkmaj )
1712   MDRV_IMPORT_FROM(galaxian)
45641713
45651714   /* basic machine hardware */
4566   MDRV_IMPORT_FROM(galaxian_base)
4567   MDRV_CPU_MODIFY("main")
4568   MDRV_CPU_PROGRAM_MAP(galaxian_readmem,checkmaj_writemem)
4569
45701715   MDRV_CPU_ADD(Z80, 1620000)
4571   /* audio CPU */
4572   MDRV_CPU_PROGRAM_MAP(checkmaj_sound_readmem,checkmaj_sound_writemem)
4573   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,32)   /* NMIs are triggered by the main CPU */
1716   MDRV_CPU_PROGRAM_MAP(checkmaj_sound_map,0)
45741717
1718   MDRV_TIMER_ADD_SCANLINE("irq0", checkmaj_irq0_gen, "main", 0, 8)
45751719
4576   /* video hardware */
4577   MDRV_PALETTE_LENGTH(32+2+64)   /* 32 for the characters, 2 for the bullets, 64 for the stars */
4578
45791720   /* sound hardware */
45801721   MDRV_SOUND_ADD(AY8910, 1620000)
45811722   MDRV_SOUND_CONFIG(checkmaj_ay8910_interface)
45821723   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
45831724MACHINE_DRIVER_END
45841725
4585static MACHINE_DRIVER_START( dingoe )
45861726
4587   /* basic machine hardware */
1727static MACHINE_DRIVER_START( mshuttle )
45881728   MDRV_IMPORT_FROM(galaxian_base)
1729
1730   /* basic machine hardware */
45891731   MDRV_CPU_MODIFY("main")
4590   MDRV_CPU_PROGRAM_MAP(mooncrst_readmem,checkman_writemem)
4591   MDRV_CPU_IO_MAP(0,checkman_writeport)
1732   MDRV_CPU_PROGRAM_MAP(mshuttle_map,0)
1733   MDRV_CPU_IO_MAP(mshuttle_portmap,0)
45921734
4593   MDRV_CPU_ADD(Z80, 1620000)
4594   /* audio CPU */   /* 1.62 MHz */
4595   MDRV_CPU_PROGRAM_MAP(checkman_sound_readmem,checkman_sound_writemem)
4596   MDRV_CPU_IO_MAP(checkman_sound_readport,checkman_sound_writeport)
4597   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)   /* NMIs are triggered by the main CPU */
4598
4599   /* video hardware */
4600   MDRV_PALETTE_LENGTH(32+2+64)   /* 32 for the characters, 2 for the bullets, 64 for the stars */
4601
46021735   /* sound hardware */
4603   MDRV_SOUND_ADD(AY8910, 1789750)
1736   MDRV_SOUND_ADD(AY8910, GALAXIAN_PIXEL_CLOCK/3/4)
1737   MDRV_SOUND_CONFIG(cclimber_ay8910_interface)
46041738   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1739
1740   MDRV_SOUND_ADD(SAMPLES, 0)
1741   MDRV_SOUND_CONFIG(cclimber_samples_interface)
1742   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
46051743MACHINE_DRIVER_END
46061744
1745
46071746static MACHINE_DRIVER_START( kingball )
1747   MDRV_IMPORT_FROM(mooncrst)
46081748
46091749   /* basic machine hardware */
4610   MDRV_IMPORT_FROM(galaxian)
4611   MDRV_CPU_MODIFY("main")
4612   MDRV_CPU_PROGRAM_MAP(mooncrst_readmem,kingball_writemem)
4613
46141750   MDRV_CPU_ADD(Z80,5000000/2)
4615   /* audio CPU */   /* 2.5 MHz */
4616   MDRV_CPU_PROGRAM_MAP(kingball_sound_readmem,kingball_sound_writemem)
4617   MDRV_CPU_IO_MAP(kingball_sound_readport,kingball_sound_writeport)
1751   MDRV_CPU_PROGRAM_MAP(kingball_sound_map,0)
1752   MDRV_CPU_IO_MAP(kingball_sound_portmap,0)
46181753
4619   /* video hardware */
4620   MDRV_PALETTE_LENGTH(32+2+64)   /* 32 for the characters, 2 for the bullets, 64 for the stars */
4621
46221754   /* sound hardware */
4623   MDRV_SOUND_ADD_TAG("DAC", DAC, 0)
4624   MDRV_SOUND_ROUTE(0, "filter", 1.0)
4625
4626   MDRV_SOUND_ADD_TAG("filter", FILTER_RC, 0)
4627   MDRV_SOUND_CONFIG(flt_rc_ac_default)
1755   MDRV_SOUND_ADD(DAC, 0)
46281756   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
46291757MACHINE_DRIVER_END
46301758
46311759
4632static MACHINE_DRIVER_START( scorpnmc )
1760static MACHINE_DRIVER_START( frogger )
1761   MDRV_IMPORT_FROM(galaxian_base)
1762   MDRV_IMPORT_FROM(konami_sound_1x_ay8910)
46331763
4634   /* basic machine hardware */
4635   MDRV_IMPORT_FROM(galaxian)
1764   /* alternate memory map */
46361765   MDRV_CPU_MODIFY("main")
4637   MDRV_CPU_PROGRAM_MAP(scorpnmc_readmem,scorpnmc_writemem)
4638
4639   /* video hardware */
4640   MDRV_VIDEO_START(batman2)
1766   MDRV_CPU_PROGRAM_MAP(frogger_map,0)
46411767MACHINE_DRIVER_END
46421768
46431769
4644static MACHINE_DRIVER_START( frogg )
1770static MACHINE_DRIVER_START( froggrmc )
1771   MDRV_IMPORT_FROM(galaxian_base)
1772   MDRV_IMPORT_FROM(konami_sound_1x_ay8910)
46451773
4646   /* basic machine hardware */
4647   MDRV_IMPORT_FROM(galaxian)
4648
4649   /* video hardware */
4650   MDRV_PALETTE_LENGTH(32+64+2+1)  /* 32 for characters, 64 for stars, 2 for bullets, 1 for background */
4651
4652   MDRV_PALETTE_INIT(frogger)
4653   MDRV_VIDEO_START(froggers)
1774   /* alternate memory map */
1775   MDRV_CPU_MODIFY("main")
1776   MDRV_CPU_PROGRAM_MAP(mooncrst_map,0)
46541777MACHINE_DRIVER_END
46551778
46561779
4657static MACHINE_DRIVER_START( 4in1 )
1780static MACHINE_DRIVER_START( froggers )
1781   MDRV_IMPORT_FROM(galaxian_base)
1782   MDRV_IMPORT_FROM(konami_sound_1x_ay8910)
46581783
4659   /* basic machine hardware */
4660   MDRV_IMPORT_FROM(galaxian)
1784   /* alternate memory map */
46611785   MDRV_CPU_MODIFY("main")
4662   MDRV_CPU_PROGRAM_MAP(_4in1_readmem,_4in1_writemem)
4663
4664   /* video hardware */
4665   MDRV_GFXDECODE(_4in1)
4666
4667   MDRV_VIDEO_START(pisces)
1786   MDRV_CPU_PROGRAM_MAP(theend_map,0)
46681787MACHINE_DRIVER_END
46691788
46701789
4671static MACHINE_DRIVER_START( bagmanmc )
1790static MACHINE_DRIVER_START( frogf )
1791   MDRV_IMPORT_FROM(galaxian_base)
1792   MDRV_IMPORT_FROM(konami_sound_1x_ay8910)
46721793
4673   /* basic machine hardware */
4674   MDRV_IMPORT_FROM(galaxian)
1794   /* alternate memory map */
46751795   MDRV_CPU_MODIFY("main")
4676   MDRV_CPU_PROGRAM_MAP(bagmanmc_readmem,bagmanmc_writemem)
4677
4678   MDRV_MACHINE_RESET( devilfsg )
4679
4680   /* video hardware */
4681   MDRV_GFXDECODE(bagmanmc)
4682
4683   MDRV_VIDEO_START(pisces)
1796   MDRV_CPU_PROGRAM_MAP(frogf_map,0)
46841797MACHINE_DRIVER_END
46851798
46861799
4687static MACHINE_DRIVER_START( dkongjrm )
1800static MACHINE_DRIVER_START( turtles )
1801   MDRV_IMPORT_FROM(galaxian_base)
1802   MDRV_IMPORT_FROM(konami_sound_2x_ay8910)
46881803
4689   /* basic machine hardware */
4690   MDRV_IMPORT_FROM(galaxian)
1804   /* alternate memory map */
46911805   MDRV_CPU_MODIFY("main")
4692   MDRV_CPU_PROGRAM_MAP(dkongjrm_readmem,dkongjrm_writemem)
4693
4694   /* video hardware */
4695   MDRV_VIDEO_START(dkongjrm)
1806   MDRV_CPU_PROGRAM_MAP(turtles_map,0)
46961807MACHINE_DRIVER_END
46971808
4698static MACHINE_DRIVER_START( rockclim )
4699   /* basic machine hardware */
4700   MDRV_IMPORT_FROM(galaxian)
4701   MDRV_CPU_MODIFY("main")
4702   MDRV_CPU_PROGRAM_MAP(rockclim_readmem,rockclim_writemem)
4703   MDRV_GFXDECODE(rockclim)
4704   /* video hardware */
4705   MDRV_VIDEO_START(rockclim)
4706   MDRV_PALETTE_LENGTH(64+64+2)   /* 64 colors only, but still uses bullets so we need to keep the palette big */
4707   MDRV_PALETTE_INIT(rockclim)
47081809
4709   MDRV_SCREEN_MODIFY("main")
4710   MDRV_SCREEN_SIZE(64*8, 32*8)
4711
4712MACHINE_DRIVER_END
4713
4714static MACHINE_DRIVER_START( ozon1 )
4715   /* basic machine hardware */
1810static MACHINE_DRIVER_START( theend )
47161811   MDRV_IMPORT_FROM(galaxian_base)
4717   MDRV_CPU_MODIFY("main")
4718   MDRV_CPU_PROGRAM_MAP(ozon1_readmem,ozon1_writemem)
4719   MDRV_CPU_IO_MAP(0,ozon1_writeport)
4720   MDRV_CPU_VBLANK_INT("main", nmi_line_pulse)
1812   MDRV_IMPORT_FROM(konami_sound_2x_ay8910)
47211813
4722   MDRV_MACHINE_RESET(NULL)
4723
4724   MDRV_PALETTE_INIT(rockclim)
4725   MDRV_PALETTE_LENGTH(32)
4726
4727   MDRV_VIDEO_START(galaxian_plain)
4728   MDRV_SOUND_ADD(AY8910, 1789750)
4729   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1814   /* alternate memory map */
1815   MDRV_CPU_MODIFY("main")
1816   MDRV_CPU_PROGRAM_MAP(theend_map,0)
47301817MACHINE_DRIVER_END
47311818
4732static MACHINE_DRIVER_START( drivfrcg )
47331819
4734   /* basic machine hardware */
4735   MDRV_CPU_ADD(S2650, 18432000/6)
4736   MDRV_CPU_PROGRAM_MAP(drivfrcg,0)
4737   MDRV_CPU_IO_MAP(drivfrcg_io,0)
4738   MDRV_CPU_VBLANK_INT("main", hunchbks_vh_interrupt)
1820static MACHINE_DRIVER_START( explorer )
1821   MDRV_IMPORT_FROM(galaxian_base)
47391822
1823   /* alternate memory map */
1824   MDRV_CPU_MODIFY("main")
1825   MDRV_CPU_PROGRAM_MAP(theend_map,0)
47401826
4741   MDRV_SCREEN_ADD("main", RASTER)
4742   MDRV_SCREEN_REFRESH_RATE(16000.0/132/2)
4743   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
4744   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
4745   MDRV_SCREEN_SIZE(32*8, 32*8)
4746   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
1827   /* 2nd CPU to drive sound */
1828   MDRV_CPU_ADD(Z80,KONAMI_SOUND_CLOCK/8)
1829   MDRV_CPU_PROGRAM_MAP(konami_sound_map,0)
1830   MDRV_CPU_IO_MAP(konami_sound_portmap,0)
47471831
4748   MDRV_PALETTE_LENGTH(64)
4749   MDRV_GFXDECODE(gmgalax)
4750
4751   MDRV_PALETTE_INIT(rockclim)
4752
4753   MDRV_VIDEO_START(drivfrcg)
4754   MDRV_VIDEO_UPDATE(galaxian)
4755
47561832   /* sound hardware */
4757   MDRV_SPEAKER_STANDARD_MONO("mono")
4758   MDRV_SOUND_ADD(SAMPLES, 0)
4759   MDRV_SOUND_CONFIG(galaxian_samples_interface)
4760   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
4761MACHINE_DRIVER_END
1833   MDRV_SOUND_ADD_TAG("8910.0", AY8910, KONAMI_SOUND_CLOCK/8)
1834   MDRV_SOUND_CONFIG(explorer_ay8910_interface_1)
1835   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
47621836
4763static MACHINE_DRIVER_START( bongo )
4764   /* basic machine hardware */
4765   MDRV_IMPORT_FROM(galaxian_base)
4766   MDRV_CPU_MODIFY("main")
4767   MDRV_CPU_PROGRAM_MAP(bongo,0)
4768   MDRV_CPU_IO_MAP(bongo_io,0)
4769
4770   MDRV_VIDEO_START(bongo)
4771   MDRV_VIDEO_UPDATE(galaxian)
4772
4773   MDRV_SOUND_ADD(AY8910, 1789750)
4774   MDRV_SOUND_CONFIG(bongo_ay8910_interface)
4775   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1837   MDRV_SOUND_ADD_TAG("8910.1", AY8910, KONAMI_SOUND_CLOCK/8)
1838   MDRV_SOUND_CONFIG(explorer_ay8910_interface_2)
1839   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
47761840MACHINE_DRIVER_END
47771841
4778static MACHINE_DRIVER_START( hunchbkg )
47791842
4780   /* basic machine hardware */
4781   MDRV_CPU_ADD(S2650, PIXEL_CLOCK/2)
4782   MDRV_CPU_PROGRAM_MAP(hunchbkg,0)
4783   MDRV_CPU_IO_MAP(hunchbkg_io,0)
4784   MDRV_CPU_VBLANK_INT("main", hunchbks_vh_interrupt)
1843static MACHINE_DRIVER_START( scorpion )
1844   MDRV_IMPORT_FROM(theend)
47851845
4786   MDRV_GFXDECODE(galaxian)
4787   MDRV_PALETTE_LENGTH(32+2+64)      /* 32 for the characters, 2 for the bullets, 64 for the stars */
4788
4789   MDRV_SCREEN_ADD("main", RASTER)
4790   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
4791   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
4792
4793   MDRV_PALETTE_INIT(galaxian)
4794
4795   MDRV_VIDEO_UPDATE(galaxian)
4796   MDRV_VIDEO_START(galaxian_plain)
4797
4798   /* sound hardware */
4799   MDRV_SPEAKER_STANDARD_MONO("mono")
4800   MDRV_SOUND_ADD(SAMPLES, 0)
4801   MDRV_SOUND_CONFIG(galaxian_samples_interface)
4802   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
1846   /* extra AY8910 with I/O ports */
1847   MDRV_SOUND_ADD_TAG("8910.2", AY8910, KONAMI_SOUND_CLOCK/8)
1848   MDRV_SOUND_CONFIG(scorpion_ay8910_interface)
1849   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
48031850MACHINE_DRIVER_END
48041851
4805static MACHINE_DRIVER_START( harem )
4806   /* basic machine hardware */
1852
1853static MACHINE_DRIVER_START( sfx )
48071854   MDRV_IMPORT_FROM(galaxian_base)
4808   MDRV_CPU_MODIFY("main")
4809   MDRV_CPU_PROGRAM_MAP(harem_cpu1,0)
4810   MDRV_CPU_VBLANK_INT("main", nmi_line_pulse)
1855   MDRV_IMPORT_FROM(konami_sound_2x_ay8910)
48111856
4812   MDRV_CPU_ADD(Z80, 1620000)
4813   /* audio CPU */
4814   MDRV_CPU_PROGRAM_MAP(harem_cpu2,0)
4815   MDRV_CPU_IO_MAP(harem_cpu2_io,0)
1857   MDRV_WATCHDOG_VBLANK_INIT(0)
48161858
4817   MDRV_MACHINE_RESET(NULL)
4818
4819   MDRV_PALETTE_INIT(rockclim)
4820   MDRV_PALETTE_LENGTH(32)
4821
4822   MDRV_VIDEO_START(galaxian_plain)
4823
4824   MDRV_SOUND_ADD(AY8910, 2000000)
4825   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33/3)
4826
4827   MDRV_SOUND_ADD(AY8910, 2000000)
4828   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33/3)
4829
4830   MDRV_SOUND_ADD(AY8910, 2000000)
4831   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33/3)
4832MACHINE_DRIVER_END
4833
4834static MACHINE_DRIVER_START( tazzmang )
4835   /* basic machine hardware */
4836   MDRV_IMPORT_FROM(galaxian)
1859   /* alternate memory map */
48371860   MDRV_CPU_MODIFY("main")
4838   MDRV_CPU_PROGRAM_MAP(tazzmang,0)
4839MACHINE_DRIVER_END
1861   MDRV_CPU_PROGRAM_MAP(sfx_map,0)
48401862
4841static MACHINE_DRIVER_START( racknrol )
1863   /* 3rd CPU for the sample player */
1864   MDRV_CPU_ADD(Z80, KONAMI_SOUND_CLOCK/8)
1865   MDRV_CPU_PROGRAM_MAP(sfx_sample_map,0)
1866   MDRV_CPU_IO_MAP(sfx_sample_portmap,0)
48421867
4843   /* basic machine hardware */
4844   MDRV_CPU_ADD(S2650, PIXEL_CLOCK/2)
4845   MDRV_CPU_PROGRAM_MAP(racknrol,0)
4846   MDRV_CPU_IO_MAP(racknrol_io,0)
4847   MDRV_CPU_VBLANK_INT("main", hunchbks_vh_interrupt)
1868   /* port on 1st 8910 is used for communication */
1869   MDRV_SOUND_MODIFY("8910.0")
1870   MDRV_SOUND_CONFIG(sfx_ay8910_interface)
48481871
4849   MDRV_GFXDECODE(galaxian)
4850   MDRV_PALETTE_LENGTH(32)
4851
4852   MDRV_SCREEN_ADD("main", RASTER)
4853   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
4854   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
4855
4856   MDRV_PALETTE_INIT(rockclim)
4857   MDRV_VIDEO_UPDATE(galaxian)
4858   MDRV_VIDEO_START(racknrol)
4859
4860   /* sound hardware */
4861   MDRV_SPEAKER_STANDARD_MONO("mono")
4862   MDRV_SOUND_ADD(SN76496, PIXEL_CLOCK/2)
1872   /* DAC for the sample player */
1873   MDRV_SOUND_ADD(DAC, 0)
48631874   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
4864
4865   MDRV_SOUND_ADD(SN76496, PIXEL_CLOCK/2)
4866   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
4867
4868   MDRV_SOUND_ADD(SN76496, PIXEL_CLOCK/2)
4869   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
48701875MACHINE_DRIVER_END
48711876
4872static MACHINE_DRIVER_START( ckongg )
48731877
4874   /* basic machine hardware */
4875   MDRV_IMPORT_FROM(galaxian)
4876   MDRV_CPU_MODIFY("main")
4877   MDRV_CPU_PROGRAM_MAP(ckongg_readmem,ckongg_writemem)
1878static MACHINE_DRIVER_START( scobra )
1879   MDRV_IMPORT_FROM(galaxian_base)
1880   MDRV_IMPORT_FROM(konami_sound_2x_ay8910)
48781881
4879   MDRV_GFXDECODE(gmgalax)
4880
4881   MDRV_VIDEO_START(ckongs)
4882
4883MACHINE_DRIVER_END
4884
4885static MACHINE_DRIVER_START( kkgalax )
4886
4887   /* basic machine hardware */
4888   MDRV_IMPORT_FROM(galaxian)
1882   /* alternate memory map */
48891883   MDRV_CPU_MODIFY("main")
4890   MDRV_CPU_PROGRAM_MAP(kkgalax_readmem,kkgalax_writemem)
4891
4892   MDRV_GFXDECODE(gmgalax)
4893
4894   MDRV_VIDEO_START(ckongs)
4895
1884   MDRV_CPU_PROGRAM_MAP(scobra_map,0)
48961885MACHINE_DRIVER_END
48971886
48981887
4899static MACHINE_DRIVER_START( hexpoola )
49001888
4901   /* basic machine hardware */
4902   MDRV_CPU_ADD(S2650, PIXEL_CLOCK/2)
4903   MDRV_CPU_PROGRAM_MAP(racknrol,0)
4904   MDRV_CPU_IO_MAP(hexpoola_io,0)
4905   MDRV_CPU_VBLANK_INT("main", hunchbks_vh_interrupt)
1889/*************************************
1890 *
1891 *  Decryption helpers
1892 *
1893 *************************************/
49061894
4907   MDRV_GFXDECODE(galaxian)
4908   MDRV_PALETTE_LENGTH(32)
1895static void decode_mooncrst(int length, UINT8 *dest)
1896{
1897   UINT8 *rom = memory_region(REGION_CPU1);
1898   int offs;
49091899
4910   MDRV_SCREEN_ADD("main", RASTER)
4911   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
4912   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
1900   for (offs = 0; offs < length; offs++)
1901   {
1902      UINT8 data = rom[offs];
1903      UINT8 res = data;
1904      if (BIT(data,1)) res ^= 0x40;
1905      if (BIT(data,5)) res ^= 0x04;
1906      if ((offs & 1) == 0) res = BITSWAP8(res,7,2,5,4,3,6,1,0);
1907      dest[offs] = res;
1908   }
1909}
49131910
4914   MDRV_PALETTE_INIT(rockclim)
4915   MDRV_VIDEO_UPDATE(galaxian)
4916   MDRV_VIDEO_START(racknrol)
49171911
4918   /* sound hardware */
4919   MDRV_SPEAKER_STANDARD_MONO("mono")
4920   MDRV_SOUND_ADD(SN76496, PIXEL_CLOCK/2)
4921   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
4922MACHINE_DRIVER_END
1912static void decode_checkman(void)
1913{
1914   /*
1915                             Encryption Table
1916                             ----------------
1917        +---+---+---+------+------+------+------+------+------+------+------+
1918        |A2 |A1 |A0 |D7    |D6    |D5    |D4    |D3    |D2    |D1    |D0    |
1919        +---+---+---+------+------+------+------+------+------+------+------+
1920        | 0 | 0 | 0 |D7    |D6    |D5    |D4    |D3    |D2    |D1    |D0^^D6|
1921        | 0 | 0 | 1 |D7    |D6    |D5    |D4    |D3    |D2    |D1^^D5|D0    |
1922        | 0 | 1 | 0 |D7    |D6    |D5    |D4    |D3    |D2^^D4|D1^^D6|D0    |
1923        | 0 | 1 | 1 |D7    |D6    |D5    |D4^^D2|D3    |D2    |D1    |D0^^D5|
1924        | 1 | 0 | 0 |D7    |D6^^D4|D5^^D1|D4    |D3    |D2    |D1    |D0    |
1925        | 1 | 0 | 1 |D7    |D6^^D0|D5^^D2|D4    |D3    |D2    |D1    |D0    |
1926        | 1 | 1 | 0 |D7    |D6    |D5    |D4    |D3    |D2^^D0|D1    |D0    |
1927        | 1 | 1 | 1 |D7    |D6    |D5    |D4^^D1|D3    |D2    |D1    |D0    |
1928        +---+---+---+------+------+------+------+------+------+------+------+
49231929
4924/***************************************************************************
1930        For example if A2=1, A1=1 and A0=0 then D2 to the CPU would be an XOR of
1931        D2 and D0 from the ROM's. Note that D7 and D3 are not encrypted.
49251932
4926  Game driver(s)
1933        Encryption PAL 16L8 on cardridge
1934                 +--- ---+
1935            OE --|   U   |-- VCC
1936         ROMD0 --|       |-- D0
1937         ROMD1 --|       |-- D1
1938         ROMD2 --|VER 5.2|-- D2
1939            A0 --|       |-- NOT USED
1940            A1 --|       |-- A2
1941         ROMD4 --|       |-- D4
1942         ROMD5 --|       |-- D5
1943         ROMD6 --|       |-- D6
1944           GND --|       |-- M1 (NOT USED)
1945                 +-------+
1946        Pin layout is such that links can replace the PAL if encryption is not used.
1947    */
1948   static const UINT8 xortable[8][4] =
1949   {
1950      { 6,0,6,0 },
1951      { 5,1,5,1 },
1952      { 4,2,6,1 },
1953      { 2,4,5,0 },
1954      { 4,6,1,5 },
1955      { 0,6,2,5 },
1956      { 0,2,0,2 },
1957      { 1,4,1,4 }
1958   };
1959   UINT8 *rombase = memory_region(REGION_CPU1);
1960   UINT32 romlength = memory_region_length(REGION_CPU1);
1961   UINT32 offs;
49271962
4928***************************************************************************/
1963   for (offs = 0; offs < romlength; offs++)
1964   {
1965      UINT8 data = rombase[offs];
1966      UINT32 line = offs & 0x07;
49291967
4930ROM_START( galaxian )
4931   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4932   ROM_LOAD( "galmidw.u",    0x0000, 0x0800, CRC(745e2d61) SHA1(e65f74e35b1bfaccd407e168ea55678ae9b68edf) )
4933   ROM_LOAD( "galmidw.v",    0x0800, 0x0800, CRC(9c999a40) SHA1(02fdcd95d8511e64c0d2b007b874112d53e41045) )
4934   ROM_LOAD( "galmidw.w",    0x1000, 0x0800, CRC(b5894925) SHA1(0046b9ed697a34d088de1aead8bd7cbe526a2396) )
4935   ROM_LOAD( "galmidw.y",    0x1800, 0x0800, CRC(6b3ca10b) SHA1(18d8714e5ef52f63ba8888ecc5a25b17b3bf17d1) )
4936   ROM_LOAD( "7l",           0x2000, 0x0800, CRC(1b933207) SHA1(8b44b0f74420871454e27894d0f004859f9e59a9) )
1968      data ^= (BIT(data,xortable[line][0]) << xortable[line][1]) | (BIT(data,xortable[line][2]) << xortable[line][3]);
1969      rombase[offs] = data;
1970   }
1971}
49371972
4938   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
4939   ROM_LOAD( "1h.bin",       0x0000, 0x0800, CRC(39fb43a4) SHA1(4755609bd974976f04855d51e08ec0d62ab4bc07) )
4940   ROM_LOAD( "1k.bin",       0x0800, 0x0800, CRC(7e3f56a2) SHA1(a9795d8b7388f404f3b0e2c6ce15d713a4c5bafa) )
49411973
4942   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4943   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
4944ROM_END
1974static void decode_dingoe(void)
1975{
1976   UINT8 *rombase = memory_region(REGION_CPU1);
1977   UINT32 romlength = memory_region_length(REGION_CPU1);
1978   UINT32 offs;
49451979
4946ROM_START( galaxiaj )
4947   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4948   ROM_LOAD( "7f.bin",       0x0000, 0x1000, CRC(4335b1de) SHA1(e41e3d90dac738cf71377f3b476ec67b14dee27a) )
4949   ROM_LOAD( "7j.bin",       0x1000, 0x1000, CRC(4e6f66a1) SHA1(ee2a675ab34485c0f58c51be7630a51e27a7a8f3) )
4950   ROM_LOAD( "7l.bin",       0x2000, 0x0800, CRC(5341d75a) SHA1(40bc8fcc598f58c6ff944e2a4a9288463e75a09d) )
1980   for (offs = 0; offs < romlength; offs++)
1981   {
1982      UINT8 data = rombase[offs];
49511983
4952   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
4953   ROM_LOAD( "1h.bin",       0x0000, 0x0800, CRC(39fb43a4) SHA1(4755609bd974976f04855d51e08ec0d62ab4bc07) )
4954   ROM_LOAD( "1k.bin",       0x0800, 0x0800, CRC(7e3f56a2) SHA1(a9795d8b7388f404f3b0e2c6ce15d713a4c5bafa) )
1984      /* XOR bit 4 with bit 2, and bit 0 with bit 5, and invert bit 1 */
1985      data ^= BIT(data, 2) << 4;
1986      data ^= BIT(data, 5) << 0;
1987      data ^= 0x02;
49551988
4956   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4957   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
4958ROM_END
1989      /* Swap bit0 with bit4 */
1990      if (offs & 0x02)
1991         data = BITSWAP8(data, 7,6,5,0,3,2,1,4);
1992      rombase[offs] = data;
1993   }
1994}
49591995
4960ROM_START( galmidw )
4961   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4962   ROM_LOAD( "galmidw.u",    0x0000, 0x0800, CRC(745e2d61) SHA1(e65f74e35b1bfaccd407e168ea55678ae9b68edf) )
4963   ROM_LOAD( "galmidw.v",    0x0800, 0x0800, CRC(9c999a40) SHA1(02fdcd95d8511e64c0d2b007b874112d53e41045) )
4964   ROM_LOAD( "galmidw.w",    0x1000, 0x0800, CRC(b5894925) SHA1(0046b9ed697a34d088de1aead8bd7cbe526a2396) )
4965   ROM_LOAD( "galmidw.y",    0x1800, 0x0800, CRC(6b3ca10b) SHA1(18d8714e5ef52f63ba8888ecc5a25b17b3bf17d1) )
4966   ROM_LOAD( "galmidw.z",    0x2000, 0x0800, CRC(cb24f797) SHA1(e6bb977ded0654c2c7388aad188059e1e0647908) )
49671996
4968   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
4969   ROM_LOAD( "galaxian.j1",  0x0000, 0x0800, CRC(84decf98) SHA1(2e565cb6057b1816a6b4541e6dfadd3c3762fa36) )
4970   ROM_LOAD( "galaxian.l1",  0x0800, 0x0800, CRC(c31ada9e) SHA1(237ebb48549b34ca59a13cc2706512d957413ec4) )
1997static void decode_frogger_sound(void)
1998{
1999   UINT8 *rombase = memory_region(REGION_CPU2);
2000   UINT32 offs;
49712001
4972   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4973   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
4974ROM_END
2002   /* the first ROM of the sound CPU has data lines D0 and D1 swapped */
2003   for (offs = 0; offs < 0x0800; offs++)
2004      rombase[offs] = BITSWAP8(rombase[offs], 7,6,5,4,3,2,0,1);
2005}
49752006
4976ROM_START( galmidwo )
4977   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4978   ROM_LOAD( "galaxian.u",   0x0000, 0x0800, CRC(fac42d34) SHA1(0b96d9f1c6bf0e0b7f757dcbaeacfbfafefc54d1) )
4979   ROM_LOAD( "galaxian.v",   0x0800, 0x0800, CRC(f58283e3) SHA1(edc6e72516c50fd3402281d9936574d276581ce9) )
4980   ROM_LOAD( "galaxian.w",   0x1000, 0x0800, CRC(4c7031c0) SHA1(97f7ab0cedcd8eba1c8f6f516d84d672a2108258) )
4981   ROM_LOAD( "galaxian.y",   0x1800, 0x0800, CRC(96a7ac94) SHA1(c3c7a43117c8b9fd8621823c872889f8e31bf935) )
4982   ROM_LOAD( "7l.bin",       0x2000, 0x0800, CRC(5341d75a) SHA1(40bc8fcc598f58c6ff944e2a4a9288463e75a09d) )
49832007
4984   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
4985   ROM_LOAD( "galaxian.j1",  0x0000, 0x0800, CRC(84decf98) SHA1(2e565cb6057b1816a6b4541e6dfadd3c3762fa36) )
4986   ROM_LOAD( "galaxian.l1",  0x0800, 0x0800, CRC(c31ada9e) SHA1(237ebb48549b34ca59a13cc2706512d957413ec4) )
2008static void decode_frogger_gfx(void)
2009{
2010   UINT8 *rombase = memory_region(REGION_GFX1);
2011   UINT32 offs;
49872012
4988   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4989   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
4990ROM_END
2013   /* the 2nd gfx ROM has data lines D0 and D1 swapped */
2014   for (offs = 0x0800; offs < 0x1000; offs++)
2015      rombase[offs] = BITSWAP8(rombase[offs], 7,6,5,4,3,2,0,1);
2016}
49912017
4992ROM_START( galtaito )
4993   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4994   ROM_LOAD( "gl-03.8g",  0x0000, 0x0800, CRC(e8f3aa67) SHA1(a0e9576784dbe602dd9780e667f01f31defd7c00) ) /* All eprom are HN462716 eproms */
4995   ROM_LOAD( "gl-04.8f",  0x0800, 0x0800, CRC(f58283e3) SHA1(edc6e72516c50fd3402281d9936574d276581ce9) )
4996   ROM_LOAD( "gl-05.8e",  0x1000, 0x0800, CRC(4c7031c0) SHA1(97f7ab0cedcd8eba1c8f6f516d84d672a2108258) )
4997   ROM_LOAD( "gl-06.8d",  0x1800, 0x0800, CRC(097d92a2) SHA1(63ef86657286a4e1fae4f795e0e6b410ca2ef06b) )
4998   ROM_LOAD( "gl-07.8c",  0x2000, 0x0800, CRC(5341d75a) SHA1(40bc8fcc598f58c6ff944e2a4a9288463e75a09d) )
49992018
5000   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5001   ROM_LOAD( "gl-01.1j",  0x0000, 0x0800, CRC(968b6016) SHA1(f13e4a8d0fdeb121d39ca76120acdc6c7e7f377c) )
5002   ROM_LOAD( "gl-02.1k",  0x0800, 0x0800, CRC(d14f7510) SHA1(cd09e6ee0a3890d01b2415f5b8346c42c02d15a3) )
2019static void decode_anteater_gfx(void)
2020{
2021   UINT32 romlength = memory_region_length(REGION_GFX1);
2022   UINT8 *rombase = memory_region(REGION_GFX1);
2023   UINT8 *scratch = malloc_or_die(romlength);
2024   UINT32 offs;
50032025
5004   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5005   ROM_LOAD( "6l.bpr",    0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
5006ROM_END
2026   memcpy(scratch, rombase, romlength);
2027   for (offs = 0; offs < romlength; offs++)
2028   {
2029      UINT32 srcoffs = offs & 0x9bf;
2030      srcoffs |= (BIT(offs,4) ^ BIT(offs,9) ^ (BIT(offs,2) & BIT(offs,10))) << 6;
2031      srcoffs |= (BIT(offs,2) ^ BIT(offs,10)) << 9;
2032      srcoffs |= (BIT(offs,0) ^ BIT(offs,6) ^ 1) << 10;
2033      rombase[offs] = scratch[srcoffs];
2034   }
2035   free(scratch);
2036}
50072037
5008ROM_START( superg )
5009   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5010   ROM_LOAD( "7f.bin",       0x0000, 0x1000, CRC(4335b1de) SHA1(e41e3d90dac738cf71377f3b476ec67b14dee27a) )
5011   ROM_LOAD( "superg.w",     0x1000, 0x0800, CRC(ddeabdae) SHA1(daa5109a32c7c9a80bdb212dc3e4e3e3c104a731) )
5012   ROM_LOAD( "superg.y",     0x1800, 0x0800, CRC(9463f753) SHA1(d9cb35c19aafec43d08b048bbe2337a790f6ba9d) )
5013   ROM_LOAD( "superg.z",     0x2000, 0x0800, CRC(e6312e35) SHA1(c4010459379d7fe00f605aaf288928b2deffb8b2) )
50142038
5015   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5016   ROM_LOAD( "galmidw.1j",   0x0000, 0x0800, CRC(84decf98) SHA1(2e565cb6057b1816a6b4541e6dfadd3c3762fa36) )
5017   ROM_LOAD( "galmidw.1k",   0x0800, 0x0800, CRC(c31ada9e) SHA1(237ebb48549b34ca59a13cc2706512d957413ec4) )
2039static void decode_losttomb_gfx(void)
2040{
2041   UINT32 romlength = memory_region_length(REGION_GFX1);
2042   UINT8 *rombase = memory_region(REGION_GFX1);
2043   UINT8 *scratch = malloc_or_die(romlength);
2044   UINT32 offs;
50182045
5019   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5020   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
5021ROM_END
2046   memcpy(scratch, rombase, romlength);
2047   for (offs = 0; offs < romlength; offs++)
2048   {
2049      UINT32 srcoffs = offs & 0xa7f;
2050      srcoffs |= ((BIT(offs,1) & BIT(offs,8)) | ((1 ^ BIT(offs,1)) & (BIT(offs,10)))) << 7;
2051      srcoffs |= (BIT(offs,7) ^ (BIT(offs,1) & (BIT(offs,7) ^ BIT(offs,10)))) << 8;
2052      srcoffs |= ((BIT(offs,1) & BIT(offs,7)) | ((1 ^ BIT(offs,1)) & (BIT(offs,8)))) << 10;
2053      rombase[offs] = scratch[srcoffs];
2054   }
2055   free(scratch);
2056}
50222057
5023ROM_START( galapx )
5024   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5025   ROM_LOAD( "galx.u",       0x0000, 0x0800, CRC(79e4007d) SHA1(d55050498a670d1c022ba3caad34f8fcaccf4a30) )
5026   ROM_LOAD( "galx.v",       0x0800, 0x0800, CRC(bc16064e) SHA1(4e3220fd63c8184bf9581a89dffb6944d8fae3bb) )
5027   ROM_LOAD( "galx.w",       0x1000, 0x0800, CRC(72d2d3ee) SHA1(96e0c5824e46d7398c7e58dd6b75a9f4ead6f3f5) )
5028   ROM_LOAD( "galx.y",       0x1800, 0x0800, CRC(afe397f3) SHA1(283c6f3b3f07581d88f7a6e11fc36947a9d90e2e) )
5029   ROM_LOAD( "galx.z",       0x2000, 0x0800, CRC(778c0d3c) SHA1(6a81875abfea515d379c6212cb57f8e54573e943) )
50302058
5031   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5032   ROM_LOAD( "galx.1h",      0x0000, 0x0800, CRC(e8810654) SHA1(b6924c7ad765c32714e6abd5bb56b2732edd5855) )
5033   ROM_LOAD( "galx.1k",      0x0800, 0x0800, CRC(cbe84a76) SHA1(c6d72fb452e8213dd40a2eb5dcca726d7cdca658) )
50342059
5035   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5036   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
5037ROM_END
2060/*************************************
2061 *
2062 *  Driver configuration
2063 *
2064 *************************************/
50382065
5039ROM_START( moonaln )
5040   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5041   ROM_LOAD( "galx.u",       0x0000, 0x0800, CRC(79e4007d) SHA1(d55050498a670d1c022ba3caad34f8fcaccf4a30) ) // prg1.bin
5042   ROM_LOAD( "prg2.bin",     0x0800, 0x0800, CRC(59580b30) SHA1(e659426ad8c4e5e10a7cdd07d8b4fea93f875026) )
5043   ROM_LOAD( "prg3.bin",     0x1000, 0x0800, CRC(b64e9d12) SHA1(3b07902ea61388f54c03d65082e78dfc0fa8d3d2) )
5044   ROM_LOAD( "superg.y",     0x1800, 0x0800, CRC(9463f753) SHA1(d9cb35c19aafec43d08b048bbe2337a790f6ba9d) ) // prg4.bin
5045   ROM_LOAD( "prg5.bin",     0x2000, 0x0800, CRC(8bb78987) SHA1(5f24dba0bb31fc8bda5bf570d568472befc4d740) )
2066static void common_init(
2067   running_machine *machine,
2068   galaxian_draw_bullet_func draw_bullet,
2069   galaxian_draw_background_func draw_background,
2070   galaxian_extend_tile_info_func extend_tile_info,
2071   galaxian_extend_sprite_info_func extend_sprite_info)
2072{
2073   irq_line = INPUT_LINE_NMI;
2074   galaxian_frogger_adjust = FALSE;
2075   galaxian_sfx_tilemap = FALSE;
2076   galaxian_sprite_clip_start = 16;
2077   galaxian_sprite_clip_end = 255;
2078   galaxian_draw_bullet_ptr = (draw_bullet != NULL) ? draw_bullet : galaxian_draw_bullet;
2079   galaxian_draw_background_ptr = (draw_background != NULL) ? draw_background : galaxian_draw_background;
2080   galaxian_extend_tile_info_ptr = extend_tile_info;
2081   galaxian_extend_sprite_info_ptr = extend_sprite_info;
2082}
50462083
5047   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5048   ROM_LOAD( "ca1.bin",   0x0000, 0x0800, CRC(074271dd) SHA1(cd6a40b493bc51c5340d7083f83c51834b95b5fe) )
5049   ROM_LOAD( "ca2.bin",   0x0800, 0x0800, CRC(84d90397) SHA1(93e6ded079c9721d3f9c003e378e8121584671c9) )
50502084
5051   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5052   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
5053ROM_END
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);
50542094
5055ROM_START( galap1 )
5056   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5057   ROM_LOAD( "7f.bin",       0x0000, 0x1000, CRC(4335b1de) SHA1(e41e3d90dac738cf71377f3b476ec67b14dee27a) )
5058   ROM_LOAD( "galaxian.w",   0x1000, 0x0800, CRC(4c7031c0) SHA1(97f7ab0cedcd8eba1c8f6f516d84d672a2108258) )
5059   ROM_LOAD( "galx_1_4.rom", 0x1800, 0x0800, CRC(e71e1d9e) SHA1(32bf22b06c84d36de7c1280740b9c11e8d6a12b6) )
5060   ROM_LOAD( "galx_1_5.rom", 0x2000, 0x0800, CRC(6e65a3b2) SHA1(c9f20645ad2882e937245a9e90504423bb492158) )
2095   /* configure Konami sound */
2096   ppi8255_init(&konami_ppi8255_intf);
2097}
50612098
5062   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5063   ROM_LOAD( "galmidw.1j",   0x0000, 0x0800, CRC(84decf98) SHA1(2e565cb6057b1816a6b4541e6dfadd3c3762fa36) )
5064   ROM_LOAD( "galmidw.1k",   0x0800, 0x0800, CRC(c31ada9e) SHA1(237ebb48549b34ca59a13cc2706512d957413ec4) )
50652099
5066   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5067   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
5068ROM_END
2100static void unmap_galaxian_sound(offs_t base)
2101{
2102   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, base + 0x0004, base + 0x0007, 0, 0x07f8, SMH_UNMAP);
2103   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, base + 0x0800, base + 0x0807, 0, 0x07f8, SMH_UNMAP);
2104   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, base + 0x1800, base + 0x1800, 0, 0x07ff, SMH_UNMAP);
2105}
50692106
5070ROM_START( galap4 )
5071   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5072   ROM_LOAD( "galnamco.u",   0x0000, 0x0800, CRC(acfde501) SHA1(4b72c1ffecaccadc541da2367f3ef70a2a9aed64) )
5073   ROM_LOAD( "galnamco.v",   0x0800, 0x0800, CRC(65cf3c77) SHA1(1c5249815816b395e1e04bf6a7dbb63e40faa0e3) )
5074   ROM_LOAD( "galnamco.w",   0x1000, 0x0800, CRC(9eef9ae6) SHA1(b2282e4edb8911e6aabfa936c3526f90381e1320) )
5075   ROM_LOAD( "galnamco.y",   0x1800, 0x0800, CRC(56a5ddd1) SHA1(1f87f647ebdffba28d5957f195448f6bce17f4d5) )
5076   ROM_LOAD( "galnamco.z",   0x2000, 0x0800, CRC(f4bc7262) SHA1(c4b70e474d49f45cec96f7c250bd77e01e18601a) )
50772107
5078   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5079   ROM_LOAD( "galx_4c1.rom", 0x0000, 0x0800, CRC(d5e88ab4) SHA1(737a22e406fd0a97d10e93a2c91c3aa61aebbdef) )
5080   ROM_LOAD( "galx_4c2.rom", 0x0800, 0x0800, CRC(a57b83e4) SHA1(335d8674df1d237a4b83da00eb9aee346bc2e901) )
50812108
5082   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5083   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
5084ROM_END
2109/*************************************
2110 *
2111 *  Galaxian-derived games
2112 *
2113 *************************************/
50852114
5086ROM_START( galturbo )
5087   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5088   ROM_LOAD( "galturbo.u",   0x0000, 0x0800, CRC(e8f3aa67) SHA1(a0e9576784dbe602dd9780e667f01f31defd7c00) )
5089   ROM_LOAD( "galx.v",       0x0800, 0x0800, CRC(bc16064e) SHA1(4e3220fd63c8184bf9581a89dffb6944d8fae3bb) )
5090   ROM_LOAD( "superg.w",     0x1000, 0x0800, CRC(ddeabdae) SHA1(daa5109a32c7c9a80bdb212dc3e4e3e3c104a731) )
5091   ROM_LOAD( "galturbo.y",   0x1800, 0x0800, CRC(a44f450f) SHA1(4009834afb45e9b23c7cf058bcd3378ef8601872) )
5092   ROM_LOAD( "galturbo.z",   0x2000, 0x0800, CRC(3247f3d4) SHA1(5754dedc2d06736629d85514b2e7c262ce27bf2d) )
2115static DRIVER_INIT( galaxian )
2116{
2117   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL);
2118}
50932119
5094   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5095   ROM_LOAD( "galturbo.1h",  0x0000, 0x0800, CRC(a713fd1a) SHA1(abf86fe5cb7243a1a36d7ac0a868577a3360dcca) )
5096   ROM_LOAD( "galturbo.1k",  0x0800, 0x0800, CRC(28511790) SHA1(dec2e183a753295d033a56184c973bbc810abf55) )
50972120
5098   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5099   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
5100ROM_END
2121static DRIVER_INIT( nolock )
2122{
2123   /* same as galaxian... */
2124   DRIVER_INIT_CALL(galaxian);
51012125
5102ROM_START( swarm )
5103   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5104   ROM_LOAD( "swarm1.bin",   0x0000, 0x0800, CRC(21eba3d0) SHA1(d07f141d785c86faca8c40af034c26f2789e9346) )
5105   ROM_LOAD( "swarm2.bin",   0x0800, 0x0800, CRC(f3a436cd) SHA1(8d64e61b823e22f17cb79bf9e0c7b3c80c76413f) )
5106   ROM_LOAD( "swarm3.bin",   0x1000, 0x0800, CRC(2915e38b) SHA1(045d4cc2c363b9ba8d066f902f03b7eacbeb1f5e) )
5107   ROM_LOAD( "swarm4.bin",   0x1800, 0x0800, CRC(8bbbf486) SHA1(84c975562c9c359069fb70f7f416420c74d40622) )
5108   ROM_LOAD( "swarm5.bin",   0x2000, 0x0800, CRC(f1b1987e) SHA1(0c8b57cb156fdd1a81a5e4535464cafab737185b) )
2126   /* ...but coin lockout disabled/disconnected */
2127   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP);
2128}
51092129
5110   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5111   ROM_LOAD( "swarma.bin",   0x0000, 0x0800, CRC(ef8657bb) SHA1(c942db83231b04041e2794a08ce779331613edcf) )
5112   ROM_LOAD( "swarmb.bin",   0x0800, 0x0800, CRC(60c4bd31) SHA1(a8f22f8d7a9fca2c29091888e243dfa10211e138) )
51132130
5114   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5115   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
5116ROM_END
2131static DRIVER_INIT( azurian )
2132{
2133   /* yellow bullets instead of white ones */
2134   common_init(machine, scramble_draw_bullet, galaxian_draw_background, NULL, NULL);
51172135
5118ROM_START( zerotime )
5119   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5120   ROM_LOAD( "zt-p01c.016",  0x0000, 0x0800, CRC(90a2bc61) SHA1(9d23dfcf5310cf1d4aa1b473ec84279585e1a876) )
5121   ROM_LOAD( "zt-2.016",     0x0800, 0x0800, CRC(a433067e) SHA1(1aed1a2153c4a32a9996fc709e544f2063885599) )
5122   ROM_LOAD( "zt-3.016",     0x1000, 0x0800, CRC(aaf038d4) SHA1(2d070fe7c4e9b26092f0f12a9db3392f7d8a65f1) )
5123   ROM_LOAD( "zt-4.016",     0x1800, 0x0800, CRC(786d690a) SHA1(50c5c07941006e3b71afbf057d27daa2f2274925) )
5124   ROM_LOAD( "zt-5.016",     0x2000, 0x0800, CRC(af9260d7) SHA1(955e466a8989993351dc69d73ca322c1c9af7b63) )
2136   /* coin lockout disabled */
2137   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP);
2138}
51252139
5126   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5127   ROM_LOAD( "ztc-2.016",    0x0000, 0x0800, CRC(1b13ca05) SHA1(6999068771dacc6bf6c17eb858af593a929d09af) )
5128   ROM_LOAD( "ztc-1.016",    0x0800, 0x0800, CRC(5cd7df03) SHA1(77873408c89546a17b1da3f64b7e96e314fadb17) )
51292140
5130   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5131   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
5132ROM_END
2141static DRIVER_INIT( gmgalax )
2142{
2143   /* video extensions */
2144   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, gmgalax_extend_tile_info, gmgalax_extend_sprite_info);
51332145
5134ROM_START( starfght )
5135   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5136   ROM_LOAD( "ja.1",         0x0000, 0x0400, CRC(c6ab558b) SHA1(2b707e332c57b9ec6a61220ab2b79ed5076d0628) )
5137   ROM_LOAD( "jb.2",         0x0400, 0x0400, CRC(34b99fed) SHA1(03d12b19c9aee75313cae6af602c93205d2fd4a8) )
5138   ROM_LOAD( "jc.3",         0x0800, 0x0400, CRC(30e28016) SHA1(07a621e5061d85a9559a920d76716ea4db61b674) )
5139   ROM_LOAD( "jd.4",         0x0c00, 0x0400, CRC(de7e7770) SHA1(b06043a1d898eb323ddabffd3d2a3b1f63df0e5e) )
5140   ROM_LOAD( "je.5",         0x1000, 0x0400, CRC(a916c919) SHA1(b3e264ff92687022a0f2f551d5df36db848b48eb) )
5141   ROM_LOAD( "jf.6",         0x1400, 0x0400, CRC(9175882b) SHA1(d9943efcb9245af7f01aecc533a699bdefc7d283) )
5142   ROM_LOAD( "jg.7",         0x1800, 0x0400, CRC(707c0f02) SHA1(4cfb18b8161ec6a74663b54120bdc6371ee9dbff) )
5143   ROM_LOAD( "jh.8",         0x1c00, 0x0400, CRC(5dd26461) SHA1(173b939287d0261ff069c277a1afd724133f4c88) )
5144   ROM_LOAD( "ji.9",         0x2000, 0x0400, CRC(6651fe93) SHA1(eb1d9466090ef723ae20003e5be27059f5bea57b) )
5145   ROM_LOAD( "jj.10",        0x2400, 0x0400, CRC(12c721b9) SHA1(1944cd5129115d245ced44da7f1eb4574561c457) )
2146   /* ROM is banked */
2147   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1);
2148   memory_configure_bank(1, 0, 2, memory_region(REGION_CPU1) + 0x10000, 0x4000);
51462149
5147   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5148   ROM_LOAD( "k1.7a",        0x0000, 0x0800, CRC(977e37cf) SHA1(88ff1e4edadf5cfc83413a1fe999aecf4ba72232) )
5149   ROM_LOAD( "k2.9a",        0x0800, 0x0800, CRC(15e387ce) SHA1(d804b1391de5a15c336aa53c812b4a885f830191) )
2150   /* callback when the game select is toggled */
2151   gmgalax_game_changed(machine, NULL, 0, 0);
2152   state_save_register_global(gmgalax_selected_game);
2153}
51502154
5151   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5152   ROM_LOAD( "mmi6331.7f",   0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) ) /* Compatible with 82s123 prom */
5153ROM_END
51542155
5155/* was marked 'star fighter' but doesn't appear to be the above game */
5156ROM_START( galaxbsf )
5157   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5158   ROM_LOAD( "1.bn",         0x0000, 0x0400, CRC(cc37b774) SHA1(5b7d9e3c896a1f5b0353732806568d4ffead3ead) )
5159   ROM_LOAD( "2.bn",         0x0400, 0x0400, CRC(c6d21f03) SHA1(64784915bf988fd2a3eea5f219c95c8498175018) )
5160   ROM_LOAD( "3.bn",         0x0800, 0x0400, CRC(30e28016) SHA1(07a621e5061d85a9559a920d76716ea4db61b674) )
5161   ROM_LOAD( "4.bn",         0x0c00, 0x0400, CRC(de7e7770) SHA1(b06043a1d898eb323ddabffd3d2a3b1f63df0e5e) )
5162   ROM_LOAD( "5.bn",         0x1000, 0x0400, CRC(a916c919) SHA1(b3e264ff92687022a0f2f551d5df36db848b48eb) )
5163   ROM_LOAD( "6.bn",         0x1400, 0x0400, CRC(9175882b) SHA1(d9943efcb9245af7f01aecc533a699bdefc7d283) )
5164   ROM_LOAD( "7.bn",         0x1800, 0x0400, CRC(1237b9da) SHA1(00e11532c599fca452a816683b361a24476b7100) )
5165   ROM_LOAD( "8.bn",         0x1c00, 0x0400, CRC(78c53607) SHA1(780acff57b594185eb5f4b24ae7d8b4992d96611) )
5166   ROM_LOAD( "9.bn",         0x2000, 0x0400, CRC(901894cc) SHA1(a189a8ab0068e9acc3be7b8e87adc1eadfd6b708) )
5167   ROM_LOAD( "10.bn",        0x2400, 0x0400, CRC(5876f695) SHA1(e8c0d13066cfe4a409293b9e1380513099b35330) )
2156static DRIVER_INIT( pisces )
2157{
2158   /* video extensions */
2159   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, pisces_extend_tile_info, pisces_extend_sprite_info);
51682160
5169   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5170   ROM_LOAD( "11.bn",       0x0000, 0x0800, CRC(39fb43a4) SHA1(4755609bd974976f04855d51e08ec0d62ab4bc07) )
5171   ROM_LOAD( "12.bn",       0x0800, 0x0800, CRC(7e3f56a2) SHA1(a9795d8b7388f404f3b0e2c6ce15d713a4c5bafa) )
2161   /* coin lockout replaced by graphics bank */
2162   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, galaxian_gfxbank_w);
2163}
51722164
5173   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5174   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
5175ROM_END
51762165
2166static DRIVER_INIT( batman2 )
2167{
2168   /* video extensions */
2169   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, batman2_extend_tile_info, upper_extend_sprite_info);
51772170
5178ROM_START( tst_galx )
5179   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5180   ROM_LOAD( "test.u",    0x0000, 0x0800, CRC(0614cd7f) SHA1(12440678be8a27a6c3032b6e43c45e27905ffa83) )   /*  The Test ROM */
5181   ROM_LOAD( "galmidw.v",    0x0800, 0x0800, CRC(9c999a40) SHA1(02fdcd95d8511e64c0d2b007b874112d53e41045) )
5182   ROM_LOAD( "galmidw.w",    0x1000, 0x0800, CRC(b5894925) SHA1(0046b9ed697a34d088de1aead8bd7cbe526a2396) )
5183   ROM_LOAD( "galmidw.y",    0x1800, 0x0800, CRC(6b3ca10b) SHA1(18d8714e5ef52f63ba8888ecc5a25b17b3bf17d1) )
2171   /* coin lockout replaced by graphics bank */
2172   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, galaxian_gfxbank_w);
2173}
51842174
5185   ROM_LOAD( "7l",           0x2000, 0x0800, CRC(1b933207) SHA1(8b44b0f74420871454e27894d0f004859f9e59a9) )
51862175
5187   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5188   ROM_LOAD( "1h.bin",       0x0000, 0x0800, CRC(39fb43a4) SHA1(4755609bd974976f04855d51e08ec0d62ab4bc07) )
5189   ROM_LOAD( "1k.bin",       0x0800, 0x0800, CRC(7e3f56a2) SHA1(a9795d8b7388f404f3b0e2c6ce15d713a4c5bafa) )
2176static DRIVER_INIT( frogg )
2177{
2178   /* same as galaxian... */
2179   common_init(machine, galaxian_draw_bullet, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info);
51902180
5191   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5192   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
5193ROM_END
2181   /* ...but needs a full 2k of RAM */
2182   memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x47ff, 0, 0, SMH_BANK1, SMH_BANK1);
2183   memory_set_bankptr(1, auto_malloc(0x800));
2184}
51942185
5195ROM_START( gmgalax )
5196   ROM_REGION( 0x18000, REGION_CPU1, 0 )   /* 64k for code + 32k for banked code */
5197   ROM_LOAD( "pcb1_pm1.bin",0x10000, 0x1000, CRC(19338c70) SHA1(cc2665b7d534d324627d12025ee099ff415d4214) )
5198   ROM_LOAD( "pcb1_pm2.bin",0x11000, 0x1000, CRC(18db074d) SHA1(a70ed18f632e947493e648e6fc057dfb7a2a3322) )
5199   ROM_LOAD( "pcb1_pm3.bin",0x12000, 0x1000, CRC(abb98b1d) SHA1(bb0109d353359bb192a3e6856a857c2f842838cb) )
5200   ROM_LOAD( "pcb1_pm4.bin",0x13000, 0x1000, CRC(2403c78e) SHA1(52d8c8a4efcf47871485080ab217098a019e6579) )
5201   ROM_LOAD( "pcb1_gx1.bin",0x14000, 0x1000, CRC(2faa9f53) SHA1(1e7010d407601c5da1adc68bc9f4742c79d57286) )
5202   ROM_LOAD( "pcb1_gx2.bin",0x15000, 0x1000, CRC(121c5f16) SHA1(cb1806fa984870133fd883969838dca85f992515) )
5203   ROM_LOAD( "pcb1_gx3.bin",0x16000, 0x1000, CRC(02d81a21) SHA1(39209cfb7cf142a65e157544d93803ea542a8efb) )
52042186
5205   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
5206   ROM_LOAD( "pcb2gfx1.bin", 0x0000, 0x0800, CRC(7021bbc0) SHA1(52d2983d74e722fccb31eb02ca56255850c4f41c) )
5207   ROM_CONTINUE(             0x1000, 0x0800 )
5208   ROM_LOAD( "pcb2gfx3.bin", 0x0800, 0x0800, CRC(089c922b) SHA1(f1b81999f63677d4cd58cd547353170e348a1423) )
5209   ROM_CONTINUE(             0x1800, 0x0800 )
5210   ROM_LOAD( "pcb2gfx2.bin", 0x2000, 0x0800, CRC(51bf58ee) SHA1(3546ff03c76a6422b0515bd5c695674bfb032089) )
5211   ROM_CONTINUE(             0x3000, 0x0800 )
5212   ROM_LOAD( "pcb2gfx4.bin", 0x2800, 0x0800, CRC(908fd0dc) SHA1(ac278bd82730e92ff312793244340748b93fa9bb) )
5213   ROM_CONTINUE(             0x3800, 0x0800 )
52142187
5215   ROM_REGION( 0x0040, REGION_PROMS, 0 )
5216   ROM_LOAD( "gmgalax2.clr", 0x0000, 0x0020, CRC(499f4440) SHA1(66d6463a145087041934bdab8bfa6c3db6375317) )
5217   ROM_LOAD( "l06_prom.bin", 0x0020, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
5218ROM_END
2188/*************************************
2189 *
2190 *  Moon Cresta-derived games
2191 *
2192 *************************************/
52192193
5220ROM_START( pisces )
5221   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5222   ROM_LOAD( "p1.bin",       0x0000, 0x0800, CRC(40c5b0e4) SHA1(6c18e6f4719eb0d7eb13b778d7ea58e4b87ac35c) )
5223   ROM_LOAD( "p2.bin",       0x0800, 0x0800, CRC(055f9762) SHA1(9d821874dd48a80651adc58a2f7fe5d2b3ed67bc) )
5224   ROM_LOAD( "p3.bin",       0x1000, 0x0800, CRC(3073dd04) SHA1(b93913a988f412d565abd19dc668976585cc8066) )
5225   ROM_LOAD( "p4.bin",       0x1800, 0x0800, CRC(44aaf525) SHA1(667bf4c3a36169c3ddddd22b2f1f90bcc9308548) )
5226   ROM_LOAD( "p5.bin",       0x2000, 0x0800, CRC(fade512b) SHA1(ccef2650f1d9dc3fdde2d441774246d47febc2cc) )
5227   ROM_LOAD( "p6.bin",       0x2800, 0x0800, CRC(5ab2822f) SHA1(bbcac3aab943dd9b173de11ddf02ff75d16b1582) )
2194static DRIVER_INIT( mooncrst )
2195{
2196   /* video extensions */
2197   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
52282198
5229   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5230//  ROM_LOAD( "pisces.1j",    0x0000, 0x1000, CRC(2dba9e0e) )
5231//  ROM_LOAD( "pisces.1k",    0x1000, 0x1000, CRC(cdc5aa26) )
5232   ROM_LOAD( "g09.bin",      0x0000, 0x0800, CRC(9503a23a) SHA1(23848de56841dd1de9ef74d5a9c981c784098175) )
5233   ROM_LOAD( "g11.bin",      0x0800, 0x0800, CRC(0adfc3fe) SHA1(a4da488632d9906066db45ae62747caf5ffbf2d8) )
5234   ROM_LOAD( "g10.bin",      0x1000, 0x0800, CRC(3e61f849) SHA1(efa0059bc843af0c3bb94f4bc0a8286ca5069179) )
5235   ROM_LOAD( "g12.bin",      0x1800, 0x0800, CRC(7130e9eb) SHA1(e6bb7a9b4f2fc001296e1060d0671b7a88599c8b) )
2199   /* decrypt program code */
2200   decode_mooncrst(0x8000, memory_region(REGION_CPU1));
2201}
52362202
5237   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5238   ROM_LOAD( "colour.bin",   0x0000, 0x0020, CRC(57a45057) SHA1(d4ec6a54f72640e5b485aa59e206c090e67ff640) )   // same as checkman.clr
5239ROM_END
52402203
5241ROM_START( piscesb )
5242   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5243   ROM_LOAD( "pisces.a1",    0x0000, 0x0800, CRC(856b8e1f) SHA1(24d468b5f06f54c3fa1cb54ceec8a0c8e285430e) )
5244   ROM_LOAD( "p2.bin",       0x0800, 0x0800, CRC(055f9762) SHA1(9d821874dd48a80651adc58a2f7fe5d2b3ed67bc) )
5245   ROM_LOAD( "pisces.b2",    0x1000, 0x0800, CRC(5540f2e4) SHA1(b069a7e46fa2c1f732371ef056caaf8f343e11a8) )
5246   ROM_LOAD( "p4.bin",       0x1800, 0x0800, CRC(44aaf525) SHA1(667bf4c3a36169c3ddddd22b2f1f90bcc9308548) )
5247   ROM_LOAD( "p5.bin",       0x2000, 0x0800, CRC(fade512b) SHA1(ccef2650f1d9dc3fdde2d441774246d47febc2cc) )
5248   ROM_LOAD( "p6.bin",       0x2800, 0x0800, CRC(5ab2822f) SHA1(bbcac3aab943dd9b173de11ddf02ff75d16b1582) )
2204static DRIVER_INIT( mooncrsu )
2205{
2206   /* video extensions */
2207   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
2208}
52492209
5250   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5251//  ROM_LOAD( "pisces.1j",    0x0000, 0x1000, CRC(2dba9e0e) )
5252//  ROM_LOAD( "pisces.1k",    0x1000, 0x1000, CRC(cdc5aa26) )
5253   ROM_LOAD( "g09.bin",      0x0000, 0x0800, CRC(9503a23a) SHA1(23848de56841dd1de9ef74d5a9c981c784098175) )
5254   ROM_LOAD( "g11.bin",      0x0800, 0x0800, CRC(0adfc3fe) SHA1(a4da488632d9906066db45ae62747caf5ffbf2d8) )
5255   ROM_LOAD( "g10.bin",      0x1000, 0x0800, CRC(3e61f849) SHA1(efa0059bc843af0c3bb94f4bc0a8286ca5069179) )
5256   ROM_LOAD( "g12.bin",      0x1800, 0x0800, CRC(7130e9eb) SHA1(e6bb7a9b4f2fc001296e1060d0671b7a88599c8b) )
52572210
5258   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5259//  ROM_LOAD( "6331-1j.86",   0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) ) /* very close to Galaxian */
5260   ROM_LOAD( "colour.bin",   0x0000, 0x0020, CRC(57a45057) SHA1(d4ec6a54f72640e5b485aa59e206c090e67ff640) )   // same as checkman.clr
5261ROM_END
2211static DRIVER_INIT( mooncrgx )
2212{
2213   /* video extensions */
2214   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
52622215
5263ROM_START( omni )
5264   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5265   ROM_LOAD( "omni1.7f",     0x0000, 0x1000, CRC(a9b7acc6) SHA1(0c6319957b760fea3cfa6c29b37c25f5a89a6d77) )
5266   ROM_LOAD( "omni2.7j",     0x1000, 0x1000, CRC(6ade29b7) SHA1(64f1ce82c761db11d26c385299a7063f5971c99a) )
5267   ROM_LOAD( "omni3.7f",     0x2000, 0x1000, CRC(9e37bb24) SHA1(d90b2ff0297d87687561e1e9b29510b6c051760b) )
2216   /* LEDs and coin lockout replaced by graphics banking */
2217   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6002, 0, 0x7f8, galaxian_gfxbank_w);
2218}
52682219
5269   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5270   ROM_LOAD( "omni5b.l1",    0x0000, 0x0800, CRC(9503a23a) SHA1(23848de56841dd1de9ef74d5a9c981c784098175) )
5271   ROM_LOAD( "omni6c.j22",   0x0800, 0x0800, CRC(0adfc3fe) SHA1(a4da488632d9906066db45ae62747caf5ffbf2d8) )
5272   ROM_LOAD( "omni4a.j1",    0x1000, 0x0800, CRC(3e61f849) SHA1(efa0059bc843af0c3bb94f4bc0a8286ca5069179) )
5273   ROM_LOAD( "omni7d.l2",    0x1800, 0x0800, CRC(7130e9eb) SHA1(e6bb7a9b4f2fc001296e1060d0671b7a88599c8b) )
52742220
5275   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5276   ROM_LOAD( "colour.bin",   0x0000, 0x0020, CRC(57a45057) SHA1(d4ec6a54f72640e5b485aa59e206c090e67ff640) )
5277ROM_END
2221static DRIVER_INIT( moonqsr )
2222{
2223   UINT8 *decrypt = auto_malloc(0x8000);
52782224
5279ROM_START( uniwars )
5280   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5281   ROM_LOAD( "f07_1a.bin",   0x0000, 0x0800, CRC(d975af10) SHA1(a2e2a36a75db8fd09441308b08b6ae073c68b8cf) )
5282   ROM_LOAD( "h07_2a.bin",   0x0800, 0x0800, CRC(b2ed14c3) SHA1(7668df11f64b8e296eedfee53437777dc53a56d5) )
5283   ROM_LOAD( "k07_3a.bin",   0x1000, 0x0800, CRC(945f4160) SHA1(5fbe879f51e14c4c7ae551e5b3089f8e148770a4) )
5284   ROM_LOAD( "m07_4a.bin",   0x1800, 0x0800, CRC(ddc80bc5) SHA1(18c3920198baf87267bc7f12db6b23b090d3577a) )
5285   ROM_LOAD( "d08p_5a.bin",  0x2000, 0x0800, CRC(62354351) SHA1(85bf18942f73023b8be0c3659a0dcd3dfcccfc2c) )
5286   ROM_LOAD( "gg6",          0x2800, 0x0800, CRC(270a3f4d) SHA1(20f5097033fca515d70fe47178cbd341a1d07443) )
5287   ROM_LOAD( "m08p_7a.bin",  0x3000, 0x0800, CRC(c9245346) SHA1(239bad3fe64eaab2dfc3febd06d1124103a10504) )
5288   ROM_LOAD( "n08p_8a.bin",  0x3800, 0x0800, CRC(797d45c7) SHA1(76fb8b45fcce3622c59c04af32cfa001ef7bf71d) )
2225   /* video extensions */
2226   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, moonqsr_extend_tile_info, moonqsr_extend_sprite_info);
52892227
5290   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5291   ROM_LOAD( "egg10",        0x0000, 0x0800, CRC(012941e0) SHA1(4f7ec4d95939cb7c4086bb7df43759ac504ae47c) )
5292   ROM_LOAD( "h01_2.bin",    0x0800, 0x0800, CRC(c26132af) SHA1(7ae125a911dfd47aeca4f129f580762ce4d8d91a) )
5293   ROM_LOAD( "egg9",         0x1000, 0x0800, CRC(fc8b58fd) SHA1(72553e2735b0dcc2dcfce9698d49566732492588) )
5294   ROM_LOAD( "k01_2.bin",    0x1800, 0x0800, CRC(dcc2b33b) SHA1(c3a5ac935c519400dfabb28909f7e460769d1837) )
2228   /* decrypt program code */
2229   decode_mooncrst(0x8000, decrypt);
2230   memory_set_decrypted_region(0, 0x0000, 0x7fff, decrypt);
2231}
52952232
5296   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5297   ROM_LOAD( "uniwars.clr",  0x0000, 0x0020, CRC(25c79518) SHA1(e8f7e8b3d0cf1ed9d723948548f58abf0e2c6d1f) )
5298ROM_END
52992233
5300ROM_START( gteikoku )
5301   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5302   ROM_LOAD( "f07_1a.bin",   0x0000, 0x0800, CRC(d975af10) SHA1(a2e2a36a75db8fd09441308b08b6ae073c68b8cf) )
5303   ROM_LOAD( "h07_2a.bin",   0x0800, 0x0800, CRC(b2ed14c3) SHA1(7668df11f64b8e296eedfee53437777dc53a56d5) )
5304   ROM_LOAD( "k07_3a.bin",   0x1000, 0x0800, CRC(945f4160) SHA1(5fbe879f51e14c4c7ae551e5b3089f8e148770a4) )
5305   ROM_LOAD( "m07_4a.bin",   0x1800, 0x0800, CRC(ddc80bc5) SHA1(18c3920198baf87267bc7f12db6b23b090d3577a) )
5306   ROM_LOAD( "d08p_5a.bin",  0x2000, 0x0800, CRC(62354351) SHA1(85bf18942f73023b8be0c3659a0dcd3dfcccfc2c) )
5307   ROM_LOAD( "e08p_6a.bin",  0x2800, 0x0800, CRC(d915a389) SHA1(0e2ff6eec9453856a1276889946b463cfae58eba) )
5308   ROM_LOAD( "m08p_7a.bin",  0x3000, 0x0800, CRC(c9245346) SHA1(239bad3fe64eaab2dfc3febd06d1124103a10504) )
5309   ROM_LOAD( "n08p_8a.bin",  0x3800, 0x0800, CRC(797d45c7) SHA1(76fb8b45fcce3622c59c04af32cfa001ef7bf71d) )
2234static DRIVER_INIT( pacmanbl )
2235{
2236   /* same as galaxian... */
2237   DRIVER_INIT_CALL(galaxian);
53102238
5311   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5312   ROM_LOAD( "h01_1.bin",    0x0000, 0x0800, CRC(8313c959) SHA1(b09157c6f824d6e94647728cbb329877fcb4e502) )
5313   ROM_LOAD( "h01_2.bin",    0x0800, 0x0800, CRC(c26132af) SHA1(7ae125a911dfd47aeca4f129f580762ce4d8d91a) )
5314   ROM_LOAD( "k01_1.bin",    0x1000, 0x0800, CRC(c9d4537e) SHA1(65d27066ffec04b755d2f5d3f36f5ec6792e8d6c) )
5315   ROM_LOAD( "k01_2.bin",    0x1800, 0x0800, CRC(dcc2b33b) SHA1(c3a5ac935c519400dfabb28909f7e460769d1837) )
2239   /* ...but coin lockout disabled/disconnected */
2240   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP);
53162241
5317   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5318   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
5319ROM_END
2242   /* also shift the sprite clip offset */
2243   galaxian_sprite_clip_start = 7;
2244   galaxian_sprite_clip_end = 246;
2245}
53202246
5321ROM_START( gteikokb )
5322   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5323   ROM_LOAD( "1.bin",        0x0000, 0x0800, CRC(bf00252f) SHA1(a4ec48c6b9468f52bcf8b01d1bdb908dcf81d42d) )
5324   ROM_LOAD( "2.bin",        0x0800, 0x0800, CRC(f712b7d5) SHA1(c269db2e9984a3fbd33888bd426c53d319cad36f) )
5325   ROM_LOAD( "k07_3a.bin",   0x1000, 0x0800, CRC(945f4160) SHA1(5fbe879f51e14c4c7ae551e5b3089f8e148770a4) )
5326   ROM_LOAD( "4.bin",        0x1800, 0x0800, CRC(808a39a8) SHA1(f3db5175d0c2d10e9e3ded400888f6541490597e) )
5327   ROM_LOAD( "5.bin",       0x2000, 0x0800, CRC(36fe6e67) SHA1(e54a19ad6611fefcdfcf74019a63cc6cea6cf433) )
5328   ROM_LOAD( "6.bin",       0x2800, 0x0800, CRC(c5ea67e8) SHA1(0157eb2ef5ab56cd00e5f4fafd618271d2d4862b) )
5329   ROM_LOAD( "m08p_7a.bin",  0x3000, 0x0800, CRC(c9245346) SHA1(239bad3fe64eaab2dfc3febd06d1124103a10504) )
5330   ROM_LOAD( "8.bin",       0x3800, 0x0800, CRC(28df3229) SHA1(fd307c6a7de4fcddce1c2f36a957a31b9a6aaa21) )
53312247
5332   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5333   ROM_LOAD( "h01_1.bin",    0x0000, 0x0800, CRC(8313c959) SHA1(b09157c6f824d6e94647728cbb329877fcb4e502) )
5334   ROM_LOAD( "h01_2.bin",    0x0800, 0x0800, CRC(c26132af) SHA1(7ae125a911dfd47aeca4f129f580762ce4d8d91a) )
5335   ROM_LOAD( "k01_1.bin",    0x1000, 0x0800, CRC(c9d4537e) SHA1(65d27066ffec04b755d2f5d3f36f5ec6792e8d6c) )
5336   ROM_LOAD( "k01_2.bin",    0x1800, 0x0800, CRC(dcc2b33b) SHA1(c3a5ac935c519400dfabb28909f7e460769d1837) )
2248static DRIVER_INIT( devilfsg )
2249{
2250   /* video extensions */
2251   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL);
53372252
5338   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5339   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
5340ROM_END
2253   /* IRQ line is INT, not NMI */
2254   irq_line = 0;
2255}
53412256
5342ROM_START( gteikob2 )
5343   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5344   ROM_LOAD( "94gnog.bin",   0x0000, 0x0800, CRC(67ec3235) SHA1(f250db867257f474f693012c11008bf92f038cc7) )
5345   ROM_LOAD( "92gnog.bin",   0x0800, 0x0800, CRC(813c41f2) SHA1(bd92e0b53e3c8874d63f3444bca02246cd74b1c6) )
5346   ROM_LOAD( "k07_3a.bin",   0x1000, 0x0800, CRC(945f4160) SHA1(5fbe879f51e14c4c7ae551e5b3089f8e148770a4) )
5347   ROM_LOAD( "1gnog.bin",    0x1800, 0x0800, CRC(49ff9658) SHA1(3b7f3dc40b3fbc7d4abe5f5d534951c70409148c) )
5348   ROM_LOAD( "5.bin",       0x2000, 0x0800, CRC(36fe6e67) SHA1(e54a19ad6611fefcdfcf74019a63cc6cea6cf433) )
5349   ROM_LOAD( "e08p_6a.bin",  0x2800, 0x0800, CRC(d915a389) SHA1(0e2ff6eec9453856a1276889946b463cfae58eba) )
5350   ROM_LOAD( "m08p_7a.bin",  0x3000, 0x0800, CRC(c9245346) SHA1(239bad3fe64eaab2dfc3febd06d1124103a10504) )
5351   ROM_LOAD( "98gnog.bin",   0x3800, 0x0800, CRC(e9d4ad3c) SHA1(b32b96bebbf59e23b06958f6b16790e9f9f334e2) )
53522257
5353   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5354   ROM_LOAD( "h01_1.bin",    0x0000, 0x0800, CRC(8313c959) SHA1(b09157c6f824d6e94647728cbb329877fcb4e502) )
5355   ROM_LOAD( "h01_2.bin",    0x0800, 0x0800, CRC(c26132af) SHA1(7ae125a911dfd47aeca4f129f580762ce4d8d91a) )
5356   ROM_LOAD( "k01_1.bin",    0x1000, 0x0800, CRC(c9d4537e) SHA1(65d27066ffec04b755d2f5d3f36f5ec6792e8d6c) )
5357   ROM_LOAD( "k01_2.bin",    0x1800, 0x0800, CRC(dcc2b33b) SHA1(c3a5ac935c519400dfabb28909f7e460769d1837) )
2258static DRIVER_INIT( zigzag )
2259{
2260   /* video extensions */
2261   common_init(machine, NULL, galaxian_draw_background, NULL, NULL);
53582262
5359   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5360   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
5361ROM_END
2263   /* make ROMs 2 & 3 swappable */
2264   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, 0, 0, SMH_BANK1);
2265   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, SMH_BANK2);
2266   memory_configure_bank(1, 0, 2, memory_region(REGION_CPU1) + 0x2000, 0x1000);
2267   memory_configure_bank(2, 0, 2, memory_region(REGION_CPU1) + 0x2000, 0x1000);
53622268
5363ROM_START( spacbatt )
5364   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5365   ROM_LOAD( "sb1",    0x0000, 0x0800, CRC(d975af10) SHA1(a2e2a36a75db8fd09441308b08b6ae073c68b8cf) ) /* Same as f07_1a.bin above */
5366   ROM_LOAD( "sb2",    0x0800, 0x0800, CRC(b2ed14c3) SHA1(7668df11f64b8e296eedfee53437777dc53a56d5) ) /* Same as h07_2a.bin above */
5367   ROM_LOAD( "sb3",    0x1000, 0x0800, CRC(945f4160) SHA1(5fbe879f51e14c4c7ae551e5b3089f8e148770a4) ) /* Same as k07_3a.bin above */
5368   ROM_LOAD( "sb4",    0x1800, 0x0800, CRC(8229835c) SHA1(8cfd8f6cab6f80ca69645a184f7e841fc69f47f6) )
5369   ROM_LOAD( "sb5",    0x2000, 0x0800, CRC(f51ef930) SHA1(213e68571a0c7d5ba33a7170d5fa4aea898ea0b9) )
5370   ROM_LOAD( "sb6",    0x2800, 0x0800, CRC(d915a389) SHA1(0e2ff6eec9453856a1276889946b463cfae58eba) ) /* Same as e08p_6a.bin above */
5371   ROM_LOAD( "sb7",    0x3000, 0x0800, CRC(c9245346) SHA1(239bad3fe64eaab2dfc3febd06d1124103a10504) ) /* Same as m08p_7a.bin above */
5372   ROM_LOAD( "sb8",    0x3800, 0x0800, CRC(e59ff1ae) SHA1(fef22885cbd3273882f8c7755dd04c28e843b9ea) )
2269   /* handler for doing the swaps */
2270   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7002, 0x7002, 0, 0x07f8, zigzag_bankswap_w);
2271   zigzag_bankswap_w(machine, 0, 0);
53732272
5374   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5375   ROM_LOAD( "sb12",   0x0000, 0x0800, CRC(8313c959) SHA1(b09157c6f824d6e94647728cbb329877fcb4e502) ) /* Same as h01_1.bin above */
5376   ROM_LOAD( "sb14",   0x0800, 0x0800, CRC(c26132af) SHA1(7ae125a911dfd47aeca4f129f580762ce4d8d91a) ) /* Same as h01_2.bin above */
5377   ROM_LOAD( "sb11",   0x1000, 0x0800, CRC(c9d4537e) SHA1(65d27066ffec04b755d2f5d3f36f5ec6792e8d6c) ) /* Same as k01_1.bin above */
5378   ROM_LOAD( "sb13",   0x1800, 0x0800, CRC(92454380) SHA1(f0cd67b39c760c2b5ac549b27b0a5f83fbb3a86b) )
2273   /* coin lockout disabled */
2274   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP);
53792275
5380   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5381   ROM_LOAD( "6l.bpr", 0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) ) /* MMI 6331 bp-prom, compatible with 82s123 */
5382ROM_END
2276   /* remove the galaxian sound hardware */
2277   unmap_galaxian_sound(0x6000);
53832278
5384ROM_START( spacbat2 )
5385   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5386   ROM_LOAD( "sb1",    0x0000, 0x0800, CRC(d975af10) SHA1(a2e2a36a75db8fd09441308b08b6ae073c68b8cf) ) /* Same as f07_1a.bin above */
5387   ROM_LOAD( "sb2",    0x0800, 0x0800, CRC(b2ed14c3) SHA1(7668df11f64b8e296eedfee53437777dc53a56d5) ) /* Same as h07_2a.bin above */
5388   ROM_LOAD( "sb.3",   0x1000, 0x0800, CRC(c25ce4c1) SHA1(d7a5d435df7868155523d2fb90f331d4b6d9eaa1) )
5389   ROM_LOAD( "sb4",    0x1800, 0x0800, CRC(8229835c) SHA1(8cfd8f6cab6f80ca69645a184f7e841fc69f47f6) )
5390   ROM_LOAD( "sb5",    0x2000, 0x0800, CRC(f51ef930) SHA1(213e68571a0c7d5ba33a7170d5fa4aea898ea0b9) )
5391   ROM_LOAD( "sb6",    0x2800, 0x0800, CRC(d915a389) SHA1(0e2ff6eec9453856a1276889946b463cfae58eba) ) /* Same as e08p_6a.bin above */
5392   ROM_LOAD( "sb7",    0x3000, 0x0800, CRC(c9245346) SHA1(239bad3fe64eaab2dfc3febd06d1124103a10504) ) /* Same as m08p_7a.bin above */
5393   ROM_LOAD( "sb8",    0x3800, 0x0800, CRC(e59ff1ae) SHA1(fef22885cbd3273882f8c7755dd04c28e843b9ea) )
2279   /* install our AY-8910 handler */
2280   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4fff, 0, 0, zigzag_ay8910_w);
2281}
53942282
5395   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5396   ROM_LOAD( "sb12",      0x0000, 0x0800, CRC(8313c959) SHA1(b09157c6f824d6e94647728cbb329877fcb4e502) ) /* Same as h01_1.bin above */
5397   ROM_LOAD( "sb14",      0x0800, 0x0800, CRC(c26132af) SHA1(7ae125a911dfd47aeca4f129f580762ce4d8d91a) ) /* Same as h01_2.bin above */
5398   ROM_LOAD( "sb11",      0x1000, 0x0800, CRC(c9d4537e) SHA1(65d27066ffec04b755d2f5d3f36f5ec6792e8d6c) ) /* Same as k01_1.bin above */
5399   ROM_LOAD( "k01_2.bin", 0x1800, 0x0800, CRC(dcc2b33b) SHA1(c3a5ac935c519400dfabb28909f7e460769d1837) )
54002283
5401   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5402   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
5403ROM_END
2284static DRIVER_INIT( jumpbug )
2285{
2286   /* video extensions */
2287   common_init(machine, scramble_draw_bullet, jumpbug_draw_background, jumpbug_extend_tile_info, jumpbug_extend_sprite_info);
2288}
54042289
5405ROM_START( skyraidr )
5406   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5407   ROM_LOAD( "f07_1a.bin",   0x0000, 0x0800, CRC(d975af10) SHA1(a2e2a36a75db8fd09441308b08b6ae073c68b8cf) )
5408   ROM_LOAD( "h07_2a.bin",   0x0800, 0x0800, CRC(b2ed14c3) SHA1(7668df11f64b8e296eedfee53437777dc53a56d5) )
5409   ROM_LOAD( "k07_3a.bin",   0x1000, 0x0800, CRC(945f4160) SHA1(5fbe879f51e14c4c7ae551e5b3089f8e148770a4) )
5410   ROM_LOAD( "sr.04",        0x1800, 0x0800, CRC(9f61d1f8) SHA1(389b0a0d1a577b302907b2ea4c119aa18a6120d9) )
5411   ROM_LOAD( "sr.05",        0x2000, 0x0800, CRC(4352af0a) SHA1(1b31846ea7025aaf3a79141dfa5a089b8d12d982) )
5412   ROM_LOAD( "sr.06",        0x2800, 0x0800, CRC(d915a389) SHA1(0e2ff6eec9453856a1276889946b463cfae58eba) )
5413   ROM_LOAD( "m08p_7a.bin",  0x3000, 0x0800, CRC(c9245346) SHA1(239bad3fe64eaab2dfc3febd06d1124103a10504) )
5414   ROM_LOAD( "n08p_8a.bin",  0x3800, 0x0800, CRC(797d45c7) SHA1(76fb8b45fcce3622c59c04af32cfa001ef7bf71d) )
54152290
5416   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5417   ROM_LOAD( "sr.10",        0x0000, 0x0800, CRC(af069cba) SHA1(12b7d0a57f43613c80afd51c417628090740aabe) )
5418   ROM_LOAD( "h01_2.bin",    0x0800, 0x0800, CRC(c26132af) SHA1(7ae125a911dfd47aeca4f129f580762ce4d8d91a) )
5419   ROM_LOAD( "sr.09",        0x1000, 0x0800, CRC(ff2c20d5) SHA1(48668dc4f008f44f5c15bdcc331cfe133da99cd4) )
5420   ROM_LOAD( "k01_2.bin",    0x1800, 0x0800, CRC(dcc2b33b) SHA1(c3a5ac935c519400dfabb28909f7e460769d1837) )
2291static DRIVER_INIT( checkman )
2292{
2293   /* video extensions */
2294   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
54212295
5422   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5423   ROM_LOAD( "uniwars.clr",  0x0000, 0x0020, CRC(25c79518) SHA1(e8f7e8b3d0cf1ed9d723948548f58abf0e2c6d1f) )
5424ROM_END
2296   /* move the interrupt enable from $b000 to $b001 */
2297   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0x7f8, SMH_UNMAP);
2298   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w);
54252299
5426ROM_START( batman2 )
5427   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5428   ROM_LOAD( "01.bin",         0x0000, 0x0800, CRC(150fbca5) SHA1(a5dc104169eb3225c6200e7e07102f8a9bee6861) )
5429   ROM_LOAD( "02.bin",       0x0800, 0x0800, CRC(b1624fd0) SHA1(ca4678cf7a8b935be2f68d6e342c1f961bf6f1a2) )
5430   ROM_LOAD( "03.bin",       0x1000, 0x0800, CRC(93774188) SHA1(8bdd3290db43459c56b932b582f555d89df30bd1) )
5431   ROM_LOAD( "04.bin",       0x1800, 0x0800, CRC(8a94ec6c) SHA1(dacadab9a05ddee2de188b368f795d74213e020d) )
5432   ROM_LOAD( "05.bin",       0x2000, 0x0800, CRC(a3669461) SHA1(11ea7aa9b55f5790cc2451d80d0eb84388cf47eb) )
5433   ROM_LOAD( "06.bin",       0x2800, 0x0800, CRC(fa1efbfe) SHA1(f7222dd21e0810d0c8c32919ebb6e0e7bbb4c68e) )
5434   ROM_LOAD( "07.bin",       0x3000, 0x0800, CRC(9b77debd) SHA1(1f5521bc0f701d86e61219ad3b9516aaa71a68da) )
5435   ROM_LOAD( "08.bin",       0x3800, 0x0800, CRC(6466177e) SHA1(fc359eadee34586576c557ff7c1dd2c8d49bdf3f) )
2300   /* attach the sound command handler */
2301   memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0xffff, checkman_sound_command_w);
54362302
5437   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5438   ROM_LOAD( "09.bin",       0x0000, 0x0800, CRC(1a657b1f) SHA1(42149dafdde7d9104f0bddda2223bfc211d0154a) )
5439   ROM_LOAD( "11.bin",       0x0800, 0x0800, CRC(7a2b48e5) SHA1(f559799c685dd2cb9de06a356bee95b7d6ffadfc) )
5440   ROM_LOAD( "10.bin",       0x1000, 0x0800, CRC(9b570016) SHA1(44fd2b1caeecdc5200d63c35636f0a605943d30c) )
5441   ROM_LOAD( "12.bin",       0x1800, 0x0800, CRC(73956244) SHA1(e464b587b5ed636816cc9688593f5b6005cb5216) )
2303   /* decrypt program code */
2304   decode_checkman();
2305}
54422306
5443   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5444   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
5445ROM_END
54462307
5447ROM_START( warofbug )
5448   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5449   ROM_LOAD( "warofbug.u",   0x0000, 0x0800, CRC(b8dfb7e3) SHA1(c7c675b2638869a9cd7dbd554e6131d8c71b567a) )
5450   ROM_LOAD( "warofbug.v",   0x0800, 0x0800, CRC(fd8854e0) SHA1(b39ab41b834f18341968dd780f0a3cd07d70c16c) )
5451   ROM_LOAD( "warofbug.w",   0x1000, 0x0800, CRC(4495aa14) SHA1(f1be281db1d831770efa9cc41ea87eb348e70108) )
5452   ROM_LOAD( "warofbug.y",   0x1800, 0x0800, CRC(c14a541f) SHA1(d32e89fd18d9e1db2e4a545186eac728c0b02255) )
5453   ROM_LOAD( "warofbug.z",   0x2000, 0x0800, CRC(c167fe55) SHA1(d85c4d1bd7aa5e14eb2f11dfa14979e5dbc084a8) )
2308static DRIVER_INIT( checkmaj )
2309{
2310   /* video extensions */
2311   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL);
54542312
5455   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5456   ROM_LOAD( "warofbug.1k",  0x0000, 0x0800, CRC(8100fa85) SHA1(06641c431cace36dec98b87555f62e72f3e53a31) )
5457   ROM_LOAD( "warofbug.1j",  0x0800, 0x0800, CRC(d1220ae9) SHA1(e892bc8b0b71d8b07503e474e9c30e6cab460682) )
2313   /* attach the sound command handler */
2314   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7800, 0x7800, 0, 0x7ff, checkman_sound_command_w);
54582315
5459   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5460   ROM_LOAD( "warofbug.clr", 0x0000, 0x0020, CRC(8688e64b) SHA1(ed13414257f580b98b50c9892a14159c55e7838d) )
5461ROM_END
2316   /* for the title screen */
2317   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3800, 0x3800, 0, 0, checkmaj_protection_r);
2318}
54622319
5463ROM_START( redufo )
5464   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5465   ROM_LOAD( "ru1a",         0x0000, 0x0800, CRC(5a8e4f37) SHA1(c0957ede91e2dc3f80e4912b877843aed5d15779) )
5466   ROM_LOAD( "ru2a",         0x0800, 0x0800, CRC(c624f52d) SHA1(119a660513ad33e35c9bdaecd588219bf8026d82) )
5467   ROM_LOAD( "ru3a",         0x1000, 0x0800, CRC(e1030d1c) SHA1(80640fbbfa7f84c016366b1084e7f8a7acdcd440) )
5468   ROM_LOAD( "ru4a",         0x1800, 0x0800, CRC(7692069e) SHA1(5130d61c857c3b85eadabcf10f3a6771c72f0f56) )
5469   ROM_LOAD( "ru5a",         0x2000, 0x0800, CRC(cb648ff3) SHA1(e0042251ca7f4a31b5bd9f8cca35278a1e152899) )
5470   ROM_LOAD( "ru6a",         0x2800, 0x0800, CRC(e1a9f58e) SHA1(4fc7489fca057156a7cf5efcb01058ce4f0db69e) )
54712320
5472   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5473   ROM_LOAD( "ruhja",        0x0000, 0x0800, CRC(8a422b0d) SHA1(b886157518f73e7115a225ba230e456179f6e18f) )
5474   ROM_LOAD( "rukla",        0x0800, 0x0800, CRC(1eb84cb1) SHA1(08f360802a90039c0499a1417d06b6eb5f89d67e) )
2321static DRIVER_INIT( dingo )
2322{
2323   /* video extensions */
2324   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL);
54752325
5476   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5477   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
5478ROM_END
2326   /* attach the sound command handler */
2327   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7800, 0x7800, 0, 0x7ff, checkman_sound_command_w);
54792328
5480ROM_START( exodus )
5481   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5482   ROM_LOAD( "exodus1.bin",  0x0000, 0x0800, CRC(5dfe65e1) SHA1(5f1ce289b3c98a89d61d4dea952b4b8888d92ed7) )
5483   ROM_LOAD( "exodus2.bin",  0x0800, 0x0800, CRC(6559222f) SHA1(520497f6fb2b0c76be8419702e8af894283ebf0b) )
5484   ROM_LOAD( "exodus3.bin",  0x1000, 0x0800, CRC(bf7030e8) SHA1(59b0624dd91527a916ee6a27d61def82c3c14f49) )
5485   ROM_LOAD( "exodus4.bin",  0x1800, 0x0800, CRC(3607909e) SHA1(93d074fe4b258d496a0998acb3fc47f0a762227a) )
5486   ROM_LOAD( "exodus9.bin",  0x2000, 0x0800, CRC(994a90c4) SHA1(a07e3ce8f69042c45ebe00ab1d40dbb85602a7a2) )
5487   ROM_LOAD( "exodus10.bin", 0x2800, 0x0800, CRC(fbd11187) SHA1(a3bd49c4a79e76b08e6b343b94689159dc239458) )
5488   ROM_LOAD( "exodus11.bin", 0x3000, 0x0800, CRC(fd07d811) SHA1(6b968a7ce452f76a8d26fe694aa4ea6b16e8b6fa) )
2329   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3000, 0, 0, dingo_3000_r);
2330   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3035, 0x3035, 0, 0, dingo_3035_r);
2331}
54892332
5490   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5491   ROM_LOAD( "exodus5.bin",  0x0000, 0x0800, CRC(b34c7cb4) SHA1(146ed4a02d7540378f4a27a6643055216ad403f7) )
5492   ROM_LOAD( "exodus6.bin",  0x0800, 0x0800, CRC(50a2d447) SHA1(1f97d1096ad2a3a43a480cb1f040f4534fada3c3) )
54932333
5494   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5495   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
5496ROM_END
2334static DRIVER_INIT( dingoe )
2335{
2336   /* video extensions */
2337   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
54972338
5498ROM_START( streakng )
5499   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5500   ROM_LOAD( "sk1",          0x0000, 0x1000, CRC(c8866ccb) SHA1(1fc8bc643ecbfa86a50448d79b299f5a3dd586c5) )
5501   ROM_LOAD( "sk2",          0x1000, 0x1000, CRC(7caea29b) SHA1(5b3946ee914b1637db9046abf92d66ceaeb4fc5f) )
5502   ROM_LOAD( "sk3",          0x2000, 0x1000, CRC(7b4bfa76) SHA1(9223bec0c1cc39bc84670869b2a4fab0d0167c6e) )
5503   ROM_LOAD( "sk4",          0x3000, 0x1000, CRC(056fc921) SHA1(de8525571e5a82ddf74dd57b1a6c5bc9f2d2c0fe) )
2339   /* move the interrupt enable from $b000 to $b001 */
2340   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0x7f8, SMH_UNMAP);
2341   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w);
55042342
5505   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5506   ROM_LOAD( "sk5",          0x0000, 0x1000, CRC(d27f1e0c) SHA1(c3b4ae55a93516b034a16c9f943b360b24c933d6) )
5507   ROM_LOAD( "sk6",          0x1000, 0x1000, CRC(a7089588) SHA1(e76242b043b1d8f060f669da3ddeee3d10122cdb) )
2343   /* attach the sound command handler */
2344   memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0xffff, checkman_sound_command_w);
55082345
5509   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5510   ROM_LOAD( "sk.bpr",       0x0000, 0x0020, CRC(bce79607) SHA1(49d60fde149240bcd025f721b0fbbbdbc549a42f) )
5511ROM_END
2346   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3001, 0x3001, 0, 0, dingoe_3001_r);   /* Protection check */
55122347
5513ROM_START( pacmanbl )
5514   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5515   ROM_LOAD( "blpac1b",      0x0000, 0x0800, CRC(6718df42) SHA1(ee15c3f583d381fba4878f824f83d04479a0cee5) )
5516   ROM_LOAD( "blpac2b",      0x0800, 0x0800, CRC(33be3648) SHA1(50175889cf37fe8a81c931e009b55d10f8d0444a) )
5517   ROM_LOAD( "blpac3b",      0x1000, 0x0800, CRC(f98c0ceb) SHA1(4faf8b2fb3f109d1196a9ea256328485074a31b9) )
5518   ROM_LOAD( "blpac4b",      0x1800, 0x0800, CRC(a9cd0082) SHA1(f44ff1ad15d5ee3096f8f44f9c605f32ae2737d9) )
5519   ROM_LOAD( "blpac5b",      0x2000, 0x0800, CRC(6d475afc) SHA1(4fe6bde352c7dd9572fefaae4b59640b4f4eb8ba) )
5520   ROM_LOAD( "blpac6b",      0x2800, 0x0800, CRC(cbe863d3) SHA1(97a2ffa6ab33e6061c664dcd1ee57c86a456782f) )
5521   ROM_LOAD( "blpac7b",      0x3000, 0x0800, CRC(7daef758) SHA1(4dc8ec0ea8fc04d5bffc1c1335407729309c17f0) )
2348   /* decrypt program code */
2349   decode_dingoe();
2350}
55222351
5523   /* note from f205v: on the PCB I have, 10b and 11b have been joined into one single 2732 EPROM labeled "pmc31"
5524    The same goes for 9b and 12b, joined into one single 2732 EPROM labeled "pmc42" */
5525   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5526   ROM_LOAD( "blpac12b",     0x0000, 0x0800, CRC(b2ed320b) SHA1(680a6fdcb65cc2d88d10bc85e0b2628f43375c5c) )
5527   ROM_LOAD( "blpac11b",     0x0800, 0x0800, CRC(ab88b2c4) SHA1(d0c829ea8021eae81a2b82d36c35ad8258b115e0) )
5528   ROM_LOAD( "blpac10b",     0x1000, 0x0800, CRC(44a45b72) SHA1(8abd0684a01d6c23ef5cf5f0765458f982316acf) )
5529   ROM_LOAD( "blpac9b",      0x1800, 0x0800, CRC(fa84659f) SHA1(20c212723f9062f052539190dfe3fc41577543eb) )
55302352
5531   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5532   ROM_LOAD( "blpaccp",      0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) ) /* same as pisces */
5533ROM_END
2353static DRIVER_INIT( skybase )
2354{
2355   /* video extensions */
2356   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, pisces_extend_tile_info, pisces_extend_sprite_info);
55342357
5535ROM_START( devilfsg )
5536   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5537   ROM_LOAD( "dfish1.7f",    0x2000, 0x0800, CRC(2ab19698) SHA1(8450981d3cf3fa8abf2fb5487aa98b03a4cf03a1) )
5538   ROM_CONTINUE(             0x0000, 0x0800 )
5539   ROM_LOAD( "dfish2.7h",    0x2800, 0x0800, CRC(4e77f097) SHA1(aeaa5ff210ccbbe77114edf5dee992d2720636ae) )
5540   ROM_CONTINUE(             0x0800, 0x0800 )
5541   ROM_LOAD( "dfish3.7k",    0x3000, 0x0800, CRC(3f16a4c6) SHA1(cc30b27070a12c250cdc2f7289bae7c7a4c05c2c) )
5542   ROM_CONTINUE(             0x1000, 0x0800 )
5543   ROM_LOAD( "dfish4.7m",    0x3800, 0x0800, CRC(11fc7e59) SHA1(2c0182a75bfca085e67483b421f40b3bc9b8ef24) )
5544   ROM_CONTINUE(             0x1800, 0x0800 )
2358   /* coin lockout replaced by graphics bank */
2359   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa002, 0xa002, 0, 0x7f8, galaxian_gfxbank_w);
55452360
5546   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5547   ROM_LOAD( "dfish5.1h",    0x1000, 0x0800, CRC(ace6e31f) SHA1(23df890fdf8ef275af79e10c8e43ff3a617b28ac) )
5548   ROM_CONTINUE(             0x0000, 0x0800 )
5549   ROM_LOAD( "dfish6.1k",    0x1800, 0x0800, CRC(d7a6c4c4) SHA1(ec5f9182657edb11884ab93f868f1bb3569461ae) )
5550   ROM_CONTINUE(             0x0800, 0x0800 )
2361   /* needs a full 2k of RAM */
2362   memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, SMH_BANK1, SMH_BANK1);
2363   memory_set_bankptr(1, auto_malloc(0x800));
55512364
5552   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5553   ROM_LOAD( "82s123.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
5554ROM_END
2365   /* extend ROM */
2366   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x5fff, 0, 0, SMH_BANK2);
2367   memory_set_bankptr(2, memory_region(REGION_CPU1));
2368}
55552369
5556ROM_START( zigzag )
5557   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5558   ROM_LOAD( "zz_d1.bin",    0x0000, 0x1000, CRC(8cc08d81) SHA1(be671192ef06dc3ed6963dc39e6bdce3275300e9) )
5559   ROM_LOAD( "zz_d2.bin",    0x1000, 0x1000, CRC(326d8d45) SHA1(563b9fc64c34e36cfadffb107ce30d3a04d62d9c) )
5560   ROM_LOAD( "zz_d4.bin",    0x2000, 0x1000, CRC(a94ed92a) SHA1(d56f32fc2b3f0f7affe658b7726682c60d09bc16) )
5561   ROM_LOAD( "zz_d3.bin",    0x3000, 0x1000, CRC(ce5e7a00) SHA1(93c47d22698a016cb0f0b654ade9ccab0cd1c88b) )
55622370
5563   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5564   ROM_LOAD( "zz_6_h1.bin",  0x0000, 0x0800, CRC(780c162a) SHA1(b0cac68258281917bcada52ce26e0ce38721d633) )
5565   ROM_CONTINUE(             0x1000, 0x0800 )
5566   ROM_LOAD( "zz_5.bin",     0x0800, 0x0800, CRC(f3cdfec5) SHA1(798d631c72d8e6b2e372b4b3ab0c10d8365a1359) )
5567   ROM_CONTINUE(             0x1800, 0x0800 )
2371static DRIVER_INIT( mshuttle )
2372{
2373   /* video extensions */
2374   common_init(machine, mshuttle_draw_bullet, galaxian_draw_background, mshuttle_extend_tile_info, mshuttle_extend_sprite_info);
55682375
5569   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5570   ROM_LOAD( "zzbp_e9.bin",  0x0000, 0x0020, CRC(aa486dd0) SHA1(b845b52715bf6361ceee8c1ac541733963bd47af) )
5571ROM_END
2376   /* IRQ line is INT, not NMI */
2377   irq_line = 0;
55722378
5573ROM_START( zigzag2 )
5574   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5575   ROM_LOAD( "z1",           0x0000, 0x1000, CRC(4c28349a) SHA1(646134ce506deaee88cc2ec5a973f8fedaddb66b) )
5576   ROM_LOAD( "zz_d2.bin",    0x1000, 0x1000, CRC(326d8d45) SHA1(563b9fc64c34e36cfadffb107ce30d3a04d62d9c) )
5577   ROM_LOAD( "zz_d4.bin",    0x2000, 0x1000, CRC(a94ed92a) SHA1(d56f32fc2b3f0f7affe658b7726682c60d09bc16) )
5578   ROM_LOAD( "zz_d3.bin",    0x3000, 0x1000, CRC(ce5e7a00) SHA1(93c47d22698a016cb0f0b654ade9ccab0cd1c88b) )
2379   /* decrypt the code */
2380   mshuttle_decode();
2381}
55792382
5580   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5581   ROM_LOAD( "zz_6_h1.bin",  0x0000, 0x0800, CRC(780c162a) SHA1(b0cac68258281917bcada52ce26e0ce38721d633) )
5582   ROM_CONTINUE(             0x1000, 0x0800 )
5583   ROM_LOAD( "zz_5.bin",     0x0800, 0x0800, CRC(f3cdfec5) SHA1(798d631c72d8e6b2e372b4b3ab0c10d8365a1359) )
5584   ROM_CONTINUE(             0x1800, 0x0800 )
55852383
5586   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5587   ROM_LOAD( "zzbp_e9.bin",  0x0000, 0x0020, CRC(aa486dd0) SHA1(b845b52715bf6361ceee8c1ac541733963bd47af) )
5588ROM_END
2384static DRIVER_INIT( mshuttlj )
2385{
2386   /* video extensions */
2387   common_init(machine, mshuttle_draw_bullet, galaxian_draw_background, mshuttle_extend_tile_info, mshuttle_extend_sprite_info);
55892388
5590ROM_START( mooncrgx )
5591   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5592   ROM_LOAD( "1",            0x0000, 0x0800, CRC(84cf420b) SHA1(82c979467c51df699337d5878340d05bee606480) )
5593   ROM_LOAD( "2",            0x0800, 0x0800, CRC(4c2a61a1) SHA1(a3759bd2c062f2843cd5b812529c798d5d12086c) )
5594   ROM_LOAD( "3",            0x1000, 0x0800, CRC(1962523a) SHA1(56ea003c3ff37c2bc33383207fccde0ba0ed781a) )
5595   ROM_LOAD( "4",            0x1800, 0x0800, CRC(75dca896) SHA1(017d04501d3d1305491ba843d92ebd74d47d2f9c) )
5596   ROM_LOAD( "5",            0x2000, 0x0800, CRC(32483039) SHA1(23baf136d5b7fc02f999dcb31b8daf68b6ffafd1) )
5597   ROM_LOAD( "6",            0x2800, 0x0800, CRC(43f2ab89) SHA1(f7f0802a12fd89d61f6f00044e077f34a9d3955f) )
5598   ROM_LOAD( "7",            0x3000, 0x0800, CRC(1e9c168c) SHA1(891dc159dfc343322c3241980a0ef76dee510ca9) )
5599   ROM_LOAD( "8",            0x3800, 0x0800, CRC(5e09da94) SHA1(677890912db12df6fa2cb515c198f8ac3f7187af) )
2389   /* IRQ line is INT, not NMI */
2390   irq_line = 0;
56002391
5601   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5602   ROM_LOAD( "1h_1_10.bin",  0x0000, 0x0800, CRC(528da705) SHA1(d726ee18b79774c982f88afb2a508eb5d5783193) )
5603   ROM_LOAD( "12.chr",       0x0800, 0x0800, CRC(5a4b17ea) SHA1(8a879dc34fdecc8a121c4a87abb981212fb05945) )
5604   ROM_LOAD( "9.chr",        0x1000, 0x0800, CRC(70df525c) SHA1(f771293494a2234bf80f206ecf1e88773322e503) )
5605   ROM_LOAD( "11.chr",       0x1800, 0x0800, CRC(e0edccbd) SHA1(0839a4c9b6e863d12253ae8e1732e80e08702228) )
2392   /* decrypt the code */
2393   cclimbrj_decode();
2394}
56062395
5607   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5608   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
5609ROM_END
56102396
5611ROM_START( omega )
5612   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5613   ROM_LOAD( "omega1.bin",   0x0000, 0x0800, CRC(fc2a096b) SHA1(071ff30060a1aa0a47ae6e88140b80caed00fc4e) )
5614   ROM_LOAD( "omega2.bin",   0x0800, 0x0800, CRC(ad100357) SHA1(7c5e82c25e65b4a390cf5607f15bf4df407f7f11) )
5615   ROM_LOAD( "omega3.bin",   0x1000, 0x0800, CRC(d7e3be79) SHA1(ffa228043c6c717bee8bbec16432dcfe2e348aef) )
5616   ROM_LOAD( "omega4.bin",   0x1800, 0x0800, CRC(42068171) SHA1(940ca30a5772940b8a437498d22c6121482b38e6) )
5617   ROM_LOAD( "omega5.bin",   0x2000, 0x0800, CRC(d8a93383) SHA1(5f60f127360b14206d4df638e528bf961049e37d) )
5618   ROM_LOAD( "omega6.bin",   0x2800, 0x0800, CRC(32a42f44) SHA1(94f458997ec279dce218a17b665fa8c46067e646) )
2397static DRIVER_INIT( kingball )
2398{
2399   /* video extensions */
2400   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL);
56192401
5620   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5621   ROM_LOAD( "omega1h.bin",  0x0000, 0x0800, CRC(527fd384) SHA1(92a384899d5acd2c689f637da16a0e2d11a9d9c6) )
5622   ROM_LOAD( "omega1k.bin",  0x0800, 0x0800, CRC(36de42c6) SHA1(6fd93d439e3b8eab62049f925d9e8f8deeda2ae3) )
2402   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0x7f8, kingball_sound1_w);
2403   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w);
2404   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb002, 0xb002, 0, 0x7f8, kingball_sound2_w);
2405   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb003, 0xb003, 0, 0x7f8, kingball_speech_dip_w);
56232406
5624   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5625   ROM_LOAD( "6331-1j.86",   0x0000, 0x0020, NO_DUMP )   /* missing */
5626ROM_END
2407   state_save_register_global(kingball_speech_dip);
2408   state_save_register_global(kingball_sound);
2409}
56272410
5628ROM_START( scramblb )
5629   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5630   ROM_LOAD( "scramble.1k",  0x0000, 0x0800, CRC(9e025c4a) SHA1(a8cc9391bdd01a5a2fe7f0c4e889b4e2495df891) )
5631   ROM_LOAD( "scramble.2k",  0x0800, 0x0800, CRC(306f783e) SHA1(92d19f90f1123cd211706294d668ab23c8b0760b) )
5632   ROM_LOAD( "scramble.3k",  0x1000, 0x0800, CRC(0500b701) SHA1(54c84ccad2aae34f42fdddcfcd92cd9da2cd7119) )
5633   ROM_LOAD( "scramble.4k",  0x1800, 0x0800, CRC(dd380a22) SHA1(125e713a58cc5f2c1e38f67dad29f8c985ce5a8b) )
5634   ROM_LOAD( "scramble.5k",  0x2000, 0x0800, CRC(df0b9648) SHA1(4ae9150c9441897d5ab7c5a0b3f10e1e8c8e2f6c) )
5635   ROM_LOAD( "scramble.1j",  0x2800, 0x0800, CRC(b8c07b3c) SHA1(33eaedef4b7f49eeef072425541c17206d0a00ec) )
5636   ROM_LOAD( "scramble.2j",  0x3000, 0x0800, CRC(88ac07a0) SHA1(c57061db5984b472039356bf84a050b5b66e3813) )
5637   ROM_LOAD( "scramble.3j",  0x3800, 0x0800, CRC(c67d57ca) SHA1(ba8b14289aef47d48d9750cf2ef3c368e74a60e8) )
56382411
5639   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5640   ROM_LOAD( "5f.k",         0x0000, 0x0800, CRC(4708845b) SHA1(a8b1ad19a95a9d35050a2ab7194cc96fc5afcdc9) )
5641   ROM_LOAD( "5h.k",         0x0800, 0x0800, CRC(11fd2887) SHA1(69844e48bb4d372cac7ae83c953df573c7ecbb7f) )
2412static DRIVER_INIT( scorpnmc )
2413{
2414   /* video extensions */
2415   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, batman2_extend_tile_info, upper_extend_sprite_info);
56422416
5643   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5644   ROM_LOAD( "82s123.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
5645ROM_END
2417   /* move the interrupt enable from $b000 to $b001 */
2418   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0x7f8, SMH_UNMAP);
2419   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w);
56462420
2421   /* extra ROM */
2422   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x67ff, 0, 0, SMH_BANK1);
2423   memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x5000);
56472424
5648ROM_START( scramb2 )
5649   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5650   ROM_LOAD( "r1.7f1",  0x0000, 0x0800, CRC(4a43148c) SHA1(ea27fd3acf661101296a58a7a50fb8e4d5292760) )
5651   ROM_LOAD( "r1.7f2",  0x0800, 0x0800, CRC(215a3b86) SHA1(bfddfea9f74064123629d89556240c7a59f7bea2) )
5652   ROM_LOAD( "r2.7h1",  0x1000, 0x0800, CRC(28779444) SHA1(0abd3a89c8cdd5af2ac06afd38bcd2dcd6010bee) )
5653   ROM_LOAD( "r2.7h2",  0x1800, 0x0800, CRC(5b4b300b) SHA1(6d69dbdab66bc8f4a16c3d9d3b4581799e4bbfab) )
5654   ROM_LOAD( "r3.7k1",  0x2000, 0x0800, CRC(b478aa53) SHA1(68cf134482092534ef0a3ceee3aa842f86660065) )
5655   ROM_LOAD( "r3.7k2",  0x2800, 0x0800, CRC(c33f072e) SHA1(28d61e35f3d5c971e070d7e0cc20b831fe8d52c5) )
5656   ROM_LOAD( "r4.7l1",  0x3000, 0x0800, CRC(88ac07a0) SHA1(c57061db5984b472039356bf84a050b5b66e3813) )
5657   ROM_LOAD( "r4.7l2",  0x3800, 0x0800, CRC(321fd003) SHA1(61f33c2709913da4cb20f311501df707d755917e) )
5658   /* Also exists in the following Rom config */
5659//  ROM_LOAD( "r1.7f",  0x0000, 0x1000, CRC(75208a74) SHA1(e77afe4b906d08d6763f31dd70d7cb772be97102) )
5660//  ROM_LOAD( "r2.7h",  0x1000, 0x1000, CRC(f2179cf5) SHA1(5c38aa9bd1d5ebdccf16d2e50acc56f0b3f042d0) )
5661//  ROM_LOAD( "r3.7k",  0x2000, 0x1000, CRC(941c804e) SHA1(f1eedf719a234cf98071e6a46120765e231f0730) )
5662//  ROM_LOAD( "r4.7l",  0x3000, 0x1000, CRC(f1506edc) SHA1(66689bb3d7570848e4d020a5f44d6de03b4bff99) )
2425   /* install RAM at $4000-$4800 */
2426   memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x47ff, 0, 0, SMH_BANK2, SMH_BANK2);
2427   memory_set_bankptr(2, auto_malloc(0x800));
56632428
5664   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5665   ROM_LOAD( "r6.1j",         0x0000, 0x0800, CRC(4708845b) SHA1(a8b1ad19a95a9d35050a2ab7194cc96fc5afcdc9) )
5666   ROM_LOAD( "r5.1l",         0x0800, 0x0800, CRC(11fd2887) SHA1(69844e48bb4d372cac7ae83c953df573c7ecbb7f) )
2429   /* doesn't appear to use original RAM */
2430   memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, SMH_UNMAP, SMH_UNMAP);
2431}
56672432
5668   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5669   ROM_LOAD( "82s123.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
5670ROM_END
56712433
56722434
5673ROM_START( jumpbug )
5674   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5675   ROM_LOAD( "jb1",          0x0000, 0x1000, CRC(415aa1b7) SHA1(4f9edd7e9720acf085dd8910849c2f2fac5cb547) )
5676   ROM_LOAD( "jb2",          0x1000, 0x1000, CRC(b1c27510) SHA1(66fbe0b94b6c101cb50d7a3ff78160110415dff9) )
5677   ROM_LOAD( "jb3",          0x2000, 0x1000, CRC(97c24be2) SHA1(1beb9fbc3a52610b416af8b5fee156d8b6b3125a) )
5678   ROM_LOAD( "jb4",          0x3000, 0x1000, CRC(66751d12) SHA1(26c68cfb59596ae164ee9ae4a24ddf8dc7a923a7) )
5679   ROM_LOAD( "jb5",          0x8000, 0x1000, CRC(e2d66faf) SHA1(3dec0796642856359de57afb896cc668c0245b40) )
5680   ROM_LOAD( "jb6",          0x9000, 0x1000, CRC(49e0bdfd) SHA1(8d89d9cd7134b153264fdc49d2c68e8c14004b0d) )
5681   ROM_LOAD( "jb7",          0xa000, 0x0800, CRC(83d71302) SHA1(9292088d26ba29fbf8817df03461b8bb6bf27639) )
2435/*************************************
2436 *
2437 *  Konami games
2438 *
2439 *************************************/
56822440
5683   ROM_REGION( 0x3000, REGION_GFX1, ROMREGION_DISPOSE )
5684   ROM_LOAD( "jbl",          0x0000, 0x0800, CRC(9a091b0a) SHA1(19b88f802ee80ff8901ef99e3688f2869f1a69c5) )
5685   ROM_LOAD( "jbm",          0x0800, 0x0800, CRC(8a0fc082) SHA1(58b72a3161950a2fb71cdab3f30bb3abb19c7978) )
5686   ROM_LOAD( "jbn",          0x1000, 0x0800, CRC(155186e0) SHA1(717ddaecc52a4ef03a01fcddb520acdbfb0d722a) )
5687   ROM_LOAD( "jbi",          0x1800, 0x0800, CRC(7749b111) SHA1(55071ce04708bd52177644298f76ae79d23f6ac9) )
5688   ROM_LOAD( "jbj",          0x2000, 0x0800, CRC(06e8d7df) SHA1(d04f1503d9fde5aae92652cb9d2eb16bd6a0fe9c) )
5689   ROM_LOAD( "jbk",          0x2800, 0x0800, CRC(b8dbddf3) SHA1(043de444890a93459789dc99c43ef88ff66b79e4) )
2441static DRIVER_INIT( theend )
2442{
2443   /* video extensions */
2444   konami_common_init(machine, theend_draw_bullet, galaxian_draw_background, NULL, NULL);
56902445
5691   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5692   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
5693ROM_END
2446   /* coin counter on the upper bit of port C */
2447   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6802, 0x6802, 0, 0x7f8, SMH_UNMAP);
2448   ppi8255_set_portCwrite(0, theend_coin_counter_w);
2449}
56942450
5695ROM_START( jumpbugb )
5696   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5697   ROM_LOAD( "jb1",          0x0000, 0x1000, CRC(415aa1b7) SHA1(4f9edd7e9720acf085dd8910849c2f2fac5cb547) )
5698   ROM_LOAD( "jb2",          0x1000, 0x1000, CRC(b1c27510) SHA1(66fbe0b94b6c101cb50d7a3ff78160110415dff9) )
5699   ROM_LOAD( "jb3b",         0x2000, 0x1000, CRC(cb8b8a0f) SHA1(9e8591471dda2cb964ba2a866d4a5a3ef65d8707) )
5700   ROM_LOAD( "jb4",          0x3000, 0x1000, CRC(66751d12) SHA1(26c68cfb59596ae164ee9ae4a24ddf8dc7a923a7) )
5701   ROM_LOAD( "jb5b",         0x8000, 0x1000, CRC(7553b5e2) SHA1(6439585e713581dd36cea6324414f803d683216f) )
5702   ROM_LOAD( "jb6b",         0x9000, 0x1000, CRC(47be9843) SHA1(495d6fc732267bfd19a953b0b70df3f94b3c1e38) )
5703   ROM_LOAD( "jb7b",         0xa000, 0x0800, CRC(460aed61) SHA1(449ab1bb502f98da74c0955ce1364f8708fd3f81) )
57042451
5705   ROM_REGION( 0x3000, REGION_GFX1, ROMREGION_DISPOSE )
5706   ROM_LOAD( "jbl",          0x0000, 0x0800, CRC(9a091b0a) SHA1(19b88f802ee80ff8901ef99e3688f2869f1a69c5) )
5707   ROM_LOAD( "jbm",          0x0800, 0x0800, CRC(8a0fc082) SHA1(58b72a3161950a2fb71cdab3f30bb3abb19c7978) )
5708   ROM_LOAD( "jbn",          0x1000, 0x0800, CRC(155186e0) SHA1(717ddaecc52a4ef03a01fcddb520acdbfb0d722a) )
5709   ROM_LOAD( "jbi",          0x1800, 0x0800, CRC(7749b111) SHA1(55071ce04708bd52177644298f76ae79d23f6ac9) )
5710   ROM_LOAD( "jbj",          0x2000, 0x0800, CRC(06e8d7df) SHA1(d04f1503d9fde5aae92652cb9d2eb16bd6a0fe9c) )
5711   ROM_LOAD( "jbk",          0x2800, 0x0800, CRC(b8dbddf3) SHA1(043de444890a93459789dc99c43ef88ff66b79e4) )
2452static DRIVER_INIT( scramble )
2453{
2454   /* video extensions */
2455   konami_common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
57122456
5713   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5714   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
5715ROM_END
2457   /* configure protection */
2458   ppi8255_set_portCread (1, scramble_protection_r);
2459   ppi8255_set_portCwrite(1, scramble_protection_w);
2460}
57162461
5717ROM_START( levers )
5718   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5719   ROM_LOAD( "g96059.a8",      0x0000, 0x1000, CRC(9550627a) SHA1(3da9a614622d5b880852fe2bb2e8e4a60afb2d34) )
5720   ROM_LOAD( "g96060.d8",      0x2000, 0x1000, CRC(5ac64646) SHA1(459755932a033095eff72d78d1e916932964c5cc) )
5721   ROM_LOAD( "g96061.e8",      0x3000, 0x1000, CRC(9db8e520) SHA1(1ff10e221e45cc4afb77571a171937f8501aa509) )
5722   ROM_LOAD( "g96062.h8",      0x8000, 0x1000, CRC(7c8e8b3a) SHA1(ad281f801e818ea529be8ec43096212e834f69ef) )
5723   ROM_LOAD( "g96063.j8",      0x9000, 0x1000, CRC(fa61e793) SHA1(7aad77f3de05a7bd3dcb0c9c97a3cccd1136f352) )
5724   ROM_LOAD( "g96064.l8",      0xa000, 0x1000, CRC(f797f389) SHA1(b961f0506defa9884ac47b2316884318e1e90bff) )
57252462
5726   ROM_REGION( 0x3000, REGION_GFX1, ROMREGION_DISPOSE )
5727   ROM_LOAD( "g95948.n1",      0x0000, 0x0800, CRC(d8a0c692) SHA1(dd64623f4072bcb8c528b5b7b95a7bd858b79d6c) )
5728                     /*0x0800- 0x0fff empty */
5729   ROM_LOAD( "g95949.s1",      0x1000, 0x0800, CRC(3660a552) SHA1(bebfd30f90da55d6d42945717b9b38d5b0c9623a) )
5730   ROM_LOAD( "g95946.j1",      0x1800, 0x0800, CRC(73b61b2d) SHA1(fdb75eea1778daa6f9c48243361e418044b471f8) )
5731                     /*0x2000- 0x27ff empty */
5732   ROM_LOAD( "g95947.m1",      0x2800, 0x0800, CRC(72ff67e2) SHA1(dcc12f17a857271c253d06d5ac170b9d6bb6a2bd) )
2463static DRIVER_INIT( explorer )
2464{
2465   /* video extensions */
2466   konami_common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
57332467
5734   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5735   ROM_LOAD( "g960lev.clr",  0x0000, 0x0020, CRC(01febbbe) SHA1(11b1dab7983ba29e830ccb7f14eb1a99465c9e81) )
5736ROM_END
2468   /* watchdog works for writes as well? (or is it just disabled?) */
2469   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7000, 0, 0x7ff, watchdog_reset_w);
57372470
5738ROM_START( azurian )
5739   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5740   ROM_LOAD( "pgm.1",        0x0000, 0x1000, CRC(17a0fca7) SHA1(0ffb80d433fbaa0631d0d982a453f9e6cccab297) )
5741   ROM_LOAD( "pgm.2",        0x1000, 0x1000, CRC(14659848) SHA1(bb9d9c01b074bf7ed7a1c29379bbef41728dd27a) )
5742   ROM_LOAD( "pgm.3",        0x2000, 0x1000, CRC(8f60fb97) SHA1(d0f4d65e568ac1a5d41e550f2f626cbf72884959) )
2471   /* I/O appears to be direct, not via PPIs */
2472   memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_UNMAP, SMH_UNMAP);
2473   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000, 0, 0xffc, input_port_0_r);
2474   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8001, 0x8001, 0, 0xffc, input_port_1_r);
2475   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8002, 0x8002, 0, 0xffc, input_port_2_r);
2476   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8003, 0x8003, 0, 0xffc, input_port_3_r);
2477   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000, 0, 0xfff, soundlatch_w);
2478   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x9000, 0, 0xfff, explorer_sound_control_w);
2479}
57432480
5744   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5745   ROM_LOAD( "gfx.1",        0x0000, 0x0800, CRC(f5afb803) SHA1(ffc8f86a35179d7715ef618004b79003e0236a93) )
5746   ROM_LOAD( "gfx.2",        0x0800, 0x0800, CRC(ae96e5d1) SHA1(df667fb96d7353ccf9ce0acf788371ef2221e97d) )
57472481
5748   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5749   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
5750ROM_END
2482static DRIVER_INIT( sfx )
2483{
2484   /* basic configuration */
2485   common_init(machine, scramble_draw_bullet, scramble_draw_background, upper_extend_tile_info, NULL);
2486   galaxian_sfx_tilemap = TRUE;
57512487
5752ROM_START( orbitron )
5753   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5754   ROM_LOAD( "orbitron.3",   0x0600, 0x0200, CRC(419f9c9b) SHA1(788a3920f4270b886b3a578f8c2df33e6314a1c3) )
5755   ROM_CONTINUE(           0x0400, 0x0200)
5756   ROM_CONTINUE(           0x0200, 0x0200)
2488   /* sfx uses 3 x 8255, so we need a non-standard interface */
2489   ppi8255_init(&sfx_ppi8255_intf);
57572490
2491   /* sound board has space for extra ROM */
2492   memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1);
2493   memory_set_bankptr(1, memory_region(REGION_CPU2));
2494}
57582495
5759   ROM_CONTINUE(           0x0000, 0x0200)
5760   ROM_LOAD( "orbitron.4",   0x0e00, 0x0200, CRC(44ad56ac) SHA1(3a8339cdee50912a16ac0fb448e6659e32542c0c) )
5761   ROM_CONTINUE(           0x0c00, 0x0200)
5762   ROM_CONTINUE(           0x0a00, 0x0200)
5763   ROM_CONTINUE(           0x0800, 0x0200)
5764   ROM_LOAD( "orbitron.1",   0x1600, 0x0200, CRC(da3f5168) SHA1(1927cc7cd3b9d15b629e09781557f4c75d684182) )
5765   ROM_CONTINUE(           0x1400, 0x0200)
5766   ROM_CONTINUE(           0x1200, 0x0200)
5767   ROM_CONTINUE(           0x1000, 0x0200)
5768   ROM_LOAD( "orbitron.2",   0x1e00, 0x0200, CRC(a3b813fc) SHA1(7f0f22667bee897b474fb485d65a74d74a36991a) )
5769   ROM_CONTINUE(           0x1c00, 0x0200)
5770   ROM_CONTINUE(           0x1a00, 0x0200)
5771   ROM_CONTINUE(           0x1800, 0x0200)
5772   ROM_LOAD( "orbitron.5",   0x2000, 0x0800, CRC(20cd8bb8) SHA1(a5309cb04a656c6e1e18bb19910474af8ef814a5) )
57732496
5774   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5775   ROM_LOAD( "orbitron.6",   0x0000, 0x0800, CRC(2c91b83f) SHA1(29c73b7ad0dc5a3ba739492c902ad9201eae6ef2) )
5776   ROM_LOAD( "orbitron.7",   0x0800, 0x0800, CRC(46f4cca4) SHA1(e5fb616b1d17b5b5167f05f7840638840deb2d13) )
2497static DRIVER_INIT( atlantis )
2498{
2499   /* video extensions */
2500   konami_common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
57772501
5778   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5779   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
5780ROM_END
2502   /* watchdog is at $7800? (or is it just disabled?) */
2503   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7000, 0, 0x7ff, SMH_UNMAP);
2504   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7800, 0x7800, 0, 0x7ff, watchdog_reset_r);
2505}
57812506
5782ROM_START( checkman )
5783   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5784   ROM_LOAD( "cm1",          0x0000, 0x0800, CRC(e8cbdd28) SHA1(ba0b41e375b94bbfed6a2c949cc7958474c8ba6e) )
5785   ROM_LOAD( "cm2",          0x0800, 0x0800, CRC(b8432d4d) SHA1(d331476f1f88b7ef1426bed7442392f369e0650b) )
5786   ROM_LOAD( "cm3",          0x1000, 0x0800, CRC(15a97f61) SHA1(3c06c734cef1eed68b401d0d36f7ec9126986d73) )
5787   ROM_LOAD( "cm4",          0x1800, 0x0800, CRC(8c12ecc0) SHA1(1c2d61ef84404b6a524c453a3d339aaaadb38229) )
5788   ROM_LOAD( "cm5",          0x2000, 0x0800, CRC(2352cfd6) SHA1(77db5f925ee5f83c17a05a78af5191eefe70ca5a) )
57892507
5790   ROM_REGION( 0x10000, REGION_CPU2, 0 )   /* 64k for sound code */
5791   ROM_LOAD( "cm13",         0x0000, 0x0800, CRC(0b09a3e8) SHA1(e4e65da306e22f61790f0a68d953cc017c3ce762) )
5792   ROM_LOAD( "cm14",         0x0800, 0x0800, CRC(47f043be) SHA1(44d8892d93849cbc989561387c0a05baead58446) )
2508static DRIVER_INIT( scobra )
2509{
2510   /* video extensions */
2511   konami_common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
2512}
57932513
5794   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5795   ROM_LOAD( "cm11",         0x0000, 0x0800, CRC(8d1bcca0) SHA1(28fc7fb76180820e84d59e6836ed1f8136e8f138) )
5796   ROM_RELOAD(                 0x0800, 0x0800 )
5797   ROM_LOAD( "cm9",          0x1000, 0x0800, CRC(3cd5c751) SHA1(a769fdd30752da8fb331aa0f7a0181a93f0b3378) )
5798   ROM_RELOAD(                 0x1800, 0x0800 )
57992514
5800   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5801   ROM_LOAD( "checkman.clr", 0x0000, 0x0020, CRC(57a45057) SHA1(d4ec6a54f72640e5b485aa59e206c090e67ff640) )
5802ROM_END
2515static DRIVER_INIT( losttomb )
2516{
2517   /* video extensions */
2518   konami_common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
58032519
5804ROM_START( checkmaj )
5805   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5806   ROM_LOAD( "cm_1.bin",     0x0000, 0x1000, CRC(456a118f) SHA1(7c2e8343360f446af4391012784a1ccfecae3299) )
5807   ROM_LOAD( "cm_2.bin",     0x1000, 0x1000, CRC(146b2c44) SHA1(80455396a9b1802fcefaec1340b76461c0601bf9) )
5808   ROM_LOAD( "cm_3.bin",     0x2000, 0x0800, CRC(73e1c945) SHA1(bcf2558958a30e5936f19ff53687f2316e0b822e) )
2520   /* decrypt */
2521   decode_losttomb_gfx();
2522}
58092523
5810   ROM_REGION( 0x10000, REGION_CPU2, 0 )   /* 64k for sound code */
5811   ROM_LOAD( "cm_4.bin",     0x0000, 0x1000, CRC(923cffa1) SHA1(132822d20de2ad1ecc561e811ca40c5642500631) )
58122524
5813   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5814   ROM_LOAD( "cm_6.bin",     0x0000, 0x0800, CRC(476a7cc3) SHA1(3c343b0dcfb2f4cbec2f8b5854a303a1660fea22) )
5815   ROM_LOAD( "cm_5.bin",     0x0800, 0x0800, CRC(b3df2b5f) SHA1(519a0894d1794211659abeb6b2a2c610e6c2af25) )
2525static DRIVER_INIT( frogger )
2526{
2527   /* video extensions */
2528   konami_common_init(machine, NULL, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info);
2529   galaxian_frogger_adjust = TRUE;
58162530
5817   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5818   ROM_LOAD( "checkman.clr", 0x0000, 0x0020, CRC(57a45057) SHA1(d4ec6a54f72640e5b485aa59e206c090e67ff640) )
5819ROM_END
2531   /* decrypt */
2532   decode_frogger_sound();
2533   decode_frogger_gfx();
2534}
58202535
5821ROM_START( dingo )
5822   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5823   ROM_LOAD( "003.e7",       0x0000, 0x1000, CRC(d088550f) SHA1(13b87995881e484825c45ab4e558ac3d90bf162a) )
5824   ROM_LOAD( "004.h7",       0x1000, 0x1000, CRC(a228446a) SHA1(4b7e611edd6bce308cc7b17caa068445f5438f4f) )
5825   ROM_LOAD( "005.j7",       0x2000, 0x0800, CRC(14d680bb) SHA1(e9d84d1a62ed5300c390a7326c16cebd0aceae3b) )
58262536
5827   ROM_REGION( 0x10000, REGION_CPU2, 0 )   /* 64k for sound code */
5828   ROM_LOAD( "6.7l",         0x0000, 0x1000, CRC(047092e0) SHA1(24014c999c904b4be571121b0f6808713d95add1) )
2537static DRIVER_INIT( froggrmc )
2538{
2539   /* video extensions */
2540   common_init(machine, NULL, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info);
58292541
5830   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5831   ROM_LOAD( "001.h1",       0x0000, 0x0800, CRC(1ab1dd4d) SHA1(74ef2226e1f1d2583b0c7718325da193f411a97d) )
5832   ROM_LOAD( "002.k1",       0x0800, 0x0800, CRC(4be375ee) SHA1(7379b037887baca0f932d910f8f94f7edf39bb26) )
2542   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xa800, 0, 0x7ff, soundlatch_w);
2543   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, froggrmc_sound_control_w);
58332544
5834   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5835   ROM_LOAD( "18s030.l6",     0x0000, 0x0020, CRC(3061d0f9) SHA1(5af85499c6219137dc57d9fba79cb5afa3548ab1) )
5836ROM_END
2545   /* actually needs 2k of RAM */
2546   memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, SMH_BANK1, SMH_BANK1);
2547   memory_set_bankptr(1, auto_malloc(0x800));
58372548
5838ROM_START( dingoe )
5839   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5840   ROM_LOAD( "unk.2b",       0x0000, 0x1000, CRC(0df7ac6d) SHA1(c1d45a7694848e66426c3510d0749c98e51571cb) )
5841   ROM_LOAD( "unk.2d",       0x1000, 0x1000, CRC(0881e204) SHA1(4ba59d73e04b5337cfbd68d6a708e7321cb629f1) )
5842   ROM_LOAD( "unk.3b",       0x2000, 0x1000, BAD_DUMP CRC(0b6aeab5) SHA1(ebfab3227dd23e3e1802b881a5662f634f86e382) ) // both halves identical (bad?)
2549   /* decrypt */
2550   decode_frogger_sound();
2551}
58432552
5844   ROM_REGION( 0x10000, REGION_CPU2, 0 )   /* 64k for sound code */
5845   ROM_LOAD( "unk.1c",       0x0000, 0x0800, CRC(8e354c38) SHA1(87608c1fa55e6fcf482f5d3bcc506a84673719cc) )
5846   ROM_LOAD( "unk.1d",       0x0800, 0x0800, CRC(092878d6) SHA1(8a3b25e27df5aee2023a7e1a193ab152df171ede) )
58472553
5848   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5849   ROM_LOAD( "unk.4d",       0x0000, 0x0800, CRC(76a00a56) SHA1(2a696b9ce3e148529c731231852dc104729bb916) )
5850   ROM_LOAD( "unk.4b",       0x0800, 0x0800, CRC(5acf57aa) SHA1(bb05be53728e7867085dad5854fcadfa687ff5d7) )
2554static DRIVER_INIT( froggers )
2555{
2556   /* video extensions */
2557   konami_common_init(machine, NULL, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info);
58512558
5852   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5853   ROM_LOAD( "82s123n.001",  0x0000, 0x0020, CRC(02b11865) SHA1(70053db9635a9194e4372835379a82f6ea64ef83) ) /* Unknown */
5854ROM_END
2559   /* decrypt */
2560   decode_frogger_sound();
2561}
58552562
58562563
5857ROM_START( blkhole )
5858   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5859   ROM_LOAD( "bh1",          0x0000, 0x0800, CRC(64998819) SHA1(69fe5dfbe6cde18ef4cae62da12b5c692c2c72b9) )
5860   ROM_LOAD( "bh2",          0x0800, 0x0800, CRC(26f26ce4) SHA1(720ce7af05ef596fb9a109591534c74d282955e8) )
5861   ROM_LOAD( "bh3",          0x1000, 0x0800, CRC(3418bc45) SHA1(088bbbde66b7b5c36fa48cf14c22146e1444e67c) )
5862   ROM_LOAD( "bh4",          0x1800, 0x0800, CRC(735ff481) SHA1(d9b32db048a0e2a1195cd6f7326005e6622242a9) )
5863   ROM_LOAD( "bh5",          0x2000, 0x0800, CRC(3f657be9) SHA1(3ed1ee0bc199c1625156d2771eecd18a57a0e6ed) )
5864   ROM_LOAD( "bh6",          0x2800, 0x0800, CRC(a057ab35) SHA1(430261bafe20fc182e6e6659019cf42643e95d54) )
2564static DRIVER_INIT( turtles )
2565{
2566   /* video extensions */
2567   konami_common_init(machine, NULL, turtles_draw_background, NULL, NULL);
2568}
58652569
5866   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5867   ROM_LOAD( "bh7",          0x0000, 0x0800, CRC(975ba821) SHA1(c50d55f6ab81b803d67f5e18c1243ef85a1a2df1) )
5868   ROM_LOAD( "bh8",          0x0800, 0x0800, CRC(03d11020) SHA1(5768b573fac9aac168db2723462cca76d4d80552) )
58692570
5870   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5871   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
5872ROM_END
2571#ifdef UNUSED_CODE
2572static DRIVER_INIT( amidar )
2573{
2574   /* no existing amidar sets run on Amidar hardware as described by Amidar schematics! */
2575   /* video extensions */
2576   konami_common_init(machine, scramble_draw_bullet, amidar_draw_background, NULL, NULL);
2577}
2578#endif
58732579
5874ROM_START( mooncrst )
5875   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5876   ROM_LOAD( "mc1",          0x0000, 0x0800, CRC(7d954a7a) SHA1(a93ee403cfd7887538ad12d33f6dd6c71bea2a32) )
5877   ROM_LOAD( "mc2",          0x0800, 0x0800, CRC(44bb7cfa) SHA1(349c2e23a9fce73f95bb8168d369082fa129fe3d) )
5878   ROM_LOAD( "mc3",          0x1000, 0x0800, CRC(9c412104) SHA1(1b40054ebb1ace965a8522119bb23f09797bc5f6) )
5879   ROM_LOAD( "mc4",          0x1800, 0x0800, CRC(7e9b1ab5) SHA1(435f603c0c3e788a509dd144a7916a34e791ae44) )
5880   ROM_LOAD( "mc5.7r",       0x2000, 0x0800, CRC(16c759af) SHA1(3b48050411f65f9d3fb41ff22901e22d82bf1cf6) )
5881   ROM_LOAD( "mc6.8d",       0x2800, 0x0800, CRC(69bcafdb) SHA1(939c8c6ed1cd4660a3d99b8f17ed99cbd7e1352a) )
5882   ROM_LOAD( "mc7.8e",       0x3000, 0x0800, CRC(b50dbc46) SHA1(4fa084fd1ba5f78e7703e684c57af15ca7a844e4) )
5883   ROM_LOAD( "mc8",          0x3800, 0x0800, CRC(18ca312b) SHA1(39219059003b949e38305553fea2d33071062c64) )
58842580
5885   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5886   ROM_LOAD( "mcs_b",        0x0000, 0x0800, CRC(fb0f1f81) SHA1(38a6679a8b69bc1870a0e67e692131c42f9535c8) )
5887   ROM_LOAD( "mcs_d",        0x0800, 0x0800, CRC(13932a15) SHA1(b8885c555c6ad7021be55c6925a0a0872c1b6abd) )
5888   ROM_LOAD( "mcs_a",        0x1000, 0x0800, CRC(631ebb5a) SHA1(5bc9493afa76c55858b8c8849524cbc77dc838fc) )
5889   ROM_LOAD( "mcs_c",        0x1800, 0x0800, CRC(24cfd145) SHA1(08c6599db170dd6ee364c44f70a0f5c0f881b6ef) )
2581static DRIVER_INIT( scorpion )
2582{
2583   konami_common_init(machine, scramble_draw_bullet, scramble_draw_background, batman2_extend_tile_info, upper_extend_sprite_info);
58902584
5891   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5892   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
5893ROM_END
2585   /* hook up AY8910 */
2586   memory_install_readwrite8_handler(1, ADDRESS_SPACE_IO, 0x00, 0xff, 0, 0, scorpion_ay8910_r, scorpion_ay8910_w);
58942587
5895ROM_START( mooncrsu )
5896   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5897   ROM_LOAD( "smc1f",        0x0000, 0x0800, CRC(389ca0d6) SHA1(51cf6d190a0ebf23b70c2bcf1ccaa4705e29cd09) )
5898   ROM_LOAD( "smc2f",        0x0800, 0x0800, CRC(410ab430) SHA1(d89abff6ac4afbf69377a1d63043d629a634aab7) )
5899   ROM_LOAD( "smc3f",        0x1000, 0x0800, CRC(a6b4144b) SHA1(2b27ad54d716286c0dc9476d47df182ae01bcfd7) )
5900   ROM_LOAD( "smc4f",        0x1800, 0x0800, CRC(4cc046fe) SHA1(465eaacd50967d768babadd09ab9cad35380f6bf) )
5901   ROM_LOAD( "e5",            0x2000, 0x0800, CRC(06d378a6) SHA1(99dbe9fc7f95f8fdce86eb5c32bd1ca1bea0ca3c) )
5902   ROM_LOAD( "bepr199",      0x2800, 0x0800, CRC(6e84a927) SHA1(82e8e825d157c3c947a3a222bca059a735169c7d) )
5903   ROM_LOAD( "e7",           0x3000, 0x0800, CRC(b45af1e8) SHA1(d7020774707234acdaef5c655f667d5ee9e54a13) )
5904   ROM_LOAD( "smc8f",        0x3800, 0x0800, CRC(f42164c5) SHA1(e0d1680f193889568edf005786e2767d4fb086f4) )
2588   /* configure protection */
2589   ppi8255_set_portCwrite(1, scorpion_protection_w);
2590   ppi8255_set_portCread(1, scorpion_protection_r);
59052591
5906   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5907   ROM_LOAD( "mcs_b",        0x0000, 0x0800, CRC(fb0f1f81) SHA1(38a6679a8b69bc1870a0e67e692131c42f9535c8) )
5908   ROM_LOAD( "mcs_d",        0x0800, 0x0800, CRC(13932a15) SHA1(b8885c555c6ad7021be55c6925a0a0872c1b6abd) )
5909   ROM_LOAD( "mcs_a",        0x1000, 0x0800, CRC(631ebb5a) SHA1(5bc9493afa76c55858b8c8849524cbc77dc838fc) )
5910   ROM_LOAD( "mcs_c",        0x1800, 0x0800, CRC(24cfd145) SHA1(08c6599db170dd6ee364c44f70a0f5c0f881b6ef) )
2592   /* extra ROM */
2593   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5800, 0x67ff, 0, 0, SMH_BANK1);
2594   memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x5800);
59112595
5912   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5913   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
5914ROM_END
2596   /* no background related */
2597//  memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6803, 0x6803, 0, 0, SMH_NOP);
59152598
5916ROM_START( mooncrsa )
5917   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5918   ROM_LOAD( "mc1.7d",       0x0000, 0x0800, CRC(92a86aac) SHA1(f5818ac97d8b779e1fb29bf903f74185d24afb0d) )
5919   ROM_LOAD( "mc2.7e",       0x0800, 0x0800, CRC(438c2b4b) SHA1(11f56b489b5489999952e91919c5e1f622c59c36) )
5920   ROM_LOAD( "mc3.7j",       0x1000, 0x0800, CRC(67e3d21d) SHA1(59579d19931ef11b30fdc3912d838200bef92c81) )
5921   ROM_LOAD( "mc4.7p",       0x1800, 0x0800, CRC(f4db39f6) SHA1(454931f80b35608793590b3843c69ba64cbf6772) )
5922   ROM_LOAD( "mc5.7r",       0x2000, 0x0800, CRC(16c759af) SHA1(3b48050411f65f9d3fb41ff22901e22d82bf1cf6) )
5923   ROM_LOAD( "mc6.8d",       0x2800, 0x0800, CRC(69bcafdb) SHA1(939c8c6ed1cd4660a3d99b8f17ed99cbd7e1352a) )
5924   ROM_LOAD( "mc7.8e",       0x3000, 0x0800, CRC(b50dbc46) SHA1(4fa084fd1ba5f78e7703e684c57af15ca7a844e4) )
5925   ROM_LOAD( "mc8.8h",       0x3800, 0x0800, CRC(7e2b1928) SHA1(4f0de8e80c2e2ec6df8612755caf93671ea965b0) )
2599   memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3000, 0, 0, scorpion_sound_status_r);
2600/*
2601{
2602    const UINT8 *rom = memory_region(REGION_SOUND1);
2603    int i;
59262604
5927   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5928   ROM_LOAD( "mcs_b",        0x0000, 0x0800, CRC(fb0f1f81) SHA1(38a6679a8b69bc1870a0e67e692131c42f9535c8) )
5929   ROM_LOAD( "mcs_d",        0x0800, 0x0800, CRC(13932a15) SHA1(b8885c555c6ad7021be55c6925a0a0872c1b6abd) )
5930   ROM_LOAD( "mcs_a",        0x1000, 0x0800, CRC(631ebb5a) SHA1(5bc9493afa76c55858b8c8849524cbc77dc838fc) )
5931   ROM_LOAD( "mcs_c",        0x1800, 0x0800, CRC(24cfd145) SHA1(08c6599db170dd6ee364c44f70a0f5c0f881b6ef) )
2605    for (i = 0; i < 0x2c; i++)
2606    {
2607        UINT16 addr = (rom[2*i] << 8) | rom[2*i+1];
2608        UINT16 endaddr = (rom[2*i+2] << 8) | rom[2*i+3];
2609        int j;
2610        printf("Cmd %02X -> %04X-%04X:", i, addr, endaddr - 1);
2611        for (j = 0; j < 32 && addr < endaddr; j++)
2612            printf(" %02X", rom[addr++]);
2613        printf("\n");
2614    }
2615}
2616*/
2617}
59322618
5933   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5934   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
5935ROM_END
59362619
5937ROM_START( mooncrsg )
5938   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5939   ROM_LOAD( "epr194",       0x0000, 0x0800, CRC(0e5582b1) SHA1(946ad4aeb10c0b7b3f93fd24925cc9bcb49e443c) )
5940   ROM_LOAD( "epr195",       0x0800, 0x0800, CRC(12cb201b) SHA1(ebb01ec646b9e015cbcb93f70dfdaf448afefc12) )
5941   ROM_LOAD( "epr196",       0x1000, 0x0800, CRC(18255614) SHA1(b373e22d47c0f7facba13148ca9c462ec9a0d732) )
5942   ROM_LOAD( "epr197",       0x1800, 0x0800, CRC(05ac1466) SHA1(cbf93a8ce0925fa1c073c74f1274b190d9faefaf) )
5943   ROM_LOAD( "epr198",       0x2000, 0x0800, CRC(c28a2e8f) SHA1(9ff6bab1e1185597ba55cb0d6086091a1fce01a6) )
5944   ROM_LOAD( "epr199",       0x2800, 0x0800, CRC(5a4571de) SHA1(2a4170dee105922fc69c99b79f6f328098e81918) )
5945   ROM_LOAD( "epr200",       0x3000, 0x0800, CRC(b7c85bf1) SHA1(cc9f593658ea39c849d80c83ee0c2170cc29879e) )
5946   ROM_LOAD( "epr201",       0x3800, 0x0800, CRC(2caba07f) SHA1(8fec4904e12b4cfb6068784007278be986a3eede) )
2620static DRIVER_INIT( anteater )
2621{
2622   /* video extensions */
2623   konami_common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
59472624
5948   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5949   ROM_LOAD( "epr203",       0x0000, 0x0800, CRC(be26b561) SHA1(cc27de6888eaf4ee18c0d37d9bcb528dd282b838) )
5950   ROM_LOAD( "mcs_d",        0x0800, 0x0800, CRC(13932a15) SHA1(b8885c555c6ad7021be55c6925a0a0872c1b6abd) )
5951   ROM_LOAD( "epr202",       0x1000, 0x0800, CRC(26c7e800) SHA1(034192e5e2cbac4b66a9828f5ec2311c2c368781) )
5952   ROM_LOAD( "mcs_c",        0x1800, 0x0800, CRC(24cfd145) SHA1(08c6599db170dd6ee364c44f70a0f5c0f881b6ef) )
2625   /* decode graphics */
2626   decode_anteater_gfx();
2627}
59532628
5954   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5955   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
5956ROM_END
59572629
5958ROM_START( smooncrs )
5959   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5960   ROM_LOAD( "927",          0x0000, 0x0800, CRC(55c5b994) SHA1(3451b121fa22361b2684385cf5d4455fa6963215) )
5961   ROM_LOAD( "928a",         0x0800, 0x0800, CRC(77ae26d3) SHA1(cbc16a024b73bedff76a6c47336d6ef098e92c53) )
5962   ROM_LOAD( "929",          0x1000, 0x0800, CRC(716eaa10) SHA1(780fc785e6651f19dc1a0ccf48cf9485d6562a71) )
5963   ROM_LOAD( "930",          0x1800, 0x0800, CRC(cea864f2) SHA1(aaaf9f8dd126dfb4a4f52f39863fee02a56a6485) )
5964   ROM_LOAD( "931",          0x2000, 0x0800, CRC(702c5f51) SHA1(5ba8d87c93c4810b8e7c2ad4ee376cd806e83686) )
5965   ROM_LOAD( "932a",         0x2800, 0x0800, CRC(e6a2039f) SHA1(f0f240dd8ac7cd2d9994cb7341b59d7a0a3eaf26) )
5966   ROM_LOAD( "933",          0x3000, 0x0800, CRC(73783cee) SHA1(69760e25ba22645572ec16b4f9136ee84ed0c766) )
5967   ROM_LOAD( "934",          0x3800, 0x0800, CRC(c1a14aa2) SHA1(99f6b01a0acd5e936d6ae61c13599db603b73191) )
5968
5969   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5970   ROM_LOAD( "epr203",       0x0000, 0x0800, CRC(be26b561) SHA1(cc27de6888eaf4ee18c0d37d9bcb528dd282b838) )
5971   ROM_LOAD( "mcs_d",        0x0800, 0x0800, CRC(13932a15) SHA1(b8885c555c6ad7021be55c6925a0a0872c1b6abd) )
5972   ROM_LOAD( "epr202",       0x1000, 0x0800, CRC(26c7e800) SHA1(034192e5e2cbac4b66a9828f5ec2311c2c368781) )
5973   ROM_LOAD( "mcs_c",        0x1800, 0x0800, CRC(24cfd145) SHA1(08c6599db170dd6ee364c44f70a0f5c0f881b6ef) )
5974
5975   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5976   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
5977ROM_END
5978
5979ROM_START( mooncrsb )
5980   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5981   ROM_LOAD( "bepr194",      0x0000, 0x0800, CRC(6a23ec6d) SHA1(df2214bdde26a71db59ffd39a745052076563f65) )
5982   ROM_LOAD( "bepr195",      0x0800, 0x0800, CRC(ee262ff2) SHA1(4e2202023ad53109ea58304071735d2425a617f3) )
5983   ROM_LOAD( "f03.bin",      0x1000, 0x0800, CRC(29a2b0ab) SHA1(e9fc7161d0566e36307c45b7132e2262c0af4845) )
5984   ROM_LOAD( "f04.bin",      0x1800, 0x0800, CRC(4c6a5a6d) SHA1(366516f63c9b5239e703e4dfb672659049ddbf44) )
5985   ROM_LOAD( "e5",           0x2000, 0x0800, CRC(06d378a6) SHA1(99dbe9fc7f95f8fdce86eb5c32bd1ca1bea0ca3c) )
5986   ROM_LOAD( "bepr199",      0x2800, 0x0800, CRC(6e84a927) SHA1(82e8e825d157c3c947a3a222bca059a735169c7d) )
5987   ROM_LOAD( "e7",           0x3000, 0x0800, CRC(b45af1e8) SHA1(d7020774707234acdaef5c655f667d5ee9e54a13) )
5988   ROM_LOAD( "bepr201",      0x3800, 0x0800, CRC(66da55d5) SHA1(39e2f6107e77ee97860147f64b9673cd9a2ae612) )
5989
5990   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
5991   ROM_LOAD( "epr203",       0x0000, 0x0800, CRC(be26b561) SHA1(cc27de6888eaf4ee18c0d37d9bcb528dd282b838) )
5992   ROM_LOAD( "mcs_d",        0x0800, 0x0800, CRC(13932a15) SHA1(b8885c555c6ad7021be55c6925a0a0872c1b6abd) )
5993   ROM_LOAD( "epr202",       0x1000, 0x0800, CRC(26c7e800) SHA1(034192e5e2cbac4b66a9828f5ec2311c2c368781) )
5994   ROM_LOAD( "mcs_c",        0x1800, 0x0800, CRC(24cfd145) SHA1(08c6599db170dd6ee364c44f70a0f5c0f881b6ef) )
5995
5996   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5997   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
5998ROM_END
5999
6000ROM_START( mooncrs2 )
6001   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6002   ROM_LOAD( "f8.bin",       0x0000, 0x0800, CRC(d36003e5) SHA1(562b27f1bccce6ae29de18b93fa51c508446cda9) )
6003   ROM_LOAD( "bepr195",      0x0800, 0x0800, CRC(ee262ff2) SHA1(4e2202023ad53109ea58304071735d2425a617f3) )
6004   ROM_LOAD( "f03.bin",      0x1000, 0x0800, CRC(29a2b0ab) SHA1(e9fc7161d0566e36307c45b7132e2262c0af4845) )
6005   ROM_LOAD( "f04.bin",      0x1800, 0x0800, CRC(4c6a5a6d) SHA1(366516f63c9b5239e703e4dfb672659049ddbf44) )
6006   ROM_LOAD( "e5",           0x2000, 0x0800, CRC(06d378a6) SHA1(99dbe9fc7f95f8fdce86eb5c32bd1ca1bea0ca3c) )
6007   ROM_LOAD( "bepr199",      0x2800, 0x0800, CRC(6e84a927) SHA1(82e8e825d157c3c947a3a222bca059a735169c7d) )
6008   ROM_LOAD( "e7",           0x3000, 0x0800, CRC(b45af1e8) SHA1(d7020774707234acdaef5c655f667d5ee9e54a13) )
6009   ROM_LOAD( "m7.bin",       0x3800, 0x0800, CRC(957ee078) SHA1(472038dedfc01c995be889ea93d4df8bef2b874c) )
6010
6011   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6012   ROM_LOAD( "1h_1_10.bin",  0x0000, 0x0800, CRC(528da705) SHA1(d726ee18b79774c982f88afb2a508eb5d5783193) )
6013   ROM_LOAD( "12.chr",       0x0800, 0x0200, CRC(5a4b17ea) SHA1(8a879dc34fdecc8a121c4a87abb981212fb05945) )
6014   ROM_CONTINUE(             0x0c00, 0x0200 )   /* this version of the gfx ROMs has two */
6015   ROM_CONTINUE(             0x0a00, 0x0200 )   /* groups of 16 sprites swapped */
6016   ROM_CONTINUE(             0x0e00, 0x0200 )
6017   ROM_LOAD( "1k_1_11.bin",  0x1000, 0x0800, CRC(4e79ff6b) SHA1(f72386a3766a7fcc7b4b8cedfa58b8d57f911f6f) )
6018   ROM_LOAD( "11.chr",       0x1800, 0x0200, CRC(e0edccbd) SHA1(0839a4c9b6e863d12253ae8e1732e80e08702228) )
6019   ROM_CONTINUE(             0x1c00, 0x0200 )
6020   ROM_CONTINUE(             0x1a00, 0x0200 )
6021   ROM_CONTINUE(             0x1e00, 0x0200 )
6022
6023   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6024   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
6025ROM_END
6026
6027ROM_START( mooncrs3 ) /* Bootleg by Jeutel, very simular to Moon Cresta (bootleg set 2) */
6028   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6029   ROM_LOAD( "b1.7f",  0x0000, 0x0800, CRC(0b28cd8a) SHA1(a1aa0ec63e1dddf4263aa39f6a5fda93108b6e98) )
6030   ROM_CONTINUE(       0x2000, 0x0800 )
6031   ROM_LOAD( "b2.7h",  0x0800, 0x0800, CRC(74a6f0ca) SHA1(cc8e8193bb6bd62f6cb9ea924e4da5ddc44c4685) )
6032   ROM_CONTINUE(       0x2800, 0x0800 )
6033   ROM_LOAD( "b3.7j",  0x1000, 0x0800, CRC(eeb34cc9) SHA1(c5e7d5e1989211be949972e4281403b7b4866922) )
6034   ROM_CONTINUE(       0x3000, 0x0800 )
6035   ROM_LOAD( "b4.7k",  0x1800, 0x0800, CRC(714330e5) SHA1(c681752732c73a6c9bcc9acdcd5c978c455acba0) )
6036   ROM_CONTINUE(       0x3800, 0x0800 )
6037
6038   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6039   ROM_LOAD( "o.1h",  0x0000, 0x0800, CRC(528da705) SHA1(d726ee18b79774c982f88afb2a508eb5d5783193) )
6040   ROM_LOAD( "q.1h",  0x0800, 0x0200, CRC(5a4b17ea) SHA1(8a879dc34fdecc8a121c4a87abb981212fb05945) )
6041   ROM_CONTINUE(      0x0c00, 0x0200 )   /* this version of the gfx ROMs has two */
6042   ROM_CONTINUE(      0x0a00, 0x0200 )   /* groups of 16 sprites swapped */
6043   ROM_CONTINUE(      0x0e00, 0x0200 )
6044   ROM_LOAD( "p.1k",  0x1000, 0x0800, CRC(4e79ff6b) SHA1(f72386a3766a7fcc7b4b8cedfa58b8d57f911f6f) )
6045   ROM_LOAD( "r.1k",  0x1800, 0x0200, CRC(e0edccbd) SHA1(0839a4c9b6e863d12253ae8e1732e80e08702228) )
6046   ROM_CONTINUE(      0x1c00, 0x0200 )
6047   ROM_CONTINUE(      0x1a00, 0x0200 )
6048   ROM_CONTINUE(      0x1e00, 0x0200 )
6049
6050   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6051   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
6052ROM_END
6053
6054
6055ROM_START( mooncmw )
6056   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6057   ROM_LOAD( "60.1x",      0x0000, 0x0800, CRC(322859e6) SHA1(292dccb66c38c8de837ec3ac10928d092494958e) )
6058   ROM_LOAD( "61.2x",      0x0800, 0x0800, CRC(c249902d) SHA1(0015461173fb991fd99c824e0eab054c3c17d0f1) )
6059   ROM_LOAD( "62.3x",      0x1000, 0x0800, CRC(29a2b0ab) SHA1(e9fc7161d0566e36307c45b7132e2262c0af4845) )
6060   ROM_LOAD( "63.4x",      0x1800, 0x0800, CRC(4c6a5a6d) SHA1(366516f63c9b5239e703e4dfb672659049ddbf44) )
6061   ROM_LOAD( "64.5x",      0x2000, 0x0800, CRC(06d378a6) SHA1(99dbe9fc7f95f8fdce86eb5c32bd1ca1bea0ca3c) )
6062   ROM_LOAD( "65.6x",      0x2800, 0x0800, CRC(6e84a927) SHA1(82e8e825d157c3c947a3a222bca059a735169c7d) )
6063   ROM_LOAD( "66.7x",      0x3000, 0x0800, CRC(f23cd8ce) SHA1(a77e7eca239de6a72a8cabed6444ae8efb9e40bd) )
6064   ROM_LOAD( "67.8x",      0x3800, 0x0800, CRC(66da55d5) SHA1(39e2f6107e77ee97860147f64b9673cd9a2ae612) )
6065
6066   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6067   ROM_LOAD( "68.1h",      0x0000, 0x1000, CRC(78663d86) SHA1(8648a3e60259404a05ad58b1641190e5b33a24eb) )
6068   ROM_LOAD( "69.1k",      0x1000, 0x1000, CRC(162c50d3) SHA1(67d9c87782cf29c443590d7ad687fbeaa6218346) )
6069
6070   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6071   ROM_LOAD( "prom-sn74s288n-71.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
6072ROM_END
6073
6074ROM_START( spcdrag )
6075   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6076   ROM_LOAD( "a.bin",      0x0000, 0x0800, CRC(38cc9839) SHA1(71c5853fc14a9c0b93e3b7660b925021680a0fe1) )
6077   ROM_LOAD( "b.bin",      0x0800, 0x0800, CRC(419fa8d6) SHA1(709b096d43c15cbfb98745e1f5e7c1bc921e3241) )
6078   ROM_LOAD( "c.bin",      0x1000, 0x0800, CRC(a1939def) SHA1(c9be93d325dde496d89e0735ec4e7abca932c0f6) )
6079   ROM_LOAD( "d.bin",      0x1800, 0x0800, CRC(cbcf17c5) SHA1(9aa3ca6dc30e4a19ed2bdb2be6ba90bde4cb7542) )
6080   ROM_LOAD( "em.bin",     0x2000, 0x0800, CRC(eb81c19c) SHA1(e5dd61704938c837b87a3155d54698482235c513) )
6081   ROM_LOAD( "fm.bin",     0x2800, 0x0800, CRC(757b7672) SHA1(d042e4bc17d2a8c9f1db55d57d5c235338cdb20c) )
6082   ROM_LOAD( "g.bin",      0x3000, 0x0800, CRC(57713b91) SHA1(ba01ed3f047ebbd0f9e6956e649bec0e8b730a45) )
6083   ROM_LOAD( "h.bin",      0x3800, 0x0800, CRC(159ad847) SHA1(9d46f380c868ac07964e571c54e800c683a6a679) )
6084
6085   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6086   ROM_LOAD( "203.bin",  0x0000, 0x0800, CRC(a2e82527) SHA1(5e9236ba102728213b4651db984b3a169b4a0410) )
6087   ROM_LOAD( "172.bin",  0x0800, 0x0800, CRC(13932a15) SHA1(b8885c555c6ad7021be55c6925a0a0872c1b6abd) )
6088   ROM_LOAD( "202.bin",  0x1000, 0x0800, CRC(80c3ad74) SHA1(0fd2269543d123bd427f5a648a17f8bee65b20a2) )
6089   ROM_LOAD( "171.bin",  0x1800, 0x0800, CRC(24cfd145) SHA1(08c6599db170dd6ee364c44f70a0f5c0f881b6ef) )
6090
6091   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6092   // not present in this set
6093   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
6094ROM_END
6095
6096ROM_START( spcdraga )
6097   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6098   ROM_LOAD( "1.7g",      0x0000, 0x0800, CRC(38cc9839) SHA1(71c5853fc14a9c0b93e3b7660b925021680a0fe1) )
6099   ROM_LOAD( "2.7g",      0x0800, 0x0800, CRC(29e00ae4) SHA1(574bdfb621e084485e6621229cd569486831e4ba) )
6100   ROM_LOAD( "3.7g",      0x1000, 0x0800, CRC(a1939def) SHA1(c9be93d325dde496d89e0735ec4e7abca932c0f6) )
6101   ROM_LOAD( "4.7g",      0x1800, 0x0800, CRC(068f8830) SHA1(e12d590401878d9f2695e5c7aa38387ed9ccfb06) )
6102   ROM_LOAD( "5.10g",     0x2000, 0x0800, CRC(32cd9adc) SHA1(3143690712465d092d6c63f4826f220839d78958) )
6103   ROM_LOAD( "6.10g",     0x2800, 0x0800, CRC(50db67c5) SHA1(69ad219332ac0d9f4e328b314f7bdc34d5599393) )
6104   ROM_LOAD( "7.10g",     0x3000, 0x0800, CRC(22415271) SHA1(60b1ca2dc044c0863c6f38280a3bd0ff9397c869) )
6105   ROM_LOAD( "8.10g",     0x3800, 0x0800, CRC(159ad847) SHA1(9d46f380c868ac07964e571c54e800c683a6a679) )
6106
6107   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6108   ROM_LOAD( "a2.7a",  0x0000, 0x0800, CRC(38b042dd) SHA1(bd452dae4cbc22a900cf783f84d1f9d8cb1218f9) )
6109   ROM_LOAD( "a4.7a",  0x0800, 0x0200, CRC(5a4b17ea) SHA1(8a879dc34fdecc8a121c4a87abb981212fb05945) )
6110   ROM_CONTINUE(      0x0c00, 0x0200 )   /* this version of the gfx ROMs has two */
6111   ROM_CONTINUE(      0x0a00, 0x0200 )   /* groups of 16 sprites swapped */
6112   ROM_CONTINUE(      0x0e00, 0x0200 )
6113   ROM_LOAD( "a1.9a",  0x1000, 0x0800, CRC(24441ab3) SHA1(8c9d2bd062cb2360f3dd3df2d7d212e9485f91ad) )
6114   ROM_LOAD( "a3.9a",  0x1800, 0x0200, CRC(e0edccbd) SHA1(0839a4c9b6e863d12253ae8e1732e80e08702228) )
6115   ROM_CONTINUE(      0x1c00, 0x0200 )
6116   ROM_CONTINUE(      0x1a00, 0x0200 )
6117   ROM_CONTINUE(      0x1e00, 0x0200 )
6118
6119   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6120   // not present in this set
6121   ROM_LOAD( "prom_6331.10f", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
6122ROM_END
6123
6124
6125ROM_START( fantazia )
6126   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6127   ROM_LOAD( "f01.bin",      0x0000, 0x0800, CRC(d3e23863) SHA1(f0a6f7491fdf8aae214f40078b29b7aecdcf2f1e) )
6128   ROM_LOAD( "f02.bin",      0x0800, 0x0800, CRC(63fa4149) SHA1(603ee6d4d2952cc08b3f6e98b1a2053671875e44) )
6129   ROM_LOAD( "f03.bin",      0x1000, 0x0800, CRC(29a2b0ab) SHA1(e9fc7161d0566e36307c45b7132e2262c0af4845) )
6130   ROM_LOAD( "f04.bin",      0x1800, 0x0800, CRC(4c6a5a6d) SHA1(366516f63c9b5239e703e4dfb672659049ddbf44) )
6131   ROM_LOAD( "f09.bin",      0x2000, 0x0800, CRC(75fd5ca1) SHA1(45f2dd33f0e437cb95d9373f86490e5432338737) )
6132   ROM_LOAD( "f10.bin",      0x2800, 0x0800, CRC(e4da2dd4) SHA1(7a53efd5b583f656c87b7d7a5ba7c239ced7d87b) )
6133   ROM_LOAD( "f11.bin",      0x3000, 0x0800, CRC(42869646) SHA1(a3640b2ace31ce99c056bc14d1d96f3404698d6a) )
6134   ROM_LOAD( "f12.bin",      0x3800, 0x0800, CRC(a48d7fb0) SHA1(6206036a9d85e87fb7f8a88c17bfe090fc70caf4) )
6135
6136   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6137   ROM_LOAD( "1h_1_10.bin",  0x0000, 0x0800, CRC(528da705) SHA1(d726ee18b79774c982f88afb2a508eb5d5783193) )
6138   ROM_LOAD( "mcs_d",        0x0800, 0x0800, CRC(13932a15) SHA1(b8885c555c6ad7021be55c6925a0a0872c1b6abd) )
6139   ROM_LOAD( "1k_1_11.bin",  0x1000, 0x0800, CRC(4e79ff6b) SHA1(f72386a3766a7fcc7b4b8cedfa58b8d57f911f6f) )
6140   ROM_LOAD( "mcs_c",        0x1800, 0x0800, CRC(24cfd145) SHA1(08c6599db170dd6ee364c44f70a0f5c0f881b6ef) )
6141
6142   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6143   ROM_LOAD( "fantazia.clr", 0x0000, 0x0020, CRC(a84ff0af) SHA1(c300dc937c608d2d1c113ca7a53c649472c72379) )
6144ROM_END
6145
6146ROM_START( eagle )
6147   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6148   ROM_LOAD( "e1",           0x0000, 0x0800, CRC(224c9526) SHA1(4c014d60d4ee80de7f60b4609269461688c181d0) )
6149   ROM_LOAD( "e2",           0x0800, 0x0800, CRC(cc538ebd) SHA1(4ef3c7363e2dcd9ed99779039ccc50a9f2084dbd) )
6150   ROM_LOAD( "f03.bin",      0x1000, 0x0800, CRC(29a2b0ab) SHA1(e9fc7161d0566e36307c45b7132e2262c0af4845) )
6151   ROM_LOAD( "f04.bin",      0x1800, 0x0800, CRC(4c6a5a6d) SHA1(366516f63c9b5239e703e4dfb672659049ddbf44) )
6152   ROM_LOAD( "e5",           0x2000, 0x0800, CRC(06d378a6) SHA1(99dbe9fc7f95f8fdce86eb5c32bd1ca1bea0ca3c) )
6153   ROM_LOAD( "e6",           0x2800, 0x0800, CRC(0dea20d5) SHA1(405b51d4e3b1065f78afd2297e075e977ae19196) )
6154   ROM_LOAD( "e7",           0x3000, 0x0800, CRC(b45af1e8) SHA1(d7020774707234acdaef5c655f667d5ee9e54a13) )
6155   ROM_LOAD( "e8",           0x3800, 0x0800, CRC(c437a876) SHA1(845941b873970ac62ba9bb6353bee53d0fcfa292) )
6156
6157   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6158   ROM_LOAD( "e10",          0x0000, 0x0800, CRC(40ce58bf) SHA1(67ea99e1afe4fff3e17252b22d11d3c96a416041) )
6159   ROM_LOAD( "e12",          0x0800, 0x0200, CRC(628fdeed) SHA1(a798530c65e639fbf00ed3a4e8c428935bf5f38e) )
6160   ROM_CONTINUE(             0x0c00, 0x0200 )   /* this version of the gfx ROMs has two */
6161   ROM_CONTINUE(             0x0a00, 0x0200 )   /* groups of 16 sprites swapped */
6162   ROM_CONTINUE(             0x0e00, 0x0200 )
6163   ROM_LOAD( "e9",           0x1000, 0x0800, CRC(ba664099) SHA1(9509123bed02a9d47f2c056e1562b80206da5579) )
6164   ROM_LOAD( "e11",          0x1800, 0x0200, CRC(ee4ec5fd) SHA1(bf08b3f111f780dc8c81275e4e6247388183a8da) )
6165   ROM_CONTINUE(             0x1c00, 0x0200 )
6166   ROM_CONTINUE(             0x1a00, 0x0200 )
6167   ROM_CONTINUE(             0x1e00, 0x0200 )
6168
6169   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6170   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
6171ROM_END
6172
6173ROM_START( eagle2 )
6174   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6175   ROM_LOAD( "e1.7f",        0x0000, 0x0800, CRC(45aab7a3) SHA1(52ae0463f363dc0964b976faa2c0c428d85a4f12) )
6176   ROM_LOAD( "e2",           0x0800, 0x0800, CRC(cc538ebd) SHA1(4ef3c7363e2dcd9ed99779039ccc50a9f2084dbd) )
6177   ROM_LOAD( "f03.bin",      0x1000, 0x0800, CRC(29a2b0ab) SHA1(e9fc7161d0566e36307c45b7132e2262c0af4845) )
6178   ROM_LOAD( "f04.bin",      0x1800, 0x0800, CRC(4c6a5a6d) SHA1(366516f63c9b5239e703e4dfb672659049ddbf44) )
6179   ROM_LOAD( "e5",           0x2000, 0x0800, CRC(06d378a6) SHA1(99dbe9fc7f95f8fdce86eb5c32bd1ca1bea0ca3c) )
6180   ROM_LOAD( "e6.6",         0x2800, 0x0800, CRC(9f09f8c6) SHA1(47c600629e02357389dd78c7fcaec862e0da4ef0) )
6181   ROM_LOAD( "e7",           0x3000, 0x0800, CRC(b45af1e8) SHA1(d7020774707234acdaef5c655f667d5ee9e54a13) )
6182   ROM_LOAD( "e8",           0x3800, 0x0800, CRC(c437a876) SHA1(845941b873970ac62ba9bb6353bee53d0fcfa292) )
6183
6184   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6185   ROM_LOAD( "e10.2",        0x0000, 0x0800, CRC(25b38ebd) SHA1(f679c2f2cb5892680fec102fafbdfeae156ce373) )
6186   ROM_LOAD( "e12",          0x0800, 0x0200, CRC(628fdeed) SHA1(a798530c65e639fbf00ed3a4e8c428935bf5f38e) )
6187   ROM_CONTINUE(             0x0c00, 0x0200 )   /* this version of the gfx ROMs has two */
6188   ROM_CONTINUE(             0x0a00, 0x0200 )   /* groups of 16 sprites swapped */
6189   ROM_CONTINUE(             0x0e00, 0x0200 )
6190   ROM_LOAD( "e9",           0x1000, 0x0800, CRC(ba664099) SHA1(9509123bed02a9d47f2c056e1562b80206da5579) )
6191   ROM_LOAD( "e11",          0x1800, 0x0200, CRC(ee4ec5fd) SHA1(bf08b3f111f780dc8c81275e4e6247388183a8da) )
6192   ROM_CONTINUE(             0x1c00, 0x0200 )
6193   ROM_CONTINUE(             0x1a00, 0x0200 )
6194   ROM_CONTINUE(             0x1e00, 0x0200 )
6195
6196   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6197   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
6198ROM_END
6199
6200ROM_START( eagle3 )
6201   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6202   ROM_LOAD( "e1",           0x0000, 0x0800, CRC(224c9526) SHA1(4c014d60d4ee80de7f60b4609269461688c181d0) )
6203   ROM_LOAD( "e2",           0x0800, 0x0800, CRC(cc538ebd) SHA1(4ef3c7363e2dcd9ed99779039ccc50a9f2084dbd) )
6204   ROM_LOAD( "f03.bin",      0x1000, 0x0800, CRC(29a2b0ab) SHA1(e9fc7161d0566e36307c45b7132e2262c0af4845) )
6205   ROM_LOAD( "f04.bin",      0x1800, 0x0800, CRC(4c6a5a6d) SHA1(366516f63c9b5239e703e4dfb672659049ddbf44) )
6206   ROM_LOAD( "e5",           0x2000, 0x0800, CRC(06d378a6) SHA1(99dbe9fc7f95f8fdce86eb5c32bd1ca1bea0ca3c) )
6207   ROM_LOAD( "e6",           0x2800, 0x0800, CRC(0dea20d5) SHA1(405b51d4e3b1065f78afd2297e075e977ae19196) )
6208   ROM_LOAD( "e7",           0x3000, 0x0800, CRC(b45af1e8) SHA1(d7020774707234acdaef5c655f667d5ee9e54a13) )
6209   ROM_LOAD( "e8",           0x3800, 0x0800, CRC(c437a876) SHA1(845941b873970ac62ba9bb6353bee53d0fcfa292) )
6210
6211   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6212   ROM_LOAD( "e10a",         0x0000, 0x0800, CRC(e3c63d4c) SHA1(ad2b22e316da6bb819c58934d51cd4b2819b18f0) )
6213   ROM_LOAD( "e12",          0x0800, 0x0200, CRC(628fdeed) SHA1(a798530c65e639fbf00ed3a4e8c428935bf5f38e) )
6214   ROM_CONTINUE(             0x0c00, 0x0200 )   /* this version of the gfx ROMs has two */
6215   ROM_CONTINUE(             0x0a00, 0x0200 )   /* groups of 16 sprites swapped */
6216   ROM_CONTINUE(             0x0e00, 0x0200 )
6217   ROM_LOAD( "e9a",          0x1000, 0x0800, CRC(59429e47) SHA1(b7629c81d122fd1e4d390aa7abba44df898387d3) )
6218   ROM_LOAD( "e11",          0x1800, 0x0200, CRC(ee4ec5fd) SHA1(bf08b3f111f780dc8c81275e4e6247388183a8da) )
6219   ROM_CONTINUE(             0x1c00, 0x0200 )
6220   ROM_CONTINUE(             0x1a00, 0x0200 )
6221   ROM_CONTINUE(             0x1e00, 0x0200 )
6222
6223   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6224   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
6225ROM_END
6226
6227ROM_START( spctbird )
6228   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6229   ROM_LOAD( "tssa-7f",      0x0000, 0x0800, CRC(45aab7a3) SHA1(52ae0463f363dc0964b976faa2c0c428d85a4f12) )
6230   ROM_LOAD( "tssa-7h",      0x0800, 0x0800, CRC(8b328f48) SHA1(d4f549e90e0bf1f546e2c3dc5a5a16e0415e709e) )
6231   ROM_LOAD( "tssa-7k",      0x1000, 0x0800, CRC(29a2b0ab) SHA1(e9fc7161d0566e36307c45b7132e2262c0af4845) )
6232   ROM_LOAD( "tssa-7m",      0x1800, 0x0800, CRC(99c9166d) SHA1(c108d84330bc958ff2812dc807e68c246a5a5ad5) )
6233   ROM_LOAD( "tssa-5",       0x2000, 0x0800, CRC(797b6261) SHA1(9a60e504e2aa0201b7311485c0dd411bbe2dc70b) )
6234   ROM_LOAD( "tssa-6",       0x2800, 0x0800, CRC(4825692c) SHA1(41a7e305c3d93f2245fb0413398d951eab9d16c0) )
6235   ROM_LOAD( "tssa-7",       0x3000, 0x0800, CRC(b45af1e8) SHA1(d7020774707234acdaef5c655f667d5ee9e54a13) )
6236   ROM_LOAD( "tssa-8",       0x3800, 0x0800, CRC(c9b77b85) SHA1(00797f126b4cdacd9ec2df7e747aa1892933b8b8) )
6237
6238   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6239   ROM_LOAD( "tssb-2",       0x0000, 0x0800, CRC(7d23e1f2) SHA1(6902e44ff6f805a8d589c57b236e471b7fb609f8) )
6240   ROM_LOAD( "tssb-4",       0x0800, 0x0200, CRC(e4977833) SHA1(85aca9bccc6c1a5a2d792a9c4a77ee1b114934c9) )
6241   ROM_CONTINUE(             0x0c00, 0x0200 )
6242   ROM_CONTINUE(             0x0a00, 0x0200 )
6243   ROM_CONTINUE(             0x0e00, 0x0200 )
6244   ROM_LOAD( "tssb-1",       0x1000, 0x0800, CRC(9b9267c3) SHA1(2bbbff7a8a2d3e4524634de5e1c5a2426612c18f) )
6245   ROM_LOAD( "tssb-3",       0x1800, 0x0200, CRC(5ca5e233) SHA1(2115faecd07940547d0ee09776da6fcb1a008287) )
6246   ROM_CONTINUE(             0x1c00, 0x0200 )
6247   ROM_CONTINUE(             0x1a00, 0x0200 )
6248   ROM_CONTINUE(             0x1e00, 0x0200 )
6249
6250   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6251   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
6252ROM_END
6253
6254ROM_START( skybase )
6255   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6256   ROM_LOAD( "skybase.9a",   0x0000, 0x1000, CRC(845b87a5) SHA1(8a249c1ec921532cb1bb85ed7fec11396634ca38) )
6257   ROM_LOAD( "skybase.8a",   0x1000, 0x1000, CRC(096785c2) SHA1(a0833bc1984e1f198587195e58b6fed6657922bd) )
6258   ROM_LOAD( "skybase.7a",   0x2000, 0x1000, CRC(d50c715b) SHA1(3d0fa15514b210bccd4aeed06540122a4f56fd7a) )
6259   ROM_LOAD( "skybase.6a",   0x3000, 0x1000, CRC(f57edb27) SHA1(4b5c376017700315345241fad96c00478a14fc8f) )
6260   ROM_LOAD( "skybase.5a",   0x4000, 0x1000, CRC(50365d95) SHA1(9b3d360c9d1df0ebf047bef1b30765ea9bb42b42) )
6261   ROM_LOAD( "skybase.4a",   0x5000, 0x1000, CRC(cbd6647f) SHA1(7a167c9df6b5f3346c37e5c45d0680b0b29852a6) )
6262
6263   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
6264   ROM_LOAD( "skybase.7t",   0x0000, 0x1000, CRC(9b471686) SHA1(b35831daa8ce57e498c2c4f75763a74c340cfaf0) )
6265   ROM_LOAD( "skybase.8t",   0x1000, 0x1000, CRC(1cf723da) SHA1(f2e41ab89413298571626d13b2b5853eb35dcb96) )
6266   ROM_LOAD( "skybase.10t",  0x2000, 0x1000, CRC(fe02e72c) SHA1(bf7c078e984b13dcc12d529904f1096d65e41bec) )
6267   ROM_LOAD( "skybase.9t",   0x3000, 0x1000, CRC(0871291f) SHA1(2e4e802316b55711bcfeb48d84bacd11afff8cb3) )
6268
6269   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6270   ROM_LOAD( "82s123.bpr",  0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Color prom */
6271ROM_END
6272
6273ROM_START( moonqsr )
6274   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6275   ROM_LOAD( "mq1",          0x0000, 0x0800, CRC(132c13ec) SHA1(d95166b025442f184e44a70312fb3b4f6366f324) )
6276   ROM_LOAD( "mq2",          0x0800, 0x0800, CRC(c8eb74f1) SHA1(4efa85c40349852da47a0f725ae06873efe4ce1c) )
6277   ROM_LOAD( "mq3",          0x1000, 0x0800, CRC(33965a89) SHA1(92912cea76a472d9b709c664d9818844a07fcc32) )
6278   ROM_LOAD( "mq4",          0x1800, 0x0800, CRC(a3861d17) SHA1(d7037d93b7838ccdd9a6a1a1476571cfa869fca1) )
6279   ROM_LOAD( "mq5",          0x2000, 0x0800, CRC(8bcf9c67) SHA1(7af0d9308d20c52675301acf5d1a5d62358352a6) )
6280   ROM_LOAD( "mq6",          0x2800, 0x0800, CRC(5750cda9) SHA1(17c2bc38037833fdb8923d4a2262264386ef916b) )
6281   ROM_LOAD( "mq7",          0x3000, 0x0800, CRC(78d7fe5b) SHA1(4085562a0af94c65dad2a3550409727e597c0d5b) )
6282   ROM_LOAD( "mq8",          0x3800, 0x0800, CRC(4919eed5) SHA1(526aaedd25e0f7c525eb7c66519218ae09b0407e) )
6283
6284   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6285
6286   ROM_LOAD( "mqb",          0x0000, 0x0800, CRC(b55ec806) SHA1(fb52e53dfa3ae9dec162622d22de9cfdb0b5f9d6) )
6287   ROM_LOAD( "mqd",          0x0800, 0x0800, CRC(9e7d0e13) SHA1(18951080d307ac13344f89745f671595e26d282c) )
6288   ROM_LOAD( "mqa",          0x1000, 0x0800, CRC(66eee0db) SHA1(eeb08efd226e15e248999558240488ffd0e39688) )
6289   ROM_LOAD( "mqc",          0x1800, 0x0800, CRC(a6db5b0d) SHA1(476e197df047e991d2ea3c1fad92c799510f1647) )
6290
6291   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6292   ROM_LOAD( "vid_e6.bin",   0x0000, 0x0020, CRC(0b878b54) SHA1(3667aca564ebfef5b88d7f74fabbd16dd23183b4) )
6293ROM_END
6294
6295ROM_START( moonal2 )
6296   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6297   ROM_LOAD( "ali1",         0x0000, 0x0400, CRC(0dcecab4) SHA1(493628640de1a7e3bb9914ee3459b74cedc599fd) )
6298   ROM_LOAD( "ali2",         0x0400, 0x0400, CRC(c6ee75a7) SHA1(36503351380f7638069637c22bd06da06da54a1c) )
6299   ROM_LOAD( "ali3",         0x0800, 0x0400, CRC(cd1be7e9) SHA1(684f1923090f0d53338705f6972778712e27577f) )
6300   ROM_LOAD( "ali4",         0x0c00, 0x0400, CRC(83b03f08) SHA1(a1fd422051aa7f17f857188b503031cce3fdc275) )
6301   ROM_LOAD( "ali5",         0x1000, 0x0400, CRC(6f3cf61d) SHA1(e238ed6f9c0813f0177abe9090e29562529eeef8) )
6302   ROM_LOAD( "ali6",         0x1400, 0x0400, CRC(e169d432) SHA1(a5189d7322a240863afee7ac0ecf68599498cb87) )
6303   ROM_LOAD( "ali7",         0x1800, 0x0400, CRC(41f64b73) SHA1(dff786a74575da9fbaca3ac610ad2f367983c7fc) )
6304   ROM_LOAD( "ali8",         0x1c00, 0x0400, CRC(f72ee876) SHA1(8e50a516f10d77652ff3692bb85adb66bc128e26) )
6305   ROM_LOAD( "ali9",         0x2000, 0x0400, CRC(b7fb763c) SHA1(4e7c4995f52dec2ea61424c79d79797933dad604) )
6306   ROM_LOAD( "ali10",        0x2400, 0x0400, CRC(b1059179) SHA1(86de04c82a7604cb57958a52d5585837481f94a5) )
6307   ROM_LOAD( "ali11",        0x2800, 0x0400, CRC(9e79a1c6) SHA1(2f59e3a2a81a224b163b23bd2c184385f64e1565) )
6308
6309   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6310   ROM_LOAD( "ali13.1h",     0x0000, 0x0800, CRC(a1287bf6) SHA1(eeeaba4b9e186454a5e2f1c26e333e8fccd97af8) )
6311   ROM_RELOAD(                 0x0800, 0x0800 )
6312   ROM_LOAD( "ali12.1k",     0x1000, 0x0800, CRC(528f1481) SHA1(e266a75c3109bcfa2a0394f2ed0ac136fc3158ba) )
6313   ROM_RELOAD(                 0x1800, 0x0800 )
6314
6315   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6316   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
6317ROM_END
6318
6319ROM_START( moonal2b )
6320   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6321   ROM_LOAD( "ali1",         0x0000, 0x0400, CRC(0dcecab4) SHA1(493628640de1a7e3bb9914ee3459b74cedc599fd) )
6322   ROM_LOAD( "ali2",         0x0400, 0x0400, CRC(c6ee75a7) SHA1(36503351380f7638069637c22bd06da06da54a1c) )
6323   ROM_LOAD( "md-2",         0x0800, 0x0800, CRC(8318b187) SHA1(75bb113db1111cd2a335139fa6cb94d9522f5860) )
6324   ROM_LOAD( "ali5",         0x1000, 0x0400, CRC(6f3cf61d) SHA1(e238ed6f9c0813f0177abe9090e29562529eeef8) )
6325   ROM_LOAD( "ali6",         0x1400, 0x0400, CRC(e169d432) SHA1(a5189d7322a240863afee7ac0ecf68599498cb87) )
6326   ROM_LOAD( "ali7",         0x1800, 0x0400, CRC(41f64b73) SHA1(dff786a74575da9fbaca3ac610ad2f367983c7fc) )
6327   ROM_LOAD( "ali8",         0x1c00, 0x0400, CRC(f72ee876) SHA1(8e50a516f10d77652ff3692bb85adb66bc128e26) )
6328   ROM_LOAD( "ali9",         0x2000, 0x0400, CRC(b7fb763c) SHA1(4e7c4995f52dec2ea61424c79d79797933dad604) )
6329   ROM_LOAD( "ali10",        0x2400, 0x0400, CRC(b1059179) SHA1(86de04c82a7604cb57958a52d5585837481f94a5) )
6330   ROM_LOAD( "md-6",         0x2800, 0x0800, CRC(9cc973e0) SHA1(8d96448794e0869036a3fac7f7fbcad459149a98) )
6331
6332   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6333   ROM_LOAD( "ali13.1h",     0x0000, 0x0800, CRC(a1287bf6) SHA1(eeeaba4b9e186454a5e2f1c26e333e8fccd97af8) )
6334   ROM_RELOAD(                 0x0800, 0x0800 )
6335   ROM_LOAD( "ali12.1k",     0x1000, 0x0800, CRC(528f1481) SHA1(e266a75c3109bcfa2a0394f2ed0ac136fc3158ba) )
6336   ROM_RELOAD(                 0x1800, 0x0800 )
6337
6338   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6339   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
6340ROM_END
6341
6342ROM_START( supergx )
6343   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6344   ROM_LOAD( "sg1",          0x0000, 0x0800, CRC(b83f4578) SHA1(9a5d5fc291839f7f1e0a52cca7bea29e99c13315) )
6345   ROM_LOAD( "sg2",          0x0800, 0x0800, CRC(d12ca054) SHA1(8eb7f6904c3c650bfa80908a5988622d5e693bd1) )
6346   ROM_LOAD( "sg3",          0x1000, 0x0800, CRC(53714cb1) SHA1(7dffcd3ced1c3354339bb69477f8aa4c708708db) )
6347   ROM_LOAD( "sg4",          0x1800, 0x0800, CRC(2f36fc69) SHA1(d310dcb0a79b03ee26b0575db9cba6d920cb9273) )
6348   ROM_LOAD( "sg5",          0x2000, 0x0800, CRC(1e0ed4fd) SHA1(183d8990dbff1954921f8c5b67cec09f2d380794) )
6349   ROM_LOAD( "sg6",          0x2800, 0x0800, BAD_DUMP CRC(4f3d97a8) SHA1(b9fcab182ab57e8374fef93f7fd314a155a8d04d) )
6350
6351   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6352   ROM_LOAD( "sgg1",         0x0000, 0x0800, CRC(a1287bf6) SHA1(eeeaba4b9e186454a5e2f1c26e333e8fccd97af8) )
6353   ROM_RELOAD(               0x0800, 0x0800 )
6354   ROM_LOAD( "sgg2",         0x1000, 0x0800, CRC(528f1481) SHA1(e266a75c3109bcfa2a0394f2ed0ac136fc3158ba) )
6355   ROM_RELOAD(               0x1800, 0x0800 )
6356
6357   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6358   ROM_LOAD( "supergx.prm",  0x0000, 0x0020, NO_DUMP )
6359ROM_END
6360
6361ROM_START( mshuttle )
6362   ROM_REGION( 2*0x10000, REGION_CPU1, 0 )   /* 64k for code + 64k for decrypted opcodes */
6363   ROM_LOAD( "my05",         0x0000, 0x1000, CRC(83574af1) SHA1(d69c2a0538a49d6c72c3346ac4e3959d91da6c98) )
6364   ROM_LOAD( "my04",         0x1000, 0x1000, CRC(1cfae2c8) SHA1(6c7eeee70e91b8498c41525dcc60f8086cff8da7) )
6365   ROM_LOAD( "my03",         0x2000, 0x1000, CRC(c8b8a368) SHA1(140ba60f55285d1e9f7a262634f5ce5c3470ab71) )
6366   ROM_LOAD( "my02",         0x3000, 0x1000, CRC(b6aeee6e) SHA1(032af7000aebe9d34319231cdb3f2fe5de7158ba) )
6367   ROM_LOAD( "my01",         0x4000, 0x1000, CRC(def82adc) SHA1(2fb963299468c52d50b7460b55bf69c9659ee21d) )
6368
6369   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
6370   ROM_LOAD( "my09",         0x0000, 0x1000, CRC(3601b380) SHA1(c0b9d1801f58a16449708d514d2fd88e34af340b) )
6371   ROM_LOAD( "my11",         0x1000, 0x0800, CRC(b659e932) SHA1(3f63c99e81cb93c9553a5e274546525f598d50c4) )
6372   ROM_LOAD( "my08",         0x2000, 0x1000, CRC(992b06cd) SHA1(8645ccad8169601bbe25b9f2b17b99004c0a584f) )
6373   ROM_LOAD( "my10",         0x3000, 0x0800, CRC(d860e6ce) SHA1(2912d13bf69496f8f18358a36366a1f60afd0070) )
6374
6375   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6376   ROM_LOAD( "mscprom1.bin", 0x0000, 0x0020, CRC(ea0d1af0) SHA1(cb59e04c02307dfe847e3170cf0a7f62829b6094) )
6377
6378   ROM_REGION( 0x2000, REGION_SOUND1, 0 )   /* samples */
6379   ROM_LOAD( "my07",         0x0000, 0x1000, CRC(522a2920) SHA1(a64d821a8ff6bd6e2b0bdb1e632181e65a97363b) )
6380   ROM_LOAD( "my06",         0x1000, 0x1000, CRC(466415f2) SHA1(a05f8238cdcebe926a564ef6268b3cd677987fa2) )
6381ROM_END
6382
6383ROM_START( mshuttlj )
6384   ROM_REGION( 2*0x10000, REGION_CPU1, 0 )   /* 64k for code + 64k for decrypted opcodes */
6385   ROM_LOAD( "mcs.5",        0x0000, 0x1000, CRC(a5a292b4) SHA1(b4e9d969c762f4114eba88051917df122fc7181f) )
6386   ROM_LOAD( "mcs.4",        0x1000, 0x1000, CRC(acdc0f9e) SHA1(8cd6d6566fe3f4090ccb625c3c1e5850a371826f) )
6387   ROM_LOAD( "mcs.3",        0x2000, 0x1000, CRC(c1e3f5d8) SHA1(d3af89d485b1ca21ac879dbe15490dcd1cd64f2a) )
6388   ROM_LOAD( "mcs.2",        0x3000, 0x1000, CRC(14577703) SHA1(51537982dd06ba44e95e4c7d1f7fa41ff186421d) )
6389
6390   ROM_LOAD( "mcs.1",        0x4000, 0x1000, CRC(27d46772) SHA1(848a47ba30823a55933bb55792991f0535078f0c) )
6391
6392   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
6393   ROM_LOAD( "my09",         0x0000, 0x1000, CRC(3601b380) SHA1(c0b9d1801f58a16449708d514d2fd88e34af340b) )
6394   ROM_LOAD( "my11",         0x1000, 0x0800, CRC(b659e932) SHA1(3f63c99e81cb93c9553a5e274546525f598d50c4) )
6395   ROM_LOAD( "my08",         0x2000, 0x1000, CRC(992b06cd) SHA1(8645ccad8169601bbe25b9f2b17b99004c0a584f) )
6396   ROM_LOAD( "my10",         0x3000, 0x0800, CRC(d860e6ce) SHA1(2912d13bf69496f8f18358a36366a1f60afd0070) )
6397
6398   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6399   ROM_LOAD( "mscprom1.bin", 0x0000, 0x0020, CRC(ea0d1af0) SHA1(cb59e04c02307dfe847e3170cf0a7f62829b6094) )
6400
6401   ROM_REGION( 0x2000, REGION_SOUND1, 0 )   /* samples */
6402   ROM_LOAD( "my07",         0x0000, 0x1000, CRC(522a2920) SHA1(a64d821a8ff6bd6e2b0bdb1e632181e65a97363b) )
6403   ROM_LOAD( "my06",         0x1000, 0x1000, CRC(466415f2) SHA1(a05f8238cdcebe926a564ef6268b3cd677987fa2) )
6404ROM_END
6405
6406ROM_START( mshutlj2 )
6407   ROM_REGION( 2*0x10000, REGION_CPU1, 0 )   /* 64k for code + 64k for decrypted opcodes */
6408   ROM_LOAD( "ali5.bin",     0x0000, 0x1000, CRC(320fe630) SHA1(df4fe25989783c8851f41c9b4b63dedfa365c1e9) )
6409   ROM_LOAD( "mcs.4",        0x1000, 0x1000, CRC(acdc0f9e) SHA1(8cd6d6566fe3f4090ccb625c3c1e5850a371826f) )
6410   ROM_LOAD( "mcs.3",        0x2000, 0x1000, CRC(c1e3f5d8) SHA1(d3af89d485b1ca21ac879dbe15490dcd1cd64f2a) )
6411   ROM_LOAD( "ali2.bin",     0x3000, 0x1000, CRC(9ed169e1) SHA1(75a24d0fcbdfc7c4e6fa0d8c7f8b4a3bccaa4439) )
6412
6413   ROM_LOAD( "ali1.bin",     0x4000, 0x1000, CRC(7f8a52d9) SHA1(4e62f6265289bae1a46e60cdd3230e188b2aec3c) )
6414
6415   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
6416   ROM_LOAD( "my09",         0x0000, 0x1000, CRC(3601b380) SHA1(c0b9d1801f58a16449708d514d2fd88e34af340b) )
6417   ROM_LOAD( "my11",         0x1000, 0x0800, CRC(b659e932) SHA1(3f63c99e81cb93c9553a5e274546525f598d50c4) )
6418   ROM_LOAD( "my08",         0x2000, 0x1000, CRC(992b06cd) SHA1(8645ccad8169601bbe25b9f2b17b99004c0a584f) )
6419   ROM_LOAD( "my10",         0x3000, 0x0800, CRC(d860e6ce) SHA1(2912d13bf69496f8f18358a36366a1f60afd0070) )
6420
6421   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6422   ROM_LOAD( "mscprom1.bin", 0x0000, 0x0020, CRC(ea0d1af0) SHA1(cb59e04c02307dfe847e3170cf0a7f62829b6094) )
6423
6424   ROM_REGION( 0x2000, REGION_SOUND1, 0 )   /* samples */
6425   ROM_LOAD( "my07",         0x0000, 0x1000, CRC(522a2920) SHA1(a64d821a8ff6bd6e2b0bdb1e632181e65a97363b) )
6426   ROM_LOAD( "my06",         0x1000, 0x1000, CRC(466415f2) SHA1(a05f8238cdcebe926a564ef6268b3cd677987fa2) )
6427ROM_END
6428
6429ROM_START( kingball )
6430   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6431   ROM_LOAD( "prg1.7f",      0x0000, 0x1000, CRC(6cb49046) SHA1(a0891605dff7f9ff51bc7ad85f831a749f2f61e9) )
6432   ROM_LOAD( "prg2.7j",      0x1000, 0x1000, CRC(c223b416) SHA1(ca2d9f6b8ef6db4f382089161f4147d9828c3554) )
6433   ROM_LOAD( "prg3.7l",      0x2000, 0x0800, CRC(453634c0) SHA1(0025ccd91e165692092a37541e730010e85e37f2) )
6434
6435   ROM_REGION( 0x10000, REGION_CPU2, 0 )   /* 64k for sound code */
6436   ROM_LOAD( "kbe1.ic4",     0x0000, 0x0800, CRC(5be2c80a) SHA1(f719a80357bed3d66bce40569690f419740148c5) )
6437   ROM_LOAD( "kbe2.ic5",     0x0800, 0x0800, CRC(bb59e965) SHA1(830e0c415f051e932d76df604025e4e33118a799) )
6438   ROM_LOAD( "kbe3.ic6",     0x1000, 0x0800, CRC(1c94dd31) SHA1(14ab59b8eee741eb1f10ae99ddb99bf7c2dab957) )
6439   ROM_LOAD( "kbe2.ic7",     0x1800, 0x0800, CRC(bb59e965) SHA1(830e0c415f051e932d76df604025e4e33118a799) )
6440
6441   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6442   ROM_LOAD( "chg1.1h",      0x0000, 0x0800, CRC(9cd550e7) SHA1(d2989e6b7a4d7b37a711ef1cfb536fe13e0c5482) )
6443   ROM_RELOAD(                 0x0800, 0x0800 )
6444   ROM_LOAD( "chg2.1k",      0x1000, 0x0800, CRC(a206757d) SHA1(46b50005876b7f61ab4a118d0a4caaebce8ce3e1) )
6445   ROM_RELOAD(                 0x1800, 0x0800 )
6446
6447   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6448   ROM_LOAD( "kb2-1",        0x0000, 0x0020, CRC(15dd5b16) SHA1(3d2ca2b42bf508a9e5198e970abcbbedf5729164) )
6449ROM_END
6450
6451ROM_START( kingbalj )
6452   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6453   ROM_LOAD( "prg1.7f",      0x0000, 0x1000, CRC(6cb49046) SHA1(a0891605dff7f9ff51bc7ad85f831a749f2f61e9) )
6454   ROM_LOAD( "prg2.7j",      0x1000, 0x1000, CRC(c223b416) SHA1(ca2d9f6b8ef6db4f382089161f4147d9828c3554) )
6455   ROM_LOAD( "prg3.7l",      0x2000, 0x0800, CRC(453634c0) SHA1(0025ccd91e165692092a37541e730010e85e37f2) )
6456
6457   ROM_REGION( 0x10000, REGION_CPU2, 0 )   /* 64k for sound code */
6458   ROM_LOAD( "kbj1.ic4",     0x0000, 0x0800, CRC(ba16beb7) SHA1(8c2c91a9e941d858a49edd6c0c8a912e1135653e) )
6459   ROM_LOAD( "kbj2.ic5",     0x0800, 0x0800, CRC(56686a63) SHA1(8e624df57a63a556941fdbebcd886488799fad17) )
6460   ROM_LOAD( "kbj3.ic6",     0x1000, 0x0800, CRC(fbc570a5) SHA1(d0dbaf86396bca65e067338a3b5b60b24990b8be) )
6461   ROM_LOAD( "kbj2.ic7",     0x1800, 0x0800, CRC(56686a63) SHA1(8e624df57a63a556941fdbebcd886488799fad17) )
6462
6463
6464   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6465   ROM_LOAD( "chg1.1h",      0x0000, 0x0800, CRC(9cd550e7) SHA1(d2989e6b7a4d7b37a711ef1cfb536fe13e0c5482) )
6466   ROM_RELOAD(                 0x0800, 0x0800 )
6467   ROM_LOAD( "chg2.1k",      0x1000, 0x0800, CRC(a206757d) SHA1(46b50005876b7f61ab4a118d0a4caaebce8ce3e1) )
6468   ROM_RELOAD(                 0x1800, 0x0800 )
6469
6470   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6471   ROM_LOAD( "kb2-1",        0x0000, 0x0020, CRC(15dd5b16) SHA1(3d2ca2b42bf508a9e5198e970abcbbedf5729164) )
6472ROM_END
6473
6474ROM_START( scorpnmc )
6475   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6476   ROM_LOAD( "p1.bin",       0x0000, 0x0800, CRC(58818d88) SHA1(d9fbfb6fff9ba1d078c3735889b8878ab0442ded) )
6477   ROM_LOAD( "p2.bin",       0x0800, 0x0800, CRC(8bec5f9f) SHA1(78642124edbf946140f62985bafe2dca314cb257) )
6478   ROM_LOAD( "p3.bin",       0x1000, 0x0800, CRC(24b7fdff) SHA1(1382199c85af3aa101b4ca01a0b096d801bc61a6) )
6479   ROM_LOAD( "p4.bin",       0x1800, 0x0800, CRC(9082e2f0) SHA1(8e3beebca33e73901cb8c4fa0af39a299b831d32) )
6480   ROM_LOAD( "p5.bin",       0x2000, 0x0800, CRC(20387fc0) SHA1(1aa2f16fb1630e65fd8aaedd21d8e4bac343678b) )
6481   ROM_LOAD( "p6.bin",       0x2800, 0x0800, CRC(f66c48e1) SHA1(bbfd68309d1f6b6bb3ec0879c8bde80b3f30fa02) )
6482   ROM_LOAD( "p7.bin",       0x3000, 0x0800, CRC(931e34c7) SHA1(8b6c1099634b5d693faab9edf5e29b3c476c7f52) )
6483   ROM_LOAD( "p8.bin",       0x3800, 0x0800, CRC(ab5ab61d) SHA1(eb78d7dc8d424f6ed4f7cbec02485cd769bac5c6) )
6484   ROM_LOAD( "p9.bin",       0x5000, 0x1000, CRC(b551b974) SHA1(c19e61dd8b6daf808ba42fa318dfd179a020d20e) )
6485   ROM_LOAD( "p10.bin",      0x6000, 0x0800, CRC(a7bd8d20) SHA1(c8131279de58298546c5af2c34ff18116c3a2d3b) )
6486
6487   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6488   ROM_LOAD( "h.bin",        0x0000, 0x1000, CRC(1e5da9d6) SHA1(ca8b27e6dd40e4ca13e7e6b5f813bafca78b62f4) )
6489   ROM_LOAD( "k.bin",        0x1000, 0x1000, CRC(a57adb0a) SHA1(d97c7dc4a6c5efb59cc0148e2498156c682c6714) )
6490
6491   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6492   ROM_LOAD( "mmi6331.bpr",  0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
6493ROM_END
6494
6495ROM_START( frogg )
6496   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6497   ROM_LOAD( "p1.bin",       0x0000, 0x0800, CRC(1762b266) SHA1(2cf34dcfe00dc476b327f9d762a8d2aa268a2d25) )
6498   ROM_LOAD( "p2.bin",       0x0800, 0x0800, CRC(322f3916) SHA1(9236aaa260c4db4adbd92c8bba3674d07d7235a8) )
6499   ROM_LOAD( "p3.bin",       0x1000, 0x0800, CRC(28bd6151) SHA1(1a5bc540168fa5fef01bd7bc2cdbdb910c9a4ba4) )
6500   ROM_LOAD( "p4.bin",       0x1800, 0x0800, CRC(5a69ab18) SHA1(40b7bf200f87e0fb3fb54726ba79387889446052) )
6501   ROM_LOAD( "p5.bin",       0x2000, 0x0800, CRC(b4f17745) SHA1(2f237a667f6c95af213b787620142c1530d3cdd8) )
6502   ROM_LOAD( "p6.bin",       0x2800, 0x0800, CRC(34be71b5) SHA1(3088fc5817a397d0a87610d62845c7b8c4440f57) )
6503   ROM_LOAD( "p7.bin",       0x3000, 0x0800, CRC(de3edc8c) SHA1(634d54fb19b422b56576a196bdaf95733c52c7ee) )
6504
6505   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
6506   ROM_LOAD( "k.bin",        0x0000, 0x0800, CRC(05f7d883) SHA1(78831fd287da18928651a8adb7e578d291493eff) )
6507   ROM_LOAD( "h.bin",        0x0800, 0x0800, CRC(658745f8) SHA1(e4e5c3e011c8a7233a36d29e10e08905873500aa) )
6508
6509   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6510   ROM_LOAD( "pr-91.6l",     0x0000, 0x0020, CRC(413703bf) SHA1(66648b2b28d3dcbda5bdb2605d1977428939dd3c) )
6511ROM_END
6512
6513ROM_START( 4in1 )
6514   ROM_REGION( 0x20000, REGION_CPU1, 0 )   /* 64k for code  64k for banked code, encrypted */
6515   /* Menu Code, Fixed at 0xc000 - 0xdfff */
6516   ROM_LOAD( "rom1a",        0xc000, 0x1000, CRC(ce1af4d9) SHA1(260d81cb703ab33fa5f282454214dea06e59a5d6) )
6517   ROM_LOAD( "rom1b",        0xd000, 0x1000, CRC(18484f9b) SHA1(2439841ba5882c287bd9656fbf79190ff9efe4ee) )
6518   /* Ghost Muncher PT3 - banked at 0x0000 - 0x3fff */
6519   ROM_LOAD( "rom1c",       0x10000, 0x1000, CRC(83248a8b) SHA1(65af22b9a4516ab52c3327cb3b714d90c2c77284) )
6520   ROM_LOAD( "rom1d",       0x11000, 0x1000, CRC(053f6da0) SHA1(fa69de09a2162dfaa82ea566f0808433f26e4854) )
6521   ROM_LOAD( "rom1e",       0x12000, 0x1000, CRC(43c546f3) SHA1(c32a2281f8dca1f2b218dc76192d8e09f2eee460) )
6522   ROM_LOAD( "rom1f",       0x13000, 0x1000, CRC(3a086b46) SHA1(1fd65fd139a650a5c246cead5141b81764faf98c) )
6523   /* Scramble PT2 - banked at 0x0000 - 0x3fff */
6524   ROM_LOAD( "rom1g",       0x14000, 0x1000, CRC(ac0e2050) SHA1(02961a41f54d55f2ae07a2694a14fb6e6e4a766b) )
6525   ROM_LOAD( "rom1h",       0x15000, 0x1000, CRC(dc11a513) SHA1(2785c08d890f2f8e86b7f793f7989d7605570cc3) )
6526   ROM_LOAD( "rom1i",       0x16000, 0x1000, CRC(a5fb6be4) SHA1(f575ca70037134084aff152fcee7fdd0a1163c33) )
6527   ROM_LOAD( "rom1j",       0x17000, 0x1000, CRC(9054cfbe) SHA1(99ad74491cf8682daf45f2786e0bf275160c9826) )
6528   /* Galaxian PT5 - banked at 0x0000 - 0x3fff */
6529   ROM_LOAD( "rom2c",       0x18000, 0x1000, CRC(7cd98e11) SHA1(7ef49866a5c5fd871acf5bfe3d899a9ae0d37405) )
6530   ROM_LOAD( "rom2d",       0x19000, 0x1000, CRC(9402f32e) SHA1(feb5cb09ea719612a22949f34fb97e172305c7b0) )
6531   ROM_LOAD( "rom2e",       0x1a000, 0x1000, CRC(468e81df) SHA1(4ac30c170ce63637c77227833cef8839e2b0b8ab) )
6532   /* Galactic Convoy - banked at 0x0000 - 0x3fff */
6533   ROM_LOAD( "rom2g",       0x1c000, 0x1000, CRC(b1ce3976) SHA1(365e643948e982126198714bb1e07340ded7d4a5) )
6534   ROM_LOAD( "rom2h",       0x1d000, 0x1000, CRC(7eab5670) SHA1(d9648fc314bc6a685536c6acb17b17737813d902) )
6535   ROM_LOAD( "rom2i",       0x1e000, 0x1000, CRC(44565ac5) SHA1(cc8141cbdb9280a15b40761448e00a3b30a94ec7) )
6536
6537   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
6538   /* Ghost Muncher PT3 GFX */
6539   ROM_LOAD( "rom4b",        0x4000, 0x0800, CRC(7e6495af) SHA1(32db70bca5c60eea6b37a943e076bc5a8dc3870b) )
6540   ROM_CONTINUE(             0x0000, 0x0800 )
6541   ROM_LOAD( "rom3b",        0x6000, 0x0800, CRC(7475f72f) SHA1(834873b6a587760cbbd0ac9435af55f6cb20097a) )
6542   ROM_CONTINUE(             0x2000, 0x0800 )
6543   /* Scramble PT2 GFX */
6544   ROM_LOAD( "rom4c",        0x4800, 0x0800, CRC(3355d46d) SHA1(e5476d2053298958f141e11a97017ea465621d89) )
6545   ROM_RELOAD(               0x0800, 0x0800)
6546   ROM_LOAD( "rom3c",        0x6800, 0x0800, CRC(ac755a25) SHA1(70af05d32554682be6c3f74936e57b4050d283c7) )
6547   ROM_RELOAD(               0x2800, 0x0800)
6548   /* Galaxians PT5 GFX */
6549   ROM_LOAD( "rom4d",        0x5000, 0x0800, CRC(bbdddb65) SHA1(fc2dcfd969b1ee51a6413117e83f8a0c29278658) )
6550   ROM_CONTINUE(             0x1000, 0x0800)
6551   ROM_LOAD( "rom3d",        0x7000, 0x0800, CRC(91a00204) SHA1(eea8a8bd8439260dde9131693e9b53b0238ce7a7) )
6552   ROM_CONTINUE(             0x3000, 0x0800)
6553   /* Galactic Convoy GFX */
6554   ROM_LOAD( "rom4e",        0x5800, 0x0800, CRC(0cb9e297) SHA1(a9be2951851deed0ffefb980fc7751a399dc131e) )
6555   ROM_CONTINUE(             0x1800, 0x0800 )
6556   ROM_LOAD( "rom3e",        0x7800, 0x0800, CRC(a1fe77f9) SHA1(dc7972b7aa77fb4f95d7349d4cd7fc4674f9032d) )
6557   ROM_CONTINUE(             0x3800, 0x0800 )
6558
6559   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6560    ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
6561ROM_END
6562
6563ROM_START( bagmanmc )
6564   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6565   ROM_LOAD( "b1.bin",       0x0000, 0x1000, CRC(b74c75ee) SHA1(620083c30136e24a37b79eb4647d99b997107693) )
6566   ROM_LOAD( "b2.bin",       0x1000, 0x1000, CRC(a7d99916) SHA1(13185e8ff6de92ad5135895e5a7fc8b956f009d3) )
6567   ROM_LOAD( "b3.bin",       0x2000, 0x1000, CRC(c78f5360) SHA1(7ce9e94c33f1b8e60cc12a3df5f9555f1ca6130f) )
6568   ROM_LOAD( "b4.bin",       0x3000, 0x1000, CRC(eebd3bd1) SHA1(03200383e87b0759f607888d9b290a0a777b597e) )
6569   ROM_LOAD( "b5.bin",       0x4000, 0x1000, CRC(0fe24b8c) SHA1(205a36fd346d49d2dda6911198295e202caae81f) )
6570   ROM_LOAD( "b6.bin",       0x5000, 0x1000, CRC(f50390e7) SHA1(b4ebe647458c26e52461750d63856aea4262f110) )
6571
6572   ROM_REGION( 0x3000, REGION_GFX1, ROMREGION_DISPOSE )
6573   ROM_LOAD( "g1-u.bin",     0x0000, 0x0800, CRC(b63cfae4) SHA1(3e0cb3dbeec8ad790bc482176ca599721bac31ee) )
6574   ROM_CONTINUE(             0x2000, 0x0800 )
6575   ROM_LOAD( "g2-u.bin",     0x1000, 0x0800, CRC(a2790089) SHA1(7eb8634f26f6af52fb79bf90ec90b4e258c7c79f) )
6576   ROM_CONTINUE(             0x2800, 0x0800 )
6577   ROM_LOAD( "g1-l.bin",     0x0800, 0x0800, CRC(2ae6b5ab) SHA1(59bdebf75d28a247293440ec2ad83eaf30e3de00) )
6578   ROM_LOAD( "g2-l.bin",     0x1800, 0x0800, CRC(98b37397) SHA1(29914435a10cebbbce04382c45e13a64a0cd18cb) )
6579
6580
6581   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6582   ROM_LOAD( "bagmanmc.clr", 0x0000, 0x0020, NO_DUMP )   // missing
6583ROM_END
6584
6585ROM_START( dkongjrm )
6586   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6587   ROM_LOAD( "a1",           0x0000, 0x1000, CRC(299486e9) SHA1(cc4143ff8cb7a37c151bebab007a932381ae733b) )
6588   ROM_LOAD( "a2",           0x1000, 0x1000, CRC(a74a193b) SHA1(46f208293c0944b468550738d1238de9b672f403) )
6589   ROM_LOAD( "b2",           0x2000, 0x1000, CRC(7bc4f236) SHA1(84e7f5fcbea7d047f2a9a9006ae3ed646417c5e0) )
6590   ROM_LOAD( "c1",           0x3000, 0x1000, CRC(0f594c21) SHA1(eb15bd9cc37794786e2ad24753172e88aa7c4f98) )
6591   ROM_LOAD( "d1",           0x4000, 0x1000, CRC(cf7d7296) SHA1(9a817eca2ebef3f5208bb29ee7eece2ec0efe158) )
6592   ROM_LOAD( "e2",           0x5000, 0x1000, CRC(f7528a52) SHA1(e9d3c57934ee97fcc1f17ecdf3bc954574212220) )
6593   ROM_LOAD( "f1",           0x7000, 0x1000, CRC(9b1d4cc5) SHA1(9a412fec82f39b9389ff99cceba2e49b2a74df17) )
6594
6595   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
6596   ROM_LOAD( "v_3pa.bin",    0x0000, 0x1000, CRC(4974ffef) SHA1(7bb1e207dd3c5214e405bf32c57ec1b048061050) )
6597   ROM_LOAD( "a2.gfx",       0x1000, 0x1000, CRC(51845eaf) SHA1(43970d69329f3d49ea1ff57d54abe8340ceef275) )
6598   ROM_LOAD( "v_3na.bin",    0x2000, 0x1000, CRC(a95c4c63) SHA1(75e312b6872958f3bfc7bafd0743efdf7a74e8f0) )
6599   ROM_LOAD( "b2.gfx",       0x3000, 0x1000, CRC(7b39c3d0) SHA1(4b8cebb4cdaaca9e1b6fd378f6c390ab05984590) )
6600
6601   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6602   ROM_LOAD( "hustler.clr",  0x0000, 0x0020, CRC(aa1f7f5e) SHA1(311dd17aa11490a1173c76223e4ccccf8ea29850) )
6603ROM_END
6604
6605ROM_START( rockclim )
6606
6607   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6608   ROM_LOAD( "lc01.a1",   0x0000, 0x1000, CRC(8601ae8d) SHA1(6e0c3b34ce5e6879ce7a116c5c2660889a68320d) )
6609   ROM_LOAD( "lc02.a2",   0x1000, 0x1000, CRC(2dde9d4c) SHA1(7e343113116b94894558819a7f77f77e4e952da7) )
6610   ROM_LOAD( "lc03.a3",   0x2000, 0x1000, CRC(82c48a67) SHA1(abf95062eb5c9bd4bb3c9b9af59396a4ca6905d8) )
6611   ROM_LOAD( "lc04.a4",   0x3000, 0x1000, CRC(7cd3a04a) SHA1(756c12288e120e6f761b266b91920d17cab6926c) )
6612   ROM_LOAD( "lc05.a5",   0x6000, 0x1000, CRC(5e542149) SHA1(425a5a8769c3fa0887db8ff04e2a4f32f18d2679) )
6613   ROM_LOAD( "lc06.a6",   0x7000, 0x1000, CRC(b2bdca64) SHA1(e72e63725164c922816dda90ac964a94062eab1b) )
6614
6615   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6616   ROM_LOAD( "lc08.a9",   0x0000, 0x800, CRC(7f18e1ef) SHA1(2a160b994708ec0f06774dde3ec613af7e3f32c6) )
6617   ROM_LOAD( "lc07.a7",   0x0800, 0x800, CRC(f18b50ac) SHA1(a2328eb55882a09403cae1a497c611b494649cac) )
6618   ROM_LOAD( "lc10.c9",   0x1000, 0x800, CRC(dec5781b) SHA1(b6277fc890d153db24bd48293780cf239a6aa0e7) )
6619   ROM_LOAD( "lc09.c7",   0x1800, 0x800, CRC(06c0b5de) SHA1(561cf99a6be03205c7bc5fd15d4d51ee4d6d164b) )
6620
6621   ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )
6622   ROM_LOAD( "lc13.g5",   0x0000, 0x1000, CRC(19475f2b) SHA1(5d42aa45a7b519dacdecd3d2edbfee6971693034) )
6623   ROM_LOAD( "lc14.g7",   0x1000, 0x1000, CRC(cc96d1db) SHA1(9713b47b723a5d8837f2a8e8c43e46dc41a62e5b) )
6624
6625   ROM_REGION( 0x0040, REGION_PROMS, 0 )
6626   ROM_LOAD( "lc12.e9",  0x0000, 0x0020, CRC(f6e76547) SHA1(c9ea78d1876156561b3bbf327d7e0299e1d9fd4a) )
6627   ROM_LOAD( "lc11.f4",  0x0020, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
6628ROM_END
6629
6630ROM_START( ozon1 )
6631   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6632   ROM_LOAD( "rom1.bin",     0x0000, 0x1000, CRC(54899e8b) SHA1(270af76ae4396ebda767f160535fa77c0b49726a) )
6633   ROM_LOAD( "rom2.bin",     0x1000, 0x1000, CRC(3c90fbfc) SHA1(92da614dba3a644eac144bb0ed434d78a31fcb1a) )
6634   ROM_LOAD( "rom3.bin",     0x2000, 0x1000, CRC(79fe313b) SHA1(ef8fd70f5669b7e7d7184eca2baaddcecb55c22d) )
6635
6636   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
6637   ROM_LOAD( "rom7.bin",     0x0000, 0x0800, CRC(464285e8) SHA1(fff36b034b95050219c70cdfe05ff3bbc452b73e) )
6638   ROM_LOAD( "rom8.bin",     0x0800, 0x0800, CRC(92056dcc) SHA1(b162da8701bfee465205e8f274ee494063c52c7b) )
6639
6640   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6641   ROM_LOAD( "ozon1.clr", 0x0000, 0x0020, CRC(605ea6e9) SHA1(d3471e6ef756059c2f7feb32fb8e41181cc1718e) )
6642ROM_END
6643
6644ROM_START( ladybugg )
6645   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6646   ROM_LOAD( "lbuggx.1",   0x0000, 0x0800, CRC(e67e241d) SHA1(42b8eaca71c6b346ab54bc722850d6e6d169c517) )
6647   ROM_LOAD( "lbuggx.2",   0x0800, 0x0800, CRC(3cb1fb9a) SHA1(ee76758c94329dfcc740571195a74d9242aaf49f) )
6648   ROM_LOAD( "lbuggx.3",   0x1000, 0x0800, CRC(0937009e) SHA1(ef57ebf3d6ab3d6ac0e1faa10c3109d2c80a1248) )
6649   ROM_LOAD( "lbuggx.4",   0x1800, 0x0800, CRC(3e773f62) SHA1(6348e61f48e5d1f04289098c4c0395335ea5e2a5) )
6650   ROM_LOAD( "lbuggx.5",   0x2000, 0x0800, CRC(2b0d42e5) SHA1(1547b8127f964eb10862b566f5779f8011c3441d) )
6651   ROM_LOAD( "lbuggx.6",   0x2800, 0x0800, CRC(159f9433) SHA1(93341a4de1e1e4a3fb004019fc1edba73db6a4c8) )
6652   ROM_LOAD( "lbuggx.7",   0x3000, 0x0800, CRC(f2be06d5) SHA1(1354332d2d107ad810aa2e261b595285394dfb49) )
6653   ROM_LOAD( "lbuggx.8",   0x3800, 0x0800, CRC(646fe79f) SHA1(03223d6c4f9050fd6c1c313f0e366ab4989feca4) )
6654
6655   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6656   ROM_LOAD( "lbuggx.a",   0x0800, 0x0800, CRC(7efb9dc5) SHA1(5e02ea8cd1a1c8efa6708a8615cc2dc9da65a455) )
6657   ROM_CONTINUE ( 0x0000, 0x0800)
6658   ROM_LOAD( "lbuggx.b",   0x1800, 0x0800, CRC(351d4ddc) SHA1(048e8a60e57c6eb0a4d7c2175ddd46c4273756c5) )
6659   ROM_CONTINUE ( 0x1000, 0x0800)
6660
6661   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6662   ROM_LOAD( "lbuggx.clr", 0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
6663ROM_END
6664
6665ROM_START( vpool )
6666   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6667   ROM_LOAD( "vidpool1.bin", 0x0000, 0x0800, CRC(333f4732) SHA1(b57460c039c69137645bd4280ad877aa789277d6) )
6668   ROM_CONTINUE(             0x2000, 0x0800 )
6669   ROM_LOAD( "vidpool2.bin", 0x0800, 0x0800, CRC(eea6c0f1) SHA1(5b18caa78e246f55fd9cd778d6e83f79f0b3f157) )
6670   ROM_CONTINUE(             0x2800, 0x0800 )
6671   ROM_LOAD( "vidpool3.bin", 0x1000, 0x0800, CRC(309972a6) SHA1(8269d2f677f55dda71d6a7b0796d2d53a4def59d) )
6672   ROM_CONTINUE(             0x3000, 0x0800 )
6673   ROM_LOAD( "vidpool4.bin", 0x1800, 0x0800, CRC(c4f71c1d) SHA1(e1d01135d5ccc1a53308ce89dc2a8fc0992207d5) )
6674   ROM_CONTINUE(             0x3800, 0x0800 )
6675
6676   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
6677   ROM_LOAD( "hustler.5f", 0x0000, 0x0800, CRC(0bdfad0e) SHA1(8e6f1737604f3801c03fa2e9a5e6a2778b54bae8) ) // vidpoolh.bin
6678   ROM_LOAD( "hustler.5h", 0x0800, 0x0800, CRC(8e062177) SHA1(7e52a1669804b6c2f694cfc64b04abc8246bb0c2) ) // vidpoolk.bin
6679
6680   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6681   ROM_LOAD( "hustler.clr",  0x0000, 0x0020, CRC(aa1f7f5e) SHA1(311dd17aa11490a1173c76223e4ccccf8ea29850) )
6682ROM_END
6683
6684ROM_START( drivfrcg )
6685   ROM_REGION( 0x8000, REGION_CPU1, 0 )
6686   ROM_LOAD( "dfgp1.bin",    0x2800, 0x0400, CRC(52d5e77d) SHA1(4e68ac1274bbc8cb5b6a7dfb511232bd83482453) )
6687   ROM_CONTINUE(           0x2c00, 0x0400 )
6688   ROM_CONTINUE(           0x0000, 0x0400 )
6689   ROM_CONTINUE(           0x0400, 0x0400 )
6690   ROM_LOAD( "dfgp2.bin",    0x0800, 0x0400, CRC(9cf4dbce) SHA1(028c168ad0987f21d76c6ac4f756f4fa86c2f8e3) )
6691   ROM_CONTINUE(           0x0c00, 0x0400 )
6692   ROM_CONTINUE(           0x2000, 0x0400 )
6693   ROM_CONTINUE(           0x2400, 0x0400 )
6694   ROM_LOAD( "dfgp3.bin",    0x6800, 0x0400, CRC(79763f62) SHA1(2bb8921fcd2a8b9543e398e248fd47d7e03dc24d) )
6695   ROM_CONTINUE(           0x6c00, 0x0400 )
6696   ROM_CONTINUE(           0x4000, 0x0400 )
6697   ROM_CONTINUE(           0x4400, 0x0400 )
6698   ROM_LOAD( "dfgp4.bin",    0x4800, 0x0400, CRC(dd95338b) SHA1(9054986f7b8fee36f458362836ae969e7d1e2456) )
6699   ROM_CONTINUE(           0x4c00, 0x0400 )
6700   ROM_CONTINUE(           0x6000, 0x0400 )
6701   ROM_CONTINUE(           0x6400, 0x0400 )
6702
6703   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
6704   ROM_LOAD( "dfgj2.bin",    0x0000, 0x1000, CRC(8e19f1e7) SHA1(addd5add2117ef29ce38c0c80584e5d481b9d820) )
6705   ROM_LOAD( "dfgj1.bin",    0x1000, 0x1000, CRC(86b60ca8) SHA1(be266e2d69e12a196c2195d48b495c0fb9ef8a43) )
6706   ROM_LOAD( "dfgl2.bin",    0x2000, 0x1000, CRC(ea5e9959) SHA1(6b638d22adf19224cf741458c8ad34d7f7e17e58) )
6707   ROM_LOAD( "dfgl1.bin",    0x3000, 0x1000, CRC(b7ed195c) SHA1(81b2b444153dacb962a33a5d86a280ed5088637a) )
6708
6709   /* piggy-backed colour proms */
6710   ROM_REGION( 0x0040, REGION_PROMS, 0 )
6711   ROM_LOAD( "top.clr",      0x0000, 0x0020, CRC(3110ddae) SHA1(53b2e1cc07915592f6c868131ec296c63a407f04) )
6712   ROM_LOAD( "bot.clr",      0x0020, 0x0020, CRC(0f0782af) SHA1(32c0dd09ead5c70cee2657e9cb8cb9fcf54c5a6a) )
6713ROM_END
6714
6715ROM_START( drivfrcb )
6716   ROM_REGION( 0x8000, REGION_CPU1, 0 )
6717   ROM_LOAD( "dfp.bin",      0x2800, 0x0400, CRC(b5b2981d) SHA1(c9ff19791895bf05b569457b1e53dfa0aaeb8e95) )
6718   ROM_CONTINUE(           0x2c00, 0x0400 )
6719   ROM_CONTINUE(           0x0000, 0x0400 )
6720   ROM_CONTINUE(           0x0400, 0x0400 )
6721   ROM_CONTINUE(           0x0800, 0x0400 )
6722   ROM_CONTINUE(           0x0c00, 0x0400 )
6723   ROM_CONTINUE(           0x2000, 0x0400 )
6724   ROM_CONTINUE(           0x2400, 0x0400 )
6725   ROM_CONTINUE(           0x6800, 0x0400 )
6726   ROM_CONTINUE(           0x6c00, 0x0400 )
6727   ROM_CONTINUE(           0x4000, 0x0400 )
6728   ROM_CONTINUE(           0x4400, 0x0400 )
6729   ROM_CONTINUE(           0x4800, 0x0400 )
6730   ROM_CONTINUE(           0x4c00, 0x0400 )
6731   ROM_CONTINUE(           0x6000, 0x0400 )
6732   ROM_CONTINUE(           0x6400, 0x0400 )
6733
6734   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
6735   ROM_LOAD( "df1.bin",      0x1000, 0x1000, CRC(8adc3de0) SHA1(046fb92913171c621bb62edb0174f04298bfd283) )
6736   ROM_CONTINUE(           0x0000, 0x1000 )
6737   ROM_LOAD( "df2.bin",      0x3000, 0x1000, CRC(6d95ec35) SHA1(c745ee2bc7b1fb53e8bc1ac3a4238bbe00f30cfe) )
6738   ROM_CONTINUE(           0x2000, 0x1000 )
6739
6740   /* piggy-backed colour proms */
6741   ROM_REGION( 0x0040, REGION_PROMS, 0 )
6742   ROM_LOAD( "top.clr",      0x0000, 0x0020, CRC(3110ddae) SHA1(53b2e1cc07915592f6c868131ec296c63a407f04) )
6743   ROM_LOAD( "bot.clr",      0x0020, 0x0020, CRC(0f0782af) SHA1(32c0dd09ead5c70cee2657e9cb8cb9fcf54c5a6a) )
6744ROM_END
6745
6746ROM_START( bongo )
6747   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6748   ROM_LOAD( "bg1.bin",    0x0000, 0x1000, CRC(de9a8ec6) SHA1(b5ee99b26d1a39e31b643ad0f5723ee8e364023e) )
6749   ROM_LOAD( "bg2.bin",    0x1000, 0x1000, CRC(a19da662) SHA1(a2674392d489c5e5eeb9abc51572a37cc6045220) )
6750   ROM_LOAD( "bg3.bin",    0x2000, 0x1000, CRC(9f6f2150) SHA1(26a1f872686ddddcdb690d7b826ba26c20cdec35) )
6751   ROM_LOAD( "bg4.bin",    0x3000, 0x1000, CRC(f80372d2) SHA1(078e2c8b947103c168c0c85430f8ebc9d09f8ba7) )
6752   ROM_LOAD( "bg5.bin",    0x4000, 0x1000, CRC(fc92eade) SHA1(f4012a1c4631388a3e8109a8381bc4084ddc8757) )
6753   ROM_LOAD( "bg6.bin",    0x5000, 0x1000, CRC(561d9e5d) SHA1(68d7fab3cfb5b3360fe8064c70bf21bb1341032f) )
6754
6755   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6756   ROM_LOAD( "b-h.bin",    0x0000, 0x1000, CRC(fc79d103) SHA1(dac1152221ebdc4cd9bf353b4cc5d45021ca5d9e) )
6757   ROM_LOAD( "b-k.bin",    0x1000, 0x1000, CRC(94d17bf3) SHA1(2a70968249946de52c5a4cfabafbbf4ecda844a8) )
6758
6759   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6760   ROM_LOAD( "b-clr.bin",  0x0000, 0x0020, CRC(c4761ada) SHA1(067d12b2d3635ffa6337ed234ba42717447bea00) )
6761ROM_END
6762
6763ROM_START( hunchbkg )
6764   ROM_REGION( 0x8000, REGION_CPU1, 0 )
6765   ROM_LOAD( "gal_hb_1",     0x0000, 0x0800, CRC(46590e9b) SHA1(5d26578c91adec20d8d8a17d5dade9ef2febcbe5) )
6766   ROM_LOAD( "gal_hb_2",     0x0800, 0x0800, CRC(4e6e671c) SHA1(5948fc7f390f0343b367d333395427ce2f9b2931) )
6767   ROM_LOAD( "gal_hb_3",     0x2000, 0x0800, CRC(d29dc242) SHA1(3f6087fe962ee63c2886ad3f502c1a37d357ba87) )
6768   ROM_LOAD( "gal_hb_4",     0x2800, 0x0800, CRC(d409d292) SHA1(d631c9106106b31b605b6fdf1d4f40e237a725ac) )
6769   ROM_LOAD( "gal_hb_5",     0x4000, 0x0800, CRC(29d3a8c4) SHA1(2e1ef20d980e5033503d8095e9576dcb8f532f41) )
6770   ROM_LOAD( "gal_hb_6",     0x4800, 0x0800, CRC(b016fd15) SHA1(cdfbd531e23438f05a7c3aad99a94ce55912aac3) )
6771   ROM_LOAD( "gal_hb_7",     0x6000, 0x0800, CRC(d2731d27) SHA1(8c4a3d2303d85c3b11803c577a9ad21e6e69011e) )
6772   ROM_LOAD( "gal_hb_8",     0x6800, 0x0800, CRC(e4b1a666) SHA1(9f73d17cff208374d587536e783be024fc9ab700) )
6773
6774   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
6775   ROM_LOAD( "gal_hb_kl",    0x0000, 0x0800, CRC(3977650e) SHA1(1de05d6ceed3f2ed0925caa8235b63a93f03f61e) )
6776   ROM_LOAD( "gal_hb_hj",    0x0800, 0x0800, CRC(db489c3d) SHA1(df08607ad07222c1c1c4b3589b50b785bdeefbf2) )
6777
6778   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6779   ROM_LOAD( "gal_hb_cp",    0x0000, 0x0020, CRC(cbff6762) SHA1(4515a6e12a0a5c485a55291feee17a571120a549) )
6780ROM_END
6781
6782ROM_START( harem )
6783   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6784   ROM_LOAD( "p0_ic85.bin",  0x0000, 0x2000, CRC(4521b753) SHA1(9033f9c3be8fec1e5ff251e9f60faaf3848a1a1e) )
6785   ROM_LOAD( "p1_ic87.bin",  0x8000, 0x2000, BAD_DUMP CRC(3cc5d1e8) SHA1(827e2d20de2a00ec016ead249ed3afdccd0c856c) )
6786
6787   ROM_REGION( 0x10000, REGION_CPU2, 0 )
6788   ROM_LOAD( "s1_ic12.bin",  0x0000, 0x2000, CRC(b54799dd) SHA1(b6aeb010257cba48a52afd33b4f8031c7d99550c) )
6789   ROM_LOAD( "s2_ic13.bin",  0x2000, 0x1000, CRC(2d5573a4) SHA1(1fdcd99d89e078509634742b2116a35bb199fe4b) )
6790
6791   ROM_REGION( 0x2000, REGION_SOUND1, 0 )
6792   ROM_LOAD( "a1_ic25.bin",  0x0000, 0x2000, CRC(279f923a) SHA1(166b1b625997766f0de7cc18af52c42268022fcb) )
6793
6794   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
6795   ROM_LOAD( "m0_ic36.bin",  0x0000, 0x2000, CRC(64b3c6d6) SHA1(e71092585f7ffdae85b2a4c9add1bc71e5a608a8) )
6796   ROM_LOAD( "m1_ic37.bin",  0x2000, 0x2000, CRC(cb0324fb) SHA1(61612f683810339d5d5f31daa4c475d0338d446f) )
6797
6798   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6799   ROM_LOAD( "harem.clr",    0x0000, 0x0020, CRC(c9a2bf73) SHA1(dad65ebf43a5df147e334afd552e67f5fcd26df7) )
6800ROM_END
6801
6802ROM_START( tazzmang )
6803   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6804   ROM_LOAD( "tazzm1.4k",    0x0000, 0x1000, CRC(a14480a1) SHA1(60dac6b57e8331cc4daedaf87faf3e3acc68f378) )
6805   ROM_LOAD( "tazzm2.5j",    0x1000, 0x1000, CRC(5609f5db) SHA1(3fc50109ea0e012e3e310ae4f5dd0cf460bdca52) )
6806   ROM_LOAD( "tazzm3.6f",    0x2000, 0x1000, CRC(fe7f7002) SHA1(ac4134c07a798328b18994010bcaf6b3f728466a) )
6807   ROM_LOAD( "tazzm4.7e",    0x3000, 0x1000, CRC(c9ca1d0a) SHA1(d420ca2e926174e17215212278c86ba9bbb3d9dc) )
6808   ROM_LOAD( "tazzm5.7l",    0x4000, 0x1000, CRC(f50cd8a6) SHA1(b59ca37171b9acc9854f1beae43cfa5643219a5f) )
6809   ROM_LOAD( "tazzm6.7l",    0x5000, 0x1000, CRC(5cf2e7d2) SHA1(ad89e2655164e0fc5ecc9af70c5f0dd9b094d432) )
6810
6811   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
6812   ROM_LOAD( "tazm8.1lk",    0x0000, 0x0800, CRC(2c5b612b) SHA1(32e3a41a9a4a8b1285b6a195213ff0d98012360a) )
6813   ROM_LOAD( "tazzm7.1jh",   0x0800, 0x0800, CRC(3f5ff3ac) SHA1(bc70eef54a45b52c14e35464e5f06b5eec554eb6) )
6814
6815   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6816   ROM_LOAD( "prom.6l",      0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
6817ROM_END
6818
6819ROM_START( racknrol )
6820   ROM_REGION( 0x8000, REGION_CPU1, 0 )
6821   ROM_LOAD( "horz_p.bin",   0x0000, 0x1000, CRC(32ca5b43) SHA1(f3e7662f947dcdd80f6eae4f002d2fe64a825aff) )
6822   ROM_CONTINUE(           0x2000, 0x1000 )
6823   ROM_CONTINUE(           0x4000, 0x1000 )
6824   ROM_CONTINUE(           0x6000, 0x1000 )
6825
6826   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
6827   ROM_LOAD( "horz_g.bin",   0x0000, 0x4000, CRC(97069ad5) SHA1(50199c7bc5083be23a34849cff17906795bf4067) )
6828   ROM_LOAD( "horz_r.bin",   0x4000, 0x4000, CRC(ff64e84b) SHA1(ceabd522bae26743804987632f35f3c4b5aff179) )
6829
6830   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6831   ROM_LOAD( "82s123.bin",   0x0000, 0x0020, CRC(737802bf) SHA1(9b0476c51ce63898cd690e01e16ee83bae361cb2) )
6832
6833   ROM_REGION( 0x0200, REGION_USER1, 0 ) /* unknown */
6834   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(aace7fa5) SHA1(6761530bb3585d2eaa97b7ae77b52e96782ffe0a) )
6835ROM_END
6836
6837ROM_START( hexpool )
6838   ROM_REGION( 0x8000, REGION_CPU1, 0 )
6839   ROM_LOAD( "vert_p.bin",   0x0000, 0x1000, CRC(bdb078fc) SHA1(85a65c3038dc05a98eae71edf9efdd6659a2966a) )
6840   ROM_CONTINUE(           0x2000, 0x1000 )
6841   ROM_CONTINUE(           0x4000, 0x1000 )
6842   ROM_CONTINUE(           0x6000, 0x1000 )
6843
6844   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
6845   ROM_LOAD( "vert_g.bin",   0x0000, 0x4000, CRC(7e257e80) SHA1(dabb10d076dc49fc130f58e6d1c4b04e6debce55) )
6846   ROM_LOAD( "vert_r.bin",   0x4000, 0x4000, CRC(c5f0851e) SHA1(cedcdb29962c6cd65af9d57d0cb2533397d58f99) )
6847
6848   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6849   ROM_LOAD( "82s123.bin",   0x0000, 0x0020, CRC(737802bf) SHA1(9b0476c51ce63898cd690e01e16ee83bae361cb2) )
6850
6851   ROM_REGION( 0x0200, REGION_USER1, 0 ) /* unknown */
6852   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(aace7fa5) SHA1(6761530bb3585d2eaa97b7ae77b52e96782ffe0a) )
6853ROM_END
6854
6855ROM_START( hexpoola )
6856   ROM_REGION( 0x8000, REGION_CPU1, 0 )
6857   ROM_LOAD( "rom.4l",       0x0000, 0x1000, CRC(2ca8018d) SHA1(f0784d18bc7e77515bf2140d8993ae8178919853) )
6858   ROM_CONTINUE(           0x2000, 0x1000 )
6859   ROM_CONTINUE(           0x4000, 0x1000 )
6860   ROM_CONTINUE(           0x6000, 0x1000 )
6861
6862   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
6863   ROM_LOAD( "rom.1m",       0x0000, 0x4000, CRC(7e257e80) SHA1(dabb10d076dc49fc130f58e6d1c4b04e6debce55) )
6864   ROM_LOAD( "rom.1l",       0x4000, 0x4000, CRC(c5f0851e) SHA1(cedcdb29962c6cd65af9d57d0cb2533397d58f99) )
6865
6866   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6867   ROM_LOAD( "82s123.11r",   0x0000, 0x0020, CRC(deb2fcf4) SHA1(cdec737a9d9feae912f7cc04ca0adb48f859b5c2) )
6868
6869   ROM_REGION( 0x0200, REGION_USER1, 0 ) /* unknown */
6870   ROM_LOAD( "82s147.5pr",   0x0000, 0x0200, CRC(cf496b1e) SHA1(5b5ca52b3cc46e18990dae53a98984aeaf264241) )
6871
6872   ROM_REGION( 0x00eb, REGION_PLDS, 0 )
6873   ROM_LOAD( "82s153.6pr.bin", 0x0000, 0x00eb, CRC(bc07939a) SHA1(615b085575ad215662eab2777a2d8b9167c4b9c3) )
6874ROM_END
6875
6876ROM_START( trvchlng )
6877   ROM_REGION( 0x8000, REGION_CPU1, 0 )
6878   ROM_LOAD( "senko11.bin",  0x0000, 0x1000, CRC(3657331d) SHA1(d9a9a4e4e2e696e70dfb888725c959ec8ce24e3d) )
6879   ROM_CONTINUE(           0x2000, 0x1000 )
6880   ROM_CONTINUE(           0x4000, 0x1000 )
6881   ROM_CONTINUE(           0x6000, 0x1000 )
6882
6883   ROM_REGION( 0x100000, REGION_USER1, 0 )
6884   ROM_LOAD( "questions",    0x000000, 0x100000, NO_DUMP )
6885
6886   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
6887   ROM_LOAD( "senko10.bin",  0x0000, 0x4000, CRC(234b59d0) SHA1(5eafdfc6d6a73575835b68361fe29a2dc61e8a83) )
6888   ROM_LOAD( "senko12.bin",  0x4000, 0x4000, CRC(0bf6b92d) SHA1(6ca993c0642949a52fafea3bc57a08c6881e8120) )
6889
6890   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6891   ROM_LOAD( "senko1.bin",   0x0000, 0x0020, CRC(1434c7ff) SHA1(0ee5f5351dd84fbf8d3d8eaafbdbe86dd29960f8) )
6892ROM_END
6893
6894ROM_START( luctoday )
6895   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6896   ROM_LOAD( "ltprog1.bin", 0x0000, 0x0800, CRC(59c389b9) SHA1(1e158ced3b56db2c51e422fb4c0b8893565f1956))
6897   ROM_LOAD( "ltprog2.bin", 0x2000, 0x0800, CRC(ac3893b1) SHA1(f6b9cd8111b367ff7030cba52fe965959d92568f))
6898
6899   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
6900   ROM_LOAD( "ltchar2.bin", 0x0000, 0x0800, CRC(8cd73bdc) SHA1(6174f7347d2c96f9c5074bc0da5a370c9b07461b))
6901   ROM_LOAD( "ltchar1.bin", 0x0800, 0x0800, CRC(b5ba9946) SHA1(7222cbe8c41ca74b214f4dd5439bf69d90f4644e))
6902
6903   ROM_REGION( 0x0020, REGION_PROMS, 0 )//This may not be the correct prom
6904   ROM_LOAD( "74s288.ch", 0x0000, 0x0020, BAD_DUMP CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d))
6905ROM_END
6906
6907ROM_START( chewing )
6908   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6909   ROM_LOAD( "1.bin", 0x0000, 0x1000, CRC(7470b347) SHA1(315d2631b50a6e469b9538318d95452e8d2e1f69) )
6910   ROM_LOAD( "7l.bin", 0x2000, 0x0800, CRC(78ebed36) SHA1(e80185737c8ac448901cf0e60ca50d967c323b34) )
6911
6912   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
6913   ROM_LOAD( "2.bin", 0x0000, 0x0800, CRC(88c605f3) SHA1(938a9fadfa0994a1d2fc9b3266ec4ccdb5ec6d3a) )
6914   ROM_LOAD( "3.bin", 0x0800, 0x0800, CRC(77ac016a) SHA1(fa5b1e79603ca8d2ee7b3d0a78f12d9ffeec3fd4) )
6915
6916   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6917   ROM_LOAD( "74s288.ch", 0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) )
6918ROM_END
6919
6920ROM_START( catacomb )
6921   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6922   ROM_LOAD( "catacomb.u",    0x0000, 0x0800, CRC(35cc28d2) SHA1(e1dbd75fc21ec88b8119bf9508c87d78e1d5c4f6) )
6923   ROM_LOAD( "catacomb.v",    0x0800, 0x0800, CRC(1d1ce133) SHA1(e22a169003a2238004bdf6c2558198216c2353b7) )
6924   ROM_LOAD( "catacomb.w",    0x1000, 0x0800, CRC(479bbde7) SHA1(9981662cb6351de7c1730de45f645fb0e26ea467) )
6925   /* no .x */
6926   ROM_LOAD( "catacomb.y",    0x2000, 0x0800, CRC(5e3da534) SHA1(a9b960ae96c8ef0b2d590bc58b711aad949025e2) )
6927
6928   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
6929   ROM_LOAD( "cat-gfx1",       0x0000, 0x0800, CRC(e871e65c) SHA1(0b528dfab0f57153db9406798848cdedee0323a0) )
6930   ROM_LOAD( "cat-gfx2",       0x0800, 0x0800, CRC(b14dafaa) SHA1(592d5931a76563b3565f22ac4c0120b9a120193f) )
6931
6932   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6933   /* No color PROM came with the conversion - the Moon Cresta one seems more appropriate than Galaxian,
6934       (the game is unplayable with a Galaxian PROM) but which was intended for use with the kit is unclear */
6935   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, BAD_DUMP CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
6936ROM_END
6937
6938ROM_START( ckongg )
6939   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6940   ROM_LOAD( "ck1.bin",       0x2400, 0x0400, CRC(a4323b94) SHA1(1fed47e1df5efa8f40585bedab07b60067edc2bb) )
6941   ROM_CONTINUE(              0x1C00, 0x0400)
6942   ROM_CONTINUE(              0x4800, 0x0400)
6943   ROM_CONTINUE(              0x0C00, 0x0400)
6944   ROM_LOAD( "ck2.bin",       0x4400, 0x0400, CRC(1e532996) SHA1(fe1feeca347fccd266925614a46c98cff683f5d3) )
6945   ROM_CONTINUE(              0x0000, 0x0400)
6946   ROM_CONTINUE(              0x1800, 0x0400)
6947   ROM_CONTINUE(              0x2800, 0x0400)
6948   ROM_LOAD( "ck3.bin",       0x3400, 0x0400, CRC(65157cde) SHA1(572b9bd56894600e21220356d0bf193c7920672c) )
6949   ROM_CONTINUE(              0x4c00, 0x0400)
6950   ROM_CONTINUE(              0x5000, 0x0400)
6951   ROM_CONTINUE(              0x0400, 0x0400)
6952   ROM_LOAD( "ck4.bin",       0x2000, 0x0400, CRC(43827bc6) SHA1(a2ca9afff0dd1bdcfc3a6ead9ff30b7c91caa7ea) )
6953   ROM_CONTINUE(              0x3800, 0x0400)
6954   ROM_CONTINUE(              0x1000, 0x0400)
6955   ROM_CONTINUE(              0x4000, 0x0400)
6956   ROM_LOAD( "ck5.bin",       0x0800, 0x0400, CRC(a74ed96e) SHA1(1e845d693a728fea9d52953b5493ec98fdec63e3) )
6957   ROM_CONTINUE(              0x5400, 0x0400)  // fill
6958   ROM_CONTINUE(              0x2c00, 0x0400)
6959   ROM_CONTINUE(              0x1400, 0x0400)
6960   ROM_LOAD( "ck7.bin",       0x3000, 0x0400, CRC(2c4d8129) SHA1(ab1708ff72ee027106fe8da0caea03a796b3212b) )
6961   ROM_CONTINUE(              0x3c00, 0x0400)
6962
6963   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6964   ROM_LOAD( "ckvid10.bin",   0x0000, 0x1000, CRC(7866d2cb) SHA1(62dd8b80bc0459c7337d8a8cb83e53b999e7f4a9) )
6965   ROM_LOAD( "ckvid7.bin",    0x1000, 0x1000, CRC(7311a101) SHA1(49d54c8b94cae4ba81d7a7684eaa4e87815bb4da) )
6966
6967   ROM_REGION( 0x0020, REGION_PROMS, 0 )
6968   ROM_LOAD( "ck_cp.bin",     0x0000, 0x0020, CRC(7e0b79cb) SHA1(72ef3eb5f09e10c13dcf6fd568a6d16658055a16) )
6969ROM_END
6970
6971ROM_START( kkgalax )
6972   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6973   ROM_LOAD( "kc1.bin",       0x0000, 0x0800, CRC(a87fc828) SHA1(f66b72427d8cdfabdf2274e22bdb10018ac7d2f9) )
6974   ROM_CONTINUE( 0x2000, 0x0800)
6975   ROM_LOAD( "kc2.bin",       0x0800, 0x0800, CRC(94a13dec) SHA1(d3bfd5a266bb1f0e66d847e15b51bdd4c9a15e37) )
6976   ROM_CONTINUE( 0x2800, 0x0800)
6977   ROM_LOAD( "kc3.bin",       0x1000, 0x0800, CRC(5efc6705) SHA1(9af59a9cb58599b1c7ce0a063929531f6c73b912) )
6978   ROM_CONTINUE( 0x3000, 0x0800)
6979   ROM_LOAD( "kc4.bin",       0x1800, 0x0800, CRC(ac917d66) SHA1(63a0db01bb93e052fec64fa69ebcbae3b0b8aa04) )
6980   ROM_CONTINUE( 0x3800, 0x0800)
6981   ROM_LOAD( "kc5.bin",       0x4000, 0x0800, CRC(5a9ee1ed) SHA1(1bc420a42a4931c389b4f8db451de7c59786dfbc) )
6982   ROM_LOAD( "kc6.bin",       0x4800, 0x0800, CRC(f787431e) SHA1(5cee497b8f4072509920d982470cbe06bd18f88b) )
6983   ROM_LOAD( "kc7.bin",       0x5000, 0x0800, CRC(7a185e31) SHA1(a257f32958af6b2c1c9007b46bd1dc984670b0d9) )
6984
6985   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
6986   ROM_LOAD( "kc8carat.bin",   0x0000, 0x1000, CRC(7866d2cb) SHA1(62dd8b80bc0459c7337d8a8cb83e53b999e7f4a9) )
6987   ROM_LOAD( "kc9carat.bin",   0x1000, 0x1000, CRC(7311a101) SHA1(49d54c8b94cae4ba81d7a7684eaa4e87815bb4da) )
6988
6989   ROM_REGION( 0x0020, REGION_PROMS, 0 ) // not in this set
6990   ROM_LOAD( "ck_cp.bin",     0x0000, 0x0020, CRC(7e0b79cb) SHA1(72ef3eb5f09e10c13dcf6fd568a6d16658055a16) )
6991ROM_END
6992
6993
6994ROM_START( porter )
6995   ROM_REGION( 0x10000, REGION_CPU1, 0 )
6996   ROM_LOAD( "port1.bin",          0x0000, 0x0800, CRC(babaf7fe) SHA1(2138abf57990df9b6f9953efd3be9b2bede49520) )
6997   ROM_CONTINUE(                   0x2000, 0x0800)
6998   ROM_LOAD( "port2.bin",          0x0800, 0x0800, CRC(8f7eb0e3) SHA1(7ac5bfc0bb8b6a7a3e9acab5ce9a53f7cba1fca5) )
6999   ROM_CONTINUE(                   0x2800, 0x0800)
7000   ROM_LOAD( "port3.bin",          0x1000, 0x0800, CRC(683939b5) SHA1(caf69b03794cb5cf63b1aa52cf8ef355a3aeef87) )
7001   ROM_CONTINUE(                   0x3000, 0x0800)
7002   ROM_LOAD( "port4.bin",          0x1800, 0x0800, CRC(6a65d58d) SHA1(05824a41b2912f12bff7887e7483cb3f4367d339) )
7003   ROM_CONTINUE(                   0x3800,0x0800)
7004   ROM_LOAD( "port5.bin",          0x4000, 0x0800, CRC(2978a9aa) SHA1(99ec75c7f83f4858b26e083b50fde41fbcfe449a) )
7005   ROM_LOAD( "port6.bin",          0x4800, 0x0800, CRC(7ecdffb5) SHA1(18ce71b670503bef039c6bfb0aed5e8c10e9eb2d) )
7006
7007   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
7008   ROM_LOAD( "port7.bin",          0x0000, 0x1000, CRC(603294f9) SHA1(168b90fdf38cd2e2c7f54cde16b4d83dc5bb3046) )
7009   ROM_LOAD( "port8.bin",          0x1000, 0x1000, CRC(b66a763d) SHA1(995b473b1942ff666b0989993587e41e89542172) )
7010
7011   ROM_REGION( 0x0020, REGION_PROMS, 0 ) // not in the set
7012   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, BAD_DUMP CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
7013ROM_END
7014
7015GAME( 1979, galaxian, 0,        galaxian, galaxian, 0,        ROT90,  "Namco", "Galaxian (Namco set 1)", GAME_SUPPORTS_SAVE )
7016GAME( 1979, galaxiaj, galaxian, galaxian, superg,   0,        ROT90,  "Namco", "Galaxian (Namco set 2)", GAME_SUPPORTS_SAVE )
7017GAME( 1979, galmidw,  galaxian, galaxian, galaxian, 0,        ROT90,  "[Namco] (Midway license)", "Galaxian (Midway)", GAME_SUPPORTS_SAVE )
7018GAME( 1979, galmidwo, galaxian, galaxian, galaxian, 0,        ROT90,  "[Namco] (Midway license)", "Galaxian (Midway, old rev)", GAME_SUPPORTS_SAVE )
7019GAME( 1979, galtaito, galaxian, galaxian, galtaito, 0,        ROT90,  "[Namco] (Taito license)", "Galaxian (Taito)", GAME_SUPPORTS_SAVE )
7020GAME( 1979, superg,   galaxian, galaxian, superg,   0,        ROT90,  "hack", "Super Galaxians", GAME_SUPPORTS_SAVE )
7021GAME( 1979, galapx,   galaxian, galaxian, superg,   0,        ROT90,  "hack", "Galaxian Part X", GAME_SUPPORTS_SAVE )
7022GAME( 19??, moonaln,  galaxian, galaxian, superg,   0,        ROT90,  "[Nichibutsu] (Karateco license)", "Moon Alien", GAME_SUPPORTS_SAVE )
7023GAME( 1979, galap1,   galaxian, galaxian, superg,   0,        ROT90,  "hack", "Space Invaders Galactica", GAME_SUPPORTS_SAVE )
7024GAME( 1979, galap4,   galaxian, galaxian, superg,   0,        ROT90,  "hack", "Galaxian Part 4", GAME_SUPPORTS_SAVE )
7025GAME( 1979, galturbo, galaxian, galaxian, superg,   0,        ROT90,  "hack", "Galaxian Turbo", GAME_SUPPORTS_SAVE )
7026GAME( 1979, swarm,    galaxian, galaxian, swarm,    0,        ROT90,  "[Namco] (Sub-Electro bootleg)", "Swarm (hack of Galaxian)", GAME_SUPPORTS_SAVE )
7027GAME( 1979, zerotime, galaxian, galaxian, zerotime, 0,        ROT90,  "Petaco S.A.", "Zero Time", GAME_SUPPORTS_SAVE )
7028GAME( 1979, starfght, galaxian, galaxian, swarm,    0,        ROT90,  "Jeutel", "Star Fighter (bootleg of Galaxian)", GAME_SUPPORTS_SAVE )
7029GAME( 1979, galaxbsf, galaxian, galaxian, galaxian, 0,        ROT90,  "bootleg", "Galaxian (bootleg)", GAME_SUPPORTS_SAVE )
7030GAME( 19??, tst_galx, galaxian, galaxian, galaxian, 0,        ROT90,  "Test ROM", "Galaxian Test ROM", GAME_SUPPORTS_SAVE )
7031GAME( 1981, gmgalax,  0,        gmgalax,  gmgalax,  gmgalax,  ROT90,  "bootleg", "Ghostmuncher Galaxian (bootleg)", GAME_SUPPORTS_SAVE )
7032GAME( 19??, pisces,   0,        pisces,   pisces,   pisces,   ROT90,  "Subelectro", "Pisces", GAME_SUPPORTS_SAVE )
7033GAME( 19??, piscesb,  pisces,   pisces,   piscesb,  pisces,   ROT90,  "bootleg", "Pisces (bootleg)", GAME_SUPPORTS_SAVE )
7034GAME( 19??, omni,     pisces,   pisces,   piscesb,  pisces,   ROT90,  "bootleg", "Omni", GAME_SUPPORTS_SAVE )
7035GAME( 1980, uniwars,  0,        pisces,   superg,   pisces,   ROT90,  "Irem", "UniWar S", GAME_SUPPORTS_SAVE )
7036GAME( 1980, gteikoku, uniwars,  pisces,   superg,   pisces,   ROT90,  "Irem", "Gingateikoku No Gyakushu", GAME_SUPPORTS_SAVE )
7037GAME( 1980, gteikokb, uniwars,  pisces,   gteikokb, pisces,   ROT270, "bootleg", "Gingateikoku No Gyakushu (bootleg set 1)", GAME_SUPPORTS_SAVE )
7038GAME( 1980, gteikob2, uniwars,  gteikob2, gteikob2, gteikob2, ROT270, "bootleg", "Gingateikoku No Gyakushu (bootleg set 2)", GAME_SUPPORTS_SAVE )
7039GAME( 1980, spacbatt, uniwars,  pisces,   spacbatt, pisces,   ROT90,  "bootleg", "Space Battle (bootleg set 1)", GAME_SUPPORTS_SAVE )
7040GAME( 1980, spacbat2, uniwars,  pisces,   spacbatt, pisces,   ROT90,  "bootleg", "Space Battle (bootleg set 2)", GAME_SUPPORTS_SAVE )
7041GAME( 1980, skyraidr, uniwars,  pisces,   superg,   pisces,   ROT90,  "bootleg", "Sky Raiders", GAME_SUPPORTS_SAVE )
7042GAME( 1981, batman2,  phoenix,  batman2,  batman2,  pisces,   ROT270, "bootleg", "Batman Part 2", GAME_SUPPORTS_SAVE )
7043GAME( 1981, warofbug, 0,        galaxian, warofbug, pisces,   ROT90,  "Armenia", "War of the Bugs or Monsterous Manouvers in a Mushroom Maze", GAME_SUPPORTS_SAVE )
7044GAME( 19??, redufo,   0,        galaxian, redufo,   pisces,   ROT90,  "bootleg", "Defend the Terra Attack on the Red UFO", GAME_SUPPORTS_SAVE )
7045GAME( 19??, exodus,   redufo,   galaxian, exodus,   pisces,   ROT90,  "Subelectro", "Exodus (bootleg?)", GAME_SUPPORTS_SAVE )
7046GAME( 1981, streakng, 0,        pacmanbl, streakng, 0,        ROT90,  "Shoei", "Streaking", GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE )
7047GAME( 1981, pacmanbl, puckman,  pacmanbl, pacmanbl, pisces,   ROT270, "bootleg", "Pac-Man (Galaxian hardware)", GAME_SUPPORTS_SAVE )
7048GAME( 1984, devilfsg, devilfsh, devilfsg, devilfsg, 0,        ROT270, "Vision / Artic", "Devil Fish (Galaxian hardware, bootleg?)", GAME_SUPPORTS_SAVE )
7049GAME( 1982, zigzag,   0,        zigzag,   zigzag,   zigzag,   ROT90,  "LAX", "Zig Zag (Galaxian hardware, set 1)", GAME_SUPPORTS_SAVE )
7050GAME( 1982, zigzag2,  zigzag,   zigzag,   zigzag,   zigzag,   ROT90,  "LAX", "Zig Zag (Galaxian hardware, set 2)", GAME_SUPPORTS_SAVE )
7051GAME( 1981, scramblb, scramble, scramblb, scramblb, 0,        ROT90,  "bootleg", "Scramble (Galaxian hardware)", GAME_SUPPORTS_SAVE )
7052GAME( 1981, scramb2,  scramble, scramb2,  scramb2,  0,        ROT90,  "bootleg", "Scramble (bootleg)", GAME_SUPPORTS_SAVE )
7053GAME( 1981, jumpbug,  0,        jumpbug,  jumpbug,  0,        ROT90,  "Rock-ola", "Jump Bug", GAME_SUPPORTS_SAVE )
7054GAME( 1981, jumpbugb, jumpbug,  jumpbug,  jumpbug,  0,        ROT90,  "bootleg", "Jump Bug (bootleg)", GAME_SUPPORTS_SAVE )
7055GAME( 1983, levers,   0,        jumpbug,  levers,   0,        ROT90,  "Rock-ola", "Levers", GAME_SUPPORTS_SAVE )
7056GAME( 1982, azurian,  0,        azurian,  azurian,  azurian,  ROT90,  "Rait Electronics Ltd", "Azurian Attack", GAME_SUPPORTS_SAVE )
7057GAME( 19??, orbitron, 0,        galaxian, orbitron, pisces,   ROT270, "Signatron USA", "Orbitron", GAME_SUPPORTS_SAVE )
7058GAME( 1982, checkman, 0,        checkman, checkman, checkman, ROT90,  "Zilec-Zenitone", "Check Man", GAME_SUPPORTS_SAVE )
7059GAME( 1982, checkmaj, checkman, checkmaj, checkmaj, checkmaj, ROT90,  "Jaleco", "Check Man (Japan)", GAME_SUPPORTS_SAVE )
7060GAME( 1983, dingo,    0,        checkmaj, dingo,    dingo,    ROT90,  "Ashby Computers and Graphics LTD. (Jaleco license)", "Dingo", GAME_SUPPORTS_SAVE )
7061GAME( 1983, dingoe,   0,        dingoe,   dingo,    dingoe,   ROT90,  "Ashby Computers and Graphics LTD.", "Dingo (encrypted)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
7062GAME( 1981, blkhole,  0,        galaxian, blkhole,  0,        ROT90,  "TDS", "Black Hole", GAME_SUPPORTS_SAVE )
7063GAME( 1980, mooncrst, 0,        mooncrst, mooncrst, mooncrst, ROT90,  "Nichibutsu", "Moon Cresta (Nichibutsu)", GAME_SUPPORTS_SAVE )
7064GAME( 1980, mooncrsu, mooncrst, mooncrst, mooncrst, mooncrsu, ROT90,  "Nichibutsu USA", "Moon Cresta (Nichibutsu, unencrypted)", GAME_SUPPORTS_SAVE )
7065GAME( 1980, mooncrsa, mooncrst, mooncrst, mooncrsa, mooncrst, ROT90,  "Nichibutsu", "Moon Cresta (Nichibutsu, old rev)", GAME_SUPPORTS_SAVE )
7066GAME( 1980, mooncrsg, mooncrst, mooncrst, mooncrsg, mooncrsu, ROT90,  "Gremlin", "Moon Cresta (Gremlin)", GAME_SUPPORTS_SAVE )
7067GAME( 1980, mooncrsb, mooncrst, mooncrst, mooncrsa, mooncrsu, ROT90,  "bootleg", "Moon Cresta (bootleg set 1)", GAME_SUPPORTS_SAVE )
7068GAME( 1980, mooncrs2, mooncrst, mooncrst, mooncrsa, mooncrsu, ROT90,  "Nichibutsu", "Moon Cresta (bootleg set 2)", GAME_SUPPORTS_SAVE )
7069GAME( 1980, mooncrs3, mooncrst, mooncrst, mooncrst, mooncrsu, ROT90,  "bootleg", "Moon Cresta (bootleg set 3)", GAME_SUPPORTS_SAVE ) /* Jeutel bootleg, similar to bootleg set 2 */
7070GAME( 1980, fantazia, mooncrst, mooncrst, fantazia, mooncrsu, ROT90,  "Subelectro", "Fantazia (bootleg?)", GAME_SUPPORTS_SAVE )
7071GAME( 1980, eagle,    mooncrst, mooncrst, eagle,    mooncrsu, ROT90,  "Centuri", "Eagle (set 1)", GAME_SUPPORTS_SAVE )
7072GAME( 1980, eagle2,   mooncrst, mooncrst, eagle2,   mooncrsu, ROT90,  "Centuri", "Eagle (set 2)", GAME_SUPPORTS_SAVE )
7073GAME( 1980, eagle3,   mooncrst, mooncrst, eagle,    mooncrsu, ROT90,  "Centuri", "Eagle (set 3)", GAME_SUPPORTS_SAVE )
7074GAME( 1981?,spctbird, mooncrst, mooncrst, eagle2,   mooncrsu, ROT90,  "Fortrek", "Space Thunderbird", GAME_SUPPORTS_SAVE )
7075GAME( 1980?,smooncrs, mooncrst, mooncrst, smooncrs, mooncrsu, ROT90,  "Gremlin", "Super Moon Cresta", GAME_SUPPORTS_SAVE )
7076GAME( 198?, mooncmw,  mooncrst, mooncrst, mooncrsa, mooncrsu, ROT90,  "bootleg", "Moon War (Moon Cresta bootleg)", GAME_SUPPORTS_SAVE )
7077// The boards were marked 'Space Dragon' although this doesn't appear in the games.
7078GAME( 1980, spcdrag,  mooncrst, mooncrst, spcdrag,  mooncrsu, ROT90,  "bootleg", "Space Dragon (Moon Cresta bootleg, set 1)", GAME_SUPPORTS_SAVE )
7079GAME( 1980, spcdraga, mooncrst, mooncrst, spcdrag,  mooncrsu, ROT90,  "bootleg", "Space Dragon (Moon Cresta bootleg, set 2)", GAME_SUPPORTS_SAVE )
7080GAME( 1980, mooncrgx, mooncrst, mooncrgx, mooncrgx, mooncrgx, ROT270, "bootleg", "Moon Cresta (Galaxian hardware)", GAME_SUPPORTS_SAVE )
7081GAME( 1980, moonqsr,  0,        moonqsr,  moonqsr,  moonqsr,  ROT90,  "Nichibutsu", "Moon Quasar", GAME_SUPPORTS_SAVE )
7082GAME( 1981, mshuttle, 0,        mshuttle, mshuttle, mshuttle, ROT0,   "Nichibutsu", "Moon Shuttle (US?)", GAME_SUPPORTS_SAVE )
7083GAME( 1981, mshuttlj, mshuttle, mshuttle, mshuttle, cclimbrj, ROT0,   "Nichibutsu", "Moon Shuttle (Japan set 1)", GAME_SUPPORTS_SAVE )
7084GAME( 1981, mshutlj2, mshuttle, mshuttle, mshuttle, cclimbrj, ROT0,   "Nichibutsu", "Moon Shuttle (Japan set 2)", GAME_SUPPORTS_SAVE )
7085GAME( 1980, moonal2,  0,        mooncrst, moonal2,  0,        ROT90,  "Nichibutsu", "Moon Alien Part 2", GAME_SUPPORTS_SAVE )
7086GAME( 1980, moonal2b, moonal2,  mooncrst, moonal2,  0,        ROT90,  "Nichibutsu", "Moon Alien Part 2 (older version)", GAME_SUPPORTS_SAVE )
7087GAME( 1980, supergx,  moonal2,  galaxian, superg,   0,        ROT90,  "Nichibutsu", "Super GX", GAME_NOT_WORKING | GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
7088GAME( 1982, skybase,  0,        skybase,  skybase,  0,        ROT90,  "Omori Electric Co., Ltd.", "Sky Base", GAME_SUPPORTS_SAVE )
7089GAME( 19??, omega,    theend,   galaxian, omega,    0,        ROT270, "bootleg?", "Omega", GAME_SUPPORTS_SAVE )
7090GAME( 1980, kingball, 0,        kingball, kingball, kingball, ROT90,  "Namco", "King & Balloon (US)", GAME_SUPPORTS_SAVE )
7091GAME( 1980, kingbalj, kingball, kingball, kingball, kingball, ROT90,  "Namco", "King & Balloon (Japan)", GAME_SUPPORTS_SAVE )
7092GAME( 19??, scorpnmc, scorpion, scorpnmc, scorpnmc, 0,        ROT90,  "Dorneer", "Scorpion (Moon Cresta hardware)", GAME_SUPPORTS_SAVE )
7093GAME( 1981, frogg,    frogger,  frogg,    frogg,    0,        ROT90,  "bootleg", "Frog (Galaxian hardware)", GAME_SUPPORTS_SAVE )
7094GAME( 1981, 4in1,     0,        4in1,     4in1,     4in1,     ROT90,  "Armenia / Food and Fun", "4 Fun in 1", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
7095GAME( 1982, bagmanmc, bagman,   bagmanmc, bagmanmc, 0,        ROT90,  "bootleg", "Bagman (Moon Cresta hardware)", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
7096GAME( 1982, dkongjrm, dkongjr,  dkongjrm, dkongjrm, 0,        ROT90,  "bootleg", "Donkey Kong Jr. (Moon Cresta hardware)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
7097GAME( 1981, rockclim, 0,        rockclim, rockclim, 0,         ROT180, "Taito", "Rock Climber", GAME_SUPPORTS_SAVE )
7098GAME( 1983, ozon1,    0,        ozon1,    ozon1,    0,         ROT90,  "Proma", "Ozon I", GAME_SUPPORTS_SAVE )
7099GAME( 1983, ladybugg, ladybug,  batman2,  ladybugg, ladybugg, ROT270, "bootleg", "Ladybug (bootleg on Galaxian hardware)", GAME_SUPPORTS_SAVE )
7100GAME( 1980, vpool,    hustler,  mooncrst, vpool,    0,        ROT90,  "bootleg", "Video Pool (bootleg on Moon Cresta hardware)", GAME_SUPPORTS_SAVE )
7101GAME( 1984, drivfrcg, drivfrcp, drivfrcg, drivfrcg, 0,        ROT90,  "Shinkai Inc. (Magic Eletronics USA licence)", "Driving Force (Galaxian conversion)", GAME_SUPPORTS_SAVE )
7102GAME( 1985, drivfrcb, drivfrcp, drivfrcg, drivfrcg, 0,        ROT90,  "bootleg", "Driving Force (Galaxian conversion bootleg)", GAME_SUPPORTS_SAVE )
7103GAME( 1983, bongo,    0,        bongo,    bongo,    0,         ROT90,  "Jetsoft", "Bongo", GAME_SUPPORTS_SAVE )
7104GAME( 1983, hunchbkg, hunchbak,   hunchbkg, hunchbkg, 0,        ROT90,  "Century Electronics", "Hunchback (Galaxian hardware)", GAME_SUPPORTS_SAVE )
7105GAME( 1983, harem,    0,        harem,    harem,    0,        ROT90,  "I.G.R.", "Harem", GAME_NO_SOUND | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
7106GAME( 1982, tazzmang, tazmania,   tazzmang, tazzmang, 0,        ROT90,  "bootleg", "Tazz-Mania (Galaxian Hardware)", GAME_SUPPORTS_SAVE )
7107GAME( 1986, racknrol, 0,        racknrol, racknrol, 0,         ROT0,   "Status (Shinkai License)", "Rack + Roll", GAME_SUPPORTS_SAVE )
7108GAME( 1986, hexpool,  racknrol, racknrol, racknrol, 0,         ROT90,  "Shinkai", "Hex Pool (Shinkai)", GAME_SUPPORTS_SAVE )
7109GAME( 1985, hexpoola, racknrol, hexpoola, racknrol, 0,         ROT90,  "Senko", "Hex Pool (Senko)", GAME_SUPPORTS_SAVE )
7110GAME( 1985, trvchlng, 0,        racknrol, trvchlng, 0,         ROT90,  "Joyland (Senko License)", "Trivia Challenge", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
7111GAME( 1980, luctoday, 0,        galaxian, luctoday, 0,        ROT270, "Sigma", "Lucky Today",GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
7112GAME( 19??, chewing,  0,        galaxian, luctoday, 0,        ROT90,  "unknown", "Chewing Gum", GAME_SUPPORTS_SAVE )
7113GAME( 1982, catacomb, 0,        galaxian, catacomb, 0,        ROT90,  "MTM Games", "Catacomb", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
7114GAME( 1981, ckongg,   0,        ckongg,   ckongg,   0,        ROT90,  "bootleg", "Crazy Kong (bootleg on Galaxian hardware, set 1)", GAME_SUPPORTS_SAVE )
7115GAME( 1981, kkgalax,  ckongg,   kkgalax,  kkgalax,  0,        ROT90,  "bootleg", "Crazy Kong (bootleg on Galaxian hardware, set 2)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) // set was marked as 'King Kong on Galaxian'
7116GAME( 19??, porter,   0,        mooncrst, porter,   0,        ROT90,  "[Nova Games Ltd.] (bootleg)", "Port Man (bootleg on Moon Cresta hardware)", GAME_IMPERFECT_GRAPHICS ) // missing GFX bank switch!
2630#include "galdrvr.c"
src/mame/drivers/othldrby.c
r2241r2242
4545
4646static WRITE16_HANDLER( oki_bankswitch_w )
4747{
48   if (ACCESSING_LSB)
48   if (ACCESSING_BITS_0_7)
4949      OKIM6295_set_bank_base(0, (data & 1) * 0x40000);
5050}
5151
5252static WRITE16_HANDLER( coinctrl_w )
5353{
54   if (ACCESSING_LSB)
54   if (ACCESSING_BITS_0_7)
5555   {
5656      coin_counter_w(0,data & 1);
5757      coin_counter_w(1,data & 2);
src/mame/drivers/gstriker.c
r2241r2242
203203
204204static WRITE16_HANDLER( sound_command_w )
205205{
206   if (ACCESSING_LSB)
206   if (ACCESSING_BITS_0_7)
207207   {
208208      pending_command = 1;
209209      soundlatch_w(machine,offset,data & 0xff);
src/mame/drivers/hyprduel.c
r2241r2242
107107
108108static WRITE16_HANDLER( hyprduel_irq_cause_w )
109109{
110   if (ACCESSING_LSB)
110   if (ACCESSING_BITS_0_7)
111111   {
112112      if (data == int_num)
113113         requested_int &= ~(int_num & ~*hypr_irq_enable);
src/mame/drivers/arcadecl.c
r2241r2242
133133
134134static WRITE16_HANDLER( adpcm_w )
135135{
136   if (ACCESSING_MSB)
136   if (ACCESSING_BITS_8_15)
137137      OKIM6295_data_0_w(machine, offset, (data >> 8) & 0xff);
138138}
139139
r2241r2242
154154    */
155155
156156   /* lower byte being modified? */
157   if (ACCESSING_LSB)
157   if (ACCESSING_BITS_0_7)
158158   {
159159      OKIM6295_set_bank_base(0, (data & 0x80) ? 0x40000 : 0x00000);
160160      atarigen_set_oki6295_vol(machine, (data & 0x001f) * 100 / 0x1f);
src/mame/drivers/suprslam.c
r2241r2242
103103
104104static WRITE16_HANDLER( sound_command_w )
105105{
106   if (ACCESSING_LSB)
106   if (ACCESSING_BITS_0_7)
107107   {
108108      pending_command = 1;
109109      soundlatch_w(machine,offset,data & 0xff);
src/mame/drivers/dgpix.c
r2241r2242
121121
122122         // write game settings
123123
124         if(ACCESSING_LSW32)
124         if(ACCESSING_BITS_0_15)
125125            rom[BYTE_XOR_BE(offset*2 + 1)] = data & 0xffff;
126126         else
127127            rom[BYTE_XOR_BE(offset*2 + 0)] = (data & 0xffff0000) >> 16;
src/mame/drivers/model2.c
r2241r2242
415415static WRITE32_HANDLER(pal32_w)
416416{
417417   COMBINE_DATA(paletteram32+offset);
418   if(ACCESSING_LSW32)
418   if(ACCESSING_BITS_0_15)
419419      chcolor(offset*2, paletteram32[offset]);
420   if(ACCESSING_MSW32)
420   if(ACCESSING_BITS_16_31)
421421      chcolor(offset*2+1, paletteram32[offset]>>16);
422422}
423423
424424static WRITE32_HANDLER(ctrl0_w)
425425{
426   if(!(mem_mask & 0x000000ff)) {
426   if(ACCESSING_BITS_0_7) {
427427      model2_ctrlmode = data & 0x01;
428428      EEPROM_write_bit(data & 0x20);
429429      EEPROM_set_clock_line((data & 0x80) ? ASSERT_LINE : CLEAR_LINE);
r2241r2242
494494
495495static READ32_HANDLER(copro_prg_r)
496496{
497   if ((strcmp(Machine->gamedrv->name, "manxtt" ) == 0) || (strcmp(Machine->gamedrv->name, "srallyc" ) == 0))
497   if ((strcmp(machine->gamedrv->name, "manxtt" ) == 0) || (strcmp(machine->gamedrv->name, "srallyc" ) == 0))
498498   {
499499      return 8;
500500   }
r2241r2242
530530         logerror("Boot copro, %d dwords\n", model2_coprocnt);
531531         if (dsp_type != DSP_TYPE_TGPX4)
532532         {
533            cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, CLEAR_LINE);
533            cpunum_set_input_line(machine, 2, INPUT_LINE_HALT, CLEAR_LINE);
534534         }
535535      }
536536   }
r2241r2242
550550
551551static READ32_HANDLER(copro_fifo_r)
552552{
553   if ((strcmp(Machine->gamedrv->name, "manxtt" ) == 0) || (strcmp(Machine->gamedrv->name, "srallyc" ) == 0))
553   if ((strcmp(machine->gamedrv->name, "manxtt" ) == 0) || (strcmp(machine->gamedrv->name, "srallyc" ) == 0))
554554   {
555555      return 8;
556556   }
r2241r2242
589589static UINT32 iop_data = 0;
590590static WRITE32_HANDLER(copro_sharc_iop_w)
591591{
592   if ((strcmp(Machine->gamedrv->name, "schamp" ) == 0) ||
593      (strcmp(Machine->gamedrv->name, "fvipers" ) == 0) ||
594      (strcmp(Machine->gamedrv->name, "vstriker" ) == 0) ||
595      (strcmp(Machine->gamedrv->name, "gunblade" ) == 0))
592   if ((strcmp(machine->gamedrv->name, "schamp" ) == 0) ||
593      (strcmp(machine->gamedrv->name, "fvipers" ) == 0) ||
594      (strcmp(machine->gamedrv->name, "vstriker" ) == 0) ||
595      (strcmp(machine->gamedrv->name, "gunblade" ) == 0))
596596   {
597597      cpuintrf_push_context(2);
598598      sharc_external_iop_write(offset, data);
r2241r2242
659659        else
660660        {
661661            logerror("Boot geo, %d dwords\n", model2_geocnt);
662            cpunum_set_input_line(Machine, 3, INPUT_LINE_HALT, CLEAR_LINE);
662            cpunum_set_input_line(machine, 3, INPUT_LINE_HALT, CLEAR_LINE);
663663            //cpu_spinuntil_time(ATTOTIME_IN_USEC(1000));       // Give the SHARC enough time to boot itself
664664        }
665665    }
r2241r2242
669669
670670static READ32_HANDLER(geo_sharc_fifo_r)
671671{
672    if ((strcmp(Machine->gamedrv->name, "manxtt" ) == 0) || (strcmp(Machine->gamedrv->name, "srallyc" ) == 0))
672    if ((strcmp(machine->gamedrv->name, "manxtt" ) == 0) || (strcmp(machine->gamedrv->name, "srallyc" ) == 0))
673673    {
674674        return 8;
675675    }
r2241r2242
700700static UINT32 geo_iop_data = 0;
701701static WRITE32_HANDLER(geo_sharc_iop_w)
702702{
703    if ((strcmp(Machine->gamedrv->name, "schamp" ) == 0))
703    if ((strcmp(machine->gamedrv->name, "schamp" ) == 0))
704704    {
705705        cpuintrf_push_context(3);
706706        sharc_external_iop_write(offset, data);
r2241r2242
942942
943943static WRITE32_HANDLER( model2_serial_w )
944944{
945   if (((mem_mask & 0xff) == 0) && (offset == 0))
945   if (ACCESSING_BITS_0_7 && (offset == 0))
946946   {
947947      SCSP_MidiIn(machine, 0, data&0xff, 0);
948948
src/mame/drivers/wiping.c
r2241r2242
9393}
9494
9595
96
97static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
98   AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM)
99   AM_RANGE(0x8000, 0x8bff) AM_READ(SMH_RAM)
100   AM_RANGE(0x9000, 0x93ff) AM_READ(shared1_r)
101   AM_RANGE(0x9800, 0x9bff) AM_READ(shared2_r)
102   AM_RANGE(0xa800, 0xa807) AM_READ(ports_r)
103   AM_RANGE(0xb000, 0xb7ff) AM_READ(SMH_RAM)
104ADDRESS_MAP_END
105
106static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
107   AM_RANGE(0x0000, 0x5fff) AM_WRITE(SMH_ROM)
108   AM_RANGE(0x8000, 0x83ff) AM_WRITE(SMH_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
109   AM_RANGE(0x8400, 0x87ff) AM_WRITE(SMH_RAM) AM_BASE(&colorram)
110   AM_RANGE(0x8800, 0x88ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
111   AM_RANGE(0x8900, 0x8bff) AM_WRITE(SMH_RAM)
112   AM_RANGE(0x9000, 0x93ff) AM_WRITE(shared1_w) AM_BASE(&sharedram1)
113   AM_RANGE(0x9800, 0x9bff) AM_WRITE(shared2_w) AM_BASE(&sharedram2)
96static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
97   AM_RANGE(0x0000, 0x5fff) AM_ROM
98   AM_RANGE(0x8000, 0x83ff) AM_BASE(&videoram) AM_SIZE(&videoram_size)      /* Fallthrough */
99   AM_RANGE(0x8400, 0x87ff) AM_BASE(&colorram)
100   AM_RANGE(0x8800, 0x88ff) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
101   AM_RANGE(0x8000, 0x8bff) AM_RAM
102   AM_RANGE(0x9000, 0x93ff) AM_READWRITE(shared1_r,shared1_w) AM_BASE(&sharedram1)
103   AM_RANGE(0x9800, 0x9bff) AM_READWRITE(shared2_r,shared2_w) AM_BASE(&sharedram2)
114104   AM_RANGE(0xa000, 0xa000) AM_WRITE(interrupt_enable_w)
115105   AM_RANGE(0xa002, 0xa002) AM_WRITE(wiping_flipscreen_w)
116106   AM_RANGE(0xa003, 0xa003) AM_WRITE(subcpu_reset_w)
117   AM_RANGE(0xb000, 0xb7ff) AM_WRITE(SMH_RAM)
107   AM_RANGE(0xa800, 0xa807) AM_READ(ports_r)
108   AM_RANGE(0xb000, 0xb7ff) AM_RAM
118109   AM_RANGE(0xb800, 0xb800) AM_WRITE(watchdog_reset_w)
119110ADDRESS_MAP_END
120111
121
122/* Sound cpu data */
123static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
124   AM_RANGE(0x0000, 0x1fff) AM_READ(SMH_ROM)
125   AM_RANGE(0x9000, 0x93ff) AM_READ(shared1_r)
126   AM_RANGE(0x9800, 0x9bff) AM_READ(shared2_r)
127ADDRESS_MAP_END
128
129static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
130   AM_RANGE(0x0000, 0x1fff) AM_WRITE(SMH_ROM)
112static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
113   AM_RANGE(0x0000, 0x1fff) AM_ROM
131114   AM_RANGE(0x4000, 0x7fff) AM_WRITE(wiping_sound_w) AM_BASE(&wiping_soundregs)
132   AM_RANGE(0x9000, 0x93ff) AM_WRITE(shared1_w)
133   AM_RANGE(0x9800, 0x9bff) AM_WRITE(shared2_w)
115   AM_RANGE(0x9000, 0x93ff) AM_READWRITE(shared1_r,shared1_w)
116   AM_RANGE(0x9800, 0x9bff) AM_READWRITE(shared2_r,shared2_w)
134117   AM_RANGE(0xa001, 0xa001) AM_WRITE(interrupt_enable_w)
135118ADDRESS_MAP_END
136119
137120
138
139121static INPUT_PORTS_START( wiping )
140122   PORT_START   /* 0 */
141123   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
r2241r2242
309291
310292   /* basic machine hardware */
311293   MDRV_CPU_ADD(Z80,18432000/6)   /* 3.072 MHz */
312   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
294   MDRV_CPU_PROGRAM_MAP(main_map,0)
313295   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
314296
315297   MDRV_CPU_ADD(Z80,18432000/6)
316298   /* audio CPU */   /* 3.072 MHz */
317   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
299   MDRV_CPU_PROGRAM_MAP(sound_map,0)
318300   MDRV_CPU_PERIODIC_INT(irq0_line_hold,120)   /* periodic interrupt, don't know about the frequency */
319301
320302   /* video hardware */
src/mame/drivers/gstream.c
r2241r2242
126126{
127127   COMBINE_DATA(&gstream_vram[offset]);
128128
129   if (ACCESSING_MSB32)
129   if (ACCESSING_BITS_24_31)
130130   {
131131      if (offset>=0x000/4 && offset<0x400/4)
132132      {
src/mame/drivers/cps2.c
r2241r2242
584584***************************************************************************/
585585
586586#include "driver.h"
587#include "deprecat.h"
588587#include "machine/eeprom.h"
589588#include "cpu/m68000/m68000.h"
590589#include "sound/qsound.h"
r2241r2242
727726
728727static WRITE16_HANDLER( cps2_eeprom_port_w )
729728{
730    if (ACCESSING_MSB)
729    if (ACCESSING_BITS_8_15)
731730    {
732731   /* bit 0 - Unused */
733732   /* bit 1 - Unused */
r2241r2242
744743   EEPROM_set_cs_line((data & 0x4000) ? CLEAR_LINE : ASSERT_LINE);
745744   }
746745
747   if (ACCESSING_LSB)
746   if (ACCESSING_BITS_0_7)
748747   {
749748   /* bit 0 - coin counter 1 */
750749   /* bit 0 - coin counter 2 */
r2241r2242
756755   /* bit 7 - */
757756
758757        /* Z80 Reset */
759      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x0008) ? CLEAR_LINE : ASSERT_LINE);
758      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 0x0008) ? CLEAR_LINE : ASSERT_LINE);
760759
761760   coin_counter_w(0, data & 0x0001);
762   if( (strncmp(Machine->gamedrv->name,"pzloop2",8)==0) ||
763        (strncmp(Machine->gamedrv->name,"pzloop2j",8)==0) )
761   if( (strncmp(machine->gamedrv->name,"pzloop2",8)==0) ||
762        (strncmp(machine->gamedrv->name,"pzloop2j",8)==0) )
764763   {
765764      // Puzz Loop 2 uses coin counter 2 input to switch between stick and paddle controls
766765      readpaddle = data & 0x0002;
r2241r2242
770769      coin_counter_w(1, data & 0x0002);
771770   }
772771
773   if(strncmp(Machine->gamedrv->name,"mmatrix",7)==0)      // Mars Matrix seems to require the coin lockout bit to be reversed
772   if(strncmp(machine->gamedrv->name,"mmatrix",7)==0)      // Mars Matrix seems to require the coin lockout bit to be reversed
774773   {
775774      coin_lockout_w(0,data & 0x0010);
776775      coin_lockout_w(1,data & 0x0020);
r2241r2242
12621261   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 2*8, 30*8-1 )
12631262
12641263   MDRV_GFXDECODE(cps2)
1265   MDRV_PALETTE_LENGTH(4096)
1264   MDRV_PALETTE_LENGTH(0xc00)
12661265
12671266   MDRV_VIDEO_START(cps2)
12681267   MDRV_VIDEO_EOF(cps1)
src/mame/drivers/lordgun.c
r2241r2242
166166
167167static WRITE16_HANDLER( lordgun_soundlatch_w )
168168{
169   if (ACCESSING_LSB)   soundlatch_w (machine, 0, (data >> 0) & 0xff);
170   if (ACCESSING_MSB)   soundlatch2_w(machine, 0, (data >> 8) & 0xff);
169   if (ACCESSING_BITS_0_7)   soundlatch_w (machine, 0, (data >> 0) & 0xff);
170   if (ACCESSING_BITS_8_15)   soundlatch2_w(machine, 0, (data >> 8) & 0xff);
171171
172172   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
173173}
src/mame/drivers/pushman.c
r2241r2242
3939
4040static WRITE16_HANDLER( pushman_control_w )
4141{
42   if (ACCESSING_MSB)
42   if (ACCESSING_BITS_8_15)
4343      soundlatch_w(machine,0,(data>>8)&0xff);
4444}
4545
r2241r2242
5656
5757static WRITE16_HANDLER( pushman_68705_w )
5858{
59   if (ACCESSING_MSB)
59   if (ACCESSING_BITS_8_15)
6060      shared_ram[2*offset]=data>>8;
61   if (ACCESSING_LSB)
61   if (ACCESSING_BITS_0_7)
6262      shared_ram[2*offset+1]=data&0xff;
6363
6464   if (offset==1)
r2241r2242
8787
8888static WRITE16_HANDLER( bballs_68705_w )
8989{
90   if (ACCESSING_MSB)
90   if (ACCESSING_BITS_8_15)
9191      shared_ram[2*offset]=data>>8;
92   if (ACCESSING_LSB)
92   if (ACCESSING_BITS_0_7)
9393      shared_ram[2*offset+1]=data&0xff;
9494
9595   if(offset==0)
src/mame/drivers/zerozone.c
r2241r2242
5959
6060static WRITE16_HANDLER( zerozone_sound_w )
6161{
62   if (ACCESSING_MSB)
62   if (ACCESSING_BITS_8_15)
6363   {
6464      soundlatch_w(machine,offset,data >> 8);
6565      cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);
src/mame/drivers/shanghai.c
r2241r2242
620620static WRITE16_HANDLER( HD63484_address_w )
621621{
622622   /* only low 8 bits are used */
623   if (ACCESSING_LSB)
623   if (ACCESSING_BITS_0_7)
624624      regno = data;
625625}
626626
r2241r2242
739739
740740static WRITE16_HANDLER( shanghai_coin_w )
741741{
742   if (ACCESSING_LSB)
742   if (ACCESSING_BITS_0_7)
743743   {
744744      coin_counter_w(0,data & 1);
745745      coin_counter_w(1,data & 2);
r2241r2242
807807ADDRESS_MAP_END
808808
809809static INPUT_PORTS_START( kothello )
810   SEIBU_COIN_INPUTS
810   SEIBU_COIN_INPUTS   /* coin inputs read through sound cpu */
811811INPUT_PORTS_END
812812
813813
src/mame/drivers/tmnt.c
r2241r2242
134134{
135135   /* it seems that a word write is supposed to affect only the MSB. The */
136136   /* "ROUND 1" text in punkshtj goes lost otherwise. */
137   if (ACCESSING_MSB)
137   if (ACCESSING_BITS_8_15)
138138      K052109_w(machine,offset,(data >> 8) & 0xff);
139   else if (ACCESSING_LSB)
139   else if (ACCESSING_BITS_0_7)
140140      K052109_w(machine,offset + 0x2000,data & 0xff);
141141}
142142
r2241r2242
185185{
186186   offset &= ~1;   /* handle mirror address */
187187
188   if (ACCESSING_MSB)
188   if (ACCESSING_BITS_8_15)
189189      K053244_w(machine,offset,(data >> 8) & 0xff);
190   if (ACCESSING_LSB)
190   if (ACCESSING_BITS_0_7)
191191      K053244_w(machine,offset + 1,data & 0xff);
192192}
193193
r2241r2242
223223
224224static WRITE16_HANDLER( tmnt_sound_command_w )
225225{
226   if (ACCESSING_LSB)
226   if (ACCESSING_BITS_0_7)
227227      soundlatch_w(machine,0,data & 0xff);
228228}
229229
r2241r2242
250250
251251static WRITE16_HANDLER( glfgreat_sound_w )
252252{
253   if (ACCESSING_MSB)
253   if (ACCESSING_BITS_8_15)
254254      K053260_0_w(machine, offset, (data >> 8) & 0xff);
255255
256256   if (offset)
r2241r2242
264264
265265static WRITE16_HANDLER( prmrsocr_sound_cmd_w )
266266{
267   if (ACCESSING_LSB)
267   if (ACCESSING_BITS_0_7)
268268   {
269269      data &= 0xff;
270270      if (offset == 0) soundlatch_w(machine,0,data);
r2241r2242
551551
552552static WRITE16_HANDLER( blswhstl_eeprom_w )
553553{
554   if (ACCESSING_LSB)
554   if (ACCESSING_BITS_0_7)
555555   {
556556      /* bit 0 is data */
557557      /* bit 1 is cs (active low) */
r2241r2242
625625{
626626   static int last;
627627
628   if (ACCESSING_LSB)
628   if (ACCESSING_BITS_0_7)
629629   {
630630      /* bit 0 is data */
631631      /* bit 1 is cs (active low) */
r2241r2242
668668
669669static WRITE16_HANDLER( prmrsocr_eeprom_w )
670670{
671   if (ACCESSING_LSB)
671   if (ACCESSING_BITS_0_7)
672672   {
673673      prmrsocr_122000_w(machine,offset,data,mem_mask);
674674   }
675675
676   if (ACCESSING_MSB)
676   if (ACCESSING_BITS_8_15)
677677   {
678678      /* bit 8 is data */
679679      /* bit 9 is cs (active low) */
r2241r2242
932932
933933   COMBINE_DATA(tmnt2_1c0800 + offset);
934934
935   if (offset != 0x18/2 || !ACCESSING_MSB) return;
935   if (offset != 0x18/2 || !ACCESSING_BITS_8_15) return;
936936
937937   mcu = tmnt2_1c0800;
938938   if ((mcu[8] & 0xff00) != 0x8200) return;
src/mame/drivers/jpmimpct.c
r2241r2242
508508 *************************************/
509509static WRITE16_HANDLER( volume_w )
510510{
511   if (ACCESSING_LSB)
511   if (ACCESSING_BITS_0_7)
512512   {
513513      upd7759_set_bank_base(0, 0x20000 * ((data >> 1) & 3));
514514      upd7759_reset_w(0, data & 0x01);
r2241r2242
517517
518518static WRITE16_HANDLER( upd7759_w )
519519{
520   if (ACCESSING_LSB)
520   if (ACCESSING_BITS_0_7)
521521   {
522522      upd7759_port_w(0, data);
523523      upd7759_start_w(0, 0);
r2241r2242
527527
528528static READ16_HANDLER( upd7759_r )
529529{
530   if (ACCESSING_LSB)
530   if (ACCESSING_BITS_0_7)
531531   {
532532      return upd7759_busy_r(0);
533533   }
src/mame/drivers/namcos12.c
r2241r2242
922922*/
923923
924924#include "driver.h"
925#include "deprecat.h"
926925#include "cpu/mips/psx.h"
927926#include "cpu/h83002/h83002.h"
928927#include "includes/psx.h"
r2241r2242
984983static WRITE32_HANDLER( bankoffset_w )
985984{
986985   // Golgo 13 has different banking (maybe the keycus controls it?)
987   if( strcmp( Machine->gamedrv->name, "golgo13" ) == 0 ||
988      strcmp( Machine->gamedrv->name, "g13knd" ) == 0 )
986   if( strcmp( machine->gamedrv->name, "golgo13" ) == 0 ||
987      strcmp( machine->gamedrv->name, "g13knd" ) == 0 )
989988   {
990989      if( ( data & 8 ) != 0 )
991990      {
r2241r2242
10121011
10131012static WRITE32_HANDLER( dmaoffset_w )
10141013{
1015   if( ACCESSING_LSW32 )
1014   if( ACCESSING_BITS_0_15 )
10161015   {
10171016      m_n_dmaoffset = ( offset * 4 ) | ( data << 16 );
10181017   }
1019   if( ACCESSING_MSW32 )
1018   if( ACCESSING_BITS_16_31 )
10201019   {
10211020      m_n_dmaoffset = ( ( offset + 2 ) * 4 ) | ( data & 0xffff0000 );
10221021   }
r2241r2242
11221121
11231122static WRITE32_HANDLER( system11gun_w )
11241123{
1125   if( ACCESSING_LSW32 )
1124   if( ACCESSING_BITS_0_15 )
11261125   {
11271126      /* start 1 */
11281127      set_led_status(0, !(data & 0x08));
r2241r2242
11341133      /* !(data & 0x01) */
11351134      verboselog( 1, "system11gun_w: outputs (%08x %08x)\n", data, mem_mask );
11361135   }
1137   if( ACCESSING_MSW32 )
1136   if( ACCESSING_BITS_16_31 )
11381137   {
11391138      verboselog( 2, "system11gun_w: start reading (%08x %08x)\n", data, mem_mask );
11401139   }
r2241r2242
13001299   mame_system_time systime;
13011300   static const int weekday[7] = { 7, 1, 2, 3, 4, 5, 6 };
13021301
1303   mame_get_current_datetime(Machine, &systime);
1302   mame_get_current_datetime(machine, &systime);
13041303
13051304   switch (s12_rtcstate)
13061305   {
src/mame/drivers/raiden2.c
r2241r2242
20432043
20442044static WRITE16_HANDLER( rdx_v33_eeprom_w )
20452045{
2046   if (ACCESSING_LSB)
2046   if (ACCESSING_BITS_0_7)
20472047   {
20482048      EEPROM_set_clock_line((data & 0x10) ? ASSERT_LINE : CLEAR_LINE);
20492049      EEPROM_write_bit(data & 0x20);
r2241r2242
21022102
21032103static WRITE16_HANDLER( rdx_v33_oki_w )
21042104{
2105   if (ACCESSING_LSB) OKIM6295_data_0_w(machine, 0, data & 0x00ff);
2106   if (ACCESSING_MSB) logerror("rdx_v33_oki_w MSB %04x\n",data);
2105   if (ACCESSING_BITS_0_7) OKIM6295_data_0_w(machine, 0, data & 0x00ff);
2106   if (ACCESSING_BITS_8_15) logerror("rdx_v33_oki_w MSB %04x\n",data);
21072107}
21082108
21092109static READ16_HANDLER( rdx_v33_unknown_r )
src/mame/drivers/scramble.c
r2241r2242
3030#include "machine/8255ppi.h"
3131#include "sound/ay8910.h"
3232#include "sound/dac.h"
33#include "galaxian.h"
33#include "galaxold.h"
3434
3535
36//cpu #0 (PC=00003F6C): warning - op-code execute on mapped I/O
37extern int monsterz_count;
38static READ8_HANDLER( monsterz_prot_r )
39{
40   int pc = activecpu_get_pc();
41   if(pc != 0xc5e0 && pc != 0xC604 && pc != 0xc62c)
42      printf("%X\n",pc);
4336
44   if( !(monsterz_count % 0x200) )
45   {
46
47      UINT8 ret = memory_region(REGION_CPU1)[0x19 - monsterz_count / 0x200];
48
49      printf("count = %X\n",monsterz_count );
50
51      ret ^= memory_region(REGION_CPU1)[0x100 + monsterz_count / 2];
52      monsterz_count++;
53      return ret;
54   }
55   else
56   {
57      UINT8 ret;
58
59      if(monsterz_count & 0x100)
60         // missing data?
61         ret = 0;//memory_region(REGION_CPU1)[0xc000 + monsterz_count2+ (monsterz_count / 0x200) * 0x100 + (monsterz_count % 0x200)];
62      else
63         ret = memory_region(REGION_CPU1)[0x100 + (monsterz_count / 0x200) * 0x100 + (monsterz_count % 0x200)];
64
65      printf("count = %X\n",monsterz_count);
66
67      monsterz_count++;
68
69      if(monsterz_count == 0x200*9)
70      {
71         UINT8 *ROM = memory_region(REGION_CPU1);
72         memcpy(&ROM[0x3800],&ROM[0xc01f],0x800);
73         monsterz_count = 0;
74      }
75
76      return ret;
77   }
78}
79
80
8137static ADDRESS_MAP_START( scramble_readmem, ADDRESS_SPACE_PROGRAM, 8 )
8238   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
8339   AM_RANGE(0x4000, 0x4bff) AM_READ(SMH_RAM)
84   AM_RANGE(0x4c00, 0x4fff) AM_READ(galaxian_videoram_r)   /* mirror */
40   AM_RANGE(0x4c00, 0x4fff) AM_READ(galaxold_videoram_r)   /* mirror */
8541   AM_RANGE(0x5000, 0x50ff) AM_READ(SMH_RAM)
8642   AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
8743   AM_RANGE(0x7800, 0x7800) AM_READ(watchdog_reset_r)
r2241r2242
9349static ADDRESS_MAP_START( scramble_writemem, ADDRESS_SPACE_PROGRAM, 8 )
9450   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
9551   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM)
96   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
97   AM_RANGE(0x4c00, 0x4fff) AM_WRITE(galaxian_videoram_w)   /* mirror address */
98   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
99   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
100   AM_RANGE(0x5060, 0x507f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
52   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
53   AM_RANGE(0x4c00, 0x4fff) AM_WRITE(galaxold_videoram_w)   /* mirror address */
54   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
55   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
56   AM_RANGE(0x5060, 0x507f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
10157   AM_RANGE(0x5080, 0x50ff) AM_WRITE(SMH_RAM)
102   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxian_nmi_enable_w)
103   AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxian_coin_counter_w)
104   AM_RANGE(0x6804, 0x6804) AM_WRITE(galaxian_stars_enable_w)
105   AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxian_flip_screen_x_w)
106   AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxian_flip_screen_y_w)
58   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxold_nmi_enable_w)
59   AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxold_coin_counter_w)
60   AM_RANGE(0x6804, 0x6804) AM_WRITE(galaxold_stars_enable_w)
61   AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxold_flip_screen_x_w)
62   AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxold_flip_screen_y_w)
10763   AM_RANGE(0x8100, 0x8103) AM_WRITE(ppi8255_0_w)
10864   AM_RANGE(0x8200, 0x8203) AM_WRITE(ppi8255_1_w)
10965ADDRESS_MAP_END
r2241r2242
11369   AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM)
11470   AM_RANGE(0x8000, 0x87ff) AM_READ(SMH_RAM)
11571   AM_RANGE(0x9000, 0x93ff) AM_READ(SMH_RAM)
116   AM_RANGE(0x9400, 0x97ff) AM_READ(galaxian_videoram_r)
72   AM_RANGE(0x9400, 0x97ff) AM_READ(galaxold_videoram_r)
11773   AM_RANGE(0x9800, 0x98ff) AM_READ(SMH_RAM)
11874
11975   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
r2241r2242
13086static ADDRESS_MAP_START( turpins_writemem, ADDRESS_SPACE_PROGRAM, 8 )
13187   AM_RANGE(0x0000, 0x5fff) AM_WRITE(SMH_ROM)
13288   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM)
133   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
134   AM_RANGE(0x9400, 0x97ff) AM_WRITE(galaxian_videoram_w)
135   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
136   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
137   AM_RANGE(0x9860, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
89   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
90   AM_RANGE(0x9400, 0x97ff) AM_WRITE(galaxold_videoram_w)
91   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
92   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
93   AM_RANGE(0x9860, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
13894   AM_RANGE(0x9880, 0x98ff) AM_WRITE(SMH_RAM)
13995
140   AM_RANGE(0xa801, 0xa801) AM_WRITE(galaxian_nmi_enable_w)
141   AM_RANGE(0xa802, 0xa802) AM_WRITE(galaxian_coin_counter_w)
142   AM_RANGE(0xa804, 0xa804) AM_WRITE(galaxian_stars_enable_w)
143   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxian_flip_screen_x_w)
144   AM_RANGE(0xa807, 0xa807) AM_WRITE(galaxian_flip_screen_y_w)
96   AM_RANGE(0xa801, 0xa801) AM_WRITE(galaxold_nmi_enable_w)
97   AM_RANGE(0xa802, 0xa802) AM_WRITE(galaxold_coin_counter_w)
98   AM_RANGE(0xa804, 0xa804) AM_WRITE(galaxold_stars_enable_w)
99   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_x_w)
100   AM_RANGE(0xa807, 0xa807) AM_WRITE(galaxold_flip_screen_y_w)
145101   /* don't know where these are */
146102//  AM_RANGE(0x8100, 0x8103) AM_WRITE(ppi8255_0_w)
147103//  AM_RANGE(0x8200, 0x8203) AM_WRITE(ppi8255_1_w)
r2241r2242
150106static ADDRESS_MAP_START( explorer_readmem, ADDRESS_SPACE_PROGRAM, 8 )
151107   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
152108   AM_RANGE(0x4000, 0x4bff) AM_READ(SMH_RAM)
153   AM_RANGE(0x4c00, 0x4fff) AM_READ(galaxian_videoram_r)   /* mirror */
109   AM_RANGE(0x4c00, 0x4fff) AM_READ(galaxold_videoram_r)   /* mirror */
154110   AM_RANGE(0x5000, 0x50ff) AM_READ(SMH_RAM)
155111   AM_RANGE(0x5100, 0x51ff) AM_READ(SMH_NOP)   /* test mode mirror? */
156112   AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
r2241r2242
163119static ADDRESS_MAP_START( explorer_writemem, ADDRESS_SPACE_PROGRAM, 8 )
164120   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
165121   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM)
166   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
167   AM_RANGE(0x4c00, 0x4fff) AM_WRITE(galaxian_videoram_w)   /* mirror address */
168   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
169   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
170   AM_RANGE(0x5060, 0x507f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
122   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
123   AM_RANGE(0x4c00, 0x4fff) AM_WRITE(galaxold_videoram_w)   /* mirror address */
124   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
125   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
126   AM_RANGE(0x5060, 0x507f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
171127   AM_RANGE(0x5080, 0x50ff) AM_WRITE(SMH_RAM)
172128   AM_RANGE(0x5100, 0x51ff) AM_WRITE(SMH_NOP)   /* test mode mirror? */
173129   AM_RANGE(0x6800, 0x6800) AM_WRITE(SMH_NOP)
174   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxian_nmi_enable_w)
175   AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxian_coin_counter_w)
130   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxold_nmi_enable_w)
131   AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxold_coin_counter_w)
176132   AM_RANGE(0x6803, 0x6803) AM_WRITE(SMH_NOP)
177   AM_RANGE(0x6804, 0x6804) AM_WRITE(galaxian_stars_enable_w)
178   AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxian_flip_screen_x_w)
179   AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxian_flip_screen_y_w)
133   AM_RANGE(0x6804, 0x6804) AM_WRITE(galaxold_stars_enable_w)
134   AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxold_flip_screen_x_w)
135   AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxold_flip_screen_y_w)
180136   AM_RANGE(0x7000, 0x7000) AM_WRITE(SMH_NOP)
181137   AM_RANGE(0x8000, 0x8000) AM_WRITE(soundlatch_w)
182138   AM_RANGE(0x9000, 0x9000) AM_WRITE(hotshock_sh_irqtrigger_w)
r2241r2242
198154   AM_RANGE(0x6000, 0x6bff) AM_WRITE(SMH_RAM)
199155   AM_RANGE(0x7000, 0x7003) AM_WRITE(ppi8255_0_w)
200156   AM_RANGE(0x7800, 0x7803) AM_WRITE(ppi8255_1_w)
201   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
202   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
203   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
204   AM_RANGE(0x9860, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
157   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
158   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
159   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
160   AM_RANGE(0x9860, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
205161   AM_RANGE(0x9880, 0x98ff) AM_WRITE(SMH_RAM)
206   AM_RANGE(0xa801, 0xa801) AM_WRITE(galaxian_nmi_enable_w)
207   AM_RANGE(0xa802, 0xa802) AM_WRITE(galaxian_coin_counter_w)
208   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxian_flip_screen_x_w)
209   AM_RANGE(0xa807, 0xa807) AM_WRITE(galaxian_flip_screen_y_w)
162   AM_RANGE(0xa801, 0xa801) AM_WRITE(galaxold_nmi_enable_w)
163   AM_RANGE(0xa802, 0xa802) AM_WRITE(galaxold_coin_counter_w)
164   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_x_w)
165   AM_RANGE(0xa807, 0xa807) AM_WRITE(galaxold_flip_screen_y_w)
210166ADDRESS_MAP_END
211167
212168
r2241r2242
234190static ADDRESS_MAP_START( mars_readmem, ADDRESS_SPACE_PROGRAM, 8 )
235191   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
236192   AM_RANGE(0x4000, 0x4bff) AM_READ(SMH_RAM)
237   AM_RANGE(0x4c00, 0x4fff) AM_READ(galaxian_videoram_r)
193   AM_RANGE(0x4c00, 0x4fff) AM_READ(galaxold_videoram_r)
238194   AM_RANGE(0x5000, 0x50ff) AM_READ(SMH_RAM)
239195   AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
240196   AM_RANGE(0x7000, 0x7000) AM_READ(SMH_NOP)
r2241r2242
245201static ADDRESS_MAP_START( mars_writemem, ADDRESS_SPACE_PROGRAM, 8 )
246202   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
247203   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM)
248   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
249   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
250   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
251   AM_RANGE(0x5060, 0x507f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
204   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
205   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
206   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
207   AM_RANGE(0x5060, 0x507f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
252208   AM_RANGE(0x5080, 0x50ff) AM_WRITE(SMH_RAM)
253   AM_RANGE(0x6800, 0x6800) AM_WRITE(galaxian_coin_counter_1_w)
254   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxian_stars_enable_w)
255   AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxian_nmi_enable_w)
256   AM_RANGE(0x6808, 0x6808) AM_WRITE(galaxian_coin_counter_0_w)
257   AM_RANGE(0x6809, 0x6809) AM_WRITE(galaxian_flip_screen_x_w)
258   AM_RANGE(0x680b, 0x680b) AM_WRITE(galaxian_flip_screen_y_w)
209   AM_RANGE(0x6800, 0x6800) AM_WRITE(galaxold_coin_counter_1_w)
210   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxold_stars_enable_w)
211   AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxold_nmi_enable_w)
212   AM_RANGE(0x6808, 0x6808) AM_WRITE(galaxold_coin_counter_0_w)
213   AM_RANGE(0x6809, 0x6809) AM_WRITE(galaxold_flip_screen_x_w)
214   AM_RANGE(0x680b, 0x680b) AM_WRITE(galaxold_flip_screen_y_w)
259215   AM_RANGE(0x8100, 0x810f) AM_WRITE(mars_ppi8255_0_w)
260216   AM_RANGE(0x8200, 0x820f) AM_WRITE(mars_ppi8255_1_w)
261217ADDRESS_MAP_END
r2241r2242
264220static ADDRESS_MAP_START( newsin7_readmem, ADDRESS_SPACE_PROGRAM, 8 )
265221   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
266222   AM_RANGE(0x4000, 0x4bff) AM_READ(SMH_RAM)
267   AM_RANGE(0x4c00, 0x4fff) AM_READ(galaxian_videoram_r)
223   AM_RANGE(0x4c00, 0x4fff) AM_READ(galaxold_videoram_r)
268224   AM_RANGE(0x5000, 0x50ff) AM_READ(SMH_RAM)
269225   AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
270226   AM_RANGE(0x8200, 0x820f) AM_READ(mars_ppi8255_1_r)
r2241r2242
275231static ADDRESS_MAP_START( newsin7_writemem, ADDRESS_SPACE_PROGRAM, 8 )
276232   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
277233   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM)
278   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
279   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
280   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
281   AM_RANGE(0x5060, 0x507f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
234   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
235   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
236   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
237   AM_RANGE(0x5060, 0x507f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
282238   AM_RANGE(0x5080, 0x50ff) AM_WRITE(SMH_RAM)
283   AM_RANGE(0x6800, 0x6800) AM_WRITE(galaxian_coin_counter_1_w)
284   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxian_stars_enable_w)
285   AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxian_nmi_enable_w)
286   AM_RANGE(0x6808, 0x6808) AM_WRITE(galaxian_coin_counter_0_w)
287   AM_RANGE(0x6809, 0x6809) AM_WRITE(galaxian_flip_screen_x_w)
288   AM_RANGE(0x680b, 0x680b) AM_WRITE(galaxian_flip_screen_y_w)
239   AM_RANGE(0x6800, 0x6800) AM_WRITE(galaxold_coin_counter_1_w)
240   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxold_stars_enable_w)
241   AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxold_nmi_enable_w)
242   AM_RANGE(0x6808, 0x6808) AM_WRITE(galaxold_coin_counter_0_w)
243   AM_RANGE(0x6809, 0x6809) AM_WRITE(galaxold_flip_screen_x_w)
244   AM_RANGE(0x680b, 0x680b) AM_WRITE(galaxold_flip_screen_y_w)
289245   AM_RANGE(0x8200, 0x820f) AM_WRITE(mars_ppi8255_1_w)
290246   AM_RANGE(0xa000, 0xafff) AM_WRITE(SMH_ROM)
291247   AM_RANGE(0xc100, 0xc10f) AM_WRITE(mars_ppi8255_0_w)
r2241r2242
295251static ADDRESS_MAP_START( mrkougar_writemem, ADDRESS_SPACE_PROGRAM, 8 )
296252   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
297253   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM)
298   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
299   AM_RANGE(0x4c00, 0x4fff) AM_WRITE(galaxian_videoram_w)   /* mirror address */
300   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
301   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
302   AM_RANGE(0x5060, 0x507f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
254   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
255   AM_RANGE(0x4c00, 0x4fff) AM_WRITE(galaxold_videoram_w)   /* mirror address */
256   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
257   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
258   AM_RANGE(0x5060, 0x507f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
303259   AM_RANGE(0x5080, 0x50ff) AM_WRITE(SMH_RAM)
304   AM_RANGE(0x6800, 0x6800) AM_WRITE(galaxian_coin_counter_1_w)
305   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxian_nmi_enable_w)
306   AM_RANGE(0x6808, 0x6808) AM_WRITE(galaxian_coin_counter_0_w)
307   AM_RANGE(0x6809, 0x6809) AM_WRITE(galaxian_flip_screen_x_w)
308   AM_RANGE(0x680b, 0x680b) AM_WRITE(galaxian_flip_screen_y_w)
260   AM_RANGE(0x6800, 0x6800) AM_WRITE(galaxold_coin_counter_1_w)
261   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxold_nmi_enable_w)
262   AM_RANGE(0x6808, 0x6808) AM_WRITE(galaxold_coin_counter_0_w)
263   AM_RANGE(0x6809, 0x6809) AM_WRITE(galaxold_flip_screen_x_w)
264   AM_RANGE(0x680b, 0x680b) AM_WRITE(galaxold_flip_screen_y_w)
309265   AM_RANGE(0x8100, 0x810f) AM_WRITE(mars_ppi8255_0_w)
310266   AM_RANGE(0x8200, 0x820f) AM_WRITE(mars_ppi8255_1_w)
311267ADDRESS_MAP_END
r2241r2242
314270static ADDRESS_MAP_START( hotshock_readmem, ADDRESS_SPACE_PROGRAM, 8 )
315271   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
316272   AM_RANGE(0x4000, 0x4bff) AM_READ(SMH_RAM)
317   AM_RANGE(0x4c00, 0x4fff) AM_READ(galaxian_videoram_r)
273   AM_RANGE(0x4c00, 0x4fff) AM_READ(galaxold_videoram_r)
318274   AM_RANGE(0x5000, 0x50ff) AM_READ(SMH_RAM)
319275   AM_RANGE(0x8000, 0x8000) AM_READ(input_port_0_r)
320276   AM_RANGE(0x8001, 0x8001) AM_READ(input_port_1_r)
r2241r2242
325281static ADDRESS_MAP_START( hotshock_writemem, ADDRESS_SPACE_PROGRAM, 8 )
326282   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
327283   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM)
328   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
329   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
330   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
331   AM_RANGE(0x5060, 0x507f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
284   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
285   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
286   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
287   AM_RANGE(0x5060, 0x507f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
332288   AM_RANGE(0x5080, 0x50ff) AM_WRITE(SMH_RAM)
333   AM_RANGE(0x6000, 0x6000) AM_WRITE(galaxian_coin_counter_2_w)
334   AM_RANGE(0x6002, 0x6002) AM_WRITE(galaxian_coin_counter_1_w)
289   AM_RANGE(0x6000, 0x6000) AM_WRITE(galaxold_coin_counter_2_w)
290   AM_RANGE(0x6002, 0x6002) AM_WRITE(galaxold_coin_counter_1_w)
335291   AM_RANGE(0x6004, 0x6004) AM_WRITE(hotshock_flip_screen_w)
336   AM_RANGE(0x6005, 0x6005) AM_WRITE(galaxian_coin_counter_0_w)
337   AM_RANGE(0x6006, 0x6006) AM_WRITE(galaxian_gfxbank_w)
338   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxian_nmi_enable_w)
292   AM_RANGE(0x6005, 0x6005) AM_WRITE(galaxold_coin_counter_0_w)
293   AM_RANGE(0x6006, 0x6006) AM_WRITE(galaxold_gfxbank_w)
294   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxold_nmi_enable_w)
339295   AM_RANGE(0x7000, 0x7000) AM_WRITE(watchdog_reset_w)
340296   AM_RANGE(0x8000, 0x8000) AM_WRITE(soundlatch_w)
341297   AM_RANGE(0x9000, 0x9000) AM_WRITE(hotshock_sh_irqtrigger_w)
r2241r2242
361317static ADDRESS_MAP_START( hunchbks_writemem, ADDRESS_SPACE_PROGRAM, 8 )
362318   AM_RANGE(0x0000, 0x0fff) AM_WRITE(SMH_ROM)
363319   AM_RANGE(0x1210, 0x1213) AM_WRITE(ppi8255_1_w)
364   AM_RANGE(0x1400, 0x143f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
365   AM_RANGE(0x1440, 0x145f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
366   AM_RANGE(0x1460, 0x147f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
320   AM_RANGE(0x1400, 0x143f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
321   AM_RANGE(0x1440, 0x145f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
322   AM_RANGE(0x1460, 0x147f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
367323   AM_RANGE(0x1480, 0x14ff) AM_WRITE(SMH_RAM)
368324   AM_RANGE(0x1500, 0x1503) AM_WRITE(ppi8255_0_w)
369   AM_RANGE(0x1606, 0x1606) AM_WRITE(galaxian_flip_screen_x_w)
370   AM_RANGE(0x1607, 0x1607) AM_WRITE(galaxian_flip_screen_y_w)
371   AM_RANGE(0x1800, 0x1bff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
325   AM_RANGE(0x1606, 0x1606) AM_WRITE(galaxold_flip_screen_x_w)
326   AM_RANGE(0x1607, 0x1607) AM_WRITE(galaxold_flip_screen_y_w)
327   AM_RANGE(0x1800, 0x1bff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
372328   AM_RANGE(0x1c00, 0x1fff) AM_WRITE(SMH_RAM)
373329   AM_RANGE(0x2000, 0x2fff) AM_WRITE(SMH_ROM)
374330   AM_RANGE(0x3000, 0x3fff) AM_WRITE(hunchbks_mirror_w)
r2241r2242
379335ADDRESS_MAP_END
380336
381337
382static ADDRESS_MAP_START( sfx_readmem, ADDRESS_SPACE_PROGRAM, 8 )
383   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
384   AM_RANGE(0x4000, 0x4bff) AM_READ(SMH_RAM)
385   AM_RANGE(0x4c00, 0x4fff) AM_READ(galaxian_videoram_r)   /* mirror */
386   AM_RANGE(0x5000, 0x50ff) AM_READ(SMH_RAM)
387   AM_RANGE(0x7000, 0x7fff) AM_READ(SMH_ROM)
388   AM_RANGE(0x8100, 0x8103) AM_READ(ppi8255_0_r)
389   AM_RANGE(0x8200, 0x8203) AM_READ(ppi8255_1_r)
390   AM_RANGE(0xc000, 0xefff) AM_READ(SMH_ROM)
391ADDRESS_MAP_END
392
393static ADDRESS_MAP_START( sfx_writemem, ADDRESS_SPACE_PROGRAM, 8 )
394   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
395   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM)
396   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
397   AM_RANGE(0x4c00, 0x4fff) AM_WRITE(galaxian_videoram_w)   /* mirror address */
398   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
399   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
400   AM_RANGE(0x5060, 0x507f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
401   AM_RANGE(0x5080, 0x50ff) AM_WRITE(SMH_RAM)
402   AM_RANGE(0x6800, 0x6800) AM_WRITE(scramble_background_red_w)
403   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxian_nmi_enable_w)
404   AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxian_coin_counter_w)
405   AM_RANGE(0x6803, 0x6803) AM_WRITE(scramble_background_blue_w)
406   AM_RANGE(0x6804, 0x6804) AM_WRITE(galaxian_stars_enable_w)
407   AM_RANGE(0x6805, 0x6805) AM_WRITE(scramble_background_green_w)
408   AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxian_flip_screen_x_w)
409   AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxian_flip_screen_y_w)
410   AM_RANGE(0x7000, 0x7fff) AM_WRITE(SMH_ROM)
411   AM_RANGE(0x8100, 0x8103) AM_WRITE(ppi8255_0_w)
412   AM_RANGE(0x8200, 0x8203) AM_WRITE(ppi8255_1_w)
413   AM_RANGE(0xc000, 0xefff) AM_WRITE(SMH_ROM)
414ADDRESS_MAP_END
415
416static ADDRESS_MAP_START( sfx_sample_readmem, ADDRESS_SPACE_PROGRAM, 8 )
417   AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM)
418   AM_RANGE(0x8000, 0x83ff) AM_READ(SMH_RAM)
419ADDRESS_MAP_END
420
421static ADDRESS_MAP_START( sfx_sample_writemem, ADDRESS_SPACE_PROGRAM, 8 )
422   AM_RANGE(0x0000, 0x5fff) AM_WRITE(SMH_ROM)
423   AM_RANGE(0x8000, 0x83ff) AM_WRITE(SMH_RAM)
424ADDRESS_MAP_END
425
426static ADDRESS_MAP_START( sfx_sample_readport, ADDRESS_SPACE_IO, 8 )
427   ADDRESS_MAP_GLOBAL_MASK(0xff)
428   AM_RANGE(0x04, 0x07) AM_READ(ppi8255_2_r)
429ADDRESS_MAP_END
430
431static ADDRESS_MAP_START( sfx_sample_writeport, ADDRESS_SPACE_IO, 8 )
432   ADDRESS_MAP_GLOBAL_MASK(0xff)
433   AM_RANGE(0x04, 0x07) AM_WRITE(ppi8255_2_w)
434   AM_RANGE(0x10, 0x10) AM_WRITE(DAC_0_signed_data_w)
435ADDRESS_MAP_END
436
437
438static READ8_HANDLER( monsterz_sound_status_r )
439{
440   return 0x80;
441}
442
443static ADDRESS_MAP_START( monsterz_map, ADDRESS_SPACE_PROGRAM, 8 )
444   AM_RANGE(0x0000, 0x37ff) AM_ROM
445   AM_RANGE(0x3800, 0x3fff) AM_RAM
446   AM_RANGE(0x4000, 0x47ff) AM_RAM
447   AM_RANGE(0x4800, 0x4bff) AM_READWRITE(galaxian_videoram_r, galaxian_videoram_w) AM_BASE(&galaxian_videoram)
448   AM_RANGE(0x4c00, 0x4fff) AM_READWRITE(galaxian_videoram_r, galaxian_videoram_w)   /* mirror address */
449   AM_RANGE(0x5000, 0x503f) AM_RAM AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
450   AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
451   AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
452   AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
453   AM_RANGE(0x8100, 0x8103) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
454   AM_RANGE(0x8200, 0x8203) AM_READWRITE(ppi8255_1_r, ppi8255_1_w)
455   AM_RANGE(0x6800, 0x6800) AM_WRITE(scramble_background_red_w)
456   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxian_nmi_enable_w)
457   AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxian_coin_counter_w)
458   AM_RANGE(0x6803, 0x6803) AM_WRITE(scramble_background_blue_w)
459   AM_RANGE(0x6804, 0x6804) AM_WRITE(galaxian_stars_enable_w)
460   AM_RANGE(0x6805, 0x6805) AM_WRITE(scramble_background_green_w)
461   AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxian_flip_screen_x_w)
462   AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxian_flip_screen_y_w)
463   AM_RANGE(0xc000, 0xd7ff) AM_ROM
464   AM_RANGE(0xd800, 0xd800) AM_READ(monsterz_prot_r)
465ADDRESS_MAP_END
466
467static ADDRESS_MAP_START( monsterz_sound_io_map, ADDRESS_SPACE_IO, 8 )
468   AM_RANGE(0x04, 0x04) AM_READ(monsterz_sound_status_r)
469   AM_RANGE(0x10, 0x10) AM_WRITE(AY8910_control_port_0_w)
470   AM_RANGE(0x20, 0x20) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
471   AM_RANGE(0x40, 0x40) AM_WRITE(AY8910_control_port_1_w)
472   AM_RANGE(0x80, 0x80) AM_READWRITE(AY8910_read_port_1_r, AY8910_write_port_1_w)
473ADDRESS_MAP_END
474
475
476338static ADDRESS_MAP_START( mimonscr_readmem, ADDRESS_SPACE_PROGRAM, 8 )
477339   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
478   AM_RANGE(0x4000, 0x43ff) AM_READ(galaxian_videoram_r)   /* mirror address?, probably not */
340   AM_RANGE(0x4000, 0x43ff) AM_READ(galaxold_videoram_r)   /* mirror address?, probably not */
479341   AM_RANGE(0x4400, 0x4bff) AM_READ(SMH_RAM)
480342   AM_RANGE(0x5000, 0x50ff) AM_READ(SMH_RAM)
481343   AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
r2241r2242
486348
487349static ADDRESS_MAP_START( mimonscr_writemem, ADDRESS_SPACE_PROGRAM, 8 )
488350   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
489   AM_RANGE(0x4000, 0x43ff) AM_WRITE(galaxian_videoram_w)   /* mirror address?, probably not */
351   AM_RANGE(0x4000, 0x43ff) AM_WRITE(galaxold_videoram_w)   /* mirror address?, probably not */
490352   AM_RANGE(0x4400, 0x47ff) AM_WRITE(SMH_RAM)
491   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
492   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
493   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
494   AM_RANGE(0x5060, 0x507f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
353   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
354   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
355   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
356   AM_RANGE(0x5060, 0x507f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
495357   AM_RANGE(0x5080, 0x50ff) AM_WRITE(SMH_RAM)
496   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxian_nmi_enable_w)
497   AM_RANGE(0x6800, 0x6802) AM_WRITE(galaxian_gfxbank_w)
498   AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxian_flip_screen_x_w)
499   AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxian_flip_screen_y_w)
358   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxold_nmi_enable_w)
359   AM_RANGE(0x6800, 0x6802) AM_WRITE(galaxold_gfxbank_w)
360   AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxold_flip_screen_x_w)
361   AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxold_flip_screen_y_w)
500362   AM_RANGE(0x8100, 0x8103) AM_WRITE(ppi8255_0_w)
501363   AM_RANGE(0x8200, 0x8203) AM_WRITE(ppi8255_1_w)
502364   AM_RANGE(0xc000, 0xffff) AM_WRITE(SMH_ROM)
r2241r2242
526388static ADDRESS_MAP_START( frogf_map, ADDRESS_SPACE_PROGRAM, 8 )
527389   AM_RANGE(0x0000, 0x2fff) AM_ROM
528390   AM_RANGE(0x8000, 0x87ff) AM_RAM
529   AM_RANGE(0x8800, 0x8bff) AM_RAM AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
530   AM_RANGE(0x9000, 0x903f) AM_RAM AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
531   AM_RANGE(0x9040, 0x905f) AM_RAM AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
391   AM_RANGE(0x8800, 0x8bff) AM_RAM AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
392   AM_RANGE(0x9000, 0x903f) AM_RAM AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
393   AM_RANGE(0x9040, 0x905f) AM_RAM AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
532394   AM_RANGE(0x9060, 0x90ff) AM_RAM
533   AM_RANGE(0xa802, 0xa802) AM_WRITE(galaxian_flip_screen_x_w)
534   AM_RANGE(0xa804, 0xa804) AM_WRITE(galaxian_nmi_enable_w)
535   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxian_flip_screen_y_w)
536   AM_RANGE(0xa808, 0xa808) AM_WRITE(galaxian_coin_counter_1_w)
537   AM_RANGE(0xa80e, 0xa80e) AM_WRITE(galaxian_coin_counter_0_w)
395   AM_RANGE(0xa802, 0xa802) AM_WRITE(galaxold_flip_screen_x_w)
396   AM_RANGE(0xa804, 0xa804) AM_WRITE(galaxold_nmi_enable_w)
397   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_y_w)
398   AM_RANGE(0xa808, 0xa808) AM_WRITE(galaxold_coin_counter_1_w)
399   AM_RANGE(0xa80e, 0xa80e) AM_WRITE(galaxold_coin_counter_0_w)
538400   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
539401   AM_RANGE(0xd000, 0xd018) AM_READWRITE(frogf_ppi8255_0_r, frogf_ppi8255_0_w)
540402   AM_RANGE(0xe000, 0xe018) AM_READWRITE(frogf_ppi8255_1_r, frogf_ppi8255_1_w)
r2241r2242
543405static ADDRESS_MAP_START( ad2083_map, ADDRESS_SPACE_PROGRAM, 8 )
544406   AM_RANGE(0x0000, 0x3fff) AM_ROM
545407   AM_RANGE(0x4000, 0x47ff) AM_RAM
546   AM_RANGE(0x4800, 0x4bff) AM_READWRITE(galaxian_videoram_r, galaxian_videoram_w) AM_BASE(&galaxian_videoram)
547   AM_RANGE(0x5000, 0x503f) AM_RAM AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
548   AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
549   AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
408   AM_RANGE(0x4800, 0x4bff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w) AM_BASE(&galaxold_videoram)
409   AM_RANGE(0x5000, 0x503f) AM_RAM AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
410   AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
411   AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
550412   AM_RANGE(0x6004, 0x6004) AM_WRITE(hotshock_flip_screen_w)
551   AM_RANGE(0x6800, 0x6800) AM_WRITE(galaxian_coin_counter_2_w)
552   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxian_nmi_enable_w)
553   AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxian_coin_counter_0_w)
554   AM_RANGE(0x6803, 0x6803) AM_WRITE(scramble_background_blue_w)
555   AM_RANGE(0x6805, 0x6805) AM_WRITE(galaxian_coin_counter_1_w)
556   AM_RANGE(0x6806, 0x6806) AM_WRITE(scramble_background_red_w)
557   AM_RANGE(0x6807, 0x6807) AM_WRITE(scramble_background_green_w)
413   AM_RANGE(0x6800, 0x6800) AM_WRITE(galaxold_coin_counter_2_w)
414   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxold_nmi_enable_w)
415   AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxold_coin_counter_0_w)
416   AM_RANGE(0x6803, 0x6803) AM_WRITE(scrambold_background_blue_w)
417   AM_RANGE(0x6805, 0x6805) AM_WRITE(galaxold_coin_counter_1_w)
418   AM_RANGE(0x6806, 0x6806) AM_WRITE(scrambold_background_red_w)
419   AM_RANGE(0x6807, 0x6807) AM_WRITE(scrambold_background_green_w)
558420   AM_RANGE(0x8000, 0x8000) AM_WRITE(soundlatch_w)
559421   AM_RANGE(0x9000, 0x9000) AM_WRITE(hotshock_sh_irqtrigger_w)
560422   AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
r2241r2242
20091871   MDRV_GFXDECODE(scramble)
20101872   MDRV_PALETTE_LENGTH(32+64+2+1)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
20111873
2012   MDRV_PALETTE_INIT(scramble)
2013   MDRV_VIDEO_START(scramble)
2014   MDRV_VIDEO_UPDATE(galaxian)
1874   MDRV_PALETTE_INIT(scrambold)
1875   MDRV_VIDEO_START(scrambold)
1876   MDRV_VIDEO_UPDATE(galaxold)
20151877
20161878   /* sound hardware */
20171879   MDRV_SPEAKER_STANDARD_MONO("mono")
r2241r2242
20801942   /* video hardware */
20811943   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
20821944
2083   MDRV_PALETTE_INIT(galaxian)
1945   MDRV_PALETTE_INIT(galaxold)
20841946   MDRV_VIDEO_START(theend)
20851947MACHINE_DRIVER_END
20861948
20871949
2088static ADDRESS_MAP_START( frogger_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
2089   AM_RANGE(0x0000, 0x1fff) AM_READ(SMH_ROM)
2090   AM_RANGE(0x4000, 0x43ff) AM_READ(SMH_RAM)
2091ADDRESS_MAP_END
2092
2093static ADDRESS_MAP_START( frogger_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
2094   AM_RANGE(0x0000, 0x1fff) AM_WRITE(SMH_ROM)
2095   AM_RANGE(0x4000, 0x43ff) AM_WRITE(SMH_RAM)
2096    AM_RANGE(0x6000, 0x6fff) AM_WRITE(frogger_filter_w)
2097ADDRESS_MAP_END
2098
2099
2100static ADDRESS_MAP_START( frogger_sound_readport, ADDRESS_SPACE_IO, 8 )
2101   ADDRESS_MAP_GLOBAL_MASK(0xff)
2102   AM_RANGE(0x40, 0x40) AM_READ(AY8910_read_port_0_r)
2103ADDRESS_MAP_END
2104
2105static ADDRESS_MAP_START( frogger_sound_writeport, ADDRESS_SPACE_IO, 8 )
2106   ADDRESS_MAP_GLOBAL_MASK(0xff)
2107   AM_RANGE(0x40, 0x40) AM_WRITE(AY8910_write_port_0_w)
2108   AM_RANGE(0x80, 0x80) AM_WRITE(AY8910_control_port_0_w)
2109ADDRESS_MAP_END
2110
2111static const struct AY8910interface frogger_ay8910_interface =
2112{
2113   soundlatch_r,
2114   frogger_portB_r
2115};
2116
2117
2118static MACHINE_DRIVER_START( froggers )
2119
2120   /* basic machine hardware */
2121   MDRV_IMPORT_FROM(scramble)
2122   MDRV_CPU_MODIFY("audio")
2123   MDRV_CPU_PROGRAM_MAP(frogger_sound_readmem,frogger_sound_writemem)
2124   MDRV_CPU_IO_MAP(frogger_sound_readport,frogger_sound_writeport)
2125
2126   /* video hardware */
2127   MDRV_PALETTE_INIT(frogger)
2128   MDRV_VIDEO_START(froggers)
2129
2130   /* sound hardware */
2131   MDRV_SOUND_MODIFY("8910.1")
2132   MDRV_SOUND_CONFIG(frogger_ay8910_interface)
2133   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
2134
2135   MDRV_SOUND_REMOVE("8910.2")
2136MACHINE_DRIVER_END
2137
2138
2139static MACHINE_DRIVER_START( frogf )
2140
2141   /* basic machine hardware */
2142   MDRV_IMPORT_FROM(scramble)
2143
2144   MDRV_CPU_MODIFY("main")
2145   MDRV_CPU_PROGRAM_MAP(frogf_map,0)
2146
2147   MDRV_CPU_MODIFY("audio")
2148   MDRV_CPU_PROGRAM_MAP(frogger_sound_readmem,frogger_sound_writemem)
2149   MDRV_CPU_IO_MAP(frogger_sound_readport,frogger_sound_writeport)
2150
2151   /* video hardware */
2152   MDRV_PALETTE_INIT(frogger)
2153   MDRV_VIDEO_START(froggers)
2154
2155   /* sound hardware */
2156   MDRV_SOUND_MODIFY("8910.1")
2157   MDRV_SOUND_CONFIG(frogger_ay8910_interface)
2158   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
2159
2160   MDRV_SOUND_REMOVE("8910.2")
2161MACHINE_DRIVER_END
2162
21631950static MACHINE_DRIVER_START( mars )
21641951
21651952   /* basic machine hardware */
r2241r2242
21691956
21701957   /* video hardware */
21711958   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
2172   MDRV_PALETTE_INIT(galaxian)
1959   MDRV_PALETTE_INIT(galaxold)
21731960MACHINE_DRIVER_END
21741961
21751962static MACHINE_DRIVER_START( devilfsh )
r2241r2242
21821969   /* video hardware */
21831970   MDRV_GFXDECODE(devilfsh)
21841971   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
2185   MDRV_PALETTE_INIT(galaxian)
1972   MDRV_PALETTE_INIT(galaxold)
21861973MACHINE_DRIVER_END
21871974
21881975static MACHINE_DRIVER_START( newsin7 )
r2241r2242
21951982   /* video hardware */
21961983   MDRV_GFXDECODE(newsin7)
21971984   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
2198   MDRV_PALETTE_INIT(galaxian)
1985   MDRV_PALETTE_INIT(galaxold)
21991986   MDRV_VIDEO_START(newsin7)
22001987MACHINE_DRIVER_END
22011988
r2241r2242
22091996   /* video hardware */
22101997   MDRV_GFXDECODE(mrkougar)
22111998   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
2212   MDRV_PALETTE_INIT(galaxian)
1999   MDRV_PALETTE_INIT(galaxold)
22132000MACHINE_DRIVER_END
22142001
22152002static MACHINE_DRIVER_START( mrkougb )
r2241r2242
22212008
22222009   /* video hardware */
22232010   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
2224   MDRV_PALETTE_INIT(galaxian)
2011   MDRV_PALETTE_INIT(galaxold)
22252012MACHINE_DRIVER_END
22262013
22272014static MACHINE_DRIVER_START( ckongs )
r2241r2242
22332020
22342021   /* video hardware */
22352022   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
2236   MDRV_PALETTE_INIT(galaxian)
2023   MDRV_PALETTE_INIT(galaxold)
22372024   MDRV_VIDEO_START(ckongs)
22382025MACHINE_DRIVER_END
22392026
r2241r2242
22472034   MDRV_CPU_MODIFY("audio")
22482035   MDRV_CPU_IO_MAP(hotshock_sound_readport,hotshock_sound_writeport)
22492036
2250   MDRV_MACHINE_RESET(galaxian)
2037   MDRV_MACHINE_RESET(galaxold)
22512038
22522039   /* video hardware */
22532040   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
2254   MDRV_PALETTE_INIT(galaxian)
2041   MDRV_PALETTE_INIT(galaxold)
22552042   MDRV_VIDEO_START(pisces)
22562043
22572044   MDRV_SOUND_MODIFY("8910.1")
r2241r2242
22692056
22702057   /* video hardware */
22712058   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
2272   MDRV_PALETTE_INIT(galaxian)
2059   MDRV_PALETTE_INIT(galaxold)
22732060   MDRV_VIDEO_START(ckongs)
22742061MACHINE_DRIVER_END
22752062
2276static MACHINE_DRIVER_START( sfx )
22772063
2278   /* basic machine hardware */
2279   MDRV_IMPORT_FROM(scramble)
2280   MDRV_CPU_MODIFY("main")
2281   MDRV_CPU_PROGRAM_MAP(sfx_readmem,sfx_writemem)
22822064
2283   MDRV_CPU_ADD(Z80, 14318000/8)   /* 1.78975 MHz */
2284   /* audio CPU */
2285   MDRV_CPU_PROGRAM_MAP(sfx_sample_readmem,sfx_sample_writemem)
2286   MDRV_CPU_IO_MAP(sfx_sample_readport,sfx_sample_writeport)
22872065
2288   MDRV_MACHINE_RESET(sfx)
22892066
2290   /* video hardware */
2291   MDRV_SCREEN_MODIFY("main")
2292   MDRV_SCREEN_VISIBLE_AREA(2*8, 30*8-1, 2*8, 30*8-1)
2293   MDRV_PALETTE_LENGTH(32+64+2+8)   /* 32 for characters, 64 for stars, 2 for bullets, 8 for background */
2294   MDRV_GFXDECODE(sfx)
2295   MDRV_PALETTE_INIT(turtles)
2296   MDRV_VIDEO_START(sfx)
22972067
2298   /* sound hardware */
2299   MDRV_SOUND_MODIFY("8910.1")
2300   MDRV_SOUND_CONFIG(sfx_ay8910_interface_1)
2301   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
2302
2303   MDRV_SOUND_MODIFY("8910.2")
2304   MDRV_SOUND_CONFIG(scramble_ay8910_interface_2)
2305   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
2306
2307   MDRV_SOUND_ADD(DAC, 0)
2308   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
2309MACHINE_DRIVER_END
2310
2311
2312
2313
2314
2315
2316static MACHINE_DRIVER_START( monsterz )
2317
2318   /* basic machine hardware */
2319   MDRV_IMPORT_FROM(scramble)
2320   MDRV_CPU_MODIFY("main")
2321   MDRV_CPU_PROGRAM_MAP(monsterz_map,0)
2322   MDRV_CPU_PERIODIC_INT(irq0_line_hold,16*4) //?
2323
2324   MDRV_CPU_MODIFY("audio")
2325   MDRV_CPU_IO_MAP(monsterz_sound_io_map,0)
2326
2327   MDRV_CPU_ADD(Z80, 14318000/8)   /* 1.78975 MHz */
2328   /* audio CPU */
2329   MDRV_CPU_PROGRAM_MAP(sfx_sample_readmem,sfx_sample_writemem)
2330   MDRV_CPU_IO_MAP(sfx_sample_readport,sfx_sample_writeport)
2331
2332   MDRV_MACHINE_RESET(monsterz)
2333
2334   /* video hardware */
2335   MDRV_SCREEN_MODIFY("main")
2336   MDRV_SCREEN_VISIBLE_AREA(2*8, 30*8-1, 2*8, 30*8-1)
2337   MDRV_PALETTE_LENGTH(32+64+2+8)   /* 32 for characters, 64 for stars, 2 for bullets, 8 for background */
2338   MDRV_GFXDECODE(sfx)
2339   MDRV_PALETTE_INIT(turtles)
2340   MDRV_VIDEO_START(sfx)
2341
2342   /* sound hardware */
2343   MDRV_SOUND_MODIFY("8910.1")
2344   MDRV_SOUND_CONFIG(sfx_ay8910_interface_1)
2345   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
2346
2347   MDRV_SOUND_MODIFY("8910.2")
2348   MDRV_SOUND_CONFIG(scramble_ay8910_interface_2)
2349   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
2350
2351   MDRV_SOUND_ADD(DAC, 0)
2352   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
2353MACHINE_DRIVER_END
2354
23552068static MACHINE_DRIVER_START( mimonscr )
23562069
23572070   /* basic machine hardware */
r2241r2242
23762089   /* video hardware */
23772090   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets */
23782091
2379   MDRV_PALETTE_INIT(galaxian)
2092   MDRV_PALETTE_INIT(galaxold)
23802093
23812094   /* sound hardware */
23822095   MDRV_SOUND_MODIFY("8910.1")
r2241r2242
24142127   /* video hardware */
24152128   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets */
24162129
2417   MDRV_PALETTE_INIT(galaxian)
2130   MDRV_PALETTE_INIT(galaxold)
24182131MACHINE_DRIVER_END
24192132
24202133static MACHINE_DRIVER_START( hncholms )
r2241r2242
24552168   MDRV_CPU_ADD(Z80, 18432000/6)   /* 3.072 MHz */
24562169   MDRV_CPU_PROGRAM_MAP(ad2083_map,0)
24572170
2458   MDRV_MACHINE_RESET(galaxian)
2171   MDRV_MACHINE_RESET(galaxold)
24592172
24602173   /* video hardware */
24612174   MDRV_SCREEN_ADD("main", RASTER)
r2241r2242
24702183
24712184   MDRV_PALETTE_INIT(turtles)
24722185   MDRV_VIDEO_START(ad2083)
2473   MDRV_VIDEO_UPDATE(galaxian)
2186   MDRV_VIDEO_UPDATE(galaxold)
24742187
24752188   /* sound hardware */
24762189
r2241r2242
26712384   ROM_LOAD( "6331-1j.86",   0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) )
26722385ROM_END
26732386
2674ROM_START( froggers )
2675   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2676   ROM_LOAD( "vid_d2.bin",   0x0000, 0x0800, CRC(c103066e) SHA1(8c2d4c825e9c4180fe70b0db18a547dc3ddc3c2c) )
2677   ROM_LOAD( "vid_e2.bin",   0x0800, 0x0800, CRC(f08bc094) SHA1(23ad1e57f244d6b63fd9640249dcb1eeafb8206e) )
2678   ROM_LOAD( "vid_f2.bin",   0x1000, 0x0800, CRC(637a2ff8) SHA1(e9b9fc692ca5d8deb9cd30d9d73ad25c8d8bafe1) )
2679   ROM_LOAD( "vid_h2.bin",   0x1800, 0x0800, CRC(04c027a5) SHA1(193550731513c02cad464661a1ceb230819ca70f) )
2680   ROM_LOAD( "vid_j2.bin",   0x2000, 0x0800, CRC(fbdfbe74) SHA1(48d5d1247d09eaea2a9a29f4ed6543d0411597aa) )
2681   ROM_LOAD( "vid_l2.bin",   0x2800, 0x0800, CRC(8a4389e1) SHA1(b2c74afb93927dac0d8bb24e02e0b2a069f2d3c8) )
2682
2683   ROM_REGION( 0x10000, REGION_CPU2, 0 )
2684   ROM_LOAD( "frogger.608",  0x0000, 0x0800, CRC(e8ab0256) SHA1(f090afcfacf5f13cdfa0dfda8e3feb868c6ce8bc) )
2685   ROM_LOAD( "frogger.609",  0x0800, 0x0800, CRC(7380a48f) SHA1(75582a94b696062cbdb66a4c5cf0bc0bb94f81ee) )
2686   ROM_LOAD( "frogger.610",  0x1000, 0x0800, CRC(31d7eb27) SHA1(2e1d34ae4da385fd7cac94707d25eeddf4604e1a) )
2687
2688   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2689   ROM_LOAD( "frogger.607",  0x0000, 0x0800, CRC(05f7d883) SHA1(78831fd287da18928651a8adb7e578d291493eff) )
2690   ROM_LOAD( "epr-1036.1k",  0x0800, 0x0800, CRC(658745f8) SHA1(e4e5c3e011c8a7233a36d29e10e08905873500aa) )
2691
2692   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2693   ROM_LOAD( "pr-91.6l",     0x0000, 0x0020, CRC(413703bf) SHA1(66648b2b28d3dcbda5bdb2605d1977428939dd3c) )
2694ROM_END
2695
2696
2697
2698ROM_START( frogf )
2699   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2700   ROM_LOAD( "6.bin",        0x0000, 0x1000, CRC(8ff0a973) SHA1(adb1c28617d915fbcfa9190bd8589a56a8858e25) )
2701   ROM_LOAD( "7.bin",        0x1000, 0x1000, CRC(3087bb4b) SHA1(3fe1f68a2ad12b1cadba89d99afe574cf5342d81) )
2702   ROM_LOAD( "8.bin",        0x2000, 0x1000, CRC(c3869d12) SHA1(7bd95c12fc1fe1a3cfc0140b64cf76fa57aa3fb4) )
2703
2704   ROM_REGION( 0x10000, REGION_CPU2, 0 )
2705   ROM_LOAD( "frogger.608",  0x0000, 0x0800, CRC(e8ab0256) SHA1(f090afcfacf5f13cdfa0dfda8e3feb868c6ce8bc) )
2706   ROM_LOAD( "frogger.609",  0x0800, 0x0800, CRC(7380a48f) SHA1(75582a94b696062cbdb66a4c5cf0bc0bb94f81ee) )
2707   ROM_LOAD( "frogger.610",  0x1000, 0x0800, CRC(31d7eb27) SHA1(2e1d34ae4da385fd7cac94707d25eeddf4604e1a) )
2708
2709   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2710   ROM_LOAD( "frogger.607",  0x0000, 0x0800, CRC(05f7d883) SHA1(78831fd287da18928651a8adb7e578d291493eff) )
2711   ROM_LOAD( "epr-1036.1k",  0x0800, 0x0800, CRC(658745f8) SHA1(e4e5c3e011c8a7233a36d29e10e08905873500aa) )
2712
2713   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2714   ROM_LOAD( "pr-91.6l",     0x0000, 0x0020, CRC(413703bf) SHA1(66648b2b28d3dcbda5bdb2605d1977428939dd3c) )
2715ROM_END
2716
2717ROM_START( amidars )
2718   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2719   ROM_LOAD( "am2d",         0x0000, 0x0800, CRC(24b79547) SHA1(eca735c6a35561a9a6ba8a20dca1e1c78ed073fc) )
2720   ROM_LOAD( "am2e",         0x0800, 0x0800, CRC(4c64161e) SHA1(5b2e49ff915295617671b13f15b566046a5dbc15) )
2721   ROM_LOAD( "am2f",         0x1000, 0x0800, CRC(b3987a72) SHA1(1d72e9ae3005029628c6f9beb6ca65afcb1f7893) )
2722   ROM_LOAD( "am2h",         0x1800, 0x0800, CRC(29873461) SHA1(7d0ee9a82f02163b4cc6a7097e88ae34e96ebf58) )
2723   ROM_LOAD( "am2j",         0x2000, 0x0800, CRC(0fdd54d8) SHA1(c32fdc8e292d91159e6c80c7033abea6404a4f2c) )
2724   ROM_LOAD( "am2l",         0x2800, 0x0800, CRC(5382f7ed) SHA1(425ec2c2caf404fc8ab13ee38d6567413022e1a1) )
2725   ROM_LOAD( "am2m",         0x3000, 0x0800, CRC(1d7109e9) SHA1(e0d24475547bbe5a94b45be6abefb84ad84d2534) )
2726   ROM_LOAD( "am2p",         0x3800, 0x0800, CRC(c9163ac6) SHA1(46d757180426b71c827d14a35824a248f2c787b6) )
2727
2728   ROM_REGION( 0x10000, REGION_CPU2, 0 )
2729   ROM_LOAD( "amidarus.5c",  0x0000, 0x1000, CRC(8ca7b750) SHA1(4f4c2915503b85abe141d717fd254ee10c9da99e) )
2730   ROM_LOAD( "amidarus.5d",  0x1000, 0x1000, CRC(9b5bdc0a) SHA1(84d953618c8bf510d23b42232a856ac55f1baff5) )
2731
2732   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2733   ROM_LOAD( "2716.a6",      0x0000, 0x0800, CRC(2082ad0a) SHA1(c6014d9575e92adf09b0961c2158a779ebe940c4) )   /* Same graphics ROMs as Amigo */
2734   ROM_LOAD( "2716.a5",      0x0800, 0x0800, CRC(3029f94f) SHA1(3b432b42e79f8b0a7d65e197f373a04e3c92ff20) )
2735
2736   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2737   ROM_LOAD( "amidar.clr",   0x0000, 0x0020, CRC(f940dcc3) SHA1(1015e56f37c244a850a8f4bf0e36668f047fd46d) )
2738ROM_END
2739
27402387ROM_START( triplep )
27412388   ROM_REGION( 0x10000, REGION_CPU1, 0 )
27422389   ROM_LOAD( "triplep.2g",   0x0000, 0x1000, CRC(c583a93d) SHA1(2bd4a02f945d64ef3ff814d0b8cbf32380d3f790) )
r2241r2242
30982745   ROM_LOAD( "cavelon.clr",  0x0000, 0x0020, CRC(d133356b) SHA1(58db4013a9ad77107f0d462c96363d7c38d86fa2) )
30992746ROM_END
31002747
3101ROM_START( sfx )
3102   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3103   ROM_LOAD( "sfx_b-0.1j",   0x0000, 0x1000, CRC(e5bc6952) SHA1(7bfb772418d738d3c49fd59c0bfc04590945977a) )
3104   ROM_CONTINUE(             0xe000, 0x1000             )
3105   ROM_LOAD( "1.1c",         0x1000, 0x1000, CRC(1b3c48e7) SHA1(2f245aaf9b4bb5d949aae18ee89a0be639e7b2df) )
3106   ROM_LOAD( "22.1d",        0x2000, 0x1000, CRC(ed44950d) SHA1(f8c54ff89ac461171df951d703d5571be1b8da38) )
3107   ROM_LOAD( "23.1e",        0x3000, 0x1000, CRC(f44a3ca0) SHA1(3917ea960329a06d3d0c447cb6a4ba710fb7ca92) )
3108   ROM_LOAD( "27.1a",        0x7000, 0x1000, CRC(ed86839f) SHA1(a0d8c941a6e01058eab66d5da9b49b6b5695b981) )
3109   ROM_LOAD( "24.1g",        0xc000, 0x1000, CRC(e6d7dc74) SHA1(c1e6d9598fb837775ee6550fea3cd4910572615e) )
3110   ROM_LOAD( "5.1h",         0xd000, 0x1000, CRC(d1e8d390) SHA1(f8fe9f69e6500fbcf25f8151c1070d9a1a20a38c) )
3111
3112   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3113   ROM_LOAD( "5.5j",         0x0000, 0x1000, CRC(59028fb6) SHA1(94105b5b03c81a948a409f7ea20312bb9c79c150) )
3114   ROM_LOAD( "6.6j",         0x1000, 0x1000, CRC(5427670f) SHA1(ffc3f7186d0319f0fd7ed25eb97bb0db7bc107c6) )
3115
3116   ROM_REGION( 0x10000, REGION_CPU3, 0 )   /* 64k for the sample CPU */
3117   ROM_LOAD( "1.1j",         0x0000, 0x1000, CRC(2f172c58) SHA1(4706d55fcfad4d5a87d96a0a0187f59997ef9720) )
3118   ROM_LOAD( "2.2j",         0x1000, 0x1000, CRC(a6ad2f6b) SHA1(14d1a93e507c349b14a1b26408cce23f089fa33c) )
3119   ROM_LOAD( "3.3j",         0x2000, 0x1000, CRC(fa1274fa) SHA1(e98cb602b265b209eaa4a9b3972e47c869ff863b) )
3120   ROM_LOAD( "4.4j",         0x3000, 0x1000, CRC(1cd33f3a) SHA1(cf9248fd6cb56ec81d354afe032a2dea810e834b) )
3121   ROM_LOAD( "10.3h",        0x4000, 0x1000, CRC(b833a15b) SHA1(0d21aaa0ca5ccba89118b205a6b3b36b15663c47) )
3122   ROM_LOAD( "11.4h",        0x5000, 0x1000, CRC(cbd76ec2) SHA1(9434350ee93ca71efe78018b69913386353306ff) )
3123
3124   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3125   ROM_LOAD( "28.5a",        0x0000, 0x1000, CRC(d73a8252) SHA1(59d14f41f1a806f98ee33596b84fe5aefe606944) )
3126   ROM_LOAD( "29.5c",        0x1000, 0x1000, CRC(1401ccf2) SHA1(5762eafd9f402330e1d4ac677f46595087716c47) )
3127
3128   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3129   ROM_LOAD( "6331.9g",      0x0000, 0x0020, CRC(ca1d9ccd) SHA1(27124759a06497c1bc1a64b6d3faa6ba924a8447) )
3130ROM_END
3131
31322748ROM_START( skelagon )
31332749   ROM_REGION( 0x10000, REGION_CPU1, 0 )
31342750   /* first half of 36.bin is missing */
r2241r2242
31602776   ROM_LOAD( "6331.9g",      0x0000, 0x0020, CRC(ca1d9ccd) SHA1(27124759a06497c1bc1a64b6d3faa6ba924a8447) )
31612777ROM_END
31622778
3163/*
3164Monster Zero
3165
3166CPU: Z80 (x3)
3167Sound: AY-3-8910 (x2)
3168Other: 8255 (x3)
3169RAM: 2114 (x2), 2114 (x2), TMM2016P, TMM314A (x4), MPB8216 (x2), MPB8216 (x2), 2114 (x2), TMM314A (x2), D2125A (x5)
3170PAL: 16R8C (protected x2)
3171PROM: 82S123
3172X1: 1431818
3173X2: 16000
3174*/
3175
3176ROM_START( monsterz )
3177   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3178   ROM_LOAD( "b-1e.a1",      0x0000, 0x1000, CRC(97886542) SHA1(01f4f9bd55f9eae28162cbb22a26f7cda22cd3f3) )
3179   ROM_LOAD( "b-2e.c1",      0x1000, 0x1000, CRC(184ffcb4) SHA1(829d6ca13773aba7c3a81e122171befbe3666110) )
3180   ROM_LOAD( "b-3e.d1",      0x2000, 0x1000, CRC(b7b10ac7) SHA1(51d544d4db456df756a95d7f1853fffed9259647) )
3181   ROM_LOAD( "b-4e.e1",      0x3000, 0x1000, CRC(fb02c736) SHA1(24466116dd07b856b1afff62b8312c67ff466b95) )
3182   ROM_LOAD( "b-5e.g1",      0xc000, 0x1000, CRC(b2788ab9) SHA1(eb1a6b41f4c7a243481bfccf2b068ce1bc292366) )
3183   ROM_LOAD( "b-6e.h1",      0xd000, 0x1000, CRC(77d7aa8d) SHA1(62aaf582ba55f7b21f6cf13b4fb6c2c54bb729f5) )
3184
3185   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3186   ROM_LOAD( "a-1e.k1",      0x0000, 0x1000, CRC(b88ba44e) SHA1(85c141fb411d541b1e20412f5fefd18395f635ae) )
3187   ROM_LOAD( "a-2.k2",       0x1000, 0x1000, CRC(8913c94e) SHA1(6c4fe065217a234d45761f8ad4d2c4e7078a0abd) )
3188   ROM_LOAD( "a-3e.k3",      0x2000, 0x1000, CRC(a8fa5095) SHA1(5cabe5497a79a0c43e78a84ae87c824af60a2a3f) )
3189   ROM_LOAD( "a-4.k4",       0x3000, 0x1000, CRC(93f81317) SHA1(167708be94cb9a47290067a20bc5ff6f018b93b6) )
3190
3191   ROM_REGION( 0x10000, REGION_CPU3, 0 )   /* 64k for the sample CPU */
3192   ROM_LOAD( "a-5e.k5",      0x0000, 0x1000, CRC(b5bcdb4e) SHA1(db0965e5636e0f4e9cd4f4a7d808c413ecf733db) )
3193   ROM_LOAD( "a-6.k6",       0x1000, 0x1000, CRC(24832b2e) SHA1(2a67888e86ce1a3182303e841513ba2a07977359) )
3194   ROM_LOAD( "a-7e.k7",      0x2000, 0x1000, CRC(20ebea81) SHA1(473c688365b256d8593663ff95768f4a5bb1289d) )
3195   // 0x3000 empty ?
3196   ROM_LOAD( "a-8.k8",       0x4000, 0x1000, CRC(b833a15b) SHA1(0d21aaa0ca5ccba89118b205a6b3b36b15663c47) )
3197   ROM_LOAD( "a-9.k9",       0x5000, 0x1000, CRC(cbd76ec2) SHA1(9434350ee93ca71efe78018b69913386353306ff) )
3198
3199   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3200   ROM_LOAD( "b-7e.a5",      0x0000, 0x1000, CRC(ddd4158d) SHA1(9701e2d8a0226455dfbed650e58bb4be05918fe8) )
3201   ROM_LOAD( "b-8e.c5",      0x1000, 0x1000, CRC(b1331b4c) SHA1(fa1af406ecd6919b4846aea68d3edb70106f9273) )
3202
3203   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3204   ROM_LOAD( "prom.g9",      0x0000, 0x0020, CRC(b7ea00d7) SHA1(f658c6ac8123ae1e6b68ae513cc02c4d9d2b4e47) )
3205ROM_END
3206
32072779ROM_START( mimonscr )
32082780   ROM_REGION( 0x10000, REGION_CPU1, 0 )
32092781   ROM_LOAD( "mm1",          0x0000, 0x1000, CRC(0399a0c4) SHA1(8314124f9b535ce531663625d19cd3a76782ed3b) )
r2241r2242
33552927   ROM_LOAD( "turtles.clr",     0x0000, 0x0020, CRC(f3ef02dd) SHA1(09fd795170d7d30f101d579f57553da5ff3800ab) )
33562928ROM_END
33572929
3358GAME( 1981, scramble, 0,        fscramble,scramble, scramble,     ROT90, "Konami", "Scramble", GAME_SUPPORTS_SAVE )
3359GAME( 1981, scrambls, scramble, fscramble,scramble, scrambls,     ROT90, "[Konami] (Stern license)", "Scramble (Stern)", GAME_SUPPORTS_SAVE )
3360GAME( 1981, explorer, scramble, explorer, explorer, 0,            ROT90, "bootleg", "Explorer", GAME_SUPPORTS_SAVE )
3361GAME( 1981, strfbomb, scramble, scramble, strfbomb, scramble,     ROT90, "Omni", "Strafe Bomb", GAME_SUPPORTS_SAVE )
3362GAME( 1981, atlantis, 0,        scramble, atlantis, atlantis,     ROT90, "Comsoft", "Battle of Atlantis (set 1)", GAME_SUPPORTS_SAVE )
3363GAME( 1981, atlants2, atlantis, scramble, atlantis, atlantis,     ROT90, "Comsoft", "Battle of Atlantis (set 2)", GAME_SUPPORTS_SAVE )
3364GAME( 1980, theend,   0,        theend,   theend,   theend,       ROT90, "Konami", "The End", GAME_SUPPORTS_SAVE )
3365GAME( 1980, theends,  theend,   theend,   theend,   theend,       ROT90, "[Konami] (Stern license)", "The End (Stern)", GAME_SUPPORTS_SAVE )
3366GAME( 1981, froggers, frogger,  froggers, froggers, froggers,     ROT90, "bootleg", "Frog", GAME_SUPPORTS_SAVE )
3367GAME( 1981, frogf,    frogger,  frogf,    froggers, froggers,     ROT90, "Falcon", "Frogger (Falcon bootleg)", GAME_SUPPORTS_SAVE )
3368GAME( 1982, amidars,  amidar,   scramble, amidars,  atlantis,     ROT90, "Konami", "Amidar (Scramble hardware)", GAME_SUPPORTS_SAVE )
33692930GAME( 1982, triplep,  0,        triplep,  triplep,  scramble_ppi, ROT90, "KKI", "Triple Punch", GAME_SUPPORTS_SAVE )
33702931GAME( 1982, knockout, triplep,  triplep,  triplep,  scramble_ppi, ROT90, "KKK", "Knock Out!!", GAME_SUPPORTS_SAVE )
33712932GAME( 1981, mariner,  0,        mariner,  scramble, mariner,      ROT90, "Amenip", "Mariner", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE)
r2241r2242
33832944GAME( 1983, hunchbks, hunchbak, hunchbks, hunchbks, scramble_ppi, ROT90, "Century Electronics", "Hunchback (Scramble hardware)", GAME_SUPPORTS_SAVE )
33842945GAME( 1984, hncholms, huncholy, hncholms, hncholms, scramble_ppi, ROT90, "Century Electronics", "Hunchback Olympic (Scramble hardware)", GAME_SUPPORTS_SAVE )
33852946GAME( 1983, cavelon,  0,        cavelon,  cavelon,  cavelon,      ROT90, "Jetsoft", "Cavelon", GAME_SUPPORTS_SAVE )
3386GAME( 1983, sfx,      0,        sfx,      sfx,      sfx,          ORIENTATION_FLIP_X, "Nichibutsu", "SF-X", GAME_SUPPORTS_SAVE )
3387GAME( 1983, skelagon, sfx,      sfx,      sfx,      sfx,          ORIENTATION_FLIP_X, "Nichibutsu USA", "Skelagon", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE)
3388GAME( 198?, monsterz, 0,        monsterz, sfx,      monsterz,     ORIENTATION_FLIP_X, "Nihon", "Monster Zero", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
33892947GAME( 198?, mimonscr, mimonkey, mimonscr, mimonscr, mimonscr,     ROT90, "bootleg", "Mighty Monkey (bootleg on Scramble hardware)", GAME_SUPPORTS_SAVE )
3390GAME( 1982, scorpion, 0,      scorpion, scorpion, scorpion,     ROT90, "Zaccaria", "Scorpion (set 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE)
3391GAME( 1982, scrpiona, scorpion, scorpion, scorpion, scorpion,     ROT90, "Zaccaria", "Scorpion (set 2)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE)
3392GAME( 1982, scrpionb, scorpion, scorpion, scorpion, scorpion,     ROT90, "Zaccaria", "Scorpion (set 3)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE)
33932948GAME( 1983, ad2083,   0,        ad2083,   ad2083,   ad2083,       ROT90, "Midcoin", "A. D. 2083", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE)
33942949GAME( 1981, turpins,  turtles,  turpins,  turpins,  0,            ROT90, "[Sega] (bootleg)", "Turpin (bootleg on Scramble hardware)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) // haven't hooked up the sound CPU yet
src/mame/drivers/mogura.c
r2241r2242
11/* Mogura Desse */
22
33#include "driver.h"
4#include "deprecat.h"
54#include "sound/dac.h"
65
76static UINT8 *mogura_tileram;
r2241r2242
117116{
118117   mogura_gfxram[offset] = data ;
119118
120   decodechar(Machine->gfx[0], offset/16, mogura_gfxram);
119   decodechar(machine->gfx[0], offset/16, mogura_gfxram);
121120
122121   tilemap_mark_all_tiles_dirty(mogura_tilemap);
123122}
src/mame/drivers/system18.c
r2241r2242
8686
8787static WRITE16_HANDLER( sys18_refreshenable_w )
8888{
89   if(ACCESSING_LSB)
89   if(ACCESSING_BITS_0_7)
9090   {
9191      sys16_refreshenable = data & 0x02;
9292   }
r2241r2242
9494
9595static WRITE16_HANDLER( sys18_tilebank_w )
9696{
97   if(ACCESSING_LSB)
97   if(ACCESSING_BITS_0_7)
9898   {
9999      sys16_tile_bank0 = (data >> 0) & 0x0F;
100100      sys16_tile_bank1 = (data >> 4) & 0x0F;
r2241r2242
193193static UINT8* shdancbl_soundbank_ptr = NULL;      /* Pointer to currently selected portion of ROM */
194194
195195static WRITE16_HANDLER( sound_command_irq_w ){
196   if( ACCESSING_LSB ){
196   if( ACCESSING_BITS_0_7 ){
197197      soundlatch_w( machine,0,data&0xff );
198198      cpunum_set_input_line(machine, 1, 0, HOLD_LINE );
199199   }
r2241r2242
337337ADDRESS_MAP_END
338338
339339static WRITE16_HANDLER( sound_command_nmi_w ){
340   if( ACCESSING_LSB ){
340   if( ACCESSING_BITS_0_7 ){
341341      soundlatch_w( machine,0,data&0xff );
342342      cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
343343   }
r2241r2242
478478
479479static READ16_HANDLER( sys18_io_r )
480480{
481   if(ACCESSING_LSB)
481   if(ACCESSING_BITS_0_7)
482482   {
483483      switch(offset & 0x3000/2)
484484      {
r2241r2242
576576
577577static WRITE16_HANDLER( sys18_io_w )
578578{
579   if(ACCESSING_LSB)
579   if(ACCESSING_BITS_0_7)
580580   {
581581      switch(offset & 0x3000/2)
582582      {
src/mame/drivers/taitojc.c
r2241r2242
419419   {
420420      case 0x0:
421421      {
422         if (!(mem_mask & 0xff000000))
422         if (ACCESSING_BITS_24_31)
423423         {
424424            r |= ((readinputport(0) & 0x2) << 2) << 24;
425425         }
r2241r2242
427427      }
428428      case 0x1:
429429      {
430         if (!(mem_mask & 0xff000000))
430         if (ACCESSING_BITS_24_31)
431431         {
432432            UINT32 data = EEPROM_read_bit() & 1;
433433            data |= readinputport(0) & 0xfe;
r2241r2242
437437      }
438438      case 0x2:
439439      {
440         if (!(mem_mask & 0xff000000))
440         if (ACCESSING_BITS_24_31)
441441         {
442442            r |= readinputport(1) << 24;
443443         }
r2241r2242
445445      }
446446      case 0x3:
447447      {
448         if (!(mem_mask & 0xff000000))
448         if (ACCESSING_BITS_24_31)
449449         {
450450            r |= readinputport(2) << 24;
451451         }
r2241r2242
453453      }
454454      case 0x4:
455455      {
456         if (!(mem_mask & 0xff000000))
456         if (ACCESSING_BITS_24_31)
457457         {
458458            //r |= (mame_rand(Machine) & 0xff) << 24;
459459         }
r2241r2242
461461      }
462462      case 0x7:
463463      {
464         if (!(mem_mask & 0xff000000))
464         if (ACCESSING_BITS_24_31)
465465         {
466466            r |= readinputport(3) << 24;
467467         }
r2241r2242
483483   {
484484      case 0x3:
485485      {
486         if (!(mem_mask & 0xff000000))
486         if (ACCESSING_BITS_24_31)
487487         {
488488            EEPROM_set_clock_line(((data >> 24) & 0x08) ? ASSERT_LINE : CLEAR_LINE);
489489            EEPROM_write_bit(((data >> 24) & 0x04) ? 1 : 0);
r2241r2242
562562   UINT32 r = 0;
563563   int reg = offset * 4;
564564
565   if (!(mem_mask & 0xff000000))
565   if (ACCESSING_BITS_24_31)
566566   {
567567      r |= mcu_comm_reg_r(reg + 0) << 24;
568568   }
569   if (!(mem_mask & 0x00ff0000))
569   if (ACCESSING_BITS_16_23)
570570   {
571571      r |= mcu_comm_reg_r(reg + 1) << 16;
572572   }
573   if (!(mem_mask & 0x0000ff00))
573   if (ACCESSING_BITS_8_15)
574574   {
575575      r |= mcu_comm_reg_r(reg + 2) << 8;
576576   }
577   if (!(mem_mask & 0x000000ff))
577   if (ACCESSING_BITS_0_7)
578578   {
579579      r |= mcu_comm_reg_r(reg + 3) << 0;
580580   }
r2241r2242
586586{
587587   int reg = offset * 4;
588588
589   if (!(mem_mask & 0xff000000))
589   if (ACCESSING_BITS_24_31)
590590   {
591591      mcu_comm_reg_w(reg + 0, (data >> 24) & 0xff);
592592   }
593   if (!(mem_mask & 0x00ff0000))
593   if (ACCESSING_BITS_16_23)
594594   {
595595      mcu_comm_reg_w(reg + 1, (data >> 16) & 0xff);
596596   }
597   if (!(mem_mask & 0x0000ff00))
597   if (ACCESSING_BITS_8_15)
598598   {
599599      mcu_comm_reg_w(reg + 2, (data >> 8) & 0xff);
600600   }
601   if (!(mem_mask & 0x000000ff))
601   if (ACCESSING_BITS_0_7)
602602   {
603603      mcu_comm_reg_w(reg + 3, (data >> 0) & 0xff);
604604   }
r2241r2242
752752static WRITE32_HANDLER(dsp_shared_w)
753753{
754754   //mame_printf_debug("dsp_shared_ram: %08X, %04X at %08X\n", offset, data >> 16, activecpu_get_pc());
755   if (!(mem_mask & 0xff000000))
755   if (ACCESSING_BITS_24_31)
756756   {
757757      dsp_shared_ram[offset] &= 0x00ff;
758758      dsp_shared_ram[offset] |= (data >> 16) & 0xff00;
759759   }
760   if (!(mem_mask & 0x00ff0000))
760   if (ACCESSING_BITS_16_23)
761761   {
762762      dsp_shared_ram[offset] &= 0xff00;
763763      dsp_shared_ram[offset] |= (data >> 16) & 0x00ff;
src/mame/drivers/psikyo.c
r2241r2242
171171
172172static WRITE32_HANDLER( psikyo_soundlatch_w )
173173{
174   if (ACCESSING_LSB32)
174   if (ACCESSING_BITS_0_7)
175175      timer_call_after_resynch(NULL, data & 0xff, psikyo_soundlatch_callback);
176176}
177177
r2241r2242
181181
182182static WRITE32_HANDLER( s1945_soundlatch_w )
183183{
184   if (!(mem_mask & 0x00ff0000))
184   if (ACCESSING_BITS_16_23)
185185      timer_call_after_resynch(NULL, (data >> 16) & 0xff, psikyo_soundlatch_callback);
186186}
187187
r2241r2242
330330static WRITE32_HANDLER( paletteram32_xRRRRRGGGGGBBBBB_dword_w )
331331{
332332   paletteram16 = (UINT16 *)paletteram32;
333   if (ACCESSING_MSW32)
333   if (ACCESSING_BITS_16_31)
334334      paletteram16_xRRRRRGGGGGBBBBB_word_w(machine, offset*2, data >> 16, mem_mask >> 16);
335   if (ACCESSING_LSW32)
335   if (ACCESSING_BITS_0_15)
336336      paletteram16_xRRRRRGGGGGBBBBB_word_w(machine, offset*2+1, data, mem_mask);
337337}
338338
src/mame/drivers/playmark.c
r2241r2242
8181
8282static WRITE16_HANDLER( coinctrl_w )
8383{
84   if (ACCESSING_MSB)
84   if (ACCESSING_BITS_8_15)
8585   {
8686      coin_counter_w(0,data & 0x0100);
8787      coin_counter_w(1,data & 0x0200);
r2241r2242
151151
152152static WRITE16_HANDLER( wbeachvl_coin_eeprom_w )
153153{
154   if (ACCESSING_LSB)
154   if (ACCESSING_BITS_0_7)
155155   {
156156      /* bits 0-3 are coin counters? (only 0 used?) */
157157      coin_counter_w(0,data & 0x01);
r2241r2242
168168
169169static WRITE16_HANDLER( hotmind_coin_eeprom_w )
170170{
171   if (ACCESSING_LSB)
171   if (ACCESSING_BITS_0_7)
172172   {
173173      coin_counter_w(0,data & 0x20);
174174
r2241r2242
186186
187187static WRITE16_HANDLER( playmark_snd_command_w )
188188{
189   if (ACCESSING_LSB) {
189   if (ACCESSING_BITS_0_7) {
190190      playmark_snd_command = (data & 0xff);
191191      playmark_snd_flag = 1;
192192      cpu_yield();
src/mame/drivers/esd16.c
r2241r2242
6868
6969static WRITE16_HANDLER( esd16_sound_command_w )
7070{
71   if (ACCESSING_LSB)
71   if (ACCESSING_BITS_0_7)
7272   {
7373      soundlatch_w(machine,0,data & 0xff);
7474      cpunum_set_input_line(machine, 1,0,ASSERT_LINE);      // Generate an IRQ
r2241r2242
129129
130130static READ16_HANDLER( esd_eeprom_r )
131131{
132   if (ACCESSING_MSB)
132   if (ACCESSING_BITS_8_15)
133133   {
134134      return ((EEPROM_read_bit() & 0x01) << 15);
135135   }
r2241r2242
140140
141141static WRITE16_HANDLER( esd_eeprom_w )
142142{
143   if (ACCESSING_MSB)
143   if (ACCESSING_BITS_8_15)
144144   {
145145      // data line
146146      EEPROM_write_bit((data & 0x0400) >> 6);
src/mame/drivers/model3.c
r2241r2242
549549
550550static READ64_HANDLER( mpc105_addr_r )
551551{
552   if (!(mem_mask & U64(0xffffffff00000000)))
552   if (ACCESSING_BITS_32_63)
553553   {
554554      return (UINT64)mpc105_addr << 32;
555555   }
r2241r2242
558558
559559static WRITE64_HANDLER( mpc105_addr_w )
560560{
561   if (!(mem_mask & U64(0xffffffff00000000)))
561   if (ACCESSING_BITS_32_63)
562562   {
563563      UINT32 d = BYTE_REVERSE32((UINT32)(data >> 32));
564564      mpc105_addr = data >> 32;
r2241r2242
586586      mpc105_regs[(pci_reg/2)+0] = BYTE_REVERSE32((UINT32)(data));
587587      return;
588588   }
589   if (!(mem_mask & 0xffffffff))
589   if (ACCESSING_BITS_0_31)
590590   {
591591      pci_device_set_reg(pci_device, pci_reg, BYTE_REVERSE32((UINT32)data));
592592   }
r2241r2242
627627
628628static READ64_HANDLER( mpc106_addr_r )
629629{
630   if (!(mem_mask & U64(0xffffffff00000000)))
630   if (ACCESSING_BITS_32_63)
631631   {
632632      return (UINT64)mpc106_addr << 32;
633633   }
r2241r2242
636636
637637static WRITE64_HANDLER( mpc106_addr_w )
638638{
639   if (!(mem_mask & U64(0xffffffff00000000)))
639   if (ACCESSING_BITS_32_63)
640640   {
641641      UINT32 d = BYTE_REVERSE32((UINT32)(data >> 32));
642642
r2241r2242
662662      return ((UINT64)(BYTE_REVERSE32(mpc106_regs[(pci_reg/2)+1])) << 32) |
663663            ((UINT64)(BYTE_REVERSE32(mpc106_regs[(pci_reg/2)+0])));
664664   }
665   if (!(mem_mask & U64(0xffffffff00000000)))
665   if (ACCESSING_BITS_32_63)
666666   {
667667      return (UINT64)(BYTE_REVERSE32(pci_device_get_reg(pci_device, pci_reg))) << 32;
668668   }
r2241r2242
679679      mpc106_regs[(pci_reg/2)+0] = BYTE_REVERSE32((UINT32)(data));
680680      return;
681681   }
682   if (!(mem_mask & 0xffffffff))
682   if (ACCESSING_BITS_0_31)
683683   {
684684      pci_device_set_reg(pci_device, pci_reg, BYTE_REVERSE32((UINT32)data));
685685   }
r2241r2242
723723{
724724   int reg = offset*8;
725725   UINT64 r = 0;
726   if (!(mem_mask & U64(0xff00000000000000))) {
726   if (ACCESSING_BITS_56_63) {
727727      r |= (UINT64)lsi53c810_reg_r(reg+0) << 56;
728728   }
729   if (!(mem_mask & U64(0x00ff000000000000))) {
729   if (ACCESSING_BITS_48_55) {
730730      r |= (UINT64)lsi53c810_reg_r(reg+1) << 48;
731731   }
732   if (!(mem_mask & U64(0x0000ff0000000000))) {
732   if (ACCESSING_BITS_40_47) {
733733      r |= (UINT64)lsi53c810_reg_r(reg+2) << 40;
734734   }
735   if (!(mem_mask & U64(0x000000ff00000000))) {
735   if (ACCESSING_BITS_32_39) {
736736      r |= (UINT64)lsi53c810_reg_r(reg+3) << 32;
737737   }
738   if (!(mem_mask & U64(0x00000000ff000000))) {
738   if (ACCESSING_BITS_24_31) {
739739      r |= (UINT64)lsi53c810_reg_r(reg+4) << 24;
740740   }
741   if (!(mem_mask & U64(0x0000000000ff0000))) {
741   if (ACCESSING_BITS_16_23) {
742742      r |= (UINT64)lsi53c810_reg_r(reg+5) << 16;
743743   }
744   if (!(mem_mask & U64(0x000000000000ff00))) {
744   if (ACCESSING_BITS_8_15) {
745745      r |= (UINT64)lsi53c810_reg_r(reg+6) << 8;
746746   }
747   if (!(mem_mask & U64(0x00000000000000ff))) {
747   if (ACCESSING_BITS_0_7) {
748748      r |= (UINT64)lsi53c810_reg_r(reg+7) << 0;
749749   }
750750
r2241r2242
754754static WRITE64_HANDLER(scsi_w)
755755{
756756   int reg = offset*8;
757   if (!(mem_mask & U64(0xff00000000000000))) {
757   if (ACCESSING_BITS_56_63) {
758758      lsi53c810_reg_w(reg+0, data >> 56);
759759   }
760   if (!(mem_mask & U64(0x00ff000000000000))) {
760   if (ACCESSING_BITS_48_55) {
761761      lsi53c810_reg_w(reg+1, data >> 48);
762762   }
763   if (!(mem_mask & U64(0x0000ff0000000000))) {
763   if (ACCESSING_BITS_40_47) {
764764      lsi53c810_reg_w(reg+2, data >> 40);
765765   }
766   if (!(mem_mask & U64(0x000000ff00000000))) {
766   if (ACCESSING_BITS_32_39) {
767767      lsi53c810_reg_w(reg+3, data >> 32);
768768   }
769   if (!(mem_mask & U64(0x00000000ff000000))) {
769   if (ACCESSING_BITS_24_31) {
770770      lsi53c810_reg_w(reg+4, data >> 24);
771771   }
772   if (!(mem_mask & U64(0x0000000000ff0000))) {
772   if (ACCESSING_BITS_16_23) {
773773      lsi53c810_reg_w(reg+5, data >> 16);
774774   }
775   if (!(mem_mask & U64(0x000000000000ff00))) {
775   if (ACCESSING_BITS_8_15) {
776776      lsi53c810_reg_w(reg+6, data >> 8);
777777   }
778   if (!(mem_mask & U64(0x00000000000000ff))) {
778   if (ACCESSING_BITS_0_7) {
779779      lsi53c810_reg_w(reg+7, data >> 0);
780780   }
781781}
r2241r2242
810810      case 1:
811811         return (dma_irq << 24) | (dma_endian << 8);
812812      case 2:
813         if(!(mem_mask & U64(0x00000000ffffffff))) {
813         if(ACCESSING_BITS_0_31) {
814814            return dma_data;
815815         }
816816         break;
r2241r2242
824824   switch(offset)
825825   {
826826      case 0:
827         if(!(mem_mask & U64(0xffffffff00000000))) {      /* DMA source address */
827         if(ACCESSING_BITS_32_63) {      /* DMA source address */
828828            dma_source = BYTE_REVERSE32((UINT32)(data >> 32));
829829            return;
830830         }
831         if(!(mem_mask & U64(0x00000000ffffffff))) {      /* DMA destination address */
831         if(ACCESSING_BITS_0_31) {      /* DMA destination address */
832832            dma_dest = BYTE_REVERSE32((UINT32)(data));
833833            return;
834834         }
835835         break;
836836      case 1:
837         if(!(mem_mask & U64(0xffffffff00000000)))      /* DMA length */
837         if(ACCESSING_BITS_32_63)      /* DMA length */
838838         {
839839            int length = BYTE_REVERSE32((UINT32)(data >> 32)) * 4;
840840            if (dma_endian & 0x80)
r2241r2242
849849            scsi_irq_callback();
850850            return;
851851         }
852         else if(!(mem_mask & U64(0x0000000000ff0000)))
852         else if(ACCESSING_BITS_16_23)
853853         {
854854            if(data & 0x10000) {
855855               dma_irq &= ~0x1;
856856            }
857857            return;
858858         }
859         else if(!(mem_mask & U64(0x000000000000ff00)))
859         else if(ACCESSING_BITS_8_15)
860860         {
861861            dma_endian = (data >> 8) & 0xff;
862862            return;
863863         }
864864         break;
865865      case 2:
866         if(!(mem_mask & U64(0xffffffff00000000))) {      /* DMA command */
866         if(ACCESSING_BITS_32_63) {      /* DMA command */
867867            UINT32 cmd = BYTE_REVERSE32((UINT32)(data >> 32));
868868            if(cmd & 0x20000000) {
869869               dma_data = BYTE_REVERSE32(real3d_device_id);   /* (PCI Vendor & Device ID) */
r2241r2242
874874            }
875875            return;
876876         }
877         if(!(mem_mask & U64(0x00000000ffffffff))) {      /* ??? */
877         if(ACCESSING_BITS_0_31) {      /* ??? */
878878            dma_data = 0xffffffff;
879879            return;
880880         }
r2241r2242
10151015   model3_tap_reset();
10161016
10171017   if(step < 0x20) {
1018      if( mame_stricmp(Machine->gamedrv->name, "vs215") == 0 ||
1019         mame_stricmp(Machine->gamedrv->name, "vs29815") == 0 ||
1020         mame_stricmp(Machine->gamedrv->name, "bass") == 0 )
1018      if( mame_stricmp(machine->gamedrv->name, "vs215") == 0 ||
1019         mame_stricmp(machine->gamedrv->name, "vs29815") == 0 ||
1020         mame_stricmp(machine->gamedrv->name, "bass") == 0 )
10211021      {
10221022         mpc106_init();
10231023      } else {
r2241r2242
10501050   switch( offset )
10511051   {
10521052      case 0:
1053         if (!(mem_mask & U64(0xff00000000000000)))
1053         if (ACCESSING_BITS_56_63)
10541054         {
10551055            return (UINT64)model3_controls_bank << 56;
10561056         }
1057         else if (!(mem_mask & 0xff000000))
1057         else if (ACCESSING_BITS_24_31)
10581058         {
10591059            if(model3_controls_bank & 0x1) {
10601060               eeprom_bit = EEPROM_read_bit() << 5;
r2241r2242
10671067         break;
10681068
10691069      case 1:
1070         if (!(mem_mask & U64(0xff00000000000000)))
1070         if (ACCESSING_BITS_56_63)
10711071         {
10721072            return (UINT64)readinputport(2) << 56;
10731073         }
1074         else if (!(mem_mask & 0xff000000))
1074         else if (ACCESSING_BITS_24_31)
10751075         {
10761076            return readinputport(3) << 24;
10771077         }
r2241r2242
10871087         return U64(0xffffffffffffffff);
10881088
10891089      case 5:
1090         if (!(mem_mask & 0xff000000))               /* Serial comm RX FIFO 1 */
1090         if (ACCESSING_BITS_24_31)               /* Serial comm RX FIFO 1 */
10911091         {
10921092            return (UINT64)model3_serial_fifo1 << 24;
10931093         }
10941094         break;
10951095
10961096      case 6:
1097         if (!(mem_mask & U64(0xff00000000000000)))      /* Serial comm RX FIFO 2 */
1097         if (ACCESSING_BITS_56_63)      /* Serial comm RX FIFO 2 */
10981098         {
10991099            return (UINT64)model3_serial_fifo2 << 56;
11001100         }
1101         else if (!(mem_mask & 0xff000000))            /* Serial comm full/empty flags */
1101         else if (ACCESSING_BITS_24_31)            /* Serial comm full/empty flags */
11021102         {
11031103            return 0x0c << 24;
11041104         }
11051105         break;
11061106
11071107      case 7:
1108         if (!(mem_mask & 0xff000000))      /* ADC Data read */
1108         if (ACCESSING_BITS_24_31)      /* ADC Data read */
11091109         {
11101110            UINT8 adc_data = readinputport(5 + adc_channel);
11111111            adc_channel++;
r2241r2242
11241124   switch(offset)
11251125   {
11261126      case 0:
1127         if (!(mem_mask & U64(0xff00000000000000)))
1127         if (ACCESSING_BITS_56_63)
11281128         {
11291129            int reg = (data >> 56) & 0xff;
11301130            EEPROM_write_bit((reg & 0x20) ? 1 : 0);
r2241r2242
11431143         return;
11441144
11451145      case 4:
1146         if (!(mem_mask & U64(0xff00000000000000)))   /* Port 4 direction */
1146         if (ACCESSING_BITS_56_63)   /* Port 4 direction */
11471147         {
11481148
11491149         }
1150         if (!(mem_mask & 0xff000000))            /* Serial comm TX FIFO 1 */
1150         if (ACCESSING_BITS_24_31)            /* Serial comm TX FIFO 1 */
11511151         {                                 /* Used for reading the light gun in Lost World */
11521152            switch(data >> 24)
11531153            {
r2241r2242
11981198         return;
11991199
12001200      case 5:
1201         if (!(mem_mask & U64(0xff00000000000000)))   /* Serial comm TX FIFO 2 */
1201         if (ACCESSING_BITS_56_63)   /* Serial comm TX FIFO 2 */
12021202         {
12031203            model3_serial_fifo2 = data >> 56;
12041204            return;
r2241r2242
12061206         break;
12071207
12081208      case 7:
1209         if (!(mem_mask & U64(0xff000000)))   /* ADC Channel selection */
1209         if (ACCESSING_BITS_24_31)   /* ADC Channel selection */
12101210         {
12111211            adc_channel = (data >> 24) & 0xf;
12121212         }
r2241r2242
12211221   switch (offset)
12221222   {
12231223      case 0x08/8:
1224         if (!(mem_mask & U64(0xff00000000000000)))
1224         if (ACCESSING_BITS_56_63)
12251225         {
12261226            return ((UINT64)model3_crom_bank << 56);
12271227         }
12281228         break;
12291229
12301230      case 0x10/8:
1231         if (!(mem_mask & U64(0xff00000000000000)))
1231         if (ACCESSING_BITS_56_63)
12321232         {
12331233            UINT64 res = model3_tap_read();
12341234
12351235            return res<<61;
12361236         }
1237         else if (!(mem_mask & 0xff000000))
1237         else if (ACCESSING_BITS_24_31)
12381238         {
12391239            return (model3_irq_enable<<24);
12401240         }
r2241r2242
12541254   switch (offset)
12551255   {
12561256      case 0x10/8:
1257         if (!(mem_mask & 0xff000000))
1257         if (ACCESSING_BITS_24_31)
12581258         {
12591259            model3_irq_enable = (data>>24)&0xff;
12601260         }
12611261         else logerror("m3_sys: unknown mask on IRQen write\n");
12621262         break;
12631263      case 0x08/8:
1264         if (!(mem_mask & U64(0xff00000000000000)))
1264         if (ACCESSING_BITS_56_63)
12651265         {
12661266            model3_crom_bank = data >> 56;
12671267
r2241r2242
12691269            data = (~data) & 0xf;
12701270            memory_set_bankptr( 1, memory_region( REGION_USER1 ) + 0x800000 + (data * 0x800000)); /* banked CROM */
12711271         }
1272         if (!(mem_mask & 0xff000000))
1272         if (ACCESSING_BITS_24_31)
12731273         {
12741274            data >>= 24;
12751275            model3_tap_write(
r2241r2242
12861286static READ64_HANDLER( model3_rtc_r )
12871287{
12881288   UINT64 r = 0;
1289   if(!(mem_mask & U64(0xff00000000000000))) {
1289   if(ACCESSING_BITS_56_63) {
12901290      r |= (UINT64)rtc72421_r(machine, (offset*2)+0, (UINT32)(mem_mask >> 32)) << 32;
12911291   }
1292   if(!(mem_mask & U64(0x00000000ff000000))) {
1292   if(ACCESSING_BITS_24_31) {
12931293      r |= (UINT64)rtc72421_r(machine, (offset*2)+1, (UINT32)(mem_mask));
12941294   }
12951295   return r;
r2241r2242
12971297
12981298static WRITE64_HANDLER( model3_rtc_w )
12991299{
1300   if(!(mem_mask & U64(0xff00000000000000))) {
1300   if(ACCESSING_BITS_56_63) {
13011301      rtc72421_w(machine, (offset*2)+0, (UINT32)(data >> 32), (UINT32)(mem_mask >> 32));
13021302   }
1303   if(!(mem_mask & U64(0x00000000ff000000))) {
1303   if(ACCESSING_BITS_24_31) {
13041304      rtc72421_w(machine, (offset*2)+1, (UINT32)(data), (UINT32)(mem_mask));
13051305   }
13061306}
r2241r2242
14201420      case 0x00/8:   return 0;      /* status */
14211421      case 0x1c/8:               /* security board data read */
14221422      {
1423         if (mame_stricmp(Machine->gamedrv->name, "vs299") == 0 ||
1424            mame_stricmp(Machine->gamedrv->name, "vs2v991") == 0)
1423         if (mame_stricmp(machine->gamedrv->name, "vs299") == 0 ||
1424            mame_stricmp(machine->gamedrv->name, "vs2v991") == 0)
14251425         {
14261426            return (UINT64)vs299_prot_data[prot_data_ptr++] << 48;
14271427         }
1428         else if (mame_stricmp(Machine->gamedrv->name, "swtrilgy") == 0 ||
1429                mame_stricmp(Machine->gamedrv->name, "swtrilga") == 0)
1428         else if (mame_stricmp(machine->gamedrv->name, "swtrilgy") == 0 ||
1429                mame_stricmp(machine->gamedrv->name, "swtrilga") == 0)
14301430         {
14311431            UINT64 data = (UINT64)swt_prot_data[prot_data_ptr++] << 16;
14321432            if (prot_data_ptr > 0x38)
r2241r2242
14351435            }
14361436            return data;
14371437         }
1438         else if (mame_stricmp(Machine->gamedrv->name, "fvipers2") == 0)
1438         else if (mame_stricmp(machine->gamedrv->name, "fvipers2") == 0)
14391439         {
14401440            UINT64 data = (UINT64)fvipers2_prot_data[prot_data_ptr++] << 16;
14411441            if (prot_data_ptr >= 0x41)
r2241r2242
14441444            }
14451445            return data;
14461446         }
1447         else if (mame_stricmp(Machine->gamedrv->name, "spikeout") == 0 ||
1448                mame_stricmp(Machine->gamedrv->name, "spikeofe") == 0)
1447         else if (mame_stricmp(machine->gamedrv->name, "spikeout") == 0 ||
1448                mame_stricmp(machine->gamedrv->name, "spikeofe") == 0)
14491449         {
14501450            UINT64 data = (UINT64)spikeout_prot_data[prot_data_ptr++] << 16;
14511451            if (prot_data_ptr >= 0x55)
r2241r2242
14541454            }
14551455            return data;
14561456         }
1457         else if (mame_stricmp(Machine->gamedrv->name, "eca") == 0)
1457         else if (mame_stricmp(machine->gamedrv->name, "eca") == 0)
14581458         {
14591459            UINT64 data = (UINT64)eca_prot_data[prot_data_ptr++] << 16;
14601460            if (prot_data_ptr >= 0x31)
r2241r2242
14741474
14751475static WRITE64_HANDLER(daytona2_rombank_w)
14761476{
1477   if (!(mem_mask & U64(0xff00000000000000)))
1477   if (ACCESSING_BITS_56_63)
14781478   {
14791479      data >>= 56;
14801480      data = (~data) & 0xf;
r2241r2242
40964096
40974097
40984098   MDRV_SCREEN_ADD("main", RASTER)
4099   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
4099   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
41004100   MDRV_SCREEN_REFRESH_RATE(60)
41014101   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
41024102   MDRV_SCREEN_SIZE(496, 384)
41034103   MDRV_SCREEN_VISIBLE_AREA(0, 495, 0, 383)
41044104
4105   MDRV_PALETTE_LENGTH(65536)
4105   MDRV_PALETTE_LENGTH(32768)
4106   MDRV_PALETTE_INIT(RRRRR_GGGGG_BBBBB)
41064107
41074108   MDRV_VIDEO_START(model3)
41084109   MDRV_VIDEO_UPDATE(model3)
r2241r2242
41334134
41344135
41354136   MDRV_SCREEN_ADD("main", RASTER)
4136   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
4137   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
41374138   MDRV_SCREEN_REFRESH_RATE(60)
41384139   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
41394140   MDRV_SCREEN_SIZE(496, 384)
41404141   MDRV_SCREEN_VISIBLE_AREA(0, 495, 0, 383)
41414142
4142   MDRV_PALETTE_LENGTH(65536)
4143   MDRV_PALETTE_LENGTH(32768)
4144   MDRV_PALETTE_INIT(RRRRR_GGGGG_BBBBB)
41434145
41444146   MDRV_VIDEO_START(model3)
41454147   MDRV_VIDEO_UPDATE(model3)
r2241r2242
41694171
41704172
41714173   MDRV_SCREEN_ADD("main", RASTER)
4172   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
4174   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
41734175   MDRV_SCREEN_REFRESH_RATE(60)
41744176   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
41754177   MDRV_SCREEN_SIZE(496, 384)
41764178   MDRV_SCREEN_VISIBLE_AREA(0, 495, 0, 383)
41774179
4178   MDRV_PALETTE_LENGTH(65536)
4180   MDRV_PALETTE_LENGTH(32768)
4181   MDRV_PALETTE_INIT(RRRRR_GGGGG_BBBBB)
41794182
41804183   MDRV_VIDEO_START(model3)
41814184   MDRV_VIDEO_UPDATE(model3)
r2241r2242
42054208
42064209
42074210   MDRV_SCREEN_ADD("main", RASTER)
4208   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
4211   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
42094212   MDRV_SCREEN_REFRESH_RATE(60)
42104213   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
42114214   MDRV_SCREEN_SIZE(496, 384)
42124215   MDRV_SCREEN_VISIBLE_AREA(0, 495, 0, 383)
42134216
4214   MDRV_PALETTE_LENGTH(65536)
4217   MDRV_PALETTE_LENGTH(32768)
4218   MDRV_PALETTE_INIT(RRRRR_GGGGG_BBBBB)
42154219
42164220   MDRV_VIDEO_START(model3)
42174221   MDRV_VIDEO_UPDATE(model3)
src/mame/drivers/namcos21.c
r2241r2242
985985
986986static WRITE16_HANDLER( pointram_data_w )
987987{
988   if( ACCESSING_LSB )
988   if( ACCESSING_BITS_0_7 )
989989   {
990990//      if( (pointram_idx%6)==0 ) logerror("\n" );
991991//      logerror( " %02x", data );
r2241r2242
10031003}
10041004static WRITE16_HANDLER( namcos21_depthcue_w )
10051005{
1006   if( ACCESSING_LSB )
1006   if( ACCESSING_BITS_0_7 )
10071007   {
10081008      int bank = (pointram_control&0x20)?1:0;
10091009      namcos21_depthcue[bank][offset] = data;
r2241r2242
10211021
10221022static WRITE16_HANDLER( namcos2_68k_dualportram_word_w )
10231023{
1024   if( ACCESSING_LSB )
1024   if( ACCESSING_BITS_0_7 )
10251025   {
10261026      mpDualPortRAM[offset] = data&0xff;
10271027   }
src/mame/drivers/pgm.c
r2241r2242
404404static WRITE16_HANDLER ( z80_ram_w )
405405{
406406   int pc = activecpu_get_pc();
407   if(ACCESSING_MSB)
407   if(ACCESSING_BITS_8_15)
408408      z80_mainram[offset*2] = data >> 8;
409   if(ACCESSING_LSB)
409   if(ACCESSING_BITS_0_7)
410410      z80_mainram[offset*2+1] = data;
411411
412412   if(pc != 0xf12 && pc != 0xde2 && pc != 0x100c50 && pc != 0x100b20)
r2241r2242
443443
444444static WRITE16_HANDLER ( m68k_l1_w )
445445{
446   if(ACCESSING_LSB) {
446   if(ACCESSING_BITS_0_7) {
447447      if (PGMLOGERROR) logerror("SL 1 m68.w %02x (%06x) IRQ\n", data & 0xff, activecpu_get_pc());
448448      soundlatch_w(machine, 0, data);
449449      cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE );
r2241r2242
755755
756756static WRITE32_HANDLER( kovsh_arm7_protlatch_w )
757757{
758   if (!(mem_mask & 0xffff0000))
758   if (ACCESSING_BITS_16_31)
759759   {
760760      kovsh_highlatch = data>>16;
761761   }
762   if (!(mem_mask & 0x0000ffff))
762   if (ACCESSING_BITS_0_15)
763763   {
764764      kovsh_lowlatch = data;
765765   }
src/mame/drivers/gameplan.c
r2241r2242
8080
8181static WRITE8_HANDLER( io_select_w )
8282{
83   gameplan_state *state = Machine->driver_data;
83   gameplan_state *state = machine->driver_data;
8484
8585   switch (data)
8686   {
r2241r2242
9696
9797static READ8_HANDLER( io_port_r )
9898{
99   gameplan_state *state = Machine->driver_data;
99   gameplan_state *state = machine->driver_data;
100100
101101   return readinputport(state->current_port);
102102}
r2241r2242
127127
128128static WRITE8_HANDLER( audio_reset_w )
129129{
130   cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
130   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
131131}
132132
133133
134134static WRITE8_HANDLER( audio_cmd_w )
135135{
136   gameplan_state *state = Machine->driver_data;
136   gameplan_state *state = machine->driver_data;
137137
138138   state->audio_cmd = data & 0x7f;
139139}
src/mame/drivers/beathead.c
r2241r2242
310310
311311static WRITE32_HANDLER( sound_data_w )
312312{
313   if (ACCESSING_LSB32)
313   if (ACCESSING_BITS_0_7)
314314      atarigen_sound_w(machine,offset, data, mem_mask);
315315}
316316
src/mame/drivers/xexex.c
r2241r2242
252252
253253static WRITE16_HANDLER( sound_cmd1_w )
254254{
255   if(ACCESSING_LSB)
255   if(ACCESSING_BITS_0_7)
256256   {
257257      // anyone knows why 0x1a keeps lurking the sound queue in the world version???
258258      if (xexex_strip0x1a)
r2241r2242
264264
265265static WRITE16_HANDLER( sound_cmd2_w )
266266{
267   if (ACCESSING_LSB)
267   if (ACCESSING_BITS_0_7)
268268   {
269269      soundlatch2_w(machine, 0, data & 0xff);
270270   }
r2241r2242
377377   AM_RANGE(0x182000, 0x183fff) AM_READWRITE(K056832_ram_word_r, K056832_ram_word_w)
378378   AM_RANGE(0x190000, 0x191fff) AM_READWRITE(K056832_rom_word_r, SMH_ROM)      // Passthrough to tile roms
379379   AM_RANGE(0x1a0000, 0x1a1fff) AM_READ(K053250_0_rom_r)
380   AM_RANGE(0x1b0000, 0x1b1fff) AM_READWRITE(SMH_RAM, paletteram16_xrgb_word_be_w) AM_BASE(&paletteram16)
380   AM_RANGE(0x1b0000, 0x1b1fff) AM_RAM AM_WRITE(paletteram16_xrgb_word_be_w) AM_BASE(&paletteram16)
381381
382382#if XE_DEBUG
383383   AM_RANGE(0x0c0000, 0x0c003f) AM_READ(K056832_word_r)
src/mame/drivers/ironhors.c
r2241r2242
1010#include "deprecat.h"
1111#include "cpu/m6809/m6809.h"
1212#include "sound/2203intf.h"
13#include "sound/flt_rc.h"
13#include "sound/discrete.h"
1414
15
1615extern UINT8 *ironhors_scroll;
1716static UINT8 *ironhors_interrupt_enable;
1817
r2241r2242
4847
4948static WRITE8_HANDLER( ironhors_filter_w )
5049{
51   if (sndti_exists(SOUND_FILTER_RC, 2))
50   if (sndti_exists(SOUND_DISCRETE, 2))
5251   {
53      filter_rc_set_RC(0,FLT_RC_LOWPASS, 1000,2200,1000,data & 0x04 ? CAP_N(220) : 0); /* YM2203-SSG-A */
54      filter_rc_set_RC(1,FLT_RC_LOWPASS, 1000,2200,1000,data & 0x02 ? CAP_N(220) : 0); /* YM2203-SSG-B */
55      filter_rc_set_RC(2,FLT_RC_LOWPASS, 1000,2200,1000,data & 0x01 ? CAP_N(220) : 0); /* YM2203-SSG-C */
52      discrete_sound_w(machine, NODE_11, (data & 0x04) >> 2);
53      discrete_sound_w(machine, NODE_12, (data & 0x02) >> 1);
54      discrete_sound_w(machine, NODE_13, (data & 0x01) >> 0);
5655   }
5756}
5857
59
6058static ADDRESS_MAP_START( master_map, ADDRESS_SPACE_PROGRAM, 8 )
6159   AM_RANGE(0x0000, 0x0002) AM_RAM
6260   AM_RANGE(0x0003, 0x0003) AM_RAM AM_WRITE(ironhors_charbank_w)
r2241r2242
382380   GFXDECODE_ENTRY( REGION_GFX2, 0, farwest_spritelayout2,16*8*16, 16*8 )  /* to handle 8x8 sprites */
383381GFXDECODE_END
384382
383static const discrete_mixer_desc ironhors_mixer_desc =
384   {DISC_MIXER_IS_RESISTOR,
385      {RES_K(2.2), RES_K(2.2), RES_K(2.2)},
386      {0,0,0,0,0,0},   /* no variable resistors   */
387      {0,0,0,0,0,0},  /* no node capacitors      */
388      0, RES_K(1),   /* RF */
389      0,
390      0,
391      0, 1};
385392
393static const discrete_mixer_desc ironhors_mixer_desc_final =
394   {DISC_MIXER_IS_RESISTOR,
395      {RES_K(0.5), RES_K(1)},
396      {0,0,0,0,0,0},   /* no variable resistors   */
397      {CAP_U(4.7), CAP_U(4.7)},  /* node capacitors         */
398      0, RES_K(1),   /* RF */
399      0,
400      0,
401      0, 1};
402
403static DISCRETE_SOUND_START( ironhors )
404
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)
408
409   DISCRETE_INPUTX_STREAM(NODE_04, 3, 1.0, 0)
410
411   DISCRETE_INPUT_DATA(NODE_11)
412   DISCRETE_INPUT_DATA(NODE_12)
413   DISCRETE_INPUT_DATA(NODE_13)
414
415   DISCRETE_RCFILTER_SW(NODE_21, 1, NODE_01, NODE_11, 1000, CAP_U(0.22), 0, 0, 0)
416   DISCRETE_RCFILTER_SW(NODE_22, 1, NODE_02, NODE_12, 1000, CAP_U(0.22), 0, 0, 0)
417   DISCRETE_RCFILTER_SW(NODE_23, 1, NODE_03, NODE_13, 1000, CAP_U(0.22), 0, 0, 0)
418
419   DISCRETE_MIXER3(NODE_30, 1, NODE_21, NODE_22, NODE_23, &ironhors_mixer_desc)
420
421   DISCRETE_RCFILTER(NODE_31,1,NODE_04, RES_K(1), CAP_N(33) )
422   DISCRETE_MIXER2(NODE_33, 1, NODE_30, NODE_31, &ironhors_mixer_desc_final)
423
424   DISCRETE_OUTPUT(NODE_33, 5.0 )
425
426DISCRETE_SOUND_END
427
386428static const struct YM2203interface ym2203_interface =
387429{
388430   0,
r2241r2242
422464   /* sound hardware */
423465   MDRV_SPEAKER_STANDARD_MONO("mono")
424466
425   MDRV_SOUND_ADD(YM2203, 18432000/6)
467   MDRV_SOUND_ADD_TAG("ym2203", YM2203, 18432000/6)
426468   MDRV_SOUND_CONFIG(ym2203_interface)
427   MDRV_SOUND_ROUTE(0, "filter1", 0.40)
428   MDRV_SOUND_ROUTE(1, "filter2", 0.40)
429   MDRV_SOUND_ROUTE(2, "filter3", 0.40)
430   MDRV_SOUND_ROUTE(3, "mono", 0.40)
431469
432   MDRV_SOUND_ADD_TAG("filter1", FILTER_RC, 0)
470   MDRV_SOUND_ROUTE_EX(0, "disc_ih", 1.0, 0)
471   MDRV_SOUND_ROUTE_EX(1, "disc_ih", 1.0, 1)
472   MDRV_SOUND_ROUTE_EX(2, "disc_ih", 1.0, 2)
473   MDRV_SOUND_ROUTE_EX(3, "disc_ih", 1.0, 3)
474
475   MDRV_SOUND_ADD_TAG("disc_ih", DISCRETE, 0)
476   MDRV_SOUND_CONFIG_DISCRETE(ironhors)
433477   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
434   MDRV_SOUND_ADD_TAG("filter2", FILTER_RC, 0)
435   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
436   MDRV_SOUND_ADD_TAG("filter3", FILTER_RC, 0)
437   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
478
438479MACHINE_DRIVER_END
439480
440481
src/mame/drivers/konamigq.c
r2241r2242
6262
6363static WRITE32_HANDLER( soundr3k_w )
6464{
65   if( ACCESSING_MSW32 )
65   if( ACCESSING_BITS_16_31 )
6666   {
6767      sndto000[ ( offset << 1 ) + 1 ] = data >> 16;
6868      if( offset == 3 )
r2241r2242
7070         cpunum_set_input_line(Machine, 1, 1, HOLD_LINE );
7171      }
7272   }
73   if( ACCESSING_LSW32 )
73   if( ACCESSING_BITS_0_15 )
7474   {
7575      sndto000[ offset << 1 ] = data;
7676   }
r2241r2242
155155
156156static WRITE32_HANDLER( pcmram_w )
157157{
158   if( ACCESSING_LSB32 )
158   if( ACCESSING_BITS_0_7 )
159159   {
160160      m_p_n_pcmram[ offset << 1 ] = data;
161161   }
162   if( ( mem_mask & 0x00ff0000 ) == 0 )
162   if( ACCESSING_BITS_16_23 )
163163   {
164164      m_p_n_pcmram[ ( offset << 1 ) + 1 ] = data >> 16;
165165   }
r2241r2242
223223   UINT16 data;
224224
225225   data = 0;
226   if( ACCESSING_LSB16 )
226   if( ACCESSING_BITS_0_7 )
227227   {
228228      data |= K054539_1_r( machine, offset );
229229   }
230   if( ACCESSING_MSB16 )
230   if( ACCESSING_BITS_8_15 )
231231   {
232232      data |= K054539_0_r( machine, offset ) << 8;
233233   }
r2241r2242
236236
237237static WRITE16_HANDLER( dual539_w )
238238{
239   if( ACCESSING_LSB16 )
239   if( ACCESSING_BITS_0_7 )
240240   {
241241      K054539_1_w( machine, offset, data );
242242   }
243   if( ACCESSING_MSB16 )
243   if( ACCESSING_BITS_8_15 )
244244   {
245245      K054539_0_w( machine, offset, data >> 8 );
246246   }
src/mame/drivers/cps3.c
r2241r2242
13871387
13881388static WRITE32_HANDLER( cram_bank_w )
13891389{
1390   if (ACCESSING_LSB)
1390   if (ACCESSING_BITS_0_7)
13911391   {
13921392      // this seems to be related to accesses to the 0x04100000 region
13931393      if (cram_bank != data)
r2241r2242
14451445
14461446   if(DEBUG_PRINTF) printf("gfxflash_r\n");
14471447
1448   if (!(mem_mask & 0xff000000))   // GFX Flash 1
1448   if (ACCESSING_BITS_24_31)   // GFX Flash 1
14491449   {
14501450      logerror("read GFX flash chip %d addr %02x\n", flash1-8, (offset<<1));
14511451      result |= intelflash_read(flash1, (offset<<1) ) << 24;
14521452   }
1453   if (!(mem_mask & 0x00ff0000))   // GFX Flash 2
1453   if (ACCESSING_BITS_16_23)   // GFX Flash 2
14541454   {
14551455      logerror("read GFX flash chip %d addr %02x\n", flash2-8, (offset<<1));
14561456      result |= intelflash_read(flash2, (offset<<1) ) << 16;
14571457   }
1458   if (!(mem_mask & 0x0000ff00))   // GFX Flash 1
1458   if (ACCESSING_BITS_8_15)   // GFX Flash 1
14591459   {
14601460      logerror("read GFX flash chip %d addr %02x\n", flash1-8, (offset<<1)+1);
14611461      result |= intelflash_read(flash1, (offset<<1)+0x1 ) << 8;
14621462   }
1463   if (!(mem_mask & 0x000000ff))   // GFX Flash 2
1463   if (ACCESSING_BITS_0_7)   // GFX Flash 2
14641464   {
14651465      logerror("read GFX flash chip %d addr %02x\n", flash2-8, (offset<<1)+1);
14661466      result |= intelflash_read(flash2, (offset<<1)+0x1 ) << 0;
r2241r2242
14851485//  if(DEBUG_PRINTF) printf("cps3_gfxflash_w %08x %08x %08x\n", offset *2, data, mem_mask);
14861486
14871487
1488   if (!(mem_mask & 0xff000000))   // GFX Flash 1
1488   if (ACCESSING_BITS_24_31)   // GFX Flash 1
14891489   {
14901490      command = (data >> 24) & 0xff;
14911491      logerror("write to GFX flash chip %d addr %02x cmd %02x\n", flash1-8, (offset<<1), command);
14921492      intelflash_write(flash1, (offset<<1), command);
14931493   }
1494   if (!(mem_mask & 0x00ff0000))   // GFX Flash 2
1494   if (ACCESSING_BITS_16_23)   // GFX Flash 2
14951495   {
14961496      command = (data >> 16) & 0xff;
14971497      logerror("write to GFX flash chip %d addr %02x cmd %02x\n", flash2-8, (offset<<1), command);
14981498      intelflash_write(flash2, (offset<<1), command);
14991499   }
1500   if (!(mem_mask & 0x0000ff00))   // GFX Flash 1
1500   if (ACCESSING_BITS_8_15)   // GFX Flash 1
15011501   {
15021502      command = (data >> 8) & 0xff;
15031503      logerror("write to GFX flash chip %d addr %02x cmd %02x\n", flash1-8, (offset<<1)+1, command);
15041504      intelflash_write(flash1, (offset<<1)+0x1, command);
15051505   }
1506   if (!(mem_mask & 0x000000ff))   // GFX Flash 2
1506   if (ACCESSING_BITS_0_7)   // GFX Flash 2
15071507   {
15081508      command = (data >> 0) & 0xff;
15091509      //if ( ((offset<<1)+1) != 0x555) printf("write to GFX flash chip %d addr %02x cmd %02x\n", flash1-8, (offset<<1)+1, command);
r2241r2242
15361536{
15371537   UINT32 result = 0;
15381538
1539   if (!(mem_mask & 0xff000000))   // Flash 1
1539   if (ACCESSING_BITS_24_31)   // Flash 1
15401540   {
15411541//      logerror("read flash chip %d addr %02x\n", base+0, offset*4 );
15421542      result |= (intelflash_read(base+0, offset)<<24);
15431543   }
1544   if (!(mem_mask & 0x00ff0000))   // Flash 1
1544   if (ACCESSING_BITS_16_23)   // Flash 1
15451545   {
15461546//      logerror("read flash chip %d addr %02x\n", base+1, offset*4 );
15471547      result |= (intelflash_read(base+1, offset)<<16);
15481548   }
1549   if (!(mem_mask & 0x0000ff00))   // Flash 1
1549   if (ACCESSING_BITS_8_15)   // Flash 1
15501550   {
15511551//      logerror("read flash chip %d addr %02x\n", base+2, offset*4 );
15521552      result |= (intelflash_read(base+2, offset)<<8);
15531553   }
1554   if (!(mem_mask & 0x000000ff))   // Flash 1
1554   if (ACCESSING_BITS_0_7)   // Flash 1
15551555   {
15561556//      logerror("read flash chip %d addr %02x\n", base+3, offset*4 );
15571557      result |= (intelflash_read(base+3, offset)<<0);
r2241r2242
16491649static void cps3_flashmain_w(int base, UINT32 offset, UINT32 data, UINT32 mem_mask)
16501650{
16511651   int command;
1652   if (!(mem_mask & 0xff000000))   // Flash 1
1652   if (ACCESSING_BITS_24_31)   // Flash 1
16531653   {
16541654      command = (data >> 24) & 0xff;
16551655      logerror("write to flash chip %d addr %02x cmd %02x\n", base+0, offset, command);
16561656      intelflash_write(base+0, offset, command);
16571657   }
1658   if (!(mem_mask & 0x00ff0000))   // Flash 2
1658   if (ACCESSING_BITS_16_23)   // Flash 2
16591659   {
16601660      command = (data >> 16) & 0xff;
16611661      logerror("write to flash chip %d addr %02x cmd %02x\n", base+1, offset, command);
16621662      intelflash_write(base+1, offset, command);
16631663   }
1664   if (!(mem_mask & 0x0000ff00))   // Flash 2
1664   if (ACCESSING_BITS_8_15)   // Flash 2
16651665   {
16661666      command = (data >> 8) & 0xff;
16671667      logerror("write to flash chip %d addr %02x cmd %02x\n", base+2, offset, command);
16681668      intelflash_write(base+2, offset, command);
16691669   }
1670   if (!(mem_mask & 0x000000ff))   // Flash 2
1670   if (ACCESSING_BITS_0_7)   // Flash 2
16711671   {
16721672      command = (data >> 0) & 0xff;
16731673      logerror("write to flash chip %d addr %02x cmd %02x\n", base+3, offset, command);
r2241r2242
17271727
17281728static WRITE32_HANDLER( cram_gfxflash_bank_w )
17291729{
1730   if (ACCESSING_MSB32)
1730   if (ACCESSING_BITS_24_31)
17311731   {
17321732      //printf("cram_gfxflash_bank_w MSB32 %08x\n",data);
17331733/*
r2241r2242
17741774      cram_gfxflash_bank-= 0x0002;// as with sound access etc. first 4 meg is 'special' and skipped
17751775   }
17761776
1777   if (ACCESSING_LSB32)
1777   if (ACCESSING_BITS_0_7)
17781778   {
17791779   /*  if(DEBUG_PRINTF)*/ printf("cram_gfxflash_bank_LSB_w LSB32 %08x\n",data);
17801780   }
r2241r2242
18221822
18231823   if (addr>=0x100 && addr<=0x17f)
18241824   {
1825      if (ACCESSING_MSB32) cps3_current_eeprom_read = (cps3_eeprom[offset-0x100/4] & 0xffff0000)>>16;
1825      if (ACCESSING_BITS_24_31) cps3_current_eeprom_read = (cps3_eeprom[offset-0x100/4] & 0xffff0000)>>16;
18261826      else cps3_current_eeprom_read = (cps3_eeprom[offset-0x100/4] & 0x0000ffff)>>0;
18271827      // read word to latch...
18281828      return 0x00000000;
r2241r2242
18301830   else if (addr == 0x200)
18311831   {
18321832      // busy flag / read data..
1833      if (ACCESSING_MSB32) return 0;
1833      if (ACCESSING_BITS_24_31) return 0;
18341834      else
18351835      {
18361836         //if(DEBUG_PRINTF) printf("reading %04x from eeprom\n", cps3_current_eeprom_read);
r2241r2242
18711871{
18721872   UINT32 retval = 0;
18731873
1874   if (ACCESSING_MSB32)
1874   if (ACCESSING_BITS_24_31)
18751875   {
18761876      retval |= ((UINT16)wd33c93_r(machine,0))<<16;
18771877   }
18781878
1879   if (ACCESSING_LSB32)
1879   if (ACCESSING_BITS_0_7)
18801880   {
18811881      retval |= (UINT16)wd33c93_r(machine,1);
18821882   }
r2241r2242
18861886
18871887static WRITE32_HANDLER( cps3_cdrom_w )
18881888{
1889   if (ACCESSING_MSB32)
1889   if (ACCESSING_BITS_24_31)
18901890   {
18911891      wd33c93_w(machine,0,(data & 0x00ff0000)>>16);
18921892   }
18931893
1894   if (ACCESSING_LSB32)
1894   if (ACCESSING_BITS_0_7)
18951895   {
18961896      wd33c93_w(machine,1,(data & 0x000000ff)>>0);
18971897   }
r2241r2242
19101910{
19111911    if(DEBUG_PRINTF) printf ("cps3_ss_pal_base_w %08x %08x\n", data, mem_mask);
19121912
1913   if(ACCESSING_MSB32)
1913   if(ACCESSING_BITS_24_31)
19141914   {
19151915      cps3_ss_pal_base = (data & 0x00ff0000)>>16;
19161916
r2241r2242
19511951   {
19521952      COMBINE_DATA(&paldma_other2);
19531953
1954      if (ACCESSING_MSB32)
1954      if (ACCESSING_BITS_24_31)
19551955      {
19561956         paldma_length = (data & 0xffff0000)>>16;
19571957      }
1958      if (ACCESSING_LSB32)
1958      if (ACCESSING_BITS_0_7)
19591959      {
19601960         if (data & 0x0002)
19611961         {
r2241r2242
22262226   if (offset==0)
22272227   {
22282228      //COMBINE_DATA(&chardma_source);
2229      if (ACCESSING_LSB32)
2229      if (ACCESSING_BITS_0_7)
22302230      {
22312231         chardma_source = data & 0x0000ffff;
22322232      }
2233      if (ACCESSING_MSB32)
2233      if (ACCESSING_BITS_24_31)
22342234      {
22352235         if(DEBUG_PRINTF) printf("chardma_w accessing MSB32 of offset 0");
22362236      }
r2241r2242
22392239   {
22402240      COMBINE_DATA(&chardma_other);
22412241
2242      if (ACCESSING_MSB32)
2242      if (ACCESSING_BITS_24_31)
22432243      {
22442244         if ((data>>16) & 0x0040)
22452245         {
r2241r2242
22902290{
22912291//  COMBINE_DATA(&cps3_colourram[offset]);
22922292
2293   if (ACCESSING_MSB32)
2293   if (ACCESSING_BITS_24_31)
22942294   {
22952295      cps3_set_mame_colours(machine, offset*2, (data & 0xffff0000) >> 16, 0);
22962296   }
22972297
2298   if (ACCESSING_LSB32)
2298   if (ACCESSING_BITS_0_7)
22992299   {
23002300      cps3_set_mame_colours(machine, offset*2+1, (data & 0x0000ffff) >> 0, 0);
23012301   }
src/mame/drivers/glass.c
r2241r2242
8787{
8888   UINT8 *RAM = memory_region(REGION_SOUND1);
8989
90   if (ACCESSING_LSB){
90   if (ACCESSING_BITS_0_7){
9191      memcpy(&RAM[0x30000], &RAM[0x40000 + (data & 0x0f)*0x10000], 0x10000);
9292   }
9393}
src/mame/drivers/mcatadv.c
r2241r2242
168168#if 0 // mcat only.. install read handler?
169169static WRITE16_HANDLER( mcat_coin_w )
170170{
171   if(ACCESSING_MSB16)
171   if(ACCESSING_BITS_8_15)
172172   {
173173      coin_counter_w(0, data & 0x1000);
174174      coin_counter_w(1, data & 0x2000);
src/mame/drivers/cinemat.c
r2241r2242
3636#include "cinemat.h"
3737#include "rendlay.h"
3838
39#include "armora.lh"
3940#include "starcas.lh"
4041#include "solarq.lh"
4142
r2241r2242
14871488GAMEL(1979, sundance, 0,       sundance, sundance, sundance, ORIENTATION_FLIP_X ^ ROT270, "Cinematronics", "Sundance", GAME_SUPPORTS_SAVE, layout_voffff20 )
14881489GAMEL(1979, tailg,    0,       tailg,    tailg,    tailg,    ORIENTATION_FLIP_Y,   "Cinematronics", "Tailgunner", GAME_SUPPORTS_SAVE, layout_ho20ffff )
14891490GAME( 1979, warrior,  0,       warrior,  warrior,  0,        ORIENTATION_FLIP_Y,   "Vectorbeam", "Warrior", GAME_SUPPORTS_SAVE )
1490GAME( 1980, armora,   0,       armora,   armora,   0,        ORIENTATION_FLIP_Y,   "Cinematronics", "Armor Attack", GAME_SUPPORTS_SAVE )
1491GAME( 1980, armorap,  armora,  armora,   armora,   0,        ORIENTATION_FLIP_Y,   "Cinematronics", "Armor Attack (prototype)", GAME_SUPPORTS_SAVE )
1492GAME( 1980, armorar,  armora,  armora,   armora,   0,        ORIENTATION_FLIP_Y,   "Cinematronics (Rock-ola license)", "Armor Attack (Rock-ola)", GAME_SUPPORTS_SAVE )
1491GAMEL(1980, armora,   0,       armora,   armora,   0,        ORIENTATION_FLIP_Y,   "Cinematronics", "Armor Attack", GAME_SUPPORTS_SAVE, layout_armora )
1492GAMEL(1980, armorap,  armora,  armora,   armora,   0,        ORIENTATION_FLIP_Y,   "Cinematronics", "Armor Attack (prototype)", GAME_SUPPORTS_SAVE, layout_armora )
1493GAMEL(1980, armorar,  armora,  armora,   armora,   0,        ORIENTATION_FLIP_Y,   "Cinematronics (Rock-ola license)", "Armor Attack (Rock-ola)", GAME_SUPPORTS_SAVE, layout_armora )
14931494GAME( 1980, ripoff,   0,       ripoff,   ripoff,   0,        ORIENTATION_FLIP_Y,   "Cinematronics", "Rip Off", GAME_SUPPORTS_SAVE )
14941495GAMEL(1980, starcas,  0,       starcas,  starcas,  0,        ORIENTATION_FLIP_Y,   "Cinematronics", "Star Castle (version 3)", GAME_SUPPORTS_SAVE, layout_starcas )
14951496GAMEL(1980, starcas1, starcas, starcas,  starcas,  0,        ORIENTATION_FLIP_Y,   "Cinematronics", "Star Castle (older)", GAME_SUPPORTS_SAVE, layout_starcas )
src/mame/drivers/toaplan2.c
r2241r2242
653653
654654static WRITE16_HANDLER( toaplan2_coin_word_w )
655655{
656   if (ACCESSING_LSB)
656   if (ACCESSING_BITS_0_7)
657657   {
658658      toaplan2_coin_w(machine, offset, data & 0xff);
659659   }
660   if (ACCESSING_MSB && (data & 0xff00) )
660   if (ACCESSING_BITS_8_15 && (data & 0xff00) )
661661   {
662662      logerror("Writing unknown upper MSB command (%04x) to coin control\n",data & 0xff00);
663663   }
r2241r2242
665665
666666static WRITE16_HANDLER( shippumd_coin_word_w )
667667{
668   if (ACCESSING_LSB)
668   if (ACCESSING_BITS_0_7)
669669   {
670670      toaplan2_coin_w(machine, offset, data & 0xff);
671671      OKIM6295_set_bank_base(0, (((data & 0x10) >> 4) * 0x40000));
672672   }
673   if (ACCESSING_MSB && (data & 0xff00) )
673   if (ACCESSING_BITS_8_15 && (data & 0xff00) )
674674   {
675675      logerror("Writing unknown upper MSB command (%04x) to coin control\n",data & 0xff00);
676676   }
r2241r2242
683683
684684static WRITE16_HANDLER( toaplan2_shared_w )
685685{
686   if (ACCESSING_LSB)
686   if (ACCESSING_BITS_0_7)
687687   {
688688      toaplan2_shared_ram[offset] = data & 0xff;
689689   }
r2241r2242
694694   /* Command sent to secondary CPU. Support for HD647180 will be
695695       required when a ROM dump becomes available for this hardware */
696696
697   if (ACCESSING_LSB)
697   if (ACCESSING_BITS_0_7)
698698   {
699699      if (toaplan2_sub_cpu == CPU_2_Z80)         /* Whoopee */
700700      {
r2241r2242
731731
732732static WRITE16_HANDLER( pipibibi_z80_task_w )
733733{
734   if (ACCESSING_LSB)
734   if (ACCESSING_BITS_0_7)
735735   {
736736      toaplan2_shared_ram[0] = data & 0xff;
737737   }
r2241r2242
766766
767767static WRITE16_HANDLER( ghox_mcu_w )
768768{
769   if (ACCESSING_LSB)
769   if (ACCESSING_BITS_0_7)
770770   {
771771      mcu_data = data;
772772      if ((data >= 0xd0) && (data < 0xe0))
r2241r2242
825825
826826static WRITE16_HANDLER( ghox_shared_ram_w )
827827{
828   if (ACCESSING_LSB)
828   if (ACCESSING_BITS_0_7)
829829   {
830830      toaplan2_shared_ram16[offset] = data & 0xff;
831831   }
r2241r2242
842842
843843static WRITE16_HANDLER( shared_ram_w )
844844{
845   if (ACCESSING_LSB)
845   if (ACCESSING_BITS_0_7)
846846   {
847847      data &= 0xff;
848848      switch (offset * 2)
r2241r2242
883883
884884static WRITE16_HANDLER( dogyuun_snd_cpu_w )
885885{
886   if (ACCESSING_LSB)
886   if (ACCESSING_BITS_0_7)
887887   {
888888      mcu_data = data;
889889      dogyuun_okisnd_w(machine, data);
r2241r2242
903903
904904static WRITE16_HANDLER( kbash_snd_cpu_w )
905905{
906   if (ACCESSING_LSB)
906   if (ACCESSING_BITS_0_7)
907907   {
908908      kbash_okisnd_w(machine, data);
909909   }
r2241r2242
937937
938938static WRITE16_HANDLER( fixeight_sec_cpu_w )
939939{
940   if (ACCESSING_LSB)
940   if (ACCESSING_BITS_0_7)
941941   {
942942      if (mcu_data & 0xff00)
943943      {
r2241r2242
974974
975975static WRITE16_HANDLER( vfive_snd_cpu_w )
976976{
977   if (ACCESSING_LSB)
977   if (ACCESSING_BITS_0_7)
978978   {
979979      mcu_data = data;
980980   }
r2241r2242
983983
984984static WRITE16_HANDLER( batsugun_snd_cpu_w )
985985{
986   if (ACCESSING_LSB)
986   if (ACCESSING_BITS_0_7)
987987   {
988988      mcu_data = data;
989989      batsugun_okisnd_w(machine, data);
r2241r2242
998998
999999static WRITE16_HANDLER( V25_sharedram_w )
10001000{
1001   if (ACCESSING_LSB)
1001   if (ACCESSING_BITS_0_7)
10021002   {
10031003      V25_shared_ram[offset] = data & 0xff;
10041004   }
r2241r2242
10061006
10071007static WRITE16_HANDLER( oki_bankswitch_w )
10081008{
1009   if (ACCESSING_LSB)
1009   if (ACCESSING_BITS_0_7)
10101010   {
10111011      OKIM6295_set_bank_base(0, (data & 1) * 0x40000);
10121012   }
r2241r2242
10141014
10151015static WRITE16_HANDLER( fixeighb_oki_bankswitch_w )
10161016{
1017   if (ACCESSING_LSB)
1017   if (ACCESSING_BITS_0_7)
10181018   {
10191019      data &= 7;
10201020      if (data <= 4)
r2241r2242
10391039
10401040static WRITE16_HANDLER( raizing_shared_ram_w )
10411041{
1042   if (ACCESSING_LSB)
1042   if (ACCESSING_BITS_0_7)
10431043   {
10441044      raizing_shared_ram[offset] = data & 0xff;
10451045   }
r2241r2242
10481048
10491049static WRITE16_HANDLER( bgaregga_soundlatch_w )
10501050{
1051   if (ACCESSING_LSB)
1051   if (ACCESSING_BITS_0_7)
10521052   {
10531053      soundlatch_w(machine, offset, data & 0xff);
10541054      cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
r2241r2242
11551155
11561156static WRITE16_HANDLER( batrider_z80_busreq_w )
11571157{
1158   if (ACCESSING_LSB)
1158   if (ACCESSING_BITS_0_7)
11591159   {
11601160      raizing_Z80_busreq = (data & 0xff);
11611161   }
r2241r2242
11761176// these two latches are always written together, via a single move.l instruction
11771177static WRITE16_HANDLER( batrider_soundlatch_w )
11781178{
1179   if (ACCESSING_LSB)
1179   if (ACCESSING_BITS_0_7)
11801180   {
11811181      soundlatch_w(machine, offset, data & 0xff);
11821182      cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE);
r2241r2242
11861186
11871187static WRITE16_HANDLER( batrider_soundlatch2_w )
11881188{
1189   if (ACCESSING_LSB)
1189   if (ACCESSING_BITS_0_7)
11901190   {
11911191      soundlatch2_w(machine, offset, data & 0xff);
11921192      cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE);
r2241r2242
13201320   if (data & ~0x001f)
13211321      logerror("CPU #0 PC:%06X - Unknown EEPROM data being written %04X\n",activecpu_get_pc(),data);
13221322
1323   if ( ACCESSING_LSB )
1323   if ( ACCESSING_BITS_0_7 )
13241324   {
13251325      // chip select
13261326      EEPROM_set_cs_line((data & 0x01) ? CLEAR_LINE : ASSERT_LINE );
src/mame/drivers/gaelco.c
r2241r2242
7676
7777static WRITE16_HANDLER( bigkarnk_sound_command_w )
7878{
79   if (ACCESSING_LSB){
79   if (ACCESSING_BITS_0_7){
8080      soundlatch_w(machine,0,data & 0xff);
8181      cpunum_set_input_line(machine, 1,M6809_FIRQ_LINE,HOLD_LINE);
8282   }
r2241r2242
8484
8585static WRITE16_HANDLER( bigkarnk_coin_w )
8686{
87   if (ACCESSING_LSB){
87   if (ACCESSING_BITS_0_7){
8888      switch ((offset >> 3)){
8989         case 0x00:   /* Coin Lockouts */
9090         case 0x01:
r2241r2242
302302{
303303   UINT8 *RAM = memory_region(REGION_SOUND1);
304304
305   if (ACCESSING_LSB){
305   if (ACCESSING_BITS_0_7){
306306      memcpy(&RAM[0x30000], &RAM[0x40000 + (data & 0x0f)*0x10000], 0x10000);
307307   }
308308}
src/mame/drivers/wecleman.c
r2241r2242
366366*/
367367static WRITE16_HANDLER( irqctrl_w )
368368{
369   if (ACCESSING_LSB)
369   if (ACCESSING_BITS_0_7)
370370   {
371371      // logerror("CPU #0 - PC = %06X - $140005 <- %02X (old value: %02X)\n",activecpu_get_pc(), data&0xFF, old_data&0xFF);
372372
r2241r2242
400400*/
401401static WRITE16_HANDLER( selected_ip_w )
402402{
403   if (ACCESSING_LSB) wecleman_selected_ip = data & 0xff;   // latch the value
403   if (ACCESSING_BITS_0_7) wecleman_selected_ip = data & 0xff;   // latch the value
404404}
405405
406406/* $140021.b - Return the previously selected input port's value */
r2241r2242
456456   COMBINE_DATA(&blitter_regs[offset]);
457457
458458   /* do a blit if $80010.b has been written */
459   if ( (offset == 0x10/2) && (ACCESSING_MSB) )
459   if ( (offset == 0x10/2) && (ACCESSING_BITS_8_15) )
460460   {
461461      /* 80000.b = ?? usually 0 - other values: 02 ; 00 - ? logic function ? */
462462      /* 80001.b = ?? usually 0 - other values: 3f ; 01 - ? height ? */
r2241r2242
573573
574574static WRITE16_HANDLER( hotchase_K051316_0_w )
575575{
576   if (ACCESSING_LSB)      K051316_0_w(machine, offset, data & 0xff);
576   if (ACCESSING_BITS_0_7)      K051316_0_w(machine, offset, data & 0xff);
577577}
578578
579579static WRITE16_HANDLER( hotchase_K051316_1_w )
580580{
581   if (ACCESSING_LSB)      K051316_1_w(machine, offset, data & 0xff);
581   if (ACCESSING_BITS_0_7)      K051316_1_w(machine, offset, data & 0xff);
582582}
583583
584584static WRITE16_HANDLER( hotchase_K051316_ctrl_0_w )
585585{
586   if (ACCESSING_LSB)      K051316_ctrl_0_w(machine, offset, data & 0xff);
586   if (ACCESSING_BITS_0_7)      K051316_ctrl_0_w(machine, offset, data & 0xff);
587587}
588588
589589static WRITE16_HANDLER( hotchase_K051316_ctrl_1_w )
590590{
591   if (ACCESSING_LSB)      K051316_ctrl_1_w(machine, offset, data & 0xff);
591   if (ACCESSING_BITS_0_7)      K051316_ctrl_1_w(machine, offset, data & 0xff);
592592}
593593
594594static WRITE16_HANDLER( hotchase_soundlatch_w );
r2241r2242
649649/* 140001.b */
650650WRITE16_HANDLER( wecleman_soundlatch_w )
651651{
652   if (ACCESSING_LSB)
652   if (ACCESSING_BITS_0_7)
653653   {
654654      soundlatch_w(machine,0,data & 0xFF);
655655      cpunum_set_input_line(machine, 2,0, HOLD_LINE);
r2241r2242
717717/* 140001.b */
718718static WRITE16_HANDLER( hotchase_soundlatch_w )
719719{
720   if (ACCESSING_LSB)
720   if (ACCESSING_BITS_0_7)
721721   {
722722      soundlatch_w(machine,0,data & 0xFF);
723723      cpunum_set_input_line(machine, 2,M6809_IRQ_LINE, HOLD_LINE);
r2241r2242
11331133   MDRV_SCREEN_ADD("main", RASTER)
11341134   MDRV_SCREEN_REFRESH_RATE(60)
11351135   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
1136   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
1136   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
11371137   MDRV_SCREEN_SIZE(320 +16, 224 +16)
11381138   MDRV_SCREEN_VISIBLE_AREA(0 +8, 320-1 +8, 0 +8, 224-1 +8)
11391139
src/mame/drivers/seattle.c
r2241r2242
16411641
16421642static WRITE32_HANDLER( status_leds_w )
16431643{
1644   if (!(mem_mask & 0x000000ff))
1644   if (ACCESSING_BITS_0_7)
16451645      status_leds = data;
16461646}
16471647
src/mame/drivers/btoads.c
r2241r2242
7777
7878static WRITE16_HANDLER( main_sound_w )
7979{
80   if (ACCESSING_LSB)
80   if (ACCESSING_BITS_0_7)
8181      timer_call_after_resynch(NULL, data & 0xff, delayed_sound_w);
8282}
8383
src/mame/drivers/tetrisp2.c
r2241r2242
9797
9898static WRITE16_HANDLER( tetrisp2_systemregs_w )
9999{
100   if (ACCESSING_LSB)
100   if (ACCESSING_BITS_0_7)
101101   {
102102      tetrisp2_systemregs[offset] = data;
103103   }
r2241r2242
107107
108108static WRITE16_HANDLER( rockn_systemregs_w )
109109{
110   if (ACCESSING_LSB)
110   if (ACCESSING_BITS_0_7)
111111   {
112112      tetrisp2_systemregs[offset] = data;
113113      if (offset == 0x0c)
r2241r2242
121121
122122static WRITE16_HANDLER( rocknms_sub_systemregs_w )
123123{
124   if (ACCESSING_LSB)
124   if (ACCESSING_BITS_0_7)
125125   {
126126      rocknms_sub_systemregs[offset] = data;
127127      if (offset == 0x0c)
r2241r2242
148148
149149static WRITE16_HANDLER( tetrisp2_sound_w )
150150{
151   if (ACCESSING_LSB)
151   if (ACCESSING_BITS_0_7)
152152   {
153153      if (offset)   YMZ280B_data_0_w     (machine, offset, data & 0xff);
154154      else      YMZ280B_register_0_w (machine, offset, data & 0xff);
r2241r2242
300300
301301static WRITE16_HANDLER( rocknms_main2sub_w )
302302{
303   if (ACCESSING_LSB)
303   if (ACCESSING_BITS_0_7)
304304      rocknms_main2sub = (data ^ 0xffff);
305305}
306306
r2241r2242
311311
312312static WRITE16_HANDLER( rocknms_sub2main_w )
313313{
314   if (ACCESSING_LSB)
314   if (ACCESSING_BITS_0_7)
315315      rocknms_sub2main = (data ^ 0xffff);
316316}
317317
src/mame/drivers/lastduel.c
r2241r2242
3939
4040static WRITE16_HANDLER( lastduel_sound_w )
4141{
42   if (ACCESSING_LSB)
42   if (ACCESSING_BITS_0_7)
4343      soundlatch_w(machine,0,data & 0xff);
4444}
4545
src/mame/drivers/alpha68k.c
r2241r2242
257257{
258258   logerror("%04x:  Alpha write trigger at %04x (%04x)\n",activecpu_get_pc(),offset,data);
259259   /* 0x44 = coin clear signal to microcontroller? */
260   if (offset==0x2d && ACCESSING_LSB)
260   if (offset==0x2d && ACCESSING_BITS_0_7)
261261      alpha68k_flipscreen_w(data & 1);
262262}
263263
r2241r2242
322322
323323static WRITE16_HANDLER( kyros_sound_w )
324324{
325   if(ACCESSING_MSB)
325   if(ACCESSING_BITS_8_15)
326326      soundlatch_w(machine, 0, (data>>8)&0xff);
327327}
328328
329329static WRITE16_HANDLER( alpha68k_II_sound_w )
330330{
331   if(ACCESSING_LSB)
331   if(ACCESSING_BITS_0_7)
332332      soundlatch_w(machine, 0, data&0xff);
333333}
334334
335335static WRITE16_HANDLER( alpha68k_V_sound_w )
336336{
337337   /* Sound & fix bank select are in the same word */
338   if(ACCESSING_LSB)
338   if(ACCESSING_BITS_0_7)
339339      soundlatch_w(machine,0,data&0xff);
340   if(ACCESSING_MSB)
340   if(ACCESSING_BITS_8_15)
341341      alpha68k_V_video_bank_w((data>>8)&0xff);
342342}
343343//AT
344344static WRITE16_HANDLER( paddlema_soundlatch_w )
345345{
346   if (ACCESSING_LSB)
346   if (ACCESSING_BITS_0_7)
347347   {
348348      soundlatch_w(machine, 0, data);
349      cpunum_set_input_line(Machine, 1, 0, HOLD_LINE);
349      cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
350350   }
351351}
352352
353353static WRITE16_HANDLER( tnexspce_soundlatch_w )
354354{
355   if (ACCESSING_LSB)
355   if (ACCESSING_BITS_0_7)
356356   {
357357      soundlatch_w(machine, 0, data);
358      cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
358      cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
359359   }
360360}
361361//ZT
r2241r2242
418418         {
419419            if (microcontroller_id == 0x00ff)      /* Super Stingry */
420420            {
421               if (trigstate >= 12 || !strcmp(Machine->gamedrv->name, "jongbou"))   /* arbitrary value ! */
421               if (trigstate >= 12 || !strcmp(machine->gamedrv->name, "jongbou"))   /* arbitrary value ! */
422422               {
423423                  trigstate = 0;
424424                  microcontroller_data = 0x21;         // timer
r2241r2242
477477
478478            if ((coin_id&0xff) == 0x22)
479479            {
480               if(!strcmp(Machine->gamedrv->name, "btlfildb"))
480               if(!strcmp(machine->gamedrv->name, "btlfildb"))
481481                  coinvalue = (readinputportbytag("IN4")>>0) & 7;
482482               else
483483                  coinvalue = (~readinputportbytag("IN4")>>0) & 7;
r2241r2242
500500
501501            if ((coin_id>>8) == 0x22)
502502            {
503               if(!strcmp(Machine->gamedrv->name, "btlfildb"))
503               if(!strcmp(machine->gamedrv->name, "btlfildb"))
504504                  coinvalue = (readinputportbytag("IN4")>>0) & 7;
505505               else
506506                  coinvalue = (~readinputportbytag("IN4")>>0) & 7;
src/mame/drivers/drgnmst.c
r2241r2242
4545
4646static WRITE16_HANDLER( drgnmst_snd_command_w )
4747{
48   if (ACCESSING_LSB) {
48   if (ACCESSING_BITS_0_7) {
4949      drgnmst_snd_command = (data & 0xff);
5050      cpu_yield();
5151   }
r2241r2242
5454static WRITE16_HANDLER( drgnmst_snd_flag_w )
5555{
5656   /* Enables the following 68K write operation to latch through to the PIC */
57   if (ACCESSING_LSB)
57   if (ACCESSING_BITS_0_7)
5858      drgnmst_snd_flag = 1;
5959}
6060
src/mame/drivers/tmaster.c
r2241r2242
4646static int okibank;
4747static WRITE16_HANDLER( tmaster_oki_bank_w )
4848{
49   if (ACCESSING_MSB)
49   if (ACCESSING_BITS_8_15)
5050   {
5151      // data & 0x0800?
5252      okibank = ((data >> 8) & 3);
5353      OKIM6295_set_bank_base(0, okibank * 0x40000);
5454   }
5555
56   if (ACCESSING_LSB)
56   if (ACCESSING_BITS_0_7)
5757   {
5858      // data & 0x0002?
5959   }
r2241r2242
7676
7777static WRITE16_HANDLER( tmaster_tscreen_reset_w )
7878{
79   if (ACCESSING_LSB && data == 0x05)
79   if (ACCESSING_BITS_0_7 && data == 0x05)
8080   {
8181      touchscreen = 0;
8282      show_touchscreen();
r2241r2242
419419   if (data & ~0x0003)
420420      logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",activecpu_get_pc(),data);
421421
422   if ( ACCESSING_LSB )
422   if ( ACCESSING_BITS_0_7 )
423423   {
424424      // latch the bit
425425      EEPROM_write_bit(data & 0x0001);
r2241r2242
447447
448448static WRITE16_HANDLER( galgames_palette_offset_w )
449449{
450   if (ACCESSING_LSB)
450   if (ACCESSING_BITS_0_7)
451451   {
452452      palette_offset = data & 0xff;
453453      palette_index = 0;
r2241r2242
455455}
456456static WRITE16_HANDLER( galgames_palette_data_w )
457457{
458   if (ACCESSING_LSB)
458   if (ACCESSING_BITS_0_7)
459459   {
460460      palette_data[palette_index] = data & 0xff;
461461      if (++palette_index == 3)
r2241r2242
474474}
475475static WRITE16_HANDLER( galgames_okiram_w )
476476{
477   if (ACCESSING_LSB)
477   if (ACCESSING_BITS_0_7)
478478      memory_region(REGION_SOUND1)[offset] = data & 0xff;
479479}
480480
r2241r2242
486486   // cart selection (0 1 2 3 4 7)
487487
488488   // 7 resets the eeprom
489   if (ACCESSING_LSB)
489   if (ACCESSING_BITS_0_7)
490490      EEPROM_set_cs_line(((data&0xff) == 0x07) ? ASSERT_LINE : CLEAR_LINE);
491491}
492492
r2241r2242
497497
498498static WRITE16_HANDLER( galgames_cart_clock_w )
499499{
500   if (ACCESSING_LSB)
500   if (ACCESSING_BITS_0_7)
501501   {
502502      // bit 3 = clock
503503
src/mame/drivers/cischeat.c
r2241r2242
542542*/
543543static WRITE16_HANDLER( scudhamm_leds_w )
544544{
545   if (ACCESSING_MSB)
545   if (ACCESSING_BITS_8_15)
546546   {
547547       set_led_status(0, data & 0x0100);   // 3 buttons
548548      set_led_status(1, data & 0x0200);
549549      set_led_status(2, data & 0x0400);
550550   }
551551
552   if (ACCESSING_LSB)
552   if (ACCESSING_BITS_0_7)
553553   {
554554//      set_led_status(3, data & 0x0010);   // if we had more leds..
555555//      set_led_status(4, data & 0x0020);
r2241r2242
568568
569569static WRITE16_HANDLER( scudhamm_oki_bank_w )
570570{
571   if (ACCESSING_LSB)
571   if (ACCESSING_BITS_0_7)
572572   {
573573      OKIM6295_set_bank_base(0, 0x40000 * ((data >> 0) & 0x3) );
574574      OKIM6295_set_bank_base(1, 0x40000 * ((data >> 4) & 0x3) );
r2241r2242
656656*/
657657static WRITE16_HANDLER( armchmp2_leds_w )
658658{
659   if (ACCESSING_MSB)
659   if (ACCESSING_BITS_8_15)
660660   {
661661      set_led_status(0, data & 0x0100);
662662       set_led_status(1, data & 0x1000);
r2241r2242
664664      set_led_status(3, data & 0x4000);
665665   }
666666
667   if (ACCESSING_LSB)
667   if (ACCESSING_BITS_0_7)
668668   {
669669      coin_counter_w(0, data & 0x0040);
670670      coin_counter_w(1, data & 0x0080);
r2241r2242
832832
833833static WRITE16_HANDLER( bigrun_soundbank_w )
834834{
835   if (ACCESSING_LSB)
835   if (ACCESSING_BITS_0_7)
836836   {
837837      OKIM6295_set_bank_base(0, 0x40000 * ((data >> 0) & 1) );
838838      OKIM6295_set_bank_base(1, 0x40000 * ((data >> 4) & 1) );
r2241r2242
866866
867867static WRITE16_HANDLER( cischeat_soundbank_0_w )
868868{
869   if (ACCESSING_LSB)   OKIM6295_set_bank_base(0, 0x40000 * (data & 1) );
869   if (ACCESSING_BITS_0_7)   OKIM6295_set_bank_base(0, 0x40000 * (data & 1) );
870870}
871871static WRITE16_HANDLER( cischeat_soundbank_1_w )
872872{
873   if (ACCESSING_LSB)   OKIM6295_set_bank_base(1, 0x40000 * (data & 1) );
873   if (ACCESSING_BITS_0_7)   OKIM6295_set_bank_base(1, 0x40000 * (data & 1) );
874874}
875875
876876static ADDRESS_MAP_START( cischeat_sound_readmem, ADDRESS_SPACE_PROGRAM, 16 )
src/mame/drivers/namcos22.c
r2241r2242
11701170      { /* SUBCPU enable for Super System 22 */
11711171         if (data)
11721172         {
1173            cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, CLEAR_LINE);
1173            cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, CLEAR_LINE);
11741174         }
11751175         else
11761176         {
1177            cpunum_set_input_line(Machine, 3,INPUT_LINE_RESET,ASSERT_LINE); /* M37710 MCU */
1177            cpunum_set_input_line(machine, 3,INPUT_LINE_RESET,ASSERT_LINE); /* M37710 MCU */
11781178         }
11791179      }
11801180   }
r2241r2242
11961196   {
11971197      if( newReg == 0 )
11981198      { /* disable DSPs */
1199         cpunum_set_input_line(Machine, 1,INPUT_LINE_RESET,ASSERT_LINE); /* master DSP */
1200         cpunum_set_input_line(Machine, 2,INPUT_LINE_RESET,ASSERT_LINE); /* slave DSP */
1199         cpunum_set_input_line(machine, 1,INPUT_LINE_RESET,ASSERT_LINE); /* master DSP */
1200         cpunum_set_input_line(machine, 2,INPUT_LINE_RESET,ASSERT_LINE); /* slave DSP */
12011201         mbEnableDspIrqs = 0;
12021202      }
12031203      else if( newReg==1 )
12041204      { /*enable dsp and rendering subsystem */
1205         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
1205         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
12061206         namcos22_enable_slave_simulation();
12071207         mbEnableDspIrqs = 1;
12081208      }
12091209      else if( newReg==0xff )
12101210      { /* used to upload game-specific code to master/slave dsps */
1211         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
1211         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
12121212         mbEnableDspIrqs = 0;
12131213      }
12141214   }
r2241r2242
13571357   */
13581358   if( offset==0 )
13591359   {
1360      if( mem_mask&0xffff0000 )
1360      if( !ACCESSING_BITS_16_31 )
13611361      {
13621362         if( mSpotRAM.portW>=SPOTRAM_SIZE )
13631363         {
r2241r2242
15891589   // bit 1 = fan
15901590   // bit 2 = button light
15911591
1592   if (!strcmp(Machine->gamedrv->name, "propcycl"))
1592   if (!strcmp(machine->gamedrv->name, "propcycl"))
15931593   {
15941594      output_set_value("fan0", data & 1);
15951595      set_led_status(0, data & 2);
r2241r2242
16301630            int i;
16311631            for (i = 0; i < 16; i++)
16321632            {
1633               cpunum_set_input_line(Machine, 3, M37710_LINE_TIMERA3TICK, PULSE_LINE);
1633               cpunum_set_input_line(machine, 3, M37710_LINE_TIMERA3TICK, PULSE_LINE);
16341634            }
16351635         }
16361636
src/mame/drivers/galaxold.c
r0r2242
1/***************************************************************************
2
3 Galaxian/Moon Cresta hardware
4
5
6Main clock: XTAL = 18.432 MHz
7Z80 Clock: XTAL/6 = 3.072 MHz
8Horizontal video frequency: HSYNC = XTAL/3/192/2 = 16 kHz
9Video frequency: VSYNC = HSYNC/132/2 = 60.606060 Hz
10VBlank duration: 1/VSYNC * (20/132) = 2500 us
11
12
13Notes:
14-----
15
16- The only code difference between 'galaxian' and 'galmidw' is that the
17  'BONUS SHIP' text is printed on a different line.
18
19
20TODO:
21----
22
23- Problems with Galaxian based on the observation of a real machine:
24
25  - Starfield is incorrect.  The speed and flashing frequency is fine, but the
26    stars appear in different positions.
27  - Background humming is incorrect.  It's faster on a real machine
28  - Explosion sound is much softer.  Filter involved?
29
30- $4800-4bff in Streaking/Ghost Muncher
31
32
33
34Moon Cresta versions supported:
35------------------------------
36
37mooncrst    Nichibutsu     - later revision with better demo mode and
38                         text for docking. Encrypted. No ROM/RAM check
39mooncrsu    Nichibutsu USA - later revision with better demo mode and
40                         text for docking. Unencrypted. No ROM/RAM check
41mooncrsa    Nichibutsu     - older revision with better demo mode and
42                         text for docking. Encrypted. No ROM/RAM check
43mooncrs2    Nichibutsu     - probably first revision (no patches) and ROM/RAM check code.
44                             This came from a bootleg board, with the logos erased
45                         from the graphics
46mooncrsg    Gremlin        - same docking text as mooncrst
47mooncrsb    bootleg of mooncrs2. ROM/RAM check erased.
48
49
50Stephh's additional notes (based on the games Z80 code and some tests) for "Moon Cresta" and its numerous clones :
51
52a) 'mooncrst'
53
54  - made by Nichibutsu
55  - inputs :
56      * player 1 controls are used by player 1
57      * player 2 controls are used by player 2, even in an "upright" cabinet
58  - 2 coins slots with different settings :
59      * coin A : 1C_1C / 2C_1C / 3C_1C / 4C_1C
60      * coin B : 1C_1C / 1C_2C / 1C_3C / "Free Play"
61  - no writes to 0xa003, so no coin counters
62  - bonus life at 30000 or 50000 based on a Dip Switch
63  - possible partial Japanese text based on a Dip Switch
64  - hi-score : 11 chars (even if only 10 will be displayed), 60 seconds to enter
65  - players bullet speed : 4 pixels - lower limit : 0x04
66  - ingame bug : if you reset the game when screen is flipped, it isn't flipped back
67  - driver possible bug (which occurs for all "Moon Cresta" sets but 'mooncrgx') :
68    when the screen is flipped, sprites are too shifted (see for example player 2
69    score which misses ending '0') while bullets shall be good
70    as a consequence, square around letters is wrong when entering player name
71    for hi-score table when screen is flipped
72
73b) 'mooncrsu'
74
75  - made by Nichibutsu
76  - very similar to 'mooncrst' with the only following differences :
77      * additional "USA" display after "Nichibutsu" (which is shifted left)
78      * writes to 0xb000 to 0xb0ff on reset ('mooncrst' only writes to 0xb000),
79        so there is no screen flipped ingame bug as in 'mooncrst'
80
81c) 'mooncrsa'
82
83  - made by Nichibutsu
84  - additional "(c)" display before "Nichibutsu"
85  - "(c) 1980 NIHON BUSSAN CO. , LTD" display replaced with "May 1980" in yellow
86  - code at 0x1f00 has been removed ! I can't determine was is was supposed to do,
87    but it's based on number of enemies left (stored at 0x823c) and possible time
88    spent on the level (stored at 0x8226). Any hint is fully welcome !
89  - this version is easier than 'mooncrst' : look at high nibbles that are stored
90    at 0x809b and 0x809c via code at 0x0cb8 (0x01 and 0x02 instead of 0x11 and 0x12).
91  - 2 coins slots, but same settings : 1C_1C / 1C_2C / 1C_3C / "Free Play"
92  - same other infos as in 'mooncrst'
93  - same ingame bug as in 'mooncrst'
94
95d) 'mooncrs2'
96
97  - bootleg (possibily based on a Gremlin version we don't have)
98  - heavily based on 'mooncrsa' with additional RAM/ROM check routine at 0x3ea1
99  - some "chars" have been erased from the GFX ROMS but some routines which
100    "prints" them are still there (but there are less than in 'mooncrsa')
101  - same other infos as in 'mooncrst'
102  - due to numerous writes in the RAM/ROM check routine, there is no screen flipped
103    ingame bug as in 'mooncrst'
104
105e) 'mooncrsb'
106
107  - bootleg (possibily based on a Gremlin version we don't have)
108  - the only difference with 'mooncrs2' is that RAM/ROM check routine at 0x3ea1
109    has completely been "noped" and the jump at address 0x0004 has been changed
110  - all "chars" from the GFX ROMS haven't been erased, so you can see the top
111    of the "Gremlin" logo as copyright and hi-scores names
112  - same ingame bug as in 'mooncrst'
113
114f) 'mooncrs3'
115
116  - bootleg
117  - very similar to 'mooncrs2' with the only following differences :
118      * checksum of ROM area 0x0000-0x3fff is computed, but the result is discarded
119        (see "xor a" operation at 0x3fc0 instead of "and a")
120      * coins stuff is different (see below)
121  - 2 coins slots with different settings (same as 'mooncrst') :
122      * coin A : 1C_1C / 2C_1C / 3C_1C / 4C_1C
123      * coin B : 1C_1C / 1C_2C / 1C_3C / "Free Play"
124  - there are writes to 0xa003 (check code at 0x1b8e and 0x1b9e) which occur
125    when you insert a coin, but I can't confirm it's related to coin counters
126    as the same value is written when you press COIN1 or COIN2
127
128g) 'mooncrsg'
129
130  - made by Gremlin
131  - there are MANY changes and additions, and I wonder if there's such a Nichibutsu set;
132    anyway, closest set to this one seems to be 'mooncrst'
133  - Gremin "logo" on 2 lines instead of Nichibutsu copyright messages (2 lines)
134  - additional test for IN0 bit 7 (code at 0x0174) which always adds 1 credit
135  - there are writes to 0xa003 (check code at 0x0158 and 0x0160) which occur
136    when you insert a coin, but I can't confirm it's related to coin counters
137    as the same value is written when you press COIN1 or COIN2
138  - only English text (Dip Switch has no effect due to code at 0x2f77)
139  - hi-score : 3 chars, 10 seconds to enter
140  - same difficulty as in 'monncrst' (but stored at 0x809e and 0x809f)
141  - same other infos as in 'mooncrst'
142  - same ingame bug as in 'mooncrst'
143
144h) 'fantazia'
145
146  - made by Subelectro
147  - closest set to this one seems to be 'mooncrsb'
148  - all intro texts have been changed as well as colors
149  - inputs :
150      * player 1 controls are used by player 1
151      * player 2 controls are used by player 2, only in a "cocktail" cabinet
152    look at additional routine at 0x29e0
153  - 2 coins slots with different settings (inverted coin A/B compared to 'mooncrst') :
154      * coin A : 1C_1C / 1C_2C / 1C_3C / "Free Play"
155      * coin B : 1C_1C / 2C_1C / 3C_1C / 4C_1C
156  - only English text (Dip Switch has no effect due to code at 0x2f53)
157  - hi-score : 3 chars, 60 seconds to enter
158  - same other infos as in 'mooncrst'
159  - same ingame bug as in 'mooncrst'
160
161i) 'eagle'
162
163  - made by Centuri
164  - very similar to 'mooncrsb' with the only following differences :
165      * only 3 chars for hi-score instead of 11
166      * all other changes are modified "strings" to be displayed
167        (the intro texts but copyright remains though) as well as
168        new GFX (I can't test the sound for now to check)
169  - same ingame bug as in 'mooncrst'
170
171j) 'eagle2'
172
173  - made by Centuri
174  - very similar to 'eagle' with the only following differences :
175      * only 20 seconds to enter hi-score instead of 60
176      * coins stuff is different (see below)
177      * one GFX ROM is slighlty different
178  - 2 coins slots, but same settings : 1C_1C / 2C_1C / 3C_1C / 4C_1C
179  - previous "Coin B" Dip Switch is now only tested to see if in "Freeplay" mode
180  - same ingame bug as in 'mooncrst'
181
182k) 'eagle3'
183
184  - made by Centuri
185  - PRG ROMS are the same as for 'eagle' while two GFX ROMS are slighly different
186    (so the game is having 'mooncrst' ships and 'eagle' enemies)
187  - same ingame bug as in 'mooncrst'
188
189l) 'spctbird'
190
191  - made by Fortrek
192  - very similar to 'mooncrsb' with the only following difference :
193      * coins stuff is different (same as in 'eagle2' - see below)
194  - 2 coins slots, but same settings : 1C_1C / 2C_1C / 3C_1C / 4C_1C
195  - previous "Coin B" Dip Switch is now only tested to see if in "Freeplay" mode
196  - same ingame bug as in 'mooncrst'
197
198m) 'smooncrs'
199
200  - made par Gremlin (bootleg based on a Nichibutsu version we don't have ?)
201  - same RAM/ROM check routine as in 'mooncrs2' (so there is no screen flipped
202    ingame bug as in 'mooncrst'), but LOTS of new features !
203  - only top of the Gremlin logo is displayed and it is also used for hi-scores
204  - all intro texts have been changed
205  - "2'ST" instead of "2'ND" and "RECORD" instead of "HI-SCORE"
206  - additional "PLAYER 1/2" messages when player changes
207  - inputs : player 1 controls are used by players 1 and 2, even in a "cocktail"
208    cabinet (player 2 inputs are never read due to code at 0x2b1c and 0x3313)
209  - 2 coins slots with different settings :
210      * coin A : 1C_1C / 2C_1C / 3C_1C / 4C_1C
211      * coin B : 1C_1C / 1C_2C / 1C_3C / "Free Play"
212    additional wrong (Spanish) text displayed when "Coin B" set to 1C_1C
213    (check additional code at 0x0fae) :
214      * if "Coin A" set to 4C_1C, "1 MONEDA 1 PARTIDA" on one line
215      * if "Coin A" set to 2C_1C, "1 MONEDA 1 PARTIDA" on one line
216        and "2 MONEDAS 3 PARTIDAS" on another line below
217    when "Coin B" set to "Free Play", "CREDIT 04" instead of "FREE PLAY" string
218    (even if this number of credits is decremented when you press a START button,
219     it is put back to 04 when the game is over for all players)
220  - additional "POR" display after the number of credits
221  - bonus life always 50000 due to code at 0x2f68
222  - only English text due to code at 0x2f53
223  - hi-score : 3 chars, 60 seconds to enter
224  - players bullet speed : 9 or 12 pixels (using previous "Language" Dip Switch) -
225    lower limit : 0x0f (see additional routine at 0x0007 and call from 0x3407)
226  - game difficulty using previous "Bonus Life" Dip Switch (code at 0x2962)
227    however, even with "Easy" difficulty, the game is much harder as in 'mooncrs2'
228    as enemies as enemies move much faster and as they shoot on some levels
229  - docking stage is harder has there are gaps of 2 pixels instead of 1
230  - when you complete the 8 stages, "O.K." "FANTASTIC" messages on 2 lines
231    instead of "FAR OUT !" message on 1 line
232  - same ingame bug as in 'mooncrst'
233  - another ingame bug : when in "cocktail mode", "PLAYER 1/2" messages are
234    displayed BEFORE the screen is flipped (back)
235  - driver other bugs :
236      * when screen is flipped, player's bullets aren't displayed
237      * when screen is flipped, enemies' bullets aren't flipped
238
239n) 'spcdrag'
240
241  - bootleg
242  - heavily based on 'smooncrs' (so there's a RAM/ROM check) but some differences though
243  - same intro texts as in 'mooncrs2'
244  - 2 coins slots with different settings :
245      * coin A : 1C_1C / 2C_1C / 3C_1C / 4C_1C
246      * coin B : 1C_2C / 1C_3C / 1C_4C / "Free Play"
247    additional wrong (Engrish) text displayed when "Coin B" set to 1C_2C
248    (check additional code at 0x0fae) :
249      * if "Coin A" set to 4C_1C, "1 COIN   1 PLAY   " on one line
250      * if "Coin A" set to 2C_1C, "1 COIN   1 PLAY   " on one line
251        and "2 COINS   3 PLAYES  " (notice the spelling) on another line below
252    when "Coin B" set to "Free Play", "CREDIT 04" instead of "FREE PLAY" string
253    (even if this number of credits is decremented when you press a START button,
254     it is put back to 04 when the game is over for all players)
255  - "CAP 2" display instead of "POR" after the number of credits
256  - hi-score : 11 chars (even if only 10 will be displayed), 60 seconds to enter
257    (same as in 'mooncrs2')
258  - players bullet speed : 6 or 9 pixels (using previous "Language" Dip Switch) -
259    lower limit : 0x04 (instead of speed 9/12 and lower limit 0x0f)
260  - even if there's also the "Difficulty" Dip Switch, the game is a little bit easier
261    (enemies speed is slower and docking stage is back to 1 pixel to fit 'mooncrs2')
262  - when you complete the 8 stages, same "FAR OUT !" message as in 'mooncrs2'
263  - driver bug : even if player's bullets are displayed when screen is flipped as in
264    other sets, enemies' bullets are still not flipped as in 'smooncrs'
265
266o) 'spcdraga'
267
268  - bootleg ? (there's a Nichibutsu logo which is displayed in the "title" screen
269    as well as in the hi-scores)
270  - very similar to 'spcdrag' with the only following (comestical) differences :
271      * unused routine at 0x37a8 has been "noped"
272      * no text after the number of credits
273      * all texts have been translated to Spanish
274
275p) 'mooncrgx'
276
277  - bootleg on "Galaxian" hardware
278  - very similar to 'mooncrsb' with the only following differences :
279      * all unused routines have been "noped"
280      * settings are different (see below)
281  - 2 coins slots with different settings :
282      * coin A : 1C_1C / 2C_1C
283      * coin B : 1C_3C / 1C_5C
284  - there are writes to 0x6003 when you press COIN1 but not when you press COIN2
285  - there are also writes to (unmapped) 0x6804 when you press either COIN1 or COIN2 :
286      * when you press COIN1, 0x00 is written once
287      * when you press COIN2, 0x01 is written 5 times, then 0x00 is written once
288  - only English text (Dip Switch has no effect due to code at 0x2f4b)
289  - no ingame bug due to code at 0x2f77
290  - driver possible bug : while sprites are now correct when screen is flipped,
291    they are too shifted when screen is not flipped (again, see for example player 2
292    score which misses ending '0') while bullets shall be good
293    as a consequence, square around letters is wrong when entering player name
294    for hi-score table when screen not is flipped
295
296
297Notes about 'azurian' :
298-----------------------
299
300  bit 6 of IN1 is linked with bit 2 of IN2 (check code at 0x05b3) to set difficulty :
301
302    bit 6  bit 2        contents of
303     IN1     IN2          0x40f4            consequences                   difficulty
304
305     OFF     OFF             2          aliens move 2 frames out of 3       easy
306     ON      OFF             4          aliens move 4 frames out of 5       hard
307     OFF     ON              3          aliens move 3 frames out of 4       normal
308     ON      ON              5          aliens move 5 frames out of 6       very hard
309
310  aliens movements is handled by routine at 0x1d59 :
311
312    - alien 1 moves when 0x4044 != 0 else contents of 0x40f4 is stored at 0x4044
313    - alien 2 moves when 0x4054 != 0 else contents of 0x40f4 is stored at 0x4054
314    - alien 3 moves when 0x4064 != 0 else contents of 0x40f4 is stored at 0x4064
315
316
317Notes about 'scorpnmc' :
318-----------------------
319
320  As the START buttons are also the buttons for player 1, how should I map them ?
321  I've coded this the same way as in 'checkman', but I'm not sure this is correct.
322
323  I can't tell if it's a bug, but if you reset the game when the screen is flipped,
324  the screens remains flipped (the "flip screen" routine doesn't seem to be called) !
325
326
327
328Notes about 'frogg' :
329---------------------
330
331  If bit 5 of IN0 or bit 5 of IN1 is HIGH, something strange occurs (check code
332  at 0x3580) : each time you press START2 a counter at 0x47da is incremented.
333  When this counter reaches 0x2f, each next time you press START2, it acts as if
334  you had pressed COIN2, so credits are added !
335  Bit 5 of IN0 is tested if "Cabinet" Dip Switch is set to "Upright" and
336  bit 5 of IN1 is tested if "Cabinet" Dip Switch is set to "Cocktail".
337
338
339
340TO DO :
341-------
342
343  - smooncrs : fix read/writes at/to unmapped memory (when player 2, "cocktail" mode)
344               fix the ?#! bug with "bullets" (when player 2, "cocktail" mode)
345  - frogg    : fix read/writes at/to unmapped/wrong memory
346  - scprpng  : fix read/writes at/to unmapped/wrong memory
347
348***************************************************************************/
349
350#include "driver.h"
351#include "deprecat.h"
352#include "cpu/z80/z80.h"
353#include "cpu/s2650/s2650.h"
354#include "galaxold.h"
355#include "sound/ay8910.h"
356#include "sound/sn76496.h"
357#include "sound/dac.h"
358#include "sound/flt_rc.h"
359#include "includes/cclimber.h"
360
361
362/*************************************
363 *
364 *  Constants
365 *
366 *************************************/
367
368#define MASTER_CLOCK      (18432000)
369
370#define PIXEL_CLOCK         (MASTER_CLOCK/3)
371
372/* H counts from 128->511, HBLANK starts at 128 and ends at 256 */
373#define HTOTAL            (384)
374#define HBEND            (0)      /*(256)*/
375#define HBSTART            (256)   /*(128)*/
376
377#define VTOTAL            (264)
378#define VBEND            (16)
379#define VBSTART            (224+16)
380
381
382
383/* Send sound data to the sound cpu and cause an nmi */
384static READ8_HANDLER( drivfrcg_port0_r )
385{
386   switch (activecpu_get_pc())
387   {
388      case 0x002e:
389      case 0x0297:
390         return 0x01;
391   }
392
393    return 0;
394}
395
396
397static ADDRESS_MAP_START( galaxold_readmem, ADDRESS_SPACE_PROGRAM, 8 )
398   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
399   AM_RANGE(0x4000, 0x47ff) AM_READ(SMH_RAM)
400   AM_RANGE(0x5000, 0x53ff) AM_READ(SMH_RAM)
401   AM_RANGE(0x5400, 0x57ff) AM_READ(galaxold_videoram_r)
402   AM_RANGE(0x5800, 0x58ff) AM_READ(SMH_RAM)
403   AM_RANGE(0x6000, 0x6000) AM_READ(input_port_0_r)
404   AM_RANGE(0x6800, 0x6800) AM_READ(input_port_1_r)
405   AM_RANGE(0x7000, 0x7000) AM_READ(input_port_2_r)
406   AM_RANGE(0x7800, 0x7fff) AM_READ(watchdog_reset_r)
407   AM_RANGE(0xfffc, 0xffff) AM_READ(SMH_RAM)
408ADDRESS_MAP_END
409
410static ADDRESS_MAP_START( galaxold_writemem, ADDRESS_SPACE_PROGRAM, 8 )
411   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
412   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM)
413   AM_RANGE(0x5000, 0x53ff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
414   AM_RANGE(0x5800, 0x583f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
415   AM_RANGE(0x5840, 0x585f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
416   AM_RANGE(0x5860, 0x587f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
417   AM_RANGE(0x5880, 0x58ff) AM_WRITE(SMH_RAM)
418   AM_RANGE(0x6000, 0x6001) AM_WRITE(galaxold_leds_w)
419   AM_RANGE(0x6002, 0x6002) AM_WRITE(galaxold_coin_lockout_w)
420   AM_RANGE(0x6003, 0x6003) AM_WRITE(galaxold_coin_counter_w)
421   AM_RANGE(0x6004, 0x6007) AM_WRITE(galaxian_lfo_freq_w)
422   AM_RANGE(0x6800, 0x6802) AM_WRITE(galaxian_background_enable_w)
423   AM_RANGE(0x6803, 0x6803) AM_WRITE(galaxian_noise_enable_w)
424   AM_RANGE(0x6805, 0x6805) AM_WRITE(galaxian_shoot_enable_w)
425   AM_RANGE(0x6806, 0x6807) AM_WRITE(galaxian_vol_w)
426   AM_RANGE(0x7001, 0x7001) AM_WRITE(galaxold_nmi_enable_w)
427   AM_RANGE(0x7004, 0x7004) AM_WRITE(galaxold_stars_enable_w)
428   AM_RANGE(0x7006, 0x7006) AM_WRITE(galaxold_flip_screen_x_w)
429   AM_RANGE(0x7007, 0x7007) AM_WRITE(galaxold_flip_screen_y_w)
430   AM_RANGE(0x7800, 0x7800) AM_WRITE(galaxian_pitch_w)
431   AM_RANGE(0xfffc, 0xffff) AM_WRITE(SMH_RAM)
432ADDRESS_MAP_END
433
434
435static ADDRESS_MAP_START( mooncrst_readmem, ADDRESS_SPACE_PROGRAM, 8 )
436   AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM)
437   AM_RANGE(0x8000, 0x87ff) AM_READ(SMH_RAM)
438   AM_RANGE(0x9000, 0x93ff) AM_READ(SMH_RAM)
439   AM_RANGE(0x9400, 0x97ff) AM_READ(galaxold_videoram_r)
440   AM_RANGE(0x9800, 0x98ff) AM_READ(SMH_RAM)
441   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
442   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)
443   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)
444   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
445ADDRESS_MAP_END
446
447static ADDRESS_MAP_START( mooncrst_writemem, ADDRESS_SPACE_PROGRAM, 8 )
448   AM_RANGE(0x0000, 0x5fff) AM_WRITE(SMH_ROM)
449   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM)
450   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
451   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
452   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
453   AM_RANGE(0x9860, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
454   AM_RANGE(0x9880, 0x98ff) AM_WRITE(SMH_RAM)
455   AM_RANGE(0xa003, 0xa003) AM_WRITE(galaxold_coin_counter_w)
456   AM_RANGE(0xa004, 0xa007) AM_WRITE(galaxian_lfo_freq_w)
457   AM_RANGE(0xa800, 0xa802) AM_WRITE(galaxian_background_enable_w)
458   AM_RANGE(0xa803, 0xa803) AM_WRITE(galaxian_noise_enable_w)
459   AM_RANGE(0xa805, 0xa805) AM_WRITE(galaxian_shoot_enable_w)
460   AM_RANGE(0xa806, 0xa807) AM_WRITE(galaxian_vol_w)
461   AM_RANGE(0xb000, 0xb000) AM_WRITE(galaxold_nmi_enable_w)
462   AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxold_stars_enable_w)
463   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxold_flip_screen_x_w)
464   AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxold_flip_screen_y_w)
465   AM_RANGE(0xb800, 0xb800) AM_WRITE(galaxian_pitch_w)
466ADDRESS_MAP_END
467
468static ADDRESS_MAP_START( rockclim_readmem, ADDRESS_SPACE_PROGRAM, 8 )
469   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
470   AM_RANGE(0x4000, 0x47ff) AM_READ(rockclim_videoram_r)
471   AM_RANGE(0x5000, 0x53ff) AM_READ(SMH_RAM)
472   AM_RANGE(0x6000, 0x7fff) AM_READ(SMH_ROM)
473   AM_RANGE(0x8000, 0x87ff) AM_READ(SMH_RAM)
474   AM_RANGE(0x8800, 0x8800) AM_READ(input_port_3_r)
475   AM_RANGE(0x9000, 0x93ff) AM_READ(SMH_RAM)
476   AM_RANGE(0x9400, 0x97ff) AM_READ(galaxold_videoram_r)
477   AM_RANGE(0x9800, 0x98ff) AM_READ(SMH_RAM)
478   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
479   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)
480   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)
481   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
482ADDRESS_MAP_END
483
484static ADDRESS_MAP_START( rockclim_writemem, ADDRESS_SPACE_PROGRAM, 8 )
485   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
486   AM_RANGE(0x4000, 0x47ff) AM_WRITE(rockclim_videoram_w) AM_BASE(&rockclim_videoram)//4800 - 4803 = bg scroll ?
487   AM_RANGE(0x4800, 0x4803) AM_WRITE(rockclim_scroll_w)
488   AM_RANGE(0x5000, 0x53ff) AM_WRITE(SMH_RAM)//?
489   AM_RANGE(0x6000, 0x7fff) AM_WRITE(SMH_ROM)
490   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM)
491   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
492   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
493   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
494   AM_RANGE(0x9860, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
495   AM_RANGE(0x9880, 0x98ff) AM_WRITE(SMH_RAM)
496   AM_RANGE(0xa000, 0xa002) AM_WRITE(galaxold_gfxbank_w)// a002 - sprite bank
497   AM_RANGE(0xa003, 0xa003) AM_WRITE(galaxold_coin_counter_w)
498   AM_RANGE(0xa004, 0xa007) AM_WRITE(galaxian_lfo_freq_w)
499   AM_RANGE(0xa800, 0xa802) AM_WRITE(galaxian_background_enable_w)
500   AM_RANGE(0xa803, 0xa803) AM_WRITE(galaxian_noise_enable_w)
501   AM_RANGE(0xa805, 0xa805) AM_WRITE(galaxian_shoot_enable_w)
502   AM_RANGE(0xa806, 0xa807) AM_WRITE(galaxian_vol_w)
503   AM_RANGE(0xb000, 0xb000) AM_WRITE(galaxold_nmi_enable_w)
504   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxold_flip_screen_x_w)
505   AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxold_flip_screen_y_w)
506   AM_RANGE(0xb800, 0xb800) AM_WRITE(galaxian_pitch_w)
507ADDRESS_MAP_END
508
509
510static ADDRESS_MAP_START( scramblb_readmem, ADDRESS_SPACE_PROGRAM, 8 )
511   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
512   AM_RANGE(0x4000, 0x4bff) AM_READ(SMH_RAM)
513   AM_RANGE(0x5000, 0x50ff) AM_READ(SMH_RAM)
514   AM_RANGE(0x6000, 0x6000) AM_READ(input_port_0_r)
515   AM_RANGE(0x6800, 0x6800) AM_READ(input_port_1_r)
516   AM_RANGE(0x7000, 0x7000) AM_READ(input_port_2_r)
517   AM_RANGE(0x7800, 0x7800) AM_READ(watchdog_reset_r)
518   AM_RANGE(0x8102, 0x8102) AM_READ(scramblb_protection_1_r)
519   AM_RANGE(0x8202, 0x8202) AM_READ(scramblb_protection_2_r)
520ADDRESS_MAP_END
521
522static ADDRESS_MAP_START( scramblb_writemem, ADDRESS_SPACE_PROGRAM, 8 )
523   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
524   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM)
525   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
526   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
527   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
528   AM_RANGE(0x5060, 0x507f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
529   AM_RANGE(0x5080, 0x50ff) AM_WRITE(SMH_RAM)
530   AM_RANGE(0x6000, 0x6001) AM_WRITE(SMH_NOP)  /* sound triggers */
531   AM_RANGE(0x6003, 0x6003) AM_WRITE(galaxold_coin_counter_w)
532   AM_RANGE(0x6004, 0x6007) AM_WRITE(galaxian_lfo_freq_w)
533   AM_RANGE(0x6800, 0x6802) AM_WRITE(galaxian_background_enable_w)
534   AM_RANGE(0x6803, 0x6803) AM_WRITE(galaxian_noise_enable_w)
535   AM_RANGE(0x6805, 0x6805) AM_WRITE(galaxian_shoot_enable_w)
536   AM_RANGE(0x6806, 0x6807) AM_WRITE(galaxian_vol_w)
537   AM_RANGE(0x7001, 0x7001) AM_WRITE(galaxold_nmi_enable_w)
538   AM_RANGE(0x7002, 0x7002) AM_WRITE(galaxold_coin_counter_w)
539   AM_RANGE(0x7003, 0x7003) AM_WRITE(scrambold_background_enable_w)
540   AM_RANGE(0x7004, 0x7004) AM_WRITE(galaxold_stars_enable_w)
541   AM_RANGE(0x7006, 0x7006) AM_WRITE(galaxold_flip_screen_x_w)
542   AM_RANGE(0x7007, 0x7007) AM_WRITE(galaxold_flip_screen_y_w)
543   AM_RANGE(0x7800, 0x7800) AM_WRITE(galaxian_pitch_w)
544ADDRESS_MAP_END
545
546
547
548static READ8_HANDLER( scramb2_protection_r ) { return 0x25; }
549static READ8_HANDLER( scramb2_port0_r ) { return (readinputport(0)>>offset)&0x1; }
550static READ8_HANDLER( scramb2_port1_r ) { return (readinputport(1)>>offset)&0x1; }
551static READ8_HANDLER( scramb2_port2_r ) { return (readinputport(2)>>offset)&0x1; }
552
553static ADDRESS_MAP_START( scramb2_readmem, ADDRESS_SPACE_PROGRAM, 8 )
554   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
555   AM_RANGE(0x4000, 0x4bff) AM_READ(SMH_RAM)
556   AM_RANGE(0x5000, 0x50ff) AM_READ(SMH_RAM)
557   AM_RANGE(0x5800, 0x5fff) AM_READ(scramb2_protection_r) // must return 0x25
558   AM_RANGE(0x6000, 0x6007) AM_READ(scramb2_port0_r) // reads from 8 addresses, 1 bit per address
559   AM_RANGE(0x6800, 0x6807) AM_READ(scramb2_port1_r) // reads from 8 addresses, 1 bit per address
560   AM_RANGE(0x7000, 0x7007) AM_READ(watchdog_reset_r)
561   AM_RANGE(0x7800, 0x7807) AM_READ(scramb2_port2_r) // reads from 8 addresses, 1 bit per address
562ADDRESS_MAP_END
563
564static ADDRESS_MAP_START( scramb2_writemem, ADDRESS_SPACE_PROGRAM, 8 )
565   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
566   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM)
567   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
568   AM_RANGE(0x4c00, 0x4fff) AM_WRITE(galaxold_videoram_w) // mirror
569   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
570   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
571   AM_RANGE(0x5060, 0x507f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
572   AM_RANGE(0x5080, 0x50ff) AM_WRITE(SMH_RAM)
573   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxold_nmi_enable_w)
574   AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxold_coin_counter_w)
575   AM_RANGE(0x6804, 0x6804) AM_WRITE(galaxold_stars_enable_w)
576   AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxold_flip_screen_x_w)
577   AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxold_flip_screen_y_w)
578   AM_RANGE(0x7006, 0x7006) AM_WRITE(SMH_NOP)
579   AM_RANGE(0x7007, 0x7007) AM_WRITE(SMH_NOP)
580   AM_RANGE(0x7800, 0x7800) AM_WRITE(galaxian_pitch_w)
581ADDRESS_MAP_END
582
583
584
585static ADDRESS_MAP_START( _4in1_readmem, ADDRESS_SPACE_PROGRAM, 8 )
586   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_BANK1)   /* banked game code */
587   AM_RANGE(0x4000, 0x47ff) AM_READ(SMH_RAM)
588   AM_RANGE(0x5000, 0x53ff) AM_READ(SMH_RAM)
589   AM_RANGE(0x5400, 0x57ff) AM_READ(galaxold_videoram_r)
590   AM_RANGE(0x5800, 0x58ff) AM_READ(SMH_RAM)
591   AM_RANGE(0x6000, 0x6000) AM_READ(input_port_0_r)
592   AM_RANGE(0x6800, 0x6800) AM_READ(_4in1_input_port_1_r)
593   AM_RANGE(0x7000, 0x7000) AM_READ(_4in1_input_port_2_r)
594   AM_RANGE(0x7800, 0x78ff) AM_READ(watchdog_reset_r)
595   AM_RANGE(0xc000, 0xdfff) AM_READ(SMH_ROM)   /* fixed menu code */
596ADDRESS_MAP_END
597
598static ADDRESS_MAP_START( _4in1_writemem, ADDRESS_SPACE_PROGRAM, 8 )
599   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)   /* banked game code */
600   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM)
601   AM_RANGE(0x5000, 0x53ff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
602   AM_RANGE(0x5800, 0x583f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
603   AM_RANGE(0x5840, 0x585f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
604   AM_RANGE(0x5860, 0x587f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
605   AM_RANGE(0x5880, 0x58ff) AM_WRITE(SMH_RAM)
606   AM_RANGE(0x6000, 0x6001) AM_WRITE(galaxold_leds_w)
607//  AM_RANGE(0x6002, 0x6002) AM_WRITE(galaxold_coin_lockout_w)
608   AM_RANGE(0x6003, 0x6003) AM_WRITE(galaxold_coin_counter_w)
609   AM_RANGE(0x6004, 0x6007) AM_WRITE(galaxian_lfo_freq_w)
610   AM_RANGE(0x6800, 0x6802) AM_WRITE(galaxian_background_enable_w)
611//  AM_RANGE(0x6803, 0x6803) AM_WRITE(galaxian_noise_enable_w) /* not hooked up? */
612   AM_RANGE(0x6805, 0x6805) AM_WRITE(galaxian_shoot_enable_w)
613   AM_RANGE(0x6806, 0x6807) AM_WRITE(galaxian_vol_w)
614   AM_RANGE(0x7001, 0x7001) AM_WRITE(galaxold_nmi_enable_w)
615   AM_RANGE(0x7004, 0x7004) AM_WRITE(galaxold_stars_enable_w)
616   AM_RANGE(0x7006, 0x7006) AM_WRITE(galaxold_flip_screen_x_w)
617   AM_RANGE(0x7007, 0x7007) AM_WRITE(galaxold_flip_screen_y_w)
618   AM_RANGE(0x7800, 0x7800) AM_WRITE(galaxian_pitch_w)
619   AM_RANGE(0x8000, 0x8000) AM_WRITE(_4in1_bank_w)
620   AM_RANGE(0xc000, 0xdfff) AM_WRITE(SMH_ROM) /* Fixed Menu Code */
621ADDRESS_MAP_END
622
623
624static ADDRESS_MAP_START( bagmanmc_readmem, ADDRESS_SPACE_PROGRAM, 8 )
625   AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM)
626   AM_RANGE(0x6000, 0x67ff) AM_READ(SMH_RAM)
627   AM_RANGE(0x9000, 0x93ff) AM_READ(SMH_RAM)
628   AM_RANGE(0x9400, 0x97ff) AM_READ(galaxold_videoram_r)
629   AM_RANGE(0x9800, 0x98ff) AM_READ(SMH_RAM)
630   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
631   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)
632   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)
633   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
634ADDRESS_MAP_END
635
636static ADDRESS_MAP_START( bagmanmc_writemem, ADDRESS_SPACE_PROGRAM, 8 )
637   AM_RANGE(0x0000, 0x5fff) AM_WRITE(SMH_ROM)
638   AM_RANGE(0x6000, 0x67ff) AM_WRITE(SMH_RAM)
639   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
640   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
641   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
642   AM_RANGE(0x9860, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
643   AM_RANGE(0x9880, 0x98ff) AM_WRITE(SMH_RAM)
644   AM_RANGE(0xa003, 0xa003) AM_WRITE(galaxold_coin_counter_w)
645   AM_RANGE(0xa803, 0xa803) AM_WRITE(galaxian_noise_enable_w)
646   AM_RANGE(0xb001, 0xb001) AM_WRITE(galaxold_nmi_enable_w)
647   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxold_flip_screen_x_w)
648   AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxold_flip_screen_y_w)
649   AM_RANGE(0xb800, 0xb800) AM_WRITE(galaxian_pitch_w)
650ADDRESS_MAP_END
651
652static ADDRESS_MAP_START( dkongjrm_readmem, ADDRESS_SPACE_PROGRAM, 8 )
653   AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM)
654   AM_RANGE(0x6000, 0x6fff) AM_READ(SMH_RAM)
655   AM_RANGE(0x7000, 0x7fff) AM_READ(SMH_ROM)
656   AM_RANGE(0x9000, 0x93ff) AM_READ(SMH_RAM)
657   AM_RANGE(0xa000, 0xa0ff) AM_READ(input_port_0_r)
658   AM_RANGE(0xa800, 0xa8ff) AM_READ(input_port_1_r)
659   AM_RANGE(0xb000, 0xb0ff) AM_READ(input_port_2_r)
660   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
661ADDRESS_MAP_END
662
663static ADDRESS_MAP_START( dkongjrm_writemem, ADDRESS_SPACE_PROGRAM, 8 )
664   AM_RANGE(0x0000, 0x5fff) AM_WRITE(SMH_ROM)
665   AM_RANGE(0x6000, 0x6fff) AM_WRITE(SMH_RAM)
666   AM_RANGE(0x7000, 0x7fff) AM_WRITE(SMH_ROM)
667   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
668   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
669   AM_RANGE(0x9840, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
670   AM_RANGE(0x98c0, 0x98ff) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram2) AM_SIZE(&galaxold_spriteram2_size)
671   AM_RANGE(0xa003, 0xa003) AM_WRITE(galaxold_coin_counter_w)
672  //AM_RANGE(0xa004, 0xa007) AM_WRITE(galaxian_lfo_freq_w)
673   AM_RANGE(0xa800, 0xa802) AM_WRITE(galaxian_background_enable_w)
674   AM_RANGE(0xa803, 0xa803) AM_WRITE(galaxian_noise_enable_w)
675  //AM_RANGE(0xa805, 0xa805) AM_WRITE(galaxian)
676   AM_RANGE(0xa806, 0xa807) AM_WRITE(galaxian_vol_w)
677   AM_RANGE(0xb000, 0xb000) AM_WRITE(galaxold_gfxbank_w)
678   AM_RANGE(0xb001, 0xb001) AM_WRITE(galaxold_nmi_enable_w)
679  //AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxold_stars_enable_w)
680   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxold_flip_screen_x_w)
681   AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxold_flip_screen_y_w)
682   AM_RANGE(0xb800, 0xb800) AM_WRITE(galaxian_pitch_w)
683ADDRESS_MAP_END
684
685
686static ADDRESS_MAP_START( ozon1_readmem, ADDRESS_SPACE_PROGRAM, 8 )
687   AM_RANGE(0x0000, 0x2fff) AM_READ(SMH_ROM)
688   AM_RANGE(0x4000, 0x4200) AM_READ(SMH_RAM)
689   AM_RANGE(0x4300, 0x43ff) AM_READ(SMH_RAM)
690   AM_RANGE(0x4800, 0x4bff) AM_READ(galaxold_videoram_r)
691   AM_RANGE(0x5000, 0x503f) AM_READ(SMH_RAM)
692   AM_RANGE(0x5040, 0x505f) AM_READ(SMH_RAM)
693   AM_RANGE(0x8100, 0x8100) AM_READ(input_port_0_r)
694   AM_RANGE(0x8101, 0x8101) AM_READ(input_port_1_r)
695   AM_RANGE(0x8102, 0x8102) AM_READ(input_port_2_r)
696ADDRESS_MAP_END
697
698static ADDRESS_MAP_START( ozon1_writemem, ADDRESS_SPACE_PROGRAM, 8 )
699   AM_RANGE(0x0000, 0x2fff) AM_WRITE(SMH_ROM)
700   AM_RANGE(0x4000, 0x4200) AM_WRITE(SMH_RAM)
701   AM_RANGE(0x4300, 0x43ff) AM_WRITE(SMH_RAM)
702   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
703   AM_RANGE(0x4c00, 0x4fff) AM_WRITE(galaxold_videoram_w)
704   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
705   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
706   AM_RANGE(0x6801, 0x6801) AM_WRITE(SMH_NOP) //continuosly 0 and 1
707   AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxold_coin_counter_w)
708   AM_RANGE(0x6806, 0x6806) AM_WRITE(SMH_NOP) //only one 0 at reset
709   AM_RANGE(0x6807, 0x6807) AM_WRITE(SMH_NOP) //only one 0 at reset
710   AM_RANGE(0x8103, 0x8103) AM_WRITE(SMH_NOP) //only one 9b at reset
711ADDRESS_MAP_END
712
713static ADDRESS_MAP_START( ozon1_writeport, ADDRESS_SPACE_IO, 8 )
714   ADDRESS_MAP_GLOBAL_MASK(0xff)
715   AM_RANGE(0x00, 0x00) AM_WRITE(AY8910_write_port_0_w)
716   AM_RANGE(0x01, 0x01) AM_WRITE(AY8910_control_port_0_w)
717ADDRESS_MAP_END
718
719static ADDRESS_MAP_START( drivfrcg, ADDRESS_SPACE_PROGRAM, 8 )
720   AM_RANGE(0x0000, 0x0fff) AM_ROM
721   AM_RANGE(0x1480, 0x14bf) AM_MIRROR(0x6000) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
722   AM_RANGE(0x14c0, 0x14ff) AM_MIRROR(0x6000) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
723   AM_RANGE(0x1500, 0x1500) AM_MIRROR(0x6000) AM_READ(input_port_0_r)
724   AM_RANGE(0x1503, 0x1503) AM_MIRROR(0x6000) AM_WRITE(galaxold_coin_counter_w)
725   AM_RANGE(0x1580, 0x1580) AM_MIRROR(0x6000) AM_READ(input_port_1_r)
726   AM_RANGE(0x1580, 0x1582) AM_MIRROR(0x6000) AM_WRITE(galaxian_background_enable_w)
727   AM_RANGE(0x1583, 0x1583) AM_MIRROR(0x6000) AM_WRITE(SMH_NOP)
728   AM_RANGE(0x1585, 0x1585) AM_MIRROR(0x6000) AM_WRITE(SMH_NOP)
729   AM_RANGE(0x1586, 0x1587) AM_MIRROR(0x6000) AM_WRITE(galaxian_lfo_freq_w)
730   AM_RANGE(0x1600, 0x1600) AM_MIRROR(0x6000) AM_READWRITE(input_port_2_r, galaxian_pitch_w)
731   AM_RANGE(0x1700, 0x1700) AM_MIRROR(0x6000) AM_READWRITE(input_port_3_r, SMH_NOP)
732   AM_RANGE(0x1701, 0x1701) AM_MIRROR(0x6000) AM_WRITE(SMH_NOP)
733   AM_RANGE(0x1704, 0x1707) AM_MIRROR(0x6000) AM_WRITE(galaxian_vol_w)
734   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
735   AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
736   AM_RANGE(0x2000, 0x2fff) AM_ROM
737   AM_RANGE(0x4000, 0x4fff) AM_ROM
738   AM_RANGE(0x6000, 0x6fff) AM_ROM
739ADDRESS_MAP_END
740
741static ADDRESS_MAP_START( drivfrcg_io, ADDRESS_SPACE_IO, 8 )
742   AM_RANGE(0x00, 0x00) AM_READ(drivfrcg_port0_r)
743   AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READWRITE(input_port_4_r, SMH_NOP)
744ADDRESS_MAP_END
745
746static ADDRESS_MAP_START( bongo, ADDRESS_SPACE_PROGRAM, 8 )
747   AM_RANGE(0x0000, 0x5fff) AM_ROM
748   AM_RANGE(0x8000, 0x83ff) AM_RAM
749   AM_RANGE(0x8400, 0x87ff) AM_WRITE(SMH_NOP) // not used
750   AM_RANGE(0x9000, 0x93ff) AM_READWRITE(SMH_RAM, galaxold_videoram_w) AM_BASE(&galaxold_videoram)
751   AM_RANGE(0x9400, 0x97ff) AM_WRITE(SMH_NOP) // not used
752   AM_RANGE(0x9800, 0x983f) AM_READWRITE(SMH_RAM, galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
753   AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
754   AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
755   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
756   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)
757   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)
758   AM_RANGE(0xb001, 0xb001) AM_WRITE(galaxold_nmi_enable_w)
759   AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxold_stars_enable_w)
760   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxold_flip_screen_x_w)
761   AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxold_flip_screen_y_w)
762   AM_RANGE(0xb800, 0xb800) AM_READWRITE(watchdog_reset_r, SMH_NOP)
763ADDRESS_MAP_END
764
765static ADDRESS_MAP_START( bongo_io, ADDRESS_SPACE_IO, 8 )
766   ADDRESS_MAP_GLOBAL_MASK(0xff)
767   AM_RANGE(0x00, 0x00) AM_WRITE(AY8910_control_port_0_w)
768   AM_RANGE(0x01, 0x01) AM_WRITE(AY8910_write_port_0_w)
769   AM_RANGE(0x02, 0x02) AM_READ(AY8910_read_port_0_r)
770ADDRESS_MAP_END
771
772
773static ADDRESS_MAP_START( hunchbkg, ADDRESS_SPACE_PROGRAM, 8 )
774   AM_RANGE(0x0000, 0x0fff) AM_ROM
775   AM_RANGE(0x1480, 0x14bf) AM_MIRROR(0x6000) AM_READWRITE(SMH_RAM, galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
776   AM_RANGE(0x14c0, 0x14ff) AM_MIRROR(0x6000) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
777   AM_RANGE(0x1500, 0x1500) AM_MIRROR(0x6000) AM_READ(input_port_0_r)
778   AM_RANGE(0x1503, 0x1503) AM_MIRROR(0x6000) AM_WRITE(galaxold_coin_counter_w)
779   AM_RANGE(0x1580, 0x1580) AM_MIRROR(0x6000) AM_READ(input_port_1_r)
780   AM_RANGE(0x1580, 0x1582) AM_MIRROR(0x6000) AM_WRITE(galaxian_background_enable_w)
781   AM_RANGE(0x1583, 0x1583) AM_MIRROR(0x6000) AM_WRITE(SMH_NOP)
782   AM_RANGE(0x1584, 0x1587) AM_MIRROR(0x6000) AM_WRITE(galaxian_lfo_freq_w)
783   AM_RANGE(0x1600, 0x1600) AM_MIRROR(0x6000) AM_READ(input_port_2_r)
784   AM_RANGE(0x1600, 0x1601) AM_MIRROR(0x6000) AM_WRITE(SMH_NOP)
785   AM_RANGE(0x1604, 0x1604) AM_MIRROR(0x6000) AM_WRITE(SMH_NOP)
786   AM_RANGE(0x1606, 0x1606) AM_MIRROR(0x6000) AM_WRITE(galaxold_flip_screen_x_w)
787   AM_RANGE(0x1607, 0x1607) AM_MIRROR(0x6000) AM_WRITE(galaxold_flip_screen_y_w)
788   AM_RANGE(0x1680, 0x1680) AM_MIRROR(0x6000) AM_READWRITE(SMH_NOP, galaxian_pitch_w)
789   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
790   AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
791   AM_RANGE(0x2000, 0x2fff) AM_ROM
792   AM_RANGE(0x4000, 0x4fff) AM_ROM
793   AM_RANGE(0x6000, 0x6fff) AM_ROM
794ADDRESS_MAP_END
795
796static ADDRESS_MAP_START( hunchbkg_io, ADDRESS_SPACE_IO, 8 )
797   AM_RANGE(S2650_DATA_PORT,  S2650_DATA_PORT) AM_READ(SMH_NOP) // not used
798   AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ(input_port_3_r)
799ADDRESS_MAP_END
800
801static ADDRESS_MAP_START( harem_cpu1, ADDRESS_SPACE_PROGRAM, 8 )
802   AM_RANGE(0x0000, 0x1fff) AM_ROM
803   AM_RANGE(0x2000, 0x27ff) AM_RAM
804   AM_RANGE(0x4000, 0x47ff) AM_RAM
805   AM_RANGE(0x4800, 0x4fff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w) AM_BASE(&galaxold_videoram)
806   AM_RANGE(0x5000, 0x5000) AM_WRITENOP
807   AM_RANGE(0x5800, 0x5800) AM_READWRITE(SMH_NOP, interrupt_enable_w)
808   AM_RANGE(0x5801, 0x5807) AM_WRITENOP
809   AM_RANGE(0x6101, 0x6101) AM_READ(input_port_0_r)
810   AM_RANGE(0x6102, 0x6102) AM_READ(input_port_1_r)
811   AM_RANGE(0x6103, 0x6103) AM_WRITENOP
812   AM_RANGE(0x6200, 0x6203) AM_WRITENOP AM_BASE(&galaxold_attributesram)
813   AM_RANGE(0x8000, 0x9fff) AM_ROM
814   AM_RANGE(0xffe6, 0xffff) AM_RAM AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
815ADDRESS_MAP_END
816
817static ADDRESS_MAP_START( harem_cpu2, ADDRESS_SPACE_PROGRAM, 8 )
818   AM_RANGE(0x0000, 0x2fff) AM_ROM
819   AM_RANGE(0x8000, 0x83ff) AM_RAM
820   AM_RANGE(0xa000, 0xa000) AM_WRITENOP
821ADDRESS_MAP_END
822
823static ADDRESS_MAP_START( harem_cpu2_io, ADDRESS_SPACE_IO, 8 )
824   ADDRESS_MAP_GLOBAL_MASK(0xff)
825   AM_RANGE(0x04, 0x04) AM_WRITE(AY8910_control_port_0_w)
826   AM_RANGE(0x08, 0x08) AM_WRITE(AY8910_write_port_0_w)
827   AM_RANGE(0x10, 0x10) AM_WRITE(AY8910_control_port_1_w)
828   AM_RANGE(0x20, 0x20) AM_WRITE(AY8910_write_port_1_w)
829   AM_RANGE(0x40, 0x40) AM_WRITE(AY8910_control_port_2_w)
830   AM_RANGE(0x80, 0x80) AM_WRITE(AY8910_write_port_2_w)
831   AM_RANGE(0x80, 0x80) AM_READ(soundlatch_r)
832ADDRESS_MAP_END
833
834static ADDRESS_MAP_START( tazzmang, ADDRESS_SPACE_PROGRAM, 8 )
835   AM_RANGE(0x0000, 0x5fff) AM_ROM
836   AM_RANGE(0x7000, 0x7000) AM_READ(input_port_2_r) /* mirror */
837   AM_RANGE(0x8000, 0x87ff) AM_RAM
838   AM_RANGE(0x8800, 0x883f) AM_READWRITE(SMH_RAM, galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
839   AM_RANGE(0x8840, 0x885f) AM_RAM AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
840   AM_RANGE(0x8860, 0x887f) AM_RAM AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
841   AM_RANGE(0x8880, 0x8bff) AM_WRITENOP
842   AM_RANGE(0x9000, 0x93ff) AM_READWRITE(SMH_RAM, galaxold_videoram_w) AM_BASE(&galaxold_videoram)
843   AM_RANGE(0x9800, 0x9800) AM_READ(watchdog_reset_r)
844   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
845   AM_RANGE(0xa7ff, 0xa7ff) AM_READ(input_port_0_r) /* mirror */
846   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r) AM_WRITE(galaxian_background_enable_w)
847   AM_RANGE(0xa803, 0xa803) AM_WRITE(galaxold_coin_counter_w)
848   AM_RANGE(0xa805, 0xa805) AM_WRITE(galaxian_shoot_enable_w)
849   AM_RANGE(0xa806, 0xa807) AM_WRITE(galaxian_vol_w)
850   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)
851   AM_RANGE(0xb001, 0xb001) AM_WRITE(galaxold_nmi_enable_w)
852   AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxold_stars_enable_w)
853   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxold_flip_screen_x_w)
854   AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxold_flip_screen_y_w)
855   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r) AM_WRITE(galaxian_pitch_w)
856ADDRESS_MAP_END
857
858static ADDRESS_MAP_START( racknrol, ADDRESS_SPACE_PROGRAM, 8 )
859   AM_RANGE(0x0000, 0x0fff) AM_ROM
860   AM_RANGE(0x1400, 0x143f) AM_MIRROR(0x6000) AM_READWRITE(SMH_RAM, galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
861   AM_RANGE(0x1440, 0x14bf) AM_MIRROR(0x6000) AM_RAM AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
862   AM_RANGE(0x14c0, 0x14ff) AM_MIRROR(0x6000) AM_RAM
863   AM_RANGE(0x1500, 0x1500) AM_MIRROR(0x6000) AM_READ(input_port_0_r)
864   AM_RANGE(0x1580, 0x1580) AM_MIRROR(0x6000) AM_READ(input_port_1_r)
865   AM_RANGE(0x1600, 0x1600) AM_MIRROR(0x6000) AM_READ(input_port_2_r)
866   AM_RANGE(0x1600, 0x1601) AM_MIRROR(0x6000) AM_WRITENOP
867   AM_RANGE(0x1606, 0x1606) AM_MIRROR(0x6000) AM_WRITE(galaxold_flip_screen_x_w)
868   AM_RANGE(0x1607, 0x1607) AM_MIRROR(0x6000) AM_WRITE(galaxold_flip_screen_y_w)
869   AM_RANGE(0x1680, 0x1680) AM_MIRROR(0x6000) AM_READNOP
870//  AM_RANGE(0x1700, 0x1700) AM_MIRROR(0x6000) AM_READ(trvchlng_question_r)
871//  AM_RANGE(0x1701, 0x1703) AM_MIRROR(0x6000) AM_READ(trvchlng_question_w)
872   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
873   AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
874   AM_RANGE(0x2000, 0x2fff) AM_ROM
875   AM_RANGE(0x4000, 0x4fff) AM_ROM
876   AM_RANGE(0x6000, 0x6fff) AM_ROM
877ADDRESS_MAP_END
878
879static ADDRESS_MAP_START( racknrol_io, ADDRESS_SPACE_IO, 8 )
880   AM_RANGE(0x1d, 0x1d) AM_WRITE(SN76496_0_w)
881   AM_RANGE(0x1e, 0x1e) AM_WRITE(SN76496_1_w)
882   AM_RANGE(0x1f, 0x1f) AM_WRITE(SN76496_2_w)
883   AM_RANGE(0x20, 0x3f) AM_WRITE(racknrol_tiles_bank_w) AM_BASE(&racknrol_tiles_bank)
884   AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ(input_port_3_r)
885ADDRESS_MAP_END
886
887static ADDRESS_MAP_START( ckongg_readmem, ADDRESS_SPACE_PROGRAM, 8 )
888
889   AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM)
890   AM_RANGE(0x6000, 0x6fff) AM_READ(SMH_RAM)
891   AM_RANGE(0x9000, 0x93ff) AM_READ(galaxold_videoram_r)
892   AM_RANGE(0x9800, 0x98ff) AM_READ(SMH_RAM)
893   AM_RANGE(0xc000, 0xc000) AM_READ(input_port_0_r)
894   AM_RANGE(0xc400, 0xc400) AM_READ(input_port_1_r)
895   AM_RANGE(0xc800, 0xc800) AM_READ(input_port_2_r)
896   AM_RANGE(0xcc00, 0xcc00) AM_READ(watchdog_reset_r)
897
898ADDRESS_MAP_END
899
900static ADDRESS_MAP_START( ckongg_writemem, ADDRESS_SPACE_PROGRAM, 8 )
901   AM_RANGE(0x0000, 0x5fff) AM_WRITE(SMH_ROM)
902   AM_RANGE(0x6000, 0x6fff) AM_WRITE(SMH_RAM)
903   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
904   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
905   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
906   AM_RANGE(0x9860, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
907   AM_RANGE(0x9880, 0x98ff) AM_WRITE(SMH_RAM)
908   AM_RANGE(0xc000, 0xc001) AM_WRITE(galaxold_leds_w)
909   AM_RANGE(0xc002, 0xc002) AM_WRITE(galaxold_coin_lockout_w)
910   AM_RANGE(0xc003, 0xc003) AM_WRITE(galaxold_coin_counter_w)
911   AM_RANGE(0xc004, 0xc007) AM_WRITE(galaxian_lfo_freq_w)
912   AM_RANGE(0xc400, 0xc402) AM_WRITE(galaxian_background_enable_w)
913   AM_RANGE(0xc403, 0xc403) AM_WRITE(galaxian_noise_enable_w)
914   AM_RANGE(0xc405, 0xc405) AM_WRITE(galaxian_shoot_enable_w)
915   AM_RANGE(0xc406, 0xc407) AM_WRITE(galaxian_vol_w)
916   AM_RANGE(0xc801, 0xc801) AM_WRITE(galaxold_nmi_enable_w)
917   AM_RANGE(0xc804, 0xc804) AM_WRITE(SMH_NOP) // link cut
918   AM_RANGE(0xc806, 0xc806) AM_WRITE(galaxold_flip_screen_x_w)
919   AM_RANGE(0xc807, 0xc807) AM_WRITE(galaxold_flip_screen_y_w)
920   AM_RANGE(0xcc00, 0xcc00) AM_WRITE(galaxian_pitch_w)
921ADDRESS_MAP_END
922
923static ADDRESS_MAP_START( kkgalax_readmem, ADDRESS_SPACE_PROGRAM, 8 )
924
925   AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM)
926   AM_RANGE(0x6000, 0x6fff) AM_READ(SMH_RAM)
927   AM_RANGE(0x9000, 0x93ff) AM_READ(galaxold_videoram_r)
928   AM_RANGE(0x9800, 0x98ff) AM_READ(SMH_RAM)
929   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
930   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)
931   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)
932//  AM_RANGE(0xcc00, 0xcc00) AM_READ(watchdog_reset_r)
933
934ADDRESS_MAP_END
935
936static ADDRESS_MAP_START( kkgalax_writemem, ADDRESS_SPACE_PROGRAM, 8 )
937   AM_RANGE(0x0000, 0x5fff) AM_WRITE(SMH_NOP)
938   AM_RANGE(0x6000, 0x6fff) AM_WRITE(SMH_RAM)
939   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
940   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
941   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
942   AM_RANGE(0x9860, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
943   AM_RANGE(0x9880, 0x98ff) AM_WRITE(SMH_RAM)
944//  AM_RANGE(0xc000, 0xc001) AM_WRITE(galaxold_leds_w)
945//  AM_RANGE(0xc002, 0xc002) AM_WRITE(galaxold_coin_lockout_w)
946//  AM_RANGE(0xc003, 0xc003) AM_WRITE(galaxold_coin_counter_w)
947//  AM_RANGE(0xc004, 0xc007) AM_WRITE(galaxian_lfo_freq_w)
948//  AM_RANGE(0xc400, 0xc402) AM_WRITE(galaxian_background_enable_w)
949//  AM_RANGE(0xc403, 0xc403) AM_WRITE(galaxian_noise_enable_w)
950//  AM_RANGE(0xc405, 0xc405) AM_WRITE(galaxian)
951//  AM_RANGE(0xc406, 0xc407) AM_WRITE(galaxian_vol_w)
952   AM_RANGE(0xb001, 0xb001) AM_WRITE(galaxold_nmi_enable_w)
953//  AM_RANGE(0xc804, 0xc804) AM_WRITE(SMH_NOP) // link cut
954//  AM_RANGE(0xc806, 0xc806) AM_WRITE(galaxold_flip_screen_x_w)
955//  AM_RANGE(0xc807, 0xc807) AM_WRITE(galaxold_flip_screen_y_w)
956//  AM_RANGE(0xcc00, 0xcc00) AM_WRITE(galaxian_pitch_w)
957ADDRESS_MAP_END
958
959static READ8_HANDLER( hexpoola_data_port_r )
960{
961   switch (activecpu_get_pc())
962   {
963      case 0x0022:
964         return 0;
965
966      case 0x0031:
967         return 1;
968   }
969
970    return 0;
971}
972
973static ADDRESS_MAP_START( hexpoola_io, ADDRESS_SPACE_IO, 8 )
974   AM_RANGE(0x00, 0x00) AM_READNOP
975   AM_RANGE(0x20, 0x3f) AM_WRITE(racknrol_tiles_bank_w) AM_BASE(&racknrol_tiles_bank)
976   AM_RANGE(S2650_DATA_PORT, S2650_DATA_PORT) AM_READWRITE(hexpoola_data_port_r, SN76496_0_w)
977   AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ(input_port_3_r)
978ADDRESS_MAP_END
979
980#define GAL_IN0\
981   PORT_START_TAG("IN0")\
982   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )\
983   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )\
984   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY\
985   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY\
986   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )\
987   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )\
988   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )\
989   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )\
990   PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )\
991   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
992
993#define GAL_IN1\
994   PORT_START_TAG("IN1")\
995   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )\
996   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )\
997   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL\
998   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL\
999   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL\
1000   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )\
1001   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )\
1002   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )\
1003   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )\
1004   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )\
1005   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
1006
1007static INPUT_PORTS_START( scramblb )
1008   PORT_START_TAG("IN0")
1009   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1010   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1011   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
1012   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1013   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1014   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
1015   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
1016   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
1017
1018   PORT_START_TAG("IN1")
1019   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1020   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1021   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1022   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1023   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1024   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
1025   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
1026   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1027   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
1028   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1029
1030   PORT_START_TAG("IN2")
1031   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) )
1032   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1033   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
1034   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
1035   PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
1036   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Lives ) )
1037   PORT_DIPSETTING(    0x00, "3" )
1038   PORT_DIPSETTING(    0x04, "4" )
1039   PORT_DIPSETTING(    0x08, "5" )
1040   PORT_DIPSETTING(    0x0c, "255 (Cheat)")
1041   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1042INPUT_PORTS_END
1043
1044
1045/* the cocktail controls only seem to be used in upright mode, is the flip flag wrong for this bootleg? */
1046static INPUT_PORTS_START( scramb2 )
1047   PORT_START_TAG("IN0")
1048   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1049   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1050    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
1051   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
1052   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1053   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1054    PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
1055    PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
1056    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1057    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
1058
1059   PORT_START_TAG("IN1")
1060   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
1061   PORT_DIPSETTING(    0x00, "3" )
1062   PORT_DIPSETTING(    0x01, "4" )
1063   PORT_DIPSETTING(    0x02, "5" )
1064   PORT_DIPSETTING(    0x03, "255 (Cheat)")
1065   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1066   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1067   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1068   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1069   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
1070   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1071
1072   PORT_START_TAG("IN2")
1073   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1074   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
1075   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1076   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
1077   PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )
1078   PORT_DIPSETTING(    0x06, DEF_STR( 1C_4C ) )
1079   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
1080   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1081   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
1082   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1083    PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
1084    PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
1085    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1086   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1087    PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
1088    PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
1089    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1090INPUT_PORTS_END
1091
1092
1093#define MOON_IN0\
1094   PORT_START_TAG("IN0")\
1095   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )\
1096   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )\
1097   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY\
1098   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY\
1099   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )\
1100   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )\
1101   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )\
1102   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )\
1103   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* "reset" on schematics */\
1104   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
1105
1106static INPUT_PORTS_START( 4in1 )
1107   PORT_START_TAG("IN0")
1108   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1109   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1110   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
1111   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1112   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1113   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
1114   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1115   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
1116   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
1117   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
1118
1119   PORT_START_TAG("IN1")
1120   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1121   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1122   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1123   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1124   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1125   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1126   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_SPECIAL )   // See fake ports
1127
1128   PORT_START_TAG("DSW0")
1129   PORT_BIT( 0x3b, IP_ACTIVE_HIGH, IPT_SPECIAL )   // See fake ports
1130   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
1131   PORT_DIPSETTING(    0x00, "3" )         // 2 when continue (Scramble PT2)
1132   PORT_DIPSETTING(    0x04, "5" )         // 2 when continue (Scramble PT2)
1133   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
1134
1135   PORT_START_TAG("FAKE1")      /* The Ghost Muncher PT3 - FAKE DSW0 (bits 0 to 5) and IN1 (bits 6 and 7) */
1136   PORT_DIPNAME( 0x03, 0x00, "Bonus Life (GM PT3)" )
1137   PORT_DIPSETTING(    0x01, "10000" )
1138   PORT_DIPSETTING(    0x02, "15000" )
1139   PORT_DIPSETTING(    0x03, "20000" )
1140   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1141   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL )   // Lives
1142//  PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
1143//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1144//  PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1145//  PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) )
1146//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1147//  PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1148//  PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) )
1149//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1150//  PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1151   PORT_DIPNAME( 0xc0, 0x00, "Coinage (GM PT3)" )
1152   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
1153   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1154   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
1155   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
1156
1157   PORT_START_TAG("FAKE2")      /* Scramble PT2 - FAKE DSW0 (bits 0 to 5) and IN1 (bits 6 and 7) */
1158//  PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) )
1159//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1160//  PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1161//  PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) )
1162//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1163//  PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1164   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL )   // Lives
1165   PORT_DIPNAME( 0x08, 0x00, "Allow Continue (S PT2)" )
1166   PORT_DIPSETTING(    0x08, DEF_STR( No ) )
1167   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1168   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )   // Scramble PT2 - Check code at 0x00c2
1169   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1170   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1171   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )   // Scramble PT2 - Check code at 0x00cc
1172   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1173   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1174   PORT_DIPNAME( 0xc0, 0x00, "Coinage (S PT2)" )
1175   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
1176   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1177   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
1178   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
1179
1180   PORT_START_TAG("FAKE3")      /* Galaxian PT5 - FAKE DSW0 (bits 0 to 5) and IN1 (bits 6 and 7) */
1181   PORT_DIPNAME( 0x03, 0x00, "Bonus Life (G PT5)" )
1182   PORT_DIPSETTING(    0x01, "4000" )
1183   PORT_DIPSETTING(    0x02, "5000" )
1184   PORT_DIPSETTING(    0x03, "7000" )
1185   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1186   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL )   // Lives
1187//  PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
1188//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1189//  PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1190//  PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) )
1191//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1192//  PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1193//  PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) )
1194//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1195//  PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1196   PORT_DIPNAME( 0xc0, 0x00, "Coinage (G PT5)" )
1197   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
1198   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1199//  PORT_DIPSETTING(    0x80, DEF_STR( 1C_1C ) )
1200   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
1201
1202   PORT_START_TAG("FAKE4")      /* Galactic Convoy - FAKE DSW0 (bits 0 to 5) and IN1 (bits 6 and 7) */
1203   PORT_DIPNAME( 0x01, 0x00, "Bonus Life (GC)" )
1204   PORT_DIPSETTING(    0x00, "50000" )
1205   PORT_DIPSETTING(    0x01, "80000" )
1206//  PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) )
1207//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1208//  PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1209   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL )   // Lives
1210//  PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
1211//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1212//  PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1213//  PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) )
1214//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1215//  PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1216//  PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) )
1217//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1218//  PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1219   PORT_DIPNAME( 0xc0, 0x00, "Coinage (GC)" )
1220   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
1221   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1222//  PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )    // 1 credit for 1st coin !
1223   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
1224INPUT_PORTS_END
1225
1226static INPUT_PORTS_START( bagmanmc )
1227   PORT_START_TAG("IN0")
1228   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1229   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1230   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
1231   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
1232   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1233   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
1234   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
1235   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1236
1237   PORT_START_TAG("IN1")
1238   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START2 )
1239   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1240   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1241   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1242   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1243   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1244   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1245   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )
1246   PORT_DIPSETTING(   0x80, DEF_STR( Upright ) )
1247   PORT_DIPSETTING(   0x00, DEF_STR( Cocktail ) )
1248
1249   PORT_START_TAG("DSW")
1250   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
1251   PORT_DIPSETTING(   0x03, "2" )
1252   PORT_DIPSETTING(   0x02, "3" )
1253   PORT_DIPSETTING(   0x01, "4" )
1254   PORT_DIPSETTING(   0x00, "5" )
1255   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Coinage ) )
1256   PORT_DIPSETTING(   0x00, "A 2C/1C  B 1C/1C" )
1257   PORT_DIPSETTING(   0x04, "A 1C/1C  B 1C/2C" )
1258   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Difficulty ) )
1259   PORT_DIPSETTING(   0x18, DEF_STR( Easy ) )
1260   PORT_DIPSETTING(   0x10, DEF_STR( Medium ) )
1261   PORT_DIPSETTING(   0x08, DEF_STR( Hard ) )
1262   PORT_DIPSETTING(   0x00, DEF_STR( Hardest ) )
1263   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Language ) )
1264   PORT_DIPSETTING(   0x20, DEF_STR( English ) )
1265   PORT_DIPSETTING(   0x00, DEF_STR( French ) )
1266   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Bonus_Life ) )
1267   PORT_DIPSETTING(   0x40, "30000" )
1268   PORT_DIPSETTING(   0x00, "40000" )
1269   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )   // Check code at 0x2d78 and 0x2e6b
1270   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1271   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
1272INPUT_PORTS_END
1273
1274static INPUT_PORTS_START( dkongjrm )
1275   PORT_START_TAG("IN0")
1276   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1277   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1278   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
1279   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1280   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
1281   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1282   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
1283   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
1284
1285   PORT_START_TAG("IN1")
1286   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1287   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1288   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
1289   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1290   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
1291   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1292   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
1293   PORT_DIPSETTING(   0xc0, DEF_STR( 3C_1C ) )
1294   PORT_DIPSETTING(   0x40, DEF_STR( 2C_1C ) )
1295   PORT_DIPSETTING(   0x00, DEF_STR( 1C_1C ) )
1296   PORT_DIPSETTING(   0x80, DEF_STR( 1C_2C ) )
1297
1298   PORT_START_TAG("IN2")
1299   PORT_DIPNAME( 0x01, 0x00, "Coin Multiplier" )
1300   PORT_DIPSETTING(    0x00, "*1" )
1301   PORT_DIPSETTING(    0x01, "*2" )
1302   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Lives ) )
1303   PORT_DIPSETTING(   0x00, "3" )
1304   PORT_DIPSETTING(   0x02, "4" )
1305   PORT_DIPSETTING(   0x04, "5" )
1306   PORT_DIPSETTING(   0x06, "6" )
1307   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
1308   PORT_DIPSETTING(   0x08, DEF_STR( Upright ) )
1309   PORT_DIPSETTING(   0x00, DEF_STR( Cocktail ) )
1310   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1311INPUT_PORTS_END
1312
1313static INPUT_PORTS_START( rockclim )
1314
1315   PORT_START_TAG("IN0")
1316   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1317   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1318   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_LEFT ) PORT_8WAY
1319   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_RIGHT ) PORT_8WAY
1320   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_UP ) PORT_8WAY
1321   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_DOWN ) PORT_8WAY
1322   PORT_DIPNAME( 0x40, 0x40, "Unknown 1" ) //code at $7713
1323   PORT_DIPSETTING(    0x00, "0" )
1324   PORT_DIPSETTING(    0x40, "1" )
1325
1326   PORT_START_TAG("IN1")
1327   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1328   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1329   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_LEFT  ) PORT_8WAY
1330   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_RIGHT  ) PORT_8WAY
1331   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_UP ) PORT_8WAY
1332   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_DOWN ) PORT_8WAY
1333   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Bonus_Life ) )
1334   PORT_DIPSETTING(    0x00, "30,000" )
1335   PORT_DIPSETTING(    0x40, "50,000" )
1336   PORT_DIPNAME( 0x80, 0x80, "Coin Slots" )
1337   PORT_DIPSETTING(    0x00, "2" )
1338   PORT_DIPSETTING(    0x80, "1" )
1339
1340   PORT_START_TAG("DSW0")
1341   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
1342   PORT_DIPSETTING(    0x00, "3" )
1343   PORT_DIPSETTING(    0x01, "4" )
1344   PORT_DIPSETTING(    0x02, "5" )
1345   PORT_DIPSETTING(    0x03, "6" )
1346
1347   PORT_START_TAG("DSW1")
1348   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
1349   PORT_DIPSETTING(    0x00, DEF_STR( 9C_1C ) )
1350   PORT_DIPSETTING(    0x01, DEF_STR( 8C_1C ) )
1351   PORT_DIPSETTING(    0x02, DEF_STR( 7C_1C ) )
1352   PORT_DIPSETTING(    0x03, DEF_STR( 6C_1C ) )
1353   PORT_DIPSETTING(    0x04, DEF_STR( 5C_1C ) )
1354   PORT_DIPSETTING(    0x05, DEF_STR( 4C_1C ) )
1355   PORT_DIPSETTING(    0x06, DEF_STR( 3C_1C ) )
1356   PORT_DIPSETTING(    0x07, DEF_STR( 2C_1C ) )
1357   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
1358   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
1359   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
1360   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
1361   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
1362   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
1363   PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
1364   PORT_DIPSETTING(    0x08, DEF_STR( 1C_8C ) )
1365   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
1366   PORT_DIPSETTING(    0x00, DEF_STR( 9C_1C ) )
1367   PORT_DIPSETTING(    0x10, DEF_STR( 8C_1C ) )
1368   PORT_DIPSETTING(    0x20, DEF_STR( 7C_1C ) )
1369   PORT_DIPSETTING(    0x30, DEF_STR( 6C_1C ) )
1370   PORT_DIPSETTING(    0x40, DEF_STR( 5C_1C ) )
1371   PORT_DIPSETTING(    0x50, DEF_STR( 4C_1C ) )
1372   PORT_DIPSETTING(    0x60, DEF_STR( 3C_1C ) )
1373   PORT_DIPSETTING(    0x70, DEF_STR( 2C_1C ) )
1374   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
1375   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
1376   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
1377   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
1378   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
1379   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
1380   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
1381   PORT_DIPSETTING(    0x80, DEF_STR( 1C_8C ) )
1382
1383INPUT_PORTS_END
1384
1385/*
1386
1387Game bug:
1388- you can insert 99 credits 3 times consecutively, then it resets
1389
1390*/
1391static INPUT_PORTS_START( ozon1 )
1392   PORT_START_TAG("IN0")
1393   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1394   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1395   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1396   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1397   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
1398   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
1399   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
1400   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
1401
1402   PORT_START_TAG("IN1")
1403   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
1404   PORT_DIPSETTING(    0x00, "3" )
1405   PORT_DIPSETTING(    0x01, "4" )
1406   PORT_DIPSETTING(    0x02, "5" )
1407   PORT_DIPSETTING(    0x03, "6" )
1408   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1409   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1410   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
1411   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
1412   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
1413   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1414
1415   PORT_START_TAG("DSW")
1416   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1417   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1418   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1419   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
1420   PORT_DIPSETTING(    0x00, "A 1C/1C  B 2C/1C" )
1421   PORT_DIPSETTING(    0x02, "A 1C/2C  B 1C/1C" ) // when you insert a coin with COIN2 it starts an infinite loop
1422   PORT_DIPSETTING(    0x04, "A 1C/3C  B 3C/1C" )
1423   PORT_DIPSETTING(    0x06, "A 1C/4C  B 4C/1C" )
1424   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1425   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1426   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1427   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1428   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1429   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1430   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1431   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1432   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1433   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1434   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1435   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1436   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1437   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1438   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1439INPUT_PORTS_END
1440
1441static INPUT_PORTS_START( ladybugg )
1442   PORT_START_TAG("IN0")
1443   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1444   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1445   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
1446   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
1447   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1448   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
1449   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1450   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
1451
1452   PORT_START_TAG("IN1")
1453   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1454   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1455   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
1456   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
1457   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL
1458   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL /* 2nd Button 1 */
1459   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
1460   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1461   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
1462   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coinage ) )
1463   PORT_DIPSETTING(    0x80, "A 1C/1C  B 1C/5C" )
1464   PORT_DIPSETTING(    0x00, "A 2C/1C  B 1C/3C" )
1465
1466   PORT_START_TAG("DSW")
1467   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Difficulty ) )
1468   PORT_DIPSETTING(    0x00, DEF_STR( Easiest ) )
1469   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
1470   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
1471   PORT_DIPSETTING(    0x03, DEF_STR( Hardest ) )
1472   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
1473   PORT_DIPSETTING(    0x00, "3" )
1474   PORT_DIPSETTING(    0x04, "4" )
1475   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )
1476   PORT_DIPSETTING(    0x00, "20000" )
1477   PORT_DIPSETTING(    0x08, "40000" )
1478   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* Yes, the game reads both of these */
1479   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* Check code at 0x22e1 */
1480INPUT_PORTS_END
1481
1482static INPUT_PORTS_START( vpool )
1483   PORT_START_TAG("IN0")
1484   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1485   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1486   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
1487   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1488   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1489   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1490   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1491   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1492   PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
1493   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1494
1495   PORT_START_TAG("IN1")
1496   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1497   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1498   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
1499   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
1500   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1501   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1502   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1503   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1504   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1505   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1506   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1507   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1508   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1509   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1510
1511   PORT_START_TAG("DSW0")
1512   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
1513   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1514   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1515   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
1516   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1517   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1518   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
1519   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1520   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1521   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1522   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1523   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1524   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1525   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1526   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1527   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1528   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1529   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1530   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1531   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1532   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1533   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1534   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1535   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1536INPUT_PORTS_END
1537
1538static INPUT_PORTS_START( drivfrcg )
1539   PORT_START_TAG("IN0")
1540   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1541   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1542   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
1543   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1544   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1545   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1546   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1547   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1548
1549   PORT_START_TAG("IN1")
1550   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1551   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 )
1552   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1553   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1554   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1555   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1556   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coinage ) )
1557   PORT_DIPSETTING(    0x40, "A 2C/1C  B 1C/3C" )
1558   PORT_DIPSETTING(    0x00, "A 1C/1C  B 1C/5C" )
1559   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1560
1561   PORT_START_TAG("DSW0")
1562   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1563   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1564   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1565   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
1566   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1567   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1568   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1569   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1570   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1571   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1572   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1573   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1574   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1575   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1576   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1577   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1578   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1579   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1580   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1581   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1582   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1583   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1584   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1585   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1586
1587   PORT_START_TAG("DSW1")
1588   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1589   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1590   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1591   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
1592   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1593   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1594   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1595   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1596   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1597   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1598   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1599   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1600   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1601   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1602   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1603   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1604   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1605   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1606   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1607   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1608   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1609   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1610   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1611   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1612
1613   PORT_START_TAG("SENSE")
1614   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1615INPUT_PORTS_END
1616
1617static INPUT_PORTS_START( bongo )
1618   PORT_START_TAG("IN0")
1619   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1620   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // coin? it jumps to an unmapped area at $C003
1621   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
1622   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
1623   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1624   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
1625   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1626   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1627
1628   PORT_START_TAG("IN1")
1629   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1630   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1631   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
1632   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
1633   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1634   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL
1635   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1636   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1637
1638   PORT_START_TAG("DSW0")
1639   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1640   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1641   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1642   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
1643   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1644   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1645   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1646   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1647   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1648   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1649   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1650   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1651   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1652   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1653   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1654   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1655   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1656   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1657   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1658   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1659   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1660   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1661   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1662   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1663
1664   PORT_START_TAG("DSW1")
1665   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1666   PORT_DIPSETTING(    0x0, DEF_STR( Off ) )
1667   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1668   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Lives ) )
1669   PORT_DIPSETTING(    0x00, "2" )
1670   PORT_DIPSETTING(    0x02, "3" )
1671   PORT_DIPSETTING(    0x04, "4" )
1672   PORT_DIPSETTING(    0x06, "5" )
1673   PORT_DIPNAME( 0x08, 0x00, "Infinite Lives" )
1674   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1675   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1676   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1677   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1678   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1679   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1680   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1681   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1682   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coinage ) )
1683   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
1684   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
1685   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
1686   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1687   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
1688INPUT_PORTS_END
1689
1690static INPUT_PORTS_START( hunchbkg )
1691   PORT_START_TAG("IN0")
1692   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1693   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1694   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1)
1695   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1)
1696   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1697   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1698   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
1699   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1)
1700
1701   PORT_START_TAG("IN1")
1702   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Start 1 / P1 Button 1") PORT_PLAYER(1)
1703   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Start 2 / P1 Button 1") PORT_PLAYER(1)
1704   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
1705   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1706   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1707   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1708   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1709   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1710
1711   PORT_START_TAG("DSW0")
1712   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1713   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1714   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
1715   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
1716   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1717   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1718   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1719   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1720   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1721   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1722   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1723   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1724   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1725   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1726   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1727   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1728   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1729   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1730   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1731   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1732   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1733   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1734   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1735   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1736
1737   PORT_START_TAG("SENSE")
1738   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1739INPUT_PORTS_END
1740
1741static INPUT_PORTS_START( harem )
1742   PORT_START_TAG("IN0")//Change tag when major usage uncovered.
1743   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1744   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1745   PORT_DIPSETTING(   0x01, DEF_STR( On ) )
1746   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
1747   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1748   PORT_DIPSETTING(   0x02, DEF_STR( On ) )
1749   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1750   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1751   PORT_DIPSETTING(   0x04, DEF_STR( On ) )
1752   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1753   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1754   PORT_DIPSETTING(   0x08, DEF_STR( On ) )
1755   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1756   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1757   PORT_DIPSETTING(   0x10, DEF_STR( On ) )
1758   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1759   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1760   PORT_DIPSETTING(   0x20, DEF_STR( On ) )
1761   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1762   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1763   PORT_DIPSETTING(   0x40, DEF_STR( On ) )
1764   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1765   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1766   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
1767
1768   PORT_START_TAG("IN1")
1769   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1770   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1771   PORT_DIPSETTING(   0x01, DEF_STR( On ) )
1772   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
1773   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1774   PORT_DIPSETTING(   0x02, DEF_STR( On ) )
1775   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1776   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1777   PORT_DIPSETTING(   0x04, DEF_STR( On ) )
1778   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1779   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1780   PORT_DIPSETTING(   0x08, DEF_STR( On ) )
1781   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1782   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1783   PORT_DIPSETTING(   0x10, DEF_STR( On ) )
1784   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1785   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1786   PORT_DIPSETTING(   0x20, DEF_STR( On ) )
1787   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1788   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1789   PORT_DIPSETTING(   0x40, DEF_STR( On ) )
1790   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1791   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1792   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
1793INPUT_PORTS_END
1794
1795static INPUT_PORTS_START( tazzmang )
1796   PORT_START
1797   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1798   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1799   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
1800   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1801   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1802   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1803   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
1804   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
1805
1806   PORT_START
1807   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Start 1 / P1 and P2 Button 2")
1808   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1809   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1810   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1811   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1812   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1813   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1814   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1815
1816   PORT_START
1817   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1818   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1819   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
1820   PORT_DIPNAME( 0x06, 0x04, DEF_STR( Coinage ) )
1821   PORT_DIPSETTING(    0x00, "A 4C/1C  B 1C/4C" )
1822   PORT_DIPSETTING(    0x02, "A 3C/1C  B 1C/3C" )
1823   PORT_DIPSETTING(    0x06, "A 2C/1C  B 1C/2C" )
1824   PORT_DIPSETTING(    0x04, "A 1C/1C  B 1C/1C" )
1825   PORT_DIPNAME( 0x08, 0x00, "3" )
1826   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1827   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1828   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1829   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1830   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1831   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1832   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1833   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1834   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1835   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1836   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1837   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1838   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1839   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1840INPUT_PORTS_END
1841
1842static INPUT_PORTS_START( racknrol )
1843   PORT_START_TAG("IN0")
1844   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1845   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1846   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
1847   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1848   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1849   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
1850   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1851   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
1852
1853   PORT_START_TAG("IN1")
1854   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1855   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1856   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1857   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1858   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1859   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1860   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1861   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1862   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1863   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1864   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1865   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1866   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1867   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1868   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1869   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1870   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1871   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1872   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1873   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1874
1875   PORT_START_TAG("DSW0")
1876   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1877   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1878   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1879   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
1880   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1881   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1882   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1883   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1884   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1885   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1886   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1887   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1888   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1889   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1890   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1891   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1892   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1893   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1894   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1895   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1896   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1897   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1898   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1899   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1900
1901   PORT_START_TAG("SENSE")
1902   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
1903INPUT_PORTS_END
1904
1905static INPUT_PORTS_START( trvchlng )
1906   PORT_START_TAG("IN0")
1907   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1908   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1909   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 )
1910   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1911   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1912   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON4)
1913   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1914   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 )
1915
1916   PORT_START_TAG("IN1")
1917   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1918   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1919   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1920   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1921   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1922   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1923   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1924   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1925   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1926   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1927   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1928   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1929   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1930   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1931   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1932   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1933   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1934   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1935   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1936   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1937
1938   PORT_START_TAG("DSW0")
1939   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1940   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1941   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1942   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
1943   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1944   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1945   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1946   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1947   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1948   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1949   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1950   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1951   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1952   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1953   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1954   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1955   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1956   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1957   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1958   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1959   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1960   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1961   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1962   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1963
1964   PORT_START_TAG("SENSE")
1965   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
1966INPUT_PORTS_END
1967
1968static INPUT_PORTS_START( catacomb )
1969   PORT_START_TAG("IN0")
1970   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1971   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1972   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
1973   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1974   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1975   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
1976   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1977   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
1978   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1979   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1980   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1981   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1982   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1983   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1984
1985   PORT_START_TAG("IN1")
1986   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1987   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1988   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
1989   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
1990   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1991   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1992   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1993   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1994   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_A ) )
1995   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
1996   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
1997   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coin_B ) )
1998   PORT_DIPSETTING(    0x00, DEF_STR( 1C_3C ) )
1999   PORT_DIPSETTING(    0x80, DEF_STR( 1C_5C ) )
2000
2001   PORT_START_TAG("DSW0")
2002   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
2003   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2004   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
2005   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
2006   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2007   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
2008   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )
2009   PORT_DIPSETTING(    0x04, "3" )
2010   PORT_DIPSETTING(    0x00, "5" )
2011   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
2012   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2013   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
2014   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
2015   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2016   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
2017   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
2018   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2019   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
2020   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
2021   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2022   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
2023   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
2024   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2025   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
2026
2027   PORT_START_TAG("SENSE")
2028   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
2029INPUT_PORTS_END
2030
2031static INPUT_PORTS_START( luctoday )
2032   PORT_START_TAG("IN0") //These inputs are clearly wrong, they need a full test
2033   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2034   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2035   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )PORT_2WAY PORT_NAME("Add Credit to Bet")
2036   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )PORT_2WAY PORT_NAME("Remove Credit from Bet")
2037   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
2038   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2039   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2040   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BILL1 )
2041
2042   PORT_START_TAG("IN1")
2043   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2044   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
2045   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
2046   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
2047   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
2048   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2049   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
2050   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
2051
2052   PORT_START_TAG("DSW0")
2053   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2054   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2055   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2056   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2057   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2058INPUT_PORTS_END
2059
2060static INPUT_PORTS_START( ckongg )
2061   PORT_START_TAG("IN0")
2062   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2063   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
2064   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
2065   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
2066   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
2067   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
2068   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 )
2069   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 )
2070
2071   PORT_START_TAG("IN1")
2072   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2073   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2074   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
2075   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
2076   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
2077   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
2078   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
2079   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
2080   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2081//      PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
2082   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
2083
2084   PORT_START_TAG("DSW0")
2085   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
2086   PORT_DIPSETTING(    0x00, "1" )
2087   PORT_DIPSETTING(    0x01, "2" )
2088   PORT_DIPSETTING(    0x02, "3" )
2089   PORT_DIPSETTING(    0x03, "4" )
2090   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
2091   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2092   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
2093   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Bonus_Life ) )
2094   PORT_DIPSETTING(    0x08, "500000" )
2095   PORT_DIPSETTING(    0x00, "750000" )
2096   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2097INPUT_PORTS_END
2098
2099/* not correct */
2100static INPUT_PORTS_START( kkgalax )
2101   PORT_START_TAG("IN0")
2102   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2103   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
2104   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
2105   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
2106   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
2107   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2108   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
2109   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
2110
2111   PORT_START_TAG("IN1")
2112   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // button 1 and start 1
2113   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL // button 1 and start 2?
2114   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
2115   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
2116   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
2117   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
2118   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
2119   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
2120   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2121//  PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
2122   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
2123
2124   PORT_START_TAG("DSW0")
2125   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
2126   PORT_DIPSETTING(    0x00, "1" )
2127   PORT_DIPSETTING(    0x01, "2" )
2128   PORT_DIPSETTING(    0x02, "3" )
2129   PORT_DIPSETTING(    0x03, "4" )
2130   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
2131   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2132   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
2133   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Bonus_Life ) )
2134   PORT_DIPSETTING(    0x08, "500000" )
2135   PORT_DIPSETTING(    0x00, "750000" )
2136   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2137INPUT_PORTS_END
2138
2139static INPUT_PORTS_START( porter )
2140   PORT_START_TAG("IN0")\
2141   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2142   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
2143   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
2144   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
2145   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
2146    PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
2147    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
2148    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2149   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
2150    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2151    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2152   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
2153
2154   PORT_START_TAG("IN1")
2155   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // and START
2156   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) // and START2
2157   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
2158   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
2159   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
2160    PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
2161    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
2162    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2163    PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
2164    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2165    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2166    PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
2167    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2168    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2169
2170   PORT_START_TAG("DSW")
2171    PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
2172   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2173    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2174    PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
2175    PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2176    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2177    PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
2178    PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
2179    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2180    PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
2181    PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2182    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2183    PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
2184    PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
2185    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2186    PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
2187    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
2188    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2189    PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
2190    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2191    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2192    PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
2193    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2194    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2195INPUT_PORTS_END
2196
2197static const gfx_layout galaxold_charlayout =
2198{
2199   8,8,
2200   RGN_FRAC(1,2),
2201   2,
2202   { RGN_FRAC(0,2), RGN_FRAC(1,2) },
2203   { 0, 1, 2, 3, 4, 5, 6, 7 },
2204   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
2205   8*8
2206};
2207static const gfx_layout galaxold_spritelayout =
2208{
2209   16,16,
2210   RGN_FRAC(1,2),
2211   2,
2212   { RGN_FRAC(0,2), RGN_FRAC(1,2) },
2213   { 0, 1, 2, 3, 4, 5, 6, 7,
2214         8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
2215   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
2216         16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
2217   32*8
2218};
2219
2220static const gfx_layout pacmanbl_charlayout =
2221{
2222   8,8,
2223   256,
2224   2,
2225   { 0, 256*8*8 },
2226   { 0, 1, 2, 3, 4, 5, 6, 7 },
2227   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
2228   8*8
2229};
2230static const gfx_layout pacmanbl_spritelayout =
2231{
2232   16,16,
2233   64,
2234   2,
2235   { 0, 64*16*16 },
2236   { 0, 1, 2, 3, 4, 5, 6, 7,
2237         8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
2238   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
2239         16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
2240   32*8
2241};
2242
2243static const gfx_layout bagmanmc_charlayout =
2244{
2245   8,8,
2246   512,
2247   2,
2248   { 0, 512*8*8 },
2249   { 0, 1, 2, 3, 4, 5, 6, 7 },
2250   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
2251   8*8
2252};
2253
2254static const gfx_layout _4in1_charlayout =
2255{
2256   8,8,
2257   1024,
2258   2,
2259   { 0, 1024*8*8 },
2260   { 0, 1, 2, 3, 4, 5, 6, 7 },
2261   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
2262   8*8
2263};
2264static const gfx_layout _4in1_spritelayout =
2265{
2266   16,16,
2267   256,
2268   2,
2269   { 0, 256*16*16 },
2270   { 0, 1, 2, 3, 4, 5, 6, 7,
2271         8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
2272   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
2273         16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
2274   32*8
2275};
2276
2277static const gfx_layout rockclim_charlayout =
2278{
2279   8,8,
2280   256,
2281   4,//?
2282   { 4, 0,4096*8+4,4096*8 },
2283   { 3, 2, 1, 0,11 ,10, 9, 8 },
2284   { 0*8*2, 1*8*2, 2*8*2, 3*8*2, 4*8*2, 5*8*2, 6*8*2, 7*8*2 },
2285   8*8*2
2286};
2287
2288static GFXDECODE_START( rockclim )
2289   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, galaxold_charlayout,   32, 8 )
2290   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, galaxold_spritelayout, 32, 8 )
2291   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, rockclim_charlayout, 0, 1 )
2292GFXDECODE_END
2293
2294
2295
2296
2297static GFXDECODE_START( galaxian )
2298   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, galaxold_charlayout,   0, 8 )
2299   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, galaxold_spritelayout, 0, 8 )
2300GFXDECODE_END
2301
2302static GFXDECODE_START( gmgalax )
2303   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, galaxold_charlayout,   0, 16 )
2304   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, galaxold_spritelayout, 0, 16 )
2305GFXDECODE_END
2306
2307/* separate character and sprite ROMs */
2308static GFXDECODE_START( pacmanbl )
2309   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, pacmanbl_charlayout,   0, 8 )
2310   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, pacmanbl_spritelayout, 0, 8 )
2311GFXDECODE_END
2312
2313static GFXDECODE_START( bagmanmc )
2314   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, bagmanmc_charlayout,    0, 8 )
2315   GFXDECODE_ENTRY( REGION_GFX1, 0x2000, pacmanbl_spritelayout, 0, 8 )
2316GFXDECODE_END
2317
2318static GFXDECODE_START( _4in1 )
2319   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, _4in1_charlayout,      0, 8 )
2320   GFXDECODE_ENTRY( REGION_GFX1, 0x4000, _4in1_spritelayout,    0, 8 )
2321GFXDECODE_END
2322
2323static const struct AY8910interface checkmaj_ay8910_interface =
2324{
2325   soundlatch_r
2326};
2327
2328static const struct AY8910interface bongo_ay8910_interface =
2329{
2330   input_port_3_r
2331};
2332
2333
2334static MACHINE_DRIVER_START( galaxold_base )
2335
2336   /* basic machine hardware */
2337   MDRV_CPU_ADD_TAG("main", Z80, PIXEL_CLOCK/2)   /* 3.072 MHz */
2338   MDRV_CPU_PROGRAM_MAP(galaxold_readmem,galaxold_writemem)
2339
2340   MDRV_MACHINE_RESET(galaxold)
2341
2342   /* video hardware */
2343   MDRV_GFXDECODE(galaxian)
2344   MDRV_PALETTE_LENGTH(32+2+64)      /* 32 for the characters, 2 for the bullets, 64 for the stars */
2345
2346   MDRV_SCREEN_ADD("main", RASTER)
2347   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
2348   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
2349
2350   MDRV_PALETTE_INIT(galaxold)
2351   MDRV_VIDEO_START(galaxold)
2352   MDRV_VIDEO_UPDATE(galaxold)
2353
2354   /* sound hardware */
2355   MDRV_SPEAKER_STANDARD_MONO("mono")
2356MACHINE_DRIVER_END
2357
2358
2359static MACHINE_DRIVER_START( galaxian )
2360
2361   /* basic machine hardware */
2362   MDRV_IMPORT_FROM(galaxold_base)
2363
2364   /* sound hardware */
2365   MDRV_SOUND_ADD(SAMPLES, 0)
2366   MDRV_SOUND_CONFIG(galaxian_samples_interface)
2367   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
2368MACHINE_DRIVER_END
2369
2370
2371static MACHINE_DRIVER_START( batman2 )
2372
2373   /* basic machine hardware */
2374   MDRV_IMPORT_FROM(galaxian)
2375
2376   /* video hardware */
2377   MDRV_VIDEO_START(batman2)
2378MACHINE_DRIVER_END
2379
2380
2381static MACHINE_DRIVER_START( mooncrst )
2382
2383   /* basic machine hardware */
2384   MDRV_IMPORT_FROM(galaxian)
2385   MDRV_CPU_MODIFY("main")
2386   MDRV_CPU_PROGRAM_MAP(mooncrst_readmem,mooncrst_writemem)
2387
2388   /* video hardware */
2389   MDRV_VIDEO_START(mooncrst)
2390MACHINE_DRIVER_END
2391
2392
2393static MACHINE_DRIVER_START( scramblb )
2394
2395   /* basic machine hardware */
2396   MDRV_IMPORT_FROM(galaxian)
2397   MDRV_CPU_MODIFY("main")
2398   MDRV_CPU_PROGRAM_MAP(scramblb_readmem,scramblb_writemem)
2399
2400   /* video hardware */
2401   MDRV_PALETTE_LENGTH(32+2+64+1)   /* 32 for the characters, 2 for the bullets, 64 for the stars, 1 for background */
2402
2403   MDRV_PALETTE_INIT(scrambold)
2404   MDRV_VIDEO_START(scrambold)
2405MACHINE_DRIVER_END
2406
2407static MACHINE_DRIVER_START( scramb2 )
2408
2409   /* basic machine hardware */
2410   MDRV_IMPORT_FROM(galaxian)
2411   MDRV_CPU_MODIFY("main")
2412   MDRV_CPU_PROGRAM_MAP(scramb2_readmem,scramb2_writemem)
2413
2414   /* video hardware */
2415   MDRV_PALETTE_LENGTH(32+2+64+1)   /* 32 for the characters, 2 for the bullets, 64 for the stars, 1 for background */
2416
2417   MDRV_PALETTE_INIT(scrambold)
2418   MDRV_VIDEO_START(scrambold)
2419MACHINE_DRIVER_END
2420
2421
2422
2423static MACHINE_DRIVER_START( 4in1 )
2424
2425   /* basic machine hardware */
2426   MDRV_IMPORT_FROM(galaxian)
2427   MDRV_CPU_MODIFY("main")
2428   MDRV_CPU_PROGRAM_MAP(_4in1_readmem,_4in1_writemem)
2429
2430   /* video hardware */
2431   MDRV_GFXDECODE(_4in1)
2432
2433   MDRV_VIDEO_START(pisces)
2434MACHINE_DRIVER_END
2435
2436
2437static MACHINE_DRIVER_START( bagmanmc )
2438
2439   /* basic machine hardware */
2440   MDRV_IMPORT_FROM(galaxian)
2441   MDRV_CPU_MODIFY("main")
2442   MDRV_CPU_PROGRAM_MAP(bagmanmc_readmem,bagmanmc_writemem)
2443
2444   MDRV_MACHINE_RESET( devilfsg )
2445
2446   /* video hardware */
2447   MDRV_GFXDECODE(bagmanmc)
2448
2449   MDRV_VIDEO_START(pisces)
2450MACHINE_DRIVER_END
2451
2452
2453static MACHINE_DRIVER_START( dkongjrm )
2454
2455   /* basic machine hardware */
2456   MDRV_IMPORT_FROM(galaxian)
2457   MDRV_CPU_MODIFY("main")
2458   MDRV_CPU_PROGRAM_MAP(dkongjrm_readmem,dkongjrm_writemem)
2459
2460   /* video hardware */
2461   MDRV_VIDEO_START(dkongjrm)
2462MACHINE_DRIVER_END
2463
2464static MACHINE_DRIVER_START( rockclim )
2465   /* basic machine hardware */
2466   MDRV_IMPORT_FROM(galaxian)
2467   MDRV_CPU_MODIFY("main")
2468   MDRV_CPU_PROGRAM_MAP(rockclim_readmem,rockclim_writemem)
2469   MDRV_GFXDECODE(rockclim)
2470   /* video hardware */
2471   MDRV_VIDEO_START(rockclim)
2472   MDRV_PALETTE_LENGTH(64+64+2)   /* 64 colors only, but still uses bullets so we need to keep the palette big */
2473   MDRV_PALETTE_INIT(rockclim)
2474
2475   MDRV_SCREEN_MODIFY("main")
2476   MDRV_SCREEN_SIZE(64*8, 32*8)
2477
2478MACHINE_DRIVER_END
2479
2480static MACHINE_DRIVER_START( ozon1 )
2481   /* basic machine hardware */
2482   MDRV_IMPORT_FROM(galaxold_base)
2483   MDRV_CPU_MODIFY("main")
2484   MDRV_CPU_PROGRAM_MAP(ozon1_readmem,ozon1_writemem)
2485   MDRV_CPU_IO_MAP(0,ozon1_writeport)
2486   MDRV_CPU_VBLANK_INT("main", nmi_line_pulse)
2487
2488   MDRV_MACHINE_RESET(NULL)
2489
2490   MDRV_PALETTE_INIT(rockclim)
2491   MDRV_PALETTE_LENGTH(32)
2492
2493   MDRV_VIDEO_START(galaxold_plain)
2494   MDRV_SOUND_ADD(AY8910, 1789750)
2495   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
2496MACHINE_DRIVER_END
2497
2498static MACHINE_DRIVER_START( drivfrcg )
2499
2500   /* basic machine hardware */
2501   MDRV_CPU_ADD(S2650, 18432000/6)
2502   MDRV_CPU_PROGRAM_MAP(drivfrcg,0)
2503   MDRV_CPU_IO_MAP(drivfrcg_io,0)
2504   MDRV_CPU_VBLANK_INT("main", hunchbks_vh_interrupt)
2505
2506
2507   MDRV_SCREEN_ADD("main", RASTER)
2508   MDRV_SCREEN_REFRESH_RATE(16000.0/132/2)
2509   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
2510   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
2511   MDRV_SCREEN_SIZE(32*8, 32*8)
2512   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
2513
2514   MDRV_PALETTE_LENGTH(64)
2515   MDRV_GFXDECODE(gmgalax)
2516
2517   MDRV_PALETTE_INIT(rockclim)
2518
2519   MDRV_VIDEO_START(drivfrcg)
2520   MDRV_VIDEO_UPDATE(galaxold)
2521
2522   /* sound hardware */
2523   MDRV_SPEAKER_STANDARD_MONO("mono")
2524   MDRV_SOUND_ADD(SAMPLES, 0)
2525   MDRV_SOUND_CONFIG(galaxian_samples_interface)
2526   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
2527MACHINE_DRIVER_END
2528
2529static MACHINE_DRIVER_START( bongo )
2530   /* basic machine hardware */
2531   MDRV_IMPORT_FROM(galaxold_base)
2532   MDRV_CPU_MODIFY("main")
2533   MDRV_CPU_PROGRAM_MAP(bongo,0)
2534   MDRV_CPU_IO_MAP(bongo_io,0)
2535
2536   MDRV_VIDEO_START(bongo)
2537   MDRV_VIDEO_UPDATE(galaxold)
2538
2539   MDRV_SOUND_ADD(AY8910, 1789750)
2540   MDRV_SOUND_CONFIG(bongo_ay8910_interface)
2541   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
2542MACHINE_DRIVER_END
2543
2544static MACHINE_DRIVER_START( hunchbkg )
2545
2546   /* basic machine hardware */
2547   MDRV_CPU_ADD(S2650, PIXEL_CLOCK/2)
2548   MDRV_CPU_PROGRAM_MAP(hunchbkg,0)
2549   MDRV_CPU_IO_MAP(hunchbkg_io,0)
2550   MDRV_CPU_VBLANK_INT("main", hunchbks_vh_interrupt)
2551
2552   MDRV_GFXDECODE(galaxian)
2553   MDRV_PALETTE_LENGTH(32+2+64)      /* 32 for the characters, 2 for the bullets, 64 for the stars */
2554
2555   MDRV_SCREEN_ADD("main", RASTER)
2556   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
2557   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
2558
2559   MDRV_PALETTE_INIT(galaxold)
2560
2561   MDRV_VIDEO_UPDATE(galaxold)
2562   MDRV_VIDEO_START(galaxold_plain)
2563
2564   /* sound hardware */
2565   MDRV_SPEAKER_STANDARD_MONO("mono")
2566   MDRV_SOUND_ADD(SAMPLES, 0)
2567   MDRV_SOUND_CONFIG(galaxian_samples_interface)
2568   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
2569MACHINE_DRIVER_END
2570
2571static MACHINE_DRIVER_START( harem )
2572   /* basic machine hardware */
2573   MDRV_IMPORT_FROM(galaxold_base)
2574   MDRV_CPU_MODIFY("main")
2575   MDRV_CPU_PROGRAM_MAP(harem_cpu1,0)
2576   MDRV_CPU_VBLANK_INT("main", nmi_line_pulse)
2577
2578   MDRV_CPU_ADD(Z80, 1620000)
2579   /* audio CPU */
2580   MDRV_CPU_PROGRAM_MAP(harem_cpu2,0)
2581   MDRV_CPU_IO_MAP(harem_cpu2_io,0)
2582
2583   MDRV_MACHINE_RESET(NULL)
2584
2585   MDRV_PALETTE_INIT(rockclim)
2586   MDRV_PALETTE_LENGTH(32)
2587
2588   MDRV_VIDEO_START(galaxold_plain)
2589
2590   MDRV_SOUND_ADD(AY8910, 2000000)
2591   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33/3)
2592
2593   MDRV_SOUND_ADD(AY8910, 2000000)
2594   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33/3)
2595
2596   MDRV_SOUND_ADD(AY8910, 2000000)
2597   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33/3)
2598MACHINE_DRIVER_END
2599
2600static MACHINE_DRIVER_START( tazzmang )
2601   /* basic machine hardware */
2602   MDRV_IMPORT_FROM(galaxian)
2603   MDRV_CPU_MODIFY("main")
2604   MDRV_CPU_PROGRAM_MAP(tazzmang,0)
2605MACHINE_DRIVER_END
2606
2607static MACHINE_DRIVER_START( racknrol )
2608
2609   /* basic machine hardware */
2610   MDRV_CPU_ADD(S2650, PIXEL_CLOCK/2)
2611   MDRV_CPU_PROGRAM_MAP(racknrol,0)
2612   MDRV_CPU_IO_MAP(racknrol_io,0)
2613   MDRV_CPU_VBLANK_INT("main", hunchbks_vh_interrupt)
2614
2615   MDRV_GFXDECODE(galaxian)
2616   MDRV_PALETTE_LENGTH(32)
2617
2618   MDRV_SCREEN_ADD("main", RASTER)
2619   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
2620   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
2621
2622   MDRV_PALETTE_INIT(rockclim)
2623   MDRV_VIDEO_UPDATE(galaxold)
2624   MDRV_VIDEO_START(racknrol)
2625
2626   /* sound hardware */
2627   MDRV_SPEAKER_STANDARD_MONO("mono")
2628   MDRV_SOUND_ADD(SN76496, PIXEL_CLOCK/2)
2629   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
2630
2631   MDRV_SOUND_ADD(SN76496, PIXEL_CLOCK/2)
2632   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
2633
2634   MDRV_SOUND_ADD(SN76496, PIXEL_CLOCK/2)
2635   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
2636MACHINE_DRIVER_END
2637
2638static MACHINE_DRIVER_START( ckongg )
2639
2640   /* basic machine hardware */
2641   MDRV_IMPORT_FROM(galaxian)
2642   MDRV_CPU_MODIFY("main")
2643   MDRV_CPU_PROGRAM_MAP(ckongg_readmem,ckongg_writemem)
2644
2645   MDRV_GFXDECODE(gmgalax)
2646
2647   MDRV_VIDEO_START(ckongs)
2648
2649MACHINE_DRIVER_END
2650
2651static MACHINE_DRIVER_START( kkgalax )
2652
2653   /* basic machine hardware */
2654   MDRV_IMPORT_FROM(galaxian)
2655   MDRV_CPU_MODIFY("main")
2656   MDRV_CPU_PROGRAM_MAP(kkgalax_readmem,kkgalax_writemem)
2657
2658   MDRV_GFXDECODE(gmgalax)
2659
2660   MDRV_VIDEO_START(ckongs)
2661
2662MACHINE_DRIVER_END
2663
2664
2665static MACHINE_DRIVER_START( hexpoola )
2666
2667   /* basic machine hardware */
2668   MDRV_CPU_ADD(S2650, PIXEL_CLOCK/2)
2669   MDRV_CPU_PROGRAM_MAP(racknrol,0)
2670   MDRV_CPU_IO_MAP(hexpoola_io,0)
2671   MDRV_CPU_VBLANK_INT("main", hunchbks_vh_interrupt)
2672
2673   MDRV_GFXDECODE(galaxian)
2674   MDRV_PALETTE_LENGTH(32)
2675
2676   MDRV_SCREEN_ADD("main", RASTER)
2677   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
2678   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
2679
2680   MDRV_PALETTE_INIT(rockclim)
2681   MDRV_VIDEO_UPDATE(galaxold)
2682   MDRV_VIDEO_START(racknrol)
2683
2684   /* sound hardware */
2685   MDRV_SPEAKER_STANDARD_MONO("mono")
2686   MDRV_SOUND_ADD(SN76496, PIXEL_CLOCK/2)
2687   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
2688MACHINE_DRIVER_END
2689
2690/***************************************************************************
2691
2692  Game driver(s)
2693
2694***************************************************************************/
2695
2696ROM_START( scramblb )
2697   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2698   ROM_LOAD( "scramble.1k",  0x0000, 0x0800, CRC(9e025c4a) SHA1(a8cc9391bdd01a5a2fe7f0c4e889b4e2495df891) )
2699   ROM_LOAD( "scramble.2k",  0x0800, 0x0800, CRC(306f783e) SHA1(92d19f90f1123cd211706294d668ab23c8b0760b) )
2700   ROM_LOAD( "scramble.3k",  0x1000, 0x0800, CRC(0500b701) SHA1(54c84ccad2aae34f42fdddcfcd92cd9da2cd7119) )
2701   ROM_LOAD( "scramble.4k",  0x1800, 0x0800, CRC(dd380a22) SHA1(125e713a58cc5f2c1e38f67dad29f8c985ce5a8b) )
2702   ROM_LOAD( "scramble.5k",  0x2000, 0x0800, CRC(df0b9648) SHA1(4ae9150c9441897d5ab7c5a0b3f10e1e8c8e2f6c) )
2703   ROM_LOAD( "scramble.1j",  0x2800, 0x0800, CRC(b8c07b3c) SHA1(33eaedef4b7f49eeef072425541c17206d0a00ec) )
2704   ROM_LOAD( "scramble.2j",  0x3000, 0x0800, CRC(88ac07a0) SHA1(c57061db5984b472039356bf84a050b5b66e3813) )
2705   ROM_LOAD( "scramble.3j",  0x3800, 0x0800, CRC(c67d57ca) SHA1(ba8b14289aef47d48d9750cf2ef3c368e74a60e8) )
2706
2707   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2708   ROM_LOAD( "5f.k",         0x0000, 0x0800, CRC(4708845b) SHA1(a8b1ad19a95a9d35050a2ab7194cc96fc5afcdc9) )
2709   ROM_LOAD( "5h.k",         0x0800, 0x0800, CRC(11fd2887) SHA1(69844e48bb4d372cac7ae83c953df573c7ecbb7f) )
2710
2711   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2712   ROM_LOAD( "82s123.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
2713ROM_END
2714
2715
2716ROM_START( scramb2 )
2717   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2718   ROM_LOAD( "r1.7f1",  0x0000, 0x0800, CRC(4a43148c) SHA1(ea27fd3acf661101296a58a7a50fb8e4d5292760) )
2719   ROM_LOAD( "r1.7f2",  0x0800, 0x0800, CRC(215a3b86) SHA1(bfddfea9f74064123629d89556240c7a59f7bea2) )
2720   ROM_LOAD( "r2.7h1",  0x1000, 0x0800, CRC(28779444) SHA1(0abd3a89c8cdd5af2ac06afd38bcd2dcd6010bee) )
2721   ROM_LOAD( "r2.7h2",  0x1800, 0x0800, CRC(5b4b300b) SHA1(6d69dbdab66bc8f4a16c3d9d3b4581799e4bbfab) )
2722   ROM_LOAD( "r3.7k1",  0x2000, 0x0800, CRC(b478aa53) SHA1(68cf134482092534ef0a3ceee3aa842f86660065) )
2723   ROM_LOAD( "r3.7k2",  0x2800, 0x0800, CRC(c33f072e) SHA1(28d61e35f3d5c971e070d7e0cc20b831fe8d52c5) )
2724   ROM_LOAD( "r4.7l1",  0x3000, 0x0800, CRC(88ac07a0) SHA1(c57061db5984b472039356bf84a050b5b66e3813) )
2725   ROM_LOAD( "r4.7l2",  0x3800, 0x0800, CRC(321fd003) SHA1(61f33c2709913da4cb20f311501df707d755917e) )
2726   /* Also exists in the following Rom config */
2727//  ROM_LOAD( "r1.7f",  0x0000, 0x1000, CRC(75208a74) SHA1(e77afe4b906d08d6763f31dd70d7cb772be97102) )
2728//  ROM_LOAD( "r2.7h",  0x1000, 0x1000, CRC(f2179cf5) SHA1(5c38aa9bd1d5ebdccf16d2e50acc56f0b3f042d0) )
2729//  ROM_LOAD( "r3.7k",  0x2000, 0x1000, CRC(941c804e) SHA1(f1eedf719a234cf98071e6a46120765e231f0730) )
2730//  ROM_LOAD( "r4.7l",  0x3000, 0x1000, CRC(f1506edc) SHA1(66689bb3d7570848e4d020a5f44d6de03b4bff99) )
2731
2732   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2733   ROM_LOAD( "r6.1j",         0x0000, 0x0800, CRC(4708845b) SHA1(a8b1ad19a95a9d35050a2ab7194cc96fc5afcdc9) )
2734   ROM_LOAD( "r5.1l",         0x0800, 0x0800, CRC(11fd2887) SHA1(69844e48bb4d372cac7ae83c953df573c7ecbb7f) )
2735
2736   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2737   ROM_LOAD( "82s123.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
2738ROM_END
2739
2740
2741ROM_START( 4in1 )
2742   ROM_REGION( 0x20000, REGION_CPU1, 0 )   /* 64k for code  64k for banked code, encrypted */
2743   /* Menu Code, Fixed at 0xc000 - 0xdfff */
2744   ROM_LOAD( "rom1a",        0xc000, 0x1000, CRC(ce1af4d9) SHA1(260d81cb703ab33fa5f282454214dea06e59a5d6) )
2745   ROM_LOAD( "rom1b",        0xd000, 0x1000, CRC(18484f9b) SHA1(2439841ba5882c287bd9656fbf79190ff9efe4ee) )
2746   /* Ghost Muncher PT3 - banked at 0x0000 - 0x3fff */
2747   ROM_LOAD( "rom1c",       0x10000, 0x1000, CRC(83248a8b) SHA1(65af22b9a4516ab52c3327cb3b714d90c2c77284) )
2748   ROM_LOAD( "rom1d",       0x11000, 0x1000, CRC(053f6da0) SHA1(fa69de09a2162dfaa82ea566f0808433f26e4854) )
2749   ROM_LOAD( "rom1e",       0x12000, 0x1000, CRC(43c546f3) SHA1(c32a2281f8dca1f2b218dc76192d8e09f2eee460) )
2750   ROM_LOAD( "rom1f",       0x13000, 0x1000, CRC(3a086b46) SHA1(1fd65fd139a650a5c246cead5141b81764faf98c) )
2751   /* Scramble PT2 - banked at 0x0000 - 0x3fff */
2752   ROM_LOAD( "rom1g",       0x14000, 0x1000, CRC(ac0e2050) SHA1(02961a41f54d55f2ae07a2694a14fb6e6e4a766b) )
2753   ROM_LOAD( "rom1h",       0x15000, 0x1000, CRC(dc11a513) SHA1(2785c08d890f2f8e86b7f793f7989d7605570cc3) )
2754   ROM_LOAD( "rom1i",       0x16000, 0x1000, CRC(a5fb6be4) SHA1(f575ca70037134084aff152fcee7fdd0a1163c33) )
2755   ROM_LOAD( "rom1j",       0x17000, 0x1000, CRC(9054cfbe) SHA1(99ad74491cf8682daf45f2786e0bf275160c9826) )
2756   /* Galaxian PT5 - banked at 0x0000 - 0x3fff */
2757   ROM_LOAD( "rom2c",       0x18000, 0x1000, CRC(7cd98e11) SHA1(7ef49866a5c5fd871acf5bfe3d899a9ae0d37405) )
2758   ROM_LOAD( "rom2d",       0x19000, 0x1000, CRC(9402f32e) SHA1(feb5cb09ea719612a22949f34fb97e172305c7b0) )
2759   ROM_LOAD( "rom2e",       0x1a000, 0x1000, CRC(468e81df) SHA1(4ac30c170ce63637c77227833cef8839e2b0b8ab) )
2760   /* Galactic Convoy - banked at 0x0000 - 0x3fff */
2761   ROM_LOAD( "rom2g",       0x1c000, 0x1000, CRC(b1ce3976) SHA1(365e643948e982126198714bb1e07340ded7d4a5) )
2762   ROM_LOAD( "rom2h",       0x1d000, 0x1000, CRC(7eab5670) SHA1(d9648fc314bc6a685536c6acb17b17737813d902) )
2763   ROM_LOAD( "rom2i",       0x1e000, 0x1000, CRC(44565ac5) SHA1(cc8141cbdb9280a15b40761448e00a3b30a94ec7) )
2764
2765   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
2766   /* Ghost Muncher PT3 GFX */
2767   ROM_LOAD( "rom4b",        0x4000, 0x0800, CRC(7e6495af) SHA1(32db70bca5c60eea6b37a943e076bc5a8dc3870b) )
2768   ROM_CONTINUE(             0x0000, 0x0800 )
2769   ROM_LOAD( "rom3b",        0x6000, 0x0800, CRC(7475f72f) SHA1(834873b6a587760cbbd0ac9435af55f6cb20097a) )
2770   ROM_CONTINUE(             0x2000, 0x0800 )
2771   /* Scramble PT2 GFX */
2772   ROM_LOAD( "rom4c",        0x4800, 0x0800, CRC(3355d46d) SHA1(e5476d2053298958f141e11a97017ea465621d89) )
2773   ROM_RELOAD(               0x0800, 0x0800)
2774   ROM_LOAD( "rom3c",        0x6800, 0x0800, CRC(ac755a25) SHA1(70af05d32554682be6c3f74936e57b4050d283c7) )
2775   ROM_RELOAD(               0x2800, 0x0800)
2776   /* Galaxians PT5 GFX */
2777   ROM_LOAD( "rom4d",        0x5000, 0x0800, CRC(bbdddb65) SHA1(fc2dcfd969b1ee51a6413117e83f8a0c29278658) )
2778   ROM_CONTINUE(             0x1000, 0x0800)
2779   ROM_LOAD( "rom3d",        0x7000, 0x0800, CRC(91a00204) SHA1(eea8a8bd8439260dde9131693e9b53b0238ce7a7) )
2780   ROM_CONTINUE(             0x3000, 0x0800)
2781   /* Galactic Convoy GFX */
2782   ROM_LOAD( "rom4e",        0x5800, 0x0800, CRC(0cb9e297) SHA1(a9be2951851deed0ffefb980fc7751a399dc131e) )
2783   ROM_CONTINUE(             0x1800, 0x0800 )
2784   ROM_LOAD( "rom3e",        0x7800, 0x0800, CRC(a1fe77f9) SHA1(dc7972b7aa77fb4f95d7349d4cd7fc4674f9032d) )
2785   ROM_CONTINUE(             0x3800, 0x0800 )
2786
2787   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2788    ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
2789ROM_END
2790
2791ROM_START( bagmanmc )
2792   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2793   ROM_LOAD( "b1.bin",       0x0000, 0x1000, CRC(b74c75ee) SHA1(620083c30136e24a37b79eb4647d99b997107693) )
2794   ROM_LOAD( "b2.bin",       0x1000, 0x1000, CRC(a7d99916) SHA1(13185e8ff6de92ad5135895e5a7fc8b956f009d3) )
2795   ROM_LOAD( "b3.bin",       0x2000, 0x1000, CRC(c78f5360) SHA1(7ce9e94c33f1b8e60cc12a3df5f9555f1ca6130f) )
2796   ROM_LOAD( "b4.bin",       0x3000, 0x1000, CRC(eebd3bd1) SHA1(03200383e87b0759f607888d9b290a0a777b597e) )
2797   ROM_LOAD( "b5.bin",       0x4000, 0x1000, CRC(0fe24b8c) SHA1(205a36fd346d49d2dda6911198295e202caae81f) )
2798   ROM_LOAD( "b6.bin",       0x5000, 0x1000, CRC(f50390e7) SHA1(b4ebe647458c26e52461750d63856aea4262f110) )
2799
2800   ROM_REGION( 0x3000, REGION_GFX1, ROMREGION_DISPOSE )
2801   ROM_LOAD( "g1-u.bin",     0x0000, 0x0800, CRC(b63cfae4) SHA1(3e0cb3dbeec8ad790bc482176ca599721bac31ee) )
2802   ROM_CONTINUE(             0x2000, 0x0800 )
2803   ROM_LOAD( "g2-u.bin",     0x1000, 0x0800, CRC(a2790089) SHA1(7eb8634f26f6af52fb79bf90ec90b4e258c7c79f) )
2804   ROM_CONTINUE(             0x2800, 0x0800 )
2805   ROM_LOAD( "g1-l.bin",     0x0800, 0x0800, CRC(2ae6b5ab) SHA1(59bdebf75d28a247293440ec2ad83eaf30e3de00) )
2806   ROM_LOAD( "g2-l.bin",     0x1800, 0x0800, CRC(98b37397) SHA1(29914435a10cebbbce04382c45e13a64a0cd18cb) )
2807
2808
2809   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2810   ROM_LOAD( "bagmanmc.clr", 0x0000, 0x0020, NO_DUMP )   // missing
2811ROM_END
2812
2813ROM_START( dkongjrm )
2814   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2815   ROM_LOAD( "a1",           0x0000, 0x1000, CRC(299486e9) SHA1(cc4143ff8cb7a37c151bebab007a932381ae733b) )
2816   ROM_LOAD( "a2",           0x1000, 0x1000, CRC(a74a193b) SHA1(46f208293c0944b468550738d1238de9b672f403) )
2817   ROM_LOAD( "b2",           0x2000, 0x1000, CRC(7bc4f236) SHA1(84e7f5fcbea7d047f2a9a9006ae3ed646417c5e0) )
2818   ROM_LOAD( "c1",           0x3000, 0x1000, CRC(0f594c21) SHA1(eb15bd9cc37794786e2ad24753172e88aa7c4f98) )
2819   ROM_LOAD( "d1",           0x4000, 0x1000, CRC(cf7d7296) SHA1(9a817eca2ebef3f5208bb29ee7eece2ec0efe158) )
2820   ROM_LOAD( "e2",           0x5000, 0x1000, CRC(f7528a52) SHA1(e9d3c57934ee97fcc1f17ecdf3bc954574212220) )
2821   ROM_LOAD( "f1",           0x7000, 0x1000, CRC(9b1d4cc5) SHA1(9a412fec82f39b9389ff99cceba2e49b2a74df17) )
2822
2823   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
2824   ROM_LOAD( "v_3pa.bin",    0x0000, 0x1000, CRC(4974ffef) SHA1(7bb1e207dd3c5214e405bf32c57ec1b048061050) )
2825   ROM_LOAD( "a2.gfx",       0x1000, 0x1000, CRC(51845eaf) SHA1(43970d69329f3d49ea1ff57d54abe8340ceef275) )
2826   ROM_LOAD( "v_3na.bin",    0x2000, 0x1000, CRC(a95c4c63) SHA1(75e312b6872958f3bfc7bafd0743efdf7a74e8f0) )
2827   ROM_LOAD( "b2.gfx",       0x3000, 0x1000, CRC(7b39c3d0) SHA1(4b8cebb4cdaaca9e1b6fd378f6c390ab05984590) )
2828
2829   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2830   ROM_LOAD( "hustler.clr",  0x0000, 0x0020, CRC(aa1f7f5e) SHA1(311dd17aa11490a1173c76223e4ccccf8ea29850) )
2831ROM_END
2832
2833ROM_START( rockclim )
2834
2835   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2836   ROM_LOAD( "lc01.a1",   0x0000, 0x1000, CRC(8601ae8d) SHA1(6e0c3b34ce5e6879ce7a116c5c2660889a68320d) )
2837   ROM_LOAD( "lc02.a2",   0x1000, 0x1000, CRC(2dde9d4c) SHA1(7e343113116b94894558819a7f77f77e4e952da7) )
2838   ROM_LOAD( "lc03.a3",   0x2000, 0x1000, CRC(82c48a67) SHA1(abf95062eb5c9bd4bb3c9b9af59396a4ca6905d8) )
2839   ROM_LOAD( "lc04.a4",   0x3000, 0x1000, CRC(7cd3a04a) SHA1(756c12288e120e6f761b266b91920d17cab6926c) )
2840   ROM_LOAD( "lc05.a5",   0x6000, 0x1000, CRC(5e542149) SHA1(425a5a8769c3fa0887db8ff04e2a4f32f18d2679) )
2841   ROM_LOAD( "lc06.a6",   0x7000, 0x1000, CRC(b2bdca64) SHA1(e72e63725164c922816dda90ac964a94062eab1b) )
2842
2843   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
2844   ROM_LOAD( "lc08.a9",   0x0000, 0x800, CRC(7f18e1ef) SHA1(2a160b994708ec0f06774dde3ec613af7e3f32c6) )
2845   ROM_LOAD( "lc07.a7",   0x0800, 0x800, CRC(f18b50ac) SHA1(a2328eb55882a09403cae1a497c611b494649cac) )
2846   ROM_LOAD( "lc10.c9",   0x1000, 0x800, CRC(dec5781b) SHA1(b6277fc890d153db24bd48293780cf239a6aa0e7) )
2847   ROM_LOAD( "lc09.c7",   0x1800, 0x800, CRC(06c0b5de) SHA1(561cf99a6be03205c7bc5fd15d4d51ee4d6d164b) )
2848
2849   ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )
2850   ROM_LOAD( "lc13.g5",   0x0000, 0x1000, CRC(19475f2b) SHA1(5d42aa45a7b519dacdecd3d2edbfee6971693034) )
2851   ROM_LOAD( "lc14.g7",   0x1000, 0x1000, CRC(cc96d1db) SHA1(9713b47b723a5d8837f2a8e8c43e46dc41a62e5b) )
2852
2853   ROM_REGION( 0x0040, REGION_PROMS, 0 )
2854   ROM_LOAD( "lc12.e9",  0x0000, 0x0020, CRC(f6e76547) SHA1(c9ea78d1876156561b3bbf327d7e0299e1d9fd4a) )
2855   ROM_LOAD( "lc11.f4",  0x0020, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
2856ROM_END
2857
2858ROM_START( ozon1 )
2859   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2860   ROM_LOAD( "rom1.bin",     0x0000, 0x1000, CRC(54899e8b) SHA1(270af76ae4396ebda767f160535fa77c0b49726a) )
2861   ROM_LOAD( "rom2.bin",     0x1000, 0x1000, CRC(3c90fbfc) SHA1(92da614dba3a644eac144bb0ed434d78a31fcb1a) )
2862   ROM_LOAD( "rom3.bin",     0x2000, 0x1000, CRC(79fe313b) SHA1(ef8fd70f5669b7e7d7184eca2baaddcecb55c22d) )
2863
2864   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2865   ROM_LOAD( "rom7.bin",     0x0000, 0x0800, CRC(464285e8) SHA1(fff36b034b95050219c70cdfe05ff3bbc452b73e) )
2866   ROM_LOAD( "rom8.bin",     0x0800, 0x0800, CRC(92056dcc) SHA1(b162da8701bfee465205e8f274ee494063c52c7b) )
2867
2868   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2869   ROM_LOAD( "ozon1.clr", 0x0000, 0x0020, CRC(605ea6e9) SHA1(d3471e6ef756059c2f7feb32fb8e41181cc1718e) )
2870ROM_END
2871
2872ROM_START( ladybugg )
2873   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2874   ROM_LOAD( "lbuggx.1",   0x0000, 0x0800, CRC(e67e241d) SHA1(42b8eaca71c6b346ab54bc722850d6e6d169c517) )
2875   ROM_LOAD( "lbuggx.2",   0x0800, 0x0800, CRC(3cb1fb9a) SHA1(ee76758c94329dfcc740571195a74d9242aaf49f) )
2876   ROM_LOAD( "lbuggx.3",   0x1000, 0x0800, CRC(0937009e) SHA1(ef57ebf3d6ab3d6ac0e1faa10c3109d2c80a1248) )
2877   ROM_LOAD( "lbuggx.4",   0x1800, 0x0800, CRC(3e773f62) SHA1(6348e61f48e5d1f04289098c4c0395335ea5e2a5) )
2878   ROM_LOAD( "lbuggx.5",   0x2000, 0x0800, CRC(2b0d42e5) SHA1(1547b8127f964eb10862b566f5779f8011c3441d) )
2879   ROM_LOAD( "lbuggx.6",   0x2800, 0x0800, CRC(159f9433) SHA1(93341a4de1e1e4a3fb004019fc1edba73db6a4c8) )
2880   ROM_LOAD( "lbuggx.7",   0x3000, 0x0800, CRC(f2be06d5) SHA1(1354332d2d107ad810aa2e261b595285394dfb49) )
2881   ROM_LOAD( "lbuggx.8",   0x3800, 0x0800, CRC(646fe79f) SHA1(03223d6c4f9050fd6c1c313f0e366ab4989feca4) )
2882
2883   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
2884   ROM_LOAD( "lbuggx.a",   0x0800, 0x0800, CRC(7efb9dc5) SHA1(5e02ea8cd1a1c8efa6708a8615cc2dc9da65a455) )
2885   ROM_CONTINUE ( 0x0000, 0x0800)
2886   ROM_LOAD( "lbuggx.b",   0x1800, 0x0800, CRC(351d4ddc) SHA1(048e8a60e57c6eb0a4d7c2175ddd46c4273756c5) )
2887   ROM_CONTINUE ( 0x1000, 0x0800)
2888
2889   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2890   ROM_LOAD( "lbuggx.clr", 0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
2891ROM_END
2892
2893ROM_START( vpool )
2894   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2895   ROM_LOAD( "vidpool1.bin", 0x0000, 0x0800, CRC(333f4732) SHA1(b57460c039c69137645bd4280ad877aa789277d6) )
2896   ROM_CONTINUE(             0x2000, 0x0800 )
2897   ROM_LOAD( "vidpool2.bin", 0x0800, 0x0800, CRC(eea6c0f1) SHA1(5b18caa78e246f55fd9cd778d6e83f79f0b3f157) )
2898   ROM_CONTINUE(             0x2800, 0x0800 )
2899   ROM_LOAD( "vidpool3.bin", 0x1000, 0x0800, CRC(309972a6) SHA1(8269d2f677f55dda71d6a7b0796d2d53a4def59d) )
2900   ROM_CONTINUE(             0x3000, 0x0800 )
2901   ROM_LOAD( "vidpool4.bin", 0x1800, 0x0800, CRC(c4f71c1d) SHA1(e1d01135d5ccc1a53308ce89dc2a8fc0992207d5) )
2902   ROM_CONTINUE(             0x3800, 0x0800 )
2903
2904   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2905   ROM_LOAD( "hustler.5f", 0x0000, 0x0800, CRC(0bdfad0e) SHA1(8e6f1737604f3801c03fa2e9a5e6a2778b54bae8) ) // vidpoolh.bin
2906   ROM_LOAD( "hustler.5h", 0x0800, 0x0800, CRC(8e062177) SHA1(7e52a1669804b6c2f694cfc64b04abc8246bb0c2) ) // vidpoolk.bin
2907
2908   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2909   ROM_LOAD( "hustler.clr",  0x0000, 0x0020, CRC(aa1f7f5e) SHA1(311dd17aa11490a1173c76223e4ccccf8ea29850) )
2910ROM_END
2911
2912ROM_START( drivfrcg )
2913   ROM_REGION( 0x8000, REGION_CPU1, 0 )
2914   ROM_LOAD( "dfgp1.bin",    0x2800, 0x0400, CRC(52d5e77d) SHA1(4e68ac1274bbc8cb5b6a7dfb511232bd83482453) )
2915   ROM_CONTINUE(           0x2c00, 0x0400 )
2916   ROM_CONTINUE(           0x0000, 0x0400 )
2917   ROM_CONTINUE(           0x0400, 0x0400 )
2918   ROM_LOAD( "dfgp2.bin",    0x0800, 0x0400, CRC(9cf4dbce) SHA1(028c168ad0987f21d76c6ac4f756f4fa86c2f8e3) )
2919   ROM_CONTINUE(           0x0c00, 0x0400 )
2920   ROM_CONTINUE(           0x2000, 0x0400 )
2921   ROM_CONTINUE(           0x2400, 0x0400 )
2922   ROM_LOAD( "dfgp3.bin",    0x6800, 0x0400, CRC(79763f62) SHA1(2bb8921fcd2a8b9543e398e248fd47d7e03dc24d) )
2923   ROM_CONTINUE(           0x6c00, 0x0400 )
2924   ROM_CONTINUE(           0x4000, 0x0400 )
2925   ROM_CONTINUE(           0x4400, 0x0400 )
2926   ROM_LOAD( "dfgp4.bin",    0x4800, 0x0400, CRC(dd95338b) SHA1(9054986f7b8fee36f458362836ae969e7d1e2456) )
2927   ROM_CONTINUE(           0x4c00, 0x0400 )
2928   ROM_CONTINUE(           0x6000, 0x0400 )
2929   ROM_CONTINUE(           0x6400, 0x0400 )
2930
2931   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
2932   ROM_LOAD( "dfgj2.bin",    0x0000, 0x1000, CRC(8e19f1e7) SHA1(addd5add2117ef29ce38c0c80584e5d481b9d820) )
2933   ROM_LOAD( "dfgj1.bin",    0x1000, 0x1000, CRC(86b60ca8) SHA1(be266e2d69e12a196c2195d48b495c0fb9ef8a43) )
2934   ROM_LOAD( "dfgl2.bin",    0x2000, 0x1000, CRC(ea5e9959) SHA1(6b638d22adf19224cf741458c8ad34d7f7e17e58) )
2935   ROM_LOAD( "dfgl1.bin",    0x3000, 0x1000, CRC(b7ed195c) SHA1(81b2b444153dacb962a33a5d86a280ed5088637a) )
2936
2937   /* piggy-backed colour proms */
2938   ROM_REGION( 0x0040, REGION_PROMS, 0 )
2939   ROM_LOAD( "top.clr",      0x0000, 0x0020, CRC(3110ddae) SHA1(53b2e1cc07915592f6c868131ec296c63a407f04) )
2940   ROM_LOAD( "bot.clr",      0x0020, 0x0020, CRC(0f0782af) SHA1(32c0dd09ead5c70cee2657e9cb8cb9fcf54c5a6a) )
2941ROM_END
2942
2943ROM_START( drivfrcb )
2944   ROM_REGION( 0x8000, REGION_CPU1, 0 )
2945   ROM_LOAD( "dfp.bin",      0x2800, 0x0400, CRC(b5b2981d) SHA1(c9ff19791895bf05b569457b1e53dfa0aaeb8e95) )
2946   ROM_CONTINUE(           0x2c00, 0x0400 )
2947   ROM_CONTINUE(           0x0000, 0x0400 )
2948   ROM_CONTINUE(           0x0400, 0x0400 )
2949   ROM_CONTINUE(           0x0800, 0x0400 )
2950   ROM_CONTINUE(           0x0c00, 0x0400 )
2951   ROM_CONTINUE(           0x2000, 0x0400 )
2952   ROM_CONTINUE(           0x2400, 0x0400 )
2953   ROM_CONTINUE(           0x6800, 0x0400 )
2954   ROM_CONTINUE(           0x6c00, 0x0400 )
2955   ROM_CONTINUE(           0x4000, 0x0400 )
2956   ROM_CONTINUE(           0x4400, 0x0400 )
2957   ROM_CONTINUE(           0x4800, 0x0400 )
2958   ROM_CONTINUE(           0x4c00, 0x0400 )
2959   ROM_CONTINUE(           0x6000, 0x0400 )
2960   ROM_CONTINUE(           0x6400, 0x0400 )
2961
2962   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
2963   ROM_LOAD( "df1.bin",      0x1000, 0x1000, CRC(8adc3de0) SHA1(046fb92913171c621bb62edb0174f04298bfd283) )
2964   ROM_CONTINUE(           0x0000, 0x1000 )
2965   ROM_LOAD( "df2.bin",      0x3000, 0x1000, CRC(6d95ec35) SHA1(c745ee2bc7b1fb53e8bc1ac3a4238bbe00f30cfe) )
2966   ROM_CONTINUE(           0x2000, 0x1000 )
2967
2968   /* piggy-backed colour proms */
2969   ROM_REGION( 0x0040, REGION_PROMS, 0 )
2970   ROM_LOAD( "top.clr",      0x0000, 0x0020, CRC(3110ddae) SHA1(53b2e1cc07915592f6c868131ec296c63a407f04) )
2971   ROM_LOAD( "bot.clr",      0x0020, 0x0020, CRC(0f0782af) SHA1(32c0dd09ead5c70cee2657e9cb8cb9fcf54c5a6a) )
2972ROM_END
2973
2974ROM_START( bongo )
2975   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2976   ROM_LOAD( "bg1.bin",    0x0000, 0x1000, CRC(de9a8ec6) SHA1(b5ee99b26d1a39e31b643ad0f5723ee8e364023e) )
2977   ROM_LOAD( "bg2.bin",    0x1000, 0x1000, CRC(a19da662) SHA1(a2674392d489c5e5eeb9abc51572a37cc6045220) )
2978   ROM_LOAD( "bg3.bin",    0x2000, 0x1000, CRC(9f6f2150) SHA1(26a1f872686ddddcdb690d7b826ba26c20cdec35) )
2979   ROM_LOAD( "bg4.bin",    0x3000, 0x1000, CRC(f80372d2) SHA1(078e2c8b947103c168c0c85430f8ebc9d09f8ba7) )
2980   ROM_LOAD( "bg5.bin",    0x4000, 0x1000, CRC(fc92eade) SHA1(f4012a1c4631388a3e8109a8381bc4084ddc8757) )
2981   ROM_LOAD( "bg6.bin",    0x5000, 0x1000, CRC(561d9e5d) SHA1(68d7fab3cfb5b3360fe8064c70bf21bb1341032f) )
2982
2983   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
2984   ROM_LOAD( "b-h.bin",    0x0000, 0x1000, CRC(fc79d103) SHA1(dac1152221ebdc4cd9bf353b4cc5d45021ca5d9e) )
2985   ROM_LOAD( "b-k.bin",    0x1000, 0x1000, CRC(94d17bf3) SHA1(2a70968249946de52c5a4cfabafbbf4ecda844a8) )
2986
2987   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2988   ROM_LOAD( "b-clr.bin",  0x0000, 0x0020, CRC(c4761ada) SHA1(067d12b2d3635ffa6337ed234ba42717447bea00) )
2989ROM_END
2990
2991ROM_START( hunchbkg )
2992   ROM_REGION( 0x8000, REGION_CPU1, 0 )
2993   ROM_LOAD( "gal_hb_1",     0x0000, 0x0800, CRC(46590e9b) SHA1(5d26578c91adec20d8d8a17d5dade9ef2febcbe5) )
2994   ROM_LOAD( "gal_hb_2",     0x0800, 0x0800, CRC(4e6e671c) SHA1(5948fc7f390f0343b367d333395427ce2f9b2931) )
2995   ROM_LOAD( "gal_hb_3",     0x2000, 0x0800, CRC(d29dc242) SHA1(3f6087fe962ee63c2886ad3f502c1a37d357ba87) )
2996   ROM_LOAD( "gal_hb_4",     0x2800, 0x0800, CRC(d409d292) SHA1(d631c9106106b31b605b6fdf1d4f40e237a725ac) )
2997   ROM_LOAD( "gal_hb_5",     0x4000, 0x0800, CRC(29d3a8c4) SHA1(2e1ef20d980e5033503d8095e9576dcb8f532f41) )
2998   ROM_LOAD( "gal_hb_6",     0x4800, 0x0800, CRC(b016fd15) SHA1(cdfbd531e23438f05a7c3aad99a94ce55912aac3) )
2999   ROM_LOAD( "gal_hb_7",     0x6000, 0x0800, CRC(d2731d27) SHA1(8c4a3d2303d85c3b11803c577a9ad21e6e69011e) )
3000   ROM_LOAD( "gal_hb_8",     0x6800, 0x0800, CRC(e4b1a666) SHA1(9f73d17cff208374d587536e783be024fc9ab700) )
3001
3002   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3003   ROM_LOAD( "gal_hb_kl",    0x0000, 0x0800, CRC(3977650e) SHA1(1de05d6ceed3f2ed0925caa8235b63a93f03f61e) )
3004   ROM_LOAD( "gal_hb_hj",    0x0800, 0x0800, CRC(db489c3d) SHA1(df08607ad07222c1c1c4b3589b50b785bdeefbf2) )
3005
3006   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3007   ROM_LOAD( "gal_hb_cp",    0x0000, 0x0020, CRC(cbff6762) SHA1(4515a6e12a0a5c485a55291feee17a571120a549) )
3008ROM_END
3009
3010ROM_START( harem )
3011   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3012   ROM_LOAD( "p0_ic85.bin",  0x0000, 0x2000, CRC(4521b753) SHA1(9033f9c3be8fec1e5ff251e9f60faaf3848a1a1e) )
3013   ROM_LOAD( "p1_ic87.bin",  0x8000, 0x2000, BAD_DUMP CRC(3cc5d1e8) SHA1(827e2d20de2a00ec016ead249ed3afdccd0c856c) )
3014
3015   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3016   ROM_LOAD( "s1_ic12.bin",  0x0000, 0x2000, CRC(b54799dd) SHA1(b6aeb010257cba48a52afd33b4f8031c7d99550c) )
3017   ROM_LOAD( "s2_ic13.bin",  0x2000, 0x1000, CRC(2d5573a4) SHA1(1fdcd99d89e078509634742b2116a35bb199fe4b) )
3018
3019   ROM_REGION( 0x2000, REGION_SOUND1, 0 )
3020   ROM_LOAD( "a1_ic25.bin",  0x0000, 0x2000, CRC(279f923a) SHA1(166b1b625997766f0de7cc18af52c42268022fcb) )
3021
3022   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
3023   ROM_LOAD( "m0_ic36.bin",  0x0000, 0x2000, CRC(64b3c6d6) SHA1(e71092585f7ffdae85b2a4c9add1bc71e5a608a8) )
3024   ROM_LOAD( "m1_ic37.bin",  0x2000, 0x2000, CRC(cb0324fb) SHA1(61612f683810339d5d5f31daa4c475d0338d446f) )
3025
3026   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3027   ROM_LOAD( "harem.clr",    0x0000, 0x0020, CRC(c9a2bf73) SHA1(dad65ebf43a5df147e334afd552e67f5fcd26df7) )
3028ROM_END
3029
3030ROM_START( tazzmang )
3031   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3032   ROM_LOAD( "tazzm1.4k",    0x0000, 0x1000, CRC(a14480a1) SHA1(60dac6b57e8331cc4daedaf87faf3e3acc68f378) )
3033   ROM_LOAD( "tazzm2.5j",    0x1000, 0x1000, CRC(5609f5db) SHA1(3fc50109ea0e012e3e310ae4f5dd0cf460bdca52) )
3034   ROM_LOAD( "tazzm3.6f",    0x2000, 0x1000, CRC(fe7f7002) SHA1(ac4134c07a798328b18994010bcaf6b3f728466a) )
3035   ROM_LOAD( "tazzm4.7e",    0x3000, 0x1000, CRC(c9ca1d0a) SHA1(d420ca2e926174e17215212278c86ba9bbb3d9dc) )
3036   ROM_LOAD( "tazzm5.7l",    0x4000, 0x1000, CRC(f50cd8a6) SHA1(b59ca37171b9acc9854f1beae43cfa5643219a5f) )
3037   ROM_LOAD( "tazzm6.7l",    0x5000, 0x1000, CRC(5cf2e7d2) SHA1(ad89e2655164e0fc5ecc9af70c5f0dd9b094d432) )
3038
3039   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3040   ROM_LOAD( "tazm8.1lk",    0x0000, 0x0800, CRC(2c5b612b) SHA1(32e3a41a9a4a8b1285b6a195213ff0d98012360a) )
3041   ROM_LOAD( "tazzm7.1jh",   0x0800, 0x0800, CRC(3f5ff3ac) SHA1(bc70eef54a45b52c14e35464e5f06b5eec554eb6) )
3042
3043   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3044   ROM_LOAD( "prom.6l",      0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
3045ROM_END
3046
3047ROM_START( racknrol )
3048   ROM_REGION( 0x8000, REGION_CPU1, 0 )
3049   ROM_LOAD( "horz_p.bin",   0x0000, 0x1000, CRC(32ca5b43) SHA1(f3e7662f947dcdd80f6eae4f002d2fe64a825aff) )
3050   ROM_CONTINUE(           0x2000, 0x1000 )
3051   ROM_CONTINUE(           0x4000, 0x1000 )
3052   ROM_CONTINUE(           0x6000, 0x1000 )
3053
3054   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
3055   ROM_LOAD( "horz_g.bin",   0x0000, 0x4000, CRC(97069ad5) SHA1(50199c7bc5083be23a34849cff17906795bf4067) )
3056   ROM_LOAD( "horz_r.bin",   0x4000, 0x4000, CRC(ff64e84b) SHA1(ceabd522bae26743804987632f35f3c4b5aff179) )
3057
3058   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3059   ROM_LOAD( "82s123.bin",   0x0000, 0x0020, CRC(737802bf) SHA1(9b0476c51ce63898cd690e01e16ee83bae361cb2) )
3060
3061   ROM_REGION( 0x0200, REGION_USER1, 0 ) /* unknown */
3062   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(aace7fa5) SHA1(6761530bb3585d2eaa97b7ae77b52e96782ffe0a) )
3063ROM_END
3064
3065ROM_START( hexpool )
3066   ROM_REGION( 0x8000, REGION_CPU1, 0 )
3067   ROM_LOAD( "vert_p.bin",   0x0000, 0x1000, CRC(bdb078fc) SHA1(85a65c3038dc05a98eae71edf9efdd6659a2966a) )
3068   ROM_CONTINUE(           0x2000, 0x1000 )
3069   ROM_CONTINUE(           0x4000, 0x1000 )
3070   ROM_CONTINUE(           0x6000, 0x1000 )
3071
3072   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
3073   ROM_LOAD( "vert_g.bin",   0x0000, 0x4000, CRC(7e257e80) SHA1(dabb10d076dc49fc130f58e6d1c4b04e6debce55) )
3074   ROM_LOAD( "vert_r.bin",   0x4000, 0x4000, CRC(c5f0851e) SHA1(cedcdb29962c6cd65af9d57d0cb2533397d58f99) )
3075
3076   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3077   ROM_LOAD( "82s123.bin",   0x0000, 0x0020, CRC(737802bf) SHA1(9b0476c51ce63898cd690e01e16ee83bae361cb2) )
3078
3079   ROM_REGION( 0x0200, REGION_USER1, 0 ) /* unknown */
3080   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(aace7fa5) SHA1(6761530bb3585d2eaa97b7ae77b52e96782ffe0a) )
3081ROM_END
3082
3083ROM_START( hexpoola )
3084   ROM_REGION( 0x8000, REGION_CPU1, 0 )
3085   ROM_LOAD( "rom.4l",       0x0000, 0x1000, CRC(2ca8018d) SHA1(f0784d18bc7e77515bf2140d8993ae8178919853) )
3086   ROM_CONTINUE(           0x2000, 0x1000 )
3087   ROM_CONTINUE(           0x4000, 0x1000 )
3088   ROM_CONTINUE(           0x6000, 0x1000 )
3089
3090   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
3091   ROM_LOAD( "rom.1m",       0x0000, 0x4000, CRC(7e257e80) SHA1(dabb10d076dc49fc130f58e6d1c4b04e6debce55) )
3092   ROM_LOAD( "rom.1l",       0x4000, 0x4000, CRC(c5f0851e) SHA1(cedcdb29962c6cd65af9d57d0cb2533397d58f99) )
3093
3094   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3095   ROM_LOAD( "82s123.11r",   0x0000, 0x0020, CRC(deb2fcf4) SHA1(cdec737a9d9feae912f7cc04ca0adb48f859b5c2) )
3096
3097   ROM_REGION( 0x0200, REGION_USER1, 0 ) /* unknown */
3098   ROM_LOAD( "82s147.5pr",   0x0000, 0x0200, CRC(cf496b1e) SHA1(5b5ca52b3cc46e18990dae53a98984aeaf264241) )
3099
3100   ROM_REGION( 0x00eb, REGION_PLDS, 0 )
3101   ROM_LOAD( "82s153.6pr.bin", 0x0000, 0x00eb, CRC(bc07939a) SHA1(615b085575ad215662eab2777a2d8b9167c4b9c3) )
3102ROM_END
3103
3104ROM_START( trvchlng )
3105   ROM_REGION( 0x8000, REGION_CPU1, 0 )
3106   ROM_LOAD( "senko11.bin",  0x0000, 0x1000, CRC(3657331d) SHA1(d9a9a4e4e2e696e70dfb888725c959ec8ce24e3d) )
3107   ROM_CONTINUE(           0x2000, 0x1000 )
3108   ROM_CONTINUE(           0x4000, 0x1000 )
3109   ROM_CONTINUE(           0x6000, 0x1000 )
3110
3111   ROM_REGION( 0x100000, REGION_USER1, 0 )
3112   ROM_LOAD( "questions",    0x000000, 0x100000, NO_DUMP )
3113
3114   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
3115   ROM_LOAD( "senko10.bin",  0x0000, 0x4000, CRC(234b59d0) SHA1(5eafdfc6d6a73575835b68361fe29a2dc61e8a83) )
3116   ROM_LOAD( "senko12.bin",  0x4000, 0x4000, CRC(0bf6b92d) SHA1(6ca993c0642949a52fafea3bc57a08c6881e8120) )
3117
3118   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3119   ROM_LOAD( "senko1.bin",   0x0000, 0x0020, CRC(1434c7ff) SHA1(0ee5f5351dd84fbf8d3d8eaafbdbe86dd29960f8) )
3120ROM_END
3121
3122ROM_START( luctoday )
3123   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3124   ROM_LOAD( "ltprog1.bin", 0x0000, 0x0800, CRC(59c389b9) SHA1(1e158ced3b56db2c51e422fb4c0b8893565f1956))
3125   ROM_LOAD( "ltprog2.bin", 0x2000, 0x0800, CRC(ac3893b1) SHA1(f6b9cd8111b367ff7030cba52fe965959d92568f))
3126
3127   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3128   ROM_LOAD( "ltchar2.bin", 0x0000, 0x0800, CRC(8cd73bdc) SHA1(6174f7347d2c96f9c5074bc0da5a370c9b07461b))
3129   ROM_LOAD( "ltchar1.bin", 0x0800, 0x0800, CRC(b5ba9946) SHA1(7222cbe8c41ca74b214f4dd5439bf69d90f4644e))
3130
3131   ROM_REGION( 0x0020, REGION_PROMS, 0 )//This may not be the correct prom
3132   ROM_LOAD( "74s288.ch", 0x0000, 0x0020, BAD_DUMP CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d))
3133ROM_END
3134
3135ROM_START( chewing )
3136   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3137   ROM_LOAD( "1.bin", 0x0000, 0x1000, CRC(7470b347) SHA1(315d2631b50a6e469b9538318d95452e8d2e1f69) )
3138   ROM_LOAD( "7l.bin", 0x2000, 0x0800, CRC(78ebed36) SHA1(e80185737c8ac448901cf0e60ca50d967c323b34) )
3139
3140   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3141   ROM_LOAD( "2.bin", 0x0000, 0x0800, CRC(88c605f3) SHA1(938a9fadfa0994a1d2fc9b3266ec4ccdb5ec6d3a) )
3142   ROM_LOAD( "3.bin", 0x0800, 0x0800, CRC(77ac016a) SHA1(fa5b1e79603ca8d2ee7b3d0a78f12d9ffeec3fd4) )
3143
3144   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3145   ROM_LOAD( "74s288.ch", 0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) )
3146ROM_END
3147
3148ROM_START( catacomb )
3149   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3150   ROM_LOAD( "catacomb.u",    0x0000, 0x0800, CRC(35cc28d2) SHA1(e1dbd75fc21ec88b8119bf9508c87d78e1d5c4f6) )
3151   ROM_LOAD( "catacomb.v",    0x0800, 0x0800, CRC(1d1ce133) SHA1(e22a169003a2238004bdf6c2558198216c2353b7) )
3152   ROM_LOAD( "catacomb.w",    0x1000, 0x0800, CRC(479bbde7) SHA1(9981662cb6351de7c1730de45f645fb0e26ea467) )
3153   /* no .x */
3154   ROM_LOAD( "catacomb.y",    0x2000, 0x0800, CRC(5e3da534) SHA1(a9b960ae96c8ef0b2d590bc58b711aad949025e2) )
3155
3156   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3157   ROM_LOAD( "cat-gfx1",       0x0000, 0x0800, CRC(e871e65c) SHA1(0b528dfab0f57153db9406798848cdedee0323a0) )
3158   ROM_LOAD( "cat-gfx2",       0x0800, 0x0800, CRC(b14dafaa) SHA1(592d5931a76563b3565f22ac4c0120b9a120193f) )
3159
3160   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3161   /* No color PROM came with the conversion - the Moon Cresta one seems more appropriate than Galaxian,
3162       (the game is unplayable with a Galaxian PROM) but which was intended for use with the kit is unclear */
3163   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, BAD_DUMP CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
3164ROM_END
3165
3166ROM_START( ckongg )
3167   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3168   ROM_LOAD( "ck1.bin",       0x2400, 0x0400, CRC(a4323b94) SHA1(1fed47e1df5efa8f40585bedab07b60067edc2bb) )
3169   ROM_CONTINUE(              0x1C00, 0x0400)
3170   ROM_CONTINUE(              0x4800, 0x0400)
3171   ROM_CONTINUE(              0x0C00, 0x0400)
3172   ROM_LOAD( "ck2.bin",       0x4400, 0x0400, CRC(1e532996) SHA1(fe1feeca347fccd266925614a46c98cff683f5d3) )
3173   ROM_CONTINUE(              0x0000, 0x0400)
3174   ROM_CONTINUE(              0x1800, 0x0400)
3175   ROM_CONTINUE(              0x2800, 0x0400)
3176   ROM_LOAD( "ck3.bin",       0x3400, 0x0400, CRC(65157cde) SHA1(572b9bd56894600e21220356d0bf193c7920672c) )
3177   ROM_CONTINUE(              0x4c00, 0x0400)
3178   ROM_CONTINUE(              0x5000, 0x0400)
3179   ROM_CONTINUE(              0x0400, 0x0400)
3180   ROM_LOAD( "ck4.bin",       0x2000, 0x0400, CRC(43827bc6) SHA1(a2ca9afff0dd1bdcfc3a6ead9ff30b7c91caa7ea) )
3181   ROM_CONTINUE(              0x3800, 0x0400)
3182   ROM_CONTINUE(              0x1000, 0x0400)
3183   ROM_CONTINUE(              0x4000, 0x0400)
3184   ROM_LOAD( "ck5.bin",       0x0800, 0x0400, CRC(a74ed96e) SHA1(1e845d693a728fea9d52953b5493ec98fdec63e3) )
3185   ROM_CONTINUE(              0x5400, 0x0400)  // fill
3186   ROM_CONTINUE(              0x2c00, 0x0400)
3187   ROM_CONTINUE(              0x1400, 0x0400)
3188   ROM_LOAD( "ck7.bin",       0x3000, 0x0400, CRC(2c4d8129) SHA1(ab1708ff72ee027106fe8da0caea03a796b3212b) )
3189   ROM_CONTINUE(              0x3c00, 0x0400)
3190
3191   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3192   ROM_LOAD( "ckvid10.bin",   0x0000, 0x1000, CRC(7866d2cb) SHA1(62dd8b80bc0459c7337d8a8cb83e53b999e7f4a9) )
3193   ROM_LOAD( "ckvid7.bin",    0x1000, 0x1000, CRC(7311a101) SHA1(49d54c8b94cae4ba81d7a7684eaa4e87815bb4da) )
3194
3195   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3196   ROM_LOAD( "ck_cp.bin",     0x0000, 0x0020, CRC(7e0b79cb) SHA1(72ef3eb5f09e10c13dcf6fd568a6d16658055a16) )
3197ROM_END
3198
3199ROM_START( kkgalax )
3200   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3201   ROM_LOAD( "kc1.bin",       0x0000, 0x0800, CRC(a87fc828) SHA1(f66b72427d8cdfabdf2274e22bdb10018ac7d2f9) )
3202   ROM_CONTINUE( 0x2000, 0x0800)
3203   ROM_LOAD( "kc2.bin",       0x0800, 0x0800, CRC(94a13dec) SHA1(d3bfd5a266bb1f0e66d847e15b51bdd4c9a15e37) )
3204   ROM_CONTINUE( 0x2800, 0x0800)
3205   ROM_LOAD( "kc3.bin",       0x1000, 0x0800, CRC(5efc6705) SHA1(9af59a9cb58599b1c7ce0a063929531f6c73b912) )
3206   ROM_CONTINUE( 0x3000, 0x0800)
3207   ROM_LOAD( "kc4.bin",       0x1800, 0x0800, CRC(ac917d66) SHA1(63a0db01bb93e052fec64fa69ebcbae3b0b8aa04) )
3208   ROM_CONTINUE( 0x3800, 0x0800)
3209   ROM_LOAD( "kc5.bin",       0x4000, 0x0800, CRC(5a9ee1ed) SHA1(1bc420a42a4931c389b4f8db451de7c59786dfbc) )
3210   ROM_LOAD( "kc6.bin",       0x4800, 0x0800, CRC(f787431e) SHA1(5cee497b8f4072509920d982470cbe06bd18f88b) )
3211   ROM_LOAD( "kc7.bin",       0x5000, 0x0800, CRC(7a185e31) SHA1(a257f32958af6b2c1c9007b46bd1dc984670b0d9) )
3212
3213   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3214   ROM_LOAD( "kc8carat.bin",   0x0000, 0x1000, CRC(7866d2cb) SHA1(62dd8b80bc0459c7337d8a8cb83e53b999e7f4a9) )
3215   ROM_LOAD( "kc9carat.bin",   0x1000, 0x1000, CRC(7311a101) SHA1(49d54c8b94cae4ba81d7a7684eaa4e87815bb4da) )
3216
3217   ROM_REGION( 0x0020, REGION_PROMS, 0 ) // not in this set
3218   ROM_LOAD( "ck_cp.bin",     0x0000, 0x0020, CRC(7e0b79cb) SHA1(72ef3eb5f09e10c13dcf6fd568a6d16658055a16) )
3219ROM_END
3220
3221
3222ROM_START( porter )
3223   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3224   ROM_LOAD( "port1.bin",          0x0000, 0x0800, CRC(babaf7fe) SHA1(2138abf57990df9b6f9953efd3be9b2bede49520) )
3225   ROM_CONTINUE(                   0x2000, 0x0800)
3226   ROM_LOAD( "port2.bin",          0x0800, 0x0800, CRC(8f7eb0e3) SHA1(7ac5bfc0bb8b6a7a3e9acab5ce9a53f7cba1fca5) )
3227   ROM_CONTINUE(                   0x2800, 0x0800)
3228   ROM_LOAD( "port3.bin",          0x1000, 0x0800, CRC(683939b5) SHA1(caf69b03794cb5cf63b1aa52cf8ef355a3aeef87) )
3229   ROM_CONTINUE(                   0x3000, 0x0800)
3230   ROM_LOAD( "port4.bin",          0x1800, 0x0800, CRC(6a65d58d) SHA1(05824a41b2912f12bff7887e7483cb3f4367d339) )
3231   ROM_CONTINUE(                   0x3800,0x0800)
3232   ROM_LOAD( "port5.bin",          0x4000, 0x0800, CRC(2978a9aa) SHA1(99ec75c7f83f4858b26e083b50fde41fbcfe449a) )
3233   ROM_LOAD( "port6.bin",          0x4800, 0x0800, CRC(7ecdffb5) SHA1(18ce71b670503bef039c6bfb0aed5e8c10e9eb2d) )
3234
3235   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3236   ROM_LOAD( "port7.bin",          0x0000, 0x1000, CRC(603294f9) SHA1(168b90fdf38cd2e2c7f54cde16b4d83dc5bb3046) )
3237   ROM_LOAD( "port8.bin",          0x1000, 0x1000, CRC(b66a763d) SHA1(995b473b1942ff666b0989993587e41e89542172) )
3238
3239   ROM_REGION( 0x0020, REGION_PROMS, 0 ) // not in the set
3240   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, BAD_DUMP CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
3241ROM_END
3242
3243GAME( 1981, scramblb, scramble, scramblb, scramblb, 0,        ROT90,  "bootleg", "Scramble (Galaxian hardware)", GAME_SUPPORTS_SAVE )
3244GAME( 1981, scramb2,  scramble, scramb2,  scramb2,  0,        ROT90,  "bootleg", "Scramble (bootleg)", GAME_SUPPORTS_SAVE )
3245
3246GAME( 1981, 4in1,     0,        4in1,     4in1,     4in1,     ROT90,  "Armenia / Food and Fun", "4 Fun in 1", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
3247GAME( 1982, bagmanmc, bagman,   bagmanmc, bagmanmc, 0,        ROT90,  "bootleg", "Bagman (Moon Cresta hardware)", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
3248GAME( 1982, dkongjrm, dkongjr,  dkongjrm, dkongjrm, 0,        ROT90,  "bootleg", "Donkey Kong Jr. (Moon Cresta hardware)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
3249GAME( 1981, rockclim, 0,        rockclim, rockclim, 0,         ROT180, "Taito", "Rock Climber", GAME_SUPPORTS_SAVE )
3250GAME( 1983, ozon1,    0,        ozon1,    ozon1,    0,         ROT90,  "Proma", "Ozon I", GAME_SUPPORTS_SAVE )
3251GAME( 1983, ladybugg, ladybug,  batman2,  ladybugg, ladybugg, ROT270, "bootleg", "Ladybug (bootleg on Galaxian hardware)", GAME_SUPPORTS_SAVE )
3252GAME( 1980, vpool,    hustler,  mooncrst, vpool,    0,        ROT90,  "bootleg", "Video Pool (bootleg on Moon Cresta hardware)", GAME_SUPPORTS_SAVE )
3253GAME( 1984, drivfrcg, drivfrcp, drivfrcg, drivfrcg, 0,        ROT90,  "Shinkai Inc. (Magic Eletronics USA licence)", "Driving Force (Galaxian conversion)", GAME_SUPPORTS_SAVE )
3254GAME( 1985, drivfrcb, drivfrcp, drivfrcg, drivfrcg, 0,        ROT90,  "bootleg", "Driving Force (Galaxian conversion bootleg)", GAME_SUPPORTS_SAVE )
3255GAME( 1983, bongo,    0,        bongo,    bongo,    0,         ROT90,  "Jetsoft", "Bongo", GAME_SUPPORTS_SAVE )
3256GAME( 1983, hunchbkg, hunchbak,   hunchbkg, hunchbkg, 0,        ROT90,  "Century Electronics", "Hunchback (Galaxian hardware)", GAME_SUPPORTS_SAVE )
3257GAME( 1983, harem,    0,        harem,    harem,    0,        ROT90,  "I.G.R.", "Harem", GAME_NO_SOUND | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
3258GAME( 1982, tazzmang, tazmania,   tazzmang, tazzmang, 0,        ROT90,  "bootleg", "Tazz-Mania (Galaxian Hardware)", GAME_SUPPORTS_SAVE )
3259GAME( 1986, racknrol, 0,        racknrol, racknrol, 0,         ROT0,   "Status (Shinkai License)", "Rack + Roll", GAME_SUPPORTS_SAVE )
3260GAME( 1986, hexpool,  racknrol, racknrol, racknrol, 0,         ROT90,  "Shinkai", "Hex Pool (Shinkai)", GAME_SUPPORTS_SAVE )
3261GAME( 1985, hexpoola, racknrol, hexpoola, racknrol, 0,         ROT90,  "Senko", "Hex Pool (Senko)", GAME_SUPPORTS_SAVE )
3262GAME( 1985, trvchlng, 0,        racknrol, trvchlng, 0,         ROT90,  "Joyland (Senko License)", "Trivia Challenge", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
3263GAME( 1981, ckongg,   0,        ckongg,   ckongg,   0,        ROT90,  "bootleg", "Crazy Kong (bootleg on Galaxian hardware, set 1)", GAME_SUPPORTS_SAVE )
3264GAME( 1981, kkgalax,  ckongg,   kkgalax,  kkgalax,  0,        ROT90,  "bootleg", "Crazy Kong (bootleg on Galaxian hardware, set 2)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) // set was marked as 'King Kong on Galaxian'
3265GAME( 19??, porter,   0,        mooncrst, porter,   0,        ROT90,  "[Nova Games Ltd.] (bootleg)", "Port Man (bootleg on Moon Cresta hardware)", GAME_IMPERFECT_GRAPHICS ) // missing GFX bank switch!
src/mame/drivers/wgp.c
r2241r2242
653653                         MEMORY STRUCTURES
654654*****************************************************************/
655655
656static ADDRESS_MAP_START( wgp_readmem, ADDRESS_SPACE_PROGRAM, 16 )
657   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM)
658   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)   /* main CPUA ram */
659   AM_RANGE(0x140000, 0x143fff) AM_READ(SMH_RAM)
660   AM_RANGE(0x180000, 0x18000f) AM_READ(TC0220IOC_halfword_byteswap_r)
661   AM_RANGE(0x200000, 0x20000f) AM_READ(wgp_adinput_r)
662   AM_RANGE(0x300000, 0x30ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
663   AM_RANGE(0x320000, 0x32000f) AM_READ(TC0100SCN_ctrl_word_0_r)
664   AM_RANGE(0x400000, 0x40bfff) AM_READ(SMH_RAM)   /* sprite tilemaps */
665   AM_RANGE(0x40c000, 0x40dfff) AM_READ(SMH_RAM)   /* sprite ram */
666   AM_RANGE(0x500000, 0x501fff) AM_READ(SMH_RAM)   /* unknown/unused */
667   AM_RANGE(0x502000, 0x517fff) AM_READ(wgp_pivram_word_r)   /* piv tilemaps */
668   AM_RANGE(0x520000, 0x52001f) AM_READ(wgp_piv_ctrl_word_r)
669   AM_RANGE(0x700000, 0x701fff) AM_READ(SMH_RAM)
670ADDRESS_MAP_END
671
672static ADDRESS_MAP_START( wgp_writemem, ADDRESS_SPACE_PROGRAM, 16 )
673   AM_RANGE(0x000000, 0x0fffff) AM_WRITE(SMH_ROM)
674   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM)
675   AM_RANGE(0x140000, 0x143fff) AM_WRITE(SMH_RAM) AM_BASE(&sharedram) AM_SIZE(&sharedram_size)
676   AM_RANGE(0x180000, 0x18000f) AM_WRITE(TC0220IOC_halfword_byteswap_w)
656static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
657   AM_RANGE(0x000000, 0x0fffff) AM_ROM
658   AM_RANGE(0x100000, 0x10ffff) AM_RAM      /* main CPUA ram */
659   AM_RANGE(0x140000, 0x143fff) AM_RAM AM_BASE(&sharedram) AM_SIZE(&sharedram_size)
660   AM_RANGE(0x180000, 0x18000f) AM_READWRITE(TC0220IOC_halfword_byteswap_r,TC0220IOC_halfword_byteswap_w)
677661   AM_RANGE(0x1c0000, 0x1c0001) AM_WRITE(cpua_ctrl_w)
678   AM_RANGE(0x200000, 0x20000f) AM_WRITE(wgp_adinput_w)
679   AM_RANGE(0x300000, 0x30ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
680   AM_RANGE(0x320000, 0x32000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
681   AM_RANGE(0x400000, 0x40bfff) AM_WRITE(SMH_RAM) AM_BASE(&wgp_spritemap) AM_SIZE(&wgp_spritemap_size)
682   AM_RANGE(0x40c000, 0x40dfff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)   /* sprite ram */
683   AM_RANGE(0x40fff0, 0x40fff1) AM_WRITE(SMH_NOP)   // ?? (writes 0x8000 and 0 alternately - Wgp2 just 0)
684   AM_RANGE(0x500000, 0x501fff) AM_WRITE(SMH_RAM)   /* unknown/unused */
685   AM_RANGE(0x502000, 0x517fff) AM_WRITE(wgp_pivram_word_w) AM_BASE(&wgp_pivram)   /* piv tilemaps */
686   AM_RANGE(0x520000, 0x52001f) AM_WRITE(wgp_piv_ctrl_word_w) AM_BASE(&wgp_piv_ctrlram)
662   AM_RANGE(0x200000, 0x20000f) AM_READWRITE(wgp_adinput_r,wgp_adinput_w)
663   AM_RANGE(0x300000, 0x30ffff) AM_READWRITE(TC0100SCN_word_0_r,TC0100SCN_word_0_w)         /* tilemaps */
664   AM_RANGE(0x320000, 0x32000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r,TC0100SCN_ctrl_word_0_w)
665   AM_RANGE(0x400000, 0x40bfff) AM_RAM AM_BASE(&wgp_spritemap) AM_SIZE(&wgp_spritemap_size)   /* sprite tilemaps */
666   AM_RANGE(0x40c000, 0x40dfff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)         /* sprite ram */
667   AM_RANGE(0x40fff0, 0x40fff1) AM_WRITE(SMH_NOP)   /* ?? (writes 0x8000 and 0 alternately - Wgp2 just 0) */
668   AM_RANGE(0x500000, 0x501fff) AM_RAM               /* unknown/unused */
669   AM_RANGE(0x502000, 0x517fff) AM_READWRITE(wgp_pivram_word_r,wgp_pivram_word_w) AM_BASE(&wgp_pivram) /* piv tilemaps */
670   AM_RANGE(0x520000, 0x52001f) AM_READWRITE(wgp_piv_ctrl_word_r,wgp_piv_ctrl_word_w) AM_BASE(&wgp_piv_ctrlram)
687671   AM_RANGE(0x600000, 0x600003) AM_WRITE(rotate_port_w)   /* rotation control ? */
688   AM_RANGE(0x700000, 0x701fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
672   AM_RANGE(0x700000, 0x701fff) AM_RAM AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
689673ADDRESS_MAP_END
690674
691static ADDRESS_MAP_START( wgp_cpub_readmem, ADDRESS_SPACE_PROGRAM, 16 )   /* LAN areas not mapped... */
692   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
693   AM_RANGE(0x100000, 0x103fff) AM_READ(SMH_RAM)
694   AM_RANGE(0x140000, 0x143fff) AM_READ(sharedram_r)
695   AM_RANGE(0x200000, 0x200003) AM_READ(wgp_sound_r)
696//  AM_RANGE(0x380000, 0x383fff) AM_READ(SMH_RAM) // LAN RAM
675static ADDRESS_MAP_START( cpu2_map, ADDRESS_SPACE_PROGRAM, 16 )   /* LAN areas not mapped... */
676   AM_RANGE(0x000000, 0x03ffff) AM_ROM
677   AM_RANGE(0x100000, 0x103fff) AM_RAM
678   AM_RANGE(0x140000, 0x143fff) AM_READWRITE(sharedram_r,sharedram_w)
679   AM_RANGE(0x200000, 0x200003) AM_READWRITE(wgp_sound_r,wgp_sound_w)
680//  AM_RANGE(0x380000, 0x383fff) AM_READ(SMH_RAM)       // LAN RAM
681//  AM_RANGE(0x380000, 0x383fff) AM_WRITE(SMH_RAM)    // LAN RAM
697682   AM_RANGE(0x380000, 0x380001) AM_READ(lan_status_r)   // ??
698683   // a lan input area is read somewhere above the status
699684   // (make the status return 0 and log)...
700685ADDRESS_MAP_END
701686
702static ADDRESS_MAP_START( wgp_cpub_writemem, ADDRESS_SPACE_PROGRAM, 16 )
703   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
704   AM_RANGE(0x100000, 0x103fff) AM_WRITE(SMH_RAM)
705   AM_RANGE(0x140000, 0x143fff) AM_WRITE(sharedram_w)
706   AM_RANGE(0x200000, 0x200003) AM_WRITE(wgp_sound_w)
707//  AM_RANGE(0x380000, 0x383fff) AM_WRITE(SMH_RAM)    // LAN RAM
708ADDRESS_MAP_END
709687
710
711688/***************************************************************************/
712689
713static ADDRESS_MAP_START( z80_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
714   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
715   AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK10)
716   AM_RANGE(0xc000, 0xdfff) AM_READ(SMH_RAM)
717   AM_RANGE(0xe000, 0xe000) AM_READ(YM2610_status_port_0_A_r)
718   AM_RANGE(0xe001, 0xe001) AM_READ(YM2610_read_port_0_r)
719   AM_RANGE(0xe002, 0xe002) AM_READ(YM2610_status_port_0_B_r)
720   AM_RANGE(0xe200, 0xe200) AM_READ(SMH_NOP)
721   AM_RANGE(0xe201, 0xe201) AM_READ(taitosound_slave_comm_r)
722   AM_RANGE(0xea00, 0xea00) AM_READ(SMH_NOP)
723ADDRESS_MAP_END
724
725static ADDRESS_MAP_START( z80_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
726   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
727   AM_RANGE(0xc000, 0xdfff) AM_WRITE(SMH_RAM)
728   AM_RANGE(0xe000, 0xe000) AM_WRITE(YM2610_control_port_0_A_w)
729   AM_RANGE(0xe001, 0xe001) AM_WRITE(YM2610_data_port_0_A_w)
730   AM_RANGE(0xe002, 0xe002) AM_WRITE(YM2610_control_port_0_B_w)
690static ADDRESS_MAP_START( z80_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
691   AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK10)   /* Fallthrough */
692   AM_RANGE(0x0000, 0x7fff) AM_ROM
693   AM_RANGE(0xc000, 0xdfff) AM_RAM
694   AM_RANGE(0xe000, 0xe000) AM_READWRITE(YM2610_status_port_0_A_r,YM2610_control_port_0_A_w)
695   AM_RANGE(0xe001, 0xe001) AM_READWRITE(YM2610_read_port_0_r,YM2610_data_port_0_A_w)
696   AM_RANGE(0xe002, 0xe002) AM_READWRITE(YM2610_status_port_0_B_r,YM2610_control_port_0_B_w)
731697   AM_RANGE(0xe003, 0xe003) AM_WRITE(YM2610_data_port_0_B_w)
732   AM_RANGE(0xe200, 0xe200) AM_WRITE(taitosound_slave_port_w)
733   AM_RANGE(0xe201, 0xe201) AM_WRITE(taitosound_slave_comm_w)
698   AM_RANGE(0xe200, 0xe200) AM_READWRITE(SMH_NOP,taitosound_slave_port_w)
699   AM_RANGE(0xe201, 0xe201) AM_READWRITE(taitosound_slave_comm_r,taitosound_slave_comm_w)
734700   AM_RANGE(0xe400, 0xe403) AM_WRITE(SMH_NOP) /* pan */
701   AM_RANGE(0xea00, 0xea00) AM_READ(SMH_NOP)
735702   AM_RANGE(0xee00, 0xee00) AM_WRITE(SMH_NOP) /* ? */
736703   AM_RANGE(0xf000, 0xf000) AM_WRITE(SMH_NOP) /* ? */
737704   AM_RANGE(0xf200, 0xf200) AM_WRITE(sound_bankswitch_w)
r2241r2242
981948
982949   /* basic machine hardware */
983950   MDRV_CPU_ADD(M68000, 12000000)   /* 12 MHz ??? */
984   MDRV_CPU_PROGRAM_MAP(wgp_readmem,wgp_writemem)
951   MDRV_CPU_PROGRAM_MAP(main_map,0)
985952   MDRV_CPU_VBLANK_INT("main", irq4_line_hold)
986953
987954   MDRV_CPU_ADD(Z80, 16000000/4)   /* 4 MHz ??? */
988955   /* audio CPU */
989   MDRV_CPU_PROGRAM_MAP(z80_sound_readmem,z80_sound_writemem)
956   MDRV_CPU_PROGRAM_MAP(z80_sound_map,0)
990957
991958   MDRV_CPU_ADD(M68000, 12000000)   /* 12 MHz ??? */
992   MDRV_CPU_PROGRAM_MAP(wgp_cpub_readmem,wgp_cpub_writemem)
959   MDRV_CPU_PROGRAM_MAP(cpu2_map,0)
993960   MDRV_CPU_VBLANK_INT("main", wgp_cpub_interrupt)
994961
995962   MDRV_MACHINE_START(wgp)
r2241r2242
1023990
1024991
1025992static MACHINE_DRIVER_START( wgp2 )
993   MDRV_IMPORT_FROM(wgp)
1026994
1027   /* basic machine hardware */
1028   MDRV_CPU_ADD(M68000, 12000000)   /* 12 MHz ??? */
1029   MDRV_CPU_PROGRAM_MAP(wgp_readmem,wgp_writemem)
1030   MDRV_CPU_VBLANK_INT("main", irq4_line_hold)
1031
1032   MDRV_CPU_ADD(Z80, 16000000/4)   /* 4 MHz ??? */
1033   /* audio CPU */
1034   MDRV_CPU_PROGRAM_MAP(z80_sound_readmem,z80_sound_writemem)
1035
1036   MDRV_CPU_ADD(M68000, 12000000)   /* 12 MHz ??? */
1037   MDRV_CPU_PROGRAM_MAP(wgp_cpub_readmem,wgp_cpub_writemem)
1038   MDRV_CPU_VBLANK_INT("main", wgp_cpub_interrupt)
1039
1040   MDRV_MACHINE_START(wgp)
1041
1042995   MDRV_INTERLEAVE(200)
1043
1044996   /* video hardware */
1045   MDRV_SCREEN_ADD("main", RASTER)
1046   MDRV_SCREEN_REFRESH_RATE(60)
1047   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
1048   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1049   MDRV_SCREEN_SIZE(40*8, 32*8)
1050   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
1051
1052   MDRV_GFXDECODE(wgp)
1053   MDRV_PALETTE_LENGTH(4096)
1054
1055997   MDRV_VIDEO_START(wgp2)
1056   MDRV_VIDEO_UPDATE(wgp)
1057
1058   /* sound hardware */
1059   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
1060
1061   MDRV_SOUND_ADD(YM2610, 16000000/2)
1062   MDRV_SOUND_CONFIG(ym2610_interface)
1063   MDRV_SOUND_ROUTE(0, "left",  0.25)
1064   MDRV_SOUND_ROUTE(0, "right", 0.25)
1065   MDRV_SOUND_ROUTE(1, "left",  1.0)
1066   MDRV_SOUND_ROUTE(2, "right", 1.0)
1067998MACHINE_DRIVER_END
1068999
10691000
src/mame/drivers/welltris.c
r2241r2242
344344
345345static WRITE16_HANDLER( sound_command_w )
346346{
347   if (ACCESSING_LSB)
347   if (ACCESSING_BITS_0_7)
348348   {
349349      pending_command = 1;
350350      soundlatch_w(machine, 0, data & 0xff);
r2241r2242
363363}
364364
365365
366static ADDRESS_MAP_START( welltris_readmem, ADDRESS_SPACE_PROGRAM, 16 )
367   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
368   AM_RANGE(0x100000, 0x17ffff) AM_READ(SMH_ROM)
369   AM_RANGE(0x800000, 0x81ffff) AM_READ(SMH_RAM) /* Graph_1 & 2*/
370   AM_RANGE(0xff8000, 0xffbfff) AM_READ(SMH_RAM) /* Work */
371   AM_RANGE(0xffc000, 0xffc3ff) AM_READ(SMH_RAM) /* Sprite */
372   AM_RANGE(0xffd000, 0xffdfff) AM_READ(SMH_RAM) /* Char */
373   AM_RANGE(0xffe000, 0xffefff) AM_READ(SMH_RAM) /* Palette */
374
375   AM_RANGE(0xfff000, 0xfff001) AM_READ(input_port_1_word_r) /* Bottom Controls */
376   AM_RANGE(0xfff002, 0xfff003) AM_READ(input_port_2_word_r) /* Top Controls */
377   AM_RANGE(0xfff004, 0xfff005) AM_READ(input_port_3_word_r) /* Left Side Ctrls */
378   AM_RANGE(0xfff006, 0xfff007) AM_READ(input_port_4_word_r) /* Right Side Ctrls */
379
380   AM_RANGE(0xfff008, 0xfff009) AM_READ(in0_r) /* Coinage, Start Buttons, pending sound command etc. */  /* Bit 5 Tested at start of irq 1 */
381   AM_RANGE(0xfff00a, 0xfff00b) AM_READ(input_port_5_word_r) /* P3+P4 Coin + Start Buttons */
382   AM_RANGE(0xfff00c, 0xfff00d) AM_READ(input_port_6_word_r) /* DSW0 Coinage */
383   AM_RANGE(0xfff00e, 0xfff00f) AM_READ(input_port_7_word_r) /* DSW1 Game Options */
384ADDRESS_MAP_END
385
386static ADDRESS_MAP_START( welltris_writemem, ADDRESS_SPACE_PROGRAM, 16 )
387   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
388   AM_RANGE(0x100000, 0x17ffff) AM_WRITE(SMH_ROM)
389   AM_RANGE(0x800000, 0x81ffff) AM_WRITE(SMH_RAM) AM_BASE(&welltris_pixelram)
390   AM_RANGE(0xff8000, 0xffbfff) AM_WRITE(SMH_RAM)
391
392   AM_RANGE(0xffc000, 0xffc3ff) AM_WRITE(welltris_spriteram_w) AM_BASE(&welltris_spriteram)
393   AM_RANGE(0xffd000, 0xffdfff) AM_WRITE(welltris_charvideoram_w) AM_BASE(&welltris_charvideoram)
394   AM_RANGE(0xffe000, 0xffefff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
395
366static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
367   AM_RANGE(0x000000, 0x03ffff) AM_ROM
368   AM_RANGE(0x100000, 0x17ffff) AM_ROM
369   AM_RANGE(0x800000, 0x81ffff) AM_RAM AM_BASE(&welltris_pixelram)   /* Graph_1 & 2*/
370   AM_RANGE(0xff8000, 0xffbfff) AM_RAM                        /* work */
371   AM_RANGE(0xffc000, 0xffc3ff) AM_RAM AM_WRITE(welltris_spriteram_w) AM_BASE(&welltris_spriteram)            /* Sprite */
372   AM_RANGE(0xffd000, 0xffdfff) AM_RAM AM_WRITE(welltris_charvideoram_w) AM_BASE(&welltris_charvideoram)      /* Char */
373   AM_RANGE(0xffe000, 0xffefff) AM_RAM AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)   /* Palette */
374   AM_RANGE(0xfff000, 0xfff001) AM_READ(input_port_1_word_r)   /* Bottom Controls */
396375   AM_RANGE(0xfff000, 0xfff001) AM_WRITE(welltris_palette_bank_w)
376   AM_RANGE(0xfff002, 0xfff003) AM_READ(input_port_2_word_r)   /* Top Controls */
397377   AM_RANGE(0xfff002, 0xfff003) AM_WRITE(welltris_gfxbank_w)
378   AM_RANGE(0xfff004, 0xfff005) AM_READ(input_port_3_word_r)   /* Left Side Ctrls */
398379   AM_RANGE(0xfff004, 0xfff007) AM_WRITE(welltris_scrollreg_w)
380   AM_RANGE(0xfff006, 0xfff007) AM_READ(input_port_4_word_r)   /* Right Side Ctrls */
381   AM_RANGE(0xfff008, 0xfff009) AM_READ(in0_r)               /* Coinage, Start Buttons, pending sound command etc. */  /* Bit 5 Tested at start of irq 1 */
399382   AM_RANGE(0xfff008, 0xfff009) AM_WRITE(sound_command_w)
400   AM_RANGE(0xfff00c, 0xfff00d) AM_WRITE(SMH_NOP)      // ??
401   AM_RANGE(0xfff00e, 0xfff00f) AM_WRITE(SMH_NOP)      // ??
383   AM_RANGE(0xfff00a, 0xfff00b) AM_READ(input_port_5_word_r)   /* P3+P4 Coin + Start Buttons */
384   AM_RANGE(0xfff00c, 0xfff00d) AM_READ(input_port_6_word_r)   /* DSW0 Coinage */
385   AM_RANGE(0xfff00c, 0xfff00d) AM_WRITE(SMH_NOP)         /* ?? */
386   AM_RANGE(0xfff00e, 0xfff00f) AM_READ(input_port_7_word_r)   /* DSW1 Game Options */
387   AM_RANGE(0xfff00e, 0xfff00f) AM_WRITE(SMH_NOP)         /* ?? */
402388ADDRESS_MAP_END
403389
404static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
405   AM_RANGE(0x0000, 0x77ff) AM_READ(SMH_ROM)
406   AM_RANGE(0x7800, 0x7fff) AM_READ(SMH_RAM)
407   AM_RANGE(0x8000, 0xffff) AM_READ(SMH_BANK1)
390static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
391   AM_RANGE(0x0000, 0x77ff) AM_ROM
392   AM_RANGE(0x7800, 0x7fff) AM_RAM
393   AM_RANGE(0x8000, 0xffff) AM_ROM AM_READ(SMH_BANK1)
408394ADDRESS_MAP_END
409395
410static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
411   AM_RANGE(0x0000, 0x77ff) AM_WRITE(SMH_ROM)
412   AM_RANGE(0x7800, 0x7fff) AM_WRITE(SMH_RAM)
413   AM_RANGE(0x8000, 0xffff) AM_WRITE(SMH_ROM)
414ADDRESS_MAP_END
415
416static ADDRESS_MAP_START( sound_readport, ADDRESS_SPACE_IO, 8 )
396static ADDRESS_MAP_START( sound_port_map, ADDRESS_SPACE_IO, 8 )
417397   ADDRESS_MAP_GLOBAL_MASK(0xff)
418   AM_RANGE(0x08, 0x08) AM_READ(YM2610_status_port_0_A_r)
419   AM_RANGE(0x0a, 0x0a) AM_READ(YM2610_status_port_0_B_r)
420   AM_RANGE(0x10, 0x10) AM_READ(soundlatch_r)
421ADDRESS_MAP_END
422
423static ADDRESS_MAP_START( sound_writeport, ADDRESS_SPACE_IO, 8 )
424   ADDRESS_MAP_GLOBAL_MASK(0xff)
425398   AM_RANGE(0x00, 0x00) AM_WRITE(welltris_sh_bankswitch_w)
426   AM_RANGE(0x08, 0x08) AM_WRITE(YM2610_control_port_0_A_w)
399   AM_RANGE(0x08, 0x08) AM_READWRITE(YM2610_status_port_0_A_r,YM2610_control_port_0_A_w)
427400   AM_RANGE(0x09, 0x09) AM_WRITE(YM2610_data_port_0_A_w)
428   AM_RANGE(0x0a, 0x0a) AM_WRITE(YM2610_control_port_0_B_w)
401   AM_RANGE(0x0a, 0x0a) AM_READWRITE(YM2610_status_port_0_B_r,YM2610_control_port_0_B_w)
429402   AM_RANGE(0x0b, 0x0b) AM_WRITE(YM2610_data_port_0_B_w)
403   AM_RANGE(0x10, 0x10) AM_READ(soundlatch_r)
430404   AM_RANGE(0x18, 0x18) AM_WRITE(pending_command_clear_w)
431405ADDRESS_MAP_END
432406
433
434
435407static INPUT_PORTS_START( welltris )
436408   PORT_START
437409   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
r2241r2242
751723
752724   /* basic machine hardware */
753725   MDRV_CPU_ADD(M68000,20000000/2)   /* 10 MHz */
754   MDRV_CPU_PROGRAM_MAP(welltris_readmem,welltris_writemem)
726   MDRV_CPU_PROGRAM_MAP(main_map,0)
755727   MDRV_CPU_VBLANK_INT("main", irq1_line_hold)
756728
757   MDRV_CPU_ADD(Z80,8000000/2)      /* 4 MHz ??? */
758729   /* audio CPU */
759   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
760   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
761                        /* IRQs are triggered by the YM2610 */
730   MDRV_CPU_ADD(Z80,8000000/2)      /* 4 MHz ??? */
731   MDRV_CPU_PROGRAM_MAP(sound_map,0)
732   MDRV_CPU_IO_MAP(sound_port_map,0)   /* IRQs are triggered by the YM2610 */
762733
763734   /* video hardware */
764735   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/dec0.c
r2241r2242
6565         break;
6666
6767      case 4: /* 6502 sound cpu */
68         if (ACCESSING_LSB)
68         if (ACCESSING_BITS_0_7)
6969         {
7070            soundlatch_w(machine,0,data & 0xff);
7171            cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
r2241r2242
101101{
102102    switch (offset<<1) {
103103       case 0:
104         if (ACCESSING_LSB)
104         if (ACCESSING_BITS_0_7)
105105         {
106106            soundlatch_w(machine,0,data & 0xff);
107107            cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
r2241r2242
115115
116116static WRITE16_HANDLER( midres_sound_w )
117117{
118   if (ACCESSING_LSB)
118   if (ACCESSING_BITS_0_7)
119119   {
120120      soundlatch_w(machine,0,data & 0xff);
121121      cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
src/mame/drivers/ssv.c
r2241r2242
308308static WRITE16_HANDLER( ssv_lockout_w )
309309{
310310//  popmessage("%02X",data & 0xff);
311   if (ACCESSING_LSB)
311   if (ACCESSING_BITS_0_7)
312312   {
313313      coin_lockout_w(1,~data & 0x01);
314314      coin_lockout_w(0,~data & 0x02);
r2241r2242
323323static WRITE16_HANDLER( ssv_lockout_inv_w )
324324{
325325//  popmessage("%02X",data & 0xff);
326   if (ACCESSING_LSB)
326   if (ACCESSING_BITS_0_7)
327327   {
328328      coin_lockout_w(1, data & 0x01);
329329      coin_lockout_w(0, data & 0x02);
r2241r2242
501501   if (data & ~0x7b00)
502502      logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",activecpu_get_pc(),data);
503503
504   if ( ACCESSING_MSB )
504   if ( ACCESSING_BITS_8_15 )
505505   {
506506//      data & 0x8000 ? (near palette writes)
507507//      data & 0x0001 ?
r2241r2242
561561         if (data & ~0x43)
562562            logerror("CPU #0 PC: %06X - Unknown gdfs_gfxram_bank bit written %04X\n",activecpu_get_pc(),data);
563563
564         if (ACCESSING_LSB)
564         if (ACCESSING_BITS_0_7)
565565            gdfs_gfxram_bank = data & 3;
566566      }
567567      break;
r2241r2242
828828
829829static WRITE16_HANDLER( srmp7_sound_bank_w )
830830{
831   if (ACCESSING_LSB)
831   if (ACCESSING_BITS_0_7)
832832   {
833833      int bank = 0x400000/2 * (data & 1);   // UINT16 address
834834      int voice;
r2241r2242
908908
909909static WRITE16_HANDLER( sxyreact_dial_w )
910910{
911   if (ACCESSING_LSB)
911   if (ACCESSING_BITS_0_7)
912912   {
913913      static int old;
914914
r2241r2242
10631063
10641064static WRITE16_HANDLER( eaglshot_gfxrom_w )
10651065{
1066   if (ACCESSING_LSB)
1066   if (ACCESSING_BITS_0_7)
10671067      gfxrom_select = data;
10681068}
10691069
r2241r2242
10821082
10831083static WRITE16_HANDLER( eaglshot_trackball_w )
10841084{
1085   if (ACCESSING_LSB)
1085   if (ACCESSING_BITS_0_7)
10861086      trackball_select = data;
10871087}
10881088
src/mame/drivers/taitoair.c
r2241r2242
240240
241241static WRITE16_HANDLER( system_control_w )
242242{
243   if ((ACCESSING_LSB == 0) && ACCESSING_MSB)
243   if ((ACCESSING_BITS_0_7 == 0) && ACCESSING_BITS_8_15)
244244   {
245245      data >>= 8;
246246   }
r2241r2242
259259
260260static WRITE16_HANDLER( lineram_w )
261261{
262   if (ACCESSING_MSB && ACCESSING_LSB)
262   if (ACCESSING_BITS_8_15 && ACCESSING_BITS_0_7)
263263      taitoair_line_ram[offset] = data;
264264}
265265
r2241r2242
270270
271271static WRITE16_HANDLER( dspram_w )
272272{
273   if (ACCESSING_MSB && ACCESSING_LSB)
273   if (ACCESSING_BITS_8_15 && ACCESSING_BITS_0_7)
274274      dsp_ram[offset] = data;
275275}
276276
src/mame/drivers/atarig42.c
r2241r2242
106106static WRITE16_HANDLER( io_latch_w )
107107{
108108   /* upper byte */
109   if (ACCESSING_MSB)
109   if (ACCESSING_BITS_8_15)
110110   {
111111      /* bit 14 controls the ASIC65 reset line */
112112      asic65_reset((~data >> 14) & 1);
r2241r2242
116116   }
117117
118118   /* lower byte */
119   if (ACCESSING_LSB)
119   if (ACCESSING_BITS_0_7)
120120   {
121121      /* bit 4 resets the sound CPU */
122122      cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
src/mame/drivers/tceptor.c
r2241r2242
5252
5353static WRITE16_HANDLER( m68k_shared_word_w )
5454{
55   if (ACCESSING_LSB16)
55   if (ACCESSING_BITS_0_7)
5656      m68k_shared_ram[offset] = data & 0xff;
5757}
5858
src/mame/drivers/mpu4drvr.c
r2241r2242
1/***************************************************************************
1/***********************************************************************************************************
22Barcrest MPU4 highly preliminary driver by J.Wallace, and Anonymous.
33
44Any MAME-approved games should go here.
r2241r2242
66See http://www.mameworld.net/agemame/techinfo/mpu4.php for Information.
77
88--- Board Setup ---
9For the Barcrest MPU4 Video system, the GAME CARD (cartridge) contains the MPU4 video bios in the usual ROM space (occupying 16k),
10an interface card to connect an additional Video board, and a 6850 serial IO to communicate with said board.
9For the Barcrest MPU4 Video system, the GAME CARD (cartridge) contains the MPU4 video bios in the usual ROM
10space (occupying 16k), an interface card to connect an additional Video board, and a 6850 serial IO to
11communicate with said board.
1112This version of the game card does not have the OKI chip, or the characteriser.
1213
13The VIDEO BOARD is driven by a 10mhz 68000 processor, and contains a 6840PTM, 6850 serial IO (the other end of the
14communications), an SAA1099 for stereo sound and SCN2674 gfx chip.
14The VIDEO BOARD is driven by a 10mhz 68000 processor, and contains a 6840PTM, 6850 serial IO
15(the other end of the communications), an SAA1099 for stereo sound and SCN2674 gfx chip.
1516
16The VIDEO CARTRIDGE plugs into the video board, and contains the program roms for the video based game. Like the MPU4 game
17card, in some cases an extra OKI sound chip is added to the video board's game card,as well as extra RAM.
18There is a protection chip similar to and replacing the MPU4 Characteriser, which is often fed question data to descramble
19(unknown how it works). In non-question cases, however, the protection chip works near identically to the original.
17The VIDEO CARTRIDGE plugs into the video board, and contains the program roms for the video based game.
18Like the MPU4 game card, in some cases an extra OKI sound chip is added to the video board's game card,
19as well as extra RAM.
20There is a protection chip similar to and replacing the MPU4 Characteriser, which is often fed question
21data to descramble (unknown how it works). In non-question cases, however, the protection chip works
22near identically to the original.
2023
2124No video card schematics ever left the PCB factory, but some decent scans of the board have been made,
2225now also available for review.
r2241r2242
169172-----------+---+-----------------+--------------------------------------------------------------------------
170173 C000-FFFF | R | D D D D D D D D | ROM
171174-----------+---+-----------------+--------------------------------------------------------------------------
172TODO: - Craft bespoke 6850 core from MC6850 emulation.
175TODO:
173176      - MPU4 Master clock value taken from schematic, but 68k value is not.
174      - Deal 'Em lockouts vary on certain cabinets (normally connected to AUX, but not there?)
177      - Deal 'Em lockouts vary on certain cabinets (normally connected to AUX2, but not there?)
175178      - Deal 'Em has bad tiles (apostrophe, logo, bottom corner), black should actually be transparent
176179      - to give black on green.
177*****************************************************************************************/
180***********************************************************************************************************/
178181
179//MPU4 Video
182/* MPU4 Video */
180183#include "cpu/m68000/m68000.h"
181184#include "machine/6850acia.h"
182185#include "sound/saa1099.h"
r2241r2242
191194
192195#define LOGSTUFF(x) do { if (MPU4VIDVERBOSE) logerror x; } while (0)
193196
194#define VIDEO_MASTER_CLOCK (10000000)
197#define VIDEO_MASTER_CLOCK (XTAL_10MHz)
195198
199/* IRQ states for 68k */
196200static UINT8 m6840_irq_state;
197201static UINT8 m6850_irq_state;
198202static UINT8 scn2674_irq_state;
r2241r2242
205209static UINT8 m6809_acia_rts;
206210static UINT8 m6809_acia_dcd;
207211
212/* SCN2674 AVDC stuff */
208213static int mpu4_gfx_index;
209214static UINT16 * mpu4_vid_vidram;
210static UINT8 * mpu4_vid_vidram_is_dirty;
215static UINT8 * mpu4_vid_vidram_is_dirty;
211216static UINT16 * mpu4_vid_mainram;
212217
213218static UINT8 scn2674_IR[16];
r2241r2242
219224static UINT8 scn2674_screen2_l;
220225static UINT8 scn2674_screen2_h;
221226
222///////////////////////////////////////////////////////////////////////////
223227
228/* called if board is reset */
224229static MACHINE_RESET( mpu4_vid )
225230{
226   ROC10937_reset(0);   // reset display1
231   ROC10937_reset(0);
227232
228//  cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
233/*  cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE); */
229234   mpu4_stepper_reset();
230235
231236   lamp_strobe    = 0;
r2241r2242
242247   prot_col  = 0;
243248}
244249
250
245251/*************************************
246252 *
247253 *  Interrupt system
r2241r2242
262268    0 - Unused
263269*/
264270
271
265272static void update_mpu68_interrupts(void)
266273{
267274   int newstate = 0;
268275
269   if (m6840_irq_state)//1
276   if (m6840_irq_state)
270277      newstate = 1;
271   if (m6850_irq_state)//2
278   if (m6850_irq_state)
272279      newstate = 2;
273   if (scn2674_irq_state)//3
280   if (scn2674_irq_state)
274281      newstate = 3;
275282
276283   /* set the new state of the IRQ lines */
r2241r2242
286293   }
287294}
288295
289// Communications ////////////////////////////////////////////////////////
290/* Clock values are currently unknown, and are derived from the 68k board.
291It *should* be the case that the rx and tx pins are triggered solely by
292the 6840 timeout, but the ACIA core doesn't allow that.
293For now, it's fixed to the frequency set by the PTM on initialisation.*/
296/* Communications with 6809 board */
297/* Clock values are currently unknown, and are derived from the 68k board.*/
298
294299static void m6809_acia_irq(int state)
295300{
296301   m68k_acia_cts = state;
297302   cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, state?ASSERT_LINE:CLEAR_LINE);
298303}
299304
305
300306static void m68k_acia_irq(int state)
301307{
302308   m6809_acia_cts = state;
r2241r2242
304310   update_mpu68_interrupts();
305311}
306312
313
307314static const struct acia6850_interface m6809_acia_if =
308315{
309   1,//This isn't a real division, this is just to work around
310   1,//the ACIA code's hard coding
316   0,
317   0,
311318   &m68k_m6809_line,
312319   &m6809_m68k_line,
313320   &m6809_acia_cts,
r2241r2242
316323   m6809_acia_irq
317324};
318325
326
319327static const struct acia6850_interface m68k_acia_if =
320328{
321   1,
322   1,
329   0,
330   0,
323331   &m6809_m68k_line,
324332   &m68k_m6809_line,
325333   &m68k_acia_cts,
r2241r2242
328336   m68k_acia_irq
329337};
330338
339
331340static void cpu1_ptm_irq(int state)
332341{
333342   m6840_irq_state = state;
334343   update_mpu68_interrupts();
335344}
336345
346
337347static WRITE8_HANDLER( vid_o1_callback )
338348{
339   int clock;
349   ptm6840_set_c2(   1, data); /* this output is the clock for timer2 */
340350
341   ptm6840_set_c2(   1, data); // copy output value to c2
342
343351   if (data)
344352   {
345      clock = MPU4_MASTER_CLOCK/44;
346      LOGSTUFF(("acia on for %d cycles \n",ptm6840_get_count(1,0)));
353      acia_tx_clock_in(0);
354      acia_rx_clock_in(0);
355      acia_tx_clock_in(1);
356      acia_rx_clock_in(1);
347357   }
348   else
349   {
350      clock = 1; //as low as we can go, ideally we need to switch the ACIAs off
351   }
352      acia6850_set_rx_clock(0, clock);
353      acia6850_set_tx_clock(0, clock);
354      acia6850_set_rx_clock(1, clock);
355      acia6850_set_tx_clock(1, clock);
356358}
357359
360
358361static WRITE8_HANDLER( vid_o2_callback )
359362{
360   ptm6840_set_c3(   1, data); // copy output value to c3
363   ptm6840_set_c3(   1, data); /* this output is the clock for timer3 */
361364}
362365
366
363367static WRITE8_HANDLER( vid_o3_callback )
364368{
365   ptm6840_set_c1(   1, data); // copy output value to c1
369   ptm6840_set_c1(   1, data); /* this output is the clock for timer1 */
366370}
367371
368//Again, this PTM clock might be wrong, it needs tracing from the PCB
372
369373static const ptm6840_interface ptm_vid_intf =
370374{
371   VIDEO_MASTER_CLOCK/10,
375   VIDEO_MASTER_CLOCK/10, /* 68k E clock */
372376   { 0,0,0 },
373377   { vid_o1_callback, vid_o2_callback, vid_o3_callback },
374378   cpu1_ptm_irq
375379};
376380
377// SCN2674 AVDC emulation
378381
382/* SCN2674 AVDC emulation */
379383/* the chip is actually more complex than this.. character aren't limited to 8 rows high... but I
380 don't *think* the MPU4 stuff needs otherwise.. yet .. */
384   don't *think* the MPU4 stuff needs otherwise.. yet .. */
381385
382386static const gfx_layout mpu4_vid_char_8x8_layout =
383387{
384388   8,8,
385   0x1000, // 0x1000 tiles (128k of GFX Ram, 0x20 bytes per tile)
389   0x1000, /* 0x1000 tiles (128k of GFX RAM, 0x20 bytes per tile) */
386390   4,
387391   { 0,8,16,24 },
388392   { 0,1,2,3,4,5,6,7 },
r2241r2242
390394   8*32
391395};
392396
397
393398/* double height */
394399static const gfx_layout mpu4_vid_char_8x16_layout =
395400{
396401   8,16,
397   0x1000, // 0x1000 tiles (128k of GFX Ram, 0x20 bytes per tile)
402   0x1000, /* 0x1000 tiles (128k of GFX RAM, 0x20 bytes per tile) */
398403   4,
399404   { 0,8,16,24 },
400405   { 0,1,2,3,4,5,6,7 },
r2241r2242
402407   8*32
403408};
404409
410
405411/* double width */
406412static const gfx_layout mpu4_vid_char_16x8_layout =
407413{
408414   16,8,
409   0x1000, // 0x1000 tiles (128k of GFX Ram, 0x20 bytes per tile)
415   0x1000, /* 0x1000 tiles (128k of GFX RAM, 0x20 bytes per tile) */
410416   4,
411417   { 0,8,16,24 },
412418   { 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7 },
r2241r2242
414420   8*32
415421};
416422
423
417424/* double height & width */
418425static const gfx_layout mpu4_vid_char_16x16_layout =
419426{
420427   16,16,
421   0x1000, // 0x1000 tiles (128k of GFX Ram, 0x20 bytes per tile)
428   0x1000, /* 0x1000 tiles (128k of GFX RAM, 0x20 bytes per tile) */
422429   4,
423430   { 0,8,16,24 },
424431   { 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7 },
r2241r2242
426433   8*32
427434};
428435
429///////////////////////////////////////////////////////////////////////////
430436
431437static UINT8 IR0_scn2674_double_ht_wd;
432438static UINT8 IR0_scn2674_scanline_per_char_row;
r2241r2242
452458static UINT8 IR13_scn2674_scroll_end;
453459static UINT8 IR13_scn2674_split_register_2;
454460
461
455462static VIDEO_UPDATE( mpu4_vid )
456463{
457464   int i;
r2241r2242
460467
461468   fillbitmap(bitmap,0,cliprect);
462469
463   for (i=0; i < 0x1000; i++)
470   for (i = 0; i < 0x1000; i++)
464471   {
465472      if (mpu4_vid_vidram_is_dirty[i]==1)
466473      {
r2241r2242
473480   }
474481
475482   /* this is in main ram.. i think it must transfer it out of here??? */
476   // count = 0x0018b6/2; // crmaze
477   // count = 0x004950/2; // turnover
483   /* count = 0x0018b6/2; - crmaze count = 0x004950/2; - turnover */
478484
479485   /* we're in row table mode...thats why */
480
481   for(y=0;y<=IR4_scn2674_rows_per_screen;y++)
486   for(y = 0; y <= IR4_scn2674_rows_per_screen; y++)
482487   {
483488      int screen2_base = (scn2674_screen2_h<<8)|(scn2674_screen2_l);
484489
r2241r2242
486491      int dbl_size;
487492      int gfxregion = 0;
488493
489      dbl_size = (rowbase & 0xc000)>>14;  // ONLY if double size is enabled.. otherwise it can address more chars given more RAM
494      dbl_size = (rowbase & 0xc000)>>14;  /* ONLY if double size is enabled.. otherwise it can address more chars given more RAM */
490495
491496      if (dbl_size&2) gfxregion = 1;
492497
493
494      for(x=0;x<=IR5_scn2674_character_per_row;x++)
498      for(x = 0; x <= IR5_scn2674_character_per_row; x++)
495499      {
496500         UINT16 tiledat;
497501         UINT16 colattr;
r2241r2242
505509         count++;
506510      }
507511
508      if (dbl_size&2) y++; // skip a row?
512      if (dbl_size&2) y++; /* skip a row? */
509513
510514   }
511515
512516   popmessage("%02x %02x %02x %02x %02x %02x",scn2674_screen1_l,scn2674_screen1_h,scn2674_cursor_l, scn2674_cursor_h,scn2674_screen2_l,scn2674_screen2_h);
513517
514   for (i=0; i<8; i++)
518   for (i = 0; i < 8; i++)
515519      mpu4_draw_led(i, led_segs[i]);
516520
517521   return 0;
518522}
519523
524
520525static READ16_HANDLER( mpu4_vid_vidram_r )
521526{
522527   return mpu4_vid_vidram[offset];
523528}
524529
530
525531static WRITE16_HANDLER( mpu4_vid_vidram_w )
526532{
527533   COMBINE_DATA(&mpu4_vid_vidram[offset]);
r2241r2242
529535   mpu4_vid_vidram_is_dirty[offset/0x20]=1;
530536}
531537
538
532539/*
533540SCN2674 - Advanced Video Display Controller (AVDC)  (Video Chip)
534541
r2241r2242
551558IR12 ---- ----
552559IR13 ---- ----
553560IR14 ---- ----
554
555561*/
556562
563
557564static void scn2674_write_init_regs(UINT8 data)
558565{
559566   LOGSTUFF(("scn2674_write_init_regs %02x %02x\n",scn2675_IR_pointer,data));
r2241r2242
561568   scn2674_IR[scn2675_IR_pointer]=data;
562569
563570
564   switch ( scn2675_IR_pointer) // display some debug info, set mame specific variables
571   switch ( scn2675_IR_pointer) /* display some debug info, set mame specific variables */
565572   {
566573      case 0:
567574         IR0_scn2674_double_ht_wd = (data & 0x80)>>7;
r2241r2242
662669      case 14:
663670         break;
664671
665      case 15: // not valid!
672      case 15: /* not valid! */
666673         break;
667674
668675   }
r2241r2242
687694
688695   if (data==0x00)
689696   {
690      // master reset
697      /* master reset, configures registers */
691698      LOGSTUFF(("master reset\n"));
692699      scn2675_IR_pointer=0;
693700      scn2674_irq_register = 0x20;
r2241r2242
701708
702709   if ((data&0xf0)==0x10)
703710   {
704      // set IR pointer
711      /* set IR pointer */
705712      LOGSTUFF(("set IR pointer %02x\n",data));
706713
707714      oprand = data & 0x0f;
r2241r2242
709716
710717   }
711718
712   /*** ANY COMBINATION OF THESE ARE POSSIBLE */
719   /* ANY COMBINATION OF THESE ARE POSSIBLE */
713720
714721   if ((data&0xe3)==0x22)
715722   {
716      // Disable GFX
723      /* Disable GFX */
717724      LOGSTUFF(("disable GFX %02x\n",data));
718725      scn2674_gfx_enabled = 0;
719726   }
720727
721728   if ((data&0xe3)==0x23)
722729   {
723      // Enable GFX
730      /* Enable GFX */
724731      LOGSTUFF(("enable GFX %02x\n",data));
725732      scn2674_gfx_enabled = 1;
726733   }
727734
728735   if ((data&0xe9)==0x28)
729736   {
730      // Display off
737      /* Display off */
731738      oprand = data & 0x04;
732739
733740      scn2674_display_enabled = 0;
r2241r2242
740747
741748   if ((data&0xe9)==0x29)
742749   {
743      // Display on
750      /* Display on */
744751      oprand = data & 0x04;
745752
746753      scn2674_display_enabled = 1;
r2241r2242
749756         LOGSTUFF(("display ON - next field %02x\n",data));
750757      else
751758         LOGSTUFF(("display ON - next scanline %02x\n",data));
752
753759   }
754760
755761   if ((data&0xf1)==0x30)
756762   {
757      // Cursor Off
763      /* Cursor Off */
758764      LOGSTUFF(("cursor off %02x\n",data));
759765      scn2674_cursor_enabled = 0;
760766   }
761767
762768   if ((data&0xf1)==0x31)
763769   {
764      // Cursor On
770      /* Cursor On */
765771      LOGSTUFF(("cursor on %02x\n",data));
766772      scn2674_cursor_enabled = 1;
767773   }
768774
769   /*** END ***/
775   /* END */
770776
771777   if ((data&0xe0)==0x40)
772778   {
773      // Reset Interrupt / Status bit
779      /* Reset Interrupt / Status bit */
774780      oprand = data & 0x1f;
775781      LOGSTUFF(("reset interrupt / status bit %02x\n",data));
776782
r2241r2242
792798   }
793799   if ((data&0xe0)==0x80)
794800   {
795      // Disable Interrupt
801      /* Disable Interrupt */
796802      oprand = data & 0x1f;
797803      LOGSTUFF(("disable interrupt %02x\n",data));
798804      LOGSTUFF(("Split 2   IRQ: %d Disabled\n",(data>>0)&1));
r2241r2242
801807      LOGSTUFF(("Line Zero IRQ: %d Disabled\n",(data>>3)&1));
802808      LOGSTUFF(("V-Blank   IRQ: %d Disabled\n",(data>>4)&1));
803809
804//      scn2674_irq_mask &= ((data & 0x1f)^0x1f); // disables.. doesn't enable?
810/*      scn2674_irq_mask &= ((data & 0x1f)^0x1f); disables.. doesn't enable? */
805811
806812      scn2674_irq_mask &= ~(data & 0x1f);
807//New code
813
808814      scn2674_irq_state = 0;
809815
810      for (i=0; i<5; i++)
816      for (i = 0; i < 5; i++)
811817      {
812818         if ((scn2674_irq_register>>i&1)&(scn2674_irq_mask>>i&1))
813819         {
r2241r2242
815821         }
816822      }
817823      update_mpu68_interrupts();
818// end new code
824
819825   }
820826
821827   if ((data&0xe0)==0x60)
822828   {
823      // Enable Interrupt
829      /* Enable Interrupt */
824830      LOGSTUFF(("enable interrupt %02x\n",data));
825831      LOGSTUFF(("Split 2   IRQ: %d Enabled\n",(data>>0)&1));
826832      LOGSTUFF(("Ready     IRQ: %d Enabled\n",(data>>1)&1));
r2241r2242
828834      LOGSTUFF(("Line Zero IRQ: %d Enabled\n",(data>>3)&1));
829835      LOGSTUFF(("V-Blank   IRQ: %d Enabled\n",(data>>4)&1));
830836
831      scn2674_irq_mask |= (data & 0x1f);  // enables .. doesn't disable?
837      scn2674_irq_mask |= (data & 0x1f);  /* enables .. doesn't disable? */
832838
833//New code
834839      scn2674_irq_state = 0;
835840
836      for (i=0; i<5; i++)
841      for (i = 0; i < 5; i++)
837842      {
838843         if ((scn2674_irq_register>>i&1)&(scn2674_irq_mask>>i&1))
839844         {
r2241r2242
841846         }
842847      }
843848      update_mpu68_interrupts();
844// end new code
845849   }
846850
847   /**** Delayed Commands ****/
851   /* Delayed Commands */
848852
849853   if (data == 0xa4)
850854   {
851      // read at pointer address
855      /* read at pointer address */
852856      LOGSTUFF(("read at pointer address %02x\n",data));
853857   }
854858
855859   if (data == 0xa2)
856860   {
857      // write at pointer address
861      /* write at pointer address */
858862      LOGSTUFF(("write at pointer address %02x\n",data));
859863   }
860864
861865   if (data == 0xa9)
862866   {
863      // increase cursor address
867      /* increase cursor address */
864868      LOGSTUFF(("increase cursor address %02x\n",data));
865869   }
866870
867871   if (data == 0xac)
868872   {
869      // read at cursor address
873      /* read at cursor address */
870874      LOGSTUFF(("read at cursor address %02x\n",data));
871875   }
872876
873877   if (data == 0xaa)
874878   {
875      // write at cursor address
879      /* write at cursor address */
876880      LOGSTUFF(("write at cursor address %02x\n",data));
877881   }
878882
879883   if (data == 0xad)
880884   {
881      // read at cursor address + increment
885      /* read at cursor address + increment */
882886      LOGSTUFF(("read at cursor address+increment %02x\n",data));
883887   }
884888
885889   if (data == 0xab)
886890   {
887      // write at cursor address + increment
891      /* write at cursor address + increment */
888892      LOGSTUFF(("write at cursor address+increment %02x\n",data));
889893   }
890894
891895   if (data == 0xbb)
892896   {
893      // write from cursor address to pointer address
897      /* write from cursor address to pointer address */
894898      LOGSTUFF(("write from cursor address to pointer address %02x\n",data));
895899   }
896900
897901   if (data == 0xbd)
898902   {
899      // read from cursor address to pointer address
903      /* read from cursor address to pointer address */
900904      LOGSTUFF(("read from cursor address to pointer address %02x\n",data));
901905   }
902
903906}
904907
908
905909static READ16_HANDLER( mpu4_vid_scn2674_r )
906910{
907911   /*
r2241r2242
931935            R  = Ready
932936            s  = Split 2
933937        */
938
934939      case 0:
935940         LOGSTUFF(("Read Irq Register %06x\n",activecpu_get_pc()));
936941         return scn2674_irq_register;
r2241r2242
950955   return 0xffff;
951956}
952957
958
953959static WRITE16_HANDLER( mpu4_vid_scn2674_w )
954960{
955961   /*
r2241r2242
964970     7       Screen Start 2 Upper Register
965971    */
966972
967   data &=0x00ff; // it's an 8-bit chip on a 16-bit board, feel the cheapness.
973   data &=0x00ff; /* it's an 8-bit chip on a 16-bit board, feel the cheapness. */
968974
969975   switch (offset)
970976   {
r2241r2242
985991   }
986992}
987993
994
988995static VIDEO_START( mpu4_vid )
989996{
990997   /* if anything uses tile sizes other than 8x8 we can't really do it this way.. we'll have to draw tiles by hand.
r2241r2242
10181025   scn2675_IR_pointer = 0;
10191026}
10201027
1021/* palette support is very preliminary */
1022static UINT8 ef9369_palette[32];
1023static UINT8 ef9369_counter;
10241028
1025static WRITE16_HANDLER( ef9369_data_w )
1029
1030/****************************
1031 *  EF9369 color palette IC
1032 *  (16 colors from 4096)
1033 ****************************/
1034
1035static struct ef9369
10261036{
1027   int color;
1028   UINT16 coldat;
1037   UINT32 addr;
1038   UINT16 clut[16];   /* 13-bits - a marking bit and a 444 color */
1039} pal;
10291040
1030   data &=0x00ff;
10311041
1032   ef9369_palette[ef9369_counter] = data;
1042/* Non-multiplexed mode */
10331043
1034   color = ef9369_counter/2;
1035   coldat = (ef9369_palette[color*2+1]<<8)|ef9369_palette[color*2];
1036   palette_set_color_rgb(Machine,color,pal4bit(coldat >> 0),pal4bit(coldat >> 8),pal4bit(coldat >> 4));
1044static WRITE16_HANDLER( ef9369_w )
1045{
1046   data &= 0x00ff;
10371047
1038   ef9369_counter++;
1039   if (ef9369_counter>31) ef9369_counter = 31;
1048   /* Address register */
1049   if (offset & 1)
1050   {
1051      pal.addr = data & 0x1f;
1052   }
1053   /* Data register */
1054   else
1055   {
1056      UINT32 entry = pal.addr >> 1;
1057
1058      if ((pal.addr & 1) == 0)
1059      {
1060         pal.clut[entry] &= ~0x00ff;
1061         pal.clut[entry] |= data;
1062      }
1063      else
1064      {
1065         UINT16 col;
1066
1067         pal.clut[entry] &= ~0x1f00;
1068         pal.clut[entry] |= (data & 0x1f) << 8;
1069
1070         /* Remove the marking bit */
1071         col = pal.clut[entry] & 0xfff;
1072
1073         /* Update the MAME palette */
1074         palette_set_color_rgb(Machine, entry, pal4bit(col >> 0), pal4bit(col >> 4), pal4bit(col >> 8));
1075      }
1076
1077         /* Address register auto-increment */
1078      if (++pal.addr == 32)
1079         pal.addr = 0;
1080   }
10401081}
10411082
1042static WRITE16_HANDLER( ef9369_address_w )
1083
1084static READ16_HANDLER( ef9369_r )
10431085{
1044   data &=0x00ff;
1086   if ((offset & 1) == 0)
1087   {
1088      UINT16 col = pal.clut[pal.addr >> 1];
10451089
1046   ef9369_counter = data*2; // = 0?
1047
1048   if (ef9369_counter>30) ef9369_counter = 30;
1090      if ((pal.addr & 1) == 0)
1091         return col & 0xff;
1092      else
1093         return col >> 8;
1094   }
1095   else
1096   {
1097      /* Address register is write only */
1098      return 0xffff;
1099   }
10491100}
10501101
10511102static INPUT_PORTS_START( crmaze )
r2241r2242
10861137   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left Yellow")
10871138   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left Red")
10881139   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Getout Yellow")
1089   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Getout Red")//Labelled Escape on cabinet
1140   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Getout Red")/* Labelled Escape on cabinet */
10901141   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("100p Service?")PORT_IMPULSE(100)
10911142
10921143   PORT_START_TAG("DIL1")
r2241r2242
11411192   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
11421193   PORT_DIPSETTING(    0x80, DEF_STR( On  ) )
11431194
1144   PORT_START_TAG("AUX1")//Presumed to be trackball, but only one phase available?
1195   PORT_START_TAG("AUX1")/* Presumed to be trackball, but only one phase available? */
11451196   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("0")
11461197   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("1")
11471198   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("2")
r2241r2242
11601211   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("20p")PORT_IMPULSE(5)
11611212   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("50p")PORT_IMPULSE(5)
11621213   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")PORT_IMPULSE(5)
1163
11641214INPUT_PORTS_END
11651215
11661216static INPUT_PORTS_START( dealem )
r2241r2242
12891339   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("20p")PORT_IMPULSE(5)
12901340   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("50p")PORT_IMPULSE(5)
12911341   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")PORT_IMPULSE(5)
1292
12931342INPUT_PORTS_END
12941343
1344
12951345static INTERRUPT_GEN(mpu4_vid_irq)
12961346{
12971347   LOGSTUFF(("scn2674_irq_mask %02x\n",scn2674_irq_mask));
1298   if (cpu_getiloops()==0) // vbl
1348   if (cpu_getiloops()==0) /* vbl */
12991349   {
1300   //  if (scn2674_display_enabled) // ?
1350   /*  if (scn2674_display_enabled) ? */
13011351      {
13021352         if (scn2674_irq_mask&0x10)
13031353         {
r2241r2242
13121362   }
13131363}
13141364
1315// machine start (called only once) /////////////////////////////////////
13161365
1366/* machine start (called only once) */
13171367MACHINE_START( mpu4_vid )
13181368{
13191369   mpu4_config_common();
r2241r2242
13211371
13221372   ptm6840_config(1, &ptm_vid_intf );
13231373
1324// setup comms///////////////////////////////////////////////////////////
1374   /* setup communications */
13251375   serial_card_connected=1;
13261376   acia6850_config(0, &m6809_acia_if);
13271377   acia6850_config(1, &m68k_acia_if);
13281378
1329// setup 8 mechanical meters ////////////////////////////////////////////
1379   /* setup 8 mechanical meters */
13301380   Mechmtr_init(8);
13311381
1332// setup 4 default 96 half step reels ///////////////////////////////////
1382   /* setup 4 reels (for hybrid machines) */
13331383
13341384   Stepper_init(0, BARCREST_48STEP_REEL);
13351385   Stepper_init(1, BARCREST_48STEP_REEL);
13361386   Stepper_init(2, BARCREST_48STEP_REEL);
13371387   Stepper_init(3, BARCREST_48STEP_REEL);
13381388
1339// setup the standard oki MSC1937 display ///////////////////////////////
1389   /* setup the standard oki MSC1937 display */
13401390
1341   ROC10937_init(0, MSC1937,0);   // ?
1391   ROC10937_init(0, MSC1937,0);
13421392}
13431393
13441394/*
r2241r2242
13481398capacity to affect lamp matrices in the same way as before, as no software seen makes any request for the 'lamp' row.
13491399It has been left in the table, as it clearly exists, but is unused.
13501400The 'quiz' games on the board did use an address-scrambling PAL for encryption, and the very last mod of this board had
1351a characteriser capable of scrambling the ROM address lines.
1401a characteriser capable of scrambling the ROM address lines.
13521402*/
1403
13531404static WRITE16_HANDLER( characteriser16_w )
13541405{
13551406   int x;
13561407   int call=data;
13571408   LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X", activecpu_get_previouspc(),offset,data));
1358   for ( x = prot_col; x < 64; x++ )
1409   for (x = prot_col; x < 64; x++)
13591410   {
13601411      if (call == 0)
13611412      {
r2241r2242
13731424   }
13741425}
13751426
1427
13761428static READ16_HANDLER( characteriser16_r )
13771429{
13781430   LOG_CHR_FULL(("%04x Characteriser read offset %02X,data %02X", activecpu_get_previouspc(),offset,MPU4_chr_data[prot_col]));
r2241r2242
13811433   return MPU4_chr_data[prot_col];
13821434}
13831435
1436
13841437static ADDRESS_MAP_START( mpu4_68k_map, ADDRESS_SPACE_PROGRAM, 16 )
13851438   AM_RANGE(0x000000, 0x7fffff) AM_ROM
13861439
1387//  AM_RANGE(0x600000, 0x63ffff) AM_RAM? In expanded games (mating)
1440/*  AM_RANGE(0x600000, 0x63ffff) AM_RAM? In expanded games (mating) */
13881441
1389   AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(&mpu4_vid_mainram) // mainram / char address ram?
1442   AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(&mpu4_vid_mainram) /* mainram / char address ram? */
13901443
13911444   /* what is here, the sound chip? Assume so */
13921445   AM_RANGE(0x900000, 0x900001) AM_WRITE(saa1099_control_port_0_lsb_w)
13931446   AM_RANGE(0x900002, 0x900003) AM_WRITE(saa1099_write_port_0_lsb_w)
13941447
1395   /* the palette chip */
1396   AM_RANGE(0xa00000, 0xa00001) AM_WRITE(ef9369_data_w)
1397   AM_RANGE(0xa00002, 0xa00003) AM_WRITE(ef9369_address_w)
1398   AM_RANGE(0xa00004, 0xa0000f) //AM_READWRITE(mpu4_vid_unmap_r, mpu4_vid_unmap_w)
1448   AM_RANGE(0xa00000, 0xa00003) AM_READWRITE(ef9369_r, ef9369_w) /* the palette chip */
1449/*  AM_RANGE(0xa00004, 0xa0000f) AM_READWRITE(mpu4_vid_unmap_r, mpu4_vid_unmap_w) */
13991450
14001451   AM_RANGE(0xb00000, 0xb0000f) AM_READWRITE(mpu4_vid_scn2674_r, mpu4_vid_scn2674_w)
14011452
r2241r2242
14051456    AM_RANGE(0xff8000, 0xff8001) AM_READWRITE(acia6850_1_stat_lsb_r, acia6850_1_ctrl_lsb_w)
14061457    AM_RANGE(0xff8002, 0xff8003) AM_READWRITE(acia6850_1_data_lsb_r, acia6850_1_data_lsb_w)
14071458
1408   AM_RANGE(0xff9000, 0xff900f) AM_READWRITE(ptm6840_1_lsb_r,ptm6840_1_lsb_w)
1459   AM_RANGE(0xff9000, 0xff900f) AM_READWRITE(ptm6840_1_lsb_r,ptm6840_1_lsb_w)   /* 6840PTM */
14091460
1410   /* characterizer */
1411   AM_RANGE(0xffd000, 0xffd00f) AM_READWRITE(characteriser16_r, characteriser16_w) // Word-based version of old CHR???
1461   AM_RANGE(0xffd000, 0xffd00f) AM_READWRITE(characteriser16_r, characteriser16_w) /* characterizer */
14121462ADDRESS_MAP_END
14131463
14141464/* TODO: Fix up MPU4 map*/
r2241r2242
14181468   AM_RANGE(0x0800, 0x0800) AM_READWRITE(acia6850_0_stat_r, acia6850_0_ctrl_w)
14191469   AM_RANGE(0x0801, 0x0801) AM_READWRITE(acia6850_0_data_r, acia6850_0_data_w)
14201470
1421   AM_RANGE(0x0880, 0x0881) AM_NOP // Could be a UART datalogger is here.
1471   AM_RANGE(0x0880, 0x0881) AM_NOP /* Could be a UART datalogger is here. */
14221472
1423   AM_RANGE(0x0900, 0x0907) AM_READWRITE(ptm6840_0_r,ptm6840_0_w)  // 6840PTM
1473   AM_RANGE(0x0900, 0x0907) AM_READWRITE(ptm6840_0_r,ptm6840_0_w)  /* 6840PTM */
14241474
1425   AM_RANGE(0x0A00, 0x0A03) AM_READWRITE(pia_0_r,pia_0_w)        // PIA6821 IC3
1426   AM_RANGE(0x0B00, 0x0B03) AM_READWRITE(pia_1_r,pia_1_w)        // PIA6821 IC4
1427   AM_RANGE(0x0C00, 0x0C03) AM_READWRITE(pia_2_r,pia_2_w)        // PIA6821 IC5
1428   AM_RANGE(0x0D00, 0x0D03) AM_READWRITE(pia_3_r,pia_3_w)      // PIA6821 IC6
1429   AM_RANGE(0x0E00, 0x0E03) AM_READWRITE(pia_4_r,pia_4_w)      // PIA6821 IC7
1430   AM_RANGE(0x0F00, 0x0F03) AM_READWRITE(pia_5_r,pia_5_w)      // PIA6821 IC8
1475   AM_RANGE(0x0A00, 0x0A03) AM_READWRITE(pia_0_r,pia_0_w)        /* PIA6821 IC3 */
1476   AM_RANGE(0x0B00, 0x0B03) AM_READWRITE(pia_1_r,pia_1_w)        /* PIA6821 IC4 */
1477   AM_RANGE(0x0C00, 0x0C03) AM_READWRITE(pia_2_r,pia_2_w)        /* PIA6821 IC5 */
1478   AM_RANGE(0x0D00, 0x0D03) AM_READWRITE(pia_3_r,pia_3_w)      /* PIA6821 IC6 */
1479   AM_RANGE(0x0E00, 0x0E03) AM_READWRITE(pia_4_r,pia_4_w)      /* PIA6821 IC7 */
1480   AM_RANGE(0x0F00, 0x0F03) AM_READWRITE(pia_5_r,pia_5_w)      /* PIA6821 IC8 */
14311481
1432   AM_RANGE(0x4000, 0x40FF) AM_RAM // it actually runs code from here...
1482   AM_RANGE(0x4000, 0x40FF) AM_RAM /* it actually runs code from here... */
14331483
1434   AM_RANGE(0xBE00, 0xBFFF) AM_RAM //00 written on startup
1435   AM_RANGE(0xC000, 0xFFFF) AM_ROM   AM_REGION(REGION_CPU1,0)  // 64k EPROM on board, only this region read
1484   AM_RANGE(0xBE00, 0xBFFF) AM_RAM /* 00 written on startup */
1485   AM_RANGE(0xC000, 0xFFFF) AM_ROM   AM_REGION(REGION_CPU1,0)  /* 64k EPROM on board, only this region read */
14361486ADDRESS_MAP_END
14371487
14381488static ADDRESS_MAP_START( vp_68k_map, ADDRESS_SPACE_PROGRAM, 16 )
14391489   AM_RANGE(0x000000, 0x7fffff) AM_ROM
14401490
1441//  AM_RANGE(0x600000, 0x63ffff) AM_RAM? In expanded games (mating)
1491/*  AM_RANGE(0x600000, 0x63ffff) AM_RAM? In expanded games (mating) */
14421492
1443   AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(&mpu4_vid_mainram) // mainram / char address ram?
1493   AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(&mpu4_vid_mainram) /* mainram / char address ram? */
14441494
1445   AM_RANGE(0x810000, 0x81ffff) AM_RAM//? In expanded games (mating)
1495   AM_RANGE(0x810000, 0x81ffff) AM_RAM /* ? */
14461496
14471497   /* what is here, the sound chip? Assume so */
14481498   AM_RANGE(0x900000, 0x900001) AM_WRITE(saa1099_control_port_0_lsb_w)
14491499   AM_RANGE(0x900002, 0x900003) AM_WRITE(saa1099_write_port_0_lsb_w)
14501500
14511501   /* the palette chip */
1452   AM_RANGE(0xa00000, 0xa00001) AM_WRITE(ef9369_data_w)
1453   AM_RANGE(0xa00002, 0xa00003) AM_WRITE(ef9369_address_w)
1454   AM_RANGE(0xa00004, 0xa0000f) //AM_READWRITE(mpu4_vid_unmap_r, mpu4_vid_unmap_w)
1502   AM_RANGE(0xa00000, 0xa00003) AM_READWRITE(ef9369_r, ef9369_w) /* the palette chip */
1503/*  AM_RANGE(0xa00004, 0xa0000f) AM_READWRITE(mpu4_vid_unmap_r, mpu4_vid_unmap_w) */
14551504
14561505   AM_RANGE(0xb00000, 0xb0000f) AM_READWRITE(mpu4_vid_scn2674_r, mpu4_vid_scn2674_w)
14571506
14581507   AM_RANGE(0xc00000, 0xc1ffff) AM_READWRITE(mpu4_vid_vidram_r, mpu4_vid_vidram_w)
14591508
1460//  AM_RANGE(0xe05000, 0xe05001) //AM_READWRITE(adpcm_r, adpcm_w)
1509/*  AM_RANGE(0xe05000, 0xe05001) AM_READWRITE(adpcm_r, adpcm_w) */
14611510
14621511   /* comms with the MPU4 */
14631512    AM_RANGE(0xff8000, 0xff8001) AM_READWRITE(acia6850_1_stat_lsb_r, acia6850_1_ctrl_lsb_w)
r2241r2242
14671516   AM_RANGE(0xff9000, 0xff900f) AM_WRITE( ptm6840_1_lsb_w)
14681517
14691518   /* characterizer */
1470//  AM_RANGE(0xffd000, 0xffd00f) AM_READWRITE(characteriser16_r, characteriser16_w) // Word-based version of old CHR???
1519/*  AM_RANGE(0xffd000, 0xffd00f) AM_READWRITE(characteriser16_r, characteriser16_w) Word-based version of old CHR??? */
14711520ADDRESS_MAP_END
14721521
1473//Deal 'Em was designed as an enhanced gamecard, to fit into an existing MPU4 cabinet
1474//It's an unoffical addon, and does all its work through the existing 6809 CPU.
1475//Although given unofficial status, Barcrest's patent on the MPU4 Video hardware (GB1596363) describes
1476//the Deal 'Em board design, rather than the one they ultimately used.
1522/* Deal 'Em */
1523/* Deal 'Em was designed as an enhanced gamecard, to fit into an existing MPU4 cabinet
1524It's an unoffical addon, and does all its work through the existing 6809 CPU.
1525Although given unofficial status, Barcrest's patent on the MPU4 Video hardware (GB1596363) describes
1526the Deal 'Em board design, rather than the one they ultimately used, suggesting some sort of licensing deal. */
14771527
14781528static const gfx_layout dealemcharlayout =
14791529{
r2241r2242
14861536   32*8
14871537};
14881538
1539
14891540static GFXDECODE_START( dealem )
14901541   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, dealemcharlayout, 0, 32 )
14911542GFXDECODE_END
14921543
1544
14931545static UINT8 *dealem_videoram;
14941546
14951547/***************************************************************************
r2241r2242
15091561  Blue:     470R
15101562            220R    Bit 7
15111563
1512  Everything is also tied to a 1K pulldown
1564  Everything is also tied to a 1K pulldown resistor
15131565***************************************************************************/
15141566
1567
15151568static PALETTE_INIT( dealem )
15161569{
15171570   int i;
r2241r2242
15481601   }
15491602}
15501603
1604
15511605static VIDEO_UPDATE(dealem)
15521606{
15531607   int x,y;
15541608   int count = 0;
15551609
1556   for (y=0;y<32;y++)
1610   for (y = 0; y < 32; y++)
15571611   {
1558      for (x=0;x<40;x++)
1612      for (x = 0; x < 40; x++)
15591613      {
1560         int tile = dealem_videoram[count+0x1000] | (dealem_videoram[count] << 8);
1614         int tile = dealem_videoram[count + 0x1000] | (dealem_videoram[count] << 8);
15611615         count++;
1562         drawgfx(bitmap,screen->machine->gfx[0],tile,0,0,0,x*8,y*8,cliprect,TRANSPARENCY_NONE,0);
1616         drawgfx(bitmap,screen->machine->gfx[0],tile,0,0,0,x * 8,y * 8,cliprect,TRANSPARENCY_NONE,0);
15631617      }
15641618   }
15651619
15661620   return 0;
15671621}
15681622
1623
15691624static MC6845_ON_VSYNC_CHANGED( dealem_vsync_changed )
15701625{
15711626   cpunum_set_input_line(device->machine, 0, INPUT_LINE_NMI, vsync);
r2241r2242
15791634
15801635static const mc6845_interface hd6845_intf =
15811636{
1582   "main",               /* screen we are acting on */
1583   MPU4_MASTER_CLOCK/4/8,    /* the clock (pin 21) of the chip (educated guess)*/
1584   8,                  /* number of pixels per video memory address */
1585   NULL,               /* before pixel update callback */
1586   NULL,               /* row update callback */
1587   NULL,               /* after pixel update callback */
1588   NULL,               /* callback for display state changes */
1589   NULL,               /* HSYNC callback */
1590   dealem_vsync_changed   /* VSYNC callback */
1637   "main",                  /* screen we are acting on */
1638   MPU4_MASTER_CLOCK / 4 / 8,   /* the clock (pin 21) of the chip (educated guess)*/
1639   8,                     /* number of pixels per video memory address */
1640   NULL,                  /* before pixel update callback */
1641   NULL,                  /* row update callback */
1642   NULL,                  /* after pixel update callback */
1643   NULL,                  /* callback for display state changes */
1644   NULL,                  /* HSYNC callback */
1645   dealem_vsync_changed      /* VSYNC callback */
15911646};
15921647
1648
15931649static ADDRESS_MAP_START( dealem_memmap, ADDRESS_SPACE_PROGRAM, 8 )
1594
15951650   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
15961651
15971652   AM_RANGE(0x0800, 0x0800) AM_DEVWRITE(HD6845, "crtc", mc6845_address_w)
15981653   AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE(HD6845, "crtc", mc6845_register_r, mc6845_register_w)
15991654
1600//  AM_RANGE(0x0850, 0x0850) AM_READWRITE(bankswitch_r,bankswitch_w)    // write bank (rom page select)
1655/*  AM_RANGE(0x08E0, 0x08E7) AM_READWRITE(68681_duart_r,68681_duart_w) */
16011656
1602//  AM_RANGE(0x08E0, 0x08E7) AM_READWRITE(68681_duart_r,68681_duart_w)
1657   AM_RANGE(0x0900, 0x0907) AM_READWRITE(ptm6840_0_r,ptm6840_0_w)  /* 6840PTM */
16031658
1604   AM_RANGE(0x0900, 0x0907) AM_READWRITE(ptm6840_0_r,ptm6840_0_w)  // 6840PTM
1659   AM_RANGE(0x0A00, 0x0A03) AM_READWRITE(pia_0_r,pia_0_w)        /* PIA6821 IC3 */
1660   AM_RANGE(0x0B00, 0x0B03) AM_READWRITE(pia_1_r,pia_1_w)        /* PIA6821 IC4 */
1661   AM_RANGE(0x0C00, 0x0C03) AM_READWRITE(pia_2_r,pia_2_w)        /* PIA6821 IC5 */
1662   AM_RANGE(0x0D00, 0x0D03) AM_READWRITE(pia_3_r,pia_3_w)      /* PIA6821 IC6 */
1663   AM_RANGE(0x0E00, 0x0E03) AM_READWRITE(pia_4_r,pia_4_w)      /* PIA6821 IC7 */
1664   AM_RANGE(0x0F00, 0x0F03) AM_READWRITE(pia_5_r,pia_5_w)      /* PIA6821 IC8 */
16051665
1606   AM_RANGE(0x0A00, 0x0A03) AM_READWRITE(pia_0_r,pia_0_w)        // PIA6821 IC3
1607   AM_RANGE(0x0B00, 0x0B03) AM_READWRITE(pia_1_r,pia_1_w)        // PIA6821 IC4
1608   AM_RANGE(0x0C00, 0x0C03) AM_READWRITE(pia_2_r,pia_2_w)        // PIA6821 IC5
1609   AM_RANGE(0x0D00, 0x0D03) AM_READWRITE(pia_3_r,pia_3_w)      // PIA6821 IC6
1610   AM_RANGE(0x0E00, 0x0E03) AM_READWRITE(pia_4_r,pia_4_w)      // PIA6821 IC7
1611   AM_RANGE(0x0F00, 0x0F03) AM_READWRITE(pia_5_r,pia_5_w)      // PIA6821 IC8
1612
16131666   AM_RANGE(0x1000, 0x2fff) AM_RAM AM_BASE(&dealem_videoram)
1614   AM_RANGE(0x8000, 0xffff) AM_ROM   AM_WRITENOP// 64k  paged ROM (4 pages)
1615
1667   AM_RANGE(0x8000, 0xffff) AM_ROM   AM_WRITENOP/* 64k  paged ROM (4 pages) */
16161668ADDRESS_MAP_END
16171669
1670
16181671static MACHINE_DRIVER_START( mpu4_vid )
1619
16201672   MDRV_CPU_ADD_TAG("main", M6809, MPU4_MASTER_CLOCK/4 )
16211673   MDRV_CPU_PROGRAM_MAP(mpu4_6809_map,0)
16221674   MDRV_TIMER_ADD_PERIODIC("50HZ",gen_50hz, HZ(100))
16231675
1624   MDRV_NVRAM_HANDLER(generic_0fill)            // confirm
1676   MDRV_NVRAM_HANDLER(generic_0fill)            /* confirm */
16251677
16261678   /* video hardware */
16271679   MDRV_SCREEN_ADD("main", RASTER)
r2241r2242
16471699   MDRV_SOUND_ADD_TAG("AY8913",AY8913, MPU4_MASTER_CLOCK/4)
16481700   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
16491701
1650   MDRV_SPEAKER_STANDARD_STEREO("left", "right")// Present on all video cards
1702   MDRV_SPEAKER_STANDARD_STEREO("left", "right")/* Present on all video cards */
16511703   MDRV_SOUND_ADD(SAA1099, 8000000)
16521704   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.00)
16531705   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.00)
1654
16551706MACHINE_DRIVER_END
16561707
16571708static MACHINE_DRIVER_START( vgpoker )
1658
16591709   MDRV_IMPORT_FROM( mpu4_vid )
16601710   MDRV_CPU_MODIFY("video")
16611711   MDRV_CPU_PROGRAM_MAP(vp_68k_map,0)
1662
16631712MACHINE_DRIVER_END
16641713
1665// machine driver for zenitone dealem board /////////////////////////////////
16661714
1715/* machine driver for Zenitone Deal 'Em board */
16671716static MACHINE_DRIVER_START( dealem )
1668
1669   MDRV_MACHINE_START(mpu4mod2)                     // main mpu4 board initialisation
1717   MDRV_MACHINE_START(mpu4mod2)                     /* main mpu4 board initialisation */
16701718   MDRV_MACHINE_RESET(mpu4_vid)
16711719   MDRV_CPU_ADD_TAG("main", M6809, MPU4_MASTER_CLOCK/4)
16721720   MDRV_CPU_PROGRAM_MAP(dealem_memmap,0)
r2241r2242
16771725   MDRV_SOUND_ADD_TAG("AY8913",AY8913, MPU4_MASTER_CLOCK/4)
16781726   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
16791727
1680   MDRV_NVRAM_HANDLER(generic_0fill)                  // load/save nv RAM
1728   MDRV_NVRAM_HANDLER(generic_0fill)
16811729
16821730   /* video hardware */
16831731   MDRV_SCREEN_ADD("main", RASTER)
16841732   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
16851733   MDRV_SCREEN_SIZE((54+1)*8, (32+1)*8)               /* Taken from 6845 init, registers 00 & 04. Normally programmed with (value-1) */
16861734   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 31*8-1)      /* Taken from 6845 init, registers 01 & 06 */
1687   MDRV_SCREEN_REFRESH_RATE(56)                     /* Measured accurately from the flip-flop */
1735   MDRV_SCREEN_REFRESH_RATE(56)                     /* Measured accurately from the flip-flop, but 6845 handles this */
16881736
16891737   MDRV_GFXDECODE(dealem)
16901738   MDRV_VIDEO_UPDATE(dealem)
r2241r2242
16921740   MDRV_PALETTE_LENGTH(32)
16931741   MDRV_PALETTE_INIT(dealem)
16941742
1695   MDRV_DEVICE_ADD("crtc", HD6845)                     // HD68B45
1743   MDRV_DEVICE_ADD("crtc", HD6845)                     /* HD68B45 */
16961744   MDRV_DEVICE_CONFIG(hd6845_intf)
16971745MACHINE_DRIVER_END
16981746
1747
16991748static DRIVER_INIT (crmaze)
17001749{
17011750   int x;
r2241r2242
17091758                             0x20,0xAC,0x74,0x04,0xA4,0x94,0x3C,0x00,
17101759                             0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
17111760
1712   for (x=0; x < 72; x++)
1761   for (x = 0; x < 72; x++)
17131762   {
17141763      MPU4_chr_data[(x)] = chr_table[(x)];
17151764   }
17161765}
17171766
1767
17181768static DRIVER_INIT (mating)
17191769{
17201770   int x;
r2241r2242
17281778                             0x2C,0x90,0x44,0x18,0xE8,0x84,0x3C,0x00,
17291779                             0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
17301780
1731   for (x=0; x < 72; x++)
1781   for (x = 0; x < 72; x++)
17321782   {
17331783      MPU4_chr_data[(x)] = chr_table[(x)];
17341784   }
17351785}
17361786
1787
17371788ROM_START( dealem )
17381789   ROM_REGION( 0x10000, REGION_CPU1, ROMREGION_ERASE00  )
17391790   ROM_LOAD( "zenndlem.u6",   0x8000, 0x8000,  CRC(571e5c05) SHA1(89b4c331407a04eae34bb187b036791e0a671533) )
r2241r2242
17621813   VID_BIOS
17631814ROM_END
17641815
1765ROM_START( crmaze ) // this set runs in MFME, so should be OK */
1816ROM_START( crmaze )
17661817   ROM_REGION( 0x10000, REGION_CPU1, 0 )
17671818   VID_BIOS
17681819
r2241r2242
19071958   VID_BIOS
19081959
19091960   ROM_REGION( 0x800000, REGION_CPU2, 0 )
1910   ROM_LOAD16_BYTE( "mats.p1",  0x000000, 0x080000,  CRC(ebc7ea7e) SHA1(11015489a803ba5c8dbdafd632424bbd6080aece) ) // 3 bytes changed from above set...
1911   ROM_LOAD16_BYTE( "mats.p2",  0x000001, 0x080000,  CRC(a4c7e9b4) SHA1(30148c0257181bb88159e02d2b7cd79995ee84a7) ) // Just enough to disable the data logger
1961   ROM_LOAD16_BYTE( "mats.p1",  0x000000, 0x080000,  CRC(ebc7ea7e) SHA1(11015489a803ba5c8dbdafd632424bbd6080aece) ) /* 3 bytes changed from above set...*/
1962   ROM_LOAD16_BYTE( "mats.p2",  0x000001, 0x080000,  CRC(a4c7e9b4) SHA1(30148c0257181bb88159e02d2b7cd79995ee84a7) ) /* Just enough to disable the data logger */
19121963   ROM_LOAD16_BYTE( "matg.p3",  0x100000, 0x080000,  CRC(571f4e8e) SHA1(51babacb5d9fb1cc9e1e56a3b2a355597d04f178) )
19131964   ROM_LOAD16_BYTE( "matg.p4",  0x100001, 0x080000,  CRC(52d8657b) SHA1(e44e1db13c4abd4fedcd72df9dce1df594f74e44) )
19141965   ROM_LOAD16_BYTE( "matg.p5",  0x200000, 0x080000,  CRC(9f0c9552) SHA1(8b1197f20853e18841a8f64fd5ff58cdd0bd1dbd) )
r2241r2242
19261977   ROM_LOAD( "matsnd.p4",  0x180000, 0x080000,  CRC(d7e65c5b) SHA1(5575fb9f948158f2e94c986bf4bca9c9ee66a489) )
19271978ROM_END
19281979
1929//Vegas Poker Protoype dumped by HIGHWAYMAN
1980/* Vegas Poker Protoype dumped by HIGHWAYMAN */
19301981ROM_START( vgpoker )
19311982   ROM_REGION( 0x10000, REGION_CPU1, 0 )
19321983   ROM_LOAD("comms-v2.0.bin",  0x00000, 0x10000,  CRC(1717581f) SHA1(40f8cae39a2ab0c89d2bbfd8a37725aaae229c96))
r2241r2242
19682019   led_extend=1;
19692020}
19702021
1971//Deal 'Em was a conversion kit designed to make early MPU4 machines into video games by replacing the top glass
1972//and reel assembly with this kit and a supplied monitor.
1973//The real Deal 'Em ran on Summit Coin hardware, and was made by someone else.
1974//A further different release was made in 2000, running on the Barcrest MPU4 Video, rather than this one.
2022/*Deal 'Em was a conversion kit designed to make early MPU4 machines into video games by replacing the top glass
2023and reel assembly with this kit and a supplied monitor.
2024The real Deal 'Em ran on Summit Coin hardware, and was made by someone else.
2025A further different release was made in 2000, running on the Barcrest MPU4 Video, rather than this one. */
2026
19752027GAME( 1987, dealem,    0,        dealem,   dealem,   0,    ROT0,   "Zenitone",       "Deal 'Em (MPU4 Conversion Kit, v7.0)",                        GAME_IMPERFECT_GRAPHICS )
19762028
19772029GAME( 199?, bctvidbs,0,       mpu4mod2, mpu4,     0,    ROT0,   "Barcrest",       "MPU4 Video Firmware",                                    GAME_IS_BIOS_ROOT )
19782030
19792031GAME( 1994?,crmaze,  bctvidbs,mpu4_vid, crmaze,   crmaze,ROT0,   "Barcrest",       "The Crystal Maze Team Challenge (SWP)",                     GAME_NOT_WORKING|GAME_NO_SOUND )
19802032GAME( 1992?,crmazea, crmaze,  mpu4_vid, crmaze,   crmaze,ROT0,   "Barcrest",       "The Crystal Maze (AMLD Version)",                           GAME_NOT_WORKING|GAME_NO_SOUND )
1981GAME( 1993?,crmazeb, crmaze,  mpu4_vid, crmaze,   0,     ROT0,   "Barcrest",       "The New Crystal Maze Featuring Ocean Zone (AMLD Version)",         GAME_NOT_WORKING|GAME_NO_SOUND ) // unprotected?
1982GAME( 1990, turnover,bctvidbs,mpu4_vid, mpu4,     0,     ROT0,   "Barcrest",       "Turnover",                                             GAME_NOT_WORKING|GAME_NO_SOUND ) // unprotected?
1983GAME( 1992, skiltrek,bctvidbs,mpu4_vid, mpu4,     0,     ROT0,   "Barcrest",       "Skill Trek",                                          GAME_NOT_WORKING|GAME_NO_SOUND ) // unprotected?
1984GAME( 1990, timemchn,bctvidbs,mpu4_vid, mpu4,     0,     ROT0,   "Barcrest",       "Time Machine (v2.0)",                                    GAME_NOT_WORKING|GAME_NO_SOUND ) // unprotected?
2033GAME( 1993?,crmazeb, crmaze,  mpu4_vid, crmaze,   0,     ROT0,   "Barcrest",       "The New Crystal Maze Featuring Ocean Zone (AMLD Version)",         GAME_NOT_WORKING|GAME_NO_SOUND ) /* unprotected? */
2034GAME( 1990, turnover,bctvidbs,mpu4_vid, mpu4,     0,     ROT0,   "Barcrest",       "Turnover",                                             GAME_NOT_WORKING|GAME_NO_SOUND ) /* unprotected? */
2035GAME( 1992, skiltrek,bctvidbs,mpu4_vid, mpu4,     0,     ROT0,   "Barcrest",       "Skill Trek",                                          GAME_NOT_WORKING|GAME_NO_SOUND ) /* unprotected? */
2036GAME( 1990, timemchn,bctvidbs,mpu4_vid, mpu4,     0,     ROT0,   "Barcrest",       "Time Machine (v2.0)",                                    GAME_NOT_WORKING|GAME_NO_SOUND ) /* unprotected? */
19852037GAME( 199?, mating,  bctvidbs,mpu4_vid, mpu4,     mating,ROT0,   "Barcrest",       "The Mating Game (Datapak)",                              GAME_NOT_WORKING|GAME_NO_SOUND )
19862038GAME( 199?, matinga, mating,  mpu4_vid, mpu4,     mating,ROT0,   "Barcrest",       "The Mating Game (Standard)",                              GAME_NOT_WORKING|GAME_NO_SOUND )
19872039GAME( 199?, vgpoker, 0,        vgpoker,   mpu4,     0,    ROT0,   "BwB",            "Vegas Poker (Prototype)",                                 GAME_NOT_WORKING|GAME_NO_SOUND )
src/mame/drivers/metro.c
r2241r2242
206206{
207207//if (data & ~0x15) logerror("CPU #0 PC %06X : unknown bits of irqcause written: %04X\n",activecpu_get_pc(),data);
208208
209   if (ACCESSING_LSB)
209   if (ACCESSING_BITS_0_7)
210210   {
211211      data &= ~*metro_irq_enable;
212212
r2241r2242
357357
358358static WRITE16_HANDLER( metro_soundlatch_w )
359359{
360   if (ACCESSING_LSB)
360   if (ACCESSING_BITS_0_7)
361361   {
362362      soundlatch_w(machine,0,data & 0xff);
363363      cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
r2241r2242
379379
380380static WRITE16_HANDLER( metro_soundstatus_w )
381381{
382   if (ACCESSING_LSB)
382   if (ACCESSING_BITS_0_7)
383383      metro_soundstatus = data & 0x01;
384384}
385385
r2241r2242
534534
535535static WRITE16_HANDLER( ymf278b_w )
536536{
537   if(ACCESSING_LSB)
537   if(ACCESSING_BITS_0_7)
538538      switch(offset)
539539      {
540540         case 0:
r2241r2242
578578
579579static WRITE16_HANDLER( metro_coin_lockout_1word_w )
580580{
581   if (ACCESSING_LSB)
581   if (ACCESSING_BITS_0_7)
582582   {
583583//      coin_lockout_w(0, data & 1);
584584//      coin_lockout_w(1, data & 2);
r2241r2242
13931393
13941394static WRITE16_HANDLER( gakusai_oki_bank_hi_w )
13951395{
1396   if (ACCESSING_LSB)
1396   if (ACCESSING_BITS_0_7)
13971397   {
13981398      gakusai_oki_bank_hi = data & 0xff;
13991399      gakusai_oki_bank_set();
r2241r2242
14021402
14031403static WRITE16_HANDLER( gakusai_oki_bank_lo_w )
14041404{
1405   if (ACCESSING_LSB)
1405   if (ACCESSING_BITS_0_7)
14061406   {
14071407      gakusai_oki_bank_lo = data & 0xff;
14081408      gakusai_oki_bank_set();
r2241r2242
14301430
14311431static WRITE16_HANDLER( gakusai_eeprom_w )
14321432{
1433   if (ACCESSING_LSB)
1433   if (ACCESSING_BITS_0_7)
14341434   {
14351435      // latch the bit
14361436      EEPROM_write_bit(data & 0x01);
r2241r2242
15621562
15631563static WRITE16_HANDLER( dokyusp_eeprom_bit_w )
15641564{
1565   if (ACCESSING_LSB)
1565   if (ACCESSING_BITS_0_7)
15661566   {
15671567      // latch the bit
15681568      EEPROM_write_bit(data & 0x01);
r2241r2242
15751575
15761576static WRITE16_HANDLER( dokyusp_eeprom_reset_w )
15771577{
1578   if (ACCESSING_LSB)
1578   if (ACCESSING_BITS_0_7)
15791579   {
15801580      // reset line asserted: reset.
15811581      EEPROM_set_cs_line((data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
r2241r2242
20342034
20352035static WRITE16_HANDLER( mouja_sound_rombank_w )
20362036{
2037   if (ACCESSING_LSB)
2037   if (ACCESSING_BITS_0_7)
20382038      OKIM6295_set_bank_base(0, ((data >> 3) & 0x07) * 0x40000);
20392039}
20402040
r2241r2242
21022102
21032103static WRITE16_HANDLER( puzzlet_irq_enable_w )
21042104{
2105   if (ACCESSING_LSB)
2105   if (ACCESSING_BITS_0_7)
21062106      *metro_irq_enable = data^0xffff;
21072107}
21082108
src/mame/drivers/circusc.c
r2241r2242
1818#include "cpu/m6809/m6809.h"
1919#include "sound/dac.h"
2020#include "sound/sn76496.h"
21#include "sound/flt_rc.h"
21#include "sound/discrete.h"
2222
23
2423void konami1_decode(void);
2524
2625extern UINT8 *circusc_spritebank;
r2241r2242
8281
8382static WRITE8_HANDLER(circusc_sound_w)
8483{
85   int c;
84   //int c;
8685
8786   switch (offset & 7)
8887   {
r2241r2242
103102
104103      /* CS5 */
105104      case 3:
106         DAC_data_w(0, data);
105         discrete_sound_w(machine, NODE_03, data);
107106         break;
108107
109108      /* CS6 */
110109      case 4:
111         c = (offset & 0x20) ? 470000 : 0;
112         filter_rc_set_RC(0, FLT_RC_LOWPASS, 1000, 2200, 1000, CAP_P(c));
113
114         c = 0;
115         if (offset & 0x10) c += 470000;
116         if (offset & 0x08) c +=  47000;
117         filter_rc_set_RC(1, FLT_RC_LOWPASS, 1000, 2200, 1000, CAP_P(c));
118
119         c = (offset & 0x40) ? 470000 : 0;
120         filter_rc_set_RC(2, FLT_RC_LOWPASS, 1000, 10000, 1000, CAP_P(c));
110         discrete_sound_w(machine, NODE_05, (offset & 0x20) >> 5);
111         discrete_sound_w(machine, NODE_06, (offset & 0x18) >> 3);
112         discrete_sound_w(machine, NODE_07, (offset & 0x40) >> 6);
113         break;
121114   }
122115}
123116
r2241r2242
296289   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*16, 16 )
297290GFXDECODE_END
298291
292static const discrete_mixer_desc circusc_mixer_desc =
293   {DISC_MIXER_IS_RESISTOR,
294      {RES_K(2.2), RES_K(2.2), RES_K(10)},
295      {0,0,0},   // no variable resistors
296      {0,0,0},  // no node capacitors
297      0, RES_K(1),
298      CAP_U(0.1),
299      CAP_U(0.47),
300      0, 1};
299301
302static DISCRETE_SOUND_START( circusc )
300303
304   DISCRETE_INPUTX_STREAM(NODE_01, 0, 1.0, 0)
305   DISCRETE_INPUTX_STREAM(NODE_02, 1, 1.0, 0)
306   DISCRETE_INPUTX_DATA(NODE_03, 255, 0, 0) //DAC
307
308   DISCRETE_INPUT_DATA(NODE_05)
309   DISCRETE_INPUT_DATA(NODE_06)
310   DISCRETE_INPUT_DATA(NODE_07)
311
312   DISCRETE_RCFILTER_SW(NODE_10, 1, NODE_01, NODE_05, 1000, CAP_U(0.47), 0, 0, 0)
313   DISCRETE_RCFILTER_SW(NODE_11, 1, NODE_02, NODE_06, 1000, CAP_U(0.047), CAP_U(0.47), 0, 0)
314   DISCRETE_RCFILTER_SW(NODE_12, 1, NODE_03, NODE_07, 1000, CAP_U(0.47), 0, 0, 0)
315
316   DISCRETE_MIXER3(NODE_20, 1, NODE_10, NODE_11, NODE_12, &circusc_mixer_desc)
317
318   DISCRETE_OUTPUT(NODE_20, 10.0 )
319
320DISCRETE_SOUND_END
321
301322static MACHINE_DRIVER_START( circusc )
302323
303324   /* basic machine hardware */
r2241r2242
332353   MDRV_SPEAKER_STANDARD_MONO("mono")
333354
334355   MDRV_SOUND_ADD(SN76496, 14318180/8)
335   MDRV_SOUND_ROUTE(0, "filter.1", 1.0)
356   MDRV_SOUND_ROUTE_EX(0, "fltdisc", 1.0, 0)
336357
337358   MDRV_SOUND_ADD(SN76496, 14318180/8)
338   MDRV_SOUND_ROUTE(0, "filter.2", 1.0)
359   MDRV_SOUND_ROUTE_EX(0, "fltdisc", 1.0, 1)
339360
340   MDRV_SOUND_ADD(DAC, 0)
341   MDRV_SOUND_ROUTE(0, "filter.3", 1.0)
361   MDRV_SOUND_ADD_TAG("fltdisc", DISCRETE, 0)
342362
343   MDRV_SOUND_ADD_TAG("filter.1", FILTER_RC, 0)
363   MDRV_SOUND_CONFIG_DISCRETE(circusc)
344364   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
345   MDRV_SOUND_ADD_TAG("filter.2", FILTER_RC, 0)
346   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
347   MDRV_SOUND_ADD_TAG("filter.3", FILTER_RC, 0)
348   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
349365
350366MACHINE_DRIVER_END
351367
src/mame/drivers/midvunit.c
r2241r2242
55    driver by Aaron Giles
66
77    Games supported:
8        * Cruis'n USA (1994)       [3 sets]
9        * Cruis'n World (1996)     [4 sets]
8        * Cruis'n USA (1994)        [3 sets]
9        * Cruis'n World (1996)      [4 sets]
1010        * War Gods (1996)
11        * Off Road Challenge (1997)
11        * Off Road Challenge (1997) [3 sets]
1212
1313    Known bugs:
1414        * textures for automatic/manual selection get overwritten in Cruis'n World
r2241r2242
10571057 *
10581058 *************************************/
10591059
1060ROM_START( crusnusa )
1060ROM_START( crusnusa ) /* Version 4.1, Mon Feb 13 1995 - 16:53:40 */
10611061   ROM_REGION16_LE( 0x1000000, REGION_SOUND1, ROMREGION_ERASEFF )   /* sound data */
10621062   ROM_LOAD16_BYTE( "cusa.u2",  0x000000, 0x80000, CRC(b9338332) SHA1(e5c420e63c4eba0010a68c7e0a57ef210e2c83d2) )
10631063   ROM_LOAD16_BYTE( "cusa.u3",  0x200000, 0x80000, CRC(cd8325d6) SHA1(d65d7263e056ca1d637adb44cafef523e0831a34) )
r2241r2242
10921092ROM_END
10931093
10941094
1095ROM_START( crusnu40 )
1095ROM_START( crusnu40 ) /* Version 4.0, Wed Feb 08 1995 - 10:45:14 */
10961096   ROM_REGION16_LE( 0x1000000, REGION_SOUND1, ROMREGION_ERASEFF )   /* sound data */
10971097   ROM_LOAD16_BYTE( "cusa.u2",  0x000000, 0x80000, CRC(b9338332) SHA1(e5c420e63c4eba0010a68c7e0a57ef210e2c83d2) )
10981098   ROM_LOAD16_BYTE( "cusa.u3",  0x200000, 0x80000, CRC(cd8325d6) SHA1(d65d7263e056ca1d637adb44cafef523e0831a34) )
r2241r2242
11271127ROM_END
11281128
11291129
1130ROM_START( crusnu21 )
1130ROM_START( crusnu21 ) /* Version 2.1, Wed Nov 09 1994 - 16:28:10 */
11311131   ROM_REGION16_LE( 0x1000000, REGION_SOUND1, ROMREGION_ERASEFF )   /* sound data */
11321132   ROM_LOAD16_BYTE( "cusa.u2",  0x000000, 0x80000, CRC(b9338332) SHA1(e5c420e63c4eba0010a68c7e0a57ef210e2c83d2) )
11331133   ROM_LOAD16_BYTE( "cusa.u3",  0x200000, 0x80000, CRC(cd8325d6) SHA1(d65d7263e056ca1d637adb44cafef523e0831a34) )
r2241r2242
11621162ROM_END
11631163
11641164
1165ROM_START( crusnwld )
1165ROM_START( crusnwld ) /* Version 2.4, Thu Feb 19 1998 - 13:43:26 */
11661166   ROM_REGION16_LE( 0x1000000, REGION_SOUND1, ROMREGION_ERASEFF )   /* sound data */
11671167   ROM_LOAD16_BYTE( "cwld.u2",  0x000000, 0x80000, CRC(7a233c89) SHA1(ecfad4bc48a69cd3399e3b3266c81574082e0169) )
11681168   ROM_LOAD16_BYTE( "cwld.u3",  0x200000, 0x80000, CRC(be9a5ff0) SHA1(98d69dbfa6aa8462cdd46772e991ee418b79c653) )
r2241r2242
11931193ROM_END
11941194
11951195
1196ROM_START( crusnw23 )
1196ROM_START( crusnw23 ) /* Version 2.3, Fri Jan 09 1998 - 10:25:49 */
11971197   ROM_REGION16_LE( 0x1000000, REGION_SOUND1, ROMREGION_ERASEFF )   /* sound data */
11981198   ROM_LOAD16_BYTE( "cwld.u2",  0x000000, 0x80000, CRC(7a233c89) SHA1(ecfad4bc48a69cd3399e3b3266c81574082e0169) )
11991199   ROM_LOAD16_BYTE( "cwld.u3",  0x200000, 0x80000, CRC(be9a5ff0) SHA1(98d69dbfa6aa8462cdd46772e991ee418b79c653) )
r2241r2242
12241224ROM_END
12251225
12261226
1227ROM_START( crusnw20 )
1227ROM_START( crusnw20 ) /* Version 2.0, Tue Mar 18 1997 - 12:32:57 */
12281228   ROM_REGION16_LE( 0x1000000, REGION_SOUND1, ROMREGION_ERASEFF )   /* sound data */
12291229   ROM_LOAD16_BYTE( "cwld.u2",  0x000000, 0x80000, CRC(7a233c89) SHA1(ecfad4bc48a69cd3399e3b3266c81574082e0169) )
12301230   ROM_LOAD16_BYTE( "cwld.u3",  0x200000, 0x80000, CRC(be9a5ff0) SHA1(98d69dbfa6aa8462cdd46772e991ee418b79c653) )
r2241r2242
12551255ROM_END
12561256
12571257
1258ROM_START( crusnw13 )
1258ROM_START( crusnw13 ) /* Version 1.3, Mon Nov 25 1996 - 23:22:45 */
12591259   ROM_REGION16_LE( 0x1000000, REGION_SOUND1, ROMREGION_ERASEFF )   /* sound data */
12601260   ROM_LOAD16_BYTE( "cwld.u2",  0x000000, 0x80000, CRC(7a233c89) SHA1(ecfad4bc48a69cd3399e3b3266c81574082e0169) )
12611261   ROM_LOAD16_BYTE( "cwld.u3",  0x200000, 0x80000, CRC(be9a5ff0) SHA1(98d69dbfa6aa8462cdd46772e991ee418b79c653) )
r2241r2242
12861286ROM_END
12871287
12881288
1289ROM_START( offroadc )
1289ROM_START( offroadc ) /* Version 1.40, Mon 10-06-97 */
12901290   ROM_REGION16_LE( 0x1000000, REGION_SOUND1, ROMREGION_ERASEFF )   /* sound data */
12911291   ROM_LOAD16_BYTE( "offroadc.u2",  0x000000, 0x80000, CRC(69976e9d) SHA1(63c886ac2563c43a10840f49f929f8613cd94de2) )
12921292   ROM_LOAD16_BYTE( "offroadc.u3",  0x200000, 0x80000, CRC(2db9b548) SHA1(4f454a3e6a8851b0ef5d325dd28102d57ea11a11) )
r2241r2242
12981298   ROM_LOAD16_BYTE( "offroadc.u9",  0xe00000, 0x80000, CRC(7ad27f69) SHA1(b33665d0593a95b58d529720aae49e90449bf714) )
12991299
13001300   ROM_REGION32_LE( 0x1000000, REGION_USER1, 0 )
1301   ROM_LOAD32_BYTE( "offroadc.u10", 0x0000000, 0x100000, CRC(4729660c) SHA1(0baff6a27015f4eb3fe0a981ecbac33d140e872a) )
1302   ROM_LOAD32_BYTE( "offroadc.u11", 0x0000001, 0x100000, CRC(6272d013) SHA1(860121184282627ed692e56a0dafee8b64562811) )
1303   ROM_LOAD32_BYTE( "offroadc.u12", 0x0000002, 0x100000, CRC(9c8326be) SHA1(55f16d14379f57d08ed84d82f9db1a582bc223a1) )
1304   ROM_LOAD32_BYTE( "offroadc.u13", 0x0000003, 0x100000, CRC(53bbc181) SHA1(1ab29a27a216eb09d69a9f3d681865de1a904717) )
1301   ROM_LOAD32_BYTE( "orc-1_4.u10",  0x0000000, 0x100000, CRC(d263b078) SHA1(d376e120e05cf8526b002300db345fd0b9775702) ) /* Version 1.40 program roms */
1302   ROM_LOAD32_BYTE( "orc-1_4.u11",  0x0000001, 0x100000, CRC(1b443a72) SHA1(0e16d923f0e97f21e92c8d5b431fcaa0815b2c87) )
1303   ROM_LOAD32_BYTE( "orc-1_4.u12",  0x0000002, 0x100000, CRC(4e82a34b) SHA1(c22a3f638b7e226add511147982339b1f59821e9) )
1304   ROM_LOAD32_BYTE( "orc-1_4.u13",  0x0000003, 0x100000, CRC(558b859c) SHA1(b7946a4b44976b08a691622000e1457021267d1a) )
13051305   ROM_LOAD32_BYTE( "offroadc.u14", 0x0400000, 0x100000, CRC(1e41d14b) SHA1(3f7c5fae1f8b82ddd811720837fa298785a8dd27) )
13061306   ROM_LOAD32_BYTE( "offroadc.u15", 0x0400001, 0x100000, CRC(654d623d) SHA1(a944b8f8d71b099d7b5bbd7df6effb90afc3aec8) )
13071307   ROM_LOAD32_BYTE( "offroadc.u16", 0x0400002, 0x100000, CRC(259774d8) SHA1(90cdf659324b84b3c2c59497cc5611e8f12629a6) )
r2241r2242
13171317ROM_END
13181318
13191319
1320ROM_START( wargods )
1320ROM_START( offrodc3 ) /* Version 1.30, Mon 09-15-97 */
1321   ROM_REGION16_LE( 0x1000000, REGION_SOUND1, ROMREGION_ERASEFF )   /* sound data */
1322   ROM_LOAD16_BYTE( "offroadc.u2",  0x000000, 0x80000, CRC(69976e9d) SHA1(63c886ac2563c43a10840f49f929f8613cd94de2) )
1323   ROM_LOAD16_BYTE( "offroadc.u3",  0x200000, 0x80000, CRC(2db9b548) SHA1(4f454a3e6a8851b0ef5d325dd28102d57ea11a11) )
1324   ROM_LOAD16_BYTE( "offroadc.u4",  0x400000, 0x80000, CRC(42bdf9d0) SHA1(04add0f0ee7fa61de1913cc0b988345d3d430cde) )
1325   ROM_LOAD16_BYTE( "offroadc.u5",  0x600000, 0x80000, CRC(569cc84b) SHA1(08b917cc41fae6b6a3e9d9461a783d3d2865e72a) )
1326   ROM_LOAD16_BYTE( "offroadc.u6",  0x800000, 0x80000, CRC(0896f679) SHA1(dde39ef17834256909ef2c9fcd5b5fb9939d5178) )
1327   ROM_LOAD16_BYTE( "offroadc.u7",  0xa00000, 0x80000, CRC(fe242d6a) SHA1(8fbac22ed23044841f309ce58c5b1affcdd5d114) )
1328   ROM_LOAD16_BYTE( "offroadc.u8",  0xc00000, 0x80000, CRC(5da13f12) SHA1(2bb5e929e8bc6c70cb4475024a6b0bb07ac25244) )
1329   ROM_LOAD16_BYTE( "offroadc.u9",  0xe00000, 0x80000, CRC(7ad27f69) SHA1(b33665d0593a95b58d529720aae49e90449bf714) )
1330
1331   ROM_REGION32_LE( 0x1000000, REGION_USER1, 0 )
1332   ROM_LOAD32_BYTE( "orc-1_3.u10",  0x0000000, 0x100000, CRC(71c62ce2) SHA1(e6bdbf3df4795f4cf29a08641cc59d90aed73b57) ) /* Version 1.30 program roms */
1333   ROM_LOAD32_BYTE( "orc-1_3.u11",  0x0000001, 0x100000, CRC(9e362dbb) SHA1(2480710f1081679ff87239a8e28a9a3f235bd3dc) )
1334   ROM_LOAD32_BYTE( "orc-1_3.u12",  0x0000002, 0x100000, CRC(9e0a5b06) SHA1(63bbe427713fc966c65dab575dd42cdce6b00874) )
1335   ROM_LOAD32_BYTE( "orc-1_3.u13",  0x0000003, 0x100000, CRC(d602db7e) SHA1(48bc762a83baeb382476619f54631ccbe12d1b2c) )
1336   ROM_LOAD32_BYTE( "offroadc.u14", 0x0400000, 0x100000, CRC(1e41d14b) SHA1(3f7c5fae1f8b82ddd811720837fa298785a8dd27) )
1337   ROM_LOAD32_BYTE( "offroadc.u15", 0x0400001, 0x100000, CRC(654d623d) SHA1(a944b8f8d71b099d7b5bbd7df6effb90afc3aec8) )
1338   ROM_LOAD32_BYTE( "offroadc.u16", 0x0400002, 0x100000, CRC(259774d8) SHA1(90cdf659324b84b3c2c59497cc5611e8f12629a6) )
1339   ROM_LOAD32_BYTE( "offroadc.u17", 0x0400003, 0x100000, CRC(50c61434) SHA1(52bc603101b4f88b7d892af683b7c8358cabbf4a) )
1340   ROM_LOAD32_BYTE( "offroadc.u18", 0x0800000, 0x100000, CRC(015be91c) SHA1(1624537068c6bc5fa6235bf0b0343347c337e8d8) )
1341   ROM_LOAD32_BYTE( "offroadc.u19", 0x0800001, 0x100000, CRC(cfc6b70e) SHA1(8c5ad84c50ca142726db0595153cf04caaabec9c) )
1342   ROM_LOAD32_BYTE( "offroadc.u20", 0x0800002, 0x100000, CRC(f48d6e33) SHA1(8b9c205e24f217ac110cdd82388c056ebbbb09b0) )
1343   ROM_LOAD32_BYTE( "offroadc.u21", 0x0800003, 0x100000, CRC(17794b56) SHA1(8bfd8f5b43056bfe7f62524bb8c3a8564a3a9413) )
1344   ROM_LOAD32_BYTE( "offroadc.u22", 0x0c00000, 0x100000, CRC(f2a6e622) SHA1(a7d7004e95b058124cc02e8073dab8fbed8813c5) )
1345   ROM_LOAD32_BYTE( "offroadc.u23", 0x0c00001, 0x100000, CRC(1cba6e20) SHA1(a7c9c58bfc4d26decb08979d83cccedb27528eb6) )
1346   ROM_LOAD32_BYTE( "offroadc.u24", 0x0c00002, 0x100000, CRC(fd3ce11f) SHA1(78c65267712488784bc6dc14eef98a90494a9553) )
1347   ROM_LOAD32_BYTE( "offroadc.u25", 0x0c00003, 0x100000, CRC(78f8e5db) SHA1(7ec2a5add27d66c43ba5cb7182554321007f5798) )
1348ROM_END
1349
1350
1351ROM_START( offrodc1 ) /* Version 1.10, Mon 08-18-97 */
1352   ROM_REGION16_LE( 0x1000000, REGION_SOUND1, ROMREGION_ERASEFF )   /* sound data */
1353   ROM_LOAD16_BYTE( "offroadc.u2",  0x000000, 0x80000, CRC(69976e9d) SHA1(63c886ac2563c43a10840f49f929f8613cd94de2) )
1354   ROM_LOAD16_BYTE( "offroadc.u3",  0x200000, 0x80000, CRC(2db9b548) SHA1(4f454a3e6a8851b0ef5d325dd28102d57ea11a11) )
1355   ROM_LOAD16_BYTE( "offroadc.u4",  0x400000, 0x80000, CRC(42bdf9d0) SHA1(04add0f0ee7fa61de1913cc0b988345d3d430cde) )
1356   ROM_LOAD16_BYTE( "offroadc.u5",  0x600000, 0x80000, CRC(569cc84b) SHA1(08b917cc41fae6b6a3e9d9461a783d3d2865e72a) )
1357   ROM_LOAD16_BYTE( "offroadc.u6",  0x800000, 0x80000, CRC(0896f679) SHA1(dde39ef17834256909ef2c9fcd5b5fb9939d5178) )
1358   ROM_LOAD16_BYTE( "offroadc.u7",  0xa00000, 0x80000, CRC(fe242d6a) SHA1(8fbac22ed23044841f309ce58c5b1affcdd5d114) )
1359   ROM_LOAD16_BYTE( "offroadc.u8",  0xc00000, 0x80000, CRC(5da13f12) SHA1(2bb5e929e8bc6c70cb4475024a6b0bb07ac25244) )
1360   ROM_LOAD16_BYTE( "offroadc.u9",  0xe00000, 0x80000, CRC(7ad27f69) SHA1(b33665d0593a95b58d529720aae49e90449bf714) )
1361
1362   ROM_REGION32_LE( 0x1000000, REGION_USER1, 0 )
1363   ROM_LOAD32_BYTE( "orc-1_1.u10",  0x0000000, 0x100000, CRC(4729660c) SHA1(0baff6a27015f4eb3fe0a981ecbac33d140e872a) ) /* Version 1.10 program roms */
1364   ROM_LOAD32_BYTE( "orc-1_1.u11",  0x0000001, 0x100000, CRC(6272d013) SHA1(860121184282627ed692e56a0dafee8b64562811) )
1365   ROM_LOAD32_BYTE( "orc-1_1.u12",  0x0000002, 0x100000, CRC(9c8326be) SHA1(55f16d14379f57d08ed84d82f9db1a582bc223a1) )
1366   ROM_LOAD32_BYTE( "orc-1_1.u13",  0x0000003, 0x100000, CRC(53bbc181) SHA1(1ab29a27a216eb09d69a9f3d681865de1a904717) )
1367   ROM_LOAD32_BYTE( "offroadc.u14", 0x0400000, 0x100000, CRC(1e41d14b) SHA1(3f7c5fae1f8b82ddd811720837fa298785a8dd27) )
1368   ROM_LOAD32_BYTE( "offroadc.u15", 0x0400001, 0x100000, CRC(654d623d) SHA1(a944b8f8d71b099d7b5bbd7df6effb90afc3aec8) )
1369   ROM_LOAD32_BYTE( "offroadc.u16", 0x0400002, 0x100000, CRC(259774d8) SHA1(90cdf659324b84b3c2c59497cc5611e8f12629a6) )
1370   ROM_LOAD32_BYTE( "offroadc.u17", 0x0400003, 0x100000, CRC(50c61434) SHA1(52bc603101b4f88b7d892af683b7c8358cabbf4a) )
1371   ROM_LOAD32_BYTE( "offroadc.u18", 0x0800000, 0x100000, CRC(015be91c) SHA1(1624537068c6bc5fa6235bf0b0343347c337e8d8) )
1372   ROM_LOAD32_BYTE( "offroadc.u19", 0x0800001, 0x100000, CRC(cfc6b70e) SHA1(8c5ad84c50ca142726db0595153cf04caaabec9c) )
1373   ROM_LOAD32_BYTE( "offroadc.u20", 0x0800002, 0x100000, CRC(f48d6e33) SHA1(8b9c205e24f217ac110cdd82388c056ebbbb09b0) )
1374   ROM_LOAD32_BYTE( "offroadc.u21", 0x0800003, 0x100000, CRC(17794b56) SHA1(8bfd8f5b43056bfe7f62524bb8c3a8564a3a9413) )
1375   ROM_LOAD32_BYTE( "offroadc.u22", 0x0c00000, 0x100000, CRC(f2a6e622) SHA1(a7d7004e95b058124cc02e8073dab8fbed8813c5) )
1376   ROM_LOAD32_BYTE( "offroadc.u23", 0x0c00001, 0x100000, CRC(1cba6e20) SHA1(a7c9c58bfc4d26decb08979d83cccedb27528eb6) )
1377   ROM_LOAD32_BYTE( "offroadc.u24", 0x0c00002, 0x100000, CRC(fd3ce11f) SHA1(78c65267712488784bc6dc14eef98a90494a9553) )
1378   ROM_LOAD32_BYTE( "offroadc.u25", 0x0c00003, 0x100000, CRC(78f8e5db) SHA1(7ec2a5add27d66c43ba5cb7182554321007f5798) )
1379ROM_END
1380
1381
1382ROM_START( wargods ) /* Boot EPROM Version 1.0, Game Type: 452 (12/11/1995) */
13211383   ROM_REGION16_LE( 0x10000, REGION_SOUND1, 0 )   /* sound data */
13221384   ROM_LOAD16_BYTE( "u2.rom",   0x000000, 0x8000, CRC(bec7d3ae) SHA1(db80aa4a645804a4574b07b9f34dec6b6b64190d) )
13231385
r2241r2242
14491511GAME( 1996, crusnw23, crusnwld, midvunit, crusnwld, crusnwld, ROT0, "Midway", "Cruis'n World (rev L2.3)", GAME_SUPPORTS_SAVE )
14501512GAME( 1996, crusnw20, crusnwld, midvunit, crusnwld, crusnwld, ROT0, "Midway", "Cruis'n World (rev L2.0)", GAME_SUPPORTS_SAVE )
14511513GAME( 1996, crusnw13, crusnwld, midvunit, crusnwld, crusnwld, ROT0, "Midway", "Cruis'n World (rev L1.3)", GAME_SUPPORTS_SAVE )
1452GAME( 1997, offroadc, 0,        midvunit, offroadc, offroadc, ROT0, "Midway", "Off Road Challenge", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
1514GAME( 1997, offroadc, 0,        midvunit, offroadc, offroadc, ROT0, "Midway", "Off Road Challenge (v1.40)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
1515GAME( 1997, offrodc3, offroadc, midvunit, offroadc, offroadc, ROT0, "Midway", "Off Road Challenge (v1.30)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
1516GAME( 1997, offrodc1, offroadc, midvunit, offroadc, offroadc, ROT0, "Midway", "Off Road Challenge (v1.10)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
14531517
14541518GAME( 1995, wargods,  0,        midvplus, wargods,  wargods,  ROT0, "Midway", "War Gods", GAME_SUPPORTS_SAVE )
src/mame/drivers/suna16.c
r2241r2242
5151
5252static WRITE16_HANDLER( suna16_soundlatch_w )
5353{
54   if (ACCESSING_LSB)
54   if (ACCESSING_BITS_0_7)
5555   {
5656      soundlatch_w( machine, 0, data & 0xff );
5757   }
r2241r2242
6161
6262static WRITE16_HANDLER( bssoccer_leds_w )
6363{
64   if (ACCESSING_LSB)
64   if (ACCESSING_BITS_0_7)
6565   {
6666      set_led_status(0, data & 0x01);
6767      set_led_status(1, data & 0x02);
r2241r2242
7575
7676static WRITE16_HANDLER( uballoon_leds_w )
7777{
78   if (ACCESSING_LSB)
78   if (ACCESSING_BITS_0_7)
7979   {
8080      coin_counter_w(0, data & 0x01);
8181      set_led_status(0, data & 0x02);
r2241r2242
8787
8888static WRITE16_HANDLER( bestbest_coin_w )
8989{
90   if (ACCESSING_LSB)
90   if (ACCESSING_BITS_0_7)
9191   {
9292      coin_counter_w(0, data & 0x04);
9393   }
r2241r2242
205205
206206static WRITE16_HANDLER( bestbest_prot_w )
207207{
208   if (ACCESSING_LSB)
208   if (ACCESSING_BITS_0_7)
209209   {
210210      switch (data & 0xff)
211211      {
src/mame/drivers/zaccaria.c
r2241r2242
286286         return 0x40;    /* Jack Rabbit */
287287
288288      case 6:
289         if (Machine->gamedrv == &driver_monymony)
289         if (machine->gamedrv == &driver_monymony)
290290            return 0x70;    /* Money Money */
291291         return 0xa0;    /* Jack Rabbit */
292292
src/mame/drivers/shadfrce.c
r2241r2242
210210
211211static WRITE16_HANDLER ( shadfrce_sound_brt_w )
212212{
213   if (ACCESSING_MSB)
213   if (ACCESSING_BITS_8_15)
214214   {
215215      soundlatch_w(machine,1,data >> 8);
216216      cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE );
src/mame/drivers/yumefuda.c
r2241r2242
204204   AM_RANGE(0xa7fc, 0xa7fc) AM_WRITE(prot_lock_w)
205205   AM_RANGE(0xa7ff, 0xa7ff) AM_WRITE(eeprom_w)
206206   AM_RANGE(0xaf80, 0xafff) AM_READWRITE(custom_ram_r, custom_ram_w) AM_BASE(&cus_ram) /*260d - 2626*/
207   AM_RANGE(0xb000, 0xb0ff) AM_READWRITE(SMH_RAM, paletteram_RRRGGGBB_w) AM_BASE(&paletteram) /*Wrong format*/
208   AM_RANGE(0xc000, 0xc3ff) AM_READWRITE(SMH_RAM, yumefuda_vram_w) AM_BASE(&videoram)
209   AM_RANGE(0xd000, 0xd3ff) AM_READWRITE(SMH_RAM, yumefuda_cram_w) AM_BASE(&colorram)
207   AM_RANGE(0xb000, 0xb0ff) AM_RAM AM_WRITE(paletteram_RRRGGGBB_w) AM_BASE(&paletteram) /*Wrong format*/
208   AM_RANGE(0xc000, 0xc3ff) AM_RAM AM_WRITE(yumefuda_vram_w) AM_BASE(&videoram)
209   AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_WRITE(yumefuda_cram_w) AM_BASE(&colorram)
210210   AM_RANGE(0xe000, 0xffff) AM_RAM
211211ADDRESS_MAP_END
212212
src/mame/drivers/firebeat.c
r2241r2242
593593      //case 0x3c:
594594      {
595595         COMBINE_DATA( &gcu[chip].visible_area );
596         if (ACCESSING_LSW32)
596         if (ACCESSING_BITS_0_15)
597597         {
598598            const device_config *screen = device_list_find_by_index(machine->config->devicelist, VIDEO_SCREEN, chip);
599599
r2241r2242
672672{
673673   UINT32 r = 0;
674674
675   if (!(mem_mask & 0xff000000))
675   if (ACCESSING_BITS_24_31)
676676   {
677677      r |= (readinputport(0) & 0xff) << 24;
678678   }
679   if (!(mem_mask & 0x0000ff00))
679   if (ACCESSING_BITS_8_15)
680680   {
681681      r |= (readinputport(1) & 0xff) << 8;
682682   }
683   if (!(mem_mask & 0x000000ff))
683   if (ACCESSING_BITS_0_7)
684684   {
685685      r |= (readinputport(2) & 0xff);
686686   }
r2241r2242
703703static READ32_HANDLER(flashram_r)
704704{
705705   UINT32 r = 0;
706   if (!(mem_mask & 0xff000000))
706   if (ACCESSING_BITS_24_31)
707707   {
708708      r |= (intelflash_read(0, (offset*4)+0) & 0xff) << 24;
709709   }
710   if (!(mem_mask & 0x00ff0000))
710   if (ACCESSING_BITS_16_23)
711711   {
712712      r |= (intelflash_read(0, (offset*4)+1) & 0xff) << 16;
713713   }
714   if (!(mem_mask & 0x0000ff00))
714   if (ACCESSING_BITS_8_15)
715715   {
716716      r |= (intelflash_read(0, (offset*4)+2) & 0xff) << 8;
717717   }
718   if (!(mem_mask & 0x000000ff))
718   if (ACCESSING_BITS_0_7)
719719   {
720720      r |= (intelflash_read(0, (offset*4)+3) & 0xff) << 0;
721721   }
r2241r2242
724724
725725static WRITE32_HANDLER(flashram_w)
726726{
727   if (!(mem_mask & 0xff000000))
727   if (ACCESSING_BITS_24_31)
728728   {
729729      intelflash_write(0, (offset*4)+0, (data >> 24) & 0xff);
730730   }
731   if (!(mem_mask & 0x00ff0000))
731   if (ACCESSING_BITS_16_23)
732732   {
733733      intelflash_write(0, (offset*4)+1, (data >> 16) & 0xff);
734734   }
735   if (!(mem_mask & 0x0000ff00))
735   if (ACCESSING_BITS_8_15)
736736   {
737737      intelflash_write(0, (offset*4)+2, (data >> 8) & 0xff);
738738   }
739   if (!(mem_mask & 0x000000ff))
739   if (ACCESSING_BITS_0_7)
740740   {
741741      intelflash_write(0, (offset*4)+3, (data >> 0) & 0xff);
742742   }
r2241r2242
757757
758758   offset &= 0x7ffff;
759759
760   if (!(mem_mask & 0xff000000))
760   if (ACCESSING_BITS_24_31)
761761   {
762762      r |= (intelflash_read(chip, (offset*4)+0) & 0xff) << 24;
763763   }
764   if (!(mem_mask & 0x00ff0000))
764   if (ACCESSING_BITS_16_23)
765765   {
766766      r |= (intelflash_read(chip, (offset*4)+1) & 0xff) << 16;
767767   }
768   if (!(mem_mask & 0x0000ff00))
768   if (ACCESSING_BITS_8_15)
769769   {
770770      r |= (intelflash_read(chip, (offset*4)+2) & 0xff) << 8;
771771   }
772   if (!(mem_mask & 0x000000ff))
772   if (ACCESSING_BITS_0_7)
773773   {
774774      r |= (intelflash_read(chip, (offset*4)+3) & 0xff) << 0;
775775   }
r2241r2242
790790
791791   offset &= 0x7ffff;
792792
793   if (!(mem_mask & 0xff000000))
793   if (ACCESSING_BITS_24_31)
794794   {
795795      intelflash_write(chip, (offset*4)+0, (data >> 24) & 0xff);
796796   }
797   if (!(mem_mask & 0x00ff0000))
797   if (ACCESSING_BITS_16_23)
798798   {
799799      intelflash_write(chip, (offset*4)+1, (data >> 16) & 0xff);
800800   }
801   if (!(mem_mask & 0x0000ff00))
801   if (ACCESSING_BITS_8_15)
802802   {
803803      intelflash_write(chip, (offset*4)+2, (data >> 8) & 0xff);
804804   }
805   if (!(mem_mask & 0x000000ff))
805   if (ACCESSING_BITS_0_7)
806806   {
807807      intelflash_write(chip, (offset*4)+3, (data >> 0) & 0xff);
808808   }
r2241r2242
12221222{
12231223   UINT32 r = 0;
12241224
1225   if (!(mem_mask & 0xff000000))
1225   if (ACCESSING_BITS_24_31)
12261226   {
12271227      r |= pc16552d_0_r(machine, (offset*4)+0) << 24;
12281228   }
1229   if (!(mem_mask & 0x00ff0000))
1229   if (ACCESSING_BITS_16_23)
12301230   {
12311231      r |= pc16552d_0_r(machine, (offset*4)+1) << 16;
12321232   }
1233   if (!(mem_mask & 0x0000ff00))
1233   if (ACCESSING_BITS_8_15)
12341234   {
12351235      r |= pc16552d_0_r(machine, (offset*4)+2) << 8;
12361236   }
1237   if (!(mem_mask & 0x000000ff))
1237   if (ACCESSING_BITS_0_7)
12381238   {
12391239      r |= pc16552d_0_r(machine, (offset*4)+3) << 0;
12401240   }
r2241r2242
12441244
12451245static WRITE32_HANDLER( comm_uart_w )
12461246{
1247   if (!(mem_mask & 0xff000000))
1247   if (ACCESSING_BITS_24_31)
12481248   {
12491249      pc16552d_0_w(machine, (offset*4)+0, (data >> 24) & 0xff);
12501250   }
1251   if (!(mem_mask & 0x00ff0000))
1251   if (ACCESSING_BITS_16_23)
12521252   {
12531253      pc16552d_0_w(machine, (offset*4)+1, (data >> 16) & 0xff);
12541254   }
1255   if (!(mem_mask & 0x0000ff00))
1255   if (ACCESSING_BITS_8_15)
12561256   {
12571257      pc16552d_0_w(machine, (offset*4)+2, (data >> 8) & 0xff);
12581258   }
1259   if (!(mem_mask & 0x000000ff))
1259   if (ACCESSING_BITS_0_7)
12601260   {
12611261      pc16552d_0_w(machine, (offset*4)+3, (data >> 0) & 0xff);
12621262   }
r2241r2242
12761276   int reg = offset * 4;
12771277   UINT32 r = 0;
12781278
1279   if (!(mem_mask & 0xff000000))
1279   if (ACCESSING_BITS_24_31)
12801280   {
12811281      r |= rtc65271_r((reg >> 8) & 0x1, (reg & 0xff) + 0) << 24;
12821282   }
1283   if (!(mem_mask & 0x00ff0000))
1283   if (ACCESSING_BITS_16_23)
12841284   {
12851285      r |= rtc65271_r((reg >> 8) & 0x1, (reg & 0xff) + 1) << 16;
12861286   }
1287   if (!(mem_mask & 0x0000ff00))
1287   if (ACCESSING_BITS_8_15)
12881288   {
12891289      r |= rtc65271_r((reg >> 8) & 0x1, (reg & 0xff) + 2) << 8;
12901290   }
1291   if (!(mem_mask & 0x000000ff))
1291   if (ACCESSING_BITS_0_7)
12921292   {
12931293      r |= rtc65271_r((reg >> 8) & 0x1, (reg & 0xff) + 3) << 0;
12941294   }
r2241r2242
12991299static WRITE32_HANDLER( rtc_w )
13001300{
13011301   int reg = offset * 4;
1302   if (!(mem_mask & 0xff000000))
1302   if (ACCESSING_BITS_24_31)
13031303   {
13041304      rtc65271_w((reg >> 8) & 0x1, (reg & 0xff) + 0, (data >> 24) & 0xff);
13051305   }
1306   if (!(mem_mask & 0x00ff0000))
1306   if (ACCESSING_BITS_16_23)
13071307   {
13081308      rtc65271_w((reg >> 8) & 0x1, (reg & 0xff) + 1, (data >> 16) & 0xff);
13091309   }
1310   if (!(mem_mask & 0x0000ff00))
1310   if (ACCESSING_BITS_8_15)
13111311   {
13121312      rtc65271_w((reg >> 8) & 0x1, (reg & 0xff) + 2, (data >> 8) & 0xff);
13131313   }
1314   if (!(mem_mask & 0x000000ff))
1314   if (ACCESSING_BITS_0_7)
13151315   {
13161316      rtc65271_w((reg >> 8) & 0x1, (reg & 0xff) + 3, (data >> 0) & 0xff);
13171317   }
r2241r2242
13251325
13261326//  printf("sound_r: %08X, %08X\n", offset, mem_mask);
13271327
1328   if (!(mem_mask & 0xff000000))   /* External RAM read */
1328   if (ACCESSING_BITS_24_31)   /* External RAM read */
13291329   {
13301330      r |= YMZ280B_data_0_r(machine, offset) << 24;
13311331   }
1332   if (!(mem_mask & 0x00ff0000))
1332   if (ACCESSING_BITS_16_23)
13331333   {
13341334      r |= YMZ280B_status_0_r(machine, offset) << 16;
13351335   }
r2241r2242
13401340static WRITE32_HANDLER( sound_w )
13411341{
13421342//  printf("sound_w: %08X, %08X, %08X\n", offset, data, mem_mask);
1343   if (!(mem_mask & 0xff000000))
1343   if (ACCESSING_BITS_24_31)
13441344   {
13451345      YMZ280B_register_0_w(machine, offset, (data >> 24) & 0xff);
13461346   }
1347   if (!(mem_mask & 0x00ff0000))
1347   if (ACCESSING_BITS_16_23)
13481348   {
13491349      YMZ280B_data_0_w(machine, offset, (data >> 16) & 0xff);
13501350   }
r2241r2242
13971397{
13981398   UINT32 r = 0;
13991399
1400   if (!(mem_mask & 0xff000000))
1400   if (ACCESSING_BITS_24_31)
14011401   {
14021402      r |= pc16552d_1_r(machine, offset >> 6) << 24;
14031403   }
r2241r2242
14071407
14081408static WRITE32_HANDLER( midi_uart_w )
14091409{
1410   if (!(mem_mask & 0xff000000))
1410   if (ACCESSING_BITS_24_31)
14111411   {
14121412      pc16552d_1_w(machine, offset >> 6, (data >> 24) & 0xff);
14131413   }
r2241r2242
15181518{
15191519   UINT32 r = 0;
15201520
1521   if (!(mem_mask & 0xff000000))
1521   if (ACCESSING_BITS_24_31)
15221522   {
15231523      r |= (~extend_board_irq_active) << 24;
15241524   }
r2241r2242
15301530{
15311531//  printf("extend_board_irq_w: %08X, %08X, %08X\n", data, offset, mem_mask);
15321532
1533   if (!(mem_mask & 0xff000000))
1533   if (ACCESSING_BITS_24_31)
15341534   {
15351535      extend_board_irq_active &= ~((data >> 24) & 0xff);
15361536
r2241r2242
15431543static WRITE32_HANDLER( lamp_output_w )
15441544{
15451545   // -------- -------- -------- xxxxxxxx   Status LEDs (active low)
1546   if (!(mem_mask & 0x000000ff))
1546   if (ACCESSING_BITS_0_7)
15471547   {
15481548      output_set_value("status_led_0", (data & 0x01) ? 0 : 1);
15491549      output_set_value("status_led_1", (data & 0x02) ? 0 : 1);
r2241r2242
15621562{
15631563   lamp_output_w(machine, offset, data, mem_mask);
15641564
1565   if (!(mem_mask & 0xff000000))
1565   if (ACCESSING_BITS_24_31)
15661566   {
15671567      output_set_value("door_lamp",   (data & 0x10000000) ? 1 : 0);
15681568      output_set_value("start1p",      (data & 0x01000000) ? 1 : 0);
15691569      output_set_value("start2p",      (data & 0x02000000) ? 1 : 0);
15701570   }
1571   if (!(mem_mask & 0x0000ff00))
1571   if (ACCESSING_BITS_8_15)
15721572   {
15731573      output_set_value("lamp1",      (data & 0x00000100) ? 1 : 0);
15741574      output_set_value("lamp2",      (data & 0x00000200) ? 1 : 0);
r2241r2242
15951595   // 0x00020000 Stage LED 5
15961596   // 0x00040000 Stage LED 6
15971597   // 0x00080000 Stage LED 7
1598   if (!(mem_mask & 0x0000ff00))
1598   if (ACCESSING_BITS_8_15)
15991599   {
16001600      output_set_value("left",         (data & 0x00000100) ? 1 : 0);
16011601      output_set_value("right",         (data & 0x00000200) ? 1 : 0);
r2241r2242
16031603      output_set_value("ok",            (data & 0x00000800) ? 1 : 0);
16041604      output_set_value("slim",         (data & 0x00008000) ? 1 : 0);
16051605   }
1606   if (!(mem_mask & 0xff000000))
1606   if (ACCESSING_BITS_24_31)
16071607   {
16081608      output_set_value("stage_led_0",      (data & 0x01000000) ? 1 : 0);
16091609      output_set_value("stage_led_1",      (data & 0x02000000) ? 1 : 0);
16101610      output_set_value("stage_led_2",      (data & 0x04000000) ? 1 : 0);
16111611      output_set_value("stage_led_3",      (data & 0x08000000) ? 1 : 0);
16121612   }
1613   if (!(mem_mask & 0x00ff0000))
1613   if (ACCESSING_BITS_16_23)
16141614   {
16151615      output_set_value("stage_led_4",      (data & 0x00010000) ? 1 : 0);
16161616      output_set_value("stage_led_5",      (data & 0x00020000) ? 1 : 0);
r2241r2242
16371637   // 0x00000002 Top LED 5
16381638   // 0x00000004 Top LED 6
16391639   // 0x00000008 Top LED 7
1640   if (!(mem_mask & 0x00ff0000))
1640   if (ACCESSING_BITS_16_23)
16411641   {
16421642      output_set_value("top_led_0",      (data & 0x00010000) ? 1 : 0);
16431643      output_set_value("top_led_1",      (data & 0x00020000) ? 1 : 0);
16441644      output_set_value("top_led_2",      (data & 0x00040000) ? 1 : 0);
16451645      output_set_value("top_led_3",      (data & 0x00080000) ? 1 : 0);
16461646   }
1647   if (!(mem_mask & 0x000000ff))
1647   if (ACCESSING_BITS_0_7)
16481648   {
16491649      output_set_value("top_led_4",      (data & 0x00000001) ? 1 : 0);
16501650      output_set_value("top_led_5",      (data & 0x00000002) ? 1 : 0);
r2241r2242
16671667   // 0x00040000 Lamp 1
16681668   // 0x00100000 Lamp 2
16691669   // 0x00400000 Lamp 3
1670   if (!(mem_mask & 0x00ff0000))
1670   if (ACCESSING_BITS_16_23)
16711671   {
16721672      output_set_value("lamp_0",         (data & 0x00010000) ? 1 : 0);
16731673      output_set_value("lamp_1",         (data & 0x00040000) ? 1 : 0);
r2241r2242
16841684{
16851685   UINT32 r = 0;
16861686
1687   if (!(mem_mask & 0xff000000))
1687   if (ACCESSING_BITS_24_31)
16881688   {
16891689      r |= spu_shared_ram[(offset * 4) + 0] << 24;
16901690   }
1691   if (!(mem_mask & 0x00ff0000))
1691   if (ACCESSING_BITS_16_23)
16921692   {
16931693      r |= spu_shared_ram[(offset * 4) + 1] << 16;
16941694   }
1695   if (!(mem_mask & 0x0000ff0000))
1695   if (ACCESSING_BITS_8_15)
16961696   {
16971697      r |= spu_shared_ram[(offset * 4) + 2] <<  8;
16981698   }
1699   if (!(mem_mask & 0xff000000))
1699   if (ACCESSING_BITS_0_7)
17001700   {
17011701      r |= spu_shared_ram[(offset * 4) + 3] <<  0;
17021702   }
r2241r2242
17061706
17071707static WRITE32_HANDLER(ppc_spu_share_w)
17081708{
1709   if (!(mem_mask & 0xff000000))
1709   if (ACCESSING_BITS_24_31)
17101710   {
17111711      spu_shared_ram[(offset * 4) + 0] = (data >> 24) & 0xff;
17121712   }
1713   if (!(mem_mask & 0x00ff0000))
1713   if (ACCESSING_BITS_16_23)
17141714   {
17151715      spu_shared_ram[(offset * 4) + 1] = (data >> 16) & 0xff;
17161716   }
1717   if (!(mem_mask & 0x0000ff00))
1717   if (ACCESSING_BITS_8_15)
17181718   {
17191719      spu_shared_ram[(offset * 4) + 2] = (data >>  8) & 0xff;
17201720   }
1721   if (!(mem_mask & 0x000000ff))
1721   if (ACCESSING_BITS_0_7)
17221722   {
17231723      spu_shared_ram[(offset * 4) + 3] = (data >>  0) & 0xff;
17241724   }
r2241r2242
20052005   MDRV_SCREEN_ADD("main", RASTER)
20062006   MDRV_SCREEN_REFRESH_RATE(60)
20072007   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
2008   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
2008   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
20092009   MDRV_SCREEN_SIZE(640, 480)
20102010   MDRV_SCREEN_VISIBLE_AREA(0, 639, 0, 479)
20112011
20122012   MDRV_PALETTE_LENGTH(32768)
20132013
2014   MDRV_PALETTE_INIT(RRRRR_GGGGG_BBBBB)
20142015   MDRV_VIDEO_START(firebeat)
20152016   MDRV_VIDEO_UPDATE(firebeat)
20162017
r2241r2242
20412042
20422043    /* video hardware */
20432044   MDRV_PALETTE_LENGTH(32768)
2045   MDRV_PALETTE_INIT(RRRRR_GGGGG_BBBBB)
20442046
20452047   MDRV_SCREEN_ADD("left", RASTER)
2046   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
2048   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
20472049   MDRV_SCREEN_REFRESH_RATE(60)
20482050   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
20492051   MDRV_SCREEN_SIZE(640, 480)
20502052   MDRV_SCREEN_VISIBLE_AREA(0, 639, 0, 479)
20512053
20522054   MDRV_SCREEN_ADD("right", RASTER)
2053   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
2055   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
20542056   MDRV_SCREEN_REFRESH_RATE(60)
20552057   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
20562058   MDRV_SCREEN_SIZE(640, 480)
src/mame/drivers/namcos23.c
r2241r2242
528528{
529529   COMBINE_DATA(&namcos23_charram[offset]   );
530530
531   decodechar( Machine->gfx[0],offset/32,(UINT8 *)namcos23_charram );
531   decodechar( machine->gfx[0],offset/32,(UINT8 *)namcos23_charram );
532532
533533   tilemap_mark_all_tiles_dirty(bgtilemap);
534534}
r2241r2242
608608      if (data)
609609      {
610610         logerror("S23: booting H8/3002\n");
611         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
611         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
612612      }
613613      else
614614      {
615615         logerror("S23: stopping H8/3002\n");
616         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
616         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
617617      }
618618   }
619619}
r2241r2242
701701   mame_system_time systime;
702702   static const int weekday[7] = { 7, 1, 2, 3, 4, 5, 6 };
703703
704   mame_get_current_datetime(Machine, &systime);
704   mame_get_current_datetime(machine, &systime);
705705
706706   switch (s23_rtcstate)
707707   {
src/mame/drivers/inufuku.c
r2241r2242
103103
104104static WRITE16_HANDLER( inufuku_soundcommand_w )
105105{
106   if (ACCESSING_LSB) {
106   if (ACCESSING_BITS_0_7) {
107107
108108      /* hack... sound doesn't work otherwise */
109109      if (data == 0x08) return;
src/mame/drivers/atarisy2.c
r2241r2242
301301static WRITE16_HANDLER( int1_ack_w )
302302{
303303   /* reset sound CPU */
304   if (ACCESSING_LSB)
304   if (ACCESSING_BITS_0_7)
305305      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
306306}
307307
r2241r2242
314314
315315static WRITE16_HANDLER( int_enable_w )
316316{
317   if (offset == 0 && ACCESSING_LSB)
317   if (offset == 0 && ACCESSING_BITS_0_7)
318318      timer_call_after_resynch(NULL, data, delayed_int_enable_w);
319319}
320320
r2241r2242
906906static INPUT_PORTS_START( ssprint )
907907   PORT_INCLUDE( paperboy )
908908
909   PORT_MODIFY("1840")
910   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
911   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
912   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN3 )
913
909914   PORT_MODIFY("1800")
910915   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
911916   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START3 )
r2241r2242
965970
966971   PORT_MODIFY("1840")
967972   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
973   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
974   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
968975
969976   PORT_MODIFY("1800")
970977   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
r2241r2242
988995static INPUT_PORTS_START( apb )
989996   PORT_INCLUDE( paperboy )
990997
998   PORT_MODIFY("1840")
999   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_SERVICE1 )
1000
9911001   PORT_MODIFY("1800")
9921002   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_BUTTON2 ) PORT_PLAYER(1)
9931003   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNUSED )
src/mame/drivers/cubocd32.c
r2241r2242
7272
7373static WRITE32_HANDLER( aga_overlay_w )
7474{
75   if ((mem_mask & 0x00ff0000) != 0x00ff0000)
75   if (ACCESSING_BITS_16_23)
7676   {
7777      data = (data >> 16) & 1;
7878
src/mame/drivers/ghosteo.c
r2241r2242
490490   MDRV_SCREEN_ADD("main", RASTER)
491491   MDRV_SCREEN_REFRESH_RATE(60)
492492   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
493   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
493   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
494494   MDRV_SCREEN_SIZE(1024, 1024)
495495   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
496496
src/mame/drivers/turbo.c
r2241r2242
145145**************************************************************************/
146146
147147#include "driver.h"
148#include "deprecat.h"
149148#include "machine/8255ppi.h"
150149#include "turbo.h"
151150#include "machine/segacrpt.h"
r2241r2242
212211static WRITE8_HANDLER( turbo_ppi0a_w )
213212{
214213   /* bit0-7 = 0PA0-7 */
215   turbo_state *state = Machine->driver_data;
214   turbo_state *state = machine->driver_data;
216215   state->turbo_opa = data;
217216}
218217
r2241r2242
220219static WRITE8_HANDLER( turbo_ppi0b_w )
221220{
222221   /* bit0-7 = 0PB0-7 */
223   turbo_state *state = Machine->driver_data;
222   turbo_state *state = machine->driver_data;
224223   state->turbo_opb = data;
225224}
226225
r2241r2242
228227static WRITE8_HANDLER( turbo_ppi0c_w )
229228{
230229   /* bit0-7 = 0PC0-7 */
231   turbo_state *state = Machine->driver_data;
230   turbo_state *state = machine->driver_data;
232231   state->turbo_opc = data;
233232}
234233
r2241r2242
236235static WRITE8_HANDLER( turbo_ppi1a_w )
237236{
238237   /* bit0-7 = 1PA0-7 */
239   turbo_state *state = Machine->driver_data;
238   turbo_state *state = machine->driver_data;
240239   state->turbo_ipa = data;
241240}
242241
r2241r2242
244243static WRITE8_HANDLER( turbo_ppi1b_w )
245244{
246245   /* bit0-7 = 1PB0-7 */
247   turbo_state *state = Machine->driver_data;
246   turbo_state *state = machine->driver_data;
248247   state->turbo_ipb = data;
249248}
250249
r2241r2242
252251static WRITE8_HANDLER( turbo_ppi1c_w )
253252{
254253   /* bit0-7 = 1PC0-7 */
255   turbo_state *state = Machine->driver_data;
254   turbo_state *state = machine->driver_data;
256255   state->turbo_ipc = data;
257256}
258257
r2241r2242
262261   /* bit 0-3 = PLA0-3 */
263262   /* bit 4-6 = COL0-2 */
264263   /* bit   7 = n/c */
265   turbo_state *state = Machine->driver_data;
264   turbo_state *state = machine->driver_data;
266265   state->turbo_fbpla = data & 0x0f;
267266   state->turbo_fbcol = (data >> 4) & 0x07;
268267}
r2241r2242
285284{
286285   /* bit 0-3 = PLY0-3 */
287286   /* bit 4-7 = n/c */
288   turbo_state *state = Machine->driver_data;
287   turbo_state *state = machine->driver_data;
289288   state->subroc3d_ply = data & 0x0f;
290289}
291290
r2241r2242
293292static WRITE8_HANDLER( subroc3d_ppi0c_w )
294293{
295294   /* bit 0-3 = COL0-3 */
296   turbo_state *state = Machine->driver_data;
295   turbo_state *state = machine->driver_data;
297296   state->subroc3d_col = data & 0x0f;
298297}
299298
r2241r2242
305304   /* bit 2 = STLA (START LAMP) */
306305   /* bit 3 = NOUSE (n/c) */
307306   /* bit 4 = FLIP (not really flip, just offset) */
308   turbo_state *state = Machine->driver_data;
307   turbo_state *state = machine->driver_data;
309308   coin_counter_w(0, data & 0x01);
310309   coin_counter_w(1, data & 0x02);
311310   set_led_status(0, data & 0x04);
r2241r2242
323322static WRITE8_HANDLER( buckrog_ppi0a_w )
324323{
325324   /* bit 0-7 = data to be read on the /IOREQ */
326   turbo_state *state = Machine->driver_data;
325   turbo_state *state = machine->driver_data;
327326   state->buckrog_command = data;
328327}
329328
r2241r2242
332331{
333332   /* bit 0-5 = MOV0-5 */
334333   /* bit 6-7 = n/c */
335   turbo_state *state = Machine->driver_data;
334   turbo_state *state = machine->driver_data;
336335   state->buckrog_mov = data & 0x3f;
337336}
338337
r2241r2242
343342   /* bit 3-5 = n/c */
344343   /* bit   6 = /IOREQ on the 2nd CPU */
345344   /* bit   7 = /INT on the 2nd CPU */
346   turbo_state *state = Machine->driver_data;
345   turbo_state *state = machine->driver_data;
347346   state->buckrog_fchg = data & 0x07;
348   cpunum_set_input_line(Machine, 1, 0, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
347   cpunum_set_input_line(machine, 1, 0, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
349348}
350349
351350
r2241r2242
357356   /* bit   5 = COM2 (COIN METER 2) */
358357   /* bit   6 = STLA (START LAMP) */
359358   /* bit   7 = NOUSE (BODY SONIC) */
360   turbo_state *state = Machine->driver_data;
359   turbo_state *state = machine->driver_data;
361360   state->buckrog_obch = data & 0x07;
362361   coin_counter_w(0, data & 0x10);
363362   coin_counter_w(1, data & 0x20);
r2241r2242
399398
400399static READ8_HANDLER( turbo_8279_r )
401400{
402   turbo_state *state = Machine->driver_data;
401   turbo_state *state = machine->driver_data;
403402   i8279_state *chip = &state->i8279;
404403   UINT8 result = 0xff;
405404   UINT8 addr;
r2241r2242
440439
441440static WRITE8_HANDLER( turbo_8279_w )
442441{
443   turbo_state *state = Machine->driver_data;
442   turbo_state *state = machine->driver_data;
444443   i8279_state *chip = &state->i8279;
445444   UINT8 addr;
446445
r2241r2242
544543
545544static READ8_HANDLER( turbo_collision_r )
546545{
547   turbo_state *state = Machine->driver_data;
546   turbo_state *state = machine->driver_data;
548547   video_screen_update_partial(machine->primary_screen, video_screen_get_vpos(machine->primary_screen));
549548   return readinputport(3) | (state->turbo_collision & 15);
550549}
r2241r2242
552551
553552static WRITE8_HANDLER( turbo_collision_clear_w )
554553{
555   turbo_state *state = Machine->driver_data;
554   turbo_state *state = machine->driver_data;
556555   video_screen_update_partial(machine->primary_screen, video_screen_get_vpos(machine->primary_screen));
557556   state->turbo_collision = 0;
558557}
r2241r2242
560559
561560static READ8_HANDLER( turbo_analog_r )
562561{
563   turbo_state *state = Machine->driver_data;
562   turbo_state *state = machine->driver_data;
564563   return readinputport(4) - state->turbo_last_analog;
565564}
566565
567566
568567static WRITE8_HANDLER( turbo_analog_reset_w )
569568{
570   turbo_state *state = Machine->driver_data;
569   turbo_state *state = machine->driver_data;
571570   state->turbo_last_analog = readinputport(4);
572571}
573572
r2241r2242
599598static READ8_HANDLER( buckrog_cpu2_command_r )
600599{
601600   /* assert ACK */
602   turbo_state *state = Machine->driver_data;
601   turbo_state *state = machine->driver_data;
603602   ppi8255_set_portC(0, 0x00);
604603   return state->buckrog_command;
605604}
src/mame/drivers/seta.c
r2241r2242
14761476
14771477static WRITE16_HANDLER( sharedram_68000_w )
14781478{
1479   if (ACCESSING_LSB)   sharedram[offset] = data & 0xff;
1479   if (ACCESSING_BITS_0_7)   sharedram[offset] = data & 0xff;
14801480}
14811481
14821482
r2241r2242
14941494   switch(offset)
14951495   {
14961496      case 0/2:   // bit 0: reset sub cpu?
1497         if (ACCESSING_LSB)
1497         if (ACCESSING_BITS_0_7)
14981498         {
14991499            if ( !(old_data&1) && (data&1) )
15001500               cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE);
r2241r2242
15061506         break;
15071507
15081508      case 4/2:   // not sure
1509         if (ACCESSING_LSB)   soundlatch_w(machine, 0, data & 0xff);
1509         if (ACCESSING_BITS_0_7)   soundlatch_w(machine, 0, data & 0xff);
15101510         break;
15111511
15121512      case 6/2:   // not sure
1513         if (ACCESSING_LSB)   soundlatch2_w(machine, 0, data & 0xff);
1513         if (ACCESSING_BITS_0_7)   soundlatch2_w(machine, 0, data & 0xff);
15141514         break;
15151515   }
15161516
r2241r2242
16771677
16781678static WRITE16_HANDLER( calibr50_soundlatch_w )
16791679{
1680   if (ACCESSING_LSB)
1680   if (ACCESSING_BITS_0_7)
16811681   {
16821682      soundlatch_word_w(machine,0,data,mem_mask);
16831683      cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
r2241r2242
17621762{
17631763   static int old_tiles_offset = 0;
17641764
1765   if (ACCESSING_LSB)
1765   if (ACCESSING_BITS_0_7)
17661766   {
17671767      seta_tiles_offset = (data & 0x10) ? 0x4000: 0;
17681768      if (old_tiles_offset != seta_tiles_offset)   tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r2241r2242
25892589
25902590static WRITE16_HANDLER( kiwame_nvram_w )
25912591{
2592   if (ACCESSING_LSB)   COMBINE_DATA( &kiwame_nvram[offset] );
2592   if (ACCESSING_BITS_0_7)   COMBINE_DATA( &kiwame_nvram[offset] );
25932593}
25942594
25952595static READ16_HANDLER( kiwame_input_r )
r2241r2242
27602760
27612761static WRITE16_HANDLER( utoukond_soundlatch_w )
27622762{
2763   if (ACCESSING_LSB)
2763   if (ACCESSING_BITS_0_7)
27642764   {
27652765      cpunum_set_input_line(machine, 1,0,HOLD_LINE);
27662766      soundlatch_w(machine,0,data & 0xff);
r2241r2242
30693069                            Crazy Fight
30703070***************************************************************************/
30713071
3072static WRITE16_HANDLER( YM3812_control_port_0_lsb_w )   {   if (ACCESSING_LSB)   YM3812_control_port_0_w(machine, 0, data & 0xff);   }
3073static WRITE16_HANDLER( YM3812_write_port_0_lsb_w )      {   if (ACCESSING_LSB)   YM3812_write_port_0_w(machine, 0, data & 0xff);      }
3072static WRITE16_HANDLER( YM3812_control_port_0_lsb_w )   {   if (ACCESSING_BITS_0_7)   YM3812_control_port_0_w(machine, 0, data & 0xff);   }
3073static WRITE16_HANDLER( YM3812_write_port_0_lsb_w )      {   if (ACCESSING_BITS_0_7)   YM3812_write_port_0_w(machine, 0, data & 0xff);      }
30743074
30753075static ADDRESS_MAP_START( crazyfgt_map, ADDRESS_SPACE_PROGRAM, 16 )
30763076   AM_RANGE(0x000000, 0x07ffff) AM_ROM
r2241r2242
92789278static WRITE16_HANDLER( twineagl_200100_w )
92799279{
92809280logerror("%04x: twineagl_200100_w %d = %02x\n",activecpu_get_pc(),offset,data);
9281   if (ACCESSING_LSB)
9281   if (ACCESSING_BITS_0_7)
92829282      xram[offset] = data & 0xff;
92839283}
92849284
src/mame/drivers/trvquest.c
r2241r2242
3535*/
3636
3737#include "driver.h"
38#include "deprecat.h"
3938#include "machine/6522via.h"
4039#include "sound/ay8910.h"
4140#include "gameplan.h"
4241
4342static READ8_HANDLER( trvquest_question_r )
4443{
45   gameplan_state *state = Machine->driver_data;
44   gameplan_state *state = machine->driver_data;
4645
4746   return memory_region(REGION_USER1)[*state->trvquest_question * 0x2000 + offset];
4847}
src/mame/drivers/plygonet.c
r2241r2242
101101
102102static READ32_HANDLER( polygonet_eeprom_r )
103103{
104   if (ACCESSING_LSW32)
104   if (ACCESSING_BITS_0_15)
105105   {
106106      return 0x0200 | (EEPROM_read_bit()<<8);
107107   }
r2241r2242
120120
121121static WRITE32_HANDLER( polygonet_eeprom_w )
122122{
123   if (ACCESSING_MSB32)
123   if (ACCESSING_BITS_24_31)
124124   {
125125      EEPROM_write_bit((data & 0x01000000) ? ASSERT_LINE : CLEAR_LINE);
126126      EEPROM_set_cs_line((data & 0x02000000) ? CLEAR_LINE : ASSERT_LINE);
r2241r2242
175175
176176static WRITE32_HANDLER( sound_w )
177177{
178   if (ACCESSING_MSB)
178   if (ACCESSING_BITS_8_15)
179179   {
180180      soundlatch_w(machine, 0, (data>>8)&0xff);
181181   }
src/mame/drivers/naomi.c
r2241r2242
574574   UINT8 *ROM = (UINT8 *)memory_region(REGION_USER1);
575575
576576   // ROM_DATA
577   if ((offset == 1) && ((mem_mask & 0xffff) == 0))
577   if ((offset == 1) && ACCESSING_BITS_0_15)
578578   {
579579      UINT64 ret;
580580
r2241r2242
584584
585585      return ret;
586586   }
587   else if ((offset == 15) && ((mem_mask & U64(0xffff00000000)) == 0)) // boardid read
587   else if ((offset == 15) && ACCESSING_BITS_32_47) // boardid read
588588   {
589589      UINT64 ret;
590590
r2241r2242
602602
603603static WRITE64_HANDLER( naomi_rom_board_w )
604604{
605   if ((offset == 1) && ((mem_mask & U64(0xffff00000000)) == 0))
605   if ((offset == 1) && ACCESSING_BITS_32_47)
606606   {
607607      // DMA_OFFSETH
608608      dma_offset &= 0xffff;
609609      dma_offset |= (data >> 16) & 0x1fff0000;
610610   }
611   else if ((offset == 2) && ((mem_mask & U64(0xffff)) == 0))
611   else if ((offset == 2) && ACCESSING_BITS_0_15)
612612   {
613613      // DMA_OFFSETL
614614      dma_offset &= 0xffff0000;
615615      dma_offset |= (data & 0xffff);
616616   }
617   else if ((offset == 0) && ((mem_mask & U64(0xffff)) == 0))
617   else if ((offset == 0) && ACCESSING_BITS_0_15)
618618   {
619619      // ROM_OFFSETH
620620      rom_offset &= 0xffff;
621621      rom_offset |= (data & 0x1fff)<<16;
622622   }
623   else if ((offset == 0) && ((mem_mask & U64(0xffff00000000)) == 0))
623   else if ((offset == 0) && ACCESSING_BITS_32_47)
624624   {
625625      // ROM_OFFSETL
626626      rom_offset &= 0xffff0000;
627627      rom_offset |= (data & 0xffff);
628628   }
629   else if ((offset == 15) && ((mem_mask & 0xffff) == 0))
629   else if ((offset == 15) && ACCESSING_BITS_0_15)
630630   {
631631      // NAOMI_BOARDID_WRITE
632632      x76f100_cs_write(0, (data >> 2) & 1 );
r2241r2242
634634      x76f100_scl_write(0, (data >> 1) & 1 );
635635      x76f100_sda_write(0, (data >> 0) & 1 );
636636   }
637   else if ((offset == 2) && ((mem_mask & U64(0xffffffff00000000)) == 0))
637   else if ((offset == 2) && ACCESSING_BITS_32_63)
638638   {
639639      // NAOMI_DMA_COUNT
640640      dma_count = data >> 32;
src/mame/drivers/nemesis.c
r2241r2242
101101
102102static WRITE16_HANDLER( salamand_soundlatch_word_w )
103103{
104   if(ACCESSING_LSB) {
104   if(ACCESSING_BITS_0_7) {
105105      soundlatch_w(machine,offset,data & 0xff);
106106      cpunum_set_input_line(machine, 1,0,HOLD_LINE);
107107   }
r2241r2242
141141
142142static WRITE16_HANDLER( gx400_irq1_enable_word_w )
143143{
144   if (ACCESSING_LSB)
144   if (ACCESSING_BITS_0_7)
145145      irq1_on = data & 0x0001;
146146/*  else
147147logerror("irq1en = %08x\n",data);*/
r2241r2242
149149
150150static WRITE16_HANDLER( gx400_irq2_enable_word_w )
151151{
152   if (ACCESSING_LSB)
152   if (ACCESSING_BITS_0_7)
153153      irq2_on = data & 0x0001;
154154/*  else
155155logerror("irq2en = %08x\n",data);*/
r2241r2242
157157
158158static WRITE16_HANDLER( gx400_irq4_enable_word_w )
159159{
160   if (ACCESSING_MSB)
160   if (ACCESSING_BITS_8_15)
161161      irq4_on = data & 0x0100;
162162/*  else
163163logerror("irq4en = %08x\n",data);*/
r2241r2242
172172
173173static WRITE16_HANDLER( gx400_sharedram_word_w )
174174{
175   if(ACCESSING_LSB)
175   if(ACCESSING_BITS_0_7)
176176      gx400_shared_ram[offset] = data;
177177}
178178
r2241r2242
192192
193193static WRITE16_HANDLER( nemesis_irq_enable_word_w )
194194{
195   if(ACCESSING_LSB)
195   if(ACCESSING_BITS_0_7)
196196      irq_on = data & 0xff;
197197}
198198
199199static WRITE16_HANDLER( konamigt_irq_enable_word_w )
200200{
201   if(ACCESSING_LSB)
201   if(ACCESSING_BITS_0_7)
202202      irq_on = data & 0xff;
203203}
204204
205205static WRITE16_HANDLER( konamigt_irq2_enable_word_w )
206206{
207   if(ACCESSING_LSB)
207   if(ACCESSING_BITS_0_7)
208208      irq2_on = data & 0xff;
209209}
210210
r2241r2242
238238
239239static WRITE16_HANDLER( selected_ip_w )
240240{
241   if (ACCESSING_LSB) hcrash_selected_ip = data & 0xff;   // latch the value
241   if (ACCESSING_BITS_0_7) hcrash_selected_ip = data & 0xff;   // latch the value
242242}
243243
244244static READ16_HANDLER( selected_ip_r )
r2241r2242
256256
257257static WRITE16_HANDLER( nemesis_soundlatch_word_w )
258258{
259   if(ACCESSING_LSB) {
259   if(ACCESSING_BITS_0_7) {
260260      soundlatch_w(machine,offset,data & 0xff);
261261   }
262262}
src/mame/drivers/magmax.c
r2241r2242
3131
3232static WRITE16_HANDLER( magmax_sound_w )
3333{
34   if (ACCESSING_LSB)
34   if (ACCESSING_BITS_0_7)
3535   {
3636      sound_latch = (data & 0xff) << 1;
3737      cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE);
src/mame/drivers/powerbal.c
r2241r2242
6868
6969static WRITE16_HANDLER( magicstk_coin_eeprom_w )
7070{
71   if (ACCESSING_LSB)
71   if (ACCESSING_BITS_0_7)
7272   {
7373      coin_counter_w(0,data & 0x20);
7474
src/mame/drivers/stv.c
r2241r2242
538538{
539539   mame_system_time systime;
540540
541   mame_get_base_datetime(Machine, &systime);
541   mame_get_base_datetime(machine, &systime);
542542
543543//  if(LOG_SMPC) logerror ("8-bit SMPC Write to Offset %02x with Data %02x\n", offset, data);
544544   smpc_ram[offset] = data;
r2241r2242
630630            if(LOG_SMPC) logerror ("SMPC: Slave OFF\n");
631631            smpc_ram[0x5f]=0x03;
632632            stv_enable_slave_sh2 = 0;
633            cpu_trigger(Machine, 1000);
633            cpu_trigger(machine, 1000);
634634            cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
635635            break;
636636         case 0x06:
r2241r2242
769769   /* registers are all byte accesses, convert here */
770770   offset = offset << 2; // multiply offset by 4
771771
772   if (!(mem_mask & 0xff000000))   { byte = 0; readdata = stv_SMPC_r8(offset+byte) << 24; }
773   if (!(mem_mask & 0x00ff0000))   { byte = 1; readdata = stv_SMPC_r8(offset+byte) << 16; }
774   if (!(mem_mask & 0x0000ff00))   { byte = 2; readdata = stv_SMPC_r8(offset+byte) << 8;  }
775   if (!(mem_mask & 0x000000ff))   { byte = 3; readdata = stv_SMPC_r8(offset+byte) << 0;  }
772   if (ACCESSING_BITS_24_31)   { byte = 0; readdata = stv_SMPC_r8(offset+byte) << 24; }
773   if (ACCESSING_BITS_16_23)   { byte = 1; readdata = stv_SMPC_r8(offset+byte) << 16; }
774   if (ACCESSING_BITS_8_15)   { byte = 2; readdata = stv_SMPC_r8(offset+byte) << 8;  }
775   if (ACCESSING_BITS_0_7)   { byte = 3; readdata = stv_SMPC_r8(offset+byte) << 0;  }
776776
777777   return readdata;
778778}
r2241r2242
785785   /* registers are all byte accesses, convert here so we can use the data more easily later */
786786   offset = offset << 2; // multiply offset by 4
787787
788   if (!(mem_mask & 0xff000000))   { byte = 0; writedata = data >> 24; }
789   if (!(mem_mask & 0x00ff0000))   { byte = 1; writedata = data >> 16; }
790   if (!(mem_mask & 0x0000ff00))   { byte = 2; writedata = data >> 8;  }
791   if (!(mem_mask & 0x000000ff))   { byte = 3; writedata = data >> 0;  }
788   if (ACCESSING_BITS_24_31)   { byte = 0; writedata = data >> 24; }
789   if (ACCESSING_BITS_16_23)   { byte = 1; writedata = data >> 16; }
790   if (ACCESSING_BITS_8_15)   { byte = 2; writedata = data >> 8;  }
791   if (ACCESSING_BITS_0_7)   { byte = 3; writedata = data >> 0;  }
792792
793793   writedata &= 0xff;
794794
795795   offset += byte;
796796
797   stv_SMPC_w8(Machine, offset,writedata);
797   stv_SMPC_w8(machine, offset,writedata);
798798}
799799
800800
r2241r2242
942942
943943static UINT8 port_sel,mux_data;
944944
945#define HI_WORD_ACCESS (mem_mask & 0x00ff0000) == 0
946#define LO_WORD_ACCESS (mem_mask & 0x000000ff) == 0
947
948945static READ32_HANDLER ( stv_io_r32 )
949946{
950947   static int i= -1;
r2241r2242
974971         }
975972         case 0x47:
976973         {
977            if ( strcmp(Machine->gamedrv->name,"critcrsh") == 0 )
974            if ( strcmp(machine->gamedrv->name,"critcrsh") == 0 )
978975            {
979976               int data1 = 0, data2 = 0;
980977
r2241r2242
995992         return (readinputport(2) << 16) | (readinputport(3));
996993      }
997994      case 1:
998      if ( strcmp(Machine->gamedrv->name,"critcrsh") == 0 )
995      if ( strcmp(machine->gamedrv->name,"critcrsh") == 0 )
999996      {
1000997         return ((readinputport(4) << 16) & ((readinputport(2) & 1) ? 0xffef0000 : 0xffff0000)) | (ioga[1]);
1001998      }
r2241r2242
10511048   switch(offset)
10521049   {
10531050      case 1:
1054         if(LO_WORD_ACCESS)
1051         if(ACCESSING_BITS_0_7)
10551052         {
10561053            /*Why does the BIOS tests these as ACTIVE HIGH?A program bug?*/
10571054            ioga[1] = (data) & 0xff;
r2241r2242
10651062         }
10661063      break;
10671064      case 2:
1068         if(HI_WORD_ACCESS)
1065         if(ACCESSING_BITS_16_23)
10691066         {
10701067            ioga[2] = data >> 16;
10711068            mux_data = ioga[2];
10721069         }
1073         else if(LO_WORD_ACCESS)
1070         else if(ACCESSING_BITS_0_7)
10741071            ioga[2] = data;
10751072      break;
10761073      case 3:
1077         if(HI_WORD_ACCESS)
1074         if(ACCESSING_BITS_16_23)
10781075            ioga[3] = data;
10791076      break;
10801077      case 4:
1081         if(HI_WORD_ACCESS)
1078         if(ACCESSING_BITS_16_23)
10821079            port_sel = (data & 0xffff0000) >> 16;
10831080      break;
10841081      case 5:
1085         if(HI_WORD_ACCESS)
1082         if(ACCESSING_BITS_16_23)
10861083            ioga[5] = data;
10871084      break;
10881085   }
r2241r2242
12951292         /*Sound IRQ*/
12961293         if(/*(!(stv_scu[40] & 0x40)) &&*/ scsp_to_main_irq == 1)
12971294         {
1298            //cpunum_set_input_line_and_vector(Machine, 0, 9, HOLD_LINE , 0x46);
1295            //cpunum_set_input_line_and_vector(machine, 0, 9, HOLD_LINE , 0x46);
12991296            logerror("SCSP: Main CPU interrupt\n");
13001297            #if 0
13011298            if((scu_dst_0 & 0x7ffffff) != 0x05a00000)
13021299            {
13031300               if(!(stv_scu[40] & 0x1000))
13041301               {
1305                  cpunum_set_input_line_and_vector(Machine, 0, 3, HOLD_LINE, 0x4c);
1302                  cpunum_set_input_line_and_vector(machine, 0, 3, HOLD_LINE, 0x4c);
13061303                  logerror("SCU: Illegal DMA interrupt\n");
13071304               }
13081305            }
r2241r2242
13561353         /*Sound IRQ*/
13571354         if(/*(!(stv_scu[40] & 0x40)) &&*/ scsp_to_main_irq == 1)
13581355         {
1359            //cpunum_set_input_line_and_vector(Machine, 0, 9, HOLD_LINE , 0x46);
1356            //cpunum_set_input_line_and_vector(machine, 0, 9, HOLD_LINE , 0x46);
13601357            logerror("SCSP: Main CPU interrupt\n");
13611358         }
13621359      }
r2241r2242
14061403         /*Sound IRQ*/
14071404         if(/*(!(stv_scu[40] & 0x40)) &&*/ scsp_to_main_irq == 1)
14081405         {
1409            //cpunum_set_input_line_and_vector(Machine, 0, 9, HOLD_LINE , 0x46);
1406            //cpunum_set_input_line_and_vector(machine, 0, 9, HOLD_LINE , 0x46);
14101407            logerror("SCSP: Main CPU interrupt\n");
14111408         }
14121409      }
r2241r2242
20522049{
20532050   logerror("cpu #%d (PC=%08X) MINIT write = %08x\n",cpu_getactivecpu(), activecpu_get_pc(),data);
20542051   cpu_boost_interleave(minit_boost_timeslice, ATTOTIME_IN_USEC(minit_boost));
2055   cpu_trigger(Machine, 1000);
2052   cpu_trigger(machine, 1000);
20562053   cpunum_set_info_int(1, CPUINFO_INT_SH2_FRT_INPUT, PULSE_LINE);
20572054}
20582055
src/mame/drivers/igs_blit.c
r2241r2242
627627      case 0x00:
628628         COMBINE_DATA(&igs_input_sel2);
629629
630         if (ACCESSING_LSB)
630         if (ACCESSING_BITS_0_7)
631631         {
632632            coin_counter_w(0,   data & 0x20);
633633            //  coin out        data & 0x40
r2241r2242
640640         break;
641641
642642      case 0x02:
643         if (ACCESSING_LSB)
643         if (ACCESSING_BITS_0_7)
644644         {
645645            chmplst2_pen_hi = data & 0x07;
646646
r2241r2242
718718   {
719719
720720      case 0x00:
721         if (ACCESSING_LSB)
721         if (ACCESSING_BITS_0_7)
722722            coin_counter_w(0,data & 2);
723723
724724         if (data & ~0x2)
r2241r2242
781781   switch(igs_magic[0])
782782   {
783783      case 0x02:
784         if (ACCESSING_LSB)
784         if (ACCESSING_BITS_0_7)
785785         {
786786            coin_counter_w(0,data & 0x01);
787787
r2241r2242
838838
839839static WRITE16_HANDLER( lhb_okibank_w )
840840{
841   if (ACCESSING_MSB)
841   if (ACCESSING_BITS_8_15)
842842   {
843843      OKIM6295_set_bank_base(0, (data & 0x200) ? 0x40000 : 0);
844844   }
r2241r2242
853853{
854854   COMBINE_DATA(&igs_input_sel2);
855855
856   if (ACCESSING_LSB)
856   if (ACCESSING_BITS_0_7)
857857   {
858858      coin_counter_w(0,          data & 0x20   );
859859      //  coin out                 data & 0x40
r2241r2242
897897   switch(igs_magic[0])
898898   {
899899      case 0x02:
900         if (ACCESSING_LSB)
900         if (ACCESSING_BITS_0_7)
901901         {
902902            coin_counter_w(0,data & 1);
903903            coin_counter_w(1,data & 2);
r2241r2242
964964      case 0x01:
965965         COMBINE_DATA(&igs_input_sel2);
966966
967         if (ACCESSING_LSB)
967         if (ACCESSING_BITS_0_7)
968968         {
969969            coin_counter_w(0,   data & 0x20);
970970            //  coin out        data & 0x40
r2241r2242
10121012
10131013static WRITE16_HANDLER( igs_YM3812_control_port_0_w )
10141014{
1015   if (ACCESSING_LSB)
1015   if (ACCESSING_BITS_0_7)
10161016      YM3812_control_port_0_w(machine,0,data);
10171017}
10181018
10191019static WRITE16_HANDLER( igs_YM3812_write_port_0_w )
10201020{
1021   if (ACCESSING_LSB)
1021   if (ACCESSING_BITS_0_7)
10221022      YM3812_write_port_0_w(machine,0,data);
10231023}
10241024
r2241r2242
11701170   switch(offset)
11711171   {
11721172      case 1:
1173         if (ACCESSING_LSB)   ics2115_w(machine,1,data);
1173         if (ACCESSING_BITS_0_7)   ics2115_w(machine,1,data);
11741174         break;
11751175      case 2:
1176         if (ACCESSING_LSB)   ics2115_w(machine,2,data);
1177         if (ACCESSING_MSB)   ics2115_w(machine,3,data>>8);
1176         if (ACCESSING_BITS_0_7)   ics2115_w(machine,2,data);
1177         if (ACCESSING_BITS_8_15)   ics2115_w(machine,3,data>>8);
11781178         break;
11791179   }
11801180}
r2241r2242
11991199
12001200static WRITE16_HANDLER( vbowl_pen_hi_w )
12011201{
1202   if (ACCESSING_LSB)
1202   if (ACCESSING_BITS_0_7)
12031203   {
12041204      chmplst2_pen_hi = data & 0x07;
12051205   }
src/mame/drivers/goal92.c
r2241r2242
2929
3030static WRITE16_HANDLER( goal92_sound_command_w )
3131{
32   if (ACCESSING_MSB)
32   if (ACCESSING_BITS_8_15)
3333   {
3434      soundlatch_w(machine, 0, (data >> 8) & 0xff);
3535      cpunum_set_input_line(machine, 1,0,HOLD_LINE);
src/mame/drivers/bishi.c
r2241r2242
11/***************************************************************************
22
3 Bishi Bashi Champ Mini Game Senshuken
4 (c) 1996 Konami
3 Bishi Bashi Champ Mini Game Senshuken (c) 1996 Konami
4 Super Bishi Bashi Championship        (c) 1998 Konami
55
66 Driver by R. Belmont
77
88 WORKING: ram/rom test passes, IRQs, sound/music, inputs, colors.
99 TODO: "bishi" needs a ROM redumped, K056832 needs per-tile priority
1010
11
12*****************************************************************************
13
14
15Super Bishi Bashi Champ (Korean version)
16Konami, 1998
17
18PCB Layout                     ROM
19----------              Daughterboard (on top)
20                                ||
21GS562 PWB(A)400625A             \/
22|----------------------|-------------------|
23|   VOL SM5875 675KAA01|24MHz  MB3790  CN4 |
24|16.9344MHz            |                   |
25|   YMZ280B    675KAA02|  6264             |
26|  056232              |                CN3|
27|              675KAA03|  6264    68000    |
28|                      |                   |
29|              675KAA04|            62256  |
30|            PAL       |                   |
31|CN1         DSW1(8)   |  058143    62256  |
32|  056879    DSW2(8)   |--------------------
33|                                   62256  |
34|                                675KAA07  |
35|                         056832           |
36|                                675KAA09  |
37|         6264                             |
38|                                675KAA08  |
39|         6264            055555           |
40|  056766                        675KAA10  |
41|056820   6264                             |
42|                                          |
43|------------------------------------------|
44Notes:
45      68000  - clock 12.000MHz (24/2)
46      YMZ280 - clock 16.9344MHz
47      CN3/4  - connector for ROM daugterboard
48      CN1    - large flat cable connector for power/controls
49      675KAA01 to 04 - 27C040 EPROMs
50      675KAA07 to 10 - 27C240 EPROMs
51
52      Konami Custom ICs -
53                          056143 (QFP160)
54                          056832 (QFP144)
55                          055555 (QFP240)
56                          056879 (QFP144)
57                          056232 (ceramic SIL14)
58                          056820 (ceramic SIL13)
59
60
61Daughterboard
62-------------
63PWB 402005(B) ROM BOARD
64|-------------------|
65|CN7 4AK16     CN8  |
66|              PAL  |
67|                   |
68|CN5 4AK16          |
69|                   |
70|         675KAA05  |
71|    4AK16          |
72|CN6      675KAA06  |
73|-------------------|
74Notes:
75      CN5/6 - 15 pin connector for lights maybe?
76      CN7/8 - 8 pin connector for power
77      4AK16 - power amp IC tied to CN5/6
78      675*  - 27C240 EPROMs
79
1180***************************************************************************/
1281
82#define CPU_CLOCK   (XTAL_24MHz / 2)   /* 68000 clock */
83#define SOUND_CLOCK   XTAL_16_9344MHz      /* YMZ280 clock */
84
1385#include "driver.h"
1486#include "deprecat.h"
1587#include "video/konamiic.h"
r2241r2242
266338static MACHINE_DRIVER_START( bishi )
267339
268340   /* basic machine hardware */
269   MDRV_CPU_ADD_TAG("main", M68000, 16000000)
341   MDRV_CPU_ADD_TAG("main", M68000, CPU_CLOCK) /* 12MHz (24MHz OSC / 2 ) */
270342   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
271343   MDRV_CPU_VBLANK_INT_HACK(bishi_interrupt, 2)
272344
r2241r2242
291363   /* sound hardware */
292364   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
293365
294   MDRV_SOUND_ADD(YMZ280B, 16934400)
366   MDRV_SOUND_ADD(YMZ280B, SOUND_CLOCK) /* 16.9344MHz */
295367   MDRV_SOUND_CONFIG(ymz280b_intf)
296368   MDRV_SOUND_ROUTE(0, "left", 1.0)
297369   MDRV_SOUND_ROUTE(1, "right", 1.0)
r2241r2242
302374
303375ROM_START( bishi )
304376   ROM_REGION( 0x100000, REGION_CPU1, 0 )
305   ROM_LOAD16_WORD_SWAP( "575jaa05.12f", 0x000000, 0x80000, CRC(7d354567) SHA1(7fc11585693c91c0ef7a8e00df4f2f01b356210f) )
306   ROM_LOAD16_WORD_SWAP( "575jaa06.15f", 0x080000, 0x80000, CRC(9b2f7fbb) SHA1(26c828085c44a9c4d4e713e8fcc0bc8fc973d107) )
377   ROM_LOAD16_WORD_SWAP( "575jaa05.12e", 0x000000, 0x80000, CRC(7d354567) SHA1(7fc11585693c91c0ef7a8e00df4f2f01b356210f) )
378   ROM_LOAD16_WORD_SWAP( "575jaa06.15e", 0x080000, 0x80000, CRC(9b2f7fbb) SHA1(26c828085c44a9c4d4e713e8fcc0bc8fc973d107) )
307379
308380   ROM_REGION( 0x200000, REGION_GFX1, 0 )
309381   ROM_LOAD16_BYTE( "575jaa07.14n", 0x000000, 0x080000, CRC(37bbf387) SHA1(dcf7b151b865d251f3122611b6339dd84eb1f990) )
r2241r2242
318390   ROM_LOAD( "575jaa01.2f", 0x000000, 0x080000, CRC(e1e9f7b2) SHA1(4da93e384a6018d829cbb02cfde98fc3662c5267) )
319391   ROM_LOAD( "575jaa02.4f", 0x080000, 0x080000, CRC(d228eb06) SHA1(075bd48242b5f590bfbfc45bc430578375fad70f) )
320392   ROM_LOAD( "575jaa03.6f", 0x100000, 0x080000, CRC(9ec0321f) SHA1(03999dc415f556d0cd58e6358f826b97e85b477b) )
321   ROM_LOAD( "575jaa04.9f", 0x180000, 0x080000, CRC(0120967f) SHA1(14cc2b9269f46859d1de418c8d4c76a6bdb09d16) )
393   ROM_LOAD( "575jaa04.8f", 0x180000, 0x080000, CRC(0120967f) SHA1(14cc2b9269f46859d1de418c8d4c76a6bdb09d16) )
322394ROM_END
323395
324396ROM_START( sbishi )
325397   ROM_REGION( 0x100000, REGION_CPU1, 0 )
326   ROM_LOAD16_WORD_SWAP( "675jaa05.12f", 0x000000, 0x80000, CRC(28a09c01) SHA1(627f6c9b9e88434ff3198c778ae5c57d9cda82c5) )
327   ROM_LOAD16_WORD_SWAP( "675jaa06.15f", 0x080000, 0x80000, CRC(e4998b33) SHA1(3012f7661542b38b1a113c5c10e2729c6a37e709) )
398   ROM_LOAD16_WORD_SWAP( "675jaa05.12e", 0x000000, 0x80000, CRC(28a09c01) SHA1(627f6c9b9e88434ff3198c778ae5c57d9cda82c5) )
399   ROM_LOAD16_WORD_SWAP( "675jaa06.15e", 0x080000, 0x80000, CRC(e4998b33) SHA1(3012f7661542b38b1a113c5c10e2729c6a37e709) )
328400
329401   ROM_REGION( 0x200000, REGION_GFX1, 0 )
330402   ROM_LOAD16_BYTE( "675jaa07.14n", 0x000000, 0x080000, CRC(6fe7c658) SHA1(a786a417053a5fc62f967bdd564e8d3bdc89f958) )
r2241r2242
339411   ROM_LOAD( "675jaa01.2f", 0x000000, 0x080000, CRC(67910b15) SHA1(6566e2344ebe9d61c584a1ab9ecbc8e7dd0a9a5b) )
340412   ROM_LOAD( "675jaa02.4f", 0x080000, 0x080000, CRC(3313a7ae) SHA1(a49df87446a5b1bbf77fdf13a298ed486d7d7476) )
341413   ROM_LOAD( "675jaa03.6f", 0x100000, 0x080000, CRC(ec977e6a) SHA1(9beb13e716d1694a64ce787fa3db4ba986a07d51) )
342   ROM_LOAD( "675jaa04.9f", 0x180000, 0x080000, CRC(1d1de34e) SHA1(1671216545cc0842cf8c128eaa0c612e6d91875c) )
414   ROM_LOAD( "675jaa04.8f", 0x180000, 0x080000, CRC(1d1de34e) SHA1(1671216545cc0842cf8c128eaa0c612e6d91875c) )
343415ROM_END
344416
417ROM_START( sbishik )
418   ROM_REGION( 0x100000, REGION_CPU1, 0 )
419   ROM_LOAD16_WORD_SWAP( "675kaa05.12e", 0x000000, 0x80000, CRC(23600e1d) SHA1(b3224c84e41e3077425a60232bb91775107f37a8) )
420   ROM_LOAD16_WORD_SWAP( "675kaa06.15e", 0x080000, 0x80000, CRC(bd1091f5) SHA1(29872abc49fe8209d0f414ca40a34fc494ff9b96) )
345421
346GAME( 1996, bishi,     0,       bishi,     bishi,     0,      ROT0, "Konami", "Bishi Bashi Championship Mini Game Senshuken (ver JAA)", GAME_IMPERFECT_GRAPHICS)
347GAME( 1998, sbishi,    0,       bishi,     bishi,     0,      ROT0, "Konami", "Super Bishi Bashi Championship (ver JAA)", GAME_IMPERFECT_GRAPHICS)
422   ROM_REGION( 0x200000, REGION_GFX1, 0 )
423   ROM_LOAD16_BYTE( "675kaa07.14n", 0x000000, 0x080000, CRC(1177c1f8) SHA1(42c6f3c3a6bd0adb7d927386fd99f1497e5df30c) )
424   ROM_LOAD16_BYTE( "675kaa08.17n", 0x000001, 0x080000, CRC(7117e9cd) SHA1(5a9b4b7427edcc10725d5936869927874fef6463) )
425   ROM_LOAD16_BYTE( "675kaa09.19n", 0x100000, 0x080000, CRC(8d49c765) SHA1(7921f8f3671fbbc3d5ea529234268a1e23ea622c) )
426   ROM_LOAD16_BYTE( "675kaa10.22n", 0x100001, 0x080000, CRC(c16acf32) SHA1(df3eeb5ab3bab8e707eaa79ffc500e1dc2332a82) )
427
428   // dummy region (game has no sprites, but we want to use the GX mixer)
429   ROM_REGION( 0x80000, REGION_GFX2, ROMREGION_ERASE00 )
430
431   ROM_REGION( 0x200000, REGION_SOUND1, 0 )
432   ROM_LOAD( "675kaa01.2f", 0x000000, 0x080000, CRC(73ac6ae6) SHA1(37e4722647a13275c5f51d2bfa50df3e12ea1ebf) )
433   ROM_LOAD( "675kaa02.4f", 0x080000, 0x080000, CRC(4c341e7c) SHA1(b944ea59d94f9ea5cea8ed8ad68da2a52c4bbfd7) )
434   ROM_LOAD( "675kaa03.6f", 0x100000, 0x080000, CRC(83f91beb) SHA1(3af95f503f26fc88e75c786a9fef8a333c21d1d6) )
435   ROM_LOAD( "675kaa04.8f", 0x180000, 0x080000, CRC(ebcbd813) SHA1(d67540d0ea303f09866f4a766e2d5162f05cd4ac) )
436ROM_END
437
438
439GAME( 1996, bishi,    0,      bishi, bishi, 0, ROT0, "Konami", "Bishi Bashi Championship Mini Game Senshuken (ver JAA)", GAME_IMPERFECT_GRAPHICS)
440GAME( 1998, sbishi,   0,      bishi, bishi, 0, ROT0, "Konami", "Super Bishi Bashi Championship (ver JAA)", GAME_IMPERFECT_GRAPHICS)
441GAME( 1998, sbishik,  sbishi, bishi, bishi, 0, ROT0, "Konami", "Super Bishi Bashi Championship (ver KAA)", GAME_IMPERFECT_GRAPHICS)
src/mame/drivers/bloodbro.c
r2241r2242
5757    entering the initials (code at 0x004a1e, 0x014bb0 and 0x014c84)
5858
5959
602) 'weststry'
602) 'bloodbra'
6161
62  - When "Starting Coin" Dip Switch is set to "x2", you need 2 coins to start
63    a game (but 1 coin to join), then 1 coin to continue.
64    However, it you insert 2 coins, and press START2, you start a 2 players game.
65    Also note that when "Starting Coin" Dip Switch is set to "x2", SERVICE1
66    adds 2 credits instead of 1.
67
68  - Bits 6 and 7 of DSW are told to be unused, but they are tested before
69    entering the initials (code at 0x004a46, 0x014bd8 and 0x014cac)
70
71
723) 'weststry'
73
6274  - This bootleg has been realised by Datsu in 1991. This "company" also
6375    bootlegged "Toki" (another TAD game) in 1990.
6476
r2241r2242
7284  - Bit 7 of DSW is also "merged" with bit 6 (code at 0x0002f6 and 0x000326).
7385
7486
753) 'skysmash'
874) 'skysmash'
7688
7789  - This game only has 2 buttons : bits 6 and 14 of players inputs are NEVER tested !
7890
r2241r2242
90102    Dip Switch as in 'toki' (same manufacturer and similar hardware).
91103
92104
105DIP locations verified for:
106    - bloodbro (manual)
107
93108**************************************************************************/
94109
95110#include "driver.h"
r2241r2242
131146   AM_RANGE(0x0c0080, 0x0c0081) AM_WRITENOP // ??? IRQ Ack VBL?
132147   AM_RANGE(0x0c00c0, 0x0c00c1) AM_WRITENOP // ??? watchdog?
133148   AM_RANGE(0x0c0100, 0x0c0101) AM_WRITENOP // ??? written once
134   AM_RANGE(0x0e0000, 0x0e0001) AM_READ(input_port_1_word_r)
135   AM_RANGE(0x0e0002, 0x0e0003) AM_READ(input_port_2_word_r)
136   AM_RANGE(0x0e0004, 0x0e0005) AM_READ(input_port_3_word_r)
149   AM_RANGE(0x0e0000, 0x0e0001) AM_READ_PORT("DSW")
150   AM_RANGE(0x0e0002, 0x0e0003) AM_READ_PORT("IN0")
151   AM_RANGE(0x0e0004, 0x0e0005) AM_READ_PORT("IN1")
137152ADDRESS_MAP_END
138153
139154static ADDRESS_MAP_START( weststry_map, ADDRESS_SPACE_PROGRAM, 16 )
r2241r2242
146161   AM_RANGE(0x08d400, 0x08d7ff) AM_RAM
147162   AM_RANGE(0x08d800, 0x08dfff) AM_RAM AM_WRITE(bloodbro_txvideoram_w) AM_BASE(&bloodbro_txvideoram)
148163   AM_RANGE(0x08e000, 0x08ffff) AM_RAM
149   AM_RANGE(0x0c1000, 0x0c1001) AM_READ(input_port_0_word_r)
150   AM_RANGE(0x0c1002, 0x0c1003) AM_READ(input_port_1_word_r)
151   AM_RANGE(0x0c1004, 0x0c1005) AM_READ(input_port_2_word_r)
164   AM_RANGE(0x0c1000, 0x0c1001) AM_READ_PORT("DSW")
165   AM_RANGE(0x0c1002, 0x0c1003) AM_READ_PORT("IN0")
166   AM_RANGE(0x0c1004, 0x0c1005) AM_READ_PORT("IN1")
152167   AM_RANGE(0x0c1000, 0x0c17ff) AM_RAM
153168   AM_RANGE(0x128000, 0x1287ff) AM_RAM AM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE(&paletteram16)
154169   AM_RANGE(0x120000, 0x128fff) AM_RAM
r2241r2242
156171
157172/* Input Ports */
158173
159static INPUT_PORTS_START( bloodbro )
160   SEIBU_COIN_INPUTS   /* Must be port 0: coin inputs read through sound cpu */
174#define BLOODBRO_COINAGE \
175   PORT_DIPNAME( 0x0001, 0x0001, "Coin Mode" )                  PORT_DIPLOCATION("SW1:1") \
176   PORT_DIPSETTING(      0x0001, "Mode 1" ) \
177   PORT_DIPSETTING(      0x0000, "Mode 2" ) \
178   /* Coin Mode 1 */ \
179   PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) )           PORT_DIPLOCATION("SW1:2,3,4,5") PORT_CONDITION("DSW",0x0001,PORTCOND_EQUALS,0x0001) \
180   PORT_DIPSETTING(      0x0014, DEF_STR( 6C_1C ) ) \
181   PORT_DIPSETTING(      0x0016, DEF_STR( 5C_1C ) ) \
182   PORT_DIPSETTING(      0x0018, DEF_STR( 4C_1C ) ) \
183   PORT_DIPSETTING(      0x001a, DEF_STR( 3C_1C ) ) \
184   PORT_DIPSETTING(      0x0002, DEF_STR( 8C_3C ) ) \
185   PORT_DIPSETTING(      0x001c, DEF_STR( 2C_1C ) ) \
186   PORT_DIPSETTING(      0x0004, DEF_STR( 5C_3C ) ) \
187   PORT_DIPSETTING(      0x0006, DEF_STR( 3C_2C ) ) \
188   PORT_DIPSETTING(      0x001e, DEF_STR( 1C_1C ) ) \
189   PORT_DIPSETTING(      0x0008, DEF_STR( 2C_3C ) ) \
190   PORT_DIPSETTING(      0x0012, DEF_STR( 1C_2C ) ) \
191   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) ) \
192   PORT_DIPSETTING(      0x000e, DEF_STR( 1C_4C ) ) \
193   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_5C ) ) \
194   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_6C ) ) \
195   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) ) \
196   /* Coin Mode 2 */ \
197    PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) )            PORT_DIPLOCATION("SW1:2,3") PORT_CONDITION("DSW",0x0001,PORTCOND_EQUALS,0x0000) \
198    PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) ) \
199    PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) ) \
200    PORT_DIPSETTING(      0x0004, DEF_STR( 2C_1C ) ) \
201    PORT_DIPSETTING(      0x0006, DEF_STR( 1C_1C ) ) \
202    PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Coin_B ) )            PORT_DIPLOCATION("SW1:4,5") PORT_CONDITION("DSW",0x0001,PORTCOND_EQUALS,0x0000) \
203    PORT_DIPSETTING(      0x0018, DEF_STR( 1C_2C ) ) \
204    PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) ) \
205    PORT_DIPSETTING(      0x0008, DEF_STR( 1C_5C ) ) \
206    PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) ) \
207   PORT_DIPNAME( 0x0020, 0x0020, "Starting Coin" )              PORT_DIPLOCATION("SW1:6") \
208   PORT_DIPSETTING(      0x0020, DEF_STR( Normal ) ) \
209   PORT_DIPSETTING(      0x0000, "x2" )
161210
162   PORT_START
163   PORT_DIPNAME( 0x0001, 0x0001, "Coin Mode" )
164   PORT_DIPSETTING(      0x0001, "Mode 1" )
165   PORT_DIPSETTING(      0x0000, "Mode 2" )
166   /* Coin Mode 1 */
167   PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) )
168   PORT_DIPSETTING(      0x0014, DEF_STR( 6C_1C ) )
169   PORT_DIPSETTING(      0x0016, DEF_STR( 5C_1C ) )
170   PORT_DIPSETTING(      0x0018, DEF_STR( 4C_1C ) )
171   PORT_DIPSETTING(      0x001a, DEF_STR( 3C_1C ) )
172   PORT_DIPSETTING(      0x0002, DEF_STR( 8C_3C ) )
173   PORT_DIPSETTING(      0x001c, DEF_STR( 2C_1C ) )
174   PORT_DIPSETTING(      0x0004, DEF_STR( 5C_3C ) )
175   PORT_DIPSETTING(      0x0006, DEF_STR( 3C_2C ) )
176   PORT_DIPSETTING(      0x001e, DEF_STR( 1C_1C ) )
177   PORT_DIPSETTING(      0x0008, DEF_STR( 2C_3C ) )
178   PORT_DIPSETTING(      0x0012, DEF_STR( 1C_2C ) )
179   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )
180   PORT_DIPSETTING(      0x000e, DEF_STR( 1C_4C ) )
181   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_5C ) )
182   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_6C ) )
183   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
184   /* Coin Mode 2
185    PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) )
186    PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
187    PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )
188    PORT_DIPSETTING(      0x0004, DEF_STR( 2C_1C ) )
189    PORT_DIPSETTING(      0x0006, DEF_STR( 1C_1C ) )
190    PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Coin_B ) )
191    PORT_DIPSETTING(      0x0018, DEF_STR( 1C_2C ) )
192    PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )
193    PORT_DIPSETTING(      0x0008, DEF_STR( 1C_5C ) )
194    PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
211static INPUT_PORTS_START( weststry )
212   PORT_START_TAG("DSW")
213   BLOODBRO_COINAGE
214   /*  SW1:7,8 is listed as "ROM change option", "optional"
215                         A  B  C  D
216        Coin Up          0  1  1  1
217        Screen Complete  0  0  0  1
218        Stage Complete   1  1  3  1
219        Top 10           1  3  3  3
220        High Score       1  4  5  4
221        Complete Game    5  5 10 15
222
223        D limits 8 tickets/coin except completion
224
225        The sets handled in MAME don't seem to have this "feature"
226    PORT_DIPNAME( 0x00c0, 0x00c0, "Ticket Dispenser Payout Mode" ) PORT_DIPLOCATION("SW1:7,8")
227    PORT_DIPSETTING(      0x00c0, "A" )
228    PORT_DIPSETTING(      0x0080, "B" )
229    PORT_DIPSETTING(      0x0040, "C" )
230    PORT_DIPSETTING(      0x0000, "D" )
195231    */
196   PORT_DIPNAME( 0x0020, 0x0020, "Starting Coin" )
197   PORT_DIPSETTING(      0x0020, DEF_STR( Normal ) )
198   PORT_DIPSETTING(      0x0000, "x2" )
199   PORT_BIT( 0x00c0, IP_ACTIVE_LOW, IPT_UNUSED )
200   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
232   PORT_DIPUNKNOWN_DIPLOC( 0x0040, IP_ACTIVE_LOW, "SW1:7" )
233   PORT_DIPUNKNOWN_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" )
234   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )             PORT_DIPLOCATION("SW2:1,2")
201235   PORT_DIPSETTING(      0x0000, "1" )
202236   PORT_DIPSETTING(      0x0200, "2" )
203237   PORT_DIPSETTING(      0x0300, "3" )
204238   PORT_DIPSETTING(      0x0100, "5" )
205   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Bonus_Life ) )
239   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Bonus_Life ) )        PORT_DIPLOCATION("SW2:3,4")
206240   PORT_DIPSETTING(      0x0c00, "300K 500K+" )
207241   PORT_DIPSETTING(      0x0800, "500K+" )
208242   PORT_DIPSETTING(      0x0400, "500K" )
209243   PORT_DIPSETTING(      0x0000, DEF_STR( None ) )
210   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Difficulty ) )
244   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Difficulty ) )        PORT_DIPLOCATION("SW2:5,6")
211245   PORT_DIPSETTING(      0x2000, DEF_STR( Easy ) )
212246   PORT_DIPSETTING(      0x3000, DEF_STR( Normal ) )
213247   PORT_DIPSETTING(      0x1000, DEF_STR( Hard ) )
214248   PORT_DIPSETTING(      0x0000, DEF_STR( Very_Hard ) )
215   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Allow_Continue ) )
249   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Allow_Continue ) )    PORT_DIPLOCATION("SW2:7")
216250   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
217251   PORT_DIPSETTING(      0x4000, DEF_STR( Yes ) )
218   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Demo_Sounds ) )
252   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Demo_Sounds ) )       PORT_DIPLOCATION("SW2:8")
219253   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
220254   PORT_DIPSETTING(      0x8000, DEF_STR( On ) )
221255
222   PORT_START
256   PORT_START_TAG("IN0")
223257   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
224258   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
225259   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
r2241r2242
237271   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)   // "Dynamite"
238272   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* tested - check code at 0x0005fe - VBLANK ? */
239273
240   PORT_START
274   PORT_START_TAG("IN1")
275   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
276   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
277   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
278   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START1 )
279   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START2 )
280   PORT_BIT( 0x00e0, IP_ACTIVE_LOW, IPT_UNKNOWN )
281   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
282INPUT_PORTS_END
283
284static INPUT_PORTS_START( bloodbro )
285   PORT_INCLUDE( weststry )
286
287   PORT_MODIFY("IN1")
241288   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
242289   PORT_BIT( 0x000e, IP_ACTIVE_LOW, IPT_UNKNOWN )
243290   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START2 )
r2241r2242
246293   PORT_BIT( 0x0e00, IP_ACTIVE_LOW, IPT_UNKNOWN )
247294   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE1 )
248295   PORT_BIT( 0xe000, IP_ACTIVE_LOW, IPT_UNKNOWN )
249INPUT_PORTS_END
250296
251static INPUT_PORTS_START( weststry )
252   PORT_START
253   PORT_DIPNAME( 0x0001, 0x0001, "Coin Mode" )
254   PORT_DIPSETTING(      0x0001, "Mode 1" )
255   PORT_DIPSETTING(      0x0000, "Mode 2" )
256   /* Coin Mode 1 */
257   PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) )
258   PORT_DIPSETTING(      0x0014, DEF_STR( 6C_1C ) )
259   PORT_DIPSETTING(      0x0016, DEF_STR( 5C_1C ) )
260   PORT_DIPSETTING(      0x0018, DEF_STR( 4C_1C ) )
261   PORT_DIPSETTING(      0x001a, DEF_STR( 3C_1C ) )
262   PORT_DIPSETTING(      0x0002, DEF_STR( 8C_3C ) )
263   PORT_DIPSETTING(      0x001c, DEF_STR( 2C_1C ) )
264   PORT_DIPSETTING(      0x0004, DEF_STR( 5C_3C ) )
265   PORT_DIPSETTING(      0x0006, DEF_STR( 3C_2C ) )
266   PORT_DIPSETTING(      0x001e, DEF_STR( 1C_1C ) )
267   PORT_DIPSETTING(      0x0008, DEF_STR( 2C_3C ) )
268   PORT_DIPSETTING(      0x0012, DEF_STR( 1C_2C ) )
269   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )
270   PORT_DIPSETTING(      0x000e, DEF_STR( 1C_4C ) )
271   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_5C ) )
272   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_6C ) )
273   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
274   /* Coin Mode 2
275    PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) )
276    PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
277    PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )
278    PORT_DIPSETTING(      0x0004, DEF_STR( 2C_1C ) )
279    PORT_DIPSETTING(      0x0006, DEF_STR( 1C_1C ) )
280    PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Coin_B ) )
281    PORT_DIPSETTING(      0x0018, DEF_STR( 1C_2C ) )
282    PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )
283    PORT_DIPSETTING(      0x0008, DEF_STR( 1C_5C ) )
284    PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
285    */
286   PORT_DIPNAME( 0x0020, 0x0020, "Starting Coin" )
287   PORT_DIPSETTING(      0x0020, DEF_STR( Normal ) )
288   PORT_DIPSETTING(      0x0000, "x2" )
289   PORT_BIT( 0x00c0, IP_ACTIVE_LOW, IPT_UNUSED )
290   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
291   PORT_DIPSETTING(      0x0000, "1" )
292   PORT_DIPSETTING(      0x0200, "2" )
293   PORT_DIPSETTING(      0x0300, "3" )
294   PORT_DIPSETTING(      0x0100, "5" )
295   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Bonus_Life ) )
296   PORT_DIPSETTING(      0x0c00, "300K 500K+" )
297   PORT_DIPSETTING(      0x0800, "500K+" )
298   PORT_DIPSETTING(      0x0400, "500K" )
299   PORT_DIPSETTING(      0x0000, DEF_STR( None ) )
300   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Difficulty ) )
301   PORT_DIPSETTING(      0x2000, DEF_STR( Easy ) )
302   PORT_DIPSETTING(      0x3000, DEF_STR( Normal ) )
303   PORT_DIPSETTING(      0x1000, DEF_STR( Hard ) )
304   PORT_DIPSETTING(      0x0000, DEF_STR( Very_Hard ) )
305   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Allow_Continue ) )
306   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
307   PORT_DIPSETTING(      0x4000, DEF_STR( Yes ) )
308   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Demo_Sounds ) )
309   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
310   PORT_DIPSETTING(      0x8000, DEF_STR( On ) )
311
312   PORT_START
313   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
314   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
315   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
316   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
317   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)   // "Fire"
318   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)   // "Roll"
319   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)   // "Dynamite"
320   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
321   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
322   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
323   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
324   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
325   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)   // "Fire"
326   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)   // "Roll"
327   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)   // "Dynamite"
328   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
329
330   PORT_START
331   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
332   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
333   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
334   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START1 )
335   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START2 )
336   PORT_BIT( 0x00e0, IP_ACTIVE_LOW, IPT_UNKNOWN )
337   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
297   SEIBU_COIN_INPUTS   /* coin inputs read through sound cpu */
338298INPUT_PORTS_END
339299
340300static INPUT_PORTS_START( skysmash )
341   SEIBU_COIN_INPUTS   /* Must be port 0: coin inputs read through sound cpu */
342
343   PORT_START
344   PORT_DIPNAME( 0x0001, 0x0001, "Coin Mode" )
345   PORT_DIPSETTING(      0x0001, "Mode 1" )
346   PORT_DIPSETTING(      0x0000, "Mode 2" )
347   /* Coin Mode 1 */
348   PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) )
349   PORT_DIPSETTING(      0x0014, DEF_STR( 6C_1C ) )
350   PORT_DIPSETTING(      0x0016, DEF_STR( 5C_1C ) )
351   PORT_DIPSETTING(      0x0018, DEF_STR( 4C_1C ) )
352   PORT_DIPSETTING(      0x001a, DEF_STR( 3C_1C ) )
353   PORT_DIPSETTING(      0x0002, DEF_STR( 8C_3C ) )
354   PORT_DIPSETTING(      0x001c, DEF_STR( 2C_1C ) )
355   PORT_DIPSETTING(      0x0004, DEF_STR( 5C_3C ) )
356   PORT_DIPSETTING(      0x0006, DEF_STR( 3C_2C ) )
357   PORT_DIPSETTING(      0x001e, DEF_STR( 1C_1C ) )
358   PORT_DIPSETTING(      0x0008, DEF_STR( 2C_3C ) )
359   PORT_DIPSETTING(      0x0012, DEF_STR( 1C_2C ) )
360   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )
361   PORT_DIPSETTING(      0x000e, DEF_STR( 1C_4C ) )
362   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_5C ) )
363   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_6C ) )
364   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
365   /* Coin Mode 2
366    PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) )
367    PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
368    PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )
369    PORT_DIPSETTING(      0x0004, DEF_STR( 2C_1C ) )
370    PORT_DIPSETTING(      0x0006, DEF_STR( 1C_1C ) )
371    PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Coin_B ) )
372    PORT_DIPSETTING(      0x0018, DEF_STR( 1C_2C ) )
373    PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )
374    PORT_DIPSETTING(      0x0008, DEF_STR( 1C_5C ) )
375    PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
376    */
377   PORT_DIPNAME( 0x0020, 0x0020, "Starting Coin" )
378   PORT_DIPSETTING(      0x0020, DEF_STR( Normal ) )
379   PORT_DIPSETTING(      0x0000, "x2" )
380   PORT_BIT( 0x00c0, IP_ACTIVE_LOW, IPT_UNUSED )
381   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
301   PORT_START_TAG("DSW")
302   BLOODBRO_COINAGE
303   PORT_DIPUNUSED_DIPLOC( 0x0040, IP_ACTIVE_LOW, "SW1:7" )      /* see notes */
304   PORT_DIPUNUSED_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" )      /* see notes */
305   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )             PORT_DIPLOCATION("SW2:1,2")
382306   PORT_DIPSETTING(      0x0200, "2" )
383307   PORT_DIPSETTING(      0x0300, "3" )
384308   PORT_DIPSETTING(      0x0100, "5" )
385309   PORT_DIPSETTING(      0x0000, DEF_STR( Infinite ) )
386   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Bonus_Life ) )
310   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Bonus_Life ) )        PORT_DIPLOCATION("SW2:3,4")
387311   PORT_DIPSETTING(      0x0c00, "120K 200K+" )
388312   PORT_DIPSETTING(      0x0800, "200K+" )
389313   PORT_DIPSETTING(      0x0400, "250K+" )
390314   PORT_DIPSETTING(      0x0000, "200K" )
391   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Difficulty ) )
315   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Difficulty ) )        PORT_DIPLOCATION("SW2:5,6")
392316   PORT_DIPSETTING(      0x0000, DEF_STR( Easy ) )
393317   PORT_DIPSETTING(      0x3000, DEF_STR( Normal ) )
394318   PORT_DIPSETTING(      0x2000, DEF_STR( Hard ) )
395319   PORT_DIPSETTING(      0x1000, DEF_STR( Very_Hard ) )
396   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Allow_Continue ) )
320   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Allow_Continue ) )    PORT_DIPLOCATION("SW2:7")
397321   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
398322   PORT_DIPSETTING(      0x4000, DEF_STR( Yes ) )
399   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Demo_Sounds ) )
323   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Demo_Sounds ) )       PORT_DIPLOCATION("SW2:8")
400324   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
401325   PORT_DIPSETTING(      0x8000, DEF_STR( On ) )
402326
403   PORT_START
327   PORT_START_TAG("IN0")
404328   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
405329   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
406330   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
r2241r2242
418342   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
419343   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
420344
421   PORT_START
345   PORT_START_TAG("IN1")
422346   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
423347   PORT_BIT( 0x000e, IP_ACTIVE_LOW, IPT_UNKNOWN )
424348   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START2 )
r2241r2242
427351   PORT_BIT( 0x0e00, IP_ACTIVE_LOW, IPT_UNKNOWN )
428352   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE1 )
429353   PORT_BIT( 0xe000, IP_ACTIVE_LOW, IPT_UNKNOWN )
354
355   SEIBU_COIN_INPUTS   /* coin inputs read through sound cpu */
430356INPUT_PORTS_END
431357
358
432359/* Graphics Layouts */
433360
434361static const gfx_layout textlayout =
src/mame/drivers/raiden.c
r2241r2242
9797/******************************************************************************/
9898
9999static INPUT_PORTS_START( raiden )
100   SEIBU_COIN_INPUTS   /* Must be port 0: coin inputs read through sound cpu */
100   SEIBU_COIN_INPUTS   /* coin inputs read through sound cpu */
101101
102102   PORT_START   /* IN0 */
103103   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r2241r2242
119119
120120   PORT_START   /* Dip switch A */
121121   PORT_DIPNAME( 0x0001, 0x0001, "Coin Mode" )
122   PORT_DIPSETTING(    0x0001, "A" )
123   PORT_DIPSETTING(    0x0000, "B" )
122   PORT_DIPSETTING(      0x0001, "A" )
123   PORT_DIPSETTING(      0x0000, "B" )
124124   /* Coin Mode A */
125125   PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) )
126   PORT_DIPSETTING(    0x0014, DEF_STR( 6C_1C ) )
127   PORT_DIPSETTING(    0x0016, DEF_STR( 5C_1C ) )
128   PORT_DIPSETTING(    0x0018, DEF_STR( 4C_1C ) )
129   PORT_DIPSETTING(    0x001a, DEF_STR( 3C_1C ) )
130   PORT_DIPSETTING(    0x0002, DEF_STR( 8C_3C ) )
131   PORT_DIPSETTING(    0x001c, DEF_STR( 2C_1C ) )
132   PORT_DIPSETTING(    0x0004, DEF_STR( 5C_3C ) )
133   PORT_DIPSETTING(    0x0006, DEF_STR( 3C_2C ) )
134   PORT_DIPSETTING(    0x001e, DEF_STR( 1C_1C ) )
135   PORT_DIPSETTING(    0x0008, DEF_STR( 2C_3C ) )
136   PORT_DIPSETTING(    0x0012, DEF_STR( 1C_2C ) )
137   PORT_DIPSETTING(    0x0010, DEF_STR( 1C_3C ) )
138   PORT_DIPSETTING(    0x000e, DEF_STR( 1C_4C ) )
139   PORT_DIPSETTING(    0x000c, DEF_STR( 1C_5C ) )
140   PORT_DIPSETTING(    0x000a, DEF_STR( 1C_6C ) )
141   PORT_DIPSETTING(    0x0000, DEF_STR( Free_Play ) )
126   PORT_DIPSETTING(      0x0014, DEF_STR( 6C_1C ) )
127   PORT_DIPSETTING(      0x0016, DEF_STR( 5C_1C ) )
128   PORT_DIPSETTING(      0x0018, DEF_STR( 4C_1C ) )
129   PORT_DIPSETTING(      0x001a, DEF_STR( 3C_1C ) )
130   PORT_DIPSETTING(      0x0002, DEF_STR( 8C_3C ) )
131   PORT_DIPSETTING(      0x001c, DEF_STR( 2C_1C ) )
132   PORT_DIPSETTING(      0x0004, DEF_STR( 5C_3C ) )
133   PORT_DIPSETTING(      0x0006, DEF_STR( 3C_2C ) )
134   PORT_DIPSETTING(      0x001e, DEF_STR( 1C_1C ) )
135   PORT_DIPSETTING(      0x0008, DEF_STR( 2C_3C ) )
136   PORT_DIPSETTING(      0x0012, DEF_STR( 1C_2C ) )
137   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )
138   PORT_DIPSETTING(      0x000e, DEF_STR( 1C_4C ) )
139   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_5C ) )
140   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_6C ) )
141   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
142142/*  PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) )
143    PORT_DIPSETTING(    0x0000, "5C/1C or Free if Coin B too" )
144    PORT_DIPSETTING(    0x0002, DEF_STR( 3C_1C ) )
145    PORT_DIPSETTING(    0x0004, DEF_STR( 2C_1C ) )
146    PORT_DIPSETTING(    0x0006, DEF_STR( 1C_1C ) )
143    PORT_DIPSETTING(      0x0000, "5C/1C or Free if Coin B too" )
144    PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )
145    PORT_DIPSETTING(      0x0004, DEF_STR( 2C_1C ) )
146    PORT_DIPSETTING(      0x0006, DEF_STR( 1C_1C ) )
147147    PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Coin_B ) )
148    PORT_DIPSETTING(    0x0018, DEF_STR( 1C_2C ) )
149    PORT_DIPSETTING(    0x0010, DEF_STR( 1C_3C ) )
150    PORT_DIPSETTING(    0x0008, DEF_STR( 1C_5C ) )
151    PORT_DIPSETTING(    0x0000, "1C/6C or Free if Coin A too" ) */
148    PORT_DIPSETTING(      0x0018, DEF_STR( 1C_2C ) )
149    PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )
150    PORT_DIPSETTING(      0x0008, DEF_STR( 1C_5C ) )
151    PORT_DIPSETTING(      0x0000, "1C/6C or Free if Coin A too" ) */
152152   PORT_DIPNAME( 0x0020, 0x0020, "Credits to Start" )
153   PORT_DIPSETTING(    0x0020, "1" )
154   PORT_DIPSETTING(    0x0000, "2" )
153   PORT_DIPSETTING(      0x0020, "1" )
154   PORT_DIPSETTING(      0x0000, "2" )
155155   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
156   PORT_DIPSETTING(    0x0040, DEF_STR( Off ) )
157   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
156   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
157   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
158158   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )
159   PORT_DIPSETTING(    0x0080, DEF_STR( Off ) )
160   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
159   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
160   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
161161   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
162   PORT_DIPSETTING(    0x0200, "1" )
163   PORT_DIPSETTING(    0x0100, "2" )
164   PORT_DIPSETTING(    0x0300, "3" )
165   PORT_DIPSETTING(    0x0000, "5" )
162   PORT_DIPSETTING(      0x0200, "1" )
163   PORT_DIPSETTING(      0x0100, "2" )
164   PORT_DIPSETTING(      0x0300, "3" )
165   PORT_DIPSETTING(      0x0000, "5" )
166166   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Bonus_Life ) )
167   PORT_DIPSETTING(    0x0800, "80000 300000" )
168   PORT_DIPSETTING(    0x0c00, "150000 400000" )
169   PORT_DIPSETTING(    0x0400, "300000 1000000" )
170   PORT_DIPSETTING(    0x0000, "1000000 5000000" )
167   PORT_DIPSETTING(      0x0800, "80000 300000" )
168   PORT_DIPSETTING(      0x0c00, "150000 400000" )
169   PORT_DIPSETTING(      0x0400, "300000 1000000" )
170   PORT_DIPSETTING(      0x0000, "1000000 5000000" )
171171   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Difficulty ) )
172   PORT_DIPSETTING(    0x2000, DEF_STR( Easy ) )
173   PORT_DIPSETTING(    0x3000, DEF_STR( Normal ) )
174   PORT_DIPSETTING(    0x1000, DEF_STR( Hard ) )
175   PORT_DIPSETTING(    0x0000, DEF_STR( Very_Hard ) )
172   PORT_DIPSETTING(      0x2000, DEF_STR( Easy ) )
173   PORT_DIPSETTING(      0x3000, DEF_STR( Normal ) )
174   PORT_DIPSETTING(      0x1000, DEF_STR( Hard ) )
175   PORT_DIPSETTING(      0x0000, DEF_STR( Very_Hard ) )
176176   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Allow_Continue ) )
177   PORT_DIPSETTING(    0x0000, DEF_STR( No ) )
178   PORT_DIPSETTING(    0x4000, DEF_STR( Yes ) )
177   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
178   PORT_DIPSETTING(      0x4000, DEF_STR( Yes ) )
179179   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Demo_Sounds ) )
180   PORT_DIPSETTING(    0x0000, DEF_STR( Off ) )
181   PORT_DIPSETTING(    0x8000, DEF_STR( On ) )
180   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
181   PORT_DIPSETTING(      0x8000, DEF_STR( On ) )
182182INPUT_PORTS_END
183183
184184/******************************************************************************/
src/mame/drivers/fromanc2.c
r2241r2242
194194
195195static WRITE16_HANDLER( fromanc2_eeprom_w )
196196{
197   if (ACCESSING_MSB) {
197   if (ACCESSING_BITS_8_15) {
198198      // latch the bit
199199      EEPROM_write_bit(data & 0x0100);
200200
r2241r2242
208208
209209static WRITE16_HANDLER( fromancr_eeprom_w )
210210{
211   if (ACCESSING_LSB) {
211   if (ACCESSING_BITS_0_7) {
212212      fromancr_gfxbank_w(data & 0xfff8);
213213
214214      // latch the bit
r2241r2242
224224
225225static WRITE16_HANDLER( fromanc4_eeprom_w )
226226{
227   if (ACCESSING_LSB) {
227   if (ACCESSING_BITS_0_7) {
228228      // latch the bit
229229      EEPROM_write_bit(data & 0x0004);
230230
src/mame/drivers/unico.c
r2241r2242
3838***************************************************************************/
3939
4040static READ16_HANDLER ( YM3812_status_port_0_msb_r )   {   return YM3812_status_port_0_r(machine,0) << 8;   }
41static WRITE16_HANDLER( YM3812_register_port_0_msb_w )   {   if (ACCESSING_MSB)   YM3812_control_port_0_w(machine,0,data >> 8);   }
42static WRITE16_HANDLER( YM3812_data_port_0_msb_w )      {   if (ACCESSING_MSB)   YM3812_write_port_0_w(machine,0,data >> 8);      }
41static WRITE16_HANDLER( YM3812_register_port_0_msb_w )   {   if (ACCESSING_BITS_8_15)   YM3812_control_port_0_w(machine,0,data >> 8);   }
42static WRITE16_HANDLER( YM3812_data_port_0_msb_w )      {   if (ACCESSING_BITS_8_15)   YM3812_write_port_0_w(machine,0,data >> 8);      }
4343
4444
4545/*
r2241r2242
5454
5555static WRITE16_HANDLER( burglarx_sound_bank_w )
5656{
57   if (ACCESSING_MSB)
57   if (ACCESSING_BITS_8_15)
5858   {
5959      int bank = (data >> 8 ) & 1;
6060      OKIM6295_set_bank_base(0, 0x40000 * bank );
r2241r2242
109109
110110static WRITE16_HANDLER( zeropnt_sound_bank_w )
111111{
112   if (ACCESSING_MSB)
112   if (ACCESSING_BITS_8_15)
113113   {
114114      /* Banked sound samples. The 3rd quarter of the ROM
115115           contains garbage. Indeed, only banks 0&1 are used */
r2241r2242
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; }
229static WRITE32_HANDLER( zeropnt2_oki0_w )         { if ((mem_mask & 0x00ff0000) == 0)   OKIM6295_data_0_w(machine,0,(data >> 16) & 0xff); }
230static WRITE32_HANDLER( zeropnt2_oki1_w )         { if ((mem_mask & 0x00ff0000) == 0)   OKIM6295_data_1_w(machine,0,(data >> 16) & 0xff); }
229static WRITE32_HANDLER( zeropnt2_oki0_w )         { if (ACCESSING_BITS_16_23)   OKIM6295_data_0_w(machine,0,(data >> 16) & 0xff); }
230static WRITE32_HANDLER( zeropnt2_oki1_w )         { if (ACCESSING_BITS_16_23)   OKIM6295_data_1_w(machine,0,(data >> 16) & 0xff); }
231231
232232static READ32_HANDLER( zeropnt2_ym2151_status_r )   { return YM2151_status_port_0_r(machine,0) << 16; }
233static WRITE32_HANDLER( zeropnt2_ym2151_reg_w )      { if ((mem_mask & 0x00ff0000) == 0)   YM2151_register_port_0_w(machine,0,(data >> 16) & 0xff); }
234static WRITE32_HANDLER( zeropnt2_ym2151_data_w )   { if ((mem_mask & 0x00ff0000) == 0)   YM2151_data_port_0_w(machine,0,(data >> 16) & 0xff); }
233static WRITE32_HANDLER( zeropnt2_ym2151_reg_w )      { if (ACCESSING_BITS_16_23)   YM2151_register_port_0_w(machine,0,(data >> 16) & 0xff); }
234static WRITE32_HANDLER( zeropnt2_ym2151_data_w )   { if (ACCESSING_BITS_16_23)   YM2151_data_port_0_w(machine,0,(data >> 16) & 0xff); }
235235
236236static WRITE32_HANDLER( zeropnt2_sound_bank_w )
237237{
238   if (ACCESSING_MSB32)
238   if (ACCESSING_BITS_24_31)
239239   {
240240      int bank = ((data >> 24) & 3) % 4;
241241      UINT8 *dst   = memory_region(REGION_SOUND1);
r2241r2242
246246
247247static WRITE32_HANDLER( zeropnt2_leds_w )
248248{
249   if ((mem_mask & 0x00ff0000) == 0)
249   if (ACCESSING_BITS_16_23)
250250   {
251251      coin_counter_w(0,data & 0x00010000);
252252      set_led_status(0,data & 0x00800000);   // Start 1
r2241r2242
259259   if (data & ~0xfe00000)
260260      logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",activecpu_get_pc(),data);
261261
262   if ( ACCESSING_MSB32 )
262   if ( ACCESSING_BITS_24_31 )
263263   {
264264      // latch the bit
265265      EEPROM_write_bit(data & 0x04000000);
src/mame/drivers/diverboy.c
r2241r2242
5959
6060static WRITE16_HANDLER( soundcmd_w )
6161{
62   if (ACCESSING_LSB)
62   if (ACCESSING_BITS_0_7)
6363   {
6464      soundlatch_w(machine,0,data & 0xff);
6565      cpunum_set_input_line(machine, 1,0,HOLD_LINE);
src/mame/drivers/superchs.c
r2241r2242
6363static WRITE16_HANDLER( shared_ram_w )
6464{
6565   if ((offset&1)==0) {
66      if (ACCESSING_MSB)
66      if (ACCESSING_BITS_8_15)
6767         shared_ram[offset/2]=(shared_ram[offset/2]&0x00ffffff)|((data&0xff00)<<16);
68      if (ACCESSING_LSB)
68      if (ACCESSING_BITS_0_7)
6969         shared_ram[offset/2]=(shared_ram[offset/2]&0xff00ffff)|((data&0x00ff)<<16);
7070   } else {
71      if (ACCESSING_MSB)
71      if (ACCESSING_BITS_8_15)
7272         shared_ram[offset/2]=(shared_ram[offset/2]&0xffff00ff)|((data&0xff00)<< 0);
73      if (ACCESSING_LSB)
73      if (ACCESSING_BITS_0_7)
7474         shared_ram[offset/2]=(shared_ram[offset/2]&0xffffff00)|((data&0x00ff)<< 0);
7575   }
7676}
r2241r2242
8686    is there an irq enable in the top nibble?
8787    */
8888
89   if (ACCESSING_MSB)
89   if (ACCESSING_BITS_8_15)
9090   {
9191      cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data &0x200) ? CLEAR_LINE : ASSERT_LINE);
9292      if (data&0x8000) cpunum_set_input_line(Machine, 0,3,HOLD_LINE); /* Guess */
9393   }
9494
95   if (ACCESSING_LSB32)
95   if (ACCESSING_BITS_0_7)
9696   {
9797      /* Lamp control bits of some sort in the lsb */
9898   }
r2241r2242
143143   {
144144      case 0x00:
145145      {
146         if (ACCESSING_MSB32)   /* $300000 is watchdog */
146         if (ACCESSING_BITS_24_31)   /* $300000 is watchdog */
147147         {
148148            watchdog_reset(machine);
149149         }
150150
151         if (ACCESSING_LSB32)
151         if (ACCESSING_BITS_0_7)
152152         {
153153            EEPROM_set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
154154            EEPROM_write_bit(data & 0x40);
r2241r2242
163163
164164      case 0x01:
165165      {
166         if (ACCESSING_MSB32)
166         if (ACCESSING_BITS_24_31)
167167         {
168168            coin_lockout_w(0,~data & 0x01000000);
169169            coin_lockout_w(1,~data & 0x02000000);
src/mame/drivers/dreamwld.c
r2241r2242
226226
227227static WRITE32_HANDLER(dreamwld_6295_0_w)
228228{
229   if (!(mem_mask & 0xff000000))
229   if (ACCESSING_BITS_24_31)
230230   {
231231      OKIM6295_data_0_w(machine, 0, (data>>24) & 0xff);
232232   }
r2241r2242
248248
249249static WRITE32_HANDLER( dreamwld_6295_0_bank_w )
250250{
251   if (!(mem_mask & 0x000000ff))
251   if (ACCESSING_BITS_0_7)
252252   {
253253      dreamwld_oki_setbank(0,data&0x3);
254254   }
r2241r2242
265265
266266static WRITE32_HANDLER(dreamwld_6295_1_w)
267267{
268   if (!(mem_mask & 0xff000000))
268   if (ACCESSING_BITS_24_31)
269269   {
270270      OKIM6295_data_1_w(machine, 0, (data>>24) & 0xff);
271271   }
r2241r2242
277277
278278static WRITE32_HANDLER( dreamwld_6295_1_bank_w )
279279{
280   if (!(mem_mask & 0x000000ff))
280   if (ACCESSING_BITS_0_7)
281281   {
282282      dreamwld_oki_setbank(1,data&0x3);
283283   }
src/mame/drivers/galdrvr.c
r0r2242
1/*************************************
2 *
3 *  Input Ports
4 *  Galaxian-derived games
5 *
6 *************************************/
7
8INPUT_PORTS_START( galaxian )
9   PORT_START_TAG("IN0")
10   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
11   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
12   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
13   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
14   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
15   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
16   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
17   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
18   PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
19   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
20
21   PORT_START_TAG("IN1")
22   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
23   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
24   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
25   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
26   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
27   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
28   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
29   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
30   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
31   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
32   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
33
34   PORT_START_TAG("IN2")
35   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ) )
36   PORT_DIPSETTING(    0x00, "7000" )
37   PORT_DIPSETTING(    0x01, "10000" )
38   PORT_DIPSETTING(    0x02, "12000" )
39   PORT_DIPSETTING(    0x03, "20000" )
40   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )
41   PORT_DIPSETTING(    0x00, "2" )
42   PORT_DIPSETTING(    0x04, "3" )
43   PORT_DIPUNUSED( 0x08, 0x00 )
44   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
45INPUT_PORTS_END
46
47
48INPUT_PORTS_START( superg )
49   PORT_INCLUDE(galaxian)
50
51   PORT_MODIFY("IN2")
52   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) )
53   PORT_DIPSETTING(    0x01, "4000" )
54   PORT_DIPSETTING(    0x02, "5000" )
55   PORT_DIPSETTING(    0x03, "7000" )
56   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
57   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
58   PORT_DIPSETTING(    0x00, "3" )
59   PORT_DIPSETTING(    0x04, "5" )
60INPUT_PORTS_END
61
62
63static INPUT_PORTS_START( galtaito )
64   PORT_INCLUDE(galaxian)
65
66   PORT_MODIFY("IN2")
67   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) )
68   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
69   PORT_DIPSETTING(    0x01, "4000" )
70   PORT_DIPSETTING(    0x02, "5000" )
71   PORT_DIPSETTING(    0x03, "7000" )
72   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
73   PORT_DIPSETTING(    0x00, "3" )
74   PORT_DIPSETTING(    0x04, "5" )
75   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
76   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
77   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
78INPUT_PORTS_END
79
80
81INPUT_PORTS_START( swarm )
82   PORT_INCLUDE(galaxian)
83
84   PORT_MODIFY("IN2")
85   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ) )
86   PORT_DIPSETTING(    0x01, "10000" )
87   PORT_DIPSETTING(    0x02, "20000" )
88   PORT_DIPSETTING(    0x03, "40000" )
89   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
90   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
91   PORT_DIPSETTING(    0x00, "3" )
92   PORT_DIPSETTING(    0x04, "4" )
93   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Difficulty ) )   /* aliens "flying" simultaneously */
94   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )            /* less aliens */
95   PORT_DIPSETTING(    0x08, DEF_STR( Hard ) )            /* more aliens */
96INPUT_PORTS_END
97
98
99INPUT_PORTS_START( zerotime )
100   PORT_INCLUDE(galaxian)
101
102   PORT_MODIFY("IN1")
103   PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Coinage ) )
104   PORT_DIPSETTING(    0x40, "A 1C/1C 2C/2C  B 1C/2C" )
105   PORT_DIPSETTING(    0xc0, "A 1C/1C 2C/3C  B 1C/3C" )
106   PORT_DIPSETTING(    0x00, "A 1C/2C 2C/4C  B 1C/4C" )
107   PORT_DIPSETTING(    0x80, "A 1C/2C 2C/5C  B 1C/5C" )
108
109   PORT_MODIFY("IN2")
110   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Bonus_Life ) )
111   PORT_DIPSETTING(    0x03, "6000" )
112   PORT_DIPSETTING(    0x02, "7000" )
113   PORT_DIPSETTING(    0x01, "9000" )
114   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
115   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
116   PORT_DIPSETTING(    0x00, "3" )
117   PORT_DIPSETTING(    0x04, "5" )
118   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Difficulty ) )   /* player's bullet speed */
119   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )            /* gap of 6 pixels */
120   PORT_DIPSETTING(    0x08, DEF_STR( Hard ) )            /* gap of 8 pixels */
121INPUT_PORTS_END
122
123
124INPUT_PORTS_START( blkhole )
125   PORT_INCLUDE(galaxian)
126
127   PORT_MODIFY("IN0")
128   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
129   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
130   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
131   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
132
133   PORT_MODIFY("IN1")
134   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
135   PORT_DIPSETTING(    0xc0, DEF_STR( 2C_1C ) )
136   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
137   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
138   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
139
140   PORT_MODIFY("IN2")
141   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
142   PORT_DIPSETTING(    0x00, "5000" )
143   PORT_DIPSETTING(    0x01, "10000" )
144   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) )
145   PORT_DIPSETTING(    0x02, DEF_STR( Upright ) )
146   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
147   PORT_DIPUNUSED( 0x04, 0x00 )
148   PORT_DIPUNUSED( 0x08, 0x00 )
149INPUT_PORTS_END
150
151
152INPUT_PORTS_START( orbitron )
153   PORT_INCLUDE(galaxian)
154
155   PORT_MODIFY("IN0")
156   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
157   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
158   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
159   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
160   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
161
162   PORT_MODIFY("IN1")
163   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
164   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
165   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Coinage ) )      /* Routine at 0x00e1 */
166   PORT_DIPSETTING(    0x00, "A 2C/1C  B 1C/3C" )
167//  PORT_DIPSETTING(    0x20, "A 2C/1C  B 1C/3C" )
168   PORT_DIPSETTING(    0x40, "A 1C/1C  B 1C/6C" )
169//  PORT_DIPSETTING(    0x60, "A 1C/1C  B 1C/6C" )
170   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
171
172   PORT_MODIFY("IN2")
173   PORT_DIPUNUSED( 0x01, 0x00 )
174   PORT_DIPUNUSED( 0x02, 0x00 )
175   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
176   PORT_DIPSETTING(    0x04, "2" )
177   PORT_DIPSETTING(    0x00, "3" )
178   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
179   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
180   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
181INPUT_PORTS_END
182
183
184/* These inputs are clearly wrong, they need a full test */
185INPUT_PORTS_START( luctoday )
186   PORT_START_TAG("IN0")
187   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
188   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
189   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_NAME("Add Credit to Bet")
190   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_NAME("Remove Credit from Bet")
191   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
192   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
193   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
194   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BILL1 )
195
196   PORT_START_TAG("IN1")
197   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
198   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
199   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
200   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
201   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
202   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
203   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
204   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
205
206   PORT_START_TAG("IN2")
207   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
208   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
209   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
210   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
211INPUT_PORTS_END
212
213
214INPUT_PORTS_START( catacomb )
215   PORT_INCLUDE(galaxian)
216
217   PORT_MODIFY("IN0")
218   PORT_DIPUNKNOWN( 0x40, 0x00 )
219   PORT_DIPUNKNOWN( 0x80, 0x00 )
220
221   PORT_MODIFY("IN1")
222   PORT_DIPUNKNOWN( 0x20, 0x00 )
223   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_A ) )
224   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
225   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
226   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coin_B ) )
227   PORT_DIPSETTING(    0x00, DEF_STR( 1C_3C ) )
228   PORT_DIPSETTING(    0x80, DEF_STR( 1C_5C ) )
229
230   PORT_MODIFY("IN2")
231   PORT_DIPUNKNOWN( 0x01, 0x00 )
232   PORT_DIPUNKNOWN( 0x02, 0x00 )
233   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )
234   PORT_DIPSETTING(    0x04, "3" )
235   PORT_DIPSETTING(    0x00, "5" )
236   PORT_DIPUNKNOWN( 0x08, 0x00 )
237INPUT_PORTS_END
238
239
240INPUT_PORTS_START( omega )
241   PORT_INCLUDE(galaxian)
242
243   PORT_MODIFY("IN0")
244   PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED )
245
246   PORT_MODIFY("IN1")
247   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
248   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_A ) )
249   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
250   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
251   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coin_B ) )
252   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
253   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
254
255   PORT_MODIFY("IN2")
256   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
257   PORT_DIPSETTING(    0x00, "10000" )
258   PORT_DIPSETTING(    0x01, "20000" )
259   PORT_DIPUNUSED( 0x02, 0x00 )
260   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
261   PORT_DIPSETTING(    0x00, "3" )
262   PORT_DIPSETTING(    0x04, "5" )
263   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
264   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
265   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
266INPUT_PORTS_END
267
268
269INPUT_PORTS_START( warofbug )
270   PORT_INCLUDE(galaxian)
271
272   PORT_MODIFY("IN0")
273   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
274   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
275   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
276   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
277   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
278
279   PORT_MODIFY("IN1")
280   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
281   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
282   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
283   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
284   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
285   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
286//  PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
287   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
288
289   PORT_MODIFY("IN2")
290   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
291   PORT_DIPSETTING(    0x00, "1" )
292   PORT_DIPSETTING(    0x01, "2" )
293   PORT_DIPSETTING(    0x02, "3" )
294   PORT_DIPSETTING(    0x03, "4" )
295   PORT_DIPUNUSED( 0x04, 0x00 )
296   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Bonus_Life ) )
297   PORT_DIPSETTING(    0x08, "500000" )
298   PORT_DIPSETTING(    0x00, "750000" )
299INPUT_PORTS_END
300
301
302INPUT_PORTS_START( redufo )
303   PORT_INCLUDE(galaxian)
304
305   PORT_MODIFY("IN1")
306   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
307   PORT_DIPSETTING(    0x40, "A 2C/1C  B 1C/3C" )
308   PORT_DIPSETTING(    0x00, "A 1C/1C  B 1C/6C" )
309   PORT_DIPSETTING(    0x80, "A 1C/2C  B 1C/12C" )
310   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
311
312   PORT_MODIFY("IN2")
313   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) )
314   PORT_DIPSETTING(    0x01, "4000" )
315   PORT_DIPSETTING(    0x02, "5000" )
316   PORT_DIPSETTING(    0x03, "7000" )
317   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
318   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
319   PORT_DIPSETTING(    0x00, "3" )
320   PORT_DIPSETTING(    0x04, "5" )
321INPUT_PORTS_END
322
323
324INPUT_PORTS_START( exodus )
325   PORT_INCLUDE(galaxian)
326
327   PORT_MODIFY("IN0")
328   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
329   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )      // Not tested due to code removed at 0x1901 and 0x191a
330
331   PORT_MODIFY("IN1")
332   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_B ) )
333   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
334   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
335   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coin_A ) )
336   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
337   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
338
339   PORT_MODIFY("IN2")
340   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
341   PORT_DIPSETTING(    0x00, "7000" )
342   PORT_DIPSETTING(    0x01, DEF_STR( None ) )
343   PORT_DIPUNUSED( 0x02, 0x00 )                  // Not read due to code at 0x012b
344   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
345   PORT_DIPSETTING(    0x00, "3" )
346   PORT_DIPSETTING(    0x04, "5" )
347   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
348   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
349   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
350INPUT_PORTS_END
351
352
353INPUT_PORTS_START( azurian )
354   PORT_START_TAG("IN0")
355   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
356   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
357   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
358   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
359   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 )
360   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 )
361   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
362   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
363
364   PORT_START_TAG("IN1")
365   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
366   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
367   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
368   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
369   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
370   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
371   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(azurian_port_r, (void *)0) /* "linked" with bit 2 of IN2 */
372   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Lives ) )
373   PORT_DIPSETTING(    0x00, "3" )
374   PORT_DIPSETTING(    0x80, "5" )
375
376   PORT_START_TAG("IN2")
377   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) )
378   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
379   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
380   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Bonus_Life ) )
381   PORT_DIPSETTING(    0x00, "5000" )
382   PORT_DIPSETTING(    0x02, "7000" )
383   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(azurian_port_r, (void *)1) /* "linked" with bit 6 of IN1 */
384   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
385   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
386   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
387   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
388
389   PORT_START_TAG("FAKE")      /* fake port to handle routine at 0x05b3 that stores value at 0x40f4 */
390   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Difficulty ) )
391   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
392   PORT_DIPSETTING(    0x01, DEF_STR( Normal ) )
393   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
394   PORT_DIPSETTING(    0x00, DEF_STR( Very_Hard ) )
395INPUT_PORTS_END
396
397
398INPUT_PORTS_START( pisces )
399   PORT_INCLUDE(galaxian)
400
401   PORT_MODIFY("IN0")
402   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 )
403   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
404   PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED )
405
406   PORT_MODIFY("IN1")
407   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Lives ) )
408   PORT_DIPSETTING(    0x00, "3" )
409   PORT_DIPSETTING(    0x40, "4" )
410   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
411   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
412   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
413
414   PORT_MODIFY("IN2")
415   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
416   PORT_DIPSETTING(    0x00, "10000" )
417   PORT_DIPSETTING(    0x01, "20000" )
418   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Coinage ) )
419   PORT_DIPSETTING(    0x02, "A 2C/1C  B 1C/3C" )
420   PORT_DIPSETTING(    0x00, "A 1C/1C  B 1C/6C" )
421   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Difficulty ) )
422   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
423   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
424INPUT_PORTS_END
425
426
427INPUT_PORTS_START( piscesb )
428   PORT_INCLUDE(pisces)
429
430   PORT_MODIFY("IN2")
431   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Coinage ) )
432   PORT_DIPSETTING(    0x02, "A 2C/1C  B 1C/2C 2C/5C" )
433   PORT_DIPSETTING(    0x00, "A 1C/1C  B 1C/5C" )
434INPUT_PORTS_END
435
436
437INPUT_PORTS_START( gteikokb )
438   PORT_INCLUDE(galaxian)
439
440   PORT_MODIFY("IN0")
441   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
442   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )      /* Not tested due to code removed at 0x00ab, 0x1b26 and 0x1c97*/
443   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )      /* Not tested due to code removed at 0x1901*/
444
445   PORT_MODIFY("IN1")
446   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_A ) )
447   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
448   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
449   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coin_B ) )
450   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
451   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
452
453   PORT_MODIFY("IN2")
454   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
455   PORT_DIPSETTING(    0x00, "7000" )
456   PORT_DIPSETTING(    0x01, DEF_STR( None ) )
457   PORT_DIPUNUSED( 0x02, 0x00 )                  // Not read due to code at 0x012b
458   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
459   PORT_DIPSETTING(    0x00, "3" )
460   PORT_DIPSETTING(    0x04, "5" )
461   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
462   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
463   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
464INPUT_PORTS_END
465
466
467INPUT_PORTS_START( gteikob2 )
468   PORT_INCLUDE(gteikokb)
469
470   PORT_MODIFY("IN2")
471   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
472   PORT_DIPSETTING(    0x08, DEF_STR( Upright ) )
473   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
474INPUT_PORTS_END
475
476
477INPUT_PORTS_START( spacbatt )
478   PORT_INCLUDE(galaxian)
479
480   PORT_MODIFY("IN1")
481   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
482   PORT_DIPSETTING(    0x40, "A 2C/1C  B 1C/3C" )
483   PORT_DIPSETTING(    0x00, "A 1C/1C  B 1C/6C" )
484   PORT_DIPSETTING(    0x80, "A 1C/2C  B 1C/6C" )
485   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
486
487   PORT_MODIFY("IN2")
488   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) )
489   PORT_DIPSETTING(    0x01, "4000" )
490   PORT_DIPSETTING(    0x02, "5000" )
491   PORT_DIPSETTING(    0x03, "7000" )
492   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
493   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
494   PORT_DIPSETTING(    0x00, "3" )
495   PORT_DIPSETTING(    0x04, "5" )
496INPUT_PORTS_END
497
498
499INPUT_PORTS_START( batman2 )
500   PORT_INCLUDE(galaxian)
501
502   PORT_MODIFY("IN0")
503   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
504   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
505   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 )
506
507   PORT_MODIFY("IN1")
508   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_A ) )
509   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
510   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
511   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coin_B ) )
512   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
513   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
514
515   PORT_MODIFY("IN2")
516   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
517   PORT_DIPSETTING(    0x00, "30000" )
518   PORT_DIPSETTING(    0x01, "50000" )
519   PORT_DIPUNUSED( 0x02, 0x00 )
520   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
521   PORT_DIPSETTING(    0x00, "3" )
522   PORT_DIPSETTING(    0x04, "5" )
523   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
524   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
525   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
526INPUT_PORTS_END
527
528
529INPUT_PORTS_START( streakng )
530   PORT_START_TAG("IN0")
531   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
532   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
533   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
534   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
535   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
536   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
537   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
538   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
539   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
540   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
541
542   PORT_START_TAG("IN1")
543   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
544   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
545   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
546   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
547   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
548   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
549   PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Bonus_Life ) )
550   PORT_DIPSETTING(    0x40, "10000" )
551   PORT_DIPSETTING(    0x80, "15000" )
552   PORT_DIPSETTING(    0xc0, "20000" )
553   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
554
555   PORT_START_TAG("IN2")
556   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Coinage ) )
557   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
558   PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
559   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
560   PORT_DIPSETTING(    0x03, DEF_STR( Free_Play ) )
561   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ) )
562   PORT_DIPSETTING(    0x0c, "1" )
563   PORT_DIPSETTING(    0x08, "2" )
564   PORT_DIPSETTING(    0x04, "3" )
565   PORT_DIPSETTING(    0x00, "5" )
566   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
567INPUT_PORTS_END
568
569
570INPUT_PORTS_START( pacmanbl )
571   PORT_START_TAG("IN0")
572   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
573   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
574   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
575   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
576   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
577   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
578   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
579   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
580
581   PORT_START_TAG("IN1")
582   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
583   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
584   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
585   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
586   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
587   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
588   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_A ) )
589   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
590   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
591   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coin_B ) )
592   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
593   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
594
595   PORT_START_TAG("IN2")
596   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
597   PORT_DIPSETTING(    0x00, "15000" )
598   PORT_DIPSETTING(    0x01, "20000" )
599   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Difficulty ) )
600   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
601   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
602   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
603   PORT_DIPSETTING(    0x00, "3" )
604   PORT_DIPSETTING(    0x04, "5" )
605   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
606   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
607   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
608   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
609INPUT_PORTS_END
610
611
612INPUT_PORTS_START( devilfsg )
613   PORT_INCLUDE(pacmanbl)
614
615   PORT_MODIFY("IN0")
616   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
617
618   PORT_MODIFY("IN1")
619   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
620
621   PORT_MODIFY("IN2")
622   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
623   PORT_DIPSETTING(    0x00, "10000" )
624   PORT_DIPSETTING(    0x01, "15000" )
625   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
626   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
627   PORT_DIPSETTING(    0x00, "4" )
628   PORT_DIPSETTING(    0x04, "5" )
629INPUT_PORTS_END
630
631
632INPUT_PORTS_START( zigzag )
633   PORT_START_TAG("IN0")
634   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
635   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
636   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
637   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
638   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
639   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
640   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
641   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
642
643   PORT_START_TAG("IN1")
644   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
645   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
646   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
647   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
648   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
649   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
650   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
651   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
652   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
653   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
654   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
655
656   PORT_START_TAG("IN2")
657   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) )
658   PORT_DIPSETTING(    0x00, "3" )
659   PORT_DIPSETTING(    0x01, "4" )
660   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) )
661   PORT_DIPSETTING(    0x02, DEF_STR( Upright ) )
662   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
663   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
664   PORT_DIPSETTING(    0x00, "10000 60000" )
665   PORT_DIPSETTING(    0x04, "20000 60000" )
666   PORT_DIPSETTING(    0x08, "30000 60000" )
667   PORT_DIPSETTING(    0x0c, "40000 60000" )
668   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
669INPUT_PORTS_END
670
671
672INPUT_PORTS_START( gmgalax )
673   PORT_START_TAG("IN0")
674   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(gmgalax_port_r, "GMIN0\0GLIN0")
675
676   PORT_START_TAG("IN1")
677   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(gmgalax_port_r, "GMIN1\0GLIN1")
678
679   PORT_START_TAG("IN2")
680   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(gmgalax_port_r, "GMIN2\0GLIN2")
681
682   PORT_START_TAG("GMIN0")      /* Ghost Muncher - IN0 */
683   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )                                    PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
684   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_4WAY PORT_COCKTAIL     PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
685   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY                PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
686   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY               PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
687   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )                                 PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
688   PORT_DIPNAME( 0x20, 0x00, "Ghost Muncher - Cabinet" )                        PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
689   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
690   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
691   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY                PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
692   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY                  PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
693
694   PORT_START_TAG("GMIN1")      /* Ghost Muncher - IN1 */
695   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )                                 PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
696   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )                                 PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
697   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL    PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
698   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
699   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )                                PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
700   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL    PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
701   PORT_DIPNAME( 0xc0, 0x40, "Ghost Muncher - Bonus Life" )                     PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
702   PORT_DIPSETTING(    0x40, "10000" )
703   PORT_DIPSETTING(    0x80, "15000" )
704   PORT_DIPSETTING(    0xc0, "20000" )
705   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
706
707   PORT_START_TAG("GMIN2")      /* Ghost Muncher - IN2 */
708   PORT_DIPNAME( 0x03, 0x02, "Ghost Muncher - Coinage" )                        PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
709   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
710   PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
711   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
712   PORT_DIPSETTING(    0x03, DEF_STR( Free_Play ) )
713   PORT_DIPNAME( 0x0c, 0x04, "Ghost Muncher - Lives" )                            PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
714   PORT_DIPSETTING(    0x0c, "1" )
715   PORT_DIPSETTING(    0x08, "2" )
716   PORT_DIPSETTING(    0x04, "3" )
717   PORT_DIPSETTING(    0x00, "5" )
718   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
719
720   PORT_START_TAG("GLIN0")      /* Galaxian - IN0 */
721   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )                                  PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
722   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )                                  PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
723   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY                PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
724   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY               PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
725   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )                                PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
726   PORT_DIPNAME( 0x20, 0x00, "Galaxian - Cabinet" )                             PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
727   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
728   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
729   PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )                                         PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
730   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )                               PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
731
732   PORT_START_TAG("GLIN1")      /* Galaxian - IN1 */
733   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )                                 PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
734   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )                                 PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
735   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL    PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
736   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
737   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL                    PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
738   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )                                PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
739   PORT_DIPNAME( 0xc0, 0x00, "Galaxian - Coinage" )                            PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
740   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
741   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
742   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
743   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
744
745   PORT_START_TAG("GLIN2")      /* Galaxian - IN2 */
746   PORT_DIPNAME( 0x03, 0x01, "Galaxian - Bonus Life" )                          PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
747   PORT_DIPSETTING(    0x01, "4000" )
748   PORT_DIPSETTING(    0x02, "5000" )
749   PORT_DIPSETTING(    0x03, "7000" )
750   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
751   PORT_DIPNAME( 0x04, 0x00, "Galaxian - Lives" )                               PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
752   PORT_DIPSETTING(    0x00, "3" )
753   PORT_DIPSETTING(    0x04, "5" )
754   PORT_DIPUNUSED( 0x08, 0x00 )
755   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
756
757   PORT_START_TAG("GAMESEL")      /* fake - game select */
758   PORT_BIT( 0x01, 0x00, IPT_DIPSWITCH_NAME ) PORT_NAME("Game Select") PORT_CODE(KEYCODE_F1) PORT_TOGGLE PORT_CHANGED(gmgalax_game_changed, NULL)
759   PORT_DIPSETTING( 0x00, "Ghost Muncher" )
760   PORT_DIPSETTING( 0x01, "Galaxian" )
761INPUT_PORTS_END
762
763
764
765/*************************************
766 *
767 *  Input Ports
768 *  Moon Cresta-derived games
769 *
770 *************************************/
771
772static INPUT_PORTS_START( mooncrst )
773   PORT_START_TAG("IN0")
774   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
775   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
776   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
777   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
778   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
779   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
780   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
781   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
782   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* "reset" on schematics */
783   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
784
785   PORT_START_TAG("IN1")
786   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
787   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
788   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
789   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
790   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
791   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
792   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )
793   PORT_DIPSETTING(    0x00, "30000" )
794   PORT_DIPSETTING(    0x40, "50000" )
795   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) )
796   PORT_DIPSETTING(    0x80, DEF_STR( English ) )
797   PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
798
799   PORT_START_TAG("IN2")
800   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
801   PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
802   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
803   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
804   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
805   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_B ) )
806   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
807   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
808   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
809   PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
810   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
811INPUT_PORTS_END
812
813
814static INPUT_PORTS_START( mooncrsa )
815   PORT_INCLUDE(mooncrst)
816
817   PORT_MODIFY("IN2")
818   PORT_DIPUNUSED( 0x03, IP_ACTIVE_HIGH )      /* Not used due to code at 0x01c0 */
819   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )
820   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
821   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
822   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
823   PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
824INPUT_PORTS_END
825
826
827static INPUT_PORTS_START( mooncrsg )
828   PORT_INCLUDE(mooncrst)
829
830   PORT_MODIFY("IN1")
831   PORT_DIPUNUSED( 0x80, IP_ACTIVE_HIGH )      /* Always non-Japanese due to code at 0x2f77 */
832INPUT_PORTS_END
833
834
835static INPUT_PORTS_START( fantazia )
836   PORT_INCLUDE(mooncrst)
837
838   PORT_MODIFY("IN1")
839   PORT_DIPUNUSED( 0x80, IP_ACTIVE_HIGH )      /* Always non-Japanese due to code at 0x2f53 */
840
841   PORT_MODIFY("IN2")
842   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_B ) )
843   PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
844   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
845   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
846   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
847   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_A ) )
848   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
849   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
850   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
851   PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
852INPUT_PORTS_END
853
854
855static INPUT_PORTS_START( eagle2 )
856   PORT_INCLUDE(mooncrst)
857
858   PORT_MODIFY("IN2")
859   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) )
860   PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
861   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
862   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
863   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
864   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Free_Play ) )      /* Not used due to code at 0x01c0, but "Free Play" is checked */
865   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
866//  PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
867//  PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
868   PORT_DIPSETTING(    0x0c, DEF_STR( On ) )
869INPUT_PORTS_END
870
871
872static INPUT_PORTS_START( smooncrs )
873   PORT_INCLUDE(mooncrst)
874
875   PORT_MODIFY("IN1")
876   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )         /* Not read due to code at 0x2b1c and 0x3313 */
877   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )         /* Not read due to code at 0x2b1c and 0x3313 */
878   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )         /* Not read due to code at 0x2b1c and 0x3313 */
879   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )      /* code at 0x2962 (0x2f68 in spcdrag) */
880   PORT_DIPSETTING(    0x40, DEF_STR( Easy ) )
881   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
882   PORT_DIPNAME( 0x80, 0x80, "Player's Bullet Speed" )      /* code at 0x0007 (0x2f53 in spcdrag) */
883   PORT_DIPSETTING(    0x00, "Slow" )
884   PORT_DIPSETTING(    0x80, "Fast" )
885   /* Bonus life is always '50000' due to code at 0x2f68 */
886   /* Language is always non-Japanese due to code at 0x2f53 */
887INPUT_PORTS_END
888
889
890static INPUT_PORTS_START( mooncrgx )
891   PORT_INCLUDE(mooncrst)
892
893   PORT_MODIFY("IN1")
894   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_A ) )
895   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
896   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
897   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coin_B ) )
898   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
899   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
900
901   PORT_MODIFY("IN2")
902   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Bonus_Life ) )
903   PORT_DIPSETTING(    0x01, "30000" )
904   PORT_DIPSETTING(    0x00, "50000" )
905   PORT_DIPUNUSED( 0x02, 0x00 )
906   PORT_DIPUNUSED( 0x04, 0x00 )      /* Always non-Japanese due to code removed at 0x2f4b */
907   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
908   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
909   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
910INPUT_PORTS_END
911
912
913INPUT_PORTS_START( moonqsr )
914   PORT_INCLUDE(mooncrst)
915
916   PORT_MODIFY("IN1")
917   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Difficulty ) )
918   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
919   PORT_DIPSETTING(    0x40, DEF_STR( Medium ) )
920   PORT_DIPSETTING(    0x80, DEF_STR( Hard ) )
921   PORT_DIPSETTING(    0xc0, DEF_STR( Hardest ) )
922INPUT_PORTS_END
923
924
925INPUT_PORTS_START( moonal2 )
926   PORT_INCLUDE(galaxian)
927
928   PORT_MODIFY("IN2")
929   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ) )
930   PORT_DIPSETTING(    0x01, "4000" )
931   PORT_DIPSETTING(    0x02, "5000" )
932   PORT_DIPSETTING(    0x03, "7000" )
933   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
934   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
935   PORT_DIPSETTING(    0x00, "3" )
936   PORT_DIPSETTING(    0x04, "5" )
937   PORT_DIPUNUSED( 0x08, 0x00 )
938INPUT_PORTS_END
939
940
941INPUT_PORTS_START( skybase )
942   PORT_INCLUDE(mooncrst)
943
944   PORT_MODIFY("IN0")
945   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
946
947   PORT_MODIFY("IN1")
948    PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
949   PORT_DIPSETTING(    0x80, "1C/1C (2 to start)" )
950   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
951   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
952   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
953
954   PORT_MODIFY("IN2")
955   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
956   PORT_DIPSETTING(    0x00, "3" )
957   PORT_DIPSETTING(    0x01, "4" )
958   PORT_DIPSETTING(    0x02, "5" )
959   PORT_DIPSETTING(    0x03, "Infinite (Cheat)")
960   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
961   PORT_DIPSETTING(    0x00, "10000" )
962   PORT_DIPSETTING(    0x04, "15000" )
963   PORT_DIPSETTING(    0x08, "20000" )
964   PORT_DIPSETTING(    0x0c, DEF_STR( None ) )
965   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
966   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
967   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 )
968   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
969INPUT_PORTS_END
970
971
972INPUT_PORTS_START( jumpbug )
973   PORT_START_TAG("IN0")
974   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
975   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
976   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
977   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
978   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
979   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
980   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
981   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
982   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
983   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
984
985   PORT_START_TAG("IN1")
986   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
987   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
988   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
989   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
990   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
991   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
992   PORT_DIPNAME( 0x40, 0x00, "Difficulty ?" )
993   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
994   PORT_DIPSETTING(    0x40, DEF_STR( Easy ) )
995   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
996
997   PORT_START_TAG("IN2")
998   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
999   PORT_DIPSETTING(    0x01, "3" )
1000   PORT_DIPSETTING(    0x02, "4" )
1001   PORT_DIPSETTING(    0x03, "5" )
1002   PORT_DIPSETTING(    0x00, "Infinite (Cheat)")
1003   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )
1004   PORT_DIPSETTING(    0x04, "A 2C/1C  B 2C/1C" )
1005   PORT_DIPSETTING(    0x08, "A 2C/1C  B 1C/3C" )
1006   PORT_DIPSETTING(    0x00, "A 1C/1C  B 1C/1C" )
1007   PORT_DIPSETTING(    0x0c, "A 1C/1C  B 1C/6C" )
1008   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1009INPUT_PORTS_END
1010
1011
1012INPUT_PORTS_START( levers )
1013   PORT_START_TAG("IN0")
1014   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1015   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1016   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1017   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1018   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1019   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
1020   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1021   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1022
1023   PORT_START_TAG("IN1")
1024   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1025   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1026   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1027   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1028   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1029   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
1030   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1031   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1032
1033   PORT_START_TAG("IN2")
1034   PORT_DIPUNKNOWN( 0x01, 0x01 )   /* probably unused */
1035   PORT_DIPUNKNOWN( 0x02, 0x02 )   /* probably unused */
1036   PORT_DIPNAME( 0x04, 0x00, "Leave On" )   /* used - MUST be ON */
1037   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1038   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1039   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Free_Play ) )
1040   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1041   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1042   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1043INPUT_PORTS_END
1044
1045
1046INPUT_PORTS_START( checkman )
1047   PORT_START_TAG("IN0")
1048   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 )
1049   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
1050   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
1051   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
1052   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL PORT_NAME("P2 Tiles Right")
1053   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
1054   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL
1055   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
1056
1057   PORT_START_TAG("IN1")
1058   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Start 1 / P1 Tiles Left")/* also p1 tiles left */
1059   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("Start 2 / P1 Tiles Right")/* also p1 tiles right */
1060   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
1061   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
1062   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL PORT_NAME("P2 Tiles Left")/* p2 tiles left */
1063   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL
1064   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coinage ) )
1065   PORT_DIPSETTING(    0x40, "A 2C/1C  B 1C/3C" )
1066   PORT_DIPSETTING(    0x00, "A 1C/1C  B 1C/6C" )
1067   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
1068   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1069   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
1070
1071   PORT_START_TAG("IN2")
1072   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
1073   PORT_DIPSETTING(    0x00, "3" )
1074   PORT_DIPSETTING(    0x01, "4" )
1075   PORT_DIPSETTING(    0x02, "5" )
1076   PORT_DIPSETTING(    0x03, "6" )
1077   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Bonus_Life ) )
1078   PORT_DIPSETTING(    0x00, "100000" )
1079   PORT_DIPSETTING(    0x04, "200000" )
1080   PORT_DIPNAME( 0x08, 0x00, "Difficulty Increases At Level" )
1081   PORT_DIPSETTING(    0x08, "3" )
1082   PORT_DIPSETTING(    0x00, "5" )
1083   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1084INPUT_PORTS_END
1085
1086
1087INPUT_PORTS_START( checkmaj )
1088   PORT_INCLUDE(checkman)
1089
1090   PORT_MODIFY("IN0")
1091   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1092   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1093   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
1094   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
1095   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
1096   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_COCKTAIL PORT_NAME("P2 Tiles Right")
1097   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL
1098   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
1099
1100   PORT_MODIFY("IN1")
1101   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1102   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1103   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
1104   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
1105   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL
1106   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_COCKTAIL PORT_NAME("P2 Tiles Left")
1107
1108   PORT_MODIFY("IN2")
1109   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Tiles Right")
1110   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Tiles Left")
1111   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
1112INPUT_PORTS_END
1113
1114
1115INPUT_PORTS_START( dingo )
1116   PORT_START_TAG("IN0")
1117   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1118   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1119   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
1120   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
1121   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
1122   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL   /* 1st Button 1 */
1123   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL
1124   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
1125
1126   PORT_START_TAG("IN1")
1127   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1128   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1129   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
1130   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
1131   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL
1132   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL   /* 2nd Button 1 */
1133   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
1134   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1135   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
1136   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coinage ) )
1137   PORT_DIPSETTING(    0x80, "A 1C/1C  B 1C/5C" )
1138   PORT_DIPSETTING(    0x00, "A 2C/1C  B 1C/3C" )
1139
1140   PORT_START_TAG("IN2")
1141   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Difficulty ) )
1142   PORT_DIPSETTING(    0x00, DEF_STR( Easiest ) )
1143   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
1144   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
1145   PORT_DIPSETTING(    0x03, DEF_STR( Hardest ) )
1146    PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
1147   PORT_DIPSETTING(    0x00, "3" )
1148   PORT_DIPSETTING(    0x04, "4" )
1149   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )
1150   PORT_DIPSETTING(    0x00, "20000" )
1151   PORT_DIPSETTING(    0x08, "40000" )
1152   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )   /* Yes, the game reads both of these */
1153   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 )   /* Check code at 0x22e1 */
1154INPUT_PORTS_END
1155
1156
1157INPUT_PORTS_START( mshuttle )
1158   PORT_START_TAG("IN0")
1159   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1160   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1161   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
1162   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
1163   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1164   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
1165   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1166   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1167
1168   PORT_START_TAG("IN1")
1169   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1170   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1171   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL
1172   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL
1173   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1174   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
1175   PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
1176   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )
1177   PORT_DIPSETTING(    0x80, DEF_STR( Upright ) )
1178   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
1179
1180   PORT_START_TAG("IN2")
1181   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
1182   PORT_DIPSETTING(    0x00, "3" )
1183   PORT_DIPSETTING(    0x01, "4" )
1184   PORT_DIPSETTING(    0x02, "5" )
1185   PORT_DIPSETTING(    0x03, "6" )
1186   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Bonus_Life ) )
1187   PORT_DIPSETTING(    0x00, "20000" )
1188   PORT_DIPSETTING(    0x04, "30000" )
1189   PORT_DIPNAME( 0x18, 0x00, DEF_STR( Coin_A ) )
1190   PORT_DIPSETTING(    0x18, DEF_STR( 4C_1C ) )
1191   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
1192   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
1193   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1194   PORT_DIPNAME( 0x60, 0x00, DEF_STR( Coin_B ) )
1195   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1196   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
1197   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
1198   PORT_DIPSETTING(    0x60, DEF_STR( 1C_4C ) )
1199   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1200   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1201   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1202INPUT_PORTS_END
1203
1204
1205INPUT_PORTS_START( kingball )
1206   PORT_INCLUDE(galaxian)
1207
1208   PORT_MODIFY("IN0")
1209   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(kingball_muxbit_r, 0)
1210   /* Relating to above port:Hack? - possibly multiplexed via writes to $b003 */
1211   //PORT_DIPNAME( 0x40, 0x40, "Speech" )
1212   //PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1213   //PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1214
1215   PORT_MODIFY("IN1")
1216   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(kingball_noise_r, 0)   /* NOISE line */
1217
1218   PORT_MODIFY("IN2")
1219   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ) )
1220   PORT_DIPSETTING(    0x00, "10000" )
1221   PORT_DIPSETTING(    0x01, "12000" )
1222   PORT_DIPSETTING(    0x02, "15000" )
1223   PORT_DIPSETTING(    0x03, DEF_STR( None ) )
1224
1225   PORT_START_TAG("FAKE")
1226   PORT_SERVICE( 0x01, IP_ACTIVE_HIGH )
1227   PORT_DIPNAME( 0x02, 0x02, "Speech" )
1228   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1229   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1230INPUT_PORTS_END
1231
1232
1233
1234/*************************************
1235 *
1236 *  Input Ports
1237 *  Konami games
1238 *
1239 *************************************/
1240
1241INPUT_PORTS_START( frogger )
1242   PORT_START_TAG("IN0")
1243   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
1244   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* 1P shoot2 - unused */
1245   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1246   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* 1P shoot1 - unused */
1247   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1248   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
1249   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
1250   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
1251
1252   PORT_START_TAG("IN1")
1253   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
1254   PORT_DIPSETTING(   0x00, "3" )
1255   PORT_DIPSETTING(   0x01, "5" )
1256   PORT_DIPSETTING(   0x02, "7" )
1257   PORT_DIPSETTING(   0x03, "256 (Cheat)")
1258   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* 2P shoot2 - unused */
1259   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* 2P shoot1 - unused */
1260   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1261   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
1262   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
1263   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1264
1265   PORT_START_TAG("IN2")
1266   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
1267   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
1268   PORT_DIPSETTING(   0x02, "A 2/1 B 2/1 C 2/1" )
1269   PORT_DIPSETTING(   0x04, "A 2/1 B 1/3 C 2/1" )
1270   PORT_DIPSETTING(   0x00, "A 1/1 B 1/1 C 1/1" )
1271   PORT_DIPSETTING(   0x06, "A 1/1 B 1/6 C 1/1" )
1272   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
1273   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1274   PORT_DIPSETTING(   0x08, DEF_STR( Cocktail ) )
1275   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
1276   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
1277   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
1278   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
1279INPUT_PORTS_END
1280
1281
1282INPUT_PORTS_START( froggrmc )
1283   PORT_START_TAG("IN0")
1284   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1285   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1286   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
1287   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1288   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
1289   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
1290   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1291   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1292
1293   PORT_START_TAG("IN1")
1294   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1295   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1296   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
1297   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1298   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
1299   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
1300   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) )
1301   PORT_DIPSETTING(   0xc0, "3" )
1302   PORT_DIPSETTING(   0x80, "5" )
1303   PORT_DIPSETTING(   0x40, "7" )
1304   PORT_DIPSETTING(   0x00, "256 (Cheat)")
1305
1306   PORT_START_TAG("IN2")
1307   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
1308   PORT_DIPSETTING(   0x01, DEF_STR( Upright ) )
1309   PORT_DIPSETTING(   0x00, DEF_STR( Cocktail ) )
1310   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Coinage ) )
1311   PORT_DIPSETTING(   0x02, "A 2/1 B 2/1 C 2/1" )
1312   PORT_DIPSETTING(   0x04, "A 2/1 B 1/3 C 2/1" )
1313   PORT_DIPSETTING(   0x06, "A 1/1 B 1/1 C 1/1" )
1314   PORT_DIPSETTING(   0x00, "A 1/1 B 1/6 C 1/1" )
1315   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1316INPUT_PORTS_END
1317
1318
1319INPUT_PORTS_START( frogg )
1320   PORT_INCLUDE(froggrmc)
1321
1322   PORT_MODIFY("IN0")
1323   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_SPECIAL )      // See notes
1324   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
1325   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
1326
1327   PORT_MODIFY("IN1")
1328   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_SPECIAL )      // See notes
1329
1330   PORT_MODIFY("IN2")
1331   PORT_DIPUNUSED( 0x02, 0x00 )                  // not tested due to code at 0x3084
1332   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Coinage ) )      // when "Cabinet" Dip Switch set to "Upright"
1333   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )      // "A 1/1 B 1/6" if "Cabinet" Dip Switch set to "Cocktail"
1334   PORT_DIPSETTING(    0x04, DEF_STR( 1C_1C ) )      // "A 2/1 B 1/3" if "Cabinet" Dip Switch set to "Cocktail"
1335   PORT_DIPUNUSED( 0x08, 0x00 )
1336INPUT_PORTS_END
1337
1338
1339INPUT_PORTS_START( turtles )
1340   PORT_START_TAG("IN0")
1341   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
1342   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1343   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1344   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
1345   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1346   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
1347   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
1348   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
1349
1350   PORT_START_TAG("IN1")
1351   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
1352   PORT_DIPSETTING(    0x00, "3" )
1353   PORT_DIPSETTING(    0x01, "4" )
1354   PORT_DIPSETTING(    0x02, "5" )
1355   PORT_DIPSETTING(    0x03, "126 (Cheat)")
1356   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1357   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1358   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1359   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
1360   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
1361   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1362
1363   PORT_START_TAG("IN2")
1364   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
1365   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
1366   PORT_DIPSETTING(    0x00, "A 1/1 B 2/1 C 1/1" )
1367   PORT_DIPSETTING(    0x02, "A 1/2 B 1/1 C 1/2" )
1368   PORT_DIPSETTING(    0x04, "A 1/3 B 3/1 C 1/3" )
1369   PORT_DIPSETTING(    0x06, "A 1/4 B 4/1 C 1/4" )
1370   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
1371   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1372   PORT_DIPSETTING(   0x08, DEF_STR( Cocktail ) )
1373   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
1374   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
1375   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
1376   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
1377INPUT_PORTS_END
1378
1379
1380INPUT_PORTS_START( turpin )
1381   PORT_INCLUDE(turtles)
1382
1383   PORT_MODIFY("IN1")
1384   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
1385   PORT_DIPSETTING(    0x00, "3" )
1386   PORT_DIPSETTING(    0x01, "5" )
1387   PORT_DIPSETTING(    0x02, "7" )
1388   PORT_DIPSETTING(    0x03, "126 (Cheat)")
1389
1390   PORT_MODIFY("IN2")
1391   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
1392   PORT_DIPSETTING(    0x06, DEF_STR( 4C_1C ) )
1393   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
1394   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1395   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
1396
1397   PORT_START_TAG("IN3")
1398   PORT_BIT( 0xff, 0x00, IPT_UNKNOWN )
1399INPUT_PORTS_END
1400
1401
1402INPUT_PORTS_START( amidar )
1403   PORT_INCLUDE(turtles)
1404
1405   PORT_MODIFY("IN1")
1406   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
1407   PORT_DIPSETTING(    0x03, "3" )
1408   PORT_DIPSETTING(    0x02, "4" )
1409   PORT_DIPSETTING(    0x01, "5" )
1410   PORT_DIPSETTING(    0x00, "255 (Cheat)")
1411
1412   PORT_MODIFY("IN2")
1413   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
1414   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1415   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1416   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Bonus_Life ) )
1417   PORT_DIPSETTING(    0x00, "30000 50000" )
1418   PORT_DIPSETTING(    0x04, "50000 50000" )
1419
1420   PORT_START_TAG("IN3")
1421   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
1422   PORT_DIPSETTING(    0x04, DEF_STR( 4C_1C ) )
1423   PORT_DIPSETTING(    0x0a, DEF_STR( 3C_1C ) )
1424   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
1425   PORT_DIPSETTING(    0x02, DEF_STR( 3C_2C ) )
1426   PORT_DIPSETTING(    0x08, DEF_STR( 4C_3C ) )
1427   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
1428   PORT_DIPSETTING(    0x0c, DEF_STR( 3C_4C ) )
1429   PORT_DIPSETTING(    0x0e, DEF_STR( 2C_3C ) )
1430   PORT_DIPSETTING(    0x07, DEF_STR( 1C_2C ) )
1431   PORT_DIPSETTING(    0x06, DEF_STR( 2C_5C ) )
1432   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_3C ) )
1433   PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
1434   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_5C ) )
1435   PORT_DIPSETTING(    0x05, DEF_STR( 1C_6C ) )
1436   PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
1437   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
1438   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
1439   PORT_DIPSETTING(    0x40, DEF_STR( 4C_1C ) )
1440   PORT_DIPSETTING(    0xa0, DEF_STR( 3C_1C ) )
1441   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
1442   PORT_DIPSETTING(    0x20, DEF_STR( 3C_2C ) )
1443   PORT_DIPSETTING(    0x80, DEF_STR( 4C_3C ) )
1444   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
1445   PORT_DIPSETTING(    0xc0, DEF_STR( 3C_4C ) )
1446   PORT_DIPSETTING(    0xe0, DEF_STR( 2C_3C ) )
1447   PORT_DIPSETTING(    0x70, DEF_STR( 1C_2C ) )
1448   PORT_DIPSETTING(    0x60, DEF_STR( 2C_5C ) )
1449   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_3C ) )
1450   PORT_DIPSETTING(    0x30, DEF_STR( 1C_4C ) )
1451   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_5C ) )
1452   PORT_DIPSETTING(    0x50, DEF_STR( 1C_6C ) )
1453   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
1454   PORT_DIPSETTING(    0x00, "Disable All Coins" )
1455INPUT_PORTS_END
1456
1457
1458INPUT_PORTS_START( amidaru )
1459   PORT_INCLUDE(amidar)
1460
1461   PORT_MODIFY("IN2")
1462   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Bonus_Life ) )
1463   PORT_DIPSETTING(    0x00, "30000 70000" )
1464   PORT_DIPSETTING(    0x04, "50000 80000" )
1465INPUT_PORTS_END
1466
1467
1468INPUT_PORTS_START( amidaro )
1469   PORT_INCLUDE(amidar)
1470
1471   PORT_MODIFY("IN1")
1472   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
1473   PORT_DIPSETTING(    0x03, "1" )
1474   PORT_DIPSETTING(    0x02, "2" )
1475   PORT_DIPSETTING(    0x01, "3" )
1476   PORT_DIPSETTING(    0x00, "4" )
1477
1478   PORT_MODIFY("IN2")
1479   PORT_DIPNAME( 0x02, 0x00, "Level Progression" )
1480   PORT_DIPSETTING(    0x00, "Slow" )
1481   PORT_DIPSETTING(    0x02, "Fast" )
1482   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Bonus_Life ) )
1483   PORT_DIPSETTING(    0x00, "30000 70000" )
1484   PORT_DIPSETTING(    0x04, "50000 80000" )
1485INPUT_PORTS_END
1486
1487
1488INPUT_PORTS_START( amidars )
1489   PORT_INCLUDE(turtles)
1490
1491   PORT_MODIFY("IN1")
1492   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
1493   PORT_DIPSETTING(    0x03, "2" )
1494   PORT_DIPSETTING(    0x02, "3" )
1495   PORT_DIPSETTING(    0x01, "4" )
1496   PORT_DIPSETTING(    0x00, "256 (Cheat)")
1497
1498   PORT_MODIFY("IN2")
1499   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Coinage ) )
1500   PORT_DIPSETTING(    0x00, "A 1/1 B 1/6" )
1501   PORT_DIPSETTING(    0x02, "A 2/1 B 1/3" )
1502   PORT_DIPUNKNOWN( 0x04, 0x00 )
1503INPUT_PORTS_END
1504
1505
1506INPUT_PORTS_START( theend )
1507   PORT_START_TAG("IN0")
1508   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1509   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1510   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1511   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
1512   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1513   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1514   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
1515   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
1516
1517   PORT_START_TAG("IN1")
1518   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
1519   PORT_DIPSETTING(    0x00, "3" )
1520   PORT_DIPSETTING(    0x01, "4" )
1521   PORT_DIPSETTING(    0x02, "5" )
1522   PORT_DIPSETTING(    0x03, "256 (Cheat)")
1523   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1524   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1525   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1526   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1527   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
1528   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1529
1530   PORT_START_TAG("IN2")
1531   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1532   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
1533   PORT_DIPSETTING(    0x04, DEF_STR( 3C_1C ) )
1534   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
1535   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1536   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
1537   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
1538   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1539   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
1540   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )      /* output bits */
1541INPUT_PORTS_END
1542
1543
1544INPUT_PORTS_START( scramble )
1545   PORT_START_TAG("IN0")
1546   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1547   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1548   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1549   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
1550   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1551   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1552   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
1553   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
1554
1555   PORT_START_TAG("IN1")
1556   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
1557   PORT_DIPSETTING(    0x00, "3" )
1558   PORT_DIPSETTING(    0x01, "4" )
1559   PORT_DIPSETTING(    0x02, "5" )
1560   PORT_DIPSETTING(    0x03, "255 (Cheat)")
1561   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1562   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1563   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1564   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1565   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
1566   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1567
1568   PORT_START_TAG("IN2")
1569   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1570   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
1571   PORT_DIPSETTING(    0x00, "A 1/1  B 2/1  C 1/1" )
1572   PORT_DIPSETTING(    0x02, "A 1/2  B 1/1  C 1/2" )
1573   PORT_DIPSETTING(    0x04, "A 1/3  B 3/1  C 1/3" )
1574   PORT_DIPSETTING(    0x06, "A 1/4  B 4/1  C 1/4" )
1575   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
1576   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1577   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
1578   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1579   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(scramble_protection_alt_r, (void *)0)   /* protection bit */
1580   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1581   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(scramble_protection_alt_r, (void *)1)   /* protection bit */
1582INPUT_PORTS_END
1583
1584
1585INPUT_PORTS_START( strfbomb )
1586   PORT_INCLUDE(scramble)
1587
1588   PORT_MODIFY("IN2")
1589   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
1590   PORT_DIPSETTING(    0x00, "A 1/2  B 4/1  C 1/2" )
1591   PORT_DIPSETTING(    0x02, "A 1/3  B 2/1  C 1/3" )
1592   PORT_DIPSETTING(    0x04, "A 1/4  B 3/1  C 1/4" )
1593   PORT_DIPSETTING(    0x06, "A 1/5  B 1/1  C 1/5" )
1594INPUT_PORTS_END
1595
1596
1597INPUT_PORTS_START( explorer )
1598   PORT_START_TAG("IN0")
1599   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
1600   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 )
1601   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
1602   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1603   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1604   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
1605   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 )
1606   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
1607
1608   PORT_START_TAG("IN1")
1609   PORT_DIPUNKNOWN( 0x01, 0x00 )
1610   PORT_DIPUNKNOWN( 0x02, 0x00 )
1611   PORT_DIPUNKNOWN( 0x04, 0x00 )
1612   PORT_DIPUNKNOWN( 0x08, 0x00 )
1613   PORT_DIPUNKNOWN( 0x10, 0x00 )
1614   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* pressing this disables the coins */
1615   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
1616   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 )
1617
1618   PORT_START_TAG("IN2")
1619   PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_A ) )
1620   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
1621   PORT_DIPSETTING(    0x09, DEF_STR( 2C_2C ) )
1622   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1623   PORT_DIPSETTING(    0x0a, DEF_STR( 2C_3C ) )
1624   PORT_DIPSETTING(    0x0b, DEF_STR( 2C_4C ) )
1625   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
1626   PORT_DIPSETTING(    0x0c, DEF_STR( 2C_5C ) )
1627   PORT_DIPSETTING(    0x0d, DEF_STR( 2C_6C ) )
1628   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
1629   PORT_DIPSETTING(    0x0e, DEF_STR( 2C_7C ) )
1630   PORT_DIPSETTING(    0x0f, DEF_STR( 2C_8C ) )
1631   PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
1632   PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
1633   PORT_DIPSETTING(    0x05, DEF_STR( 1C_6C ) )
1634   PORT_DIPSETTING(    0x06, DEF_STR( 1C_7C ) )
1635   PORT_DIPSETTING(    0x07, DEF_STR( 1C_8C ) )
1636   PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coin_B ) )
1637   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
1638   PORT_DIPSETTING(    0x90, DEF_STR( 2C_2C ) )
1639   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1640   PORT_DIPSETTING(    0xa0, DEF_STR( 2C_3C ) )
1641   PORT_DIPSETTING(    0xb0, DEF_STR( 2C_4C ) )
1642   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
1643   PORT_DIPSETTING(    0xc0, DEF_STR( 2C_5C ) )
1644   PORT_DIPSETTING(    0xd0, DEF_STR( 2C_6C ) )
1645   PORT_DIPSETTING(    0x20, DEF_STR( 1C_3C ) )
1646   PORT_DIPSETTING(    0xe0, DEF_STR( 2C_7C ) )
1647   PORT_DIPSETTING(    0xf0, DEF_STR( 2C_8C ) )
1648   PORT_DIPSETTING(    0x30, DEF_STR( 1C_4C ) )
1649   PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
1650   PORT_DIPSETTING(    0x50, DEF_STR( 1C_6C ) )
1651   PORT_DIPSETTING(    0x60, DEF_STR( 1C_7C ) )
1652   PORT_DIPSETTING(    0x70, DEF_STR( 1C_8C ) )
1653
1654   PORT_START_TAG("IN3")
1655   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
1656   PORT_DIPSETTING(    0x00, "2" )
1657   PORT_DIPSETTING(    0x01, "3" )
1658   PORT_DIPSETTING(    0x02, "4" )
1659   PORT_DIPSETTING(    0x03, "5" )
1660   PORT_DIPNAME( 0x1c, 0x00, DEF_STR( Bonus_Life ) )
1661   PORT_DIPSETTING(    0x04, "10000" )
1662   PORT_DIPSETTING(    0x0c, "15000" )
1663   PORT_DIPSETTING(    0x14, "20000" )
1664   PORT_DIPSETTING(    0x1c, "25000" )
1665   PORT_DIPSETTING(    0x00, "30000" )
1666   PORT_DIPSETTING(    0x08, "50000" )
1667   PORT_DIPSETTING(    0x10, "70000" )
1668   PORT_DIPSETTING(    0x18, "90000" )
1669   PORT_DIPUNKNOWN( 0x20, 0x00 )
1670   PORT_DIPUNKNOWN( 0x40, 0x00 )
1671   PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
1672INPUT_PORTS_END
1673
1674
1675INPUT_PORTS_START( atlantis )
1676   PORT_START_TAG("IN0")
1677   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1678   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1679   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
1680   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
1681   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1682   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1683   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
1684   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
1685
1686   PORT_START_TAG("IN1")
1687   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1688   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1689   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
1690   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Lives ) )
1691   PORT_DIPSETTING(    0x02, "3" )
1692   PORT_DIPSETTING(    0x00, "5" )
1693   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1694   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1695   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1696   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1697   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
1698   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1699
1700   PORT_START_TAG("IN2")
1701   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1702   PORT_DIPNAME( 0x0e, 0x00, DEF_STR( Coinage ) )
1703   PORT_DIPSETTING(    0x02, "A 1/3  B 2/1" )
1704   PORT_DIPSETTING(    0x00, "A 1/6  B 1/1" )
1705   PORT_DIPSETTING(    0x04, "A 1/99 B 1/99")
1706   /* all the other combos give 99 credits */
1707   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1708   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1709   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1710   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1711INPUT_PORTS_END
1712
1713
1714INPUT_PORTS_START( scorpion )
1715   PORT_START_TAG("IN0")
1716   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1717   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1718   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1719   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
1720   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1721   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1722   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
1723   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
1724
1725   PORT_START_TAG("IN1")
1726   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
1727   PORT_DIPSETTING(    0x03, "3")
1728   PORT_DIPSETTING(    0x02, "4" )
1729   PORT_DIPSETTING(    0x01, "5" )
1730   PORT_DIPSETTING(    0x00, "255" )
1731   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1732   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1733   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1734   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1735   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
1736   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1737
1738   PORT_START_TAG("IN2")
1739   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1740   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
1741   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1742   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1743   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
1744   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1745   PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
1746   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Coinage ) )
1747   PORT_DIPSETTING(    0x08, "A 1/1  B 1/1" )
1748   PORT_DIPSETTING(    0x00, "A 1/1  B 1/3" )
1749   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1750   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1751   PORT_DIPNAME( 0xa0, 0xa0, DEF_STR( Difficulty ) )
1752   PORT_DIPSETTING(    0xa0, DEF_STR( Normal ) )
1753   PORT_DIPSETTING(    0x80, DEF_STR( Medium ) )
1754   PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )
1755   PORT_DIPSETTING(    0x00, DEF_STR( Very_Hard ) )
1756INPUT_PORTS_END
1757
1758
1759INPUT_PORTS_START( scorpnmc )
1760   PORT_START_TAG("IN0")      /* 0xa000 */
1761   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 )      // COIN2? (it ALWAYS adds 1 credit)
1762   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
1763   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
1764   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1765   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
1766   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1767   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1768   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
1769
1770   PORT_START_TAG("IN1")      /* 0xa800 */
1771   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Start 1 / P1 Button 1")      /* also P1 Button 1 */
1772   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("Start 2 / P1 Button 2")      /* also P1 Button 2 */
1773   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1774   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1775   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1776   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
1777   PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Difficulty ) )   // Check code at 0x0118
1778   PORT_DIPSETTING(   0x00, DEF_STR( Easy ) )
1779   PORT_DIPSETTING(   0x40, DEF_STR( Normal ) )
1780   PORT_DIPSETTING(   0x80, DEF_STR( Hard ) )
1781   PORT_DIPSETTING(   0xc0, DEF_STR( Hardest ) )
1782
1783   PORT_START_TAG("IN2")      /* 0xb001 */
1784   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
1785   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
1786   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ) )      // Check code at 0x00eb
1787   PORT_DIPSETTING(   0x00, "2" )
1788   PORT_DIPSETTING(   0x04, "3" )
1789   PORT_DIPSETTING(   0x08, "4" )
1790   PORT_DIPSETTING(   0x0c, "5" )
1791   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1792
1793   PORT_START_TAG("IN3")      /* 0xb002 */
1794   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )      // Check code at 0x00fe
1795   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1796   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
1797   PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
1798   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
1799   PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
1800   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
1801   PORT_DIPSETTING(    0x06, DEF_STR( 1C_3C ) )
1802   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
1803INPUT_PORTS_END
1804
1805
1806INPUT_PORTS_START( sfx )
1807   PORT_START_TAG("IN0")
1808   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1809   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)   // "Fire" left
1810   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1811   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)   // "Fire" right
1812   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1813   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1814   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
1815   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
1816
1817   PORT_START_TAG("IN1")
1818   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
1819   PORT_DIPSETTING(    0x02, "3" )
1820   PORT_DIPSETTING(    0x01, "4" )
1821   PORT_DIPSETTING(    0x00, "5" )
1822   PORT_DIPSETTING(    0x03, "Invulnerability (Cheat)")
1823   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)   // "Fire" left
1824   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)   // "Fire" right
1825   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1826   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1827   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
1828   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1829
1830   PORT_START_TAG("IN2")
1831   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1832   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Coinage ) )
1833   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
1834   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
1835   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
1836   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
1837   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
1838   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1839   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
1840   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1841   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused */
1842   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1843   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused */
1844INPUT_PORTS_END
1845
1846
1847INPUT_PORTS_START( scobra )
1848   PORT_START_TAG("IN0")
1849   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1850   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1851   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1852   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
1853   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1854   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1855   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
1856   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
1857
1858   PORT_START_TAG("IN1")
1859   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Allow_Continue ) )
1860   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1861   PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
1862   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )
1863   PORT_DIPSETTING(    0x00, "3" )
1864   PORT_DIPSETTING(    0x02, "4" )
1865   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1866   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1867   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1868   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1869   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
1870   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1871
1872   PORT_START_TAG("IN2")
1873   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1874   PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
1875   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
1876   PORT_DIPSETTING(    0x06, DEF_STR( 4C_3C ) )
1877   PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
1878   PORT_DIPSETTING(    0x00, "1 Coin/99 Credits" )
1879   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
1880   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1881   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
1882   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1883   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1884   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1885   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1886INPUT_PORTS_END
1887
1888
1889INPUT_PORTS_START( scobras )
1890   PORT_INCLUDE(scobra)
1891
1892   PORT_MODIFY("IN1")
1893   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )
1894   PORT_DIPSETTING(    0x00, "3" )
1895   PORT_DIPSETTING(    0x02, "5" )
1896INPUT_PORTS_END
1897
1898
1899/* cocktail mode is N/A */
1900INPUT_PORTS_START( losttomb )
1901   PORT_START_TAG("IN0")
1902   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 )
1903   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
1904   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_8WAY
1905   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_8WAY
1906   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT) PORT_8WAY
1907   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_8WAY
1908   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
1909   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
1910
1911   PORT_START_TAG("IN1")
1912   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
1913   PORT_DIPSETTING(    0x01, "3" )
1914   PORT_DIPSETTING(    0x02, "5" )
1915   PORT_DIPSETTING(    0x03, DEF_STR( Free_Play ) )
1916   PORT_DIPSETTING(    0x00, "Invulnerability (Cheat)")
1917   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_8WAY
1918   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_8WAY
1919   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT) PORT_8WAY
1920   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_8WAY
1921   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )
1922   PORT_DIPUNKNOWN( 0x80, 0x00 )
1923
1924   PORT_START_TAG("IN2")
1925   PORT_DIPUNKNOWN( 0x01, 0x00 )
1926   PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
1927   PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
1928   PORT_DIPSETTING(    0x00, "A 1/2 B 2/1" )
1929   PORT_DIPSETTING(    0x04, "A 1/3 B 3/1" )
1930   PORT_DIPSETTING(    0x06, "A 1/4 B 4/1" )
1931   PORT_DIPUNKNOWN( 0x08, 0x00 )
1932   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
1933INPUT_PORTS_END
1934
1935
1936INPUT_PORTS_START( armorcar )
1937   PORT_START_TAG("IN0")
1938   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
1939   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1940   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1941   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
1942   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1943   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
1944   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
1945   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
1946
1947   PORT_START_TAG("IN1")
1948   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
1949   PORT_DIPSETTING(    0x01, "3" )
1950   PORT_DIPSETTING(    0x00, "5" )
1951   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
1952   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1953   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1954   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1955   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1956   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1957   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
1958   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
1959   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1960
1961   PORT_START_TAG("IN2")
1962   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
1963   PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
1964   PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
1965   PORT_DIPSETTING(    0x00, "Coin A 1/2 Coin B 2/1" )
1966   PORT_DIPSETTING(    0x04, "Coin A 1/3 Coin B 3/1" )
1967   PORT_DIPSETTING(    0x06, "Coin A 1/4 Coin B 4/1" )
1968   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
1969   PORT_DIPSETTING(    0x08, DEF_STR( Upright ) )
1970   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
1971   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
1972   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1973   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
1974   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1975INPUT_PORTS_END
1976
1977
1978INPUT_PORTS_START( tazmania )
1979   PORT_START_TAG("IN0")
1980   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 )
1981   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
1982   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1983   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1984   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1985   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1986   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
1987   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
1988
1989   PORT_START_TAG("IN1")
1990   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
1991   PORT_DIPSETTING(    0x01, "3" )
1992   PORT_DIPSETTING(    0x00, "5" )
1993   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
1994   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1995   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1996   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1997   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1998   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1999   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
2000   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
2001   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
2002
2003   PORT_START_TAG("IN2")
2004   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
2005   PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
2006   PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
2007   PORT_DIPSETTING(    0x00, "Coin A 1/2 Coin B 2/1" )
2008   PORT_DIPSETTING(    0x04, "Coin A 1/3 Coin B 3/1" )
2009   PORT_DIPSETTING(    0x06, "Coin A 1/4 Coin B 4/1" )
2010   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
2011   PORT_DIPSETTING(    0x08, DEF_STR( Upright ) )
2012   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
2013   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
2014   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
2015   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
2016   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2017INPUT_PORTS_END
2018
2019
2020/* cocktail mode not working due to bug in game code */
2021INPUT_PORTS_START( anteater )
2022   PORT_START_TAG("IN0")
2023   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
2024   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
2025   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
2026   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
2027   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
2028   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
2029   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
2030   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
2031
2032   PORT_START_TAG("IN1")
2033   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
2034   PORT_DIPSETTING(    0x01, "3" )
2035   PORT_DIPSETTING(    0x00, "5" )
2036   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
2037   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2038   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2039   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
2040   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
2041   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
2042   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
2043   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
2044   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2045
2046   PORT_START_TAG("IN2")
2047   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
2048   PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
2049   PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
2050   PORT_DIPSETTING(    0x00, "Coin A 1/2 Coin B 2/1" )
2051   PORT_DIPSETTING(    0x04, "Coin A 1/3 Coin B 3/1" )
2052   PORT_DIPSETTING(    0x06, "Coin A 1/4 Coin B 4/1" )
2053   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
2054   PORT_DIPSETTING(    0x08, DEF_STR( Upright ) )
2055   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
2056   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
2057   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
2058   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
2059   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2060INPUT_PORTS_END
2061
2062
2063
2064/*************************************
2065 *
2066 *  ROM definitions
2067 *  Galaxian-derived games
2068 *
2069 *************************************/
2070
2071ROM_START( galaxian )
2072   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2073   ROM_LOAD( "galmidw.u",    0x0000, 0x0800, CRC(745e2d61) SHA1(e65f74e35b1bfaccd407e168ea55678ae9b68edf) )
2074   ROM_LOAD( "galmidw.v",    0x0800, 0x0800, CRC(9c999a40) SHA1(02fdcd95d8511e64c0d2b007b874112d53e41045) )
2075   ROM_LOAD( "galmidw.w",    0x1000, 0x0800, CRC(b5894925) SHA1(0046b9ed697a34d088de1aead8bd7cbe526a2396) )
2076   ROM_LOAD( "galmidw.y",    0x1800, 0x0800, CRC(6b3ca10b) SHA1(18d8714e5ef52f63ba8888ecc5a25b17b3bf17d1) )
2077   ROM_LOAD( "7l",           0x2000, 0x0800, CRC(1b933207) SHA1(8b44b0f74420871454e27894d0f004859f9e59a9) )
2078
2079   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2080   ROM_LOAD( "1h.bin",       0x0000, 0x0800, CRC(39fb43a4) SHA1(4755609bd974976f04855d51e08ec0d62ab4bc07) )
2081   ROM_LOAD( "1k.bin",       0x0800, 0x0800, CRC(7e3f56a2) SHA1(a9795d8b7388f404f3b0e2c6ce15d713a4c5bafa) )
2082
2083   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2084   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
2085ROM_END
2086
2087ROM_START( galaxiaj )
2088   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2089   ROM_LOAD( "7f.bin",       0x0000, 0x1000, CRC(4335b1de) SHA1(e41e3d90dac738cf71377f3b476ec67b14dee27a) )
2090   ROM_LOAD( "7j.bin",       0x1000, 0x1000, CRC(4e6f66a1) SHA1(ee2a675ab34485c0f58c51be7630a51e27a7a8f3) )
2091   ROM_LOAD( "7l.bin",       0x2000, 0x0800, CRC(5341d75a) SHA1(40bc8fcc598f58c6ff944e2a4a9288463e75a09d) )
2092
2093   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2094   ROM_LOAD( "1h.bin",       0x0000, 0x0800, CRC(39fb43a4) SHA1(4755609bd974976f04855d51e08ec0d62ab4bc07) )
2095   ROM_LOAD( "1k.bin",       0x0800, 0x0800, CRC(7e3f56a2) SHA1(a9795d8b7388f404f3b0e2c6ce15d713a4c5bafa) )
2096
2097   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2098   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
2099ROM_END
2100
2101ROM_START( galmidw )
2102   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2103   ROM_LOAD( "galmidw.u",    0x0000, 0x0800, CRC(745e2d61) SHA1(e65f74e35b1bfaccd407e168ea55678ae9b68edf) )
2104   ROM_LOAD( "galmidw.v",    0x0800, 0x0800, CRC(9c999a40) SHA1(02fdcd95d8511e64c0d2b007b874112d53e41045) )
2105   ROM_LOAD( "galmidw.w",    0x1000, 0x0800, CRC(b5894925) SHA1(0046b9ed697a34d088de1aead8bd7cbe526a2396) )
2106   ROM_LOAD( "galmidw.y",    0x1800, 0x0800, CRC(6b3ca10b) SHA1(18d8714e5ef52f63ba8888ecc5a25b17b3bf17d1) )
2107   ROM_LOAD( "galmidw.z",    0x2000, 0x0800, CRC(cb24f797) SHA1(e6bb977ded0654c2c7388aad188059e1e0647908) )
2108
2109   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2110   ROM_LOAD( "galaxian.j1",  0x0000, 0x0800, CRC(84decf98) SHA1(2e565cb6057b1816a6b4541e6dfadd3c3762fa36) )
2111   ROM_LOAD( "galaxian.l1",  0x0800, 0x0800, CRC(c31ada9e) SHA1(237ebb48549b34ca59a13cc2706512d957413ec4) )
2112
2113   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2114   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
2115ROM_END
2116
2117ROM_START( galmidwo )
2118   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2119   ROM_LOAD( "galaxian.u",   0x0000, 0x0800, CRC(fac42d34) SHA1(0b96d9f1c6bf0e0b7f757dcbaeacfbfafefc54d1) )
2120   ROM_LOAD( "galaxian.v",   0x0800, 0x0800, CRC(f58283e3) SHA1(edc6e72516c50fd3402281d9936574d276581ce9) )
2121   ROM_LOAD( "galaxian.w",   0x1000, 0x0800, CRC(4c7031c0) SHA1(97f7ab0cedcd8eba1c8f6f516d84d672a2108258) )
2122   ROM_LOAD( "galaxian.y",   0x1800, 0x0800, CRC(96a7ac94) SHA1(c3c7a43117c8b9fd8621823c872889f8e31bf935) )
2123   ROM_LOAD( "7l.bin",       0x2000, 0x0800, CRC(5341d75a) SHA1(40bc8fcc598f58c6ff944e2a4a9288463e75a09d) )
2124
2125   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2126   ROM_LOAD( "galaxian.j1",  0x0000, 0x0800, CRC(84decf98) SHA1(2e565cb6057b1816a6b4541e6dfadd3c3762fa36) )
2127   ROM_LOAD( "galaxian.l1",  0x0800, 0x0800, CRC(c31ada9e) SHA1(237ebb48549b34ca59a13cc2706512d957413ec4) )
2128
2129   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2130   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
2131ROM_END
2132
2133ROM_START( galtaito )
2134   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2135   ROM_LOAD( "gl-03.8g",  0x0000, 0x0800, CRC(e8f3aa67) SHA1(a0e9576784dbe602dd9780e667f01f31defd7c00) ) /* All eprom are HN462716 eproms */
2136   ROM_LOAD( "gl-04.8f",  0x0800, 0x0800, CRC(f58283e3) SHA1(edc6e72516c50fd3402281d9936574d276581ce9) )
2137   ROM_LOAD( "gl-05.8e",  0x1000, 0x0800, CRC(4c7031c0) SHA1(97f7ab0cedcd8eba1c8f6f516d84d672a2108258) )
2138   ROM_LOAD( "gl-06.8d",  0x1800, 0x0800, CRC(097d92a2) SHA1(63ef86657286a4e1fae4f795e0e6b410ca2ef06b) )
2139   ROM_LOAD( "gl-07.8c",  0x2000, 0x0800, CRC(5341d75a) SHA1(40bc8fcc598f58c6ff944e2a4a9288463e75a09d) )
2140
2141   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2142   ROM_LOAD( "gl-01.1j",  0x0000, 0x0800, CRC(968b6016) SHA1(f13e4a8d0fdeb121d39ca76120acdc6c7e7f377c) )
2143   ROM_LOAD( "gl-02.1k",  0x0800, 0x0800, CRC(d14f7510) SHA1(cd09e6ee0a3890d01b2415f5b8346c42c02d15a3) )
2144
2145   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2146   ROM_LOAD( "6l.bpr",    0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
2147ROM_END
2148
2149
2150ROM_START( moonaln )
2151   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2152   ROM_LOAD( "galx.u",       0x0000, 0x0800, CRC(79e4007d) SHA1(d55050498a670d1c022ba3caad34f8fcaccf4a30) ) // prg1.bin
2153   ROM_LOAD( "prg2.bin",     0x0800, 0x0800, CRC(59580b30) SHA1(e659426ad8c4e5e10a7cdd07d8b4fea93f875026) )
2154   ROM_LOAD( "prg3.bin",     0x1000, 0x0800, CRC(b64e9d12) SHA1(3b07902ea61388f54c03d65082e78dfc0fa8d3d2) )
2155   ROM_LOAD( "superg.y",     0x1800, 0x0800, CRC(9463f753) SHA1(d9cb35c19aafec43d08b048bbe2337a790f6ba9d) ) // prg4.bin
2156   ROM_LOAD( "prg5.bin",     0x2000, 0x0800, CRC(8bb78987) SHA1(5f24dba0bb31fc8bda5bf570d568472befc4d740) )
2157
2158   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2159   ROM_LOAD( "ca1.bin",   0x0000, 0x0800, CRC(074271dd) SHA1(cd6a40b493bc51c5340d7083f83c51834b95b5fe) )
2160   ROM_LOAD( "ca2.bin",   0x0800, 0x0800, CRC(84d90397) SHA1(93e6ded079c9721d3f9c003e378e8121584671c9) )
2161
2162   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2163   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
2164ROM_END
2165
2166ROM_START( superg )
2167   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2168   ROM_LOAD( "7f.bin",       0x0000, 0x1000, CRC(4335b1de) SHA1(e41e3d90dac738cf71377f3b476ec67b14dee27a) )
2169   ROM_LOAD( "superg.w",     0x1000, 0x0800, CRC(ddeabdae) SHA1(daa5109a32c7c9a80bdb212dc3e4e3e3c104a731) )
2170   ROM_LOAD( "superg.y",     0x1800, 0x0800, CRC(9463f753) SHA1(d9cb35c19aafec43d08b048bbe2337a790f6ba9d) )
2171   ROM_LOAD( "superg.z",     0x2000, 0x0800, CRC(e6312e35) SHA1(c4010459379d7fe00f605aaf288928b2deffb8b2) )
2172
2173   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2174   ROM_LOAD( "galmidw.1j",   0x0000, 0x0800, CRC(84decf98) SHA1(2e565cb6057b1816a6b4541e6dfadd3c3762fa36) )
2175   ROM_LOAD( "galmidw.1k",   0x0800, 0x0800, CRC(c31ada9e) SHA1(237ebb48549b34ca59a13cc2706512d957413ec4) )
2176
2177   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2178   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
2179ROM_END
2180
2181ROM_START( galturbo )
2182   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2183   ROM_LOAD( "galturbo.u",   0x0000, 0x0800, CRC(e8f3aa67) SHA1(a0e9576784dbe602dd9780e667f01f31defd7c00) )
2184   ROM_LOAD( "galx.v",       0x0800, 0x0800, CRC(bc16064e) SHA1(4e3220fd63c8184bf9581a89dffb6944d8fae3bb) )
2185   ROM_LOAD( "superg.w",     0x1000, 0x0800, CRC(ddeabdae) SHA1(daa5109a32c7c9a80bdb212dc3e4e3e3c104a731) )
2186   ROM_LOAD( "galturbo.y",   0x1800, 0x0800, CRC(a44f450f) SHA1(4009834afb45e9b23c7cf058bcd3378ef8601872) )
2187   ROM_LOAD( "galturbo.z",   0x2000, 0x0800, CRC(3247f3d4) SHA1(5754dedc2d06736629d85514b2e7c262ce27bf2d) )
2188
2189   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2190   ROM_LOAD( "galturbo.1h",  0x0000, 0x0800, CRC(a713fd1a) SHA1(abf86fe5cb7243a1a36d7ac0a868577a3360dcca) )
2191   ROM_LOAD( "galturbo.1k",  0x0800, 0x0800, CRC(28511790) SHA1(dec2e183a753295d033a56184c973bbc810abf55) )
2192
2193   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2194   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
2195ROM_END
2196
2197ROM_START( galapx )
2198   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2199   ROM_LOAD( "galx.u",       0x0000, 0x0800, CRC(79e4007d) SHA1(d55050498a670d1c022ba3caad34f8fcaccf4a30) )
2200   ROM_LOAD( "galx.v",       0x0800, 0x0800, CRC(bc16064e) SHA1(4e3220fd63c8184bf9581a89dffb6944d8fae3bb) )
2201   ROM_LOAD( "galx.w",       0x1000, 0x0800, CRC(72d2d3ee) SHA1(96e0c5824e46d7398c7e58dd6b75a9f4ead6f3f5) )
2202   ROM_LOAD( "galx.y",       0x1800, 0x0800, CRC(afe397f3) SHA1(283c6f3b3f07581d88f7a6e11fc36947a9d90e2e) )
2203   ROM_LOAD( "galx.z",       0x2000, 0x0800, CRC(778c0d3c) SHA1(6a81875abfea515d379c6212cb57f8e54573e943) )
2204
2205   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2206   ROM_LOAD( "galx.1h",      0x0000, 0x0800, CRC(e8810654) SHA1(b6924c7ad765c32714e6abd5bb56b2732edd5855) )
2207   ROM_LOAD( "galx.1k",      0x0800, 0x0800, CRC(cbe84a76) SHA1(c6d72fb452e8213dd40a2eb5dcca726d7cdca658) )
2208
2209   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2210   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
2211ROM_END
2212
2213ROM_START( galap1 )
2214   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2215   ROM_LOAD( "7f.bin",       0x0000, 0x1000, CRC(4335b1de) SHA1(e41e3d90dac738cf71377f3b476ec67b14dee27a) )
2216   ROM_LOAD( "galaxian.w",   0x1000, 0x0800, CRC(4c7031c0) SHA1(97f7ab0cedcd8eba1c8f6f516d84d672a2108258) )
2217   ROM_LOAD( "galx_1_4.rom", 0x1800, 0x0800, CRC(e71e1d9e) SHA1(32bf22b06c84d36de7c1280740b9c11e8d6a12b6) )
2218   ROM_LOAD( "galx_1_5.rom", 0x2000, 0x0800, CRC(6e65a3b2) SHA1(c9f20645ad2882e937245a9e90504423bb492158) )
2219
2220   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2221   ROM_LOAD( "galmidw.1j",   0x0000, 0x0800, CRC(84decf98) SHA1(2e565cb6057b1816a6b4541e6dfadd3c3762fa36) )
2222   ROM_LOAD( "galmidw.1k",   0x0800, 0x0800, CRC(c31ada9e) SHA1(237ebb48549b34ca59a13cc2706512d957413ec4) )
2223
2224   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2225   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
2226ROM_END
2227
2228ROM_START( galap4 )
2229   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2230   ROM_LOAD( "galnamco.u",   0x0000, 0x0800, CRC(acfde501) SHA1(4b72c1ffecaccadc541da2367f3ef70a2a9aed64) )
2231   ROM_LOAD( "galnamco.v",   0x0800, 0x0800, CRC(65cf3c77) SHA1(1c5249815816b395e1e04bf6a7dbb63e40faa0e3) )
2232   ROM_LOAD( "galnamco.w",   0x1000, 0x0800, CRC(9eef9ae6) SHA1(b2282e4edb8911e6aabfa936c3526f90381e1320) )
2233   ROM_LOAD( "galnamco.y",   0x1800, 0x0800, CRC(56a5ddd1) SHA1(1f87f647ebdffba28d5957f195448f6bce17f4d5) )
2234   ROM_LOAD( "galnamco.z",   0x2000, 0x0800, CRC(f4bc7262) SHA1(c4b70e474d49f45cec96f7c250bd77e01e18601a) )
2235
2236   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2237   ROM_LOAD( "galx_4c1.rom", 0x0000, 0x0800, CRC(d5e88ab4) SHA1(737a22e406fd0a97d10e93a2c91c3aa61aebbdef) )
2238   ROM_LOAD( "galx_4c2.rom", 0x0800, 0x0800, CRC(a57b83e4) SHA1(335d8674df1d237a4b83da00eb9aee346bc2e901) )
2239
2240   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2241   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
2242ROM_END
2243
2244ROM_START( swarm )
2245   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2246   ROM_LOAD( "swarm1.bin",   0x0000, 0x0800, CRC(21eba3d0) SHA1(d07f141d785c86faca8c40af034c26f2789e9346) )
2247   ROM_LOAD( "swarm2.bin",   0x0800, 0x0800, CRC(f3a436cd) SHA1(8d64e61b823e22f17cb79bf9e0c7b3c80c76413f) )
2248   ROM_LOAD( "swarm3.bin",   0x1000, 0x0800, CRC(2915e38b) SHA1(045d4cc2c363b9ba8d066f902f03b7eacbeb1f5e) )
2249   ROM_LOAD( "swarm4.bin",   0x1800, 0x0800, CRC(8bbbf486) SHA1(84c975562c9c359069fb70f7f416420c74d40622) )
2250   ROM_LOAD( "swarm5.bin",   0x2000, 0x0800, CRC(f1b1987e) SHA1(0c8b57cb156fdd1a81a5e4535464cafab737185b) )
2251
2252   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2253   ROM_LOAD( "swarma.bin",   0x0000, 0x0800, CRC(ef8657bb) SHA1(c942db83231b04041e2794a08ce779331613edcf) )
2254   ROM_LOAD( "swarmb.bin",   0x0800, 0x0800, CRC(60c4bd31) SHA1(a8f22f8d7a9fca2c29091888e243dfa10211e138) )
2255
2256   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2257   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
2258ROM_END
2259
2260ROM_START( zerotime )
2261   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2262   ROM_LOAD( "zt-p01c.016",  0x0000, 0x0800, CRC(90a2bc61) SHA1(9d23dfcf5310cf1d4aa1b473ec84279585e1a876) )
2263   ROM_LOAD( "zt-2.016",     0x0800, 0x0800, CRC(a433067e) SHA1(1aed1a2153c4a32a9996fc709e544f2063885599) )
2264   ROM_LOAD( "zt-3.016",     0x1000, 0x0800, CRC(aaf038d4) SHA1(2d070fe7c4e9b26092f0f12a9db3392f7d8a65f1) )
2265   ROM_LOAD( "zt-4.016",     0x1800, 0x0800, CRC(786d690a) SHA1(50c5c07941006e3b71afbf057d27daa2f2274925) )
2266   ROM_LOAD( "zt-5.016",     0x2000, 0x0800, CRC(af9260d7) SHA1(955e466a8989993351dc69d73ca322c1c9af7b63) )
2267
2268   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2269   ROM_LOAD( "ztc-2.016",    0x0000, 0x0800, CRC(1b13ca05) SHA1(6999068771dacc6bf6c17eb858af593a929d09af) )
2270   ROM_LOAD( "ztc-1.016",    0x0800, 0x0800, CRC(5cd7df03) SHA1(77873408c89546a17b1da3f64b7e96e314fadb17) )
2271
2272   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2273   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
2274ROM_END
2275
2276ROM_START( starfght )
2277   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2278   ROM_LOAD( "ja.1",         0x0000, 0x0400, CRC(c6ab558b) SHA1(2b707e332c57b9ec6a61220ab2b79ed5076d0628) )
2279   ROM_LOAD( "jb.2",         0x0400, 0x0400, CRC(34b99fed) SHA1(03d12b19c9aee75313cae6af602c93205d2fd4a8) )
2280   ROM_LOAD( "jc.3",         0x0800, 0x0400, CRC(30e28016) SHA1(07a621e5061d85a9559a920d76716ea4db61b674) )
2281   ROM_LOAD( "jd.4",         0x0c00, 0x0400, CRC(de7e7770) SHA1(b06043a1d898eb323ddabffd3d2a3b1f63df0e5e) )
2282   ROM_LOAD( "je.5",         0x1000, 0x0400, CRC(a916c919) SHA1(b3e264ff92687022a0f2f551d5df36db848b48eb) )
2283   ROM_LOAD( "jf.6",         0x1400, 0x0400, CRC(9175882b) SHA1(d9943efcb9245af7f01aecc533a699bdefc7d283) )
2284   ROM_LOAD( "jg.7",         0x1800, 0x0400, CRC(707c0f02) SHA1(4cfb18b8161ec6a74663b54120bdc6371ee9dbff) )
2285   ROM_LOAD( "jh.8",         0x1c00, 0x0400, CRC(5dd26461) SHA1(173b939287d0261ff069c277a1afd724133f4c88) )
2286   ROM_LOAD( "ji.9",         0x2000, 0x0400, CRC(6651fe93) SHA1(eb1d9466090ef723ae20003e5be27059f5bea57b) )
2287   ROM_LOAD( "jj.10",        0x2400, 0x0400, CRC(12c721b9) SHA1(1944cd5129115d245ced44da7f1eb4574561c457) )
2288
2289   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2290   ROM_LOAD( "k1.7a",        0x0000, 0x0800, CRC(977e37cf) SHA1(88ff1e4edadf5cfc83413a1fe999aecf4ba72232) )
2291   ROM_LOAD( "k2.9a",        0x0800, 0x0800, CRC(15e387ce) SHA1(d804b1391de5a15c336aa53c812b4a885f830191) )
2292
2293   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2294   ROM_LOAD( "mmi6331.7f",   0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) ) /* Compatible with 82s123 prom */
2295ROM_END
2296
2297/* was marked 'star fighter' but doesn't appear to be the above game */
2298ROM_START( galaxbsf )
2299   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2300   ROM_LOAD( "1.bn",         0x0000, 0x0400, CRC(cc37b774) SHA1(5b7d9e3c896a1f5b0353732806568d4ffead3ead) )
2301   ROM_LOAD( "2.bn",         0x0400, 0x0400, CRC(c6d21f03) SHA1(64784915bf988fd2a3eea5f219c95c8498175018) )
2302   ROM_LOAD( "3.bn",         0x0800, 0x0400, CRC(30e28016) SHA1(07a621e5061d85a9559a920d76716ea4db61b674) )
2303   ROM_LOAD( "4.bn",         0x0c00, 0x0400, CRC(de7e7770) SHA1(b06043a1d898eb323ddabffd3d2a3b1f63df0e5e) )
2304   ROM_LOAD( "5.bn",         0x1000, 0x0400, CRC(a916c919) SHA1(b3e264ff92687022a0f2f551d5df36db848b48eb) )
2305   ROM_LOAD( "6.bn",         0x1400, 0x0400, CRC(9175882b) SHA1(d9943efcb9245af7f01aecc533a699bdefc7d283) )
2306   ROM_LOAD( "7.bn",         0x1800, 0x0400, CRC(1237b9da) SHA1(00e11532c599fca452a816683b361a24476b7100) )
2307   ROM_LOAD( "8.bn",         0x1c00, 0x0400, CRC(78c53607) SHA1(780acff57b594185eb5f4b24ae7d8b4992d96611) )
2308   ROM_LOAD( "9.bn",         0x2000, 0x0400, CRC(901894cc) SHA1(a189a8ab0068e9acc3be7b8e87adc1eadfd6b708) )
2309   ROM_LOAD( "10.bn",        0x2400, 0x0400, CRC(5876f695) SHA1(e8c0d13066cfe4a409293b9e1380513099b35330) )
2310
2311   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2312   ROM_LOAD( "11.bn",       0x0000, 0x0800, CRC(39fb43a4) SHA1(4755609bd974976f04855d51e08ec0d62ab4bc07) )
2313   ROM_LOAD( "12.bn",       0x0800, 0x0800, CRC(7e3f56a2) SHA1(a9795d8b7388f404f3b0e2c6ce15d713a4c5bafa) )
2314
2315   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2316   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
2317ROM_END
2318
2319ROM_START( supergx )
2320   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2321   ROM_LOAD( "sg1",          0x0000, 0x0800, CRC(b83f4578) SHA1(9a5d5fc291839f7f1e0a52cca7bea29e99c13315) )
2322   ROM_LOAD( "sg2",          0x0800, 0x0800, CRC(d12ca054) SHA1(8eb7f6904c3c650bfa80908a5988622d5e693bd1) )
2323   ROM_LOAD( "sg3",          0x1000, 0x0800, CRC(53714cb1) SHA1(7dffcd3ced1c3354339bb69477f8aa4c708708db) )
2324   ROM_LOAD( "sg4",          0x1800, 0x0800, CRC(2f36fc69) SHA1(d310dcb0a79b03ee26b0575db9cba6d920cb9273) )
2325   ROM_LOAD( "sg5",          0x2000, 0x0800, CRC(1e0ed4fd) SHA1(183d8990dbff1954921f8c5b67cec09f2d380794) )
2326   ROM_LOAD( "sg6",          0x2800, 0x0800, BAD_DUMP CRC(4f3d97a8) SHA1(b9fcab182ab57e8374fef93f7fd314a155a8d04d) )
2327
2328   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
2329   ROM_LOAD( "sgg1",         0x0000, 0x0800, CRC(a1287bf6) SHA1(eeeaba4b9e186454a5e2f1c26e333e8fccd97af8) )
2330   ROM_RELOAD(               0x0800, 0x0800 )
2331   ROM_LOAD( "sgg2",         0x1000, 0x0800, CRC(528f1481) SHA1(e266a75c3109bcfa2a0394f2ed0ac136fc3158ba) )
2332   ROM_RELOAD(               0x1800, 0x0800 )
2333
2334   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2335   ROM_LOAD( "supergx.prm",  0x0000, 0x0020, NO_DUMP )
2336ROM_END
2337
2338ROM_START( tst_galx )
2339   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2340   ROM_LOAD( "test.u",    0x0000, 0x0800, CRC(0614cd7f) SHA1(12440678be8a27a6c3032b6e43c45e27905ffa83) )   /*  The Test ROM */
2341   ROM_LOAD( "galmidw.v",    0x0800, 0x0800, CRC(9c999a40) SHA1(02fdcd95d8511e64c0d2b007b874112d53e41045) )
2342   ROM_LOAD( "galmidw.w",    0x1000, 0x0800, CRC(b5894925) SHA1(0046b9ed697a34d088de1aead8bd7cbe526a2396) )
2343   ROM_LOAD( "galmidw.y",    0x1800, 0x0800, CRC(6b3ca10b) SHA1(18d8714e5ef52f63ba8888ecc5a25b17b3bf17d1) )
2344
2345   ROM_LOAD( "7l",           0x2000, 0x0800, CRC(1b933207) SHA1(8b44b0f74420871454e27894d0f004859f9e59a9) )
2346
2347   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2348   ROM_LOAD( "1h.bin",       0x0000, 0x0800, CRC(39fb43a4) SHA1(4755609bd974976f04855d51e08ec0d62ab4bc07) )
2349   ROM_LOAD( "1k.bin",       0x0800, 0x0800, CRC(7e3f56a2) SHA1(a9795d8b7388f404f3b0e2c6ce15d713a4c5bafa) )
2350
2351   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2352   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
2353ROM_END
2354
2355
2356ROM_START( blkhole )
2357   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2358   ROM_LOAD( "bh1",          0x0000, 0x0800, CRC(64998819) SHA1(69fe5dfbe6cde18ef4cae62da12b5c692c2c72b9) )
2359   ROM_LOAD( "bh2",          0x0800, 0x0800, CRC(26f26ce4) SHA1(720ce7af05ef596fb9a109591534c74d282955e8) )
2360   ROM_LOAD( "bh3",          0x1000, 0x0800, CRC(3418bc45) SHA1(088bbbde66b7b5c36fa48cf14c22146e1444e67c) )
2361   ROM_LOAD( "bh4",          0x1800, 0x0800, CRC(735ff481) SHA1(d9b32db048a0e2a1195cd6f7326005e6622242a9) )
2362   ROM_LOAD( "bh5",          0x2000, 0x0800, CRC(3f657be9) SHA1(3ed1ee0bc199c1625156d2771eecd18a57a0e6ed) )
2363   ROM_LOAD( "bh6",          0x2800, 0x0800, CRC(a057ab35) SHA1(430261bafe20fc182e6e6659019cf42643e95d54) )
2364
2365   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2366   ROM_LOAD( "bh7",          0x0000, 0x0800, CRC(975ba821) SHA1(c50d55f6ab81b803d67f5e18c1243ef85a1a2df1) )
2367   ROM_LOAD( "bh8",          0x0800, 0x0800, CRC(03d11020) SHA1(5768b573fac9aac168db2723462cca76d4d80552) )
2368
2369   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2370   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
2371ROM_END
2372
2373ROM_START( orbitron )
2374   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2375   ROM_LOAD( "orbitron.3",   0x0600, 0x0200, CRC(419f9c9b) SHA1(788a3920f4270b886b3a578f8c2df33e6314a1c3) )
2376   ROM_CONTINUE(           0x0400, 0x0200)
2377   ROM_CONTINUE(           0x0200, 0x0200)
2378   ROM_CONTINUE(           0x0000, 0x0200)
2379   ROM_LOAD( "orbitron.4",   0x0e00, 0x0200, CRC(44ad56ac) SHA1(3a8339cdee50912a16ac0fb448e6659e32542c0c) )
2380   ROM_CONTINUE(           0x0c00, 0x0200)
2381   ROM_CONTINUE(           0x0a00, 0x0200)
2382   ROM_CONTINUE(           0x0800, 0x0200)
2383   ROM_LOAD( "orbitron.1",   0x1600, 0x0200, CRC(da3f5168) SHA1(1927cc7cd3b9d15b629e09781557f4c75d684182) )
2384   ROM_CONTINUE(           0x1400, 0x0200)
2385   ROM_CONTINUE(           0x1200, 0x0200)
2386   ROM_CONTINUE(           0x1000, 0x0200)
2387   ROM_LOAD( "orbitron.2",   0x1e00, 0x0200, CRC(a3b813fc) SHA1(7f0f22667bee897b474fb485d65a74d74a36991a) )
2388   ROM_CONTINUE(           0x1c00, 0x0200)
2389   ROM_CONTINUE(           0x1a00, 0x0200)
2390   ROM_CONTINUE(           0x1800, 0x0200)
2391   ROM_LOAD( "orbitron.5",   0x2000, 0x0800, CRC(20cd8bb8) SHA1(a5309cb04a656c6e1e18bb19910474af8ef814a5) )
2392
2393   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2394   ROM_LOAD( "orbitron.6",   0x0000, 0x0800, CRC(2c91b83f) SHA1(29c73b7ad0dc5a3ba739492c902ad9201eae6ef2) )
2395   ROM_LOAD( "orbitron.7",   0x0800, 0x0800, CRC(46f4cca4) SHA1(e5fb616b1d17b5b5167f05f7840638840deb2d13) )
2396
2397   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2398   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
2399ROM_END
2400
2401ROM_START( luctoday )
2402   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2403   ROM_LOAD( "ltprog1.bin", 0x0000, 0x0800, CRC(59c389b9) SHA1(1e158ced3b56db2c51e422fb4c0b8893565f1956))
2404   ROM_LOAD( "ltprog2.bin", 0x2000, 0x0800, CRC(ac3893b1) SHA1(f6b9cd8111b367ff7030cba52fe965959d92568f))
2405
2406   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2407   ROM_LOAD( "ltchar2.bin", 0x0000, 0x0800, CRC(8cd73bdc) SHA1(6174f7347d2c96f9c5074bc0da5a370c9b07461b))
2408   ROM_LOAD( "ltchar1.bin", 0x0800, 0x0800, CRC(b5ba9946) SHA1(7222cbe8c41ca74b214f4dd5439bf69d90f4644e))
2409
2410   ROM_REGION( 0x0020, REGION_PROMS, 0 )//This may not be the correct prom
2411   ROM_LOAD( "74s288.ch", 0x0000, 0x0020, BAD_DUMP CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d))
2412ROM_END
2413
2414ROM_START( chewing )
2415   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2416   ROM_LOAD( "1.bin", 0x0000, 0x1000, CRC(7470b347) SHA1(315d2631b50a6e469b9538318d95452e8d2e1f69) )
2417   ROM_LOAD( "7l.bin", 0x2000, 0x0800, CRC(78ebed36) SHA1(e80185737c8ac448901cf0e60ca50d967c323b34) )
2418
2419   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2420   ROM_LOAD( "2.bin", 0x0000, 0x0800, CRC(88c605f3) SHA1(938a9fadfa0994a1d2fc9b3266ec4ccdb5ec6d3a) )
2421   ROM_LOAD( "3.bin", 0x0800, 0x0800, CRC(77ac016a) SHA1(fa5b1e79603ca8d2ee7b3d0a78f12d9ffeec3fd4) )
2422
2423   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2424   ROM_LOAD( "74s288.ch", 0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) )
2425ROM_END
2426
2427ROM_START( catacomb )
2428   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2429   ROM_LOAD( "catacomb.u",    0x0000, 0x0800, CRC(35cc28d2) SHA1(e1dbd75fc21ec88b8119bf9508c87d78e1d5c4f6) )
2430   ROM_LOAD( "catacomb.v",    0x0800, 0x0800, CRC(1d1ce133) SHA1(e22a169003a2238004bdf6c2558198216c2353b7) )
2431   ROM_LOAD( "catacomb.w",    0x1000, 0x0800, CRC(479bbde7) SHA1(9981662cb6351de7c1730de45f645fb0e26ea467) )
2432   /* no .x */
2433   ROM_LOAD( "catacomb.y",    0x2000, 0x0800, CRC(5e3da534) SHA1(a9b960ae96c8ef0b2d590bc58b711aad949025e2) )
2434
2435   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2436   ROM_LOAD( "cat-gfx1",       0x0000, 0x0800, CRC(e871e65c) SHA1(0b528dfab0f57153db9406798848cdedee0323a0) )
2437   ROM_LOAD( "cat-gfx2",       0x0800, 0x0800, CRC(b14dafaa) SHA1(592d5931a76563b3565f22ac4c0120b9a120193f) )
2438
2439   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2440   /* No color PROM came with the conversion - the Moon Cresta one seems more appropriate than Galaxian,
2441       (the game is unplayable with a Galaxian PROM) but which was intended for use with the kit is unclear */
2442   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, BAD_DUMP CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
2443ROM_END
2444
2445ROM_START( omega )
2446   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2447   ROM_LOAD( "omega1.bin",   0x0000, 0x0800, CRC(fc2a096b) SHA1(071ff30060a1aa0a47ae6e88140b80caed00fc4e) )
2448   ROM_LOAD( "omega2.bin",   0x0800, 0x0800, CRC(ad100357) SHA1(7c5e82c25e65b4a390cf5607f15bf4df407f7f11) )
2449   ROM_LOAD( "omega3.bin",   0x1000, 0x0800, CRC(d7e3be79) SHA1(ffa228043c6c717bee8bbec16432dcfe2e348aef) )
2450   ROM_LOAD( "omega4.bin",   0x1800, 0x0800, CRC(42068171) SHA1(940ca30a5772940b8a437498d22c6121482b38e6) )
2451   ROM_LOAD( "omega5.bin",   0x2000, 0x0800, CRC(d8a93383) SHA1(5f60f127360b14206d4df638e528bf961049e37d) )
2452   ROM_LOAD( "omega6.bin",   0x2800, 0x0800, CRC(32a42f44) SHA1(94f458997ec279dce218a17b665fa8c46067e646) )
2453
2454   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2455   ROM_LOAD( "omega1h.bin",  0x0000, 0x0800, CRC(527fd384) SHA1(92a384899d5acd2c689f637da16a0e2d11a9d9c6) )
2456   ROM_LOAD( "omega1k.bin",  0x0800, 0x0800, CRC(36de42c6) SHA1(6fd93d439e3b8eab62049f925d9e8f8deeda2ae3) )
2457
2458   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2459   ROM_LOAD( "6331-1j.86",   0x0000, 0x0020, NO_DUMP )   /* missing */
2460ROM_END
2461
2462
2463ROM_START( warofbug )
2464   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2465   ROM_LOAD( "warofbug.u",   0x0000, 0x0800, CRC(b8dfb7e3) SHA1(c7c675b2638869a9cd7dbd554e6131d8c71b567a) )
2466   ROM_LOAD( "warofbug.v",   0x0800, 0x0800, CRC(fd8854e0) SHA1(b39ab41b834f18341968dd780f0a3cd07d70c16c) )
2467   ROM_LOAD( "warofbug.w",   0x1000, 0x0800, CRC(4495aa14) SHA1(f1be281db1d831770efa9cc41ea87eb348e70108) )
2468   ROM_LOAD( "warofbug.y",   0x1800, 0x0800, CRC(c14a541f) SHA1(d32e89fd18d9e1db2e4a545186eac728c0b02255) )
2469   ROM_LOAD( "warofbug.z",   0x2000, 0x0800, CRC(c167fe55) SHA1(d85c4d1bd7aa5e14eb2f11dfa14979e5dbc084a8) )
2470
2471   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2472   ROM_LOAD( "warofbug.1k",  0x0000, 0x0800, CRC(8100fa85) SHA1(06641c431cace36dec98b87555f62e72f3e53a31) )
2473   ROM_LOAD( "warofbug.1j",  0x0800, 0x0800, CRC(d1220ae9) SHA1(e892bc8b0b71d8b07503e474e9c30e6cab460682) )
2474
2475   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2476   ROM_LOAD( "warofbug.clr", 0x0000, 0x0020, CRC(8688e64b) SHA1(ed13414257f580b98b50c9892a14159c55e7838d) )
2477ROM_END
2478
2479ROM_START( redufo )
2480   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2481   ROM_LOAD( "ru1a",         0x0000, 0x0800, CRC(5a8e4f37) SHA1(c0957ede91e2dc3f80e4912b877843aed5d15779) )
2482   ROM_LOAD( "ru2a",         0x0800, 0x0800, CRC(c624f52d) SHA1(119a660513ad33e35c9bdaecd588219bf8026d82) )
2483   ROM_LOAD( "ru3a",         0x1000, 0x0800, CRC(e1030d1c) SHA1(80640fbbfa7f84c016366b1084e7f8a7acdcd440) )
2484   ROM_LOAD( "ru4a",         0x1800, 0x0800, CRC(7692069e) SHA1(5130d61c857c3b85eadabcf10f3a6771c72f0f56) )
2485   ROM_LOAD( "ru5a",         0x2000, 0x0800, CRC(cb648ff3) SHA1(e0042251ca7f4a31b5bd9f8cca35278a1e152899) )
2486   ROM_LOAD( "ru6a",         0x2800, 0x0800, CRC(e1a9f58e) SHA1(4fc7489fca057156a7cf5efcb01058ce4f0db69e) )
2487
2488   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2489   ROM_LOAD( "ruhja",        0x0000, 0x0800, CRC(8a422b0d) SHA1(b886157518f73e7115a225ba230e456179f6e18f) )
2490   ROM_LOAD( "rukla",        0x0800, 0x0800, CRC(1eb84cb1) SHA1(08f360802a90039c0499a1417d06b6eb5f89d67e) )
2491
2492   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2493   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
2494ROM_END
2495
2496ROM_START( exodus )
2497   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2498   ROM_LOAD( "exodus1.bin",  0x0000, 0x0800, CRC(5dfe65e1) SHA1(5f1ce289b3c98a89d61d4dea952b4b8888d92ed7) )
2499   ROM_LOAD( "exodus2.bin",  0x0800, 0x0800, CRC(6559222f) SHA1(520497f6fb2b0c76be8419702e8af894283ebf0b) )
2500   ROM_LOAD( "exodus3.bin",  0x1000, 0x0800, CRC(bf7030e8) SHA1(59b0624dd91527a916ee6a27d61def82c3c14f49) )
2501   ROM_LOAD( "exodus4.bin",  0x1800, 0x0800, CRC(3607909e) SHA1(93d074fe4b258d496a0998acb3fc47f0a762227a) )
2502   ROM_LOAD( "exodus9.bin",  0x2000, 0x0800, CRC(994a90c4) SHA1(a07e3ce8f69042c45ebe00ab1d40dbb85602a7a2) )
2503   ROM_LOAD( "exodus10.bin", 0x2800, 0x0800, CRC(fbd11187) SHA1(a3bd49c4a79e76b08e6b343b94689159dc239458) )
2504   ROM_LOAD( "exodus11.bin", 0x3000, 0x0800, CRC(fd07d811) SHA1(6b968a7ce452f76a8d26fe694aa4ea6b16e8b6fa) )
2505
2506   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2507   ROM_LOAD( "exodus5.bin",  0x0000, 0x0800, CRC(b34c7cb4) SHA1(146ed4a02d7540378f4a27a6643055216ad403f7) )
2508   ROM_LOAD( "exodus6.bin",  0x0800, 0x0800, CRC(50a2d447) SHA1(1f97d1096ad2a3a43a480cb1f040f4534fada3c3) )
2509
2510   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2511   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
2512ROM_END
2513
2514
2515ROM_START( azurian )
2516   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2517   ROM_LOAD( "pgm.1",        0x0000, 0x1000, CRC(17a0fca7) SHA1(0ffb80d433fbaa0631d0d982a453f9e6cccab297) )
2518   ROM_LOAD( "pgm.2",        0x1000, 0x1000, CRC(14659848) SHA1(bb9d9c01b074bf7ed7a1c29379bbef41728dd27a) )
2519   ROM_LOAD( "pgm.3",        0x2000, 0x1000, CRC(8f60fb97) SHA1(d0f4d65e568ac1a5d41e550f2f626cbf72884959) )
2520
2521   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2522   ROM_LOAD( "gfx.1",        0x0000, 0x0800, CRC(f5afb803) SHA1(ffc8f86a35179d7715ef618004b79003e0236a93) )
2523   ROM_LOAD( "gfx.2",        0x0800, 0x0800, CRC(ae96e5d1) SHA1(df667fb96d7353ccf9ce0acf788371ef2221e97d) )
2524
2525   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2526   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
2527ROM_END
2528
2529ROM_START( pisces )
2530   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2531   ROM_LOAD( "p1.bin",       0x0000, 0x0800, CRC(40c5b0e4) SHA1(6c18e6f4719eb0d7eb13b778d7ea58e4b87ac35c) )
2532   ROM_LOAD( "p2.bin",       0x0800, 0x0800, CRC(055f9762) SHA1(9d821874dd48a80651adc58a2f7fe5d2b3ed67bc) )
2533   ROM_LOAD( "p3.bin",       0x1000, 0x0800, CRC(3073dd04) SHA1(b93913a988f412d565abd19dc668976585cc8066) )
2534   ROM_LOAD( "p4.bin",       0x1800, 0x0800, CRC(44aaf525) SHA1(667bf4c3a36169c3ddddd22b2f1f90bcc9308548) )
2535   ROM_LOAD( "p5.bin",       0x2000, 0x0800, CRC(fade512b) SHA1(ccef2650f1d9dc3fdde2d441774246d47febc2cc) )
2536   ROM_LOAD( "p6.bin",       0x2800, 0x0800, CRC(5ab2822f) SHA1(bbcac3aab943dd9b173de11ddf02ff75d16b1582) )
2537
2538   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
2539//  ROM_LOAD( "pisces.1j",    0x0000, 0x1000, CRC(2dba9e0e) )
2540//  ROM_LOAD( "pisces.1k",    0x1000, 0x1000, CRC(cdc5aa26) )
2541   ROM_LOAD( "g09.bin",      0x0000, 0x0800, CRC(9503a23a) SHA1(23848de56841dd1de9ef74d5a9c981c784098175) )
2542   ROM_LOAD( "g11.bin",      0x0800, 0x0800, CRC(0adfc3fe) SHA1(a4da488632d9906066db45ae62747caf5ffbf2d8) )
2543   ROM_LOAD( "g10.bin",      0x1000, 0x0800, CRC(3e61f849) SHA1(efa0059bc843af0c3bb94f4bc0a8286ca5069179) )
2544   ROM_LOAD( "g12.bin",      0x1800, 0x0800, CRC(7130e9eb) SHA1(e6bb7a9b4f2fc001296e1060d0671b7a88599c8b) )
2545
2546   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2547   ROM_LOAD( "colour.bin",   0x0000, 0x0020, CRC(57a45057) SHA1(d4ec6a54f72640e5b485aa59e206c090e67ff640) )   // same as checkman.clr
2548ROM_END
2549
2550ROM_START( piscesb )
2551   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2552   ROM_LOAD( "pisces.a1",    0x0000, 0x0800, CRC(856b8e1f) SHA1(24d468b5f06f54c3fa1cb54ceec8a0c8e285430e) )
2553   ROM_LOAD( "p2.bin",       0x0800, 0x0800, CRC(055f9762) SHA1(9d821874dd48a80651adc58a2f7fe5d2b3ed67bc) )
2554   ROM_LOAD( "pisces.b2",    0x1000, 0x0800, CRC(5540f2e4) SHA1(b069a7e46fa2c1f732371ef056caaf8f343e11a8) )
2555   ROM_LOAD( "p4.bin",       0x1800, 0x0800, CRC(44aaf525) SHA1(667bf4c3a36169c3ddddd22b2f1f90bcc9308548) )
2556   ROM_LOAD( "p5.bin",       0x2000, 0x0800, CRC(fade512b) SHA1(ccef2650f1d9dc3fdde2d441774246d47febc2cc) )
2557   ROM_LOAD( "p6.bin",       0x2800, 0x0800, CRC(5ab2822f) SHA1(bbcac3aab943dd9b173de11ddf02ff75d16b1582) )
2558
2559   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
2560//  ROM_LOAD( "pisces.1j",    0x0000, 0x1000, CRC(2dba9e0e) )
2561//  ROM_LOAD( "pisces.1k",    0x1000, 0x1000, CRC(cdc5aa26) )
2562   ROM_LOAD( "g09.bin",      0x0000, 0x0800, CRC(9503a23a) SHA1(23848de56841dd1de9ef74d5a9c981c784098175) )
2563   ROM_LOAD( "g11.bin",      0x0800, 0x0800, CRC(0adfc3fe) SHA1(a4da488632d9906066db45ae62747caf5ffbf2d8) )
2564   ROM_LOAD( "g10.bin",      0x1000, 0x0800, CRC(3e61f849) SHA1(efa0059bc843af0c3bb94f4bc0a8286ca5069179) )
2565   ROM_LOAD( "g12.bin",      0x1800, 0x0800, CRC(7130e9eb) SHA1(e6bb7a9b4f2fc001296e1060d0671b7a88599c8b) )
2566
2567   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2568//  ROM_LOAD( "6331-1j.86",   0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) ) /* very close to Galaxian */
2569   ROM_LOAD( "colour.bin",   0x0000, 0x0020, CRC(57a45057) SHA1(d4ec6a54f72640e5b485aa59e206c090e67ff640) )   // same as checkman.clr
2570ROM_END
2571
2572ROM_START( omni )
2573   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2574   ROM_LOAD( "omni1.7f",     0x0000, 0x1000, CRC(a9b7acc6) SHA1(0c6319957b760fea3cfa6c29b37c25f5a89a6d77) )
2575   ROM_LOAD( "omni2.7j",     0x1000, 0x1000, CRC(6ade29b7) SHA1(64f1ce82c761db11d26c385299a7063f5971c99a) )
2576   ROM_LOAD( "omni3.7f",     0x2000, 0x1000, CRC(9e37bb24) SHA1(d90b2ff0297d87687561e1e9b29510b6c051760b) )
2577
2578   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
2579   ROM_LOAD( "omni5b.l1",    0x0000, 0x0800, CRC(9503a23a) SHA1(23848de56841dd1de9ef74d5a9c981c784098175) )
2580   ROM_LOAD( "omni6c.j22",   0x0800, 0x0800, CRC(0adfc3fe) SHA1(a4da488632d9906066db45ae62747caf5ffbf2d8) )
2581   ROM_LOAD( "omni4a.j1",    0x1000, 0x0800, CRC(3e61f849) SHA1(efa0059bc843af0c3bb94f4bc0a8286ca5069179) )
2582   ROM_LOAD( "omni7d.l2",    0x1800, 0x0800, CRC(7130e9eb) SHA1(e6bb7a9b4f2fc001296e1060d0671b7a88599c8b) )
2583
2584   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2585   ROM_LOAD( "colour.bin",   0x0000, 0x0020, CRC(57a45057) SHA1(d4ec6a54f72640e5b485aa59e206c090e67ff640) )
2586ROM_END
2587
2588ROM_START( uniwars )
2589   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2590   ROM_LOAD( "f07_1a.bin",   0x0000, 0x0800, CRC(d975af10) SHA1(a2e2a36a75db8fd09441308b08b6ae073c68b8cf) )
2591   ROM_LOAD( "h07_2a.bin",   0x0800, 0x0800, CRC(b2ed14c3) SHA1(7668df11f64b8e296eedfee53437777dc53a56d5) )
2592   ROM_LOAD( "k07_3a.bin",   0x1000, 0x0800, CRC(945f4160) SHA1(5fbe879f51e14c4c7ae551e5b3089f8e148770a4) )
2593   ROM_LOAD( "m07_4a.bin",   0x1800, 0x0800, CRC(ddc80bc5) SHA1(18c3920198baf87267bc7f12db6b23b090d3577a) )
2594   ROM_LOAD( "d08p_5a.bin",  0x2000, 0x0800, CRC(62354351) SHA1(85bf18942f73023b8be0c3659a0dcd3dfcccfc2c) )
2595   ROM_LOAD( "gg6",          0x2800, 0x0800, CRC(270a3f4d) SHA1(20f5097033fca515d70fe47178cbd341a1d07443) )
2596   ROM_LOAD( "m08p_7a.bin",  0x3000, 0x0800, CRC(c9245346) SHA1(239bad3fe64eaab2dfc3febd06d1124103a10504) )
2597   ROM_LOAD( "n08p_8a.bin",  0x3800, 0x0800, CRC(797d45c7) SHA1(76fb8b45fcce3622c59c04af32cfa001ef7bf71d) )
2598
2599   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
2600   ROM_LOAD( "egg10",        0x0000, 0x0800, CRC(012941e0) SHA1(4f7ec4d95939cb7c4086bb7df43759ac504ae47c) )
2601   ROM_LOAD( "h01_2.bin",    0x0800, 0x0800, CRC(c26132af) SHA1(7ae125a911dfd47aeca4f129f580762ce4d8d91a) )
2602   ROM_LOAD( "egg9",         0x1000, 0x0800, CRC(fc8b58fd) SHA1(72553e2735b0dcc2dcfce9698d49566732492588) )
2603   ROM_LOAD( "k01_2.bin",    0x1800, 0x0800, CRC(dcc2b33b) SHA1(c3a5ac935c519400dfabb28909f7e460769d1837) )
2604
2605   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2606   ROM_LOAD( "uniwars.clr",  0x0000, 0x0020, CRC(25c79518) SHA1(e8f7e8b3d0cf1ed9d723948548f58abf0e2c6d1f) )
2607ROM_END
2608
2609ROM_START( gteikoku )
2610   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2611   ROM_LOAD( "f07_1a.bin",   0x0000, 0x0800, CRC(d975af10) SHA1(a2e2a36a75db8fd09441308b08b6ae073c68b8cf) )
2612   ROM_LOAD( "h07_2a.bin",   0x0800, 0x0800, CRC(b2ed14c3) SHA1(7668df11f64b8e296eedfee53437777dc53a56d5) )
2613   ROM_LOAD( "k07_3a.bin",   0x1000, 0x0800, CRC(945f4160) SHA1(5fbe879f51e14c4c7ae551e5b3089f8e148770a4) )
2614   ROM_LOAD( "m07_4a.bin",   0x1800, 0x0800, CRC(ddc80bc5) SHA1(18c3920198baf87267bc7f12db6b23b090d3577a) )
2615   ROM_LOAD( "d08p_5a.bin",  0x2000, 0x0800, CRC(62354351) SHA1(85bf18942f73023b8be0c3659a0dcd3dfcccfc2c) )
2616   ROM_LOAD( "e08p_6a.bin",  0x2800, 0x0800, CRC(d915a389) SHA1(0e2ff6eec9453856a1276889946b463cfae58eba) )
2617   ROM_LOAD( "m08p_7a.bin",  0x3000, 0x0800, CRC(c9245346) SHA1(239bad3fe64eaab2dfc3febd06d1124103a10504) )
2618   ROM_LOAD( "n08p_8a.bin",  0x3800, 0x0800, CRC(797d45c7) SHA1(76fb8b45fcce3622c59c04af32cfa001ef7bf71d) )
2619
2620   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
2621   ROM_LOAD( "h01_1.bin",    0x0000, 0x0800, CRC(8313c959) SHA1(b09157c6f824d6e94647728cbb329877fcb4e502) )
2622   ROM_LOAD( "h01_2.bin",    0x0800, 0x0800, CRC(c26132af) SHA1(7ae125a911dfd47aeca4f129f580762ce4d8d91a) )
2623   ROM_LOAD( "k01_1.bin",    0x1000, 0x0800, CRC(c9d4537e) SHA1(65d27066ffec04b755d2f5d3f36f5ec6792e8d6c) )
2624   ROM_LOAD( "k01_2.bin",    0x1800, 0x0800, CRC(dcc2b33b) SHA1(c3a5ac935c519400dfabb28909f7e460769d1837) )
2625
2626   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2627   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
2628ROM_END
2629
2630ROM_START( gteikokb )
2631   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2632   ROM_LOAD( "1.bin",        0x0000, 0x0800, CRC(bf00252f) SHA1(a4ec48c6b9468f52bcf8b01d1bdb908dcf81d42d) )
2633   ROM_LOAD( "2.bin",        0x0800, 0x0800, CRC(f712b7d5) SHA1(c269db2e9984a3fbd33888bd426c53d319cad36f) )
2634   ROM_LOAD( "k07_3a.bin",   0x1000, 0x0800, CRC(945f4160) SHA1(5fbe879f51e14c4c7ae551e5b3089f8e148770a4) )
2635   ROM_LOAD( "4.bin",        0x1800, 0x0800, CRC(808a39a8) SHA1(f3db5175d0c2d10e9e3ded400888f6541490597e) )
2636   ROM_LOAD( "5.bin",       0x2000, 0x0800, CRC(36fe6e67) SHA1(e54a19ad6611fefcdfcf74019a63cc6cea6cf433) )
2637   ROM_LOAD( "6.bin",       0x2800, 0x0800, CRC(c5ea67e8) SHA1(0157eb2ef5ab56cd00e5f4fafd618271d2d4862b) )
2638   ROM_LOAD( "m08p_7a.bin",  0x3000, 0x0800, CRC(c9245346) SHA1(239bad3fe64eaab2dfc3febd06d1124103a10504) )
2639   ROM_LOAD( "8.bin",       0x3800, 0x0800, CRC(28df3229) SHA1(fd307c6a7de4fcddce1c2f36a957a31b9a6aaa21) )
2640
2641   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
2642   ROM_LOAD( "h01_1.bin",    0x0000, 0x0800, CRC(8313c959) SHA1(b09157c6f824d6e94647728cbb329877fcb4e502) )
2643   ROM_LOAD( "h01_2.bin",    0x0800, 0x0800, CRC(c26132af) SHA1(7ae125a911dfd47aeca4f129f580762ce4d8d91a) )
2644   ROM_LOAD( "k01_1.bin",    0x1000, 0x0800, CRC(c9d4537e) SHA1(65d27066ffec04b755d2f5d3f36f5ec6792e8d6c) )
2645   ROM_LOAD( "k01_2.bin",    0x1800, 0x0800, CRC(dcc2b33b) SHA1(c3a5ac935c519400dfabb28909f7e460769d1837) )
2646
2647   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2648   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
2649ROM_END
2650
2651ROM_START( gteikob2 )
2652   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2653   ROM_LOAD( "94gnog.bin",   0x0000, 0x0800, CRC(67ec3235) SHA1(f250db867257f474f693012c11008bf92f038cc7) )
2654   ROM_LOAD( "92gnog.bin",   0x0800, 0x0800, CRC(813c41f2) SHA1(bd92e0b53e3c8874d63f3444bca02246cd74b1c6) )
2655   ROM_LOAD( "k07_3a.bin",   0x1000, 0x0800, CRC(945f4160) SHA1(5fbe879f51e14c4c7ae551e5b3089f8e148770a4) )
2656   ROM_LOAD( "1gnog.bin",    0x1800, 0x0800, CRC(49ff9658) SHA1(3b7f3dc40b3fbc7d4abe5f5d534951c70409148c) )
2657   ROM_LOAD( "5.bin",       0x2000, 0x0800, CRC(36fe6e67) SHA1(e54a19ad6611fefcdfcf74019a63cc6cea6cf433) )
2658   ROM_LOAD( "e08p_6a.bin",  0x2800, 0x0800, CRC(d915a389) SHA1(0e2ff6eec9453856a1276889946b463cfae58eba) )
2659   ROM_LOAD( "m08p_7a.bin",  0x3000, 0x0800, CRC(c9245346) SHA1(239bad3fe64eaab2dfc3febd06d1124103a10504) )
2660   ROM_LOAD( "98gnog.bin",   0x3800, 0x0800, CRC(e9d4ad3c) SHA1(b32b96bebbf59e23b06958f6b16790e9f9f334e2) )
2661
2662   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
2663   ROM_LOAD( "h01_1.bin",    0x0000, 0x0800, CRC(8313c959) SHA1(b09157c6f824d6e94647728cbb329877fcb4e502) )
2664   ROM_LOAD( "h01_2.bin",    0x0800, 0x0800, CRC(c26132af) SHA1(7ae125a911dfd47aeca4f129f580762ce4d8d91a) )
2665   ROM_LOAD( "k01_1.bin",    0x1000, 0x0800, CRC(c9d4537e) SHA1(65d27066ffec04b755d2f5d3f36f5ec6792e8d6c) )
2666   ROM_LOAD( "k01_2.bin",    0x1800, 0x0800, CRC(dcc2b33b) SHA1(c3a5ac935c519400dfabb28909f7e460769d1837) )
2667
2668   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2669   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
2670ROM_END
2671
2672ROM_START( spacbatt )
2673   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2674   ROM_LOAD( "sb1",    0x0000, 0x0800, CRC(d975af10) SHA1(a2e2a36a75db8fd09441308b08b6ae073c68b8cf) ) /* Same as f07_1a.bin above */
2675   ROM_LOAD( "sb2",    0x0800, 0x0800, CRC(b2ed14c3) SHA1(7668df11f64b8e296eedfee53437777dc53a56d5) ) /* Same as h07_2a.bin above */
2676   ROM_LOAD( "sb3",    0x1000, 0x0800, CRC(945f4160) SHA1(5fbe879f51e14c4c7ae551e5b3089f8e148770a4) ) /* Same as k07_3a.bin above */
2677   ROM_LOAD( "sb4",    0x1800, 0x0800, CRC(8229835c) SHA1(8cfd8f6cab6f80ca69645a184f7e841fc69f47f6) )
2678   ROM_LOAD( "sb5",    0x2000, 0x0800, CRC(f51ef930) SHA1(213e68571a0c7d5ba33a7170d5fa4aea898ea0b9) )
2679   ROM_LOAD( "sb6",    0x2800, 0x0800, CRC(d915a389) SHA1(0e2ff6eec9453856a1276889946b463cfae58eba) ) /* Same as e08p_6a.bin above */
2680   ROM_LOAD( "sb7",    0x3000, 0x0800, CRC(c9245346) SHA1(239bad3fe64eaab2dfc3febd06d1124103a10504) ) /* Same as m08p_7a.bin above */
2681   ROM_LOAD( "sb8",    0x3800, 0x0800, CRC(e59ff1ae) SHA1(fef22885cbd3273882f8c7755dd04c28e843b9ea) )
2682
2683   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
2684   ROM_LOAD( "sb12",   0x0000, 0x0800, CRC(8313c959) SHA1(b09157c6f824d6e94647728cbb329877fcb4e502) ) /* Same as h01_1.bin above */
2685   ROM_LOAD( "sb14",   0x0800, 0x0800, CRC(c26132af) SHA1(7ae125a911dfd47aeca4f129f580762ce4d8d91a) ) /* Same as h01_2.bin above */
2686   ROM_LOAD( "sb11",   0x1000, 0x0800, CRC(c9d4537e) SHA1(65d27066ffec04b755d2f5d3f36f5ec6792e8d6c) ) /* Same as k01_1.bin above */
2687   ROM_LOAD( "sb13",   0x1800, 0x0800, CRC(92454380) SHA1(f0cd67b39c760c2b5ac549b27b0a5f83fbb3a86b) )
2688
2689   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2690   ROM_LOAD( "6l.bpr", 0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) ) /* MMI 6331 bp-prom, compatible with 82s123 */
2691ROM_END
2692
2693ROM_START( spacbat2 )
2694   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2695   ROM_LOAD( "sb1",    0x0000, 0x0800, CRC(d975af10) SHA1(a2e2a36a75db8fd09441308b08b6ae073c68b8cf) ) /* Same as f07_1a.bin above */
2696   ROM_LOAD( "sb2",    0x0800, 0x0800, CRC(b2ed14c3) SHA1(7668df11f64b8e296eedfee53437777dc53a56d5) ) /* Same as h07_2a.bin above */
2697   ROM_LOAD( "sb.3",   0x1000, 0x0800, CRC(c25ce4c1) SHA1(d7a5d435df7868155523d2fb90f331d4b6d9eaa1) )
2698   ROM_LOAD( "sb4",    0x1800, 0x0800, CRC(8229835c) SHA1(8cfd8f6cab6f80ca69645a184f7e841fc69f47f6) )
2699   ROM_LOAD( "sb5",    0x2000, 0x0800, CRC(f51ef930) SHA1(213e68571a0c7d5ba33a7170d5fa4aea898ea0b9) )
2700   ROM_LOAD( "sb6",    0x2800, 0x0800, CRC(d915a389) SHA1(0e2ff6eec9453856a1276889946b463cfae58eba) ) /* Same as e08p_6a.bin above */
2701   ROM_LOAD( "sb7",    0x3000, 0x0800, CRC(c9245346) SHA1(239bad3fe64eaab2dfc3febd06d1124103a10504) ) /* Same as m08p_7a.bin above */
2702   ROM_LOAD( "sb8",    0x3800, 0x0800, CRC(e59ff1ae) SHA1(fef22885cbd3273882f8c7755dd04c28e843b9ea) )
2703
2704   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
2705   ROM_LOAD( "sb12",      0x0000, 0x0800, CRC(8313c959) SHA1(b09157c6f824d6e94647728cbb329877fcb4e502) ) /* Same as h01_1.bin above */
2706   ROM_LOAD( "sb14",      0x0800, 0x0800, CRC(c26132af) SHA1(7ae125a911dfd47aeca4f129f580762ce4d8d91a) ) /* Same as h01_2.bin above */
2707   ROM_LOAD( "sb11",      0x1000, 0x0800, CRC(c9d4537e) SHA1(65d27066ffec04b755d2f5d3f36f5ec6792e8d6c) ) /* Same as k01_1.bin above */
2708   ROM_LOAD( "k01_2.bin", 0x1800, 0x0800, CRC(dcc2b33b) SHA1(c3a5ac935c519400dfabb28909f7e460769d1837) )
2709
2710   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2711   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
2712ROM_END
2713
2714ROM_START( skyraidr )
2715   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2716   ROM_LOAD( "f07_1a.bin",   0x0000, 0x0800, CRC(d975af10) SHA1(a2e2a36a75db8fd09441308b08b6ae073c68b8cf) )
2717   ROM_LOAD( "h07_2a.bin",   0x0800, 0x0800, CRC(b2ed14c3) SHA1(7668df11f64b8e296eedfee53437777dc53a56d5) )
2718   ROM_LOAD( "k07_3a.bin",   0x1000, 0x0800, CRC(945f4160) SHA1(5fbe879f51e14c4c7ae551e5b3089f8e148770a4) )
2719   ROM_LOAD( "sr.04",        0x1800, 0x0800, CRC(9f61d1f8) SHA1(389b0a0d1a577b302907b2ea4c119aa18a6120d9) )
2720   ROM_LOAD( "sr.05",        0x2000, 0x0800, CRC(4352af0a) SHA1(1b31846ea7025aaf3a79141dfa5a089b8d12d982) )
2721   ROM_LOAD( "sr.06",        0x2800, 0x0800, CRC(d915a389) SHA1(0e2ff6eec9453856a1276889946b463cfae58eba) )
2722   ROM_LOAD( "m08p_7a.bin",  0x3000, 0x0800, CRC(c9245346) SHA1(239bad3fe64eaab2dfc3febd06d1124103a10504) )
2723   ROM_LOAD( "n08p_8a.bin",  0x3800, 0x0800, CRC(797d45c7) SHA1(76fb8b45fcce3622c59c04af32cfa001ef7bf71d) )
2724
2725   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
2726   ROM_LOAD( "sr.10",        0x0000, 0x0800, CRC(af069cba) SHA1(12b7d0a57f43613c80afd51c417628090740aabe) )
2727   ROM_LOAD( "h01_2.bin",    0x0800, 0x0800, CRC(c26132af) SHA1(7ae125a911dfd47aeca4f129f580762ce4d8d91a) )
2728   ROM_LOAD( "sr.09",        0x1000, 0x0800, CRC(ff2c20d5) SHA1(48668dc4f008f44f5c15bdcc331cfe133da99cd4) )
2729   ROM_LOAD( "k01_2.bin",    0x1800, 0x0800, CRC(dcc2b33b) SHA1(c3a5ac935c519400dfabb28909f7e460769d1837) )
2730
2731   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2732   ROM_LOAD( "uniwars.clr",  0x0000, 0x0020, CRC(25c79518) SHA1(e8f7e8b3d0cf1ed9d723948548f58abf0e2c6d1f) )
2733ROM_END
2734
2735
2736ROM_START( batman2 )
2737   ROM_REGION( 0x4000, REGION_CPU1, 0 )
2738   ROM_LOAD( "01.bin",         0x0000, 0x0800, CRC(150fbca5) SHA1(a5dc104169eb3225c6200e7e07102f8a9bee6861) )
2739   ROM_LOAD( "02.bin",       0x0800, 0x0800, CRC(b1624fd0) SHA1(ca4678cf7a8b935be2f68d6e342c1f961bf6f1a2) )
2740   ROM_LOAD( "03.bin",       0x1000, 0x0800, CRC(93774188) SHA1(8bdd3290db43459c56b932b582f555d89df30bd1) )
2741   ROM_LOAD( "04.bin",       0x1800, 0x0800, CRC(8a94ec6c) SHA1(dacadab9a05ddee2de188b368f795d74213e020d) )
2742   ROM_LOAD( "05.bin",       0x2000, 0x0800, CRC(a3669461) SHA1(11ea7aa9b55f5790cc2451d80d0eb84388cf47eb) )
2743   ROM_LOAD( "06.bin",       0x2800, 0x0800, CRC(fa1efbfe) SHA1(f7222dd21e0810d0c8c32919ebb6e0e7bbb4c68e) )
2744   ROM_LOAD( "07.bin",       0x3000, 0x0800, CRC(9b77debd) SHA1(1f5521bc0f701d86e61219ad3b9516aaa71a68da) )
2745   ROM_LOAD( "08.bin",       0x3800, 0x0800, CRC(6466177e) SHA1(fc359eadee34586576c557ff7c1dd2c8d49bdf3f) )
2746
2747   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
2748   ROM_LOAD( "09.bin",       0x0000, 0x0800, CRC(1a657b1f) SHA1(42149dafdde7d9104f0bddda2223bfc211d0154a) )
2749   ROM_LOAD( "11.bin",       0x0800, 0x0800, CRC(7a2b48e5) SHA1(f559799c685dd2cb9de06a356bee95b7d6ffadfc) )
2750   ROM_LOAD( "10.bin",       0x1000, 0x0800, CRC(9b570016) SHA1(44fd2b1caeecdc5200d63c35636f0a605943d30c) )
2751   ROM_LOAD( "12.bin",       0x1800, 0x0800, CRC(73956244) SHA1(e464b587b5ed636816cc9688593f5b6005cb5216) )
2752
2753   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2754   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
2755ROM_END
2756
2757
2758ROM_START( streakng )
2759   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2760   ROM_LOAD( "sk1",          0x0000, 0x1000, CRC(c8866ccb) SHA1(1fc8bc643ecbfa86a50448d79b299f5a3dd586c5) )
2761   ROM_LOAD( "sk2",          0x1000, 0x1000, CRC(7caea29b) SHA1(5b3946ee914b1637db9046abf92d66ceaeb4fc5f) )
2762   ROM_LOAD( "sk3",          0x2000, 0x1000, CRC(7b4bfa76) SHA1(9223bec0c1cc39bc84670869b2a4fab0d0167c6e) )
2763   ROM_LOAD( "sk4",          0x3000, 0x1000, CRC(056fc921) SHA1(de8525571e5a82ddf74dd57b1a6c5bc9f2d2c0fe) )
2764
2765   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2766   ROM_LOAD( "sk5",          0x0000, 0x1000, CRC(d27f1e0c) SHA1(c3b4ae55a93516b034a16c9f943b360b24c933d6) )
2767
2768   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
2769   ROM_LOAD( "sk6",          0x0000, 0x1000, CRC(a7089588) SHA1(e76242b043b1d8f060f669da3ddeee3d10122cdb) )
2770
2771   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2772   ROM_LOAD( "sk.bpr",       0x0000, 0x0020, CRC(bce79607) SHA1(49d60fde149240bcd025f721b0fbbbdbc549a42f) )
2773ROM_END
2774
2775ROM_START( pacmanbl )
2776   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2777   ROM_LOAD( "blpac1b",      0x0000, 0x0800, CRC(6718df42) SHA1(ee15c3f583d381fba4878f824f83d04479a0cee5) )
2778   ROM_LOAD( "blpac2b",      0x0800, 0x0800, CRC(33be3648) SHA1(50175889cf37fe8a81c931e009b55d10f8d0444a) )
2779   ROM_LOAD( "blpac3b",      0x1000, 0x0800, CRC(f98c0ceb) SHA1(4faf8b2fb3f109d1196a9ea256328485074a31b9) )
2780   ROM_LOAD( "blpac4b",      0x1800, 0x0800, CRC(a9cd0082) SHA1(f44ff1ad15d5ee3096f8f44f9c605f32ae2737d9) )
2781   ROM_LOAD( "blpac5b",      0x2000, 0x0800, CRC(6d475afc) SHA1(4fe6bde352c7dd9572fefaae4b59640b4f4eb8ba) )
2782   ROM_LOAD( "blpac6b",      0x2800, 0x0800, CRC(cbe863d3) SHA1(97a2ffa6ab33e6061c664dcd1ee57c86a456782f) )
2783   ROM_LOAD( "blpac7b",      0x3000, 0x0800, CRC(7daef758) SHA1(4dc8ec0ea8fc04d5bffc1c1335407729309c17f0) )
2784
2785   /* note from f205v: on the PCB I have, 10b and 11b have been joined into one single 2732 EPROM labeled "pmc31"
2786    The same goes for 9b and 12b, joined into one single 2732 EPROM labeled "pmc42" */
2787   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2788   ROM_LOAD( "blpac12b",     0x0000, 0x0800, CRC(b2ed320b) SHA1(680a6fdcb65cc2d88d10bc85e0b2628f43375c5c) )
2789   ROM_LOAD( "blpac11b",     0x0800, 0x0800, CRC(ab88b2c4) SHA1(d0c829ea8021eae81a2b82d36c35ad8258b115e0) )
2790
2791   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
2792   ROM_LOAD( "blpac10b",     0x0000, 0x0800, CRC(44a45b72) SHA1(8abd0684a01d6c23ef5cf5f0765458f982316acf) )
2793   ROM_LOAD( "blpac9b",      0x0800, 0x0800, CRC(fa84659f) SHA1(20c212723f9062f052539190dfe3fc41577543eb) )
2794
2795   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2796   ROM_LOAD( "blpaccp",      0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) ) /* same as pisces */
2797ROM_END
2798
2799
2800ROM_START( devilfsg )
2801   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2802   ROM_LOAD( "dfish1.7f",    0x2000, 0x0800, CRC(2ab19698) SHA1(8450981d3cf3fa8abf2fb5487aa98b03a4cf03a1) )
2803   ROM_CONTINUE(             0x0000, 0x0800 )
2804   ROM_LOAD( "dfish2.7h",    0x2800, 0x0800, CRC(4e77f097) SHA1(aeaa5ff210ccbbe77114edf5dee992d2720636ae) )
2805   ROM_CONTINUE(             0x0800, 0x0800 )
2806   ROM_LOAD( "dfish3.7k",    0x3000, 0x0800, CRC(3f16a4c6) SHA1(cc30b27070a12c250cdc2f7289bae7c7a4c05c2c) )
2807   ROM_CONTINUE(             0x1000, 0x0800 )
2808   ROM_LOAD( "dfish4.7m",    0x3800, 0x0800, CRC(11fc7e59) SHA1(2c0182a75bfca085e67483b421f40b3bc9b8ef24) )
2809   ROM_CONTINUE(             0x1800, 0x0800 )
2810
2811   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2812   ROM_LOAD( "dfish5.1h",    0x0000, 0x0800, CRC(ace6e31f) SHA1(23df890fdf8ef275af79e10c8e43ff3a617b28ac) )
2813   ROM_CONTINUE(             0x0000, 0x0800 )
2814   ROM_LOAD( "dfish6.1k",    0x0800, 0x0800, CRC(d7a6c4c4) SHA1(ec5f9182657edb11884ab93f868f1bb3569461ae) )
2815   ROM_CONTINUE(             0x0800, 0x0800 )
2816
2817   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
2818   ROM_LOAD( "dfish5.1h",    0x0000, 0x0800, CRC(ace6e31f) SHA1(23df890fdf8ef275af79e10c8e43ff3a617b28ac) )
2819   ROM_IGNORE(                       0x0800 )
2820   ROM_LOAD( "dfish6.1k",    0x0800, 0x0800, CRC(d7a6c4c4) SHA1(ec5f9182657edb11884ab93f868f1bb3569461ae) )
2821   ROM_IGNORE(                       0x0800 )
2822
2823   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2824   ROM_LOAD( "82s123.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
2825ROM_END
2826
2827
2828ROM_START( zigzag )
2829   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2830   ROM_LOAD( "zz_d1.bin",    0x0000, 0x1000, CRC(8cc08d81) SHA1(be671192ef06dc3ed6963dc39e6bdce3275300e9) )
2831   ROM_LOAD( "zz_d2.bin",    0x1000, 0x1000, CRC(326d8d45) SHA1(563b9fc64c34e36cfadffb107ce30d3a04d62d9c) )
2832   ROM_LOAD( "zz_d4.bin",    0x2000, 0x1000, CRC(a94ed92a) SHA1(d56f32fc2b3f0f7affe658b7726682c60d09bc16) )
2833   ROM_LOAD( "zz_d3.bin",    0x3000, 0x1000, CRC(ce5e7a00) SHA1(93c47d22698a016cb0f0b654ade9ccab0cd1c88b) )
2834
2835   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2836   ROM_LOAD( "zz_6_h1.bin",  0x0000, 0x0800, CRC(780c162a) SHA1(b0cac68258281917bcada52ce26e0ce38721d633) )
2837   ROM_IGNORE(                       0x0800 )
2838   ROM_LOAD( "zz_5.bin",     0x0800, 0x0800, CRC(f3cdfec5) SHA1(798d631c72d8e6b2e372b4b3ab0c10d8365a1359) )
2839   ROM_IGNORE(                       0x0800 )
2840
2841   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
2842   ROM_LOAD( "zz_6_h1.bin",  0x0000, 0x0800, CRC(780c162a) SHA1(b0cac68258281917bcada52ce26e0ce38721d633) )
2843   ROM_CONTINUE(             0x0000, 0x0800 )
2844   ROM_LOAD( "zz_5.bin",     0x0800, 0x0800, CRC(f3cdfec5) SHA1(798d631c72d8e6b2e372b4b3ab0c10d8365a1359) )
2845   ROM_CONTINUE(             0x0800, 0x0800 )
2846
2847   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2848   ROM_LOAD( "zzbp_e9.bin",  0x0000, 0x0020, CRC(aa486dd0) SHA1(b845b52715bf6361ceee8c1ac541733963bd47af) )
2849ROM_END
2850
2851ROM_START( zigzag2 )
2852   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2853   ROM_LOAD( "z1",           0x0000, 0x1000, CRC(4c28349a) SHA1(646134ce506deaee88cc2ec5a973f8fedaddb66b) )
2854   ROM_LOAD( "zz_d2.bin",    0x1000, 0x1000, CRC(326d8d45) SHA1(563b9fc64c34e36cfadffb107ce30d3a04d62d9c) )
2855   ROM_LOAD( "zz_d4.bin",    0x2000, 0x1000, CRC(a94ed92a) SHA1(d56f32fc2b3f0f7affe658b7726682c60d09bc16) )
2856   ROM_LOAD( "zz_d3.bin",    0x3000, 0x1000, CRC(ce5e7a00) SHA1(93c47d22698a016cb0f0b654ade9ccab0cd1c88b) )
2857
2858   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
2859   ROM_LOAD( "zz_6_h1.bin",  0x0000, 0x0800, CRC(780c162a) SHA1(b0cac68258281917bcada52ce26e0ce38721d633) )
2860   ROM_IGNORE(                       0x0800 )
2861   ROM_LOAD( "zz_5.bin",     0x0800, 0x0800, CRC(f3cdfec5) SHA1(798d631c72d8e6b2e372b4b3ab0c10d8365a1359) )
2862   ROM_IGNORE(                       0x0800 )
2863
2864   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
2865   ROM_LOAD( "zz_6_h1.bin",  0x0000, 0x0800, CRC(780c162a) SHA1(b0cac68258281917bcada52ce26e0ce38721d633) )
2866   ROM_CONTINUE(             0x0000, 0x0800 )
2867   ROM_LOAD( "zz_5.bin",     0x0800, 0x0800, CRC(f3cdfec5) SHA1(798d631c72d8e6b2e372b4b3ab0c10d8365a1359) )
2868   ROM_CONTINUE(             0x0800, 0x0800 )
2869
2870   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2871   ROM_LOAD( "zzbp_e9.bin",  0x0000, 0x0020, CRC(aa486dd0) SHA1(b845b52715bf6361ceee8c1ac541733963bd47af) )
2872ROM_END
2873
2874
2875ROM_START( gmgalax )
2876   ROM_REGION( 0x18000, REGION_CPU1, 0 )   /* 64k for code + 32k for banked code */
2877   ROM_LOAD( "pcb1_pm1.bin", 0x10000, 0x1000, CRC(19338c70) SHA1(cc2665b7d534d324627d12025ee099ff415d4214) )
2878   ROM_LOAD( "pcb1_pm2.bin", 0x11000, 0x1000, CRC(18db074d) SHA1(a70ed18f632e947493e648e6fc057dfb7a2a3322) )
2879   ROM_LOAD( "pcb1_pm3.bin", 0x12000, 0x1000, CRC(abb98b1d) SHA1(bb0109d353359bb192a3e6856a857c2f842838cb) )
2880   ROM_LOAD( "pcb1_pm4.bin", 0x13000, 0x1000, CRC(2403c78e) SHA1(52d8c8a4efcf47871485080ab217098a019e6579) )
2881   ROM_LOAD( "pcb1_gx1.bin", 0x14000, 0x1000, CRC(2faa9f53) SHA1(1e7010d407601c5da1adc68bc9f4742c79d57286) )
2882   ROM_LOAD( "pcb1_gx2.bin", 0x15000, 0x1000, CRC(121c5f16) SHA1(cb1806fa984870133fd883969838dca85f992515) )
2883   ROM_LOAD( "pcb1_gx3.bin", 0x16000, 0x1000, CRC(02d81a21) SHA1(39209cfb7cf142a65e157544d93803ea542a8efb) )
2884
2885   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
2886   ROM_LOAD( "pcb2gfx1.bin", 0x0000, 0x0800, CRC(7021bbc0) SHA1(52d2983d74e722fccb31eb02ca56255850c4f41c) )
2887   ROM_CONTINUE(             0x1000, 0x0800 )
2888   ROM_LOAD( "pcb2gfx3.bin", 0x0800, 0x0800, CRC(089c922b) SHA1(f1b81999f63677d4cd58cd547353170e348a1423) )
2889   ROM_CONTINUE(             0x1800, 0x0800 )
2890   ROM_LOAD( "pcb2gfx2.bin", 0x2000, 0x0800, CRC(51bf58ee) SHA1(3546ff03c76a6422b0515bd5c695674bfb032089) )
2891   ROM_CONTINUE(             0x3000, 0x0800 )
2892   ROM_LOAD( "pcb2gfx4.bin", 0x2800, 0x0800, CRC(908fd0dc) SHA1(ac278bd82730e92ff312793244340748b93fa9bb) )
2893   ROM_CONTINUE(             0x3800, 0x0800 )
2894
2895   ROM_REGION( 0x0040, REGION_PROMS, 0 )
2896   ROM_LOAD( "gmgalax2.clr", 0x0000, 0x0020, CRC(499f4440) SHA1(66d6463a145087041934bdab8bfa6c3db6375317) )
2897   ROM_LOAD( "l06_prom.bin", 0x0020, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
2898ROM_END
2899
2900
2901
2902/*************************************
2903 *
2904 *  ROM definitions
2905 *  Moon Cresta-derived games
2906 *
2907 *************************************/
2908
2909ROM_START( mooncrst )
2910   ROM_REGION( 0x8000, REGION_CPU1, 0 )
2911   ROM_LOAD( "mc1",          0x0000, 0x0800, CRC(7d954a7a) SHA1(a93ee403cfd7887538ad12d33f6dd6c71bea2a32) )
2912   ROM_LOAD( "mc2",          0x0800, 0x0800, CRC(44bb7cfa) SHA1(349c2e23a9fce73f95bb8168d369082fa129fe3d) )
2913   ROM_LOAD( "mc3",          0x1000, 0x0800, CRC(9c412104) SHA1(1b40054ebb1ace965a8522119bb23f09797bc5f6) )
2914   ROM_LOAD( "mc4",          0x1800, 0x0800, CRC(7e9b1ab5) SHA1(435f603c0c3e788a509dd144a7916a34e791ae44) )
2915   ROM_LOAD( "mc5.7r",       0x2000, 0x0800, CRC(16c759af) SHA1(3b48050411f65f9d3fb41ff22901e22d82bf1cf6) )
2916   ROM_LOAD( "mc6.8d",       0x2800, 0x0800, CRC(69bcafdb) SHA1(939c8c6ed1cd4660a3d99b8f17ed99cbd7e1352a) )
2917   ROM_LOAD( "mc7.8e",       0x3000, 0x0800, CRC(b50dbc46) SHA1(4fa084fd1ba5f78e7703e684c57af15ca7a844e4) )
2918   ROM_LOAD( "mc8",          0x3800, 0x0800, CRC(18ca312b) SHA1(39219059003b949e38305553fea2d33071062c64) )
2919
2920   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
2921   ROM_LOAD( "mcs_b",        0x0000, 0x0800, CRC(fb0f1f81) SHA1(38a6679a8b69bc1870a0e67e692131c42f9535c8) )
2922   ROM_LOAD( "mcs_d",        0x0800, 0x0800, CRC(13932a15) SHA1(b8885c555c6ad7021be55c6925a0a0872c1b6abd) )
2923   ROM_LOAD( "mcs_a",        0x1000, 0x0800, CRC(631ebb5a) SHA1(5bc9493afa76c55858b8c8849524cbc77dc838fc) )
2924   ROM_LOAD( "mcs_c",        0x1800, 0x0800, CRC(24cfd145) SHA1(08c6599db170dd6ee364c44f70a0f5c0f881b6ef) )
2925
2926   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2927   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
2928ROM_END
2929
2930ROM_START( mooncrsu )
2931   ROM_REGION( 0x8000, REGION_CPU1, 0 )
2932   ROM_LOAD( "smc1f",        0x0000, 0x0800, CRC(389ca0d6) SHA1(51cf6d190a0ebf23b70c2bcf1ccaa4705e29cd09) )
2933   ROM_LOAD( "smc2f",        0x0800, 0x0800, CRC(410ab430) SHA1(d89abff6ac4afbf69377a1d63043d629a634aab7) )
2934   ROM_LOAD( "smc3f",        0x1000, 0x0800, CRC(a6b4144b) SHA1(2b27ad54d716286c0dc9476d47df182ae01bcfd7) )
2935   ROM_LOAD( "smc4f",        0x1800, 0x0800, CRC(4cc046fe) SHA1(465eaacd50967d768babadd09ab9cad35380f6bf) )
2936   ROM_LOAD( "e5",            0x2000, 0x0800, CRC(06d378a6) SHA1(99dbe9fc7f95f8fdce86eb5c32bd1ca1bea0ca3c) )
2937   ROM_LOAD( "bepr199",      0x2800, 0x0800, CRC(6e84a927) SHA1(82e8e825d157c3c947a3a222bca059a735169c7d) )
2938   ROM_LOAD( "e7",           0x3000, 0x0800, CRC(b45af1e8) SHA1(d7020774707234acdaef5c655f667d5ee9e54a13) )
2939   ROM_LOAD( "smc8f",        0x3800, 0x0800, CRC(f42164c5) SHA1(e0d1680f193889568edf005786e2767d4fb086f4) )
2940
2941   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
2942   ROM_LOAD( "mcs_b",        0x0000, 0x0800, CRC(fb0f1f81) SHA1(38a6679a8b69bc1870a0e67e692131c42f9535c8) )
2943   ROM_LOAD( "mcs_d",        0x0800, 0x0800, CRC(13932a15) SHA1(b8885c555c6ad7021be55c6925a0a0872c1b6abd) )
2944   ROM_LOAD( "mcs_a",        0x1000, 0x0800, CRC(631ebb5a) SHA1(5bc9493afa76c55858b8c8849524cbc77dc838fc) )
2945   ROM_LOAD( "mcs_c",        0x1800, 0x0800, CRC(24cfd145) SHA1(08c6599db170dd6ee364c44f70a0f5c0f881b6ef) )
2946
2947   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2948   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
2949ROM_END
2950
2951ROM_START( mooncrsa )
2952   ROM_REGION( 0x8000, REGION_CPU1, 0 )
2953   ROM_LOAD( "mc1.7d",       0x0000, 0x0800, CRC(92a86aac) SHA1(f5818ac97d8b779e1fb29bf903f74185d24afb0d) )
2954   ROM_LOAD( "mc2.7e",       0x0800, 0x0800, CRC(438c2b4b) SHA1(11f56b489b5489999952e91919c5e1f622c59c36) )
2955   ROM_LOAD( "mc3.7j",       0x1000, 0x0800, CRC(67e3d21d) SHA1(59579d19931ef11b30fdc3912d838200bef92c81) )
2956   ROM_LOAD( "mc4.7p",       0x1800, 0x0800, CRC(f4db39f6) SHA1(454931f80b35608793590b3843c69ba64cbf6772) )
2957   ROM_LOAD( "mc5.7r",       0x2000, 0x0800, CRC(16c759af) SHA1(3b48050411f65f9d3fb41ff22901e22d82bf1cf6) )
2958   ROM_LOAD( "mc6.8d",       0x2800, 0x0800, CRC(69bcafdb) SHA1(939c8c6ed1cd4660a3d99b8f17ed99cbd7e1352a) )
2959   ROM_LOAD( "mc7.8e",       0x3000, 0x0800, CRC(b50dbc46) SHA1(4fa084fd1ba5f78e7703e684c57af15ca7a844e4) )
2960   ROM_LOAD( "mc8.8h",       0x3800, 0x0800, CRC(7e2b1928) SHA1(4f0de8e80c2e2ec6df8612755caf93671ea965b0) )
2961
2962   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
2963   ROM_LOAD( "mcs_b",        0x0000, 0x0800, CRC(fb0f1f81) SHA1(38a6679a8b69bc1870a0e67e692131c42f9535c8) )
2964   ROM_LOAD( "mcs_d",        0x0800, 0x0800, CRC(13932a15) SHA1(b8885c555c6ad7021be55c6925a0a0872c1b6abd) )
2965   ROM_LOAD( "mcs_a",        0x1000, 0x0800, CRC(631ebb5a) SHA1(5bc9493afa76c55858b8c8849524cbc77dc838fc) )
2966   ROM_LOAD( "mcs_c",        0x1800, 0x0800, CRC(24cfd145) SHA1(08c6599db170dd6ee364c44f70a0f5c0f881b6ef) )
2967
2968   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2969   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
2970ROM_END
2971
2972ROM_START( mooncrsg )
2973   ROM_REGION( 0x8000, REGION_CPU1, 0 )
2974   ROM_LOAD( "epr194",       0x0000, 0x0800, CRC(0e5582b1) SHA1(946ad4aeb10c0b7b3f93fd24925cc9bcb49e443c) )
2975   ROM_LOAD( "epr195",       0x0800, 0x0800, CRC(12cb201b) SHA1(ebb01ec646b9e015cbcb93f70dfdaf448afefc12) )
2976   ROM_LOAD( "epr196",       0x1000, 0x0800, CRC(18255614) SHA1(b373e22d47c0f7facba13148ca9c462ec9a0d732) )
2977   ROM_LOAD( "epr197",       0x1800, 0x0800, CRC(05ac1466) SHA1(cbf93a8ce0925fa1c073c74f1274b190d9faefaf) )
2978   ROM_LOAD( "epr198",       0x2000, 0x0800, CRC(c28a2e8f) SHA1(9ff6bab1e1185597ba55cb0d6086091a1fce01a6) )
2979   ROM_LOAD( "epr199",       0x2800, 0x0800, CRC(5a4571de) SHA1(2a4170dee105922fc69c99b79f6f328098e81918) )
2980   ROM_LOAD( "epr200",       0x3000, 0x0800, CRC(b7c85bf1) SHA1(cc9f593658ea39c849d80c83ee0c2170cc29879e) )
2981   ROM_LOAD( "epr201",       0x3800, 0x0800, CRC(2caba07f) SHA1(8fec4904e12b4cfb6068784007278be986a3eede) )
2982
2983   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
2984   ROM_LOAD( "epr203",       0x0000, 0x0800, CRC(be26b561) SHA1(cc27de6888eaf4ee18c0d37d9bcb528dd282b838) )
2985   ROM_LOAD( "mcs_d",        0x0800, 0x0800, CRC(13932a15) SHA1(b8885c555c6ad7021be55c6925a0a0872c1b6abd) )
2986   ROM_LOAD( "epr202",       0x1000, 0x0800, CRC(26c7e800) SHA1(034192e5e2cbac4b66a9828f5ec2311c2c368781) )
2987   ROM_LOAD( "mcs_c",        0x1800, 0x0800, CRC(24cfd145) SHA1(08c6599db170dd6ee364c44f70a0f5c0f881b6ef) )
2988
2989   ROM_REGION( 0x0020, REGION_PROMS, 0 )
2990   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
2991ROM_END
2992
2993ROM_START( mooncrsb )
2994   ROM_REGION( 0x8000, REGION_CPU1, 0 )
2995   ROM_LOAD( "bepr194",      0x0000, 0x0800, CRC(6a23ec6d) SHA1(df2214bdde26a71db59ffd39a745052076563f65) )
2996   ROM_LOAD( "bepr195",      0x0800, 0x0800, CRC(ee262ff2) SHA1(4e2202023ad53109ea58304071735d2425a617f3) )
2997   ROM_LOAD( "f03.bin",      0x1000, 0x0800, CRC(29a2b0ab) SHA1(e9fc7161d0566e36307c45b7132e2262c0af4845) )
2998   ROM_LOAD( "f04.bin",      0x1800, 0x0800, CRC(4c6a5a6d) SHA1(366516f63c9b5239e703e4dfb672659049ddbf44) )
2999   ROM_LOAD( "e5",           0x2000, 0x0800, CRC(06d378a6) SHA1(99dbe9fc7f95f8fdce86eb5c32bd1ca1bea0ca3c) )
3000   ROM_LOAD( "bepr199",      0x2800, 0x0800, CRC(6e84a927) SHA1(82e8e825d157c3c947a3a222bca059a735169c7d) )
3001   ROM_LOAD( "e7",           0x3000, 0x0800, CRC(b45af1e8) SHA1(d7020774707234acdaef5c655f667d5ee9e54a13) )
3002   ROM_LOAD( "bepr201",      0x3800, 0x0800, CRC(66da55d5) SHA1(39e2f6107e77ee97860147f64b9673cd9a2ae612) )
3003
3004   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3005   ROM_LOAD( "epr203",       0x0000, 0x0800, CRC(be26b561) SHA1(cc27de6888eaf4ee18c0d37d9bcb528dd282b838) )
3006   ROM_LOAD( "mcs_d",        0x0800, 0x0800, CRC(13932a15) SHA1(b8885c555c6ad7021be55c6925a0a0872c1b6abd) )
3007   ROM_LOAD( "epr202",       0x1000, 0x0800, CRC(26c7e800) SHA1(034192e5e2cbac4b66a9828f5ec2311c2c368781) )
3008   ROM_LOAD( "mcs_c",        0x1800, 0x0800, CRC(24cfd145) SHA1(08c6599db170dd6ee364c44f70a0f5c0f881b6ef) )
3009
3010   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3011   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
3012ROM_END
3013
3014ROM_START( mooncrs2 )
3015   ROM_REGION( 0x8000, REGION_CPU1, 0 )
3016   ROM_LOAD( "f8.bin",       0x0000, 0x0800, CRC(d36003e5) SHA1(562b27f1bccce6ae29de18b93fa51c508446cda9) )
3017   ROM_LOAD( "bepr195",      0x0800, 0x0800, CRC(ee262ff2) SHA1(4e2202023ad53109ea58304071735d2425a617f3) )
3018   ROM_LOAD( "f03.bin",      0x1000, 0x0800, CRC(29a2b0ab) SHA1(e9fc7161d0566e36307c45b7132e2262c0af4845) )
3019   ROM_LOAD( "f04.bin",      0x1800, 0x0800, CRC(4c6a5a6d) SHA1(366516f63c9b5239e703e4dfb672659049ddbf44) )
3020   ROM_LOAD( "e5",           0x2000, 0x0800, CRC(06d378a6) SHA1(99dbe9fc7f95f8fdce86eb5c32bd1ca1bea0ca3c) )
3021   ROM_LOAD( "bepr199",      0x2800, 0x0800, CRC(6e84a927) SHA1(82e8e825d157c3c947a3a222bca059a735169c7d) )
3022   ROM_LOAD( "e7",           0x3000, 0x0800, CRC(b45af1e8) SHA1(d7020774707234acdaef5c655f667d5ee9e54a13) )
3023   ROM_LOAD( "m7.bin",       0x3800, 0x0800, CRC(957ee078) SHA1(472038dedfc01c995be889ea93d4df8bef2b874c) )
3024
3025   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3026   ROM_LOAD( "1h_1_10.bin",  0x0000, 0x0800, CRC(528da705) SHA1(d726ee18b79774c982f88afb2a508eb5d5783193) )
3027   ROM_LOAD( "12.chr",       0x0800, 0x0200, CRC(5a4b17ea) SHA1(8a879dc34fdecc8a121c4a87abb981212fb05945) )
3028   ROM_CONTINUE(             0x0c00, 0x0200 )   /* this version of the gfx ROMs has two */
3029   ROM_CONTINUE(             0x0a00, 0x0200 )   /* groups of 16 sprites swapped */
3030   ROM_CONTINUE(             0x0e00, 0x0200 )
3031   ROM_LOAD( "1k_1_11.bin",  0x1000, 0x0800, CRC(4e79ff6b) SHA1(f72386a3766a7fcc7b4b8cedfa58b8d57f911f6f) )
3032   ROM_LOAD( "11.chr",       0x1800, 0x0200, CRC(e0edccbd) SHA1(0839a4c9b6e863d12253ae8e1732e80e08702228) )
3033   ROM_CONTINUE(             0x1c00, 0x0200 )
3034   ROM_CONTINUE(             0x1a00, 0x0200 )
3035   ROM_CONTINUE(             0x1e00, 0x0200 )
3036
3037   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3038   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
3039ROM_END
3040
3041ROM_START( mooncrs3 ) /* Bootleg by Jeutel, very simular to Moon Cresta (bootleg set 2) */
3042   ROM_REGION( 0x8000, REGION_CPU1, 0 )
3043   ROM_LOAD( "b1.7f",  0x0000, 0x0800, CRC(0b28cd8a) SHA1(a1aa0ec63e1dddf4263aa39f6a5fda93108b6e98) )
3044   ROM_CONTINUE(       0x2000, 0x0800 )
3045   ROM_LOAD( "b2.7h",  0x0800, 0x0800, CRC(74a6f0ca) SHA1(cc8e8193bb6bd62f6cb9ea924e4da5ddc44c4685) )
3046   ROM_CONTINUE(       0x2800, 0x0800 )
3047   ROM_LOAD( "b3.7j",  0x1000, 0x0800, CRC(eeb34cc9) SHA1(c5e7d5e1989211be949972e4281403b7b4866922) )
3048   ROM_CONTINUE(       0x3000, 0x0800 )
3049   ROM_LOAD( "b4.7k",  0x1800, 0x0800, CRC(714330e5) SHA1(c681752732c73a6c9bcc9acdcd5c978c455acba0) )
3050   ROM_CONTINUE(       0x3800, 0x0800 )
3051
3052   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3053   ROM_LOAD( "o.1h",  0x0000, 0x0800, CRC(528da705) SHA1(d726ee18b79774c982f88afb2a508eb5d5783193) )
3054   ROM_LOAD( "q.1h",  0x0800, 0x0200, CRC(5a4b17ea) SHA1(8a879dc34fdecc8a121c4a87abb981212fb05945) )
3055   ROM_CONTINUE(      0x0c00, 0x0200 )   /* this version of the gfx ROMs has two */
3056   ROM_CONTINUE(      0x0a00, 0x0200 )   /* groups of 16 sprites swapped */
3057   ROM_CONTINUE(      0x0e00, 0x0200 )
3058   ROM_LOAD( "p.1k",  0x1000, 0x0800, CRC(4e79ff6b) SHA1(f72386a3766a7fcc7b4b8cedfa58b8d57f911f6f) )
3059   ROM_LOAD( "r.1k",  0x1800, 0x0200, CRC(e0edccbd) SHA1(0839a4c9b6e863d12253ae8e1732e80e08702228) )
3060   ROM_CONTINUE(      0x1c00, 0x0200 )
3061   ROM_CONTINUE(      0x1a00, 0x0200 )
3062   ROM_CONTINUE(      0x1e00, 0x0200 )
3063
3064   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3065   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
3066ROM_END
3067
3068ROM_START( fantazia )
3069   ROM_REGION( 0x8000, REGION_CPU1, 0 )
3070   ROM_LOAD( "f01.bin",      0x0000, 0x0800, CRC(d3e23863) SHA1(f0a6f7491fdf8aae214f40078b29b7aecdcf2f1e) )
3071   ROM_LOAD( "f02.bin",      0x0800, 0x0800, CRC(63fa4149) SHA1(603ee6d4d2952cc08b3f6e98b1a2053671875e44) )
3072   ROM_LOAD( "f03.bin",      0x1000, 0x0800, CRC(29a2b0ab) SHA1(e9fc7161d0566e36307c45b7132e2262c0af4845) )
3073   ROM_LOAD( "f04.bin",      0x1800, 0x0800, CRC(4c6a5a6d) SHA1(366516f63c9b5239e703e4dfb672659049ddbf44) )
3074   ROM_LOAD( "f09.bin",      0x2000, 0x0800, CRC(75fd5ca1) SHA1(45f2dd33f0e437cb95d9373f86490e5432338737) )
3075   ROM_LOAD( "f10.bin",      0x2800, 0x0800, CRC(e4da2dd4) SHA1(7a53efd5b583f656c87b7d7a5ba7c239ced7d87b) )
3076   ROM_LOAD( "f11.bin",      0x3000, 0x0800, CRC(42869646) SHA1(a3640b2ace31ce99c056bc14d1d96f3404698d6a) )
3077   ROM_LOAD( "f12.bin",      0x3800, 0x0800, CRC(a48d7fb0) SHA1(6206036a9d85e87fb7f8a88c17bfe090fc70caf4) )
3078
3079   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3080   ROM_LOAD( "1h_1_10.bin",  0x0000, 0x0800, CRC(528da705) SHA1(d726ee18b79774c982f88afb2a508eb5d5783193) )
3081   ROM_LOAD( "mcs_d",        0x0800, 0x0800, CRC(13932a15) SHA1(b8885c555c6ad7021be55c6925a0a0872c1b6abd) )
3082   ROM_LOAD( "1k_1_11.bin",  0x1000, 0x0800, CRC(4e79ff6b) SHA1(f72386a3766a7fcc7b4b8cedfa58b8d57f911f6f) )
3083   ROM_LOAD( "mcs_c",        0x1800, 0x0800, CRC(24cfd145) SHA1(08c6599db170dd6ee364c44f70a0f5c0f881b6ef) )
3084
3085   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3086   ROM_LOAD( "fantazia.clr", 0x0000, 0x0020, CRC(a84ff0af) SHA1(c300dc937c608d2d1c113ca7a53c649472c72379) )
3087ROM_END
3088
3089ROM_START( eagle )
3090   ROM_REGION( 0x8000, REGION_CPU1, 0 )
3091   ROM_LOAD( "e1",           0x0000, 0x0800, CRC(224c9526) SHA1(4c014d60d4ee80de7f60b4609269461688c181d0) )
3092   ROM_LOAD( "e2",           0x0800, 0x0800, CRC(cc538ebd) SHA1(4ef3c7363e2dcd9ed99779039ccc50a9f2084dbd) )
3093   ROM_LOAD( "f03.bin",      0x1000, 0x0800, CRC(29a2b0ab) SHA1(e9fc7161d0566e36307c45b7132e2262c0af4845) )
3094   ROM_LOAD( "f04.bin",      0x1800, 0x0800, CRC(4c6a5a6d) SHA1(366516f63c9b5239e703e4dfb672659049ddbf44) )
3095   ROM_LOAD( "e5",           0x2000, 0x0800, CRC(06d378a6) SHA1(99dbe9fc7f95f8fdce86eb5c32bd1ca1bea0ca3c) )
3096   ROM_LOAD( "e6",           0x2800, 0x0800, CRC(0dea20d5) SHA1(405b51d4e3b1065f78afd2297e075e977ae19196) )
3097   ROM_LOAD( "e7",           0x3000, 0x0800, CRC(b45af1e8) SHA1(d7020774707234acdaef5c655f667d5ee9e54a13) )
3098   ROM_LOAD( "e8",           0x3800, 0x0800, CRC(c437a876) SHA1(845941b873970ac62ba9bb6353bee53d0fcfa292) )
3099
3100   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3101   ROM_LOAD( "e10",          0x0000, 0x0800, CRC(40ce58bf) SHA1(67ea99e1afe4fff3e17252b22d11d3c96a416041) )
3102   ROM_LOAD( "e12",          0x0800, 0x0200, CRC(628fdeed) SHA1(a798530c65e639fbf00ed3a4e8c428935bf5f38e) )
3103   ROM_CONTINUE(             0x0c00, 0x0200 )   /* this version of the gfx ROMs has two */
3104   ROM_CONTINUE(             0x0a00, 0x0200 )   /* groups of 16 sprites swapped */
3105   ROM_CONTINUE(             0x0e00, 0x0200 )
3106   ROM_LOAD( "e9",           0x1000, 0x0800, CRC(ba664099) SHA1(9509123bed02a9d47f2c056e1562b80206da5579) )
3107   ROM_LOAD( "e11",          0x1800, 0x0200, CRC(ee4ec5fd) SHA1(bf08b3f111f780dc8c81275e4e6247388183a8da) )
3108   ROM_CONTINUE(             0x1c00, 0x0200 )
3109   ROM_CONTINUE(             0x1a00, 0x0200 )
3110   ROM_CONTINUE(             0x1e00, 0x0200 )
3111
3112   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3113   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
3114ROM_END
3115
3116ROM_START( eagle2 )
3117   ROM_REGION( 0x8000, REGION_CPU1, 0 )
3118   ROM_LOAD( "e1.7f",        0x0000, 0x0800, CRC(45aab7a3) SHA1(52ae0463f363dc0964b976faa2c0c428d85a4f12) )
3119   ROM_LOAD( "e2",           0x0800, 0x0800, CRC(cc538ebd) SHA1(4ef3c7363e2dcd9ed99779039ccc50a9f2084dbd) )
3120   ROM_LOAD( "f03.bin",      0x1000, 0x0800, CRC(29a2b0ab) SHA1(e9fc7161d0566e36307c45b7132e2262c0af4845) )
3121   ROM_LOAD( "f04.bin",      0x1800, 0x0800, CRC(4c6a5a6d) SHA1(366516f63c9b5239e703e4dfb672659049ddbf44) )
3122   ROM_LOAD( "e5",           0x2000, 0x0800, CRC(06d378a6) SHA1(99dbe9fc7f95f8fdce86eb5c32bd1ca1bea0ca3c) )
3123   ROM_LOAD( "e6.6",         0x2800, 0x0800, CRC(9f09f8c6) SHA1(47c600629e02357389dd78c7fcaec862e0da4ef0) )
3124   ROM_LOAD( "e7",           0x3000, 0x0800, CRC(b45af1e8) SHA1(d7020774707234acdaef5c655f667d5ee9e54a13) )
3125   ROM_LOAD( "e8",           0x3800, 0x0800, CRC(c437a876) SHA1(845941b873970ac62ba9bb6353bee53d0fcfa292) )
3126
3127   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3128   ROM_LOAD( "e10.2",        0x0000, 0x0800, CRC(25b38ebd) SHA1(f679c2f2cb5892680fec102fafbdfeae156ce373) )
3129   ROM_LOAD( "e12",          0x0800, 0x0200, CRC(628fdeed) SHA1(a798530c65e639fbf00ed3a4e8c428935bf5f38e) )
3130   ROM_CONTINUE(             0x0c00, 0x0200 )   /* this version of the gfx ROMs has two */
3131   ROM_CONTINUE(             0x0a00, 0x0200 )   /* groups of 16 sprites swapped */
3132   ROM_CONTINUE(             0x0e00, 0x0200 )
3133   ROM_LOAD( "e9",           0x1000, 0x0800, CRC(ba664099) SHA1(9509123bed02a9d47f2c056e1562b80206da5579) )
3134   ROM_LOAD( "e11",          0x1800, 0x0200, CRC(ee4ec5fd) SHA1(bf08b3f111f780dc8c81275e4e6247388183a8da) )
3135   ROM_CONTINUE(             0x1c00, 0x0200 )
3136   ROM_CONTINUE(             0x1a00, 0x0200 )
3137   ROM_CONTINUE(             0x1e00, 0x0200 )
3138
3139   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3140   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
3141ROM_END
3142
3143ROM_START( eagle3 )
3144   ROM_REGION( 0x8000, REGION_CPU1, 0 )
3145   ROM_LOAD( "e1",           0x0000, 0x0800, CRC(224c9526) SHA1(4c014d60d4ee80de7f60b4609269461688c181d0) )
3146   ROM_LOAD( "e2",           0x0800, 0x0800, CRC(cc538ebd) SHA1(4ef3c7363e2dcd9ed99779039ccc50a9f2084dbd) )
3147   ROM_LOAD( "f03.bin",      0x1000, 0x0800, CRC(29a2b0ab) SHA1(e9fc7161d0566e36307c45b7132e2262c0af4845) )
3148   ROM_LOAD( "f04.bin",      0x1800, 0x0800, CRC(4c6a5a6d) SHA1(366516f63c9b5239e703e4dfb672659049ddbf44) )
3149   ROM_LOAD( "e5",           0x2000, 0x0800, CRC(06d378a6) SHA1(99dbe9fc7f95f8fdce86eb5c32bd1ca1bea0ca3c) )
3150   ROM_LOAD( "e6",           0x2800, 0x0800, CRC(0dea20d5) SHA1(405b51d4e3b1065f78afd2297e075e977ae19196) )
3151   ROM_LOAD( "e7",           0x3000, 0x0800, CRC(b45af1e8) SHA1(d7020774707234acdaef5c655f667d5ee9e54a13) )
3152   ROM_LOAD( "e8",           0x3800, 0x0800, CRC(c437a876) SHA1(845941b873970ac62ba9bb6353bee53d0fcfa292) )
3153
3154   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3155   ROM_LOAD( "e10a",         0x0000, 0x0800, CRC(e3c63d4c) SHA1(ad2b22e316da6bb819c58934d51cd4b2819b18f0) )
3156   ROM_LOAD( "e12",          0x0800, 0x0200, CRC(628fdeed) SHA1(a798530c65e639fbf00ed3a4e8c428935bf5f38e) )
3157   ROM_CONTINUE(             0x0c00, 0x0200 )   /* this version of the gfx ROMs has two */
3158   ROM_CONTINUE(             0x0a00, 0x0200 )   /* groups of 16 sprites swapped */
3159   ROM_CONTINUE(             0x0e00, 0x0200 )
3160   ROM_LOAD( "e9a",          0x1000, 0x0800, CRC(59429e47) SHA1(b7629c81d122fd1e4d390aa7abba44df898387d3) )
3161   ROM_LOAD( "e11",          0x1800, 0x0200, CRC(ee4ec5fd) SHA1(bf08b3f111f780dc8c81275e4e6247388183a8da) )
3162   ROM_CONTINUE(             0x1c00, 0x0200 )
3163   ROM_CONTINUE(             0x1a00, 0x0200 )
3164   ROM_CONTINUE(             0x1e00, 0x0200 )
3165
3166   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3167   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
3168ROM_END
3169
3170ROM_START( spctbird )
3171   ROM_REGION( 0x8000, REGION_CPU1, 0 )
3172   ROM_LOAD( "tssa-7f",      0x0000, 0x0800, CRC(45aab7a3) SHA1(52ae0463f363dc0964b976faa2c0c428d85a4f12) )
3173   ROM_LOAD( "tssa-7h",      0x0800, 0x0800, CRC(8b328f48) SHA1(d4f549e90e0bf1f546e2c3dc5a5a16e0415e709e) )
3174   ROM_LOAD( "tssa-7k",      0x1000, 0x0800, CRC(29a2b0ab) SHA1(e9fc7161d0566e36307c45b7132e2262c0af4845) )
3175   ROM_LOAD( "tssa-7m",      0x1800, 0x0800, CRC(99c9166d) SHA1(c108d84330bc958ff2812dc807e68c246a5a5ad5) )
3176   ROM_LOAD( "tssa-5",       0x2000, 0x0800, CRC(797b6261) SHA1(9a60e504e2aa0201b7311485c0dd411bbe2dc70b) )
3177   ROM_LOAD( "tssa-6",       0x2800, 0x0800, CRC(4825692c) SHA1(41a7e305c3d93f2245fb0413398d951eab9d16c0) )
3178   ROM_LOAD( "tssa-7",       0x3000, 0x0800, CRC(b45af1e8) SHA1(d7020774707234acdaef5c655f667d5ee9e54a13) )
3179   ROM_LOAD( "tssa-8",       0x3800, 0x0800, CRC(c9b77b85) SHA1(00797f126b4cdacd9ec2df7e747aa1892933b8b8) )
3180
3181   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3182   ROM_LOAD( "tssb-2",       0x0000, 0x0800, CRC(7d23e1f2) SHA1(6902e44ff6f805a8d589c57b236e471b7fb609f8) )
3183   ROM_LOAD( "tssb-4",       0x0800, 0x0200, CRC(e4977833) SHA1(85aca9bccc6c1a5a2d792a9c4a77ee1b114934c9) )
3184   ROM_CONTINUE(             0x0c00, 0x0200 )
3185   ROM_CONTINUE(             0x0a00, 0x0200 )
3186   ROM_CONTINUE(             0x0e00, 0x0200 )
3187   ROM_LOAD( "tssb-1",       0x1000, 0x0800, CRC(9b9267c3) SHA1(2bbbff7a8a2d3e4524634de5e1c5a2426612c18f) )
3188   ROM_LOAD( "tssb-3",       0x1800, 0x0200, CRC(5ca5e233) SHA1(2115faecd07940547d0ee09776da6fcb1a008287) )
3189   ROM_CONTINUE(             0x1c00, 0x0200 )
3190   ROM_CONTINUE(             0x1a00, 0x0200 )
3191   ROM_CONTINUE(             0x1e00, 0x0200 )
3192
3193   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3194   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
3195ROM_END
3196
3197ROM_START( smooncrs )
3198   ROM_REGION( 0x8000, REGION_CPU1, 0 )
3199   ROM_LOAD( "927",          0x0000, 0x0800, CRC(55c5b994) SHA1(3451b121fa22361b2684385cf5d4455fa6963215) )
3200   ROM_LOAD( "928a",         0x0800, 0x0800, CRC(77ae26d3) SHA1(cbc16a024b73bedff76a6c47336d6ef098e92c53) )
3201   ROM_LOAD( "929",          0x1000, 0x0800, CRC(716eaa10) SHA1(780fc785e6651f19dc1a0ccf48cf9485d6562a71) )
3202   ROM_LOAD( "930",          0x1800, 0x0800, CRC(cea864f2) SHA1(aaaf9f8dd126dfb4a4f52f39863fee02a56a6485) )
3203   ROM_LOAD( "931",          0x2000, 0x0800, CRC(702c5f51) SHA1(5ba8d87c93c4810b8e7c2ad4ee376cd806e83686) )
3204   ROM_LOAD( "932a",         0x2800, 0x0800, CRC(e6a2039f) SHA1(f0f240dd8ac7cd2d9994cb7341b59d7a0a3eaf26) )
3205   ROM_LOAD( "933",          0x3000, 0x0800, CRC(73783cee) SHA1(69760e25ba22645572ec16b4f9136ee84ed0c766) )
3206   ROM_LOAD( "934",          0x3800, 0x0800, CRC(c1a14aa2) SHA1(99f6b01a0acd5e936d6ae61c13599db603b73191) )
3207
3208   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3209   ROM_LOAD( "epr203",       0x0000, 0x0800, CRC(be26b561) SHA1(cc27de6888eaf4ee18c0d37d9bcb528dd282b838) )
3210   ROM_LOAD( "mcs_d",        0x0800, 0x0800, CRC(13932a15) SHA1(b8885c555c6ad7021be55c6925a0a0872c1b6abd) )
3211   ROM_LOAD( "epr202",       0x1000, 0x0800, CRC(26c7e800) SHA1(034192e5e2cbac4b66a9828f5ec2311c2c368781) )
3212   ROM_LOAD( "mcs_c",        0x1800, 0x0800, CRC(24cfd145) SHA1(08c6599db170dd6ee364c44f70a0f5c0f881b6ef) )
3213
3214   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3215   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
3216ROM_END
3217
3218ROM_START( mooncmw )
3219   ROM_REGION( 0x8000, REGION_CPU1, 0 )
3220   ROM_LOAD( "60.1x",      0x0000, 0x0800, CRC(322859e6) SHA1(292dccb66c38c8de837ec3ac10928d092494958e) )
3221   ROM_LOAD( "61.2x",      0x0800, 0x0800, CRC(c249902d) SHA1(0015461173fb991fd99c824e0eab054c3c17d0f1) )
3222   ROM_LOAD( "62.3x",      0x1000, 0x0800, CRC(29a2b0ab) SHA1(e9fc7161d0566e36307c45b7132e2262c0af4845) )
3223   ROM_LOAD( "63.4x",      0x1800, 0x0800, CRC(4c6a5a6d) SHA1(366516f63c9b5239e703e4dfb672659049ddbf44) )
3224   ROM_LOAD( "64.5x",      0x2000, 0x0800, CRC(06d378a6) SHA1(99dbe9fc7f95f8fdce86eb5c32bd1ca1bea0ca3c) )
3225   ROM_LOAD( "65.6x",      0x2800, 0x0800, CRC(6e84a927) SHA1(82e8e825d157c3c947a3a222bca059a735169c7d) )
3226   ROM_LOAD( "66.7x",      0x3000, 0x0800, CRC(f23cd8ce) SHA1(a77e7eca239de6a72a8cabed6444ae8efb9e40bd) )
3227   ROM_LOAD( "67.8x",      0x3800, 0x0800, CRC(66da55d5) SHA1(39e2f6107e77ee97860147f64b9673cd9a2ae612) )
3228
3229   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3230   ROM_LOAD( "68.1h",      0x0000, 0x1000, CRC(78663d86) SHA1(8648a3e60259404a05ad58b1641190e5b33a24eb) )
3231   ROM_LOAD( "69.1k",      0x1000, 0x1000, CRC(162c50d3) SHA1(67d9c87782cf29c443590d7ad687fbeaa6218346) )
3232
3233   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3234   ROM_LOAD( "prom-sn74s288n-71.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
3235ROM_END
3236
3237ROM_START( spcdrag )
3238   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3239   ROM_LOAD( "a.bin",      0x0000, 0x0800, CRC(38cc9839) SHA1(71c5853fc14a9c0b93e3b7660b925021680a0fe1) )
3240   ROM_LOAD( "b.bin",      0x0800, 0x0800, CRC(419fa8d6) SHA1(709b096d43c15cbfb98745e1f5e7c1bc921e3241) )
3241   ROM_LOAD( "c.bin",      0x1000, 0x0800, CRC(a1939def) SHA1(c9be93d325dde496d89e0735ec4e7abca932c0f6) )
3242   ROM_LOAD( "d.bin",      0x1800, 0x0800, CRC(cbcf17c5) SHA1(9aa3ca6dc30e4a19ed2bdb2be6ba90bde4cb7542) )
3243   ROM_LOAD( "em.bin",     0x2000, 0x0800, CRC(eb81c19c) SHA1(e5dd61704938c837b87a3155d54698482235c513) )
3244   ROM_LOAD( "fm.bin",     0x2800, 0x0800, CRC(757b7672) SHA1(d042e4bc17d2a8c9f1db55d57d5c235338cdb20c) )
3245   ROM_LOAD( "g.bin",      0x3000, 0x0800, CRC(57713b91) SHA1(ba01ed3f047ebbd0f9e6956e649bec0e8b730a45) )
3246   ROM_LOAD( "h.bin",      0x3800, 0x0800, CRC(159ad847) SHA1(9d46f380c868ac07964e571c54e800c683a6a679) )
3247
3248   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3249   ROM_LOAD( "203.bin",  0x0000, 0x0800, CRC(a2e82527) SHA1(5e9236ba102728213b4651db984b3a169b4a0410) )
3250   ROM_LOAD( "172.bin",  0x0800, 0x0800, CRC(13932a15) SHA1(b8885c555c6ad7021be55c6925a0a0872c1b6abd) )
3251   ROM_LOAD( "202.bin",  0x1000, 0x0800, CRC(80c3ad74) SHA1(0fd2269543d123bd427f5a648a17f8bee65b20a2) )
3252   ROM_LOAD( "171.bin",  0x1800, 0x0800, CRC(24cfd145) SHA1(08c6599db170dd6ee364c44f70a0f5c0f881b6ef) )
3253
3254   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3255   // not present in this set
3256   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
3257ROM_END
3258
3259ROM_START( spcdraga )
3260   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3261   ROM_LOAD( "1.7g",      0x0000, 0x0800, CRC(38cc9839) SHA1(71c5853fc14a9c0b93e3b7660b925021680a0fe1) )
3262   ROM_LOAD( "2.7g",      0x0800, 0x0800, CRC(29e00ae4) SHA1(574bdfb621e084485e6621229cd569486831e4ba) )
3263   ROM_LOAD( "3.7g",      0x1000, 0x0800, CRC(a1939def) SHA1(c9be93d325dde496d89e0735ec4e7abca932c0f6) )
3264   ROM_LOAD( "4.7g",      0x1800, 0x0800, CRC(068f8830) SHA1(e12d590401878d9f2695e5c7aa38387ed9ccfb06) )
3265   ROM_LOAD( "5.10g",     0x2000, 0x0800, CRC(32cd9adc) SHA1(3143690712465d092d6c63f4826f220839d78958) )
3266   ROM_LOAD( "6.10g",     0x2800, 0x0800, CRC(50db67c5) SHA1(69ad219332ac0d9f4e328b314f7bdc34d5599393) )
3267   ROM_LOAD( "7.10g",     0x3000, 0x0800, CRC(22415271) SHA1(60b1ca2dc044c0863c6f38280a3bd0ff9397c869) )
3268   ROM_LOAD( "8.10g",     0x3800, 0x0800, CRC(159ad847) SHA1(9d46f380c868ac07964e571c54e800c683a6a679) )
3269
3270   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3271   ROM_LOAD( "a2.7a",  0x0000, 0x0800, CRC(38b042dd) SHA1(bd452dae4cbc22a900cf783f84d1f9d8cb1218f9) )
3272   ROM_LOAD( "a4.7a",  0x0800, 0x0800, CRC(5a4b17ea) SHA1(8a879dc34fdecc8a121c4a87abb981212fb05945) )
3273   ROM_LOAD( "a1.9a",  0x1000, 0x0800, CRC(24441ab3) SHA1(8c9d2bd062cb2360f3dd3df2d7d212e9485f91ad) )
3274   ROM_LOAD( "a3.9a",  0x1800, 0x0800, CRC(e0edccbd) SHA1(0839a4c9b6e863d12253ae8e1732e80e08702228) )
3275
3276   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3277   // not present in this set
3278   ROM_LOAD( "prom_6331.10f", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
3279ROM_END
3280
3281ROM_START( mooncrgx )
3282   ROM_REGION( 0x8000, REGION_CPU1, 0 )
3283   ROM_LOAD( "1",            0x0000, 0x0800, CRC(84cf420b) SHA1(82c979467c51df699337d5878340d05bee606480) )
3284   ROM_LOAD( "2",            0x0800, 0x0800, CRC(4c2a61a1) SHA1(a3759bd2c062f2843cd5b812529c798d5d12086c) )
3285   ROM_LOAD( "3",            0x1000, 0x0800, CRC(1962523a) SHA1(56ea003c3ff37c2bc33383207fccde0ba0ed781a) )
3286   ROM_LOAD( "4",            0x1800, 0x0800, CRC(75dca896) SHA1(017d04501d3d1305491ba843d92ebd74d47d2f9c) )
3287   ROM_LOAD( "5",            0x2000, 0x0800, CRC(32483039) SHA1(23baf136d5b7fc02f999dcb31b8daf68b6ffafd1) )
3288   ROM_LOAD( "6",            0x2800, 0x0800, CRC(43f2ab89) SHA1(f7f0802a12fd89d61f6f00044e077f34a9d3955f) )
3289   ROM_LOAD( "7",            0x3000, 0x0800, CRC(1e9c168c) SHA1(891dc159dfc343322c3241980a0ef76dee510ca9) )
3290   ROM_LOAD( "8",            0x3800, 0x0800, CRC(5e09da94) SHA1(677890912db12df6fa2cb515c198f8ac3f7187af) )
3291
3292   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3293   ROM_LOAD( "1h_1_10.bin",  0x0000, 0x0800, CRC(528da705) SHA1(d726ee18b79774c982f88afb2a508eb5d5783193) )
3294   ROM_LOAD( "12.chr",       0x0800, 0x0800, CRC(5a4b17ea) SHA1(8a879dc34fdecc8a121c4a87abb981212fb05945) )
3295   ROM_LOAD( "9.chr",        0x1000, 0x0800, CRC(70df525c) SHA1(f771293494a2234bf80f206ecf1e88773322e503) )
3296   ROM_LOAD( "11.chr",       0x1800, 0x0800, CRC(e0edccbd) SHA1(0839a4c9b6e863d12253ae8e1732e80e08702228) )
3297
3298   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3299   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
3300ROM_END
3301
3302ROM_START( moonqsr )
3303   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3304   ROM_LOAD( "mq1",          0x0000, 0x0800, CRC(132c13ec) SHA1(d95166b025442f184e44a70312fb3b4f6366f324) )
3305   ROM_LOAD( "mq2",          0x0800, 0x0800, CRC(c8eb74f1) SHA1(4efa85c40349852da47a0f725ae06873efe4ce1c) )
3306   ROM_LOAD( "mq3",          0x1000, 0x0800, CRC(33965a89) SHA1(92912cea76a472d9b709c664d9818844a07fcc32) )
3307   ROM_LOAD( "mq4",          0x1800, 0x0800, CRC(a3861d17) SHA1(d7037d93b7838ccdd9a6a1a1476571cfa869fca1) )
3308   ROM_LOAD( "mq5",          0x2000, 0x0800, CRC(8bcf9c67) SHA1(7af0d9308d20c52675301acf5d1a5d62358352a6) )
3309   ROM_LOAD( "mq6",          0x2800, 0x0800, CRC(5750cda9) SHA1(17c2bc38037833fdb8923d4a2262264386ef916b) )
3310   ROM_LOAD( "mq7",          0x3000, 0x0800, CRC(78d7fe5b) SHA1(4085562a0af94c65dad2a3550409727e597c0d5b) )
3311   ROM_LOAD( "mq8",          0x3800, 0x0800, CRC(4919eed5) SHA1(526aaedd25e0f7c525eb7c66519218ae09b0407e) )
3312
3313   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3314   ROM_LOAD( "mqb",          0x0000, 0x0800, CRC(b55ec806) SHA1(fb52e53dfa3ae9dec162622d22de9cfdb0b5f9d6) )
3315   ROM_LOAD( "mqd",          0x0800, 0x0800, CRC(9e7d0e13) SHA1(18951080d307ac13344f89745f671595e26d282c) )
3316   ROM_LOAD( "mqa",          0x1000, 0x0800, CRC(66eee0db) SHA1(eeb08efd226e15e248999558240488ffd0e39688) )
3317   ROM_LOAD( "mqc",          0x1800, 0x0800, CRC(a6db5b0d) SHA1(476e197df047e991d2ea3c1fad92c799510f1647) )
3318
3319   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3320   ROM_LOAD( "vid_e6.bin",   0x0000, 0x0020, CRC(0b878b54) SHA1(3667aca564ebfef5b88d7f74fabbd16dd23183b4) )
3321ROM_END
3322
3323ROM_START( moonal2 )
3324   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3325   ROM_LOAD( "ali1",         0x0000, 0x0400, CRC(0dcecab4) SHA1(493628640de1a7e3bb9914ee3459b74cedc599fd) )
3326   ROM_LOAD( "ali2",         0x0400, 0x0400, CRC(c6ee75a7) SHA1(36503351380f7638069637c22bd06da06da54a1c) )
3327   ROM_LOAD( "ali3",         0x0800, 0x0400, CRC(cd1be7e9) SHA1(684f1923090f0d53338705f6972778712e27577f) )
3328   ROM_LOAD( "ali4",         0x0c00, 0x0400, CRC(83b03f08) SHA1(a1fd422051aa7f17f857188b503031cce3fdc275) )
3329   ROM_LOAD( "ali5",         0x1000, 0x0400, CRC(6f3cf61d) SHA1(e238ed6f9c0813f0177abe9090e29562529eeef8) )
3330   ROM_LOAD( "ali6",         0x1400, 0x0400, CRC(e169d432) SHA1(a5189d7322a240863afee7ac0ecf68599498cb87) )
3331   ROM_LOAD( "ali7",         0x1800, 0x0400, CRC(41f64b73) SHA1(dff786a74575da9fbaca3ac610ad2f367983c7fc) )
3332   ROM_LOAD( "ali8",         0x1c00, 0x0400, CRC(f72ee876) SHA1(8e50a516f10d77652ff3692bb85adb66bc128e26) )
3333   ROM_LOAD( "ali9",         0x2000, 0x0400, CRC(b7fb763c) SHA1(4e7c4995f52dec2ea61424c79d79797933dad604) )
3334   ROM_LOAD( "ali10",        0x2400, 0x0400, CRC(b1059179) SHA1(86de04c82a7604cb57958a52d5585837481f94a5) )
3335   ROM_LOAD( "ali11",        0x2800, 0x0400, CRC(9e79a1c6) SHA1(2f59e3a2a81a224b163b23bd2c184385f64e1565) )
3336
3337   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3338   ROM_LOAD( "ali13.1h",     0x0000, 0x0800, CRC(a1287bf6) SHA1(eeeaba4b9e186454a5e2f1c26e333e8fccd97af8) )
3339   ROM_RELOAD(                 0x0800, 0x0800 )
3340   ROM_LOAD( "ali12.1k",     0x1000, 0x0800, CRC(528f1481) SHA1(e266a75c3109bcfa2a0394f2ed0ac136fc3158ba) )
3341   ROM_RELOAD(                 0x1800, 0x0800 )
3342
3343   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3344   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
3345ROM_END
3346
3347ROM_START( moonal2b )
3348   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3349   ROM_LOAD( "ali1",         0x0000, 0x0400, CRC(0dcecab4) SHA1(493628640de1a7e3bb9914ee3459b74cedc599fd) )
3350   ROM_LOAD( "ali2",         0x0400, 0x0400, CRC(c6ee75a7) SHA1(36503351380f7638069637c22bd06da06da54a1c) )
3351   ROM_LOAD( "md-2",         0x0800, 0x0800, CRC(8318b187) SHA1(75bb113db1111cd2a335139fa6cb94d9522f5860) )
3352   ROM_LOAD( "ali5",         0x1000, 0x0400, CRC(6f3cf61d) SHA1(e238ed6f9c0813f0177abe9090e29562529eeef8) )
3353   ROM_LOAD( "ali6",         0x1400, 0x0400, CRC(e169d432) SHA1(a5189d7322a240863afee7ac0ecf68599498cb87) )
3354   ROM_LOAD( "ali7",         0x1800, 0x0400, CRC(41f64b73) SHA1(dff786a74575da9fbaca3ac610ad2f367983c7fc) )
3355   ROM_LOAD( "ali8",         0x1c00, 0x0400, CRC(f72ee876) SHA1(8e50a516f10d77652ff3692bb85adb66bc128e26) )
3356   ROM_LOAD( "ali9",         0x2000, 0x0400, CRC(b7fb763c) SHA1(4e7c4995f52dec2ea61424c79d79797933dad604) )
3357   ROM_LOAD( "ali10",        0x2400, 0x0400, CRC(b1059179) SHA1(86de04c82a7604cb57958a52d5585837481f94a5) )
3358   ROM_LOAD( "md-6",         0x2800, 0x0800, CRC(9cc973e0) SHA1(8d96448794e0869036a3fac7f7fbcad459149a98) )
3359
3360   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3361   ROM_LOAD( "ali13.1h",     0x0000, 0x0800, CRC(a1287bf6) SHA1(eeeaba4b9e186454a5e2f1c26e333e8fccd97af8) )
3362   ROM_RELOAD(                 0x0800, 0x0800 )
3363   ROM_LOAD( "ali12.1k",     0x1000, 0x0800, CRC(528f1481) SHA1(e266a75c3109bcfa2a0394f2ed0ac136fc3158ba) )
3364   ROM_RELOAD(                 0x1800, 0x0800 )
3365
3366   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3367   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
3368ROM_END
3369
3370
3371ROM_START( skybase )
3372   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3373   ROM_LOAD( "skybase.9a",   0x0000, 0x1000, CRC(845b87a5) SHA1(8a249c1ec921532cb1bb85ed7fec11396634ca38) )
3374   ROM_LOAD( "skybase.8a",   0x1000, 0x1000, CRC(096785c2) SHA1(a0833bc1984e1f198587195e58b6fed6657922bd) )
3375   ROM_LOAD( "skybase.7a",   0x2000, 0x1000, CRC(d50c715b) SHA1(3d0fa15514b210bccd4aeed06540122a4f56fd7a) )
3376   ROM_LOAD( "skybase.6a",   0x3000, 0x1000, CRC(f57edb27) SHA1(4b5c376017700315345241fad96c00478a14fc8f) )
3377   ROM_LOAD( "skybase.5a",   0x4000, 0x1000, CRC(50365d95) SHA1(9b3d360c9d1df0ebf047bef1b30765ea9bb42b42) )
3378   ROM_LOAD( "skybase.4a",   0x5000, 0x1000, CRC(cbd6647f) SHA1(7a167c9df6b5f3346c37e5c45d0680b0b29852a6) )
3379
3380   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
3381   ROM_LOAD( "skybase.7t",   0x0000, 0x1000, CRC(9b471686) SHA1(b35831daa8ce57e498c2c4f75763a74c340cfaf0) )
3382   ROM_LOAD( "skybase.8t",   0x1000, 0x1000, CRC(1cf723da) SHA1(f2e41ab89413298571626d13b2b5853eb35dcb96) )
3383   ROM_LOAD( "skybase.10t",  0x2000, 0x1000, CRC(fe02e72c) SHA1(bf7c078e984b13dcc12d529904f1096d65e41bec) )
3384   ROM_LOAD( "skybase.9t",   0x3000, 0x1000, CRC(0871291f) SHA1(2e4e802316b55711bcfeb48d84bacd11afff8cb3) )
3385
3386   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3387   ROM_LOAD( "82s123.bpr",  0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Color prom */
3388ROM_END
3389
3390
3391ROM_START( jumpbug )
3392   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3393   ROM_LOAD( "jb1",          0x0000, 0x1000, CRC(415aa1b7) SHA1(4f9edd7e9720acf085dd8910849c2f2fac5cb547) )
3394   ROM_LOAD( "jb2",          0x1000, 0x1000, CRC(b1c27510) SHA1(66fbe0b94b6c101cb50d7a3ff78160110415dff9) )
3395   ROM_LOAD( "jb3",          0x2000, 0x1000, CRC(97c24be2) SHA1(1beb9fbc3a52610b416af8b5fee156d8b6b3125a) )
3396   ROM_LOAD( "jb4",          0x3000, 0x1000, CRC(66751d12) SHA1(26c68cfb59596ae164ee9ae4a24ddf8dc7a923a7) )
3397   ROM_LOAD( "jb5",          0x8000, 0x1000, CRC(e2d66faf) SHA1(3dec0796642856359de57afb896cc668c0245b40) )
3398   ROM_LOAD( "jb6",          0x9000, 0x1000, CRC(49e0bdfd) SHA1(8d89d9cd7134b153264fdc49d2c68e8c14004b0d) )
3399   ROM_LOAD( "jb7",          0xa000, 0x0800, CRC(83d71302) SHA1(9292088d26ba29fbf8817df03461b8bb6bf27639) )
3400
3401   ROM_REGION( 0x3000, REGION_GFX1, ROMREGION_DISPOSE )
3402   ROM_LOAD( "jbl",          0x0000, 0x0800, CRC(9a091b0a) SHA1(19b88f802ee80ff8901ef99e3688f2869f1a69c5) )
3403   ROM_LOAD( "jbm",          0x0800, 0x0800, CRC(8a0fc082) SHA1(58b72a3161950a2fb71cdab3f30bb3abb19c7978) )
3404   ROM_LOAD( "jbn",          0x1000, 0x0800, CRC(155186e0) SHA1(717ddaecc52a4ef03a01fcddb520acdbfb0d722a) )
3405   ROM_LOAD( "jbi",          0x1800, 0x0800, CRC(7749b111) SHA1(55071ce04708bd52177644298f76ae79d23f6ac9) )
3406   ROM_LOAD( "jbj",          0x2000, 0x0800, CRC(06e8d7df) SHA1(d04f1503d9fde5aae92652cb9d2eb16bd6a0fe9c) )
3407   ROM_LOAD( "jbk",          0x2800, 0x0800, CRC(b8dbddf3) SHA1(043de444890a93459789dc99c43ef88ff66b79e4) )
3408
3409   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3410   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
3411ROM_END
3412
3413ROM_START( jumpbugb )
3414   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3415   ROM_LOAD( "jb1",          0x0000, 0x1000, CRC(415aa1b7) SHA1(4f9edd7e9720acf085dd8910849c2f2fac5cb547) )
3416   ROM_LOAD( "jb2",          0x1000, 0x1000, CRC(b1c27510) SHA1(66fbe0b94b6c101cb50d7a3ff78160110415dff9) )
3417   ROM_LOAD( "jb3b",         0x2000, 0x1000, CRC(cb8b8a0f) SHA1(9e8591471dda2cb964ba2a866d4a5a3ef65d8707) )
3418   ROM_LOAD( "jb4",          0x3000, 0x1000, CRC(66751d12) SHA1(26c68cfb59596ae164ee9ae4a24ddf8dc7a923a7) )
3419   ROM_LOAD( "jb5b",         0x8000, 0x1000, CRC(7553b5e2) SHA1(6439585e713581dd36cea6324414f803d683216f) )
3420   ROM_LOAD( "jb6b",         0x9000, 0x1000, CRC(47be9843) SHA1(495d6fc732267bfd19a953b0b70df3f94b3c1e38) )
3421   ROM_LOAD( "jb7b",         0xa000, 0x0800, CRC(460aed61) SHA1(449ab1bb502f98da74c0955ce1364f8708fd3f81) )
3422
3423   ROM_REGION( 0x3000, REGION_GFX1, ROMREGION_DISPOSE )
3424   ROM_LOAD( "jbl",          0x0000, 0x0800, CRC(9a091b0a) SHA1(19b88f802ee80ff8901ef99e3688f2869f1a69c5) )
3425   ROM_LOAD( "jbm",          0x0800, 0x0800, CRC(8a0fc082) SHA1(58b72a3161950a2fb71cdab3f30bb3abb19c7978) )
3426   ROM_LOAD( "jbn",          0x1000, 0x0800, CRC(155186e0) SHA1(717ddaecc52a4ef03a01fcddb520acdbfb0d722a) )
3427   ROM_LOAD( "jbi",          0x1800, 0x0800, CRC(7749b111) SHA1(55071ce04708bd52177644298f76ae79d23f6ac9) )
3428   ROM_LOAD( "jbj",          0x2000, 0x0800, CRC(06e8d7df) SHA1(d04f1503d9fde5aae92652cb9d2eb16bd6a0fe9c) )
3429   ROM_LOAD( "jbk",          0x2800, 0x0800, CRC(b8dbddf3) SHA1(043de444890a93459789dc99c43ef88ff66b79e4) )
3430
3431   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3432   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
3433ROM_END
3434
3435ROM_START( levers )
3436   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3437   ROM_LOAD( "g96059.a8",      0x0000, 0x1000, CRC(9550627a) SHA1(3da9a614622d5b880852fe2bb2e8e4a60afb2d34) )
3438   ROM_LOAD( "g96060.d8",      0x2000, 0x1000, CRC(5ac64646) SHA1(459755932a033095eff72d78d1e916932964c5cc) )
3439   ROM_LOAD( "g96061.e8",      0x3000, 0x1000, CRC(9db8e520) SHA1(1ff10e221e45cc4afb77571a171937f8501aa509) )
3440   ROM_LOAD( "g96062.h8",      0x8000, 0x1000, CRC(7c8e8b3a) SHA1(ad281f801e818ea529be8ec43096212e834f69ef) )
3441   ROM_LOAD( "g96063.j8",      0x9000, 0x1000, CRC(fa61e793) SHA1(7aad77f3de05a7bd3dcb0c9c97a3cccd1136f352) )
3442   ROM_LOAD( "g96064.l8",      0xa000, 0x1000, CRC(f797f389) SHA1(b961f0506defa9884ac47b2316884318e1e90bff) )
3443
3444   ROM_REGION( 0x3000, REGION_GFX1, ROMREGION_DISPOSE )
3445   ROM_LOAD( "g95948.n1",      0x0000, 0x0800, CRC(d8a0c692) SHA1(dd64623f4072bcb8c528b5b7b95a7bd858b79d6c) )
3446                     /*0x0800- 0x0fff empty */
3447   ROM_LOAD( "g95949.s1",      0x1000, 0x0800, CRC(3660a552) SHA1(bebfd30f90da55d6d42945717b9b38d5b0c9623a) )
3448   ROM_LOAD( "g95946.j1",      0x1800, 0x0800, CRC(73b61b2d) SHA1(fdb75eea1778daa6f9c48243361e418044b471f8) )
3449                     /*0x2000- 0x27ff empty */
3450   ROM_LOAD( "g95947.m1",      0x2800, 0x0800, CRC(72ff67e2) SHA1(dcc12f17a857271c253d06d5ac170b9d6bb6a2bd) )
3451
3452   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3453   ROM_LOAD( "g960lev.clr",  0x0000, 0x0020, CRC(01febbbe) SHA1(11b1dab7983ba29e830ccb7f14eb1a99465c9e81) )
3454ROM_END
3455
3456
3457ROM_START( checkman )
3458   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3459   ROM_LOAD( "cm1",          0x0000, 0x0800, CRC(e8cbdd28) SHA1(ba0b41e375b94bbfed6a2c949cc7958474c8ba6e) )
3460   ROM_LOAD( "cm2",          0x0800, 0x0800, CRC(b8432d4d) SHA1(d331476f1f88b7ef1426bed7442392f369e0650b) )
3461   ROM_LOAD( "cm3",          0x1000, 0x0800, CRC(15a97f61) SHA1(3c06c734cef1eed68b401d0d36f7ec9126986d73) )
3462   ROM_LOAD( "cm4",          0x1800, 0x0800, CRC(8c12ecc0) SHA1(1c2d61ef84404b6a524c453a3d339aaaadb38229) )
3463   ROM_LOAD( "cm5",          0x2000, 0x0800, CRC(2352cfd6) SHA1(77db5f925ee5f83c17a05a78af5191eefe70ca5a) )
3464
3465   ROM_REGION( 0x10000, REGION_CPU2, 0 )   /* 64k for sound code */
3466   ROM_LOAD( "cm13",         0x0000, 0x0800, CRC(0b09a3e8) SHA1(e4e65da306e22f61790f0a68d953cc017c3ce762) )
3467   ROM_LOAD( "cm14",         0x0800, 0x0800, CRC(47f043be) SHA1(44d8892d93849cbc989561387c0a05baead58446) )
3468
3469   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3470   ROM_LOAD( "cm11",         0x0000, 0x0800, CRC(8d1bcca0) SHA1(28fc7fb76180820e84d59e6836ed1f8136e8f138) )
3471   ROM_RELOAD(                 0x0800, 0x0800 )
3472   ROM_LOAD( "cm9",          0x1000, 0x0800, CRC(3cd5c751) SHA1(a769fdd30752da8fb331aa0f7a0181a93f0b3378) )
3473   ROM_RELOAD(                 0x1800, 0x0800 )
3474
3475   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3476   ROM_LOAD( "checkman.clr", 0x0000, 0x0020, CRC(57a45057) SHA1(d4ec6a54f72640e5b485aa59e206c090e67ff640) )
3477ROM_END
3478
3479ROM_START( checkmaj )
3480   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3481   ROM_LOAD( "cm_1.bin",     0x0000, 0x1000, CRC(456a118f) SHA1(7c2e8343360f446af4391012784a1ccfecae3299) )
3482   ROM_LOAD( "cm_2.bin",     0x1000, 0x1000, CRC(146b2c44) SHA1(80455396a9b1802fcefaec1340b76461c0601bf9) )
3483   ROM_LOAD( "cm_3.bin",     0x2000, 0x0800, CRC(73e1c945) SHA1(bcf2558958a30e5936f19ff53687f2316e0b822e) )
3484
3485   ROM_REGION( 0x10000, REGION_CPU2, 0 )   /* 64k for sound code */
3486   ROM_LOAD( "cm_4.bin",     0x0000, 0x1000, CRC(923cffa1) SHA1(132822d20de2ad1ecc561e811ca40c5642500631) )
3487
3488   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3489   ROM_LOAD( "cm_6.bin",     0x0000, 0x0800, CRC(476a7cc3) SHA1(3c343b0dcfb2f4cbec2f8b5854a303a1660fea22) )
3490   ROM_LOAD( "cm_5.bin",     0x0800, 0x0800, CRC(b3df2b5f) SHA1(519a0894d1794211659abeb6b2a2c610e6c2af25) )
3491
3492   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3493   ROM_LOAD( "checkman.clr", 0x0000, 0x0020, CRC(57a45057) SHA1(d4ec6a54f72640e5b485aa59e206c090e67ff640) )
3494ROM_END
3495
3496ROM_START( dingo )
3497   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3498   ROM_LOAD( "003.e7",       0x0000, 0x1000, CRC(d088550f) SHA1(13b87995881e484825c45ab4e558ac3d90bf162a) )
3499   ROM_LOAD( "004.h7",       0x1000, 0x1000, CRC(a228446a) SHA1(4b7e611edd6bce308cc7b17caa068445f5438f4f) )
3500   ROM_LOAD( "005.j7",       0x2000, 0x0800, CRC(14d680bb) SHA1(e9d84d1a62ed5300c390a7326c16cebd0aceae3b) )
3501
3502   ROM_REGION( 0x10000, REGION_CPU2, 0 )   /* 64k for sound code */
3503   ROM_LOAD( "6.7l",         0x0000, 0x1000, CRC(047092e0) SHA1(24014c999c904b4be571121b0f6808713d95add1) )
3504
3505   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3506   ROM_LOAD( "001.h1",       0x0000, 0x0800, CRC(1ab1dd4d) SHA1(74ef2226e1f1d2583b0c7718325da193f411a97d) )
3507   ROM_LOAD( "002.k1",       0x0800, 0x0800, CRC(4be375ee) SHA1(7379b037887baca0f932d910f8f94f7edf39bb26) )
3508
3509   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3510   ROM_LOAD( "18s030.l6",     0x0000, 0x0020, CRC(3061d0f9) SHA1(5af85499c6219137dc57d9fba79cb5afa3548ab1) )
3511ROM_END
3512
3513ROM_START( dingoe )
3514   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3515   ROM_LOAD( "unk.2b",       0x0000, 0x1000, CRC(0df7ac6d) SHA1(c1d45a7694848e66426c3510d0749c98e51571cb) )
3516   ROM_LOAD( "unk.2d",       0x1000, 0x1000, CRC(0881e204) SHA1(4ba59d73e04b5337cfbd68d6a708e7321cb629f1) )
3517   ROM_LOAD( "unk.3b",       0x2000, 0x1000, BAD_DUMP CRC(0b6aeab5) SHA1(ebfab3227dd23e3e1802b881a5662f634f86e382) ) // both halves identical (bad?)
3518
3519   ROM_REGION( 0x10000, REGION_CPU2, 0 )   /* 64k for sound code */
3520   ROM_LOAD( "unk.1c",       0x0000, 0x0800, CRC(8e354c38) SHA1(87608c1fa55e6fcf482f5d3bcc506a84673719cc) )
3521   ROM_LOAD( "unk.1d",       0x0800, 0x0800, CRC(092878d6) SHA1(8a3b25e27df5aee2023a7e1a193ab152df171ede) )
3522
3523   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3524   ROM_LOAD( "unk.4d",       0x0000, 0x0800, CRC(76a00a56) SHA1(2a696b9ce3e148529c731231852dc104729bb916) )
3525   ROM_LOAD( "unk.4b",       0x0800, 0x0800, CRC(5acf57aa) SHA1(bb05be53728e7867085dad5854fcadfa687ff5d7) )
3526
3527   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3528   ROM_LOAD( "82s123n.001",  0x0000, 0x0020, CRC(02b11865) SHA1(70053db9635a9194e4372835379a82f6ea64ef83) ) /* Unknown */
3529ROM_END
3530
3531
3532ROM_START( mshuttle )
3533   ROM_REGION( 2*0x10000, REGION_CPU1, 0 )   /* 64k for code + 64k for decrypted opcodes */
3534   ROM_LOAD( "my05",         0x0000, 0x1000, CRC(83574af1) SHA1(d69c2a0538a49d6c72c3346ac4e3959d91da6c98) )
3535   ROM_LOAD( "my04",         0x1000, 0x1000, CRC(1cfae2c8) SHA1(6c7eeee70e91b8498c41525dcc60f8086cff8da7) )
3536   ROM_LOAD( "my03",         0x2000, 0x1000, CRC(c8b8a368) SHA1(140ba60f55285d1e9f7a262634f5ce5c3470ab71) )
3537   ROM_LOAD( "my02",         0x3000, 0x1000, CRC(b6aeee6e) SHA1(032af7000aebe9d34319231cdb3f2fe5de7158ba) )
3538   ROM_LOAD( "my01",         0x4000, 0x1000, CRC(def82adc) SHA1(2fb963299468c52d50b7460b55bf69c9659ee21d) )
3539
3540   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
3541   ROM_LOAD( "my09",         0x0000, 0x1000, CRC(3601b380) SHA1(c0b9d1801f58a16449708d514d2fd88e34af340b) )
3542   ROM_LOAD( "my11",         0x1000, 0x0800, CRC(b659e932) SHA1(3f63c99e81cb93c9553a5e274546525f598d50c4) )
3543   ROM_LOAD( "my08",         0x2000, 0x1000, CRC(992b06cd) SHA1(8645ccad8169601bbe25b9f2b17b99004c0a584f) )
3544   ROM_LOAD( "my10",         0x3000, 0x0800, CRC(d860e6ce) SHA1(2912d13bf69496f8f18358a36366a1f60afd0070) )
3545
3546   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3547   ROM_LOAD( "mscprom1.bin", 0x0000, 0x0020, CRC(ea0d1af0) SHA1(cb59e04c02307dfe847e3170cf0a7f62829b6094) )
3548
3549   ROM_REGION( 0x2000, REGION_SOUND1, 0 )   /* samples */
3550   ROM_LOAD( "my07",         0x0000, 0x1000, CRC(522a2920) SHA1(a64d821a8ff6bd6e2b0bdb1e632181e65a97363b) )
3551   ROM_LOAD( "my06",         0x1000, 0x1000, CRC(466415f2) SHA1(a05f8238cdcebe926a564ef6268b3cd677987fa2) )
3552ROM_END
3553
3554ROM_START( mshuttlj )
3555   ROM_REGION( 2*0x10000, REGION_CPU1, 0 )   /* 64k for code + 64k for decrypted opcodes */
3556   ROM_LOAD( "mcs.5",        0x0000, 0x1000, CRC(a5a292b4) SHA1(b4e9d969c762f4114eba88051917df122fc7181f) )
3557   ROM_LOAD( "mcs.4",        0x1000, 0x1000, CRC(acdc0f9e) SHA1(8cd6d6566fe3f4090ccb625c3c1e5850a371826f) )
3558   ROM_LOAD( "mcs.3",        0x2000, 0x1000, CRC(c1e3f5d8) SHA1(d3af89d485b1ca21ac879dbe15490dcd1cd64f2a) )
3559   ROM_LOAD( "mcs.2",        0x3000, 0x1000, CRC(14577703) SHA1(51537982dd06ba44e95e4c7d1f7fa41ff186421d) )
3560
3561   ROM_LOAD( "mcs.1",        0x4000, 0x1000, CRC(27d46772) SHA1(848a47ba30823a55933bb55792991f0535078f0c) )
3562
3563   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
3564   ROM_LOAD( "my09",         0x0000, 0x1000, CRC(3601b380) SHA1(c0b9d1801f58a16449708d514d2fd88e34af340b) )
3565   ROM_LOAD( "my11",         0x1000, 0x0800, CRC(b659e932) SHA1(3f63c99e81cb93c9553a5e274546525f598d50c4) )
3566   ROM_LOAD( "my08",         0x2000, 0x1000, CRC(992b06cd) SHA1(8645ccad8169601bbe25b9f2b17b99004c0a584f) )
3567   ROM_LOAD( "my10",         0x3000, 0x0800, CRC(d860e6ce) SHA1(2912d13bf69496f8f18358a36366a1f60afd0070) )
3568
3569   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3570   ROM_LOAD( "mscprom1.bin", 0x0000, 0x0020, CRC(ea0d1af0) SHA1(cb59e04c02307dfe847e3170cf0a7f62829b6094) )
3571
3572   ROM_REGION( 0x2000, REGION_SOUND1, 0 )   /* samples */
3573   ROM_LOAD( "my07",         0x0000, 0x1000, CRC(522a2920) SHA1(a64d821a8ff6bd6e2b0bdb1e632181e65a97363b) )
3574   ROM_LOAD( "my06",         0x1000, 0x1000, CRC(466415f2) SHA1(a05f8238cdcebe926a564ef6268b3cd677987fa2) )
3575ROM_END
3576
3577ROM_START( mshutlj2 )
3578   ROM_REGION( 2*0x10000, REGION_CPU1, 0 )   /* 64k for code + 64k for decrypted opcodes */
3579   ROM_LOAD( "ali5.bin",     0x0000, 0x1000, CRC(320fe630) SHA1(df4fe25989783c8851f41c9b4b63dedfa365c1e9) )
3580   ROM_LOAD( "mcs.4",        0x1000, 0x1000, CRC(acdc0f9e) SHA1(8cd6d6566fe3f4090ccb625c3c1e5850a371826f) )
3581   ROM_LOAD( "mcs.3",        0x2000, 0x1000, CRC(c1e3f5d8) SHA1(d3af89d485b1ca21ac879dbe15490dcd1cd64f2a) )
3582   ROM_LOAD( "ali2.bin",     0x3000, 0x1000, CRC(9ed169e1) SHA1(75a24d0fcbdfc7c4e6fa0d8c7f8b4a3bccaa4439) )
3583
3584   ROM_LOAD( "ali1.bin",     0x4000, 0x1000, CRC(7f8a52d9) SHA1(4e62f6265289bae1a46e60cdd3230e188b2aec3c) )
3585
3586   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
3587   ROM_LOAD( "my09",         0x0000, 0x1000, CRC(3601b380) SHA1(c0b9d1801f58a16449708d514d2fd88e34af340b) )
3588   ROM_LOAD( "my11",         0x1000, 0x0800, CRC(b659e932) SHA1(3f63c99e81cb93c9553a5e274546525f598d50c4) )
3589   ROM_LOAD( "my08",         0x2000, 0x1000, CRC(992b06cd) SHA1(8645ccad8169601bbe25b9f2b17b99004c0a584f) )
3590   ROM_LOAD( "my10",         0x3000, 0x0800, CRC(d860e6ce) SHA1(2912d13bf69496f8f18358a36366a1f60afd0070) )
3591
3592   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3593   ROM_LOAD( "mscprom1.bin", 0x0000, 0x0020, CRC(ea0d1af0) SHA1(cb59e04c02307dfe847e3170cf0a7f62829b6094) )
3594
3595   ROM_REGION( 0x2000, REGION_SOUND1, 0 )   /* samples */
3596   ROM_LOAD( "my07",         0x0000, 0x1000, CRC(522a2920) SHA1(a64d821a8ff6bd6e2b0bdb1e632181e65a97363b) )
3597   ROM_LOAD( "my06",         0x1000, 0x1000, CRC(466415f2) SHA1(a05f8238cdcebe926a564ef6268b3cd677987fa2) )
3598ROM_END
3599
3600
3601ROM_START( kingball )
3602   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3603   ROM_LOAD( "prg1.7f",      0x0000, 0x1000, CRC(6cb49046) SHA1(a0891605dff7f9ff51bc7ad85f831a749f2f61e9) )
3604   ROM_LOAD( "prg2.7j",      0x1000, 0x1000, CRC(c223b416) SHA1(ca2d9f6b8ef6db4f382089161f4147d9828c3554) )
3605   ROM_LOAD( "prg3.7l",      0x2000, 0x0800, CRC(453634c0) SHA1(0025ccd91e165692092a37541e730010e85e37f2) )
3606
3607   ROM_REGION( 0x10000, REGION_CPU2, 0 )   /* 64k for sound code */
3608   ROM_LOAD( "kbe1.ic4",     0x0000, 0x0800, CRC(5be2c80a) SHA1(f719a80357bed3d66bce40569690f419740148c5) )
3609   ROM_LOAD( "kbe2.ic5",     0x0800, 0x0800, CRC(bb59e965) SHA1(830e0c415f051e932d76df604025e4e33118a799) )
3610   ROM_LOAD( "kbe3.ic6",     0x1000, 0x0800, CRC(1c94dd31) SHA1(14ab59b8eee741eb1f10ae99ddb99bf7c2dab957) )
3611   ROM_LOAD( "kbe2.ic7",     0x1800, 0x0800, CRC(bb59e965) SHA1(830e0c415f051e932d76df604025e4e33118a799) )
3612
3613   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3614   ROM_LOAD( "chg1.1h",      0x0000, 0x0800, CRC(9cd550e7) SHA1(d2989e6b7a4d7b37a711ef1cfb536fe13e0c5482) )
3615   ROM_RELOAD(                 0x0800, 0x0800 )
3616   ROM_LOAD( "chg2.1k",      0x1000, 0x0800, CRC(a206757d) SHA1(46b50005876b7f61ab4a118d0a4caaebce8ce3e1) )
3617   ROM_RELOAD(                 0x1800, 0x0800 )
3618
3619   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3620   ROM_LOAD( "kb2-1",        0x0000, 0x0020, CRC(15dd5b16) SHA1(3d2ca2b42bf508a9e5198e970abcbbedf5729164) )
3621ROM_END
3622
3623ROM_START( kingbalj )
3624   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3625   ROM_LOAD( "prg1.7f",      0x0000, 0x1000, CRC(6cb49046) SHA1(a0891605dff7f9ff51bc7ad85f831a749f2f61e9) )
3626   ROM_LOAD( "prg2.7j",      0x1000, 0x1000, CRC(c223b416) SHA1(ca2d9f6b8ef6db4f382089161f4147d9828c3554) )
3627   ROM_LOAD( "prg3.7l",      0x2000, 0x0800, CRC(453634c0) SHA1(0025ccd91e165692092a37541e730010e85e37f2) )
3628
3629   ROM_REGION( 0x10000, REGION_CPU2, 0 )   /* 64k for sound code */
3630   ROM_LOAD( "kbj1.ic4",     0x0000, 0x0800, CRC(ba16beb7) SHA1(8c2c91a9e941d858a49edd6c0c8a912e1135653e) )
3631   ROM_LOAD( "kbj2.ic5",     0x0800, 0x0800, CRC(56686a63) SHA1(8e624df57a63a556941fdbebcd886488799fad17) )
3632   ROM_LOAD( "kbj3.ic6",     0x1000, 0x0800, CRC(fbc570a5) SHA1(d0dbaf86396bca65e067338a3b5b60b24990b8be) )
3633   ROM_LOAD( "kbj2.ic7",     0x1800, 0x0800, CRC(56686a63) SHA1(8e624df57a63a556941fdbebcd886488799fad17) )
3634
3635
3636   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
3637   ROM_LOAD( "chg1.1h",      0x0000, 0x0800, CRC(9cd550e7) SHA1(d2989e6b7a4d7b37a711ef1cfb536fe13e0c5482) )
3638   ROM_RELOAD(                 0x0800, 0x0800 )
3639   ROM_LOAD( "chg2.1k",      0x1000, 0x0800, CRC(a206757d) SHA1(46b50005876b7f61ab4a118d0a4caaebce8ce3e1) )
3640   ROM_RELOAD(                 0x1800, 0x0800 )
3641
3642   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3643   ROM_LOAD( "kb2-1",        0x0000, 0x0020, CRC(15dd5b16) SHA1(3d2ca2b42bf508a9e5198e970abcbbedf5729164) )
3644ROM_END
3645
3646
3647/*************************************
3648 *
3649 *  ROM definitions
3650 *  Konami games
3651 *
3652 *************************************/
3653
3654ROM_START( frogger )
3655   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3656   ROM_LOAD( "frogger.26",   0x0000, 0x1000, CRC(597696d6) SHA1(e7e021776cad00f095a1ebbef407b7c0a8f5d835) )
3657   ROM_LOAD( "frogger.27",   0x1000, 0x1000, CRC(b6e6fcc3) SHA1(5e8692f2b0c7f4b3642b3ee6670e1c3b20029cdc) )
3658   ROM_LOAD( "frsm3.7",      0x2000, 0x1000, CRC(aca22ae0) SHA1(5a99060ea2506a3ac7d61ca5876ce5cb3e493565) )
3659
3660   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3661   ROM_LOAD( "frogger.608",  0x0000, 0x0800, CRC(e8ab0256) SHA1(f090afcfacf5f13cdfa0dfda8e3feb868c6ce8bc) )
3662   ROM_LOAD( "frogger.609",  0x0800, 0x0800, CRC(7380a48f) SHA1(75582a94b696062cbdb66a4c5cf0bc0bb94f81ee) )
3663   ROM_LOAD( "frogger.610",  0x1000, 0x0800, CRC(31d7eb27) SHA1(2e1d34ae4da385fd7cac94707d25eeddf4604e1a) )
3664
3665   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3666   ROM_LOAD( "frogger.607",  0x0000, 0x0800, CRC(05f7d883) SHA1(78831fd287da18928651a8adb7e578d291493eff) )
3667   ROM_LOAD( "frogger.606",  0x0800, 0x0800, CRC(f524ee30) SHA1(dd768967add61467baa08d5929001f157d6cd911) )
3668
3669   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3670   ROM_LOAD( "pr-91.6l",     0x0000, 0x0020, CRC(413703bf) SHA1(66648b2b28d3dcbda5bdb2605d1977428939dd3c) )
3671ROM_END
3672
3673ROM_START( frogseg1 )
3674   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3675   ROM_LOAD( "frogger.26",   0x0000, 0x1000, CRC(597696d6) SHA1(e7e021776cad00f095a1ebbef407b7c0a8f5d835) )
3676   ROM_LOAD( "frogger.27",   0x1000, 0x1000, CRC(b6e6fcc3) SHA1(5e8692f2b0c7f4b3642b3ee6670e1c3b20029cdc) )
3677   ROM_LOAD( "frogger.34",   0x2000, 0x1000, CRC(ed866bab) SHA1(24e1bbde44eb5480b7a0570fa0dc1de388cb95ba) )
3678
3679   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3680   ROM_LOAD( "frogger.608",  0x0000, 0x0800, CRC(e8ab0256) SHA1(f090afcfacf5f13cdfa0dfda8e3feb868c6ce8bc) )
3681   ROM_LOAD( "frogger.609",  0x0800, 0x0800, CRC(7380a48f) SHA1(75582a94b696062cbdb66a4c5cf0bc0bb94f81ee) )
3682   ROM_LOAD( "frogger.610",  0x1000, 0x0800, CRC(31d7eb27) SHA1(2e1d34ae4da385fd7cac94707d25eeddf4604e1a) )
3683
3684   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3685   ROM_LOAD( "frogger.607",  0x0000, 0x0800, CRC(05f7d883) SHA1(78831fd287da18928651a8adb7e578d291493eff) )
3686   ROM_LOAD( "frogger.606",  0x0800, 0x0800, CRC(f524ee30) SHA1(dd768967add61467baa08d5929001f157d6cd911) )
3687
3688   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3689   ROM_LOAD( "pr-91.6l",     0x0000, 0x0020, CRC(413703bf) SHA1(66648b2b28d3dcbda5bdb2605d1977428939dd3c) )
3690ROM_END
3691
3692ROM_START( frogseg2 )
3693   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3694   ROM_LOAD( "frogger.ic5",  0x0000, 0x1000, CRC(efab0c79) SHA1(68c99b6cdcb9396bb473739a62ffc009b4bf57d5) )
3695   ROM_LOAD( "frogger.ic6",  0x1000, 0x1000, CRC(aeca9c13) SHA1(cdf560adbd7f2813e86e378da7781cccf7928a44) )
3696   ROM_LOAD( "frogger.ic7",  0x2000, 0x1000, CRC(dd251066) SHA1(4612e1fe1ab7182a277140b1a1976cc17e0746a5) )
3697   ROM_LOAD( "frogger.ic8",  0x3000, 0x1000, CRC(bf293a02) SHA1(be94e9f5caa74c3de6fd95bd20928f4a9c514227) )
3698
3699   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3700   ROM_LOAD( "frogger.608",  0x0000, 0x0800, CRC(e8ab0256) SHA1(f090afcfacf5f13cdfa0dfda8e3feb868c6ce8bc) )
3701   ROM_LOAD( "frogger.609",  0x0800, 0x0800, CRC(7380a48f) SHA1(75582a94b696062cbdb66a4c5cf0bc0bb94f81ee) )
3702   ROM_LOAD( "frogger.610",  0x1000, 0x0800, CRC(31d7eb27) SHA1(2e1d34ae4da385fd7cac94707d25eeddf4604e1a) )
3703
3704   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3705   ROM_LOAD( "frogger.607",  0x0000, 0x0800, CRC(05f7d883) SHA1(78831fd287da18928651a8adb7e578d291493eff) )
3706   ROM_LOAD( "frogger.606",  0x0800, 0x0800, CRC(f524ee30) SHA1(dd768967add61467baa08d5929001f157d6cd911) )
3707
3708   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3709   ROM_LOAD( "pr-91.6l",     0x0000, 0x0020, CRC(413703bf) SHA1(66648b2b28d3dcbda5bdb2605d1977428939dd3c) )
3710ROM_END
3711
3712ROM_START( froggrmc )
3713   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3714   ROM_LOAD( "epr-1031.15",  0x0000, 0x1000, CRC(4b7c8d11) SHA1(9200b33cac0ef5a6647c95ebd25237fa62fcdf30) )
3715   ROM_LOAD( "epr-1032.16",  0x1000, 0x1000, CRC(ac00b9d9) SHA1(6414d2aa2c0ccb8cb567ffde3acdb693cfd28dbb) )
3716   ROM_LOAD( "epr-1033.33",  0x2000, 0x1000, CRC(bc1d6fbc) SHA1(c9c040418f0bf7b7fce599592f806e7aaf448c3d) )
3717   ROM_LOAD( "epr-1034.34",  0x3000, 0x1000, CRC(9efe7399) SHA1(77355160169db256f45286e60ebf6a406527d346) )
3718
3719   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3720   ROM_LOAD( "epr-1082.42",  0x0000, 0x1000, CRC(802843c2) SHA1(059b26ddf1cdc8076d160b872f9d50b97af7f316) )
3721   ROM_LOAD( "epr-1035.43",  0x1000, 0x0800, CRC(14e74148) SHA1(0023394e971f191c41ff20b47835f1dafb924d15) )
3722
3723   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3724   ROM_LOAD( "frogger.607",  0x0000, 0x0800, CRC(05f7d883) SHA1(78831fd287da18928651a8adb7e578d291493eff) )
3725   ROM_LOAD( "epr-1036.1k",  0x0800, 0x0800, CRC(658745f8) SHA1(e4e5c3e011c8a7233a36d29e10e08905873500aa) )
3726
3727   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3728   ROM_LOAD( "pr-91.6l",     0x0000, 0x0020, CRC(413703bf) SHA1(66648b2b28d3dcbda5bdb2605d1977428939dd3c) )
3729ROM_END
3730
3731ROM_START( froggers )
3732   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3733   ROM_LOAD( "vid_d2.bin",   0x0000, 0x0800, CRC(c103066e) SHA1(8c2d4c825e9c4180fe70b0db18a547dc3ddc3c2c) )
3734   ROM_LOAD( "vid_e2.bin",   0x0800, 0x0800, CRC(f08bc094) SHA1(23ad1e57f244d6b63fd9640249dcb1eeafb8206e) )
3735   ROM_LOAD( "vid_f2.bin",   0x1000, 0x0800, CRC(637a2ff8) SHA1(e9b9fc692ca5d8deb9cd30d9d73ad25c8d8bafe1) )
3736   ROM_LOAD( "vid_h2.bin",   0x1800, 0x0800, CRC(04c027a5) SHA1(193550731513c02cad464661a1ceb230819ca70f) )
3737   ROM_LOAD( "vid_j2.bin",   0x2000, 0x0800, CRC(fbdfbe74) SHA1(48d5d1247d09eaea2a9a29f4ed6543d0411597aa) )
3738   ROM_LOAD( "vid_l2.bin",   0x2800, 0x0800, CRC(8a4389e1) SHA1(b2c74afb93927dac0d8bb24e02e0b2a069f2d3c8) )
3739
3740   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3741   ROM_LOAD( "frogger.608",  0x0000, 0x0800, CRC(e8ab0256) SHA1(f090afcfacf5f13cdfa0dfda8e3feb868c6ce8bc) )
3742   ROM_LOAD( "frogger.609",  0x0800, 0x0800, CRC(7380a48f) SHA1(75582a94b696062cbdb66a4c5cf0bc0bb94f81ee) )
3743   ROM_LOAD( "frogger.610",  0x1000, 0x0800, CRC(31d7eb27) SHA1(2e1d34ae4da385fd7cac94707d25eeddf4604e1a) )
3744
3745   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3746   ROM_LOAD( "frogger.607",  0x0000, 0x0800, CRC(05f7d883) SHA1(78831fd287da18928651a8adb7e578d291493eff) )
3747   ROM_LOAD( "epr-1036.1k",  0x0800, 0x0800, CRC(658745f8) SHA1(e4e5c3e011c8a7233a36d29e10e08905873500aa) )
3748
3749   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3750   ROM_LOAD( "pr-91.6l",     0x0000, 0x0020, CRC(413703bf) SHA1(66648b2b28d3dcbda5bdb2605d1977428939dd3c) )
3751ROM_END
3752
3753ROM_START( frogf )
3754   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3755   ROM_LOAD( "6.bin",        0x0000, 0x1000, CRC(8ff0a973) SHA1(adb1c28617d915fbcfa9190bd8589a56a8858e25) )
3756   ROM_LOAD( "7.bin",        0x1000, 0x1000, CRC(3087bb4b) SHA1(3fe1f68a2ad12b1cadba89d99afe574cf5342d81) )
3757   ROM_LOAD( "8.bin",        0x2000, 0x1000, CRC(c3869d12) SHA1(7bd95c12fc1fe1a3cfc0140b64cf76fa57aa3fb4) )
3758
3759   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3760   ROM_LOAD( "frogger.608",  0x0000, 0x0800, CRC(e8ab0256) SHA1(f090afcfacf5f13cdfa0dfda8e3feb868c6ce8bc) )
3761   ROM_LOAD( "frogger.609",  0x0800, 0x0800, CRC(7380a48f) SHA1(75582a94b696062cbdb66a4c5cf0bc0bb94f81ee) )
3762   ROM_LOAD( "frogger.610",  0x1000, 0x0800, CRC(31d7eb27) SHA1(2e1d34ae4da385fd7cac94707d25eeddf4604e1a) )
3763
3764   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3765   ROM_LOAD( "frogger.607",  0x0000, 0x0800, CRC(05f7d883) SHA1(78831fd287da18928651a8adb7e578d291493eff) )
3766   ROM_LOAD( "epr-1036.1k",  0x0800, 0x0800, CRC(658745f8) SHA1(e4e5c3e011c8a7233a36d29e10e08905873500aa) )
3767
3768   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3769   ROM_LOAD( "pr-91.6l",     0x0000, 0x0020, CRC(413703bf) SHA1(66648b2b28d3dcbda5bdb2605d1977428939dd3c) )
3770ROM_END
3771
3772ROM_START( frogg )
3773   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3774   ROM_LOAD( "p1.bin",       0x0000, 0x0800, CRC(1762b266) SHA1(2cf34dcfe00dc476b327f9d762a8d2aa268a2d25) )
3775   ROM_LOAD( "p2.bin",       0x0800, 0x0800, CRC(322f3916) SHA1(9236aaa260c4db4adbd92c8bba3674d07d7235a8) )
3776   ROM_LOAD( "p3.bin",       0x1000, 0x0800, CRC(28bd6151) SHA1(1a5bc540168fa5fef01bd7bc2cdbdb910c9a4ba4) )
3777   ROM_LOAD( "p4.bin",       0x1800, 0x0800, CRC(5a69ab18) SHA1(40b7bf200f87e0fb3fb54726ba79387889446052) )
3778   ROM_LOAD( "p5.bin",       0x2000, 0x0800, CRC(b4f17745) SHA1(2f237a667f6c95af213b787620142c1530d3cdd8) )
3779   ROM_LOAD( "p6.bin",       0x2800, 0x0800, CRC(34be71b5) SHA1(3088fc5817a397d0a87610d62845c7b8c4440f57) )
3780   ROM_LOAD( "p7.bin",       0x3000, 0x0800, CRC(de3edc8c) SHA1(634d54fb19b422b56576a196bdaf95733c52c7ee) )
3781
3782   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3783   ROM_LOAD( "k.bin",        0x0000, 0x0800, CRC(05f7d883) SHA1(78831fd287da18928651a8adb7e578d291493eff) )
3784   ROM_LOAD( "h.bin",        0x0800, 0x0800, CRC(658745f8) SHA1(e4e5c3e011c8a7233a36d29e10e08905873500aa) )
3785
3786   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3787   ROM_LOAD( "pr-91.6l",     0x0000, 0x0020, CRC(413703bf) SHA1(66648b2b28d3dcbda5bdb2605d1977428939dd3c) )
3788ROM_END
3789
3790
3791ROM_START( turtles )
3792   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3793   ROM_LOAD( "turt_vid.2c",  0x0000, 0x1000, CRC(ec5e61fb) SHA1(3ca89800fda7a7e61f54d71d5302908be2706def) )
3794   ROM_LOAD( "turt_vid.2e",  0x1000, 0x1000, CRC(fd10821e) SHA1(af74602bf2454eb8f3b9bb5c425e2476feeecd69) )
3795   ROM_LOAD( "turt_vid.2f",  0x2000, 0x1000, CRC(ddcfc5fa) SHA1(2af9383e5a289c2d7fbe6cf5e5b1519c352afbab) )
3796   ROM_LOAD( "turt_vid.2h",  0x3000, 0x1000, CRC(9e71696c) SHA1(3dcdf5dc601c875fc9d8b9a46e3ef588e7478e0d) )
3797   ROM_LOAD( "turt_vid.2j",  0x4000, 0x1000, CRC(fcd49fef) SHA1(bb1e91b2e6d4b5a861bf37907ef6b198328d8d83) )
3798
3799   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3800   ROM_LOAD( "turt_snd.5c",  0x0000, 0x1000, CRC(f0c30f9a) SHA1(5621f336e9be8acf986a34bbb8855ed5d45c28ef) )
3801   ROM_LOAD( "turt_snd.5d",  0x1000, 0x1000, CRC(af5fc43c) SHA1(8a49c55feba094b07380615cf0b6f0878c25a260) )
3802
3803   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3804   ROM_LOAD( "turt_vid.5h",  0x0000, 0x0800, CRC(e5999d52) SHA1(bc3f52cf6c6e19dfd2dacd1e8c9128f437e995fc) )
3805   ROM_LOAD( "turt_vid.5f",  0x0800, 0x0800, CRC(c3ffd655) SHA1(dee51d77be262a2944488e381541c10a2b6e5d83) )
3806
3807   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3808   ROM_LOAD( "turtles.clr",  0x0000, 0x0020, CRC(f3ef02dd) SHA1(09fd795170d7d30f101d579f57553da5ff3800ab) )
3809ROM_END
3810
3811ROM_START( turpin )
3812   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3813   ROM_LOAD( "m1",           0x0000, 0x1000, CRC(89177473) SHA1(0717b1e7308ffe527edfc578ec4353809e7d9eea) )
3814   ROM_LOAD( "m2",           0x1000, 0x1000, CRC(4c6ca5c6) SHA1(dd4ca7adaa523a8e775cdfaa99bb3cc25da32c08) )
3815   ROM_LOAD( "m3",           0x2000, 0x1000, CRC(62291652) SHA1(82965d3e9608afde4ff06cba1d7a4b11cd904c11) )
3816   ROM_LOAD( "turt_vid.2h",  0x3000, 0x1000, CRC(9e71696c) SHA1(3dcdf5dc601c875fc9d8b9a46e3ef588e7478e0d) )
3817   ROM_LOAD( "m5",           0x4000, 0x1000, CRC(7d2600f2) SHA1(1a9bdf63b50419c6e0d9c401c3dcf29d5b459fa6) )
3818
3819   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3820   ROM_LOAD( "turt_snd.5c",  0x0000, 0x1000, CRC(f0c30f9a) SHA1(5621f336e9be8acf986a34bbb8855ed5d45c28ef) )
3821   ROM_LOAD( "turt_snd.5d",  0x1000, 0x1000, CRC(af5fc43c) SHA1(8a49c55feba094b07380615cf0b6f0878c25a260) )
3822
3823   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3824   ROM_LOAD( "turt_vid.5h",  0x0000, 0x0800, CRC(e5999d52) SHA1(bc3f52cf6c6e19dfd2dacd1e8c9128f437e995fc) )
3825   ROM_LOAD( "turt_vid.5f",  0x0800, 0x0800, CRC(c3ffd655) SHA1(dee51d77be262a2944488e381541c10a2b6e5d83) )
3826
3827   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3828   ROM_LOAD( "turtles.clr",  0x0000, 0x0020, CRC(f3ef02dd) SHA1(09fd795170d7d30f101d579f57553da5ff3800ab) )
3829ROM_END
3830
3831ROM_START( 600 )
3832   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3833   ROM_LOAD( "600_vid.2c",   0x0000, 0x1000, CRC(8ee090ae) SHA1(3d491313da6cccd6dbc15774569be0555fe2f73a) )
3834   ROM_LOAD( "600_vid.2e",   0x1000, 0x1000, CRC(45bfaff2) SHA1(ba4f7aa499f4993ec2191b8832b5604fd41964bc) )
3835   ROM_LOAD( "600_vid.2f",   0x2000, 0x1000, CRC(9f4c8ed7) SHA1(2564dae82019097227351a7ddc9c5156ca00297a) )
3836   ROM_LOAD( "600_vid.2h",   0x3000, 0x1000, CRC(a92ef056) SHA1(c319d41a3345b84670fe9110f78332c1cfe1e163) )
3837   ROM_LOAD( "600_vid.2j",   0x4000, 0x1000, CRC(6dadd72d) SHA1(5602b5ebb2c287f72a5ce873b4e3dfd19b8412a0) )
3838
3839   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3840   ROM_LOAD( "600_snd.5c",   0x0000, 0x1000, CRC(1773c68e) SHA1(cc4aa3a98e85bc6300f8c1ee1a0448071d7c6dfa) )
3841   ROM_LOAD( "600_snd.5d",   0x1000, 0x1000, CRC(a311b998) SHA1(39af321b8c3f211ed6d083a2aba4fbc8af11c9e8) )
3842
3843   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3844   ROM_LOAD( "600_vid.5h",   0x0000, 0x0800, CRC(006c3d56) SHA1(0c773e0e84d0bf45be5a5a7cfff960c1ca2f0320) )
3845   ROM_LOAD( "600_vid.5f",   0x0800, 0x0800, CRC(7dbc0426) SHA1(29eeb3cdb5a3bcf7115d8099e4d04cf76216b003) )
3846
3847   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3848   ROM_LOAD( "turtles.clr",  0x0000, 0x0020, CRC(f3ef02dd) SHA1(09fd795170d7d30f101d579f57553da5ff3800ab) )
3849ROM_END
3850
3851
3852ROM_START( amidar )
3853   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3854   ROM_LOAD( "amidar.2c",    0x0000, 0x1000, CRC(c294bf27) SHA1(399325bf1559e8cdbddf7cfbf0dc739f9ed72ef0) )
3855   ROM_LOAD( "amidar.2e",    0x1000, 0x1000, CRC(e6e96826) SHA1(e9c4f8c594640424b456505e676352a98b758c03) )
3856   ROM_LOAD( "amidar.2f",    0x2000, 0x1000, CRC(3656be6f) SHA1(9d652f66bedcf17a6453c0e0ead30bfd7ea0bd0a) )
3857   ROM_LOAD( "amidar.2h",    0x3000, 0x1000, CRC(1be170bd) SHA1(c047bc393b297c0d47668a5f6f4870e3fac937ef) )
3858
3859   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3860   ROM_LOAD( "amidar.5c",    0x0000, 0x1000, CRC(c4b66ae4) SHA1(9d09dbde4019f7be3abe0815b0e06d542c01c255) )
3861   ROM_LOAD( "amidar.5d",    0x1000, 0x1000, CRC(806785af) SHA1(c8c85e3a6a204feccd7859b4527bd649e96134b4) )
3862
3863   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3864   ROM_LOAD( "amidar.5f",    0x0000, 0x0800, CRC(5e51e84d) SHA1(dfe84db7e2b1a45a1d484fcf37291f536bc5324c) )
3865   ROM_LOAD( "amidar.5h",    0x0800, 0x0800, CRC(2f7f1c30) SHA1(83c330eca20dfcc6a4099001943b9ed7a7c3db5b) )
3866
3867   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3868   ROM_LOAD( "amidar.clr",   0x0000, 0x0020, CRC(f940dcc3) SHA1(1015e56f37c244a850a8f4bf0e36668f047fd46d) )
3869ROM_END
3870
3871ROM_START( amidaru )
3872   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3873   ROM_LOAD( "amidarus.2c",  0x0000, 0x1000, CRC(951e0792) SHA1(3a68b829c9ffb465bd6582c9ea566e0e947c6c19) )
3874   ROM_LOAD( "amidarus.2e",  0x1000, 0x1000, CRC(a1a3a136) SHA1(330ec857fdf4c1b28e2560a5f63a2432f87f9b2f) )
3875   ROM_LOAD( "amidarus.2f",  0x2000, 0x1000, CRC(a5121bf5) SHA1(fe15b91724758ede43dd332327919f164772c592) )
3876   ROM_LOAD( "amidarus.2h",  0x3000, 0x1000, CRC(051d1c7f) SHA1(3cfa0f728a5c27da0a3fe2579ad226129ccde232) )
3877   ROM_LOAD( "amidarus.2j",  0x4000, 0x1000, CRC(351f00d5) SHA1(6659357f40f888b21be00826246200fd3a8a88ce) )
3878
3879   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3880   ROM_LOAD( "amidarus.5c",  0x0000, 0x1000, CRC(8ca7b750) SHA1(4f4c2915503b85abe141d717fd254ee10c9da99e) )
3881   ROM_LOAD( "amidarus.5d",  0x1000, 0x1000, CRC(9b5bdc0a) SHA1(84d953618c8bf510d23b42232a856ac55f1baff5) )
3882
3883   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3884   ROM_LOAD( "amidarus.5f",  0x0000, 0x0800, CRC(2cfe5ede) SHA1(0d86a78008ac8653c17fff5be5ebdf1f0a9d31eb) )
3885   ROM_LOAD( "amidarus.5h",  0x0800, 0x0800, CRC(57c4fd0d) SHA1(8764deec9fbff4220d61df621b12fc36c3702601) )
3886
3887   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3888   ROM_LOAD( "amidar.clr",   0x0000, 0x0020, CRC(f940dcc3) SHA1(1015e56f37c244a850a8f4bf0e36668f047fd46d) )
3889ROM_END
3890
3891ROM_START( amidaro )
3892   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3893   ROM_LOAD( "107.2cd",      0x0000, 0x1000, CRC(c52536be) SHA1(3f64578214d2d9f0e4e7ee87e09b0aac33a73098) )
3894   ROM_LOAD( "108.2fg",      0x1000, 0x1000, CRC(38538b98) SHA1(12b2a0c09926d006781bee5d450bc0c391cc1fb5) )
3895   ROM_LOAD( "109.2fg",      0x2000, 0x1000, CRC(69907f0f) SHA1(f1d19a76ffc41ee8c5c574f10108cfdfe525b732) )
3896   ROM_LOAD( "110.2h",       0x3000, 0x1000, CRC(ba149a93) SHA1(9ef1d27f0780612be0ea2be94c3a2c781a4924c8) )
3897   ROM_LOAD( "111.2j",       0x4000, 0x1000, CRC(20d01c2e) SHA1(e09437ff440f04036d5ec74b355e97bbbbfefb95) )
3898
3899   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3900   ROM_LOAD( "amidarus.5c",  0x0000, 0x1000, CRC(8ca7b750) SHA1(4f4c2915503b85abe141d717fd254ee10c9da99e) )
3901   ROM_LOAD( "amidarus.5d",  0x1000, 0x1000, CRC(9b5bdc0a) SHA1(84d953618c8bf510d23b42232a856ac55f1baff5) )
3902
3903   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3904   ROM_LOAD( "amidarus.5f",  0x0000, 0x0800, CRC(2cfe5ede) SHA1(0d86a78008ac8653c17fff5be5ebdf1f0a9d31eb) )
3905   ROM_LOAD( "113.5h",       0x0800, 0x0800, CRC(bcdce168) SHA1(e593d03c460ef4607e3ba25019d9f01d4a717dd9) )  /* The letter 'S' is slightly different */
3906
3907   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3908   ROM_LOAD( "amidar.clr",   0x0000, 0x0020, CRC(f940dcc3) SHA1(1015e56f37c244a850a8f4bf0e36668f047fd46d) )
3909ROM_END
3910
3911ROM_START( amidarb )
3912   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3913   ROM_LOAD( "ami2gor.2c", 0x0000, 0x1000, CRC(9ad2dcd2) SHA1(43ceb93d891c1ebf55e7c26de13e3db8e1d26f6d) )
3914   ROM_LOAD( "2.2f",       0x1000, 0x1000, CRC(66282ff5) SHA1(986778278eb339768d190460680e7aa698812488) )
3915   ROM_LOAD( "3.2j",       0x2000, 0x1000, CRC(b0860e31) SHA1(8fb92b0e71c826a509a8f712553de0f4a636286f) )
3916   ROM_LOAD( "4.2m",       0x3000, 0x1000, CRC(4a4086c9) SHA1(6f309b67dc68e06e6eb1d3ee2ae75afe253a4ce3) )
3917
3918   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3919   ROM_LOAD( "8.11d",      0x0000, 0x1000, CRC(8ca7b750) SHA1(4f4c2915503b85abe141d717fd254ee10c9da99e) )
3920   ROM_LOAD( "9.9d",       0x1000, 0x1000, CRC(9b5bdc0a) SHA1(84d953618c8bf510d23b42232a856ac55f1baff5) )
3921
3922   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3923   ROM_LOAD( "5.5f",      0x0000, 0x0800, CRC(2082ad0a) SHA1(c6014d9575e92adf09b0961c2158a779ebe940c4) )
3924   ROM_LOAD( "6.5h",      0x0800, 0x0800, CRC(3029f94f) SHA1(3b432b42e79f8b0a7d65e197f373a04e3c92ff20) )
3925
3926   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3927   ROM_LOAD( "n82s123n.6e",   0x0000, 0x0020, CRC(01004d3f) SHA1(e53cbc54ea96e846481a67bbcccf6b1726e70f9c) )
3928ROM_END
3929
3930ROM_START( amigo )
3931   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3932   ROM_LOAD( "2732.a1",      0x0000, 0x1000, CRC(930dc856) SHA1(7022f1f26830baccdc8b8f0b10fb1d1ccb080f22) )
3933   ROM_LOAD( "2732.a2",      0x1000, 0x1000, CRC(66282ff5) SHA1(986778278eb339768d190460680e7aa698812488) )
3934   ROM_LOAD( "2732.a3",      0x2000, 0x1000, CRC(e9d3dc76) SHA1(627c6068c65985175388aec43ac2a4248b004c97) )
3935   ROM_LOAD( "2732.a4",      0x3000, 0x1000, CRC(4a4086c9) SHA1(6f309b67dc68e06e6eb1d3ee2ae75afe253a4ce3) )
3936
3937   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3938   ROM_LOAD( "amidarus.5c",  0x0000, 0x1000, CRC(8ca7b750) SHA1(4f4c2915503b85abe141d717fd254ee10c9da99e) )
3939   ROM_LOAD( "amidarus.5d",  0x1000, 0x1000, CRC(9b5bdc0a) SHA1(84d953618c8bf510d23b42232a856ac55f1baff5) )
3940
3941   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3942   ROM_LOAD( "2716.a6",      0x0000, 0x0800, CRC(2082ad0a) SHA1(c6014d9575e92adf09b0961c2158a779ebe940c4) )
3943   ROM_LOAD( "2716.a5",      0x0800, 0x0800, CRC(3029f94f) SHA1(3b432b42e79f8b0a7d65e197f373a04e3c92ff20) )
3944
3945   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3946   ROM_LOAD( "amidar.clr",   0x0000, 0x0020, CRC(f940dcc3) SHA1(1015e56f37c244a850a8f4bf0e36668f047fd46d) )
3947ROM_END
3948
3949ROM_START( amidars )
3950   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3951   ROM_LOAD( "am2d",         0x0000, 0x0800, CRC(24b79547) SHA1(eca735c6a35561a9a6ba8a20dca1e1c78ed073fc) )
3952   ROM_LOAD( "am2e",         0x0800, 0x0800, CRC(4c64161e) SHA1(5b2e49ff915295617671b13f15b566046a5dbc15) )
3953   ROM_LOAD( "am2f",         0x1000, 0x0800, CRC(b3987a72) SHA1(1d72e9ae3005029628c6f9beb6ca65afcb1f7893) )
3954   ROM_LOAD( "am2h",         0x1800, 0x0800, CRC(29873461) SHA1(7d0ee9a82f02163b4cc6a7097e88ae34e96ebf58) )
3955   ROM_LOAD( "am2j",         0x2000, 0x0800, CRC(0fdd54d8) SHA1(c32fdc8e292d91159e6c80c7033abea6404a4f2c) )
3956   ROM_LOAD( "am2l",         0x2800, 0x0800, CRC(5382f7ed) SHA1(425ec2c2caf404fc8ab13ee38d6567413022e1a1) )
3957   ROM_LOAD( "am2m",         0x3000, 0x0800, CRC(1d7109e9) SHA1(e0d24475547bbe5a94b45be6abefb84ad84d2534) )
3958   ROM_LOAD( "am2p",         0x3800, 0x0800, CRC(c9163ac6) SHA1(46d757180426b71c827d14a35824a248f2c787b6) )
3959
3960   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3961   ROM_LOAD( "amidarus.5c",  0x0000, 0x1000, CRC(8ca7b750) SHA1(4f4c2915503b85abe141d717fd254ee10c9da99e) )
3962   ROM_LOAD( "amidarus.5d",  0x1000, 0x1000, CRC(9b5bdc0a) SHA1(84d953618c8bf510d23b42232a856ac55f1baff5) )
3963
3964   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3965   ROM_LOAD( "2716.a6",      0x0000, 0x0800, CRC(2082ad0a) SHA1(c6014d9575e92adf09b0961c2158a779ebe940c4) )   /* Same graphics ROMs as Amigo */
3966   ROM_LOAD( "2716.a5",      0x0800, 0x0800, CRC(3029f94f) SHA1(3b432b42e79f8b0a7d65e197f373a04e3c92ff20) )
3967
3968   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3969   ROM_LOAD( "amidar.clr",   0x0000, 0x0020, CRC(f940dcc3) SHA1(1015e56f37c244a850a8f4bf0e36668f047fd46d) )
3970ROM_END
3971
3972
3973ROM_START( theend )
3974   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3975   ROM_LOAD( "ic13_1t.bin",  0x0000, 0x0800, CRC(93e555ba) SHA1(f684927cecabfbd7544f7549a6152c0a6a436019) )
3976   ROM_LOAD( "ic14_2t.bin",  0x0800, 0x0800, CRC(2de7ad27) SHA1(caf369fde632652a0a5fb11d3605f0d2386d297a) )
3977   ROM_LOAD( "ic15_3t.bin",  0x1000, 0x0800, CRC(035f750b) SHA1(5f70518e5dbfca0ba12ba4dc4f357ce8e6b27bc8) )
3978   ROM_LOAD( "ic16_4t.bin",  0x1800, 0x0800, CRC(61286b5c) SHA1(14464aa5284aecc9c6046e464ab3d13da89d8dda) )
3979   ROM_LOAD( "ic17_5t.bin",  0x2000, 0x0800, CRC(434a8f68) SHA1(3c8c099c7865997d475c096f1b1c93d88ab21543) )
3980   ROM_LOAD( "ic18_6t.bin",  0x2800, 0x0800, CRC(dc4cc786) SHA1(3311361a1eb29715aa41d61fbb3563014bd9eeb1) )
3981
3982   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3983   ROM_LOAD( "ic56_1.bin",   0x0000, 0x0800, CRC(7a141f29) SHA1(ca483943971c8fc7f5775a8a7cc6ddd331d48170) )
3984   ROM_LOAD( "ic55_2.bin",   0x0800, 0x0800, CRC(218497c1) SHA1(3e080621f2e83909a6f304a2d960a080bccbbdc2) )
3985
3986   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
3987   ROM_LOAD( "ic30_2c.bin",  0x0000, 0x0800, CRC(68ccf7bf) SHA1(a8ea784a2660f855757ae0b30cb2a33ab6f2cd59) )
3988   ROM_LOAD( "ic31_1c.bin",  0x0800, 0x0800, CRC(4a48c999) SHA1(f1abcbfc3146a18dc3ff865e3ba278377a42a875) )
3989
3990   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3991   ROM_LOAD( "6331-1j.86",   0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) )
3992ROM_END
3993
3994ROM_START( theends )
3995   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3996   ROM_LOAD( "ic13",         0x0000, 0x0800, CRC(90e5ab14) SHA1(b926801ab1cc1e2787a76ced6c7cffd6fce753d4) )
3997   ROM_LOAD( "ic14",         0x0800, 0x0800, CRC(950f0a07) SHA1(bde9f3c6cf060dc6f5b7652287b94e04bed7bcf7) )
3998   ROM_LOAD( "ic15",         0x1000, 0x0800, CRC(6786bcf5) SHA1(7556d3dc51d6a112b6357b8a36df05fd1a4d1cc9) )
3999   ROM_LOAD( "ic16",         0x1800, 0x0800, CRC(380a0017) SHA1(3354eb328a32537f722fe8a0949ddcab6cf21eb8) )
4000   ROM_LOAD( "ic17",         0x2000, 0x0800, CRC(af067b7f) SHA1(855c6ddf29fbfea004c7143fe29064abf53801ad) )
4001   ROM_LOAD( "ic18",         0x2800, 0x0800, CRC(a0411b93) SHA1(d644968758a1b73d13e09b24d24bfec82276e8f4) )
4002
4003   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4004   ROM_LOAD( "ic56",         0x0000, 0x0800, CRC(3b2c2f70) SHA1(bcccdacacfc9a3b5f1412dfba6bb0046d283bccc) )
4005   ROM_LOAD( "ic55",         0x0800, 0x0800, CRC(e0429e50) SHA1(27678fc3172cbca3ae1eae96e9d8a62561d5ce40) )
4006
4007   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
4008   ROM_LOAD( "ic30",         0x0000, 0x0800, CRC(527fd384) SHA1(92a384899d5acd2c689f637da16a0e2d11a9d9c6) )
4009   ROM_LOAD( "ic31",         0x0800, 0x0800, CRC(af6d09b6) SHA1(f3ad51dc88aa58fd39195ead978b039e0b0b585c) )
4010
4011   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4012   ROM_LOAD( "6331-1j.86",   0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) )
4013ROM_END
4014
4015
4016ROM_START( scramble )
4017   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4018   ROM_LOAD( "s1.2d",         0x0000, 0x0800, CRC(ea35ccaa) SHA1(1dcb375987fe21e0483c27d485c405de53848d61) )
4019   ROM_LOAD( "s2.2e",         0x0800, 0x0800, CRC(e7bba1b3) SHA1(240877576045fddcc9ff01d97dc78139454ac4f1) )
4020   ROM_LOAD( "s3.2f",         0x1000, 0x0800, CRC(12d7fc3e) SHA1(a84d191c7be8700f630a83ddad798be9e83b5d55) )
4021   ROM_LOAD( "s4.2h",         0x1800, 0x0800, CRC(b59360eb) SHA1(5d155808c19dcf2e14aa8e29c0ee41a6d3d3c43a) )
4022   ROM_LOAD( "s5.2j",         0x2000, 0x0800, CRC(4919a91c) SHA1(9cb5861c61e4783e5fbaa3869d51195f127b1129) )
4023   ROM_LOAD( "s6.2l",         0x2800, 0x0800, CRC(26a4547b) SHA1(67c0fa81729370631647b5d78bb5a61433facd7f) )
4024   ROM_LOAD( "s7.2m",         0x3000, 0x0800, CRC(0bb49470) SHA1(05a6fe3010c2136284ca76352dac147797c79778) )
4025   ROM_LOAD( "s8.2p",         0x3800, 0x0800, CRC(6a5740e5) SHA1(e3b09141cee26857d626412e9d1a0e759469b97a) )
4026
4027   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4028   ROM_LOAD( "ot1.5c",           0x0000, 0x0800, CRC(bcd297f0) SHA1(8ed78487d76fd0a917ab7b258937a46e2cd9800c) )
4029   ROM_LOAD( "ot2.5d",           0x0800, 0x0800, CRC(de7912da) SHA1(8558b4eff5d7e63029b325edef9914feda5834c3) )
4030   ROM_LOAD( "ot3.5e",           0x1000, 0x0800, CRC(ba2fa933) SHA1(1f976d8595706730e29f93027e7ab4620075c078) )
4031
4032   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
4033   ROM_LOAD( "c2.5f",         0x0000, 0x0800, CRC(4708845b) SHA1(a8b1ad19a95a9d35050a2ab7194cc96fc5afcdc9) )
4034   ROM_LOAD( "c1.5h",         0x0800, 0x0800, CRC(11fd2887) SHA1(69844e48bb4d372cac7ae83c953df573c7ecbb7f) )
4035
4036   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4037   ROM_LOAD( "c01s.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
4038ROM_END
4039
4040ROM_START( scrambls )
4041   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4042   ROM_LOAD( "2d",           0x0000, 0x0800, CRC(b89207a1) SHA1(5422df979e82bcc73df49f50515fe76c126c037b) )
4043   ROM_LOAD( "2e",           0x0800, 0x0800, CRC(e9b4b9eb) SHA1(a8ee9ddfadf5e9accedfaf81da757a88a2e55a0a) )
4044   ROM_LOAD( "2f",           0x1000, 0x0800, CRC(a1f14f4c) SHA1(3eae2b3e4596505a8afb5c5cfb108e823c2c4319) )
4045   ROM_LOAD( "2h",           0x1800, 0x0800, CRC(591bc0d9) SHA1(170f9e92f0a3bee04407be27210b4fa825367688) )
4046   ROM_LOAD( "2j",           0x2000, 0x0800, CRC(22f11b6b) SHA1(e426ef6a7444a39a34d59799973b07d11b89f372) )
4047   ROM_LOAD( "2l",           0x2800, 0x0800, CRC(705ffe49) SHA1(174df3f281068c767344f751daace646360e26d6) )
4048   ROM_LOAD( "2m",           0x3000, 0x0800, CRC(ea26c35c) SHA1(a2f3380982d93a022f46756f974fd16c4cd617de) )
4049   ROM_LOAD( "2p",           0x3800, 0x0800, CRC(94d8f5e3) SHA1(f3a9c4d1d91836476fcad87ea0d243dde7171e0a) )
4050
4051   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4052   ROM_LOAD( "ot1.5c",           0x0000, 0x0800, CRC(bcd297f0) SHA1(8ed78487d76fd0a917ab7b258937a46e2cd9800c) )
4053   ROM_LOAD( "ot2.5d",           0x0800, 0x0800, CRC(de7912da) SHA1(8558b4eff5d7e63029b325edef9914feda5834c3) )
4054   ROM_LOAD( "ot3.5e",           0x1000, 0x0800, CRC(ba2fa933) SHA1(1f976d8595706730e29f93027e7ab4620075c078) )
4055
4056   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
4057   ROM_LOAD( "5f",           0x0000, 0x0800, CRC(5f30311a) SHA1(d64134089bebd995b3a1a089411e180c8c29f32d) )
4058   ROM_LOAD( "5h",           0x0800, 0x0800, CRC(516e029e) SHA1(81b44eb1ce43cebde87f0a41ade2e7eb291af78d) )
4059
4060   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4061   ROM_LOAD( "c01s.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
4062ROM_END
4063
4064ROM_START( strfbomb )
4065   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4066   ROM_LOAD( "1.2c",         0x0000, 0x0800, CRC(b102aaa0) SHA1(00560da7a2ded6afcdc1d46e12cc3c795654639a) )
4067   ROM_LOAD( "2.2e",         0x0800, 0x0800, CRC(d4155703) SHA1(defd37df55536890456c29812340e0d6b4292b78) )
4068   ROM_LOAD( "3.2f",         0x1000, 0x0800, CRC(a9568c89) SHA1(0d8e6b3af92e4933814700d54acfd43407f3ede1) )
4069   ROM_LOAD( "4.2h",         0x1800, 0x0800, CRC(663b6c35) SHA1(354fb2e92f4376b20aee412ed361d59b8a2c01e1) )
4070   ROM_LOAD( "5.2j",         0x2000, 0x0800, CRC(4919a91c) SHA1(9cb5861c61e4783e5fbaa3869d51195f127b1129) )
4071   ROM_LOAD( "6.2l",         0x2800, 0x0800, CRC(4ec66ae3) SHA1(a74827e161212e9b2eddd980321507a377f1e30b) )
4072   ROM_LOAD( "7.2m",         0x3000, 0x0800, CRC(0feb0192) SHA1(45a44bde3bf1483abf95fe1d1d5066bfcb1736df) )
4073   ROM_LOAD( "8.2p",         0x3800, 0x0800, CRC(280a6142) SHA1(f17625b91eaaffa36a433be32e4e80651d94b3b9) )
4074
4075   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4076   ROM_LOAD( "ot1.5c",           0x0000, 0x0800, CRC(bcd297f0) SHA1(8ed78487d76fd0a917ab7b258937a46e2cd9800c) )
4077   ROM_LOAD( "ot2.5d",           0x0800, 0x0800, CRC(de7912da) SHA1(8558b4eff5d7e63029b325edef9914feda5834c3) )
4078   ROM_LOAD( "ot3.5e",           0x1000, 0x0800, CRC(ba2fa933) SHA1(1f976d8595706730e29f93027e7ab4620075c078) )
4079
4080   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
4081   ROM_LOAD( "9.5f",         0x0000, 0x0800, CRC(3abeff25) SHA1(ff6de0596c849ec877fb759c1ab9c7a8ffe2edac) )
4082   ROM_LOAD( "10.5h",        0x0800, 0x0800, CRC(79ecacbe) SHA1(285cb3ee0ff8d596877bb571ea8479566ab36eb9) )
4083
4084   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4085   ROM_LOAD( "c01s.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
4086ROM_END
4087
4088ROM_START( explorer )
4089   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4090   ROM_LOAD( "10l.bin",      0x0000, 0x1000, CRC(d5adf626) SHA1(f362322f780c13cee73697f9158a8ca8aa943a2e) )
4091   ROM_LOAD( "9l.bin",       0x1000, 0x1000, CRC(48e32788) SHA1(7a98848d2ed8ba5b2da28c014226109af7cc9287) )
4092   ROM_LOAD( "8l.bin",       0x2000, 0x1000, CRC(c0dbdbde) SHA1(eac7444246bdf80f97962031bf900ce09b28c8b5) )
4093   ROM_LOAD( "7l.bin",       0x3000, 0x1000, CRC(9b30d227) SHA1(22764e0a2a5ce7abe862e42c84abaaf25949575f) )
4094
4095   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4096   ROM_LOAD( "3f.bin",        0x0000, 0x1000, CRC(9faf18cf) SHA1(1b6c65472d639753cc39031750f85efe1d31ae5e) )
4097   ROM_LOAD( "4b.bin",       0x1000, 0x0800, CRC(e910b5c3) SHA1(228e8d36dd1ac8a00a396df74b80aa6616997028) )
4098
4099   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
4100   ROM_LOAD( "c2.5f",         0x0000, 0x0800, CRC(4708845b) SHA1(a8b1ad19a95a9d35050a2ab7194cc96fc5afcdc9) )
4101   ROM_LOAD( "c1.5h",         0x0800, 0x0800, CRC(11fd2887) SHA1(69844e48bb4d372cac7ae83c953df573c7ecbb7f) )
4102
4103   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4104   ROM_LOAD( "c01s.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
4105ROM_END
4106
4107
4108ROM_START( atlantis )
4109   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4110   ROM_LOAD( "2c",           0x0000, 0x0800, CRC(0e485b9a) SHA1(976f1d6f4552fbee134359a776b5688588824cbb) )
4111   ROM_LOAD( "2e",           0x0800, 0x0800, CRC(c1640513) SHA1(a0dfb34f401330b16e9e4d66ec4b49d120499606) )
4112   ROM_LOAD( "2f",           0x1000, 0x0800, CRC(eec265ee) SHA1(29b6cf6b93220414eb58cddeba591dc8813c4935) )
4113   ROM_LOAD( "2h",           0x1800, 0x0800, CRC(a5d2e442) SHA1(e535d1a501ebd861ad62da70b87215fb7c23de1d) )
4114   ROM_LOAD( "2j",           0x2000, 0x0800, CRC(45f7cf34) SHA1(d1e0e0be6dec377b684625bdfdc5a3a8af847492) )
4115   ROM_LOAD( "2l",           0x2800, 0x0800, CRC(f335b96b) SHA1(17daa6d9bc916081f3c6cbdfe5b4960177dc7c9b) )
4116
4117   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4118   ROM_LOAD( "ot1.5c",           0x0000, 0x0800, CRC(bcd297f0) SHA1(8ed78487d76fd0a917ab7b258937a46e2cd9800c) )
4119   ROM_LOAD( "ot2.5d",           0x0800, 0x0800, CRC(de7912da) SHA1(8558b4eff5d7e63029b325edef9914feda5834c3) )
4120   ROM_LOAD( "ot3.5e",           0x1000, 0x0800, CRC(ba2fa933) SHA1(1f976d8595706730e29f93027e7ab4620075c078) )
4121
4122   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
4123   ROM_LOAD( "5f",           0x0000, 0x0800, CRC(57f9c6b9) SHA1(ad0d09a6611998d093d676a9c9fe9e32b10f643e) )
4124   ROM_LOAD( "5h",           0x0800, 0x0800, CRC(e989f325) SHA1(947aee915779687deae040aeef9e9aee680aaebf) )
4125
4126   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4127   ROM_LOAD( "c01s.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
4128ROM_END
4129
4130ROM_START( atlants2 )
4131   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4132   ROM_LOAD( "rom1",         0x0000, 0x0800, CRC(ad348089) SHA1(3548b94192c451c0126e7aaecefa7137ae074cd3) )
4133   ROM_LOAD( "rom2",         0x0800, 0x0800, CRC(caa705d1) SHA1(b4aefbea21fa9608e1dae2a09ae0d31270eb8c78) )
4134   ROM_LOAD( "rom3",         0x1000, 0x0800, CRC(e420641d) SHA1(103e7590f5acbac6991d665495f933c3a68da1c8) )
4135   ROM_LOAD( "rom4",         0x1800, 0x0800, CRC(04792d90) SHA1(cb477e4b8e4538def01c10b0348f8f8e3a2a9500) )
4136   ROM_LOAD( "2j",           0x2000, 0x0800, CRC(45f7cf34) SHA1(d1e0e0be6dec377b684625bdfdc5a3a8af847492) )
4137   ROM_LOAD( "rom6",         0x2800, 0x0800, CRC(b297bd4b) SHA1(0c48da41d9cf2a3456df5b1e8bf27fa641bc643b) )
4138   ROM_LOAD( "rom7",         0x3000, 0x0800, CRC(a50bf8d5) SHA1(5bca98e1c0838d27ec66bf4b906877977b212b6d) )
4139   ROM_LOAD( "rom8",         0x3800, 0x0800, CRC(d2c5c984) SHA1(a9432f9aff8a2f5ca1d347443efc008a177d8ae0) )
4140
4141   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4142   ROM_LOAD( "ot1.5c",           0x0000, 0x0800, CRC(bcd297f0) SHA1(8ed78487d76fd0a917ab7b258937a46e2cd9800c) )
4143   ROM_LOAD( "ot2.5d",           0x0800, 0x0800, CRC(de7912da) SHA1(8558b4eff5d7e63029b325edef9914feda5834c3) )
4144   ROM_LOAD( "ot3.5e",           0x1000, 0x0800, CRC(ba2fa933) SHA1(1f976d8595706730e29f93027e7ab4620075c078) )
4145
4146   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
4147   ROM_LOAD( "rom9",         0x0000, 0x0800, CRC(55cd5acd) SHA1(b3e2ce71d4e48255d44cd451ee015a7234a108c8) )
4148   ROM_LOAD( "rom10",        0x0800, 0x0800, CRC(72e773b8) SHA1(6ce178df3bd6a4177c68761572a13a56d222c48f) )
4149
4150   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4151   ROM_LOAD( "c01s.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
4152ROM_END
4153
4154
4155ROM_START( scorpion )
4156   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4157   ROM_LOAD( "1.2d",         0x0000, 0x1000, CRC(ba1219b4) SHA1(33c7843dba44152a8bc3223ea0c30b13609b80ba) )
4158   ROM_LOAD( "2.2f",         0x1000, 0x1000, CRC(c3909ab6) SHA1(0bec902ae4291fa0530f4c89ad45cc7aab888b7a) )
4159   ROM_LOAD( "3.2g",         0x2000, 0x1000, CRC(43261352) SHA1(49468cbed7e0286b260eef297bd5fad0ab9fd45b) )
4160   ROM_LOAD( "4.2h",         0x3000, 0x1000, CRC(aba2276a) SHA1(42b0378f06d2bdb4faaaa95274a6c0f965716877) )
4161   ROM_LOAD( "5.2k",         0x6000, 0x0800, CRC(952f78f2) SHA1(9562037b104fc1852c2d2650209a77ffce2cb90e) )
4162   ROM_CONTINUE(             0x5800, 0x0800 )
4163
4164   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4165   ROM_LOAD( "32_a4.7c",     0x0000, 0x1000, CRC(361b8a36) SHA1(550ac5f721aaa9fea5f6d63ba590d6b367525c23) )
4166   ROM_LOAD( "32_a5.7d",     0x1000, 0x1000, CRC(addecdd4) SHA1(ba28f1d9c7c6b5e8ecef56a4b3f64be13fc10d43) )
4167
4168   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
4169   ROM_LOAD( "32_f5.5f",     0x0000, 0x1000, CRC(1e5da9d6) SHA1(ca8b27e6dd40e4ca13e7e6b5f813bafca78b62f4) )
4170   ROM_LOAD( "32_h5.5h",     0x1000, 0x1000, CRC(a57adb0a) SHA1(d97c7dc4a6c5efb59cc0148e2498156c682c6714) )
4171
4172   ROM_REGION( 0x3000, REGION_SOUND1, 0 ) /* Samples? / Speech? */
4173   ROM_LOAD( "32_a3.6e",     0x0000, 0x1000, CRC(279ae6f9) SHA1(a93b1d68c9f4b6ad62fdb8816285e61bd3b4b884) )
4174   ROM_LOAD( "32_a2.6d",     0x1000, 0x1000, CRC(90352dd4) SHA1(62c261a2f2fbd8eff31d5c72cf532d5e43d86dd3) )
4175   ROM_LOAD( "32_a1.6c",     0x2000, 0x1000, CRC(3bf2452d) SHA1(7a163e0ef108dd40d3beab5e9805886e45be744b) )
4176
4177   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4178   ROM_LOAD( "prom.6e",      0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
4179ROM_END
4180
4181ROM_START( scrpiona )
4182   /* this dump is bad (at least one rom) */
4183   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4184   ROM_LOAD( "scor_d2.bin",  0x0000, 0x1000, BAD_DUMP CRC(c5b9daeb) SHA1(faf7a22013dd5f063eb8f506f3722cfd5522539a) )
4185   ROM_LOAD( "scor_e2.bin",  0x1000, 0x1000, BAD_DUMP CRC(82308d05) SHA1(26bc7c8b3ea0020fd1b93f6aaa29d82d04ae64b2) )
4186   ROM_LOAD( "scor_g2.bin",  0x2000, 0x1000, BAD_DUMP CRC(756b09cd) SHA1(9aec34e063fe8c0d1392db09daea2875d06eec46) )
4187   ROM_LOAD( "scor_h2.bin",  0x3000, 0x1000, BAD_DUMP CRC(a0457b93) SHA1(5ed32e117a97660dae001bd97fcb3f31e0debb24) )
4188   ROM_LOAD( "scor_k2.bin",  0x5800, 0x0800, BAD_DUMP CRC(42ec34d8) SHA1(b358d10a96490f325420b992e8e03bb3884e415a) )
4189   ROM_LOAD( "scor_l2.bin",  0x6000, 0x0800, BAD_DUMP CRC(6623da33) SHA1(99110005d00c80d674bde5d21608f50b85ee488c) )
4190
4191   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4192   ROM_LOAD( "32_a4.7c",     0x0000, 0x1000, CRC(361b8a36) SHA1(550ac5f721aaa9fea5f6d63ba590d6b367525c23) )
4193   ROM_LOAD( "32_a5.7d",     0x1000, 0x1000, CRC(addecdd4) SHA1(ba28f1d9c7c6b5e8ecef56a4b3f64be13fc10d43) )
4194
4195   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
4196   ROM_LOAD( "scor_f5.bin",  0x0000, 0x1000, CRC(60180a38) SHA1(518c1267523139aa4e27860012a722b67fe25b6d) )
4197   ROM_LOAD( "32_h5.5h",     0x1000, 0x1000, CRC(a57adb0a) SHA1(d97c7dc4a6c5efb59cc0148e2498156c682c6714) )
4198
4199   ROM_REGION( 0x3000, REGION_SOUND1, 0 ) /* Samples? / Speech? */
4200   ROM_LOAD( "scor_a3.bin",  0x0000, 0x1000, CRC(04abf178) SHA1(2e7f231413d9ec461ca21840f31d1d6b8b17c4d5) )
4201   ROM_LOAD( "scor_a2.bin",  0x1000, 0x1000, CRC(452d6354) SHA1(3d5397fddcc17b4d03b9cdc53a6439f159d1bfcc) )
4202   ROM_LOAD( "32_a1.6c",     0x2000, 0x1000, CRC(3bf2452d) SHA1(7a163e0ef108dd40d3beab5e9805886e45be744b) )
4203
4204   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4205   ROM_LOAD( "prom.6e",      0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
4206ROM_END
4207
4208ROM_START( scrpionb )
4209   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4210   ROM_LOAD( "ic109.2d",         0x0000, 0x1000, CRC(f54688c9) SHA1(2881d5238733353b9c277a2829d157688a87601b) )
4211   ROM_LOAD( "ic110.2e",         0x1000, 0x1000, CRC(91aaaa12) SHA1(2a5e5eb5aeec5637ee4675930f67158a969e0d5d) )
4212   ROM_LOAD( "ic111.2g",         0x2000, 0x1000, CRC(4c3720da) SHA1(5b2758c8a91f9463bf98abf2b52af946c5e90cf0) )
4213   ROM_LOAD( "ic112.2h",         0x3000, 0x1000, CRC(53e2a983) SHA1(cfe272055a92793de76dd1cff617b13281815485) )
4214   ROM_LOAD( "ic113.2k",         0x6000, 0x0800, CRC(e4ad299a) SHA1(712cab86eadeba9e859f7bae98eb289f00d2e217) )
4215   ROM_CONTINUE(             0x5800, 0x0800 )
4216
4217   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4218   ROM_LOAD( "32_a4.7c",     0x0000, 0x1000, CRC(361b8a36) SHA1(550ac5f721aaa9fea5f6d63ba590d6b367525c23) ) // missing in this dump
4219   ROM_LOAD( "ic13.7d",     0x1000, 0x1000, CRC(addecdd4) SHA1(ba28f1d9c7c6b5e8ecef56a4b3f64be13fc10d43) )
4220
4221   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
4222   ROM_LOAD( "ic72.5f",     0x0000, 0x1000, CRC(1e5da9d6) SHA1(ca8b27e6dd40e4ca13e7e6b5f813bafca78b62f4) )
4223   ROM_LOAD( "ic73.5h",     0x1000, 0x1000, CRC(a57adb0a) SHA1(d97c7dc4a6c5efb59cc0148e2498156c682c6714) )
4224
4225   ROM_REGION( 0x3000, REGION_SOUND1, 0 ) /* Samples? / Speech? */
4226   ROM_LOAD( "ic25.6e",     0x0000, 0x1000, CRC(04abf178) SHA1(2e7f231413d9ec461ca21840f31d1d6b8b17c4d5) )
4227   ROM_LOAD( "ic24.6d",     0x1000, 0x1000, CRC(90352dd4) SHA1(62c261a2f2fbd8eff31d5c72cf532d5e43d86dd3) )
4228   ROM_LOAD( "ic23.6c",     0x2000, 0x1000, CRC(3bf2452d) SHA1(7a163e0ef108dd40d3beab5e9805886e45be744b) )
4229
4230   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4231   ROM_LOAD( "prom.6e",      0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
4232ROM_END
4233
4234ROM_START( scorpnmc )
4235   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4236   ROM_LOAD( "p1.bin",       0x0000, 0x0800, CRC(58818d88) SHA1(d9fbfb6fff9ba1d078c3735889b8878ab0442ded) )
4237   ROM_LOAD( "p2.bin",       0x0800, 0x0800, CRC(8bec5f9f) SHA1(78642124edbf946140f62985bafe2dca314cb257) )
4238   ROM_LOAD( "p3.bin",       0x1000, 0x0800, CRC(24b7fdff) SHA1(1382199c85af3aa101b4ca01a0b096d801bc61a6) )
4239   ROM_LOAD( "p4.bin",       0x1800, 0x0800, CRC(9082e2f0) SHA1(8e3beebca33e73901cb8c4fa0af39a299b831d32) )
4240   ROM_LOAD( "p5.bin",       0x2000, 0x0800, CRC(20387fc0) SHA1(1aa2f16fb1630e65fd8aaedd21d8e4bac343678b) )
4241   ROM_LOAD( "p6.bin",       0x2800, 0x0800, CRC(f66c48e1) SHA1(bbfd68309d1f6b6bb3ec0879c8bde80b3f30fa02) )
4242   ROM_LOAD( "p7.bin",       0x3000, 0x0800, CRC(931e34c7) SHA1(8b6c1099634b5d693faab9edf5e29b3c476c7f52) )
4243   ROM_LOAD( "p8.bin",       0x3800, 0x0800, CRC(ab5ab61d) SHA1(eb78d7dc8d424f6ed4f7cbec02485cd769bac5c6) )
4244   ROM_LOAD( "p9.bin",       0x5000, 0x1000, CRC(b551b974) SHA1(c19e61dd8b6daf808ba42fa318dfd179a020d20e) )
4245   ROM_LOAD( "p10.bin",      0x6000, 0x0800, CRC(a7bd8d20) SHA1(c8131279de58298546c5af2c34ff18116c3a2d3b) )
4246
4247   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
4248   ROM_LOAD( "h.bin",        0x0000, 0x1000, CRC(1e5da9d6) SHA1(ca8b27e6dd40e4ca13e7e6b5f813bafca78b62f4) )
4249   ROM_LOAD( "k.bin",        0x1000, 0x1000, CRC(a57adb0a) SHA1(d97c7dc4a6c5efb59cc0148e2498156c682c6714) )
4250
4251   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4252   ROM_LOAD( "mmi6331.bpr",  0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
4253ROM_END
4254
4255
4256ROM_START( sfx )
4257   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4258   ROM_LOAD( "sfx_b-0.1j",   0x0000, 0x1000, CRC(e5bc6952) SHA1(7bfb772418d738d3c49fd59c0bfc04590945977a) )
4259   ROM_CONTINUE(             0xe000, 0x1000             )
4260   ROM_LOAD( "1.1c",         0x1000, 0x1000, CRC(1b3c48e7) SHA1(2f245aaf9b4bb5d949aae18ee89a0be639e7b2df) )
4261   ROM_LOAD( "22.1d",        0x2000, 0x1000, CRC(ed44950d) SHA1(f8c54ff89ac461171df951d703d5571be1b8da38) )
4262   ROM_LOAD( "23.1e",        0x3000, 0x1000, CRC(f44a3ca0) SHA1(3917ea960329a06d3d0c447cb6a4ba710fb7ca92) )
4263   ROM_LOAD( "27.1a",        0x7000, 0x1000, CRC(ed86839f) SHA1(a0d8c941a6e01058eab66d5da9b49b6b5695b981) )
4264   ROM_LOAD( "24.1g",        0xc000, 0x1000, CRC(e6d7dc74) SHA1(c1e6d9598fb837775ee6550fea3cd4910572615e) )
4265   ROM_LOAD( "5.1h",         0xd000, 0x1000, CRC(d1e8d390) SHA1(f8fe9f69e6500fbcf25f8151c1070d9a1a20a38c) )
4266
4267   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4268   ROM_LOAD( "5.5j",         0x0000, 0x1000, CRC(59028fb6) SHA1(94105b5b03c81a948a409f7ea20312bb9c79c150) )
4269   ROM_LOAD( "6.6j",         0x1000, 0x1000, CRC(5427670f) SHA1(ffc3f7186d0319f0fd7ed25eb97bb0db7bc107c6) )
4270
4271   ROM_REGION( 0x10000, REGION_CPU3, 0 )
4272   ROM_LOAD( "1.1j",         0x0000, 0x1000, CRC(2f172c58) SHA1(4706d55fcfad4d5a87d96a0a0187f59997ef9720) )
4273   ROM_LOAD( "2.2j",         0x1000, 0x1000, CRC(a6ad2f6b) SHA1(14d1a93e507c349b14a1b26408cce23f089fa33c) )
4274   ROM_LOAD( "3.3j",         0x2000, 0x1000, CRC(fa1274fa) SHA1(e98cb602b265b209eaa4a9b3972e47c869ff863b) )
4275   ROM_LOAD( "4.4j",         0x3000, 0x1000, CRC(1cd33f3a) SHA1(cf9248fd6cb56ec81d354afe032a2dea810e834b) )
4276   ROM_LOAD( "10.3h",        0x4000, 0x1000, CRC(b833a15b) SHA1(0d21aaa0ca5ccba89118b205a6b3b36b15663c47) )
4277   ROM_LOAD( "11.4h",        0x5000, 0x1000, CRC(cbd76ec2) SHA1(9434350ee93ca71efe78018b69913386353306ff) )
4278
4279   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
4280   ROM_LOAD( "28.5a",        0x0000, 0x1000, CRC(d73a8252) SHA1(59d14f41f1a806f98ee33596b84fe5aefe606944) )
4281   ROM_LOAD( "29.5c",        0x1000, 0x1000, CRC(1401ccf2) SHA1(5762eafd9f402330e1d4ac677f46595087716c47) )
4282
4283   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4284   ROM_LOAD( "6331.9g",      0x0000, 0x0020, CRC(ca1d9ccd) SHA1(27124759a06497c1bc1a64b6d3faa6ba924a8447) )
4285ROM_END
4286
4287ROM_START( skelagon )
4288   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4289   /* first half of 36.bin is missing */
4290   ROM_LOAD( "31.bin",       0x1000, 0x1000, CRC(ae6f8647) SHA1(801e88b91c204f2797e5ce45390ea6eec27a3f54) )
4291   ROM_LOAD( "32.bin",       0x2000, 0x1000, CRC(a28c5838) SHA1(0a37de7986c494d1522ce76635dd1fa6d03f05c7) )
4292   ROM_LOAD( "33.bin",       0x3000, 0x1000, CRC(32f7e99c) SHA1(2718063a77eeeb8067a9cad7ff3d9e0266b61566) )
4293   ROM_LOAD( "37.bin",       0x7000, 0x1000, CRC(47f68a31) SHA1(6e15024f67c88a733ede8702d2a80ddb1892b27e) )
4294   ROM_LOAD( "24.bin",       0xc000, 0x1000, CRC(e6d7dc74) SHA1(c1e6d9598fb837775ee6550fea3cd4910572615e) )
4295   ROM_LOAD( "35.bin",       0xd000, 0x1000, CRC(5b2a0158) SHA1(66d2fb05a8daaa86bb547b4860d5bf27b4359326) )
4296   ROM_LOAD( "36.bin",       0xe000, 0x1000, BAD_DUMP CRC(f53ead29) SHA1(f8957b0c0558acc005f418adbfeb66d1d562c9ac) )
4297
4298   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4299   ROM_LOAD( "5.5j",         0x0000, 0x1000, CRC(59028fb6) SHA1(94105b5b03c81a948a409f7ea20312bb9c79c150) )
4300   ROM_LOAD( "6.6j",         0x1000, 0x1000, CRC(5427670f) SHA1(ffc3f7186d0319f0fd7ed25eb97bb0db7bc107c6) )
4301
4302   ROM_REGION( 0x10000, REGION_CPU3, 0 )
4303   ROM_LOAD( "1.1j",         0x0000, 0x1000, CRC(2f172c58) SHA1(4706d55fcfad4d5a87d96a0a0187f59997ef9720) )
4304   ROM_LOAD( "2.2j",         0x1000, 0x1000, CRC(a6ad2f6b) SHA1(14d1a93e507c349b14a1b26408cce23f089fa33c) )
4305   ROM_LOAD( "3.3j",         0x2000, 0x1000, CRC(fa1274fa) SHA1(e98cb602b265b209eaa4a9b3972e47c869ff863b) )
4306   ROM_LOAD( "4.4j",         0x3000, 0x1000, CRC(1cd33f3a) SHA1(cf9248fd6cb56ec81d354afe032a2dea810e834b) )
4307   ROM_LOAD( "10.bin",       0x4000, 0x1000, CRC(2c719de2) SHA1(0953e96f8be1cbab3f4a8e166457c74e986a87b1) )
4308   ROM_LOAD( "8.bin",        0x5000, 0x1000, CRC(350379dd) SHA1(e979251b11d6702170dd60ffd28fc15ea737588b) )
4309
4310   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
4311   ROM_LOAD( "38.bin",       0x0000, 0x1000, CRC(2fffa8b1) SHA1(6a6032f55b9fe1da209e4ed4423042efec773d4d) )
4312   ROM_LOAD( "39.bin",       0x1000, 0x1000, CRC(a854b5de) SHA1(dd038f20ee366d439f09f0c82fd6432101b3781a) )
4313
4314   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4315   ROM_LOAD( "6331.9g",      0x0000, 0x0020, CRC(ca1d9ccd) SHA1(27124759a06497c1bc1a64b6d3faa6ba924a8447) )
4316ROM_END
4317
4318/*
4319Monster Zero
4320
4321CPU: Z80 (x3)
4322Sound: AY-3-8910 (x2)
4323Other: 8255 (x3)
4324RAM: 2114 (x2), 2114 (x2), TMM2016P, TMM314A (x4), MPB8216 (x2), MPB8216 (x2), 2114 (x2), TMM314A (x2), D2125A (x5)
4325PAL: 16R8C (protected x2)
4326PROM: 82S123
4327X1: 1431818
4328X2: 16000
4329*/
4330
4331ROM_START( monsterz )
4332   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4333   ROM_LOAD( "b-1e.a1",      0x0000, 0x1000, CRC(97886542) SHA1(01f4f9bd55f9eae28162cbb22a26f7cda22cd3f3) )
4334   ROM_LOAD( "b-2e.c1",      0x1000, 0x1000, CRC(184ffcb4) SHA1(829d6ca13773aba7c3a81e122171befbe3666110) )
4335   ROM_LOAD( "b-3e.d1",      0x2000, 0x1000, CRC(b7b10ac7) SHA1(51d544d4db456df756a95d7f1853fffed9259647) )
4336   ROM_LOAD( "b-4e.e1",      0x3000, 0x1000, CRC(fb02c736) SHA1(24466116dd07b856b1afff62b8312c67ff466b95) )
4337   ROM_LOAD( "b-5e.g1",      0xc000, 0x1000, CRC(b2788ab9) SHA1(eb1a6b41f4c7a243481bfccf2b068ce1bc292366) )
4338   ROM_LOAD( "b-6e.h1",      0xd000, 0x1000, CRC(77d7aa8d) SHA1(62aaf582ba55f7b21f6cf13b4fb6c2c54bb729f5) )
4339
4340   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4341   ROM_LOAD( "a-1e.k1",      0x0000, 0x1000, CRC(b88ba44e) SHA1(85c141fb411d541b1e20412f5fefd18395f635ae) )
4342   ROM_LOAD( "a-2.k2",       0x1000, 0x1000, CRC(8913c94e) SHA1(6c4fe065217a234d45761f8ad4d2c4e7078a0abd) )
4343   ROM_LOAD( "a-3e.k3",      0x2000, 0x1000, CRC(a8fa5095) SHA1(5cabe5497a79a0c43e78a84ae87c824af60a2a3f) )
4344   ROM_LOAD( "a-4.k4",       0x3000, 0x1000, CRC(93f81317) SHA1(167708be94cb9a47290067a20bc5ff6f018b93b6) )
4345
4346   ROM_REGION( 0x10000, REGION_CPU3, 0 )
4347   ROM_LOAD( "a-5e.k5",      0x0000, 0x1000, CRC(b5bcdb4e) SHA1(db0965e5636e0f4e9cd4f4a7d808c413ecf733db) )
4348   ROM_LOAD( "a-6.k6",       0x1000, 0x1000, CRC(24832b2e) SHA1(2a67888e86ce1a3182303e841513ba2a07977359) )
4349   ROM_LOAD( "a-7e.k7",      0x2000, 0x1000, CRC(20ebea81) SHA1(473c688365b256d8593663ff95768f4a5bb1289d) )
4350   // 0x3000 empty ?
4351   ROM_LOAD( "a-8.k8",       0x4000, 0x1000, CRC(b833a15b) SHA1(0d21aaa0ca5ccba89118b205a6b3b36b15663c47) )
4352   ROM_LOAD( "a-9.k9",       0x5000, 0x1000, CRC(cbd76ec2) SHA1(9434350ee93ca71efe78018b69913386353306ff) )
4353
4354   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
4355   ROM_LOAD( "b-7e.a5",      0x0000, 0x1000, CRC(ddd4158d) SHA1(9701e2d8a0226455dfbed650e58bb4be05918fe8) )
4356   ROM_LOAD( "b-8e.c5",      0x1000, 0x1000, CRC(b1331b4c) SHA1(fa1af406ecd6919b4846aea68d3edb70106f9273) )
4357
4358   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4359   ROM_LOAD( "prom.g9",      0x0000, 0x0020, CRC(b7ea00d7) SHA1(f658c6ac8123ae1e6b68ae513cc02c4d9d2b4e47) )
4360ROM_END
4361
4362
4363ROM_START( scobra )
4364   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4365   ROM_LOAD( "epr1265.2c",   0x0000, 0x1000, CRC(a0744b3f) SHA1(8949298a04f8ba8a82d5d84a7b012a0e7cff11df) )
4366   ROM_LOAD( "2e",           0x1000, 0x1000, CRC(8e7245cd) SHA1(281504ff364c3ddbf901c92729b139afd93b9785) )
4367   ROM_LOAD( "epr1267.2f",   0x2000, 0x1000, CRC(47a4e6fb) SHA1(01775ad11dc23469649539ee8fb8a5800df031c6) )
4368   ROM_LOAD( "2h",           0x3000, 0x1000, CRC(7244f21c) SHA1(f5fff565ed3f6c5f277a4db53c9f569813fcec1d) )
4369   ROM_LOAD( "epr1269.2j",   0x4000, 0x1000, CRC(e1f8a801) SHA1(2add8270352d6596052d3ff22c891ceccaa92071) )
4370   ROM_LOAD( "2l",           0x5000, 0x1000, CRC(d52affde) SHA1(5681771ed51d504bdcc2999fcbf926a30b137828) )
4371
4372   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4373   ROM_LOAD( "5c",           0x0000, 0x0800, CRC(d4346959) SHA1(5eab4505beb69a5bdd88b23db60e1193371250cf) )
4374   ROM_LOAD( "5d",           0x0800, 0x0800, CRC(cc025d95) SHA1(2b0784c4d05c466e0b7648f16e14f34393d792c3) )
4375   ROM_LOAD( "5e",           0x1000, 0x0800, CRC(1628c53f) SHA1(ec79a73e4a2d7373454b227dd7eff255f1cc60cc) )
4376
4377   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
4378   ROM_LOAD( "epr1274.5h",   0x0000, 0x0800, CRC(64d113b4) SHA1(7b439bb74d5ecc792e0ca8964bcca8c6b7a51262) )
4379   ROM_LOAD( "epr1273.5f",   0x0800, 0x0800, CRC(a96316d3) SHA1(9de0e94932e91dc34aea7c81880bde6a486d103b) )
4380
4381   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4382   ROM_LOAD( "82s123.6e",    0x0000, 0x0020, CRC(9b87f90d) SHA1(d11ac5e4a6057301ea2a9cbb404c2b978eb4c1dc) )
4383ROM_END
4384
4385ROM_START( scobras )
4386   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4387   ROM_LOAD( "scobra2c.bin", 0x0000, 0x1000, CRC(e15ade38) SHA1(21cf26d1781d133fa336d275d8a61d3f95d10b77) )
4388   ROM_LOAD( "scobra2e.bin", 0x1000, 0x1000, CRC(a270e44d) SHA1(8b7307af458b9cd3c45bb72b35e682d6d109ed01) )
4389   ROM_LOAD( "scobra2f.bin", 0x2000, 0x1000, CRC(bdd70346) SHA1(bda0dc5777233a86a3a0aceb6eded45145057ba8) )
4390   ROM_LOAD( "scobra2h.bin", 0x3000, 0x1000, CRC(dca5ec31) SHA1(50073d44ccef76a3c36c73a6ed4479127f2c98ee) )
4391   ROM_LOAD( "scobra2j.bin", 0x4000, 0x1000, CRC(0d8f6b6e) SHA1(0ca0096cd55cdb87d14cb7f4c7c7b853ec1661c7) )
4392   ROM_LOAD( "scobra2l.bin", 0x5000, 0x1000, CRC(6f80f3a9) SHA1(817d212454c5eb16c5d7471d2ccefc4f8708d57f) )
4393
4394   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4395   ROM_LOAD( "epr1275.5c",   0x0000, 0x0800, CRC(deeb0dd3) SHA1(b815a586f05361b75078d58f1fddfdb36f9d8fae) )
4396   ROM_LOAD( "epr1276.5d",   0x0800, 0x0800, CRC(872c1a74) SHA1(20f05bf398ad2690f5ba4e4158ad62aeec226413) )
4397   ROM_LOAD( "epr1277.5e",   0x1000, 0x0800, CRC(ccd7a110) SHA1(5a247e360530be0f94c90fcc7d0ce628d460449f) )
4398
4399   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
4400   ROM_LOAD( "epr1274.5h",   0x0000, 0x0800, CRC(64d113b4) SHA1(7b439bb74d5ecc792e0ca8964bcca8c6b7a51262) )
4401   ROM_LOAD( "epr1273.5f",   0x0800, 0x0800, CRC(a96316d3) SHA1(9de0e94932e91dc34aea7c81880bde6a486d103b) )
4402
4403   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4404   ROM_LOAD( "82s123.6e",    0x0000, 0x0020, CRC(9b87f90d) SHA1(d11ac5e4a6057301ea2a9cbb404c2b978eb4c1dc) )
4405ROM_END
4406
4407ROM_START( scobrase )
4408   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4409   ROM_LOAD( "epr1265.2c",   0x0000, 0x1000, CRC(a0744b3f) SHA1(8949298a04f8ba8a82d5d84a7b012a0e7cff11df) )
4410   ROM_LOAD( "epr1266.2e",   0x1000, 0x1000, CRC(65306279) SHA1(f6e10d57c9b88e3fcd7333f76708e190a97b4faa) )
4411   ROM_LOAD( "epr1267.2f",   0x2000, 0x1000, CRC(47a4e6fb) SHA1(01775ad11dc23469649539ee8fb8a5800df031c6) )
4412   ROM_LOAD( "epr1268.2h",   0x3000, 0x1000, CRC(53eecaf2) SHA1(08ca34097f63af8ab69b1d836a12a8bd4d42e4a2) )
4413   ROM_LOAD( "epr1269.2j",   0x4000, 0x1000, CRC(e1f8a801) SHA1(2add8270352d6596052d3ff22c891ceccaa92071) )
4414   ROM_LOAD( "epr1270.2l",   0x5000, 0x1000, CRC(f7709710) SHA1(dff9ae72ba00a98d4f5acdd6d506e3d7add6b2c6) )
4415
4416   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4417   ROM_LOAD( "epr1275.5c",   0x0000, 0x0800, CRC(deeb0dd3) SHA1(b815a586f05361b75078d58f1fddfdb36f9d8fae) )
4418   ROM_LOAD( "epr1276.5d",   0x0800, 0x0800, CRC(872c1a74) SHA1(20f05bf398ad2690f5ba4e4158ad62aeec226413) )
4419   ROM_LOAD( "epr1277.5e",   0x1000, 0x0800, CRC(ccd7a110) SHA1(5a247e360530be0f94c90fcc7d0ce628d460449f) )
4420
4421   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
4422   ROM_LOAD( "epr1274.5h",   0x0000, 0x0800, CRC(64d113b4) SHA1(7b439bb74d5ecc792e0ca8964bcca8c6b7a51262) )
4423   ROM_LOAD( "epr1273.5f",   0x0800, 0x0800, CRC(a96316d3) SHA1(9de0e94932e91dc34aea7c81880bde6a486d103b) )
4424
4425   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4426   ROM_LOAD( "pr1278.6e",    0x0000, 0x0020, CRC(fd35c561) SHA1(590f60beb443dd689c890c37cc100e0b936bf8c9) )
4427ROM_END
4428
4429ROM_START( scobrab )
4430   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4431   ROM_LOAD( "vid_2c.bin",   0x0000, 0x0800, CRC(aeddf391) SHA1(87632469e943cfe38a9676de5e8ed839a63c5da2) )
4432   ROM_LOAD( "vid_2e.bin",   0x0800, 0x0800, CRC(72b57eb7) SHA1(978d0acbfccb7c1edddb073ad9417d4cbd9b7e63) )
4433   ROM_LOAD( "scobra2e.bin", 0x1000, 0x1000, CRC(a270e44d) SHA1(8b7307af458b9cd3c45bb72b35e682d6d109ed01) )
4434   ROM_LOAD( "scobra2f.bin", 0x2000, 0x1000, CRC(bdd70346) SHA1(bda0dc5777233a86a3a0aceb6eded45145057ba8) )
4435   ROM_LOAD( "scobra2h.bin", 0x3000, 0x1000, CRC(dca5ec31) SHA1(50073d44ccef76a3c36c73a6ed4479127f2c98ee) )
4436   ROM_LOAD( "scobra2j.bin", 0x4000, 0x1000, CRC(0d8f6b6e) SHA1(0ca0096cd55cdb87d14cb7f4c7c7b853ec1661c7) )
4437   ROM_LOAD( "scobra2l.bin", 0x5000, 0x1000, CRC(6f80f3a9) SHA1(817d212454c5eb16c5d7471d2ccefc4f8708d57f) )
4438
4439   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4440   ROM_LOAD( "snd_5c.bin",   0x0000, 0x0800, CRC(deeb0dd3) SHA1(b815a586f05361b75078d58f1fddfdb36f9d8fae) )
4441   ROM_LOAD( "snd_5d.bin",   0x0800, 0x0800, CRC(872c1a74) SHA1(20f05bf398ad2690f5ba4e4158ad62aeec226413) )
4442   ROM_LOAD( "snd_5e.bin",   0x1000, 0x0800, CRC(ccd7a110) SHA1(5a247e360530be0f94c90fcc7d0ce628d460449f) )
4443
4444   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
4445   ROM_LOAD( "epr1274.5h",   0x0000, 0x0800, CRC(64d113b4) SHA1(7b439bb74d5ecc792e0ca8964bcca8c6b7a51262) )
4446   ROM_LOAD( "epr1273.5f",   0x0800, 0x0800, CRC(a96316d3) SHA1(9de0e94932e91dc34aea7c81880bde6a486d103b) )
4447
4448   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4449   ROM_LOAD( "82s123.6e",    0x0000, 0x0020, CRC(9b87f90d) SHA1(d11ac5e4a6057301ea2a9cbb404c2b978eb4c1dc) )
4450ROM_END
4451
4452
4453ROM_START( losttomb )
4454   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4455   ROM_LOAD( "2c",           0x0000, 0x1000, CRC(d6176d2c) SHA1(bc2bf63ee8d3e376f155d218704ceb5adcdf8e54) )
4456   ROM_LOAD( "2e",           0x1000, 0x1000, CRC(a5f55f4a) SHA1(3609fc2b15b6856e81738bbd370250735dba694d) )
4457   ROM_LOAD( "2f",           0x2000, 0x1000, CRC(0169fa3c) SHA1(2c06b1deca6c80d067032bfc2386da6ab0111e5f) )
4458   ROM_LOAD( "2h-easy",      0x3000, 0x1000, CRC(054481b6) SHA1(b0f5d19af0336883e4d9813e58a75c176a63a987) )
4459   ROM_LOAD( "2j",           0x4000, 0x1000, CRC(249ee040) SHA1(7297039e95e67220fa3e75fc50635f4df4c46a86) )
4460   ROM_LOAD( "2l",           0x5000, 0x1000, CRC(c7d2e608) SHA1(8aabecabd1dcd6833fb581e4571d71a680e6563a) )
4461   ROM_LOAD( "2m",           0x6000, 0x1000, CRC(bc4bc5b1) SHA1(95ffa72e57d1da10ddeda4d9333c9e0a2fb33e82) )
4462
4463   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4464   ROM_LOAD( "5c",           0x0000, 0x0800, CRC(b899be2a) SHA1(9b343a682531255104db61177a43ad933c3af34e) )
4465   ROM_LOAD( "5d",           0x0800, 0x0800, CRC(6907af31) SHA1(8496c8db5342129d81381eec196facbca45bca77) )
4466
4467   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
4468   ROM_LOAD( "5f",           0x0000, 0x0800, CRC(61f137e7) SHA1(8bff09bc29fa829e21e6b36f7b3f67f19f6bbb26) )
4469   ROM_LOAD( "5h",           0x0800, 0x0800, CRC(5581de5f) SHA1(763dacb0d2183c159e7f1f04c7ecb1182da18abf) )
4470
4471   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4472   ROM_LOAD( "ltprom",       0x0000, 0x0020, CRC(1108b816) SHA1(49fdb08f8f31fefa2f3dca3d3455318cb21847a3) )
4473ROM_END
4474
4475ROM_START( losttmbh )
4476   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4477   ROM_LOAD( "2c",           0x0000, 0x1000, CRC(d6176d2c) SHA1(bc2bf63ee8d3e376f155d218704ceb5adcdf8e54) )
4478   ROM_LOAD( "2e",           0x1000, 0x1000, CRC(a5f55f4a) SHA1(3609fc2b15b6856e81738bbd370250735dba694d) )
4479   ROM_LOAD( "2f",           0x2000, 0x1000, CRC(0169fa3c) SHA1(2c06b1deca6c80d067032bfc2386da6ab0111e5f) )
4480   ROM_LOAD( "lthard",       0x3000, 0x1000, CRC(e32cbf0e) SHA1(c4a63e01fad7bd450def5c4412690d4bb8d12691) )
4481   ROM_LOAD( "2j",           0x4000, 0x1000, CRC(249ee040) SHA1(7297039e95e67220fa3e75fc50635f4df4c46a86) )
4482   ROM_LOAD( "2l",           0x5000, 0x1000, CRC(c7d2e608) SHA1(8aabecabd1dcd6833fb581e4571d71a680e6563a) )
4483   ROM_LOAD( "2m",           0x6000, 0x1000, CRC(bc4bc5b1) SHA1(95ffa72e57d1da10ddeda4d9333c9e0a2fb33e82) )
4484
4485   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4486   ROM_LOAD( "5c",           0x0000, 0x0800, CRC(b899be2a) SHA1(9b343a682531255104db61177a43ad933c3af34e) )
4487   ROM_LOAD( "5d",           0x0800, 0x0800, CRC(6907af31) SHA1(8496c8db5342129d81381eec196facbca45bca77) )
4488
4489   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
4490   ROM_LOAD( "5f",           0x0000, 0x0800, CRC(61f137e7) SHA1(8bff09bc29fa829e21e6b36f7b3f67f19f6bbb26) )
4491   ROM_LOAD( "5h",           0x0800, 0x0800, CRC(5581de5f) SHA1(763dacb0d2183c159e7f1f04c7ecb1182da18abf) )
4492
4493   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4494   ROM_LOAD( "ltprom",       0x0000, 0x0020, CRC(1108b816) SHA1(49fdb08f8f31fefa2f3dca3d3455318cb21847a3) )
4495ROM_END
4496
4497
4498ROM_START( armorcar )
4499   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4500   ROM_LOAD( "cpu.2c",       0x0000, 0x1000, CRC(0d7bfdfb) SHA1(47791d4fc298c25d29584dfcddcd92618e3750c5) )
4501   ROM_LOAD( "cpu.2e",       0x1000, 0x1000, CRC(76463213) SHA1(86dbbed25325cc8855c1eb39bbb11b0473b7f4b5) )
4502   ROM_LOAD( "cpu.2f",       0x2000, 0x1000, CRC(2cc6d5f0) SHA1(94abb33760aed206f0f90f035fe2977c1f2e26cf) )
4503   ROM_LOAD( "cpu.2h",       0x3000, 0x1000, CRC(61278dbb) SHA1(e12cd6c499af75f77e549499093fe6d2e8eddb1d) )
4504   ROM_LOAD( "cpu.2j",       0x4000, 0x1000, CRC(fb158d8c) SHA1(efa70e92c56678d4a404a96c72cfee317b15648c) )
4505
4506   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4507   ROM_LOAD( "sound.5c",     0x0000, 0x0800, CRC(54ee7753) SHA1(3ebfa2cadf33acb4d24aa50cfa4713355cc780a3) )
4508   ROM_LOAD( "sound.5d",     0x0800, 0x0800, CRC(5218fec0) SHA1(c8f84f1e6aafc544e5acf48b245e8b1edb63211e) )
4509
4510   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
4511   ROM_LOAD( "cpu.5f",       0x0000, 0x0800, CRC(8a3da4d1) SHA1(4d2ef48aeb9099fdd145e11e2485e0bf8d87290d) )
4512   ROM_LOAD( "cpu.5h",       0x0800, 0x0800, CRC(85bdb113) SHA1(f62da0ea0c29feb10d8d1ce8de28fd750a53b40a) )
4513
4514   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4515   ROM_LOAD( "82s123.6e",    0x0000, 0x0020, CRC(9b87f90d) SHA1(d11ac5e4a6057301ea2a9cbb404c2b978eb4c1dc) )
4516ROM_END
4517
4518ROM_START( armorca2 )
4519   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4520   ROM_LOAD( "2c",           0x0000, 0x1000, CRC(e393bd2f) SHA1(6a5079d1f5d724e5f643cbc5352fc43d0b652e05) )
4521   ROM_LOAD( "2e",           0x1000, 0x1000, CRC(b7d443af) SHA1(1ce41e11a7fcfd039fbff03c4382ae29b601ed50) )
4522   ROM_LOAD( "2g",           0x2000, 0x1000, CRC(e67380a4) SHA1(a9a87e769d1ef223ae26241e9211c97b3d469656) )
4523   ROM_LOAD( "2h",           0x3000, 0x1000, CRC(72af7b37) SHA1(c9cd0a0a3e34fc7b12822f75eb511f0850703f55) )
4524   ROM_LOAD( "2j",           0x4000, 0x1000, CRC(e6b0dd7f) SHA1(98292fea03bff028ba924a49f0bfa49377018860) )
4525
4526   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4527   ROM_LOAD( "sound.5c",     0x0000, 0x0800, CRC(54ee7753) SHA1(3ebfa2cadf33acb4d24aa50cfa4713355cc780a3) )
4528   ROM_LOAD( "sound.5d",     0x0800, 0x0800, CRC(5218fec0) SHA1(c8f84f1e6aafc544e5acf48b245e8b1edb63211e) )
4529
4530   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
4531   ROM_LOAD( "cpu.5f",       0x0000, 0x0800, CRC(8a3da4d1) SHA1(4d2ef48aeb9099fdd145e11e2485e0bf8d87290d) )
4532   ROM_LOAD( "cpu.5h",       0x0800, 0x0800, CRC(85bdb113) SHA1(f62da0ea0c29feb10d8d1ce8de28fd750a53b40a) )
4533
4534   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4535   ROM_LOAD( "82s123.6e",    0x0000, 0x0020, CRC(9b87f90d) SHA1(d11ac5e4a6057301ea2a9cbb404c2b978eb4c1dc) )
4536ROM_END
4537
4538
4539ROM_START( tazmania )
4540   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4541   ROM_LOAD( "2c.cpu",       0x0000, 0x1000, CRC(932c5a06) SHA1(f90040a12f579a05cb91eacbe49dae9b2c725592) )
4542   ROM_LOAD( "2e.cpu",       0x1000, 0x1000, CRC(ef17ce65) SHA1(e1372886a4a2ae58278772f49b4f3be35e0b65d1) )
4543   ROM_LOAD( "2f.cpu",       0x2000, 0x1000, CRC(43c7c39d) SHA1(3cfe97009e3c9236b118fa1beadc50f41584bd7e) )
4544   ROM_LOAD( "2h.cpu",       0x3000, 0x1000, CRC(be829694) SHA1(3885c95ae1704e7a472139740b87fc8dd9610e07) )
4545   ROM_LOAD( "2j.cpu",       0x4000, 0x1000, CRC(6e197271) SHA1(231141a95e4dcb54d8bbee346825702e52824c42) )
4546   ROM_LOAD( "2k.cpu",       0x5000, 0x1000, CRC(a1eb453b) SHA1(50ddfd1dd8cc8c2cde97e52d4ef90e6d10e27a53) )
4547
4548   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4549   ROM_LOAD( "rom0.snd",     0x0000, 0x0800, CRC(b8d741f1) SHA1(a1bb8a1e0d6b34111f05c539c8e92fffacf5aa5c) )
4550
4551   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
4552   ROM_LOAD( "5f.cpu",       0x0000, 0x0800, CRC(2c5b612b) SHA1(32e3a41a9a4a8b1285b6a195213ff0d98012360a) )
4553   ROM_LOAD( "5h.cpu",       0x0800, 0x0800, CRC(3f5ff3ac) SHA1(bc70eef54a45b52c14e35464e5f06b5eec554eb6) )
4554
4555   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4556   ROM_LOAD( "colr6f.cpu",   0x0000, 0x0020, CRC(fce333c7) SHA1(f63a214dc47c5e7c80db000b0b6a261ca8da6629) )
4557ROM_END
4558
4559
4560ROM_START( anteater )
4561   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4562   ROM_LOAD( "ra1-2c",       0x0000, 0x1000, CRC(58bc9393) SHA1(7122782a69ef0d2196ec16833f229b6286802668) )
4563   ROM_LOAD( "ra1-2e",       0x1000, 0x1000, CRC(574fc6f6) SHA1(a1a213d215fe8502edf22383c3a6fb7c9b279d94) )
4564   ROM_LOAD( "ra1-2f",       0x2000, 0x1000, CRC(2f7c1fe5) SHA1(4cea7e66a85766a9cf9846bb5bc1ca4e6ee1f4e2) )
4565   ROM_LOAD( "ra1-2h",       0x3000, 0x1000, CRC(ae8a5da3) SHA1(1893d8293b25431d080b89f5b0874440d14e8d17) )
4566
4567   ROM_REGION( 0x10000, REGION_CPU2, 0 )
4568   ROM_LOAD( "ra4-5c",       0x0000, 0x0800, CRC(87300b4f) SHA1(b81b685ac1d353ff1cd40b876a7478b87b85e7a9) )
4569   ROM_LOAD( "ra4-5d",       0x0800, 0x0800, CRC(af4e5ffe) SHA1(62717a233cf9f58267af4a9e1c80479b373ab317) )
4570
4571   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
4572   ROM_LOAD( "ra6-5f",       0x0000, 0x0800, CRC(4c3f8a08) SHA1(3152eef64903be1a82f09764821a3654f316197d) )
4573   ROM_LOAD( "ra6-5h",       0x0800, 0x0800, CRC(b30c7c9f) SHA1(d4ae040d1fd7e5a5d08c2f6968735c551119c207) )
4574
4575   ROM_REGION( 0x0020, REGION_PROMS, 0 )
4576   ROM_LOAD( "colr6f.cpu",   0x0000, 0x0020, CRC(fce333c7) SHA1(f63a214dc47c5e7c80db000b0b6a261ca8da6629) )
4577ROM_END
4578
4579
4580
4581/*************************************
4582 *
4583 *  Game drivers
4584 *  Galaxian-derived games
4585 *
4586 *************************************/
4587
4588/* basic galaxian hardware */
4589GAME( 1979, galaxian, 0,        galaxian, galaxian, galaxian, ROT90,  "Namco", "Galaxian (Namco set 1)", GAME_SUPPORTS_SAVE )
4590GAME( 1979, galaxiaj, galaxian, galaxian, superg,   galaxian, ROT90,  "Namco", "Galaxian (Namco set 2)", GAME_SUPPORTS_SAVE )
4591GAME( 1979, galmidw,  galaxian, galaxian, galaxian, galaxian, ROT90,  "[Namco] (Midway license)", "Galaxian (Midway set 1)", GAME_SUPPORTS_SAVE )
4592GAME( 1979, galmidwo, galaxian, galaxian, galaxian, galaxian, ROT90,  "[Namco] (Midway license)", "Galaxian (Midway set 2)", GAME_SUPPORTS_SAVE )
4593GAME( 1979, galtaito, galaxian, galaxian, galtaito, galaxian, ROT90,  "[Namco] (Taito license)", "Galaxian (Taito)", GAME_SUPPORTS_SAVE )
4594
4595/* straight Galaxian ripoffs on basic galaxian hardware */
4596GAME( 1979, moonaln,  galaxian, galaxian, superg,   galaxian, ROT90,  "[Nichibutsu] (Karateco license)", "Moon Alien", GAME_SUPPORTS_SAVE )
4597GAME( 1979, superg,   galaxian, galaxian, superg,   galaxian, ROT90,  "hack", "Super Galaxians (galaxiaj hack)", GAME_SUPPORTS_SAVE )
4598GAME( 1979, galturbo, galaxian, galaxian, superg,   galaxian, ROT90,  "hack", "Galaxian Turbo (superg hack)", GAME_SUPPORTS_SAVE )
4599GAME( 1979, galapx,   galaxian, galaxian, superg,   galaxian, ROT90,  "hack", "Galaxian Part X (moonaln hack)", GAME_SUPPORTS_SAVE )
4600GAME( 1979, galap1,   galaxian, galaxian, superg,   galaxian, ROT90,  "hack", "Space Invaders Galactica (galaxiaj hack)", GAME_SUPPORTS_SAVE )
4601GAME( 1979, galap4,   galaxian, galaxian, superg,   galaxian, ROT90,  "G.G.I", "Galaxian Part 4 (hack)", GAME_SUPPORTS_SAVE )
4602GAME( 1979, swarm,    galaxian, galaxian, swarm,    galaxian, ROT90,  "Subelectro", "Swarm (bootleg?)", GAME_SUPPORTS_SAVE )
4603GAME( 1979, zerotime, galaxian, galaxian, zerotime, galaxian, ROT90,  "Petaco S.A.", "Zero Time", GAME_SUPPORTS_SAVE )
4604GAME( 1979, starfght, galaxian, galaxian, swarm,    galaxian, ROT90,  "Jeutel", "Star Fighter", GAME_SUPPORTS_SAVE )
4605GAME( 1979, galaxbsf, galaxian, galaxian, galaxian, galaxian, ROT90,  "bootleg", "Galaxian (bootleg)", GAME_SUPPORTS_SAVE )
4606GAME( 1980, supergx,  galaxian, galaxian, superg,   galaxian, ROT90,  "Nichibutsu", "Super GX", GAME_NOT_WORKING | GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
4607GAME( 19??, tst_galx, galaxian, galaxian, galaxian, galaxian, ROT90,  "Test ROM", "Galaxian Test ROM", GAME_SUPPORTS_SAVE )
4608
4609/* other games on basic galaxian hardware */
4610GAME( 1981, blkhole,  0,        galaxian, blkhole,  galaxian, ROT90,  "TDS", "Black Hole", GAME_SUPPORTS_SAVE )
4611GAME( 19??, orbitron, 0,        galaxian, orbitron, galaxian, ROT270, "Signatron USA", "Orbitron", GAME_SUPPORTS_SAVE )
4612GAME( 1980, luctoday, 0,        galaxian, luctoday, galaxian, ROT270, "Sigma", "Lucky Today",GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
4613GAME( 19??, chewing,  luctoday, galaxian, luctoday, galaxian, ROT90,  "unknown", "Chewing Gum", GAME_SUPPORTS_SAVE )
4614GAME( 1982, catacomb, 0,        galaxian, catacomb, galaxian, ROT90,  "MTM Games", "Catacomb", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
4615GAME( 19??, omega,    theend,   galaxian, omega,    galaxian, ROT270, "bootleg?", "Omega", GAME_SUPPORTS_SAVE )
4616
4617/* these games require the coin lockout mechanism to be disabled */
4618GAME( 1981, warofbug, 0,        galaxian, warofbug, nolock,   ROT90,  "Armenia", "War of the Bugs or Monsterous Manouvers in a Mushroom Maze", GAME_SUPPORTS_SAVE )
4619GAME( 19??, redufo,   0,        galaxian, redufo,   nolock,   ROT90,  "bootleg", "Defend the Terra Attack on the Red UFO", GAME_SUPPORTS_SAVE )
4620GAME( 19??, exodus,   redufo,   galaxian, exodus,   nolock,   ROT90,  "Subelectro", "Exodus (bootleg?)", GAME_SUPPORTS_SAVE )
4621
4622/* different bullet color */
4623GAME( 1982, azurian,  0,        galaxian, azurian,  azurian,  ROT90,  "Rait Electronics Ltd", "Azurian Attack", GAME_SUPPORTS_SAVE )
4624
4625/* extra characters controlled via bank at $6002 */
4626GAME( 19??, pisces,   0,        galaxian, pisces,   pisces,   ROT90,  "Subelectro", "Pisces", GAME_SUPPORTS_SAVE )
4627GAME( 19??, piscesb,  pisces,   galaxian, piscesb,  pisces,   ROT90,  "bootleg", "Pisces (bootleg)", GAME_SUPPORTS_SAVE )
4628GAME( 19??, omni,     pisces,   galaxian, piscesb,  pisces,   ROT90,  "bootleg", "Omni", GAME_SUPPORTS_SAVE )
4629GAME( 1980, uniwars,  0,        galaxian, superg,   pisces,   ROT90,  "Irem", "UniWar S", GAME_SUPPORTS_SAVE )
4630GAME( 1980, gteikoku, uniwars,  galaxian, superg,   pisces,   ROT90,  "Irem", "Gingateikoku No Gyakushu", GAME_SUPPORTS_SAVE )
4631GAME( 1980, gteikokb, uniwars,  galaxian, gteikokb, pisces,   ROT270, "bootleg", "Gingateikoku No Gyakushu (bootleg set 1)", GAME_SUPPORTS_SAVE )
4632GAME( 1980, gteikob2, uniwars,  galaxian, gteikob2, pisces,   ROT90,  "bootleg", "Gingateikoku No Gyakushu (bootleg set 2)", GAME_SUPPORTS_SAVE )
4633GAME( 1980, spacbatt, uniwars,  galaxian, spacbatt, pisces,   ROT90,  "bootleg", "Space Battle (bootleg set 1)", GAME_SUPPORTS_SAVE )
4634GAME( 1980, spacbat2, uniwars,  galaxian, spacbatt, pisces,   ROT90,  "bootleg", "Space Battle (bootleg set 2)", GAME_SUPPORTS_SAVE )
4635GAME( 1980, skyraidr, uniwars,  galaxian, superg,   pisces,   ROT90,  "bootleg", "Sky Raiders", GAME_SUPPORTS_SAVE )
4636
4637/* similar to pisces, but with different video banking characteristics */
4638GAME( 1981, batman2,  phoenix,  galaxian, batman2,  batman2,  ROT270, "bootleg", "Batman Part 2", GAME_SUPPORTS_SAVE )
4639
4640/* separate tile/sprite ROMs */
4641GAME( 1981, streakng, 0,        pacmanbl, streakng, galaxian, ROT90,  "Shoei", "Streaking", GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE )
4642GAME( 1981, pacmanbl, puckman,  pacmanbl, pacmanbl, pacmanbl, ROT270, "bootleg", "Pac-Man (Galaxian hardware)", GAME_SUPPORTS_SAVE )
4643
4644/* separate tile/sprite ROMs, plus INT instead of NMI */
4645GAME( 1984, devilfsg, devilfsh, pacmanbl, devilfsg, devilfsg, ROT270, "Vision / Artic", "Devil Fish (Galaxian hardware, bootleg?)", GAME_SUPPORTS_SAVE )
4646
4647/* sound hardware replaced with AY8910 */
4648GAME( 1982, zigzag,   0,        zigzag,   zigzag,   zigzag,   ROT90,  "LAX", "Zig Zag (Galaxian hardware, set 1)", GAME_SUPPORTS_SAVE )
4649GAME( 1982, zigzag2,  zigzag,   zigzag,   zigzag,   zigzag,   ROT90,  "LAX", "Zig Zag (Galaxian hardware, set 2)", GAME_SUPPORTS_SAVE )
4650
4651/* multi-game select via external switch */
4652GAME( 1981, gmgalax,  0,        gmgalax,  gmgalax,  gmgalax,  ROT90,  "bootleg", "Ghostmuncher Galaxian (bootleg)", GAME_SUPPORTS_SAVE )
4653
4654
4655
4656/*************************************
4657 *
4658 *  Game drivers
4659 *  Moon Cresta-derived games
4660 *
4661 *************************************/
4662
4663/* based on Galaxian, but with altered address map for more ROM */
4664GAME( 1980, mooncrst, 0,        mooncrst, mooncrst, mooncrst, ROT90,  "Nichibutsu", "Moon Cresta (Nichibutsu)", GAME_SUPPORTS_SAVE )
4665GAME( 1980, mooncrsu, mooncrst, mooncrst, mooncrst, mooncrsu, ROT90,  "Nichibutsu USA", "Moon Cresta (Nichibutsu, unencrypted)", GAME_SUPPORTS_SAVE )
4666GAME( 1980, mooncrsa, mooncrst, mooncrst, mooncrsa, mooncrst, ROT90,  "Nichibutsu", "Moon Cresta (Nichibutsu, old rev)", GAME_SUPPORTS_SAVE )
4667GAME( 1980, mooncrsg, mooncrst, mooncrst, mooncrsg, mooncrsu, ROT90,  "Gremlin", "Moon Cresta (Gremlin)", GAME_SUPPORTS_SAVE )
4668
4669/* straight Moon Cresta ripoffs on basic mooncrst hardware */
4670GAME( 1980, mooncrsb, mooncrst, mooncrst, mooncrsa, mooncrsu, ROT90,  "bootleg", "Moon Cresta (bootleg set 1)", GAME_SUPPORTS_SAVE )
4671GAME( 1980, mooncrs2, mooncrst, mooncrst, mooncrsa, mooncrsu, ROT90,  "Nichibutsu", "Moon Cresta (bootleg set 2)", GAME_SUPPORTS_SAVE )
4672GAME( 1980, mooncrs3, mooncrst, mooncrst, mooncrst, mooncrsu, ROT90,  "bootleg", "Moon Cresta (bootleg set 3)", GAME_SUPPORTS_SAVE ) /* Jeutel bootleg, similar to bootleg set 2 */
4673GAME( 1980, fantazia, mooncrst, mooncrst, fantazia, mooncrsu, ROT90,  "Subelectro", "Fantazia (bootleg?)", GAME_SUPPORTS_SAVE )
4674GAME( 1980, eagle,    mooncrst, mooncrst, mooncrsa, mooncrsu, ROT90,  "Centuri", "Eagle (set 1)", GAME_SUPPORTS_SAVE )
4675GAME( 1980, eagle2,   mooncrst, mooncrst, eagle2,   mooncrsu, ROT90,  "Centuri", "Eagle (set 2)", GAME_SUPPORTS_SAVE )
4676GAME( 1980, eagle3,   mooncrst, mooncrst, mooncrsa, mooncrsu, ROT90,  "Centuri", "Eagle (set 3)", GAME_SUPPORTS_SAVE )
4677GAME( 1981?,spctbird, mooncrst, mooncrst, eagle2,   mooncrsu, ROT90,  "Fortrek", "Space Thunderbird", GAME_SUPPORTS_SAVE )
4678GAME( 1980?,smooncrs, mooncrst, mooncrst, smooncrs, mooncrsu, ROT90,  "Gremlin", "Super Moon Cresta", GAME_SUPPORTS_SAVE )
4679GAME( 198?, mooncmw,  mooncrst, mooncrst, mooncrsa, mooncrsu, ROT90,  "bootleg", "Moon War (Moon Cresta bootleg)", GAME_SUPPORTS_SAVE )
4680// The boards were marked 'Space Dragon' although this doesn't appear in the games.
4681GAME( 1980, spcdrag,  mooncrst, mooncrst, smooncrs, mooncrsu, ROT90,  "bootleg", "Space Dragon (Moon Cresta bootleg, set 1)", GAME_SUPPORTS_SAVE )
4682GAME( 1980, spcdraga, mooncrst, mooncrst, smooncrs, mooncrsu, ROT90,  "bootleg", "Space Dragon (Moon Cresta bootleg, set 2)", GAME_SUPPORTS_SAVE )
4683GAME( 1980, mooncrgx, mooncrst, galaxian, mooncrgx, mooncrgx, ROT270, "bootleg", "Moon Cresta (Galaxian hardware)", GAME_SUPPORTS_SAVE )
4684GAME( 1980, moonqsr,  0,        mooncrst, moonqsr,  moonqsr,  ROT90,  "Nichibutsu", "Moon Quasar", GAME_SUPPORTS_SAVE )
4685GAME( 1980, moonal2,  galaxian, mooncrst, moonal2,  galaxian, ROT90,  "Nichibutsu", "Moon Alien Part 2", GAME_SUPPORTS_SAVE )
4686GAME( 1980, moonal2b, galaxian, mooncrst, moonal2,  galaxian, ROT90,  "Nichibutsu", "Moon Alien Part 2 (older version)", GAME_SUPPORTS_SAVE )
4687
4688/* other games on basic mooncrst hardware */
4689GAME( 1982, skybase,  0,        mooncrst, skybase,  skybase,  ROT90,  "Omori Electric Co., Ltd.", "Sky Base", GAME_SUPPORTS_SAVE )
4690
4691/* extra ROMs, protection, and sound hardware replaced with AY8910 */
4692GAME( 1981, jumpbug,  0,        jumpbug,  jumpbug,  jumpbug,  ROT90,  "Rock-ola", "Jump Bug", GAME_SUPPORTS_SAVE )
4693GAME( 1981, jumpbugb, jumpbug,  jumpbug,  jumpbug,  jumpbug,  ROT90,  "bootleg", "Jump Bug (bootleg)", GAME_SUPPORTS_SAVE )
4694GAME( 1983, levers,   0,        jumpbug,  levers,   jumpbug,  ROT90,  "Rock-ola", "Levers", GAME_SUPPORTS_SAVE )
4695
4696/* 2nd CPU driving AY8910 for sound */
4697GAME( 1982, checkman, 0,        checkman, checkman, checkman, ROT90,  "Zilec-Zenitone", "Check Man", GAME_SUPPORTS_SAVE )
4698GAME( 1982, checkmaj, checkman, checkmaj, checkmaj, checkmaj, ROT90,  "Jaleco", "Check Man (Japan)", GAME_SUPPORTS_SAVE )
4699GAME( 1983, dingo,    0,        checkmaj, dingo,    dingo,    ROT90,  "Ashby Computers and Graphics LTD. (Jaleco license)", "Dingo", GAME_SUPPORTS_SAVE )
4700GAME( 1983, dingoe,   dingo,    checkman, dingo,    dingoe,   ROT90,  "Ashby Computers and Graphics LTD.", "Dingo (encrypted)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
4701
4702/* Crazy Climber sound plus AY8910 instead of galaxian sound, plus INT instead of NMI */
4703GAME( 1981, mshuttle, 0,        mshuttle, mshuttle, mshuttle, ROT0,   "Nichibutsu", "Moon Shuttle (US?)", GAME_SUPPORTS_SAVE )
4704GAME( 1981, mshuttlj, mshuttle, mshuttle, mshuttle, mshuttlj, ROT0,   "Nichibutsu", "Moon Shuttle (Japan)", GAME_SUPPORTS_SAVE )
4705GAME( 1981, mshutlj2, mshuttle, mshuttle, mshuttle, mshuttlj, ROT0,   "Nichibutsu", "Moon Shuttle (Japan set 2)", GAME_SUPPORTS_SAVE )
4706
4707/* 2nd CPU driving DAC for sound */
4708GAME( 1980, kingball, 0,        kingball, kingball, kingball, ROT90,  "Namco", "King & Balloon (US)", GAME_SUPPORTS_SAVE )
4709GAME( 1980, kingbalj, kingball, kingball, kingball, kingball, ROT90,  "Namco", "King & Balloon (Japan)", GAME_SUPPORTS_SAVE )
4710
4711
4712
4713/*************************************
4714 *
4715 *  Game drivers
4716 *  Konami games
4717 *
4718 *************************************/
4719
4720/* Frogger based hardware: 2nd Z80, AY-8910A, 2 8255 PPI for I/O, custom background */
4721GAME( 1981, frogger,  0,        frogger,  frogger,  frogger,  ROT90,  "Konami", "Frogger", GAME_SUPPORTS_SAVE )
4722GAME( 1981, frogseg1, frogger,  frogger,  frogger,  frogger,  ROT90,  "[Konami] (Sega license)", "Frogger (Sega set 1)", GAME_SUPPORTS_SAVE )
4723GAME( 1981, frogseg2, frogger,  frogger,  frogger,  frogger,  ROT90,  "[Konami] (Sega license)", "Frogger (Sega set 2)", GAME_SUPPORTS_SAVE )
4724GAME( 1981, froggrmc, frogger,  froggrmc, froggrmc, froggrmc, ROT90,  "[Konami] (Sega license)", "Frogger (Moon Cresta hardware)", GAME_SUPPORTS_SAVE )
4725GAME( 1981, froggers, frogger,  froggers, frogger,  froggers, ROT90,  "bootleg", "Frog", GAME_SUPPORTS_SAVE )
4726GAME( 1981, frogf,    frogger,  frogf,    frogger,  froggers, ROT90,  "Falcon", "Frog (Falcon bootleg)", GAME_SUPPORTS_SAVE )
4727GAME( 1981, frogg,    frogger,  galaxian, frogg,    frogg,    ROT90,  "bootleg", "Frog (Galaxian hardware)", GAME_SUPPORTS_SAVE )
4728
4729
4730/* Turtles based hardware */
4731GAME( 1981, turtles,  0,        turtles,  turtles,  turtles,  ROT90,  "[Konami] (Stern license)", "Turtles", GAME_SUPPORTS_SAVE )
4732GAME( 1981, turpin,   turtles,  turtles,  turpin,   turtles,  ROT90,  "[Konami] (Sega license)", "Turpin", GAME_SUPPORTS_SAVE )
4733GAME( 1981, 600,      turtles,  turtles,  turtles,  turtles,  ROT90,  "Konami", "600", GAME_SUPPORTS_SAVE )
4734
4735GAME( 1981, amidar,   0,        turtles,  amidar,   turtles,  ROT90,  "Konami", "Amidar", GAME_SUPPORTS_SAVE )
4736GAME( 1982, amidaru,  amidar,   turtles,  amidaru,  turtles,  ROT90,  "Konami (Stern license)", "Amidar (Stern)", GAME_SUPPORTS_SAVE )
4737GAME( 1982, amidaro,  amidar,   turtles,  amidaro,  turtles,  ROT90,  "Konami (Olympia license)", "Amidar (Olympia)", GAME_SUPPORTS_SAVE )
4738GAME( 1982, amidarb,  amidar,   turtles,  amidaru,  turtles,  ROT90,  "bootleg", "Amidar (Bootleg)", GAME_SUPPORTS_SAVE ) /* Simular to Amigo bootleg */
4739GAME( 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 )
4741
4742
4743/* The End/Scramble based hardware */
4744GAME( 1980, theend,   0,        theend,   theend,   theend,   ROT90,  "Konami", "The End", GAME_SUPPORTS_SAVE )
4745GAME( 1980, theends,  theend,   theend,   theend,   theend,   ROT90,  "[Konami] (Stern license)", "The End (Stern)", GAME_SUPPORTS_SAVE )
4746
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 )
4750GAME( 1981, explorer, scramble, explorer, explorer, explorer, ROT90,  "bootleg", "Explorer", GAME_SUPPORTS_SAVE )
4751
4752GAME( 1981, atlantis, 0,        theend,   atlantis, atlantis, ROT90,  "Comsoft", "Battle of Atlantis (set 1)", GAME_SUPPORTS_SAVE )
4753GAME( 1981, atlants2, atlantis, theend,   atlantis, atlantis, ROT90,  "Comsoft", "Battle of Atlantis (set 2)", GAME_SUPPORTS_SAVE )
4754
4755/* Scorpion hardware; based on Scramble but with a 3rd AY-8910 and a speech chip */
4756GAME( 1982, scorpion, 0,      scorpion, scorpion, scorpion, ROT90,  "Zaccaria", "Scorpion (set 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE)
4757GAME( 1982, scrpiona, scorpion, scorpion, scorpion, scorpion, ROT90,  "Zaccaria", "Scorpion (set 2)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE)
4758GAME( 1982, scrpionb, scorpion, scorpion, scorpion, scorpion, ROT90,  "Zaccaria", "Scorpion (set 3)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE)
4759GAME( 19??, scorpnmc, scorpion, mooncrst, scorpnmc, scorpnmc, ROT90,  "Dorneer",  "Scorpion (Moon Cresta hardware)", GAME_SUPPORTS_SAVE )
4760
4761/* SF-X hardware; based on Scramble with extra Z80 and 8255 driving a DAC-based sample player */
4762GAME( 1983, sfx,      0,        sfx,      sfx,      sfx,      ORIENTATION_FLIP_X, "Nichibutsu", "SF-X", GAME_SUPPORTS_SAVE )
4763GAME( 1983, skelagon, sfx,      sfx,      sfx,      sfx,      ORIENTATION_FLIP_X, "Nichibutsu USA", "Skelagon", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE)
4764GAME( 198?, monsterz, 0,        sfx,      sfx,      sfx,      ORIENTATION_FLIP_X, "Nihon", "Monster Zero", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
4765
4766
4767/* scobra */
4768GAME( 1981, scobra,   0,        scobra,   scobra,   scobra,   ROT90,  "Konami", "Super Cobra", GAME_SUPPORTS_SAVE )
4769GAME( 1981, scobras,  scobra,   scobra,   scobras,  scobra,   ROT90,  "[Konami] (Stern license)", "Super Cobra (Stern)", GAME_SUPPORTS_SAVE )
4770GAME( 1981, scobrase, scobra,   scobra,   scobras,  scobra,   ROT90,  "[Konami] (Sega license)", "Super Cobra (Sega)", GAME_SUPPORTS_SAVE )
4771GAME( 1981, scobrab,  scobra,   scobra,   scobras,  scobra,   ROT90,  "bootleg", "Super Cobra (bootleg)", GAME_SUPPORTS_SAVE )
4772
4773GAME( 1982, losttomb, 0,        scobra,   losttomb, losttomb, ROT90,  "Stern", "Lost Tomb (easy)", GAME_SUPPORTS_SAVE )
4774GAME( 1982, losttmbh, losttomb, scobra,   losttomb, losttomb, ROT90,  "Stern", "Lost Tomb (hard)", GAME_SUPPORTS_SAVE )
4775
4776GAME( 1981, armorcar, 0,        scobra,   armorcar, scobra,   ROT90,  "Stern", "Armored Car (set 1)", GAME_SUPPORTS_SAVE )
4777GAME( 1981, armorca2, armorcar, scobra,   armorcar, scobra,   ROT90,  "Stern", "Armored Car (set 2)", GAME_SUPPORTS_SAVE )
4778
4779GAME( 1982, tazmania, 0,        scobra,   tazmania, scobra,   ROT90,  "Stern", "Tazz-Mania (set 1)", GAME_SUPPORTS_SAVE )
4780
4781GAME( 1982, anteater, 0,        scobra,   anteater, anteater, ROT90,  "[Stern] (Tago license)", "Anteater", GAME_SUPPORTS_SAVE )
4782
4783
4784
4785
4786/* currently in galaxold.c and should be moved here */
4787//GAME( 1981, 4in1,     0,        4in1,     4in1,     4in1,     ROT90,  "Armenia / Food and Fun", "4 Fun in 1", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
4788//GAME( 1982, bagmanmc, bagman,   bagmanmc, bagmanmc, galaxian, ROT90,  "bootleg", "Bagman (Moon Cresta hardware)", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
4789//GAME( 1982, dkongjrm, dkongjr,  dkongjrm, dkongjrm, galaxian, ROT90,  "bootleg", "Donkey Kong Jr. (Moon Cresta hardware)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
4790//GAME( 1981, rockclim, 0,        rockclim, rockclim, galaxian, ROT180, "Taito", "Rock Climber", GAME_SUPPORTS_SAVE )
4791//GAME( 1983, ozon1,    0,        ozon1,    ozon1,    galaxian, ROT90,  "Proma", "Ozon I", GAME_SUPPORTS_SAVE )
4792//GAME( 1983, ladybugg, ladybug,  galaxian/*batman2*/,  ladybugg, ladybugg, ROT270, "bootleg", "Ladybug (bootleg on Galaxian hardware)", GAME_SUPPORTS_SAVE )
4793//GAME( 1980, vpool,    hustler,  mooncrst, vpool,    galaxian, ROT90,  "bootleg", "Video Pool (bootleg on Moon Cresta hardware)", GAME_SUPPORTS_SAVE )
4794//GAME( 1984, drivfrcg, drivfrcp, drivfrcg, drivfrcg, galaxian, ROT90,  "Shinkai Inc. (Magic Eletronics USA licence)", "Driving Force (Galaxian conversion)", GAME_SUPPORTS_SAVE )
4795//GAME( 1985, drivfrcb, drivfrcp, drivfrcg, drivfrcg, galaxian, ROT90,  "bootleg", "Driving Force (Galaxian conversion bootleg)", GAME_SUPPORTS_SAVE )
4796//GAME( 1983, bongo,    0,        bongo,    bongo,    galaxian, ROT90,  "Jetsoft", "Bongo", GAME_SUPPORTS_SAVE )
4797//GAME( 1983, hunchbkg, hunchbak,   hunchbkg, hunchbkg, galaxian, ROT90,  "Century Electronics", "Hunchback (Galaxian hardware)", GAME_SUPPORTS_SAVE )
4798//GAME( 1983, harem,    0,        harem,    harem,    galaxian, ROT90,  "I.G.R.", "Harem", GAME_NO_SOUND | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
4799//GAME( 1982, tazzmang, tazmania,   tazzmang, tazzmang, galaxian, ROT90,  "bootleg", "Tazz-Mania (Galaxian Hardware)", GAME_SUPPORTS_SAVE )
4800//GAME( 1986, racknrol, 0,        racknrol, racknrol, galaxian, ROT0,   "Status (Shinkai License)", "Rack + Roll", GAME_SUPPORTS_SAVE )
4801//GAME( 1986, hexpool,  racknrol, racknrol, racknrol, galaxian, ROT90,  "Shinkai", "Hex Pool (Shinkai)", GAME_SUPPORTS_SAVE )
4802//GAME( 1985, hexpoola, racknrol, hexpoola, racknrol, galaxian, ROT90,  "Senko", "Hex Pool (Senko)", GAME_SUPPORTS_SAVE )
4803//GAME( 1985, trvchlng, 0,        racknrol, trvchlng, galaxian, ROT90,  "Joyland (Senko License)", "Trivia Challenge", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
4804//GAME( 1981, ckongg,   0,        ckongg  , ckongg,   galaxian, ROT90,  "bootleg", "Crazy Kong (galaxian)", GAME_SUPPORTS_SAVE )
4805//GAME( 1981, kkgalax,  ckongg,   ckongg  , ckongg,   galaxian, ROT90,  "bootleg", "Crazy Kong (bootleg on Galaxian hardware, set 2)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) // set was marked as 'King Kong on Galaxian'
4806//GAME( 19??, porter,   0,        mooncrst, porter,   mooncrst, ROT90,  "[Nova Games Ltd.] (bootleg)", "Port Man (bootleg on Moon Cresta hardware)", GAME_IMPERFECT_GRAPHICS ) // missing GFX bank switch!
4807
4808/* currently in scramble.c and should be moved here */
4809//GAME( 1982, triplep,  0,        theend  /*triplep*/,  triplep,  scramble_ppi, ROT90, "KKI", "Triple Punch", GAME_SUPPORTS_SAVE )
4810//GAME( 1982, knockout, triplep,  theend  /*triplep*/,  triplep,  scramble_ppi, ROT90, "KKK", "Knock Out!!", GAME_SUPPORTS_SAVE )
4811//GAME( 1981, mariner,  0,        theend  /*mariner*/,  scramble, mariner,      ROT90, "Amenip", "Mariner", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE)
4812//GAME( 1981, 800fath,  mariner,  theend  /*mariner*/,  scramble, mariner,      ROT90, "Amenip (US Billiards Inc. license)", "800 Fathoms", GAME_SUPPORTS_SAVE )
4813//GAME( 1981, ckongs,   ckong,    theend  /*ckongs*/,   ckongs,   ckongs,       ROT90, "bootleg", "Crazy Kong (Scramble hardware)", GAME_SUPPORTS_SAVE )
4814//GAME( 1981, mars,     0,        theend  /*mars*/,     mars,     mars,         ROT90, "Artic", "Mars", GAME_SUPPORTS_SAVE )
4815//GAME( 1982, devilfsh, 0,        theend  /*devilfsh*/, devilfsh, devilfsh,     ROT90, "Artic", "Devil Fish", GAME_SUPPORTS_SAVE )
4816//GAME( 1983, newsin7,  0,        theend  /*newsin7*/,  newsin7,  mars,         ROT90, "ATW USA, Inc.", "New Sinbad 7", GAME_SUPPORTS_SAVE )
4817//GAME( 1984, mrkougar, 0,        theend  /*mrkougar*/, mrkougar, mrkougar,     ROT90, "ATW", "Mr. Kougar", GAME_SUPPORTS_SAVE )
4818//GAME( 1983, mrkougr2, mrkougar, theend  /*mrkougar*/, mrkougar, mrkougar,     ROT90, "ATW", "Mr. Kougar (earlier)", GAME_SUPPORTS_SAVE )
4819//GAME( 1983, mrkougb,  mrkougar, theend  /*mrkougb*/,  mrkougar, mrkougb,      ROT90, "bootleg", "Mr. Kougar (bootleg)", GAME_SUPPORTS_SAVE )
4820//GAME( 1983, mrkougb2, mrkougar, theend  /*mrkougb*/,  mrkougar, mrkougb,      ROT90, "bootleg", "Mr. Kougar (bootleg Set 2)", GAME_SUPPORTS_SAVE )
4821//GAME( 1982, hotshock, 0,        theend  /*hotshock*/, hotshock, hotshock,     ROT90, "E.G. Felaco", "Hot Shocker", GAME_SUPPORTS_SAVE )
4822//GAME( 1982, conquer,  0,        theend  /*hotshock*/, hotshock, 0,            ROT90, "<unknown>", "Conquer", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE)
4823//GAME( 1983, hunchbks, hunchbak, theend  /*hunchbks*/, hunchbks, scramble_ppi, ROT90, "Century Electronics", "Hunchback (Scramble hardware)", GAME_SUPPORTS_SAVE )
4824//GAME( 1984, hncholms, huncholy, theend  /*hncholms*/, hncholms, scramble_ppi, ROT90, "Century Electronics", "Hunchback Olympic (Scramble hardware)", GAME_SUPPORTS_SAVE )
4825//GAME( 1983, cavelon,  0,        theend  /*cavelon*/,  cavelon,  cavelon,      ROT90, "Jetsoft", "Cavelon", GAME_SUPPORTS_SAVE )
4826//GAME( 198?, mimonscr, mimonkey, theend  /*mimonscr*/, mimonscr, mimonscr,     ROT90, "bootleg", "Mighty Monkey (bootleg on Scramble hardware)", GAME_SUPPORTS_SAVE )
4827//GAME( 1983, ad2083,   0,        theend  /*ad2083*/,   ad2083,   ad2083,       ROT90, "Midcoin", "A. D. 2083", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE)
4828//GAME( 1981, turpins,  turtles,  turtles,  turpins,  0,              ROT90, "[Sega] (bootleg)", "Turpin (bootleg on Scramble hardware)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) // haven't hooked up the sound CPU yet
4829
4830/* currently in scobra.c and should be moved here */
4831//GAME( 1981, stratgyx, 0,        scobra/*stratgyx*/, stratgyx, stratgyx,     ROT0,   "Konami", "Strategy X", GAME_SUPPORTS_SAVE )
4832//GAME( 1981, stratgys, stratgyx, scobra/*stratgyx*/, stratgyx, stratgyx,     ROT0,   "[Konami] (Stern license)", "Strategy X (Stern)", GAME_SUPPORTS_SAVE )
4833//GAME( 1981, moonwar,  0,        scobra/*moonwar*/,  moonwar,  moonwar,      ROT90,  "Stern", "Moonwar", GAME_SUPPORTS_SAVE )
4834//GAME( 1981, moonwara, moonwar,  scobra/*moonwar*/,  moonwara, moonwar,      ROT90,  "Stern", "Moonwar (older)", GAME_SUPPORTS_SAVE )
4835//GAME( 1984, spdcoin,  0,        scobra,    spdcoin,  scramble_ppi, ROT90,  "Stern", "Speed Coin (prototype)", GAME_SUPPORTS_SAVE )
4836//GAME( 1982, darkplnt, 0,        scobra/*darkplnt*/, darkplnt, darkplnt,     ROT180, "Stern", "Dark Planet", GAME_SUPPORTS_SAVE )
4837//GAME( 1982, tazmani2, tazmania, scobra/*type2*/,    tazmania, tazmani2,     ROT90,  "Stern", "Tazz-Mania (set 2)", GAME_SUPPORTS_SAVE )
4838//GAME( 1982, calipso,  0,        scobra/*calipso*/,  calipso,  scobra,       ROT90,  "[Stern] (Tago license)", "Calipso", GAME_SUPPORTS_SAVE )
4839//GAME( 1983, anteatg,  anteater, scobra/*anteatg*/,  anteatg,  scramble_ppi, ROT90,  "TV-Tuning (F.E.G. license)", "Ameisenbaer (German)", GAME_SUPPORTS_SAVE )
4840//GAME( 1983, anteatgb, anteater, scobra/*anteatgb*/, anteatgb, scramble_ppi, ROT90,  "Free Enterprise Games", "The Anteater (UK)", GAME_SUPPORTS_SAVE )
4841//GAME( 1982, rescue,   0,        scobra/*rescue*/,   rescue,   rescue,       ROT90,  "Stern", "Rescue", GAME_SUPPORTS_SAVE )
4842//GAME( 1982, aponow,   rescue,   scobra/*rescue*/,   rescue,   rescue,       ROT90,  "bootleg", "Apocaljpse Now", GAME_SUPPORTS_SAVE )
4843//GAME( 1983, minefld,  0,        scobra/*minefld*/,  minefld,  minefld,      ROT90,  "Stern", "Minefield", GAME_SUPPORTS_SAVE )
4844//GAME( 198?, superbon, 0,        scobra,    superbon, superbon,     ROT90,  "bootleg", "Super Bond", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
4845//GAME( 1981, hustler,  0,        scobra/*hustler*/,  hustler,  hustler,      ROT90,  "Konami", "Video Hustler", GAME_SUPPORTS_SAVE )
4846//GAME( 1981, billiard, hustler,  scobra/*hustler*/,  hustler,  billiard,     ROT90,  "bootleg", "The Billiards", GAME_SUPPORTS_SAVE )
4847//GAME( 1981, hustlerb, hustler,  scobra/*hustlerb*/, hustler,  scramble_ppi, ROT90,  "bootleg", "Video Hustler (bootleg)", GAME_SUPPORTS_SAVE )
4848//GAME( 198?, mimonkey, 0,      scobra/*mimonkey*/, mimonkey,   mimonkey,     ROT90,  "Universal Video Games", "Mighty Monkey", GAME_SUPPORTS_SAVE )
4849//GAME( 198?, mimonsco, mimonkey, scobra/*mimonkey*/, mimonsco, mimonsco,     ROT90,  "bootleg", "Mighty Monkey (bootleg on Super Cobra hardware)", GAME_SUPPORTS_SAVE )
4850
4851/* currently in dambustr.c and should be moved here */
4852//GAME( 1981, dambustr, 0,        dambustr, dambustr, dambustr, ROT90, "South West Research", "Dambusters (US)", 0 )
4853//GAME( 1981, dambust,  dambustr, dambustr, dambustr, dambustr, ROT90, "South West Research", "Dambusters (UK)", 0 )
4854
4855/* misc stuff that should eventually be moved here */
4856//GAME( 1981, scramblb, scramble, scramblb, scramblb, galaxian, ROT90,  "bootleg", "Scramble (Galaxian hardware)", GAME_SUPPORTS_SAVE )
4857//GAME( 1981, scramb2,  scramble, scramb2,  scramb2,  0,        ROT90,  "bootleg", "Scramble (bootleg)", GAME_SUPPORTS_SAVE )
src/mame/drivers/m62.c
r2241r2242
13771377
13781378   MDRV_VIDEO_START(ldrun2)
13791379   MDRV_VIDEO_UPDATE(ldrun)
1380
1381   MDRV_SCREEN_MODIFY("main")
1382   MDRV_SCREEN_VISIBLE_AREA((64*8-384)/2, 64*8-(64*8-384)/2-1, 0*8, 31*8-1)
13831380MACHINE_DRIVER_END
13841381
13851382
r2241r2242
13931390
13941391   /* video hardware */
13951392   MDRV_GFXDECODE(ldrun3)
1396
1397   MDRV_SCREEN_MODIFY("main")
1398   MDRV_SCREEN_VISIBLE_AREA((64*8-384)/2, 64*8-(64*8-384)/2-1, 0*8, 31*8-1)
13991393MACHINE_DRIVER_END
14001394
14011395
src/mame/drivers/deco156.c
r2241r2242
158158
159159static WRITE32_HANDLER(hvysmsh_eeprom_w)
160160{
161   if (ACCESSING_LSB32) {
161   if (ACCESSING_BITS_0_7) {
162162
163163      OKIM6295_set_bank_base(1, 0x40000 * (data & 0x7) );
164164
r2241r2242
201201
202202static WRITE32_HANDLER(wcvol95_eeprom_w)
203203{
204   if (ACCESSING_LSB32) {
204   if (ACCESSING_BITS_0_7) {
205205      EEPROM_set_clock_line((data & 0x2) ? ASSERT_LINE : CLEAR_LINE);
206206      EEPROM_write_bit(data & 0x1);
207207      EEPROM_set_cs_line((data & 0x4) ? CLEAR_LINE : ASSERT_LINE);
src/mame/drivers/toki.c
r2241r2242
163163/*****************************************************************************/
164164
165165static INPUT_PORTS_START( toki )
166   SEIBU_COIN_INPUTS   /* Must be port 0: coin inputs read through sound cpu */
166   SEIBU_COIN_INPUTS   /* coin inputs read through sound cpu */
167167
168168   PORT_START_TAG("DSW0")
169169   PORT_DIPNAME( 0x001f, 0x001f, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3,4,5")
r2241r2242
842842GAME( 1989, tokib, toki, tokib, tokib, tokib, ROT0, "bootleg", "Toki (bootleg)", 0 )
843843/* Sound hardware seems to have been slightly modified, the coins are handled ok, but there is no music and bad sfx.  Program roms have a slight bitswap, Flipscreen also seems to be ignored */
844844GAME( 1989, jujub, toki, toki,  toki,  jujub, ROT180, "bootleg", "JuJu Densetsu (Japan, bootleg)", GAME_IMPERFECT_SOUND ) // bootleg of tokia/tokij revison
845
src/mame/drivers/othunder.c
r2241r2242
358358
359359static WRITE16_HANDLER( othunder_TC0220IOC_w )
360360{
361   if (ACCESSING_LSB)
361   if (ACCESSING_BITS_0_7)
362362   {
363363      switch (offset)
364364      {
src/mame/drivers/tail2nos.c
r2241r2242
3939
4040static WRITE16_HANDLER( sound_command_w )
4141{
42   if (ACCESSING_LSB)
42   if (ACCESSING_BITS_0_7)
4343   {
4444      soundlatch_w(machine,offset,data & 0xff);
4545      cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
r2241r2242
5353
5454static WRITE16_HANDLER( tail2nos_K051316_0_w )
5555{
56   if (ACCESSING_LSB)
56   if (ACCESSING_BITS_0_7)
5757      K051316_0_w(machine,offset,data & 0xff);
5858}
5959
6060static WRITE16_HANDLER( tail2nos_K051316_ctrl_0_w )
6161{
62   if (ACCESSING_LSB)
62   if (ACCESSING_BITS_0_7)
6363      K051316_ctrl_0_w(machine,offset,data & 0xff);
6464}
6565
src/mame/drivers/ertictac.c
r2241r2242
6363
6464static WRITE32_HANDLER(IRQRQA_w)
6565{
66   if(ACCESSING_LSB32)
66   if(ACCESSING_BITS_0_7)
6767      IRQSTA&=~data;
6868}
6969
r2241r2242
7474
7575static WRITE32_HANDLER(IRQMSKA_w)
7676{
77   if(ACCESSING_LSB32)
77   if(ACCESSING_BITS_0_7)
7878      IRQMSKA=(data&(~2))|0x80;
7979}
8080
r2241r2242
9090
9191static WRITE32_HANDLER(IRQMSKB_w)
9292{
93   if(ACCESSING_LSB32)
93   if(ACCESSING_BITS_0_7)
9494      IRQMSKB=data;
9595}
9696
r2241r2242
101101
102102static WRITE32_HANDLER(FIQMSK_w)
103103{
104   if(ACCESSING_LSB32)
104   if(ACCESSING_BITS_0_7)
105105      FIQMSK=(data&(~0x2c))|0x80;
106106}
107107
r2241r2242
112112
113113static WRITE32_HANDLER(T1low_w)
114114{
115   if(ACCESSING_LSB32)
115   if(ACCESSING_BITS_0_7)
116116      T1low=data;
117117}
118118
r2241r2242
123123
124124static WRITE32_HANDLER(T1high_w)
125125{
126   if(ACCESSING_LSB32)
126   if(ACCESSING_BITS_0_7)
127127      T1high=data;
128128}
129129
src/mame/drivers/xyonix.c
r2241r2242
152152static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
153153   AM_RANGE(0x0000, 0xbfff) AM_ROM
154154   AM_RANGE(0xc000, 0xdfff) AM_RAM
155   AM_RANGE(0xe000, 0xffff) AM_READWRITE(SMH_RAM, xyonix_vidram_w) AM_BASE(&xyonix_vidram)
155   AM_RANGE(0xe000, 0xffff) AM_RAM AM_WRITE(xyonix_vidram_w) AM_BASE(&xyonix_vidram)
156156ADDRESS_MAP_END
157157
158158static ADDRESS_MAP_START( port_map, ADDRESS_SPACE_IO, 8 )
src/mame/drivers/psikyo4.c
r2241r2242
200200
201201static WRITE32_HANDLER( ps4_eeprom_w )
202202{
203   if (ACCESSING_MSW32)
203   if (ACCESSING_BITS_16_31)
204204   {
205205      EEPROM_write_bit((data & 0x00200000) ? 1 : 0);
206206      EEPROM_set_cs_line((data & 0x00800000) ? CLEAR_LINE : ASSERT_LINE);
r2241r2242
214214
215215static READ32_HANDLER( ps4_eeprom_r )
216216{
217   if (ACCESSING_MSW32)
217   if (ACCESSING_BITS_16_31)
218218   {
219219      return ((EEPROM_read_bit() << 20)); /* EEPROM */
220220   }
r2241r2242
286286
287287static WRITE32_HANDLER( ps4_screen1_brt_w )
288288{
289   if(ACCESSING_LSB32) {
289   if(ACCESSING_BITS_0_7) {
290290      /* Need seperate brightness for both screens if displaying together */
291291      double brt1 = data & 0xff;
292292      static double oldbrt1;
r2241r2242
312312
313313static WRITE32_HANDLER( ps4_screen2_brt_w )
314314{
315   if(ACCESSING_LSB32) {
315   if(ACCESSING_BITS_0_7) {
316316      /* Need seperate brightness for both screens if displaying together */
317317      double brt2 = data & 0xff;
318318      static double oldbrt2;
r2241r2242
344344#if ROMTEST
345345   if(offset==2) /* Configure bank for gfx test */
346346   {
347      if (!(mem_mask & 0x000000ff) || !(mem_mask & 0x0000ff00))   // Bank
347      if (ACCESSING_BITS_0_15)   // Bank
348348      {
349349         UINT8 *ROM = memory_region(REGION_GFX1);
350350         memory_set_bankptr(2,&ROM[0x2000 * (psikyo4_vidregs[offset]&0x1fff)]); /* Bank comes from vidregs */
r2241r2242
370370
371371static WRITE32_HANDLER( psh_ymf_fm_w )
372372{
373   if (!(mem_mask & 0xff000000))   // FM bank 1 address (OPL2/OPL3 compatible)
373   if (ACCESSING_BITS_24_31)   // FM bank 1 address (OPL2/OPL3 compatible)
374374   {
375375      YMF278B_control_port_0_A_w(machine, 0, data>>24);
376376   }
377377
378   if (!(mem_mask & 0x00ff0000))   // FM bank 1 data
378   if (ACCESSING_BITS_16_23)   // FM bank 1 data
379379   {
380380      YMF278B_data_port_0_A_w(machine, 0, data>>16);
381381   }
382382
383   if (!(mem_mask & 0x0000ff00))   // FM bank 2 address (OPL3/YMF 262 extended)
383   if (ACCESSING_BITS_8_15)   // FM bank 2 address (OPL3/YMF 262 extended)
384384   {
385385      YMF278B_control_port_0_B_w(machine, 0, data>>8);
386386   }
387387
388   if (!(mem_mask & 0x000000ff))   // FM bank 2 data
388   if (ACCESSING_BITS_0_7)   // FM bank 2 data
389389   {
390390      YMF278B_data_port_0_B_w(machine, 0, data);
391391   }
r2241r2242
393393
394394static WRITE32_HANDLER( psh_ymf_pcm_w )
395395{
396   if (!(mem_mask & 0xff000000))   // PCM address (OPL4/YMF 278B extended)
396   if (ACCESSING_BITS_24_31)   // PCM address (OPL4/YMF 278B extended)
397397   {
398398      YMF278B_control_port_0_C_w(machine, 0, data>>24);
399399
r2241r2242
405405#endif
406406   }
407407
408   if (!(mem_mask & 0x00ff0000))   // PCM data
408   if (ACCESSING_BITS_16_23)   // PCM data
409409   {
410410      YMF278B_data_port_0_C_w(machine, 0, data>>16);
411411   }
src/mame/drivers/vigilant.c
r2241r2242
7070
7171
7272
73static ADDRESS_MAP_START( vigilant_readmem, ADDRESS_SPACE_PROGRAM, 8 )
74   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
75   AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_BANK1)
76   AM_RANGE(0xc020, 0xc0df) AM_READ(SMH_RAM)
77   AM_RANGE(0xc800, 0xcfff) AM_READ(SMH_RAM)
78   AM_RANGE(0xd000, 0xdfff) AM_READ(SMH_RAM)
79   AM_RANGE(0xe000, 0xefff) AM_READ(SMH_RAM)
73static ADDRESS_MAP_START( vigilant_map, ADDRESS_SPACE_PROGRAM, 8 )
74   AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_BANK1)      /* Fallthrough */
75   AM_RANGE(0x0000, 0xbfff) AM_ROM
76   AM_RANGE(0xc020, 0xc0df) AM_RAM AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
77   AM_RANGE(0xc800, 0xcfff) AM_RAM AM_WRITE(vigilant_paletteram_w) AM_BASE(&paletteram)
78   AM_RANGE(0xd000, 0xdfff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
79   AM_RANGE(0xe000, 0xefff) AM_RAM
8080ADDRESS_MAP_END
8181
82static ADDRESS_MAP_START( vigilant_writemem, ADDRESS_SPACE_PROGRAM, 8 )
83   AM_RANGE(0x0000, 0xbfff) AM_WRITE(SMH_ROM)
84   AM_RANGE(0xc020, 0xc0df) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
85   AM_RANGE(0xc800, 0xcfff) AM_WRITE(vigilant_paletteram_w) AM_BASE(&paletteram)
86   AM_RANGE(0xd000, 0xdfff) AM_WRITE(SMH_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
87   AM_RANGE(0xe000, 0xefff) AM_WRITE(SMH_RAM)
88ADDRESS_MAP_END
89
90static ADDRESS_MAP_START( vigilant_readport, ADDRESS_SPACE_IO, 8 )
82static ADDRESS_MAP_START( vigilant_io_map, ADDRESS_SPACE_IO, 8 )
9183   ADDRESS_MAP_GLOBAL_MASK(0xff)
92   AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r)
93   AM_RANGE(0x01, 0x01) AM_READ(input_port_1_r)
84   AM_RANGE(0x00, 0x00) AM_READWRITE(input_port_0_r, m72_sound_command_byte_w)   /* SD */
85   AM_RANGE(0x01, 0x01) AM_READWRITE(input_port_1_r, vigilant_out2_w)          /* OUT2 */
9486   AM_RANGE(0x02, 0x02) AM_READ(input_port_2_r)
9587   AM_RANGE(0x03, 0x03) AM_READ(input_port_3_r)
96   AM_RANGE(0x04, 0x04) AM_READ(input_port_4_r)
97ADDRESS_MAP_END
98
99static ADDRESS_MAP_START( vigilant_writeport, ADDRESS_SPACE_IO, 8 )
100   ADDRESS_MAP_GLOBAL_MASK(0xff)
101   AM_RANGE(0x00, 0x00) AM_WRITE(m72_sound_command_byte_w)  /* SD */
102   AM_RANGE(0x01, 0x01) AM_WRITE(vigilant_out2_w) /* OUT2 */
103   AM_RANGE(0x04, 0x04) AM_WRITE(vigilant_bank_select_w) /* PBANK */
104   AM_RANGE(0x80, 0x81) AM_WRITE(vigilant_horiz_scroll_w) /* HSPL, HSPH */
88   AM_RANGE(0x04, 0x04) AM_READWRITE(input_port_4_r, vigilant_bank_select_w)   /* PBANK */
89   AM_RANGE(0x80, 0x81) AM_WRITE(vigilant_horiz_scroll_w)       /* HSPL, HSPH */
10590   AM_RANGE(0x82, 0x83) AM_WRITE(vigilant_rear_horiz_scroll_w) /* RHSPL, RHSPH */
106   AM_RANGE(0x84, 0x84) AM_WRITE(vigilant_rear_color_w) /* RCOD */
91   AM_RANGE(0x84, 0x84) AM_WRITE(vigilant_rear_color_w)       /* RCOD */
10792ADDRESS_MAP_END
10893
109static ADDRESS_MAP_START( kikcubic_readmem, ADDRESS_SPACE_PROGRAM, 8 )
110   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
111   AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_BANK1)
112   AM_RANGE(0xc000, 0xc0ff) AM_READ(SMH_RAM)
113   AM_RANGE(0xc800, 0xcaff) AM_READ(SMH_RAM)
114   AM_RANGE(0xd000, 0xdfff) AM_READ(SMH_RAM)
115   AM_RANGE(0xe000, 0xffff) AM_READ(SMH_RAM)
94static ADDRESS_MAP_START( kikcubic_map, ADDRESS_SPACE_PROGRAM, 8 )
95   AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_BANK1)      /* Fallthrough */
96   AM_RANGE(0x0000, 0xbfff) AM_ROM
97   AM_RANGE(0xc000, 0xc0ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
98   AM_RANGE(0xc800, 0xcaff) AM_RAM AM_WRITE(vigilant_paletteram_w) AM_BASE(&paletteram)
99   AM_RANGE(0xd000, 0xdfff) AM_RAM AM_WRITE(SMH_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
100   AM_RANGE(0xe000, 0xffff) AM_RAM
116101ADDRESS_MAP_END
117102
118static ADDRESS_MAP_START( kikcubic_writemem, ADDRESS_SPACE_PROGRAM, 8 )
119   AM_RANGE(0x0000, 0xbfff) AM_WRITE(SMH_ROM)
120   AM_RANGE(0xc000, 0xc0ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
121   AM_RANGE(0xc800, 0xcaff) AM_WRITE(vigilant_paletteram_w) AM_BASE(&paletteram)
122   AM_RANGE(0xd000, 0xdfff) AM_WRITE(SMH_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
123   AM_RANGE(0xe000, 0xffff) AM_WRITE(SMH_RAM)
124ADDRESS_MAP_END
125
126static ADDRESS_MAP_START( kikcubic_readport, ADDRESS_SPACE_IO, 8 )
103static ADDRESS_MAP_START( kikcubic_io_map, ADDRESS_SPACE_IO, 8 )
127104   ADDRESS_MAP_GLOBAL_MASK(0xff)
128   AM_RANGE(0x00, 0x00) AM_READ(input_port_3_r)
105   AM_RANGE(0x00, 0x00) AM_READWRITE(input_port_3_r, kikcubic_coin_w)   /* also flip screen, and...? */
129106   AM_RANGE(0x01, 0x01) AM_READ(input_port_4_r)
130107   AM_RANGE(0x02, 0x02) AM_READ(input_port_0_r)
131108   AM_RANGE(0x03, 0x03) AM_READ(input_port_1_r)
132   AM_RANGE(0x04, 0x04) AM_READ(input_port_2_r)
133ADDRESS_MAP_END
134
135static ADDRESS_MAP_START( kikcubic_writeport, ADDRESS_SPACE_IO, 8 )
136   ADDRESS_MAP_GLOBAL_MASK(0xff)
137   AM_RANGE(0x00, 0x00) AM_WRITE(kikcubic_coin_w)   /* also flip screen, and...? */
138   AM_RANGE(0x04, 0x04) AM_WRITE(vigilant_bank_select_w)
109   AM_RANGE(0x04, 0x04) AM_READWRITE(input_port_2_r, vigilant_bank_select_w)
139110   AM_RANGE(0x06, 0x06) AM_WRITE(m72_sound_command_byte_w)
140111//  AM_RANGE(0x07, 0x07) AM_WRITE(SMH_NOP) /* ?? */
141112ADDRESS_MAP_END
142113
143static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
144   AM_RANGE(0x0000, 0xbfff) AM_READ(SMH_ROM)
145   AM_RANGE(0xf000, 0xffff) AM_READ(SMH_RAM)
114static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
115   AM_RANGE(0x0000, 0xbfff) AM_ROM
116   AM_RANGE(0xf000, 0xffff) AM_RAM
146117ADDRESS_MAP_END
147118
148static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
149   AM_RANGE(0x0000, 0xbfff) AM_WRITE(SMH_ROM)
150   AM_RANGE(0xf000, 0xffff) AM_WRITE(SMH_RAM)
151ADDRESS_MAP_END
152
153static ADDRESS_MAP_START( sound_readport, ADDRESS_SPACE_IO, 8 )
119static ADDRESS_MAP_START( sound_io_map, ADDRESS_SPACE_IO, 8 )
154120   ADDRESS_MAP_GLOBAL_MASK(0xff)
155   AM_RANGE(0x01, 0x01) AM_READ(YM2151_status_port_0_r)
156   AM_RANGE(0x80, 0x80) AM_READ(soundlatch_r)   /* SDRE */
157   AM_RANGE(0x84, 0x84) AM_READ(m72_sample_r)   /* S ROM C */
158ADDRESS_MAP_END
159
160static ADDRESS_MAP_START( sound_writeport, ADDRESS_SPACE_IO, 8 )
161   ADDRESS_MAP_GLOBAL_MASK(0xff)
162121   AM_RANGE(0x00, 0x00) AM_WRITE(YM2151_register_port_0_w)
163   AM_RANGE(0x01, 0x01) AM_WRITE(YM2151_data_port_0_w)
164   AM_RANGE(0x80, 0x81) AM_WRITE(vigilant_sample_addr_w)   /* STL / STH */
122   AM_RANGE(0x01, 0x01) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w)
123   AM_RANGE(0x80, 0x81) AM_READWRITE(soundlatch_r, vigilant_sample_addr_w)   /* STL / STH */
165124   AM_RANGE(0x82, 0x82) AM_WRITE(m72_sample_w)         /* COUNT UP */
166125   AM_RANGE(0x83, 0x83) AM_WRITE(m72_sound_irq_ack_w)   /* IRQ clear */
167ADDRESS_MAP_END
168
169
170static ADDRESS_MAP_START( buccanrs_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
171   AM_RANGE(0x0000, 0xbfff) AM_READ(SMH_ROM)
172   AM_RANGE(0xf000, 0xffff) AM_READ(SMH_RAM)
173ADDRESS_MAP_END
174
175static ADDRESS_MAP_START( buccanrs_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
176   AM_RANGE(0x0000, 0xbfff) AM_WRITE(SMH_ROM)
177   AM_RANGE(0xf000, 0xffff) AM_WRITE(SMH_RAM)
178ADDRESS_MAP_END
179
180static ADDRESS_MAP_START( buccanrs_sound_readport, ADDRESS_SPACE_IO, 8 )
181   ADDRESS_MAP_GLOBAL_MASK(0xff)
182   AM_RANGE(0x00, 0x00) AM_READ(YM2203_status_port_0_r)
183   AM_RANGE(0x01, 0x01) AM_READ(YM2203_read_port_0_r)
184   AM_RANGE(0x02, 0x02) AM_READ(YM2203_status_port_1_r)
185   AM_RANGE(0x03, 0x03) AM_READ(YM2203_read_port_1_r)
186   AM_RANGE(0x80, 0x80) AM_READ(soundlatch_r)   /* SDRE */
187126   AM_RANGE(0x84, 0x84) AM_READ(m72_sample_r)   /* S ROM C */
188127ADDRESS_MAP_END
189128
190static ADDRESS_MAP_START( buccanrs_sound_writeport, ADDRESS_SPACE_IO, 8 )
129static ADDRESS_MAP_START( buccanrs_sound_io_map, ADDRESS_SPACE_IO, 8 )
191130   ADDRESS_MAP_GLOBAL_MASK(0xff)
192   AM_RANGE(0x00, 0x00) AM_WRITE(YM2203_control_port_0_w)
193   AM_RANGE(0x01, 0x01) AM_WRITE(YM2203_write_port_0_w)
194   AM_RANGE(0x02, 0x02) AM_WRITE(YM2203_control_port_1_w)
195   AM_RANGE(0x03, 0x03) AM_WRITE(YM2203_write_port_1_w)
131   AM_RANGE(0x00, 0x00) AM_READWRITE(YM2203_status_port_0_r, YM2203_control_port_0_w)
132   AM_RANGE(0x01, 0x01) AM_READWRITE(YM2203_read_port_0_r, YM2203_write_port_0_w)
133   AM_RANGE(0x02, 0x02) AM_READWRITE(YM2203_status_port_1_r, YM2203_control_port_1_w)
134   AM_RANGE(0x03, 0x03) AM_READWRITE(YM2203_read_port_1_r, YM2203_write_port_1_w)
135   AM_RANGE(0x80, 0x80) AM_READ(soundlatch_r)            /* SDRE */
196136   AM_RANGE(0x80, 0x81) AM_WRITE(vigilant_sample_addr_w)   /* STL / STH */
197   AM_RANGE(0x82, 0x82) AM_WRITE(m72_sample_w)         /* COUNT UP */
198   AM_RANGE(0x83, 0x83) AM_WRITE(m72_sound_irq_ack_w)   /* IRQ clear */
137   AM_RANGE(0x82, 0x82) AM_WRITE(m72_sample_w)            /* COUNT UP */
138   AM_RANGE(0x83, 0x83) AM_WRITE(m72_sound_irq_ack_w)      /* IRQ clear */
139   AM_RANGE(0x84, 0x84) AM_READ(m72_sample_r)            /* S ROM C */
199140ADDRESS_MAP_END
200141
201142
r2241r2242
583524
584525   /* basic machine hardware */
585526   MDRV_CPU_ADD(Z80, 3579645)         /* 3.579645 MHz */
586   MDRV_CPU_PROGRAM_MAP(vigilant_readmem,vigilant_writemem)
587   MDRV_CPU_IO_MAP(vigilant_readport,vigilant_writeport)
527   MDRV_CPU_PROGRAM_MAP(vigilant_map,0)
528   MDRV_CPU_IO_MAP(vigilant_io_map,0)
588529   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
589530
590531   MDRV_CPU_ADD(Z80, 3579645)
591532   /* audio CPU */         /* 3.579645 MHz */
592   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
593   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
533   MDRV_CPU_PROGRAM_MAP(sound_map,0)
534   MDRV_CPU_IO_MAP(sound_io_map,0)
594535   MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128)   /* clocked by V1 */
595536                        /* IRQs are generated by main Z80 and YM2151 */
596537   MDRV_MACHINE_RESET(m72_sound)
r2241r2242
626567
627568   /* basic machine hardware */
628569   MDRV_CPU_ADD(Z80, 5688800)         /* 5.688800 MHz */
629   MDRV_CPU_PROGRAM_MAP(vigilant_readmem,vigilant_writemem)
630   MDRV_CPU_IO_MAP(vigilant_readport,vigilant_writeport)
570   MDRV_CPU_PROGRAM_MAP(vigilant_map,0)
571   MDRV_CPU_IO_MAP(vigilant_io_map,0)
631572   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
632573
633574   MDRV_CPU_ADD(Z80, 18432000/6)
634575   /* audio CPU */         /* 3.072000 MHz */
635   MDRV_CPU_PROGRAM_MAP(buccanrs_sound_readmem,buccanrs_sound_writemem)
636   MDRV_CPU_IO_MAP(buccanrs_sound_readport,buccanrs_sound_writeport)
576   MDRV_CPU_PROGRAM_MAP(sound_map,0)
577   MDRV_CPU_IO_MAP(buccanrs_sound_io_map,0)
637578   MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128)   /* clocked by V1 */
638579                        /* IRQs are generated by main Z80 and YM2151 */
639580   MDRV_MACHINE_RESET(m72_sound)
r2241r2242
685626
686627   /* basic machine hardware */
687628   MDRV_CPU_ADD(Z80, 3579645)         /* 3.579645 MHz */
688   MDRV_CPU_PROGRAM_MAP(kikcubic_readmem,kikcubic_writemem)
689   MDRV_CPU_IO_MAP(kikcubic_readport,kikcubic_writeport)
629   MDRV_CPU_PROGRAM_MAP(kikcubic_map,0)
630   MDRV_CPU_IO_MAP(kikcubic_io_map,0)
690631   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
691632
692633   MDRV_CPU_ADD(Z80, 3579645)
693634   /* audio CPU */         /* 3.579645 MHz */
694   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
695   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
635   MDRV_CPU_PROGRAM_MAP(sound_map,0)
636   MDRV_CPU_IO_MAP(sound_io_map,0)
696637   MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128)   /* clocked by V1 */
697638                        /* IRQs are generated by main Z80 and YM2151 */
698639   MDRV_MACHINE_RESET(m72_sound)
src/mame/drivers/blockout.c
r2241r2242
3737
3838static WRITE16_HANDLER( blockout_sound_command_w )
3939{
40   if (ACCESSING_LSB)
40   if (ACCESSING_BITS_0_7)
4141   {
4242      soundlatch_w(machine,offset,data & 0xff);
4343      cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
src/mame/drivers/tsamurai.c
r2241r2242
104104static WRITE8_HANDLER( sound_command1_w )
105105{
106106   sound_command1 = data;
107   cpunum_set_input_line(Machine, 1, 0, HOLD_LINE );
107   cpunum_set_input_line(machine, 1, 0, HOLD_LINE );
108108}
109109
110110static WRITE8_HANDLER( sound_command2_w )
111111{
112112   sound_command2 = data;
113   cpunum_set_input_line(Machine, 2, 0, HOLD_LINE );
113   cpunum_set_input_line(machine, 2, 0, HOLD_LINE );
114114}
115115
116116static WRITE8_HANDLER( sound_command3_w )
117117{
118118   sound_command3 = data;
119   cpunum_set_input_line(Machine, 3, 0, HOLD_LINE );
119   cpunum_set_input_line(machine, 3, 0, HOLD_LINE );
120120}
121121
122122static WRITE8_HANDLER( flip_screen_w )
r2241r2242
365365
366366static READ8_HANDLER( vsgongf_a006_r ){
367367   /* sound CPU busy? */
368   if (!strcmp(Machine->gamedrv->name,"vsgongf"))  return 0x80;
369   if (!strcmp(Machine->gamedrv->name,"ringfgt"))  return 0x80;
370   if (!strcmp(Machine->gamedrv->name,"ringfgt2")) return 0xc0;
368   if (!strcmp(machine->gamedrv->name,"vsgongf"))  return 0x80;
369   if (!strcmp(machine->gamedrv->name,"ringfgt"))  return 0x80;
370   if (!strcmp(machine->gamedrv->name,"ringfgt2")) return 0xc0;
371371
372372   logerror ("unhandled read from a006\n");
373373   return 0x00;
r2241r2242
375375
376376static READ8_HANDLER( vsgongf_a100_r ){
377377   /* protection? */
378   if (!strcmp(Machine->gamedrv->name,"vsgongf"))  return 0xaa;
379   if (!strcmp(Machine->gamedrv->name,"ringfgt"))  return 0x63;
380   if (!strcmp(Machine->gamedrv->name,"ringfgt2")) return 0x6a;
378   if (!strcmp(machine->gamedrv->name,"vsgongf"))  return 0xaa;
379   if (!strcmp(machine->gamedrv->name,"ringfgt"))  return 0x63;
380   if (!strcmp(machine->gamedrv->name,"ringfgt2")) return 0x6a;
381381
382382   logerror ("unhandled read from a100\n");
383383   return 0x00;
src/mame/drivers/splash.c
r2241r2242
6868
6969static WRITE16_HANDLER( splash_sh_irqtrigger_w )
7070{
71   if (ACCESSING_LSB){
71   if (ACCESSING_BITS_0_7){
7272      soundlatch_w(machine,0,data & 0xff);
7373      cpunum_set_input_line(machine, 1,0,HOLD_LINE);
7474   }
r2241r2242
7676
7777static WRITE16_HANDLER( roldf_sh_irqtrigger_w )
7878{
79   if (ACCESSING_LSB){
79   if (ACCESSING_BITS_0_7){
8080      soundlatch_w(machine,0,data & 0xff);
8181      cpunum_set_input_line(machine, 1,0,HOLD_LINE);
8282   }
r2241r2242
102102
103103static WRITE16_HANDLER( splash_coin_w )
104104{
105   if (ACCESSING_MSB){
105   if (ACCESSING_BITS_8_15){
106106      switch ((offset >> 3)){
107107         case 0x00:   /* Coin Lockouts */
108108         case 0x01:
src/mame/drivers/jalmah.c
r2241r2242
441441     ---- xxxx Priority number (trusted,see mjzoomin)
442442    */
443443   //popmessage("Write to tilebank %02x",data);
444   if (ACCESSING_LSB)
444   if (ACCESSING_BITS_0_7)
445445   {
446446      if (sc0bank != ((data & 0xf0) >> 4))
447447      {
r2241r2242
491491
492492static WRITE16_HANDLER( jalmah_okirom_w )
493493{
494   if(ACCESSING_LSB)
494   if(ACCESSING_BITS_0_7)
495495   {
496496      UINT8 *oki = memory_region(REGION_SOUND1);
497497      oki_rom = data & 1;
r2241r2242
505505
506506static WRITE16_HANDLER( jalmah_okibank_w )
507507{
508   if(ACCESSING_LSB)
508   if(ACCESSING_BITS_0_7)
509509   {
510510      UINT8 *oki = memory_region(REGION_SOUND1);
511511      oki_bank = data & 3;
r2241r2242
13191319*/
13201320static WRITE16_HANDLER( urashima_mcu_w )
13211321{
1322   if(ACCESSING_LSB && data)
1322   if(ACCESSING_BITS_0_7 && data)
13231323   {
13241324      //jm_regs[0x30e/2] = ?
13251325
r2241r2242
14701470*/
14711471static WRITE16_HANDLER( daireika_mcu_w )
14721472{
1473   if(ACCESSING_LSB && data)
1473   if(ACCESSING_BITS_0_7 && data)
14741474   {
14751475      /*MCU program upload complete/upload kind*/
14761476      //jm_regs[0x000e/2] = 0x0005;
r2241r2242
17551755*/
17561756static WRITE16_HANDLER( mjzoomin_mcu_w )
17571757{
1758   if(ACCESSING_LSB && data)
1758   if(ACCESSING_BITS_0_7 && data)
17591759   {
17601760      /*******************************************************
17611761        1st M68k code uploaded by the MCU(Service Mode PC=2a56).
src/mame/drivers/f1gp.c
r2241r2242
6969
7070static WRITE16_HANDLER( sound_command_w )
7171{
72   if (ACCESSING_LSB)
72   if (ACCESSING_BITS_0_7)
7373   {
7474      pending_command = 1;
7575      soundlatch_w(machine,offset,data & 0xff);
src/mame/drivers/namcos2.c
r2241r2242
524524
525525static WRITE16_HANDLER( namcos2_68k_dpram_word_w )
526526{
527   if( ACCESSING_LSB )
527   if( ACCESSING_BITS_0_7 )
528528   {
529529      namcos2_dpram[offset] = data&0xff;
530530
src/mame/drivers/tecmosys.c
r2241r2242
268268
269269static READ16_HANDLER(reg_b80000_r)
270270{
271   if (ACCESSING_MSB)
271   if (ACCESSING_BITS_8_15)
272272   {
273273      // Bit 7: 0 = ready to write
274274      // Bit 6: 0 = ready to read
r2241r2242
338338
339339static WRITE16_HANDLER( eeprom_w )
340340{
341   if ( ACCESSING_MSB )
341   if ( ACCESSING_BITS_8_15 )
342342   {
343343      EEPROM_write_bit(data & 0x0800);
344344      EEPROM_set_cs_line((data & 0x0200) ? CLEAR_LINE : ASSERT_LINE );
src/mame/drivers/tx1.c
r2241r2242
467467   AM_RANGE(0x3000, 0x37ff) AM_RAM AM_MIRROR(0x800) AM_BASE(&z80_ram)
468468   AM_RANGE(0x4000, 0x4000) AM_WRITE(z80_intreq_w)
469469   AM_RANGE(0x5000, 0x5003) AM_READWRITE(ppi8255_0_r, ppi8255_0_w)
470   AM_RANGE(0x6000, 0x6003) AM_READWRITE(pit8253_r, pit8253_w)
470   AM_RANGE(0x6000, 0x6003) AM_READWRITE(tx1_pit8253_r, tx1_pit8253_w)
471471   AM_RANGE(0x7000, 0x7fff) AM_WRITE(tx1_ppi_latch_w)
472472   AM_RANGE(0xb000, 0xbfff) AM_READWRITE(ts_r, ts_w)
473473ADDRESS_MAP_END
r2241r2242
570570static ADDRESS_MAP_START( buggybjr_sound_prg, ADDRESS_SPACE_PROGRAM, 8 )
571571   AM_RANGE(0x0000, 0x3fff) AM_ROM
572572   AM_RANGE(0x4000, 0x47ff) AM_RAM AM_BASE(&z80_ram)
573   AM_RANGE(0x5000, 0x5003) AM_READWRITE(pit8253_r, pit8253_w)
573   AM_RANGE(0x5000, 0x5003) AM_READWRITE(tx1_pit8253_r, tx1_pit8253_w)
574574   AM_RANGE(0x6000, 0x6001) AM_READ(bbjr_analog_r)
575575   AM_RANGE(0x7000, 0x7000) AM_WRITE(z80_intreq_w)
576576   AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(ts_r, ts_w)
src/mame/drivers/dambustr.c
r2241r2242
1111#include "driver.h"
1212
1313#include "cpu/z80/z80.h"
14#include "galaxian.h"
14#include "galaxold.h"
1515
1616
1717PALETTE_INIT( dambustr );
r2241r2242
3636   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
3737   AM_RANGE(0xc000, 0xc7ff) AM_READ(SMH_RAM)
3838   AM_RANGE(0xd000, 0xd3ff) AM_READ(SMH_RAM)
39   AM_RANGE(0xd400, 0xd7ff) AM_READ(galaxian_videoram_r)
39   AM_RANGE(0xd400, 0xd7ff) AM_READ(galaxold_videoram_r)
4040   AM_RANGE(0xd800, 0xd8ff) AM_READ(SMH_RAM)
4141   AM_RANGE(0xe000, 0xe000) AM_READ(input_port_0_r)
4242   AM_RANGE(0xe800, 0xefff) AM_READ(input_port_1_r)
r2241r2242
5050   AM_RANGE(0xc000, 0xc7ff) AM_WRITE(SMH_RAM)
5151   AM_RANGE(0x8000, 0x8000) AM_WRITE(dambustr_bg_color_w)
5252   AM_RANGE(0x8001, 0x8001) AM_WRITE(dambustr_bg_split_line_w)
53   AM_RANGE(0xd000, 0xd3ff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
54   AM_RANGE(0xd800, 0xd83f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
55   AM_RANGE(0xd840, 0xd85f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
56   AM_RANGE(0xd860, 0xd87f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
53   AM_RANGE(0xd000, 0xd3ff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
54   AM_RANGE(0xd800, 0xd83f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
55   AM_RANGE(0xd840, 0xd85f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
56   AM_RANGE(0xd860, 0xd87f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
5757   AM_RANGE(0xd880, 0xd8ff) AM_WRITE(SMH_RAM)
58   AM_RANGE(0xe002, 0xe003) AM_WRITE(galaxian_coin_counter_w)
58   AM_RANGE(0xe002, 0xe003) AM_WRITE(galaxold_coin_counter_w)
5959   AM_RANGE(0xe004, 0xe007) AM_WRITE(galaxian_lfo_freq_w)
6060   AM_RANGE(0xe800, 0xe802) AM_WRITE(galaxian_background_enable_w)
6161   AM_RANGE(0xe803, 0xe803) AM_WRITE(dambustr_noise_enable_w)
6262   AM_RANGE(0xe804, 0xe804) AM_WRITE(galaxian_shoot_enable_w)   // probably louder than normal shot
6363   AM_RANGE(0xe805, 0xe805) AM_WRITE(galaxian_shoot_enable_w)   // normal shot (like Galaxian)
6464   AM_RANGE(0xe806, 0xe807) AM_WRITE(galaxian_vol_w)
65   AM_RANGE(0xf001, 0xf001) AM_WRITE(galaxian_nmi_enable_w)
66   AM_RANGE(0xf004, 0xf004) AM_WRITE(galaxian_stars_enable_w)
67   AM_RANGE(0xf006, 0xf006) AM_WRITE(galaxian_flip_screen_x_w)
68   AM_RANGE(0xf007, 0xf007) AM_WRITE(galaxian_flip_screen_y_w)
65   AM_RANGE(0xf001, 0xf001) AM_WRITE(galaxold_nmi_enable_w)
66   AM_RANGE(0xf004, 0xf004) AM_WRITE(galaxold_stars_enable_w)
67   AM_RANGE(0xf006, 0xf006) AM_WRITE(galaxold_flip_screen_x_w)
68   AM_RANGE(0xf007, 0xf007) AM_WRITE(galaxold_flip_screen_y_w)
6969   AM_RANGE(0xf800, 0xf800) AM_WRITE(galaxian_pitch_w)
7070ADDRESS_MAP_END
7171
r2241r2242
190190   MDRV_CPU_ADD_TAG("main", Z80, 18432000/6)   /* 3.072 MHz */
191191   MDRV_CPU_PROGRAM_MAP(dambustr_readmem, dambustr_writemem)
192192
193   MDRV_MACHINE_RESET(galaxian)
193   MDRV_MACHINE_RESET(galaxold)
194194
195195   /* video hardware */
196196   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/blmbycar.c
r2241r2242
5555
5656static WRITE16_HANDLER( blmbycar_okibank_w )
5757{
58   if (ACCESSING_LSB)
58   if (ACCESSING_BITS_0_7)
5959   {
6060      UINT8 *RAM = memory_region(REGION_SOUND1);
6161      memcpy(&RAM[0x30000],&RAM[0x40000 + 0x10000*(data & 0xf)],0x10000);
r2241r2242
7676
7777static WRITE16_HANDLER( blmbycar_pot_wheel_reset_w )
7878{
79   if (ACCESSING_LSB)
79   if (ACCESSING_BITS_0_7)
8080      pot_wheel = ~readinputport(2) & 0xff;
8181}
8282
8383static WRITE16_HANDLER( blmbycar_pot_wheel_shift_w )
8484{
85   if (ACCESSING_LSB)
85   if (ACCESSING_BITS_0_7)
8686   {
8787      static int old;
8888      if ( ((old & 0xff) == 0xff) && ((data & 0xff) == 0) )
src/mame/drivers/megaplay.c
r2241r2242
964964
965965static WRITE16_HANDLER( megadriv_68k_write_z80_extra_ram )
966966{
967   if (!ACCESSING_LSB) // byte (MSB) access
967   if (!ACCESSING_BITS_0_7) // byte (MSB) access
968968   {
969969      ic36_ram[(offset<<1)] = (data & 0xff00) >> 8;
970970   }
971   else if (!ACCESSING_MSB)
971   else if (!ACCESSING_BITS_8_15)
972972   {
973973      ic36_ram[(offset<<1)^1] = (data & 0x00ff);
974974   }
src/mame/drivers/srmp2.c
r2241r2242
289289    --x- ---- : Player 1 and 2 side flag
290290*/
291291
292   if (!ACCESSING_LSB)
292   if (!ACCESSING_BITS_0_7)
293293   {
294294      return 0xffff;
295295   }
r2241r2242
322322
323323static READ16_HANDLER( srmp2_input_2_r )
324324{
325   if (!ACCESSING_LSB)
325   if (!ACCESSING_BITS_0_7)
326326   {
327327      return 0x0001;
328328   }
src/mame/drivers/m72.c
r2241r2242
195195static WRITE16_HANDLER( bchopper_sample_trigger_w )
196196{
197197   static const int a[6] = { 0x0000, 0x0010, 0x2510, 0x6510, 0x8510, 0x9310 };
198   if (ACCESSING_LSB && (data & 0xff) < 6) m72_set_sample_start(a[data & 0xff]);
198   if (ACCESSING_BITS_0_7 && (data & 0xff) < 6) m72_set_sample_start(a[data & 0xff]);
199199}
200200
201201static WRITE16_HANDLER( nspirit_sample_trigger_w )
202202{
203203   static const int a[9] = { 0x0000, 0x0020, 0x2020, 0, 0x5720, 0, 0x7b60, 0x9b60, 0xc360 };
204   if (ACCESSING_LSB && (data & 0xff) < 9) m72_set_sample_start(a[data & 0xff]);
204   if (ACCESSING_BITS_0_7 && (data & 0xff) < 9) m72_set_sample_start(a[data & 0xff]);
205205}
206206
207207static WRITE16_HANDLER( imgfight_sample_trigger_w )
208208{
209209   static const int a[7] = { 0x0000, 0x0020, 0x44e0, 0x98a0, 0xc820, 0xf7a0, 0x108c0 };
210   if (ACCESSING_LSB && (data & 0xff) < 7) m72_set_sample_start(a[data & 0xff]);
210   if (ACCESSING_BITS_0_7 && (data & 0xff) < 7) m72_set_sample_start(a[data & 0xff]);
211211}
212212
213213static WRITE16_HANDLER( loht_sample_trigger_w )
214214{
215215   static const int a[7] = { 0x0000, 0x0020, 0, 0x2c40, 0x4320, 0x7120, 0xb200 };
216   if (ACCESSING_LSB && (data & 0xff) < 7) m72_set_sample_start(a[data & 0xff]);
216   if (ACCESSING_BITS_0_7 && (data & 0xff) < 7) m72_set_sample_start(a[data & 0xff]);
217217}
218218
219219static WRITE16_HANDLER( xmultipl_sample_trigger_w )
220220{
221221   static const int a[3] = { 0x0000, 0x0020, 0x1a40 };
222   if (ACCESSING_LSB && (data & 0xff) < 3) m72_set_sample_start(a[data & 0xff]);
222   if (ACCESSING_BITS_0_7 && (data & 0xff) < 3) m72_set_sample_start(a[data & 0xff]);
223223}
224224
225225static WRITE16_HANDLER( dbreed72_sample_trigger_w )
226226{
227227   static const int a[9] = { 0x00000, 0x00020, 0x02c40, 0x08160, 0x0c8c0, 0x0ffe0, 0x13000, 0x15820, 0x15f40 };
228   if (ACCESSING_LSB && (data & 0xff) < 9) m72_set_sample_start(a[data & 0xff]);
228   if (ACCESSING_BITS_0_7 && (data & 0xff) < 9) m72_set_sample_start(a[data & 0xff]);
229229}
230230
231231static WRITE16_HANDLER( airduel_sample_trigger_w )
r2241r2242
233233   static const int a[16] = {
234234      0x00000, 0x00020, 0x03ec0, 0x05640, 0x06dc0, 0x083a0, 0x0c000, 0x0eb60,
235235      0x112e0, 0x13dc0, 0x16520, 0x16d60, 0x18ae0, 0x1a5a0, 0x1bf00, 0x1c340 };
236   if (ACCESSING_LSB && (data & 0xff) < 16) m72_set_sample_start(a[data & 0xff]);
236   if (ACCESSING_BITS_0_7 && (data & 0xff) < 16) m72_set_sample_start(a[data & 0xff]);
237237}
238238
239239static WRITE16_HANDLER( dkgenm72_sample_trigger_w )
r2241r2242
244244      0x10fa0, 0x10fc0, 0x10fe0, 0x11f40, 0x12b20, 0x130a0, 0x13c60, 0x14740,
245245      0x153c0, 0x197e0, 0x1af40, 0x1c080 };
246246
247   if (ACCESSING_LSB && (data & 0xff) < 28) m72_set_sample_start(a[data & 0xff]);
247   if (ACCESSING_BITS_0_7 && (data & 0xff) < 28) m72_set_sample_start(a[data & 0xff]);
248248}
249249
250250static WRITE16_HANDLER( gallop_sample_trigger_w )
r2241r2242
255255      0x10200, 0x10220, 0x10240, 0x11380, 0x12760, 0x12780, 0x127a0, 0x13c40,
256256      0x140a0, 0x16760, 0x17e40, 0x18ee0, 0x19f60, 0x1bbc0, 0x1cee0 };
257257
258   if (ACCESSING_LSB && (data & 0xff) < 31) m72_set_sample_start(a[data & 0xff]);
258   if (ACCESSING_BITS_0_7 && (data & 0xff) < 31) m72_set_sample_start(a[data & 0xff]);
259259}
260260
261261
r2241r2242
460460
461461static READ16_HANDLER( protection_r )
462462{
463   if (ACCESSING_MSB)
463   if (ACCESSING_BITS_8_15)
464464      copy_le(protection_ram,protection_code,CODE_LEN);
465465   return protection_ram[0xffa/2+offset];
466466}
r2241r2242
471471   COMBINE_DATA(&protection_ram[offset]);
472472   data ^= 0xffff;
473473
474   if (offset == 0x0fff/2 && ACCESSING_MSB && (data >> 8) == 0)
474   if (offset == 0x0fff/2 && ACCESSING_BITS_8_15 && (data >> 8) == 0)
475475      copy_le(&protection_ram[0x0fe0],protection_crc,CRC_LEN);
476476}
477477
r2241r2242
600600
601601static WRITE16_HANDLER( soundram_w )
602602{
603   if (ACCESSING_LSB)
603   if (ACCESSING_BITS_0_7)
604604      soundram[offset * 2 + 0] = data;
605   if (ACCESSING_MSB)
605   if (ACCESSING_BITS_8_15)
606606      soundram[offset * 2 + 1] = data >> 8;
607607}
608608
src/mame/drivers/ohmygod.c
r2241r2242
4141
4242static WRITE16_HANDLER( ohmygod_ctrl_w )
4343{
44   if (ACCESSING_LSB)
44   if (ACCESSING_BITS_0_7)
4545   {
4646      UINT8 *rom = memory_region(REGION_SOUND1);
4747
r2241r2242
5252         memcpy(rom + 0x20000,rom + 0x40000 + 0x20000 * sndbank,0x20000);
5353      }
5454   }
55   if (ACCESSING_MSB)
55   if (ACCESSING_BITS_8_15)
5656   {
5757      coin_counter_w(0,data & 0x1000);
5858      coin_counter_w(1,data & 0x2000);
src/mame/drivers/snk68.c
r2241r2242
121121{
122122   /* top byte is used, meaning unknown */
123123   /* bottom byte is protection in ikari 3 and streetsm */
124   if (ACCESSING_LSB)
124   if (ACCESSING_BITS_0_7)
125125      invert_controls = ((data & 0xff) == 0x07) ? 0xff : 0x00;
126126}
127127
src/mame/drivers/mastboy.c
r2241r2242
563563         mastboy_vram[offs] = data^0xff;
564564
565565         /* Decode the new tile */
566         decodechar(Machine->gfx[0], offs/32, mastboy_vram);
566         decodechar(machine->gfx[0], offs/32, mastboy_vram);
567567      }
568568   }
569569   else
r2241r2242
656656static WRITE8_HANDLER( mastboy_irq0_ack_w )
657657{
658658   mastboy_irq0_ack = data;
659   if ((data&1)==1) cpunum_set_input_line(Machine, 0,0, CLEAR_LINE);
659   if ((data&1)==1) cpunum_set_input_line(machine, 0,0, CLEAR_LINE);
660660}
661661
662662static INTERRUPT_GEN( mastboy_interrupt )
src/mame/drivers/oneshot.c
r2241r2242
105105
106106static WRITE16_HANDLER( soundbank_w )
107107{
108   if (ACCESSING_LSB)
108   if (ACCESSING_BITS_0_7)
109109   {
110110      OKIM6295_set_bank_base(0, 0x40000 * ((data & 0x03) ^ 0x03));
111111   }
src/mame/drivers/stlforce.c
r2241r2242
9191
9292static WRITE16_HANDLER( eeprom_w )
9393{
94   if( ACCESSING_LSB )
94   if( ACCESSING_BITS_0_7 )
9595   {
9696      EEPROM_write_bit(data & 0x01);
9797      EEPROM_set_cs_line((data & 0x02) ? CLEAR_LINE : ASSERT_LINE );
src/mame/drivers/zr107.c
r2241r2242
169169   UINT32 r = 0;
170170   if (offset == 0)
171171   {
172      if (!(mem_mask & 0xff000000))
172      if (ACCESSING_BITS_24_31)
173173      {
174174         r |= readinputport(0) << 24;
175175      }
176      if (!(mem_mask & 0x00ff0000))
176      if (ACCESSING_BITS_16_23)
177177      {
178178         r |= readinputport(1) << 16;
179179      }
180      if (!(mem_mask & 0x0000ff00))
180      if (ACCESSING_BITS_8_15)
181181      {
182182         int adc_bit = adc083x_do_read(0);
183183         r |= ((readinputport(2) & 0x7f) | (adc_bit << 7)) << 8;
184184      }
185      if (!(mem_mask & 0x000000ff))
185      if (ACCESSING_BITS_0_7)
186186      {
187187         r |= readinputport(3) << 0;
188188      }
189189   }
190190   else if (offset == 1)
191191   {
192      if (!(mem_mask & 0xff000000))
192      if (ACCESSING_BITS_24_31)
193193      {
194194         r |= ((adc083x_sars_read(0) << 5) | (EEPROM_read_bit() << 4)) << 24;
195195      }
r2241r2242
202202{
203203   if( offset == 0 )
204204   {
205      if (!(mem_mask & 0xff000000))
205      if (ACCESSING_BITS_24_31)
206206      {
207207         led_reg0 = (data >> 24) & 0xff;
208208      }
209      if (!(mem_mask & 0x00ff0000))
209      if (ACCESSING_BITS_16_23)
210210      {
211211         led_reg1 = (data >> 16) & 0xff;
212212      }
213      if (!(mem_mask & 0x000000ff))
213      if (ACCESSING_BITS_0_7)
214214      {
215215         EEPROM_write_bit((data & 0x1) ? 1 : 0);
216216         EEPROM_set_clock_line((data & 0x2) ? ASSERT_LINE : CLEAR_LINE);
r2241r2242
225225   }
226226   else if( offset == 1 )
227227   {
228      if (!(mem_mask & 0xff000000))
228      if (ACCESSING_BITS_24_31)
229229      {
230230         if (data & 0x80000000)   /* CG Board 1 IRQ Ack */
231231            cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ1, CLEAR_LINE);
r2241r2242
276276      case 0x1c/4:
277277      {
278278         // Midnight Run polls the vertical counter in vblank
279         if (!(mem_mask & 0xff000000))
279         if (ACCESSING_BITS_24_31)
280280         {
281281            ccu_vcth ^= 0xff;
282282            r |= ccu_vcth << 24;
283283         }
284         if (!(mem_mask & 0x0000ff00))
284         if (ACCESSING_BITS_8_15)
285285         {
286286            ccu_vctl++;
287287            ccu_vctl &= 0x1ff;
r2241r2242
357357{
358358   UINT16 ret = 0;
359359
360   if (ACCESSING_LSB16)
360   if (ACCESSING_BITS_0_7)
361361      ret |= K054539_1_r(machine, offset);
362   if (ACCESSING_MSB16)
362   if (ACCESSING_BITS_8_15)
363363      ret |= K054539_0_r(machine, offset)<<8;
364364
365365   return ret;
r2241r2242
367367
368368static WRITE16_HANDLER( dual539_w )
369369{
370   if (ACCESSING_LSB16)
370   if (ACCESSING_BITS_0_7)
371371      K054539_1_w(machine, offset, data);
372   if (ACCESSING_MSB16)
372   if (ACCESSING_BITS_8_15)
373373      K054539_0_w(machine, offset, data>>8);
374374}
375375
src/mame/drivers/fantland.c
r2241r2242
7070
7171static WRITE16_HANDLER( fantland_nmi_enable_16_w )
7272{
73   if (ACCESSING_LSB)
73   if (ACCESSING_BITS_0_7)
7474      fantland_nmi_enable_w(machine,offset*2,data);
7575}
7676
r2241r2242
8282
8383static WRITE16_HANDLER( fantland_soundlatch_16_w )
8484{
85   if (ACCESSING_LSB)
85   if (ACCESSING_BITS_0_7)
8686      fantland_soundlatch_w(machine, offset*2, data);
8787}
8888
r2241r2242
102102
103103static WRITE16_HANDLER( spriteram_16_w )
104104{
105   if (ACCESSING_LSB)
105   if (ACCESSING_BITS_0_7)
106106      spriteram[2*offset+0] = data;
107   if (ACCESSING_MSB)
107   if (ACCESSING_BITS_8_15)
108108      spriteram[2*offset+1] = data >> 8;
109109}
110110
111111static WRITE16_HANDLER( spriteram2_16_w )
112112{
113   if (ACCESSING_LSB)
113   if (ACCESSING_BITS_0_7)
114114      spriteram_2[2*offset+0] = data;
115   if (ACCESSING_MSB)
115   if (ACCESSING_BITS_8_15)
116116      spriteram_2[2*offset+1] = data >> 8;
117117}
118118
src/mame/drivers/ksys573.c
r2241r2242
987987
988988   verboselog( 2, "security_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
989989
990   if( ACCESSING_LSW32 )
990   if( ACCESSING_BITS_0_15 )
991991   {
992992      switch( chiptype[ security_cart_number ] )
993993      {
r2241r2242
10541054   {
10551055      int adr = offset * 2;
10561056
1057      if( ACCESSING_LSB32 )
1057      if( ACCESSING_BITS_0_7 )
10581058      {
10591059         data |= ( intelflash_read( flash_bank + 0, adr + 0 ) & 0xff ) << 0; // 31m/31l/31j/31h
10601060      }
1061      if( ( mem_mask & 0x0000ff00 ) == 0 )
1061      if( ACCESSING_BITS_8_15 )
10621062      {
10631063         data |= ( intelflash_read( flash_bank + 1, adr + 0 ) & 0xff ) << 8; // 27m/27l/27j/27h
10641064      }
1065      if( ( mem_mask & 0x00ff0000 ) == 0 )
1065      if( ACCESSING_BITS_16_23 )
10661066      {
10671067         data |= ( intelflash_read( flash_bank + 0, adr + 1 ) & 0xff ) << 16; // 31m/31l/31j/31h
10681068      }
1069      if( ACCESSING_MSB32 )
1069      if( ACCESSING_BITS_24_31 )
10701070      {
10711071         data |= ( intelflash_read( flash_bank + 1, adr + 1 ) & 0xff ) << 24; // 27m/27l/27j/27h
10721072      }
r2241r2242
10891089   {
10901090      int adr = offset * 2;
10911091
1092      if( ( mem_mask & 0x000000ff ) == 0 )
1092      if( ACCESSING_BITS_0_7 )
10931093      {
10941094         intelflash_write( flash_bank + 0, adr + 0, ( data >> 0 ) & 0xff );
10951095      }
1096      if( ( mem_mask & 0x0000ff00 ) == 0 )
1096      if( ACCESSING_BITS_8_15 )
10971097      {
10981098         intelflash_write( flash_bank + 1, adr + 0, ( data >> 8 ) & 0xff );
10991099      }
1100      if( ( mem_mask & 0x00ff0000 ) == 0 )
1100      if( ACCESSING_BITS_16_23 )
11011101      {
11021102         intelflash_write( flash_bank + 0, adr + 1, ( data >> 16 ) & 0xff );
11031103      }
1104      if( ( mem_mask & 0xff000000 ) == 0 )
1104      if( ACCESSING_BITS_24_31 )
11051105      {
11061106         intelflash_write( flash_bank + 1, adr + 1, ( data >> 24 ) & 0xff );
11071107      }
r2241r2242
15391539
15401540static void update_mode( void )
15411541{
1542   int mode = readinputportbytag( "MODE" );
1542   int cart = readinputportbytag( "CART" );
1543   int cd = readinputportbytag( "CD" );
15431544   static SCSIInstance *new_cdrom;
15441545
15451546   if( chiptype[ 1 ] != 0 )
15461547   {
1547      security_cart_number = mode;
1548      security_cart_number = cart;
15481549   }
15491550   else
15501551   {
r2241r2242
15531554
15541555   if( available_cdroms[ 1 ] != NULL )
15551556   {
1556      new_cdrom = available_cdroms[ mode ];
1557      new_cdrom = available_cdroms[ cd ];
15571558   }
15581559   else
15591560   {
r2241r2242
16091610      uPD4701_cs_w( 0, 0 );
16101611      uPD4701_xy_w( 0, 1 );
16111612
1612      if( ( mem_mask & 0x000000ff ) != 0x000000ff )
1613      if( ACCESSING_BITS_0_7 )
16131614      {
16141615         uPD4701_ul_w( 0, 0 );
16151616         data |= uPD4701_d_r( 0 ) << 0;
16161617      }
16171618
1618      if( ( mem_mask & 0x00ff0000 ) != 0x00ff0000 )
1619      if( ACCESSING_BITS_16_23 )
16191620      {
16201621         uPD4701_ul_w( 0, 1 );
16211622         data |= uPD4701_d_r( 0 ) << 16;
r2241r2242
16411642      break;
16421643
16431644   case 0x20:
1644      if( ( mem_mask & 0x000000ff ) != 0x000000ff )
1645      if( ACCESSING_BITS_0_7 )
16451646      {
16461647         output_set_value( "motor", data & 0xff );
16471648      }
16481649      break;
16491650
16501651   case 0x22:
1651      if( ( mem_mask & 0x000000ff ) != 0x000000ff )
1652      if( ACCESSING_BITS_0_7 )
16521653      {
16531654         output_set_value( "brake", data & 0xff );
16541655      }
16551656      break;
16561657
16571658   case 0x28:
1658      if( ( mem_mask & 0x000000ff ) != 0x000000ff )
1659      if( ACCESSING_BITS_0_7 )
16591660      {
16601661         uPD4701_resety_w( 0, 1 );
16611662         uPD4701_resety_w( 0, 0 );
r2241r2242
17491750   {
17501751   case 0x20:
17511752
1752      if( ACCESSING_LSW32 )
1753      if( ACCESSING_BITS_0_15 )
17531754      {
17541755         gx700pwbf_output( 0, data & 0xff );
17551756      }
17561757      break;
17571758
17581759   case 0x22:
1759      if( ACCESSING_LSW32 )
1760      if( ACCESSING_BITS_0_15 )
17601761      {
17611762         gx700pwbf_output( 1, data & 0xff );
17621763      }
17631764      break;
17641765
17651766   case 0x24:
1766      if( ACCESSING_LSW32 )
1767      if( ACCESSING_BITS_0_15 )
17671768      {
17681769         gx700pwbf_output( 2, data & 0xff );
17691770      }
17701771      break;
17711772
17721773   case 0x26:
1773      if( ACCESSING_LSW32 )
1774      if( ACCESSING_BITS_0_15 )
17741775      {
17751776         gx700pwbf_output( 3, data & 0xff );
17761777      }
r2241r2242
20562057      data |= 0x10000;
20572058      break;
20582059   case 0x20:
2059      if( ACCESSING_LSW32 )
2060      if( ACCESSING_BITS_0_15 )
20602061      {
20612062         data |= 0x00001234;
20622063      }
20632064      break;
20642065   case 0x2b:
20652066      /* sound? */
2066      if( ACCESSING_LSW32 )
2067      if( ACCESSING_BITS_0_15 )
20672068      {
20682069//          data |= 0x00001000; /* ? */
20692070         data |= 0x00002000; /* ? */
20702071      }
2071      if( ACCESSING_MSW32 )
2072      if( ACCESSING_BITS_16_31 )
20722073      {
20732074//          data |= 0x10000000; /* rdy??? */
20742075      }
20752076      break;
20762077   case 0x2d:
2077      if( ACCESSING_LSW32 )
2078      if( ACCESSING_BITS_0_15 )
20782079      {
20792080         data |= gx894_ram[ gx894_ram_read_offset / 2 ];
20802081//          printf( "reading %08x %04x\r", gx894_ram_read_offset, gx894_ram[ gx894_ram_read_offset / 2 ] );
20812082         gx894_ram_read_offset += 2;
20822083      }
2083      if( ACCESSING_MSW32 )
2084      if( ACCESSING_BITS_16_31 )
20842085      {
20852086//          printf( "read offset 2d msw32\n" );
20862087      }
20872088      break;
20882089   case 0x30:
20892090      /* mp3? */
2090      if( ACCESSING_LSW32 )
2091      if( ACCESSING_BITS_0_15 )
20912092      {
20922093         /* unknown data word */
20932094      }
2094      if( ACCESSING_MSW32 )
2095      if( ACCESSING_BITS_16_31 )
20952096      {
20962097         /* 0x000-0x1ff */
20972098         data |= 0x1ff0000;
r2241r2242
20992100      break;
21002101   case 0x31:
21012102      /* mp3? */
2102      if( ACCESSING_LSW32 )
2103      if( ACCESSING_BITS_0_15 )
21032104      {
21042105         /* unknown data word count */
21052106         data |= 0x0000;
21062107      }
2107      if( ACCESSING_MSW32 )
2108      if( ACCESSING_BITS_16_31 )
21082109      {
21092110//          printf( "read offset 31 msw32\n" );
21102111      }
21112112      break;
21122113   case 0x32:
2113      if( ACCESSING_MSW32 )
2114      if( ACCESSING_BITS_16_31 )
21142115      {
21152116         data |= 0 & 0xffff0000;
21162117      }
21172118      /* todo */
21182119      break;
21192120   case 0x33:
2120      if( ACCESSING_LSW32 )
2121      if( ACCESSING_BITS_0_15 )
21212122      {
21222123         data |= 0 & 0x0000ffff;
21232124      }
21242125      /* todo */
21252126      break;
21262127   case 0x3b:
2127      if( ACCESSING_MSW32 )
2128      if( ACCESSING_BITS_16_31 )
21282129      {
21292130         data |= ds2401_read( 2 ) << 28;
21302131      }
21312132      break;
21322133   case 0x3d:
2133      if( ACCESSING_MSW32 )
2134      if( ACCESSING_BITS_16_31 )
21342135      {
21352136         /* fails if !8000 */
21362137         /* fails if  4000 */
r2241r2242
22042205      /* sound? */
22052206      break;
22062207   case 0x2c:
2207      if( ACCESSING_LSW32 )
2208      if( ACCESSING_BITS_0_15 )
22082209      {
22092210         gx894_ram_write_offset &= 0x0000ffff;
22102211         gx894_ram_write_offset |= ( data & 0x0000ffff ) << 16;
22112212      }
2212      if( ACCESSING_MSW32 )
2213      if( ACCESSING_BITS_16_31 )
22132214      {
22142215         gx894_ram_write_offset &= 0xffff0000;
22152216         gx894_ram_write_offset |= ( data & 0xffff0000 ) >> 16;
22162217      }
22172218      break;
22182219   case 0x2d:
2219      if( ACCESSING_LSW32 )
2220      if( ACCESSING_BITS_0_15 )
22202221      {
22212222         gx894_ram[ gx894_ram_write_offset / 2 ] = data & 0xffff;
22222223//          printf( "writing %08x %04x\r", gx894_ram_write_offset, gx894_ram[ gx894_ram_write_offset / 2 ] );
22232224         gx894_ram_write_offset += 2;
22242225      }
2225      if( ACCESSING_MSW32 )
2226      if( ACCESSING_BITS_16_31 )
22262227      {
22272228         gx894_ram_read_offset &= 0x0000ffff;
22282229         gx894_ram_read_offset |= ( data & 0xffff0000 ) << 0;
22292230      }
22302231      break;
22312232   case 0x2e:
2232      if( ACCESSING_LSW32 )
2233      if( ACCESSING_BITS_0_15 )
22332234      {
22342235         gx894_ram_read_offset &= 0xffff0000;
22352236         gx894_ram_read_offset |= ( data & 0x0000ffff ) >> 0;
22362237      }
2237      if( ACCESSING_MSW32 )
2238      if( ACCESSING_BITS_16_31 )
22382239      {
22392240//          printf( "write offset 2e msw32\n" );
22402241      }
22412242      break;
22422243   case 0x38:
2243      if( ACCESSING_MSW32 )
2244      if( ACCESSING_BITS_16_31 )
22442245      {
22452246         gx894pwbba_output( 0, ( data >> 28 ) & 0xf );
22462247      }
2247      if( ACCESSING_LSW32 )
2248      if( ACCESSING_BITS_0_15 )
22482249      {
22492250         gx894pwbba_output( 1, ( data >> 12 ) & 0xf );
22502251      }
22512252      COMBINE_DATA( &a );
22522253      break;
22532254   case 0x39:
2254      if( ACCESSING_MSW32 )
2255      if( ACCESSING_BITS_16_31 )
22552256      {
22562257         gx894pwbba_output( 7, ( data >> 28 ) & 0xf );
22572258      }
2258      if( ACCESSING_LSW32 )
2259      if( ACCESSING_BITS_0_15 )
22592260      {
22602261         gx894pwbba_output( 3, ( data >> 12 ) & 0xf );
22612262      }
22622263      COMBINE_DATA( &b );
22632264      break;
22642265   case 0x3b:
2265      if( ACCESSING_MSW32 )
2266      if( ACCESSING_BITS_16_31 )
22662267      {
22672268         ds2401_write( 2, !( ( data >> 28 ) & 1 ) );
22682269      }
22692270      break;
22702271   case 0x3e:
2271      if( ACCESSING_LSW32 )
2272      if( ACCESSING_BITS_0_15 )
22722273      {
22732274         /* 12 */
22742275         /* 13 */
r2241r2242
22902291         }
22912292      }
22922293
2293      if( ACCESSING_MSW32 )
2294      if( ACCESSING_BITS_16_31 )
22942295      {
22952296         gx894pwbba_output( 4, ( data >> 28 ) & 0xf );
22962297      }
22972298      COMBINE_DATA( &c );
22982299      break;
22992300   case 0x3f:
2300      if( ACCESSING_MSW32 )
2301      if( ACCESSING_BITS_16_31 )
23012302      {
23022303         gx894pwbba_output( 2, ( data >> 28 ) & 0xf );
23032304      }
2304      if( ACCESSING_LSW32 )
2305      if( ACCESSING_BITS_0_15 )
23052306      {
23062307         gx894pwbba_output( 5, ( data >> 12 ) & 0xf );
23072308      }
r2241r2242
28342835   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
28352836//  PORT_BIT( 0xf0fff0ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
28362837
2837   PORT_START_TAG("MODE")
2838   PORT_CONFNAME( 1, 0, "Mode" )
2838   PORT_START_TAG("CART")
2839   PORT_CONFNAME( 1, 0, "Security Cart" )
28392840   PORT_CONFSETTING( 0, "Install" )
28402841   PORT_CONFSETTING( 1, "Game" )
2842
2843   PORT_START_TAG("CD")
2844   PORT_CONFNAME( 1, 0, "CD" )
2845   PORT_CONFSETTING( 0, "1" )
2846   PORT_CONFSETTING( 1, "2" )
28412847INPUT_PORTS_END
28422848
28432849static INPUT_PORTS_START( fbaitbc )
r2241r2242
37253731   DISK_IMAGE_READONLY( "912jab", 0, BAD_DUMP MD5(60dadc836f00f22d50b5b634250aa624) SHA1(5316b2e2e89af7bc038a3febc91525edac91fe7e) )
37263732ROM_END
37273733
3734ROM_START( drmn2mpu )
3735   ROM_REGION32_LE( 0x080000, REGION_USER1, 0 )
3736   SYS573_BIOS_A
3737
3738   ROM_REGION( 0x0000224, REGION_USER2, 0 ) /* install security cart eeprom */
3739   ROM_LOAD( "ge912ja.u1",   0x000000, 0x000224, BAD_DUMP CRC(1246fe5b) SHA1(b58d4f4c95e13abf639d645223565544bd79a58a) )
3740
3741   ROM_REGION( 0x0001014, REGION_USER8, 0 ) /* game security cart eeprom */
3742   ROM_LOAD( "gn912ja.u1",   0x000000, 0x001014, BAD_DUMP CRC(34deea99) SHA1(f179e22eaf30453bb94177ed9c25d7996f020c99) )
3743
3744   ROM_REGION( 0x1000000, REGION_USER3, 0 ) /* onboard flash */
3745   ROM_FILL( 0x0000000, 0x1000000, 0xff )
3746
3747   ROM_REGION( 0x000008, REGION_USER9, 0 ) /* install security cart id */
3748   ROM_LOAD( "ge912ja.u6",   0x000000, 0x000008, BAD_DUMP CRC(af09e43c) SHA1(d8372f2d6e0ae07061b496a2242a63e5bc2e54dc) )
3749
3750   ROM_REGION( 0x000008, REGION_USER10, 0 ) /* game security cart id */
3751   ROM_LOAD( "gn912ja.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
3752
3753   DISK_REGION( REGION_DISKS )
3754   DISK_IMAGE_READONLY( "912jab",  0, BAD_DUMP MD5(60dadc836f00f22d50b5b634250aa624) SHA1(5316b2e2e89af7bc038a3febc91525edac91fe7e) )
3755   DISK_IMAGE_READONLY( "912za01", 1, BAD_DUMP MD5(1d3fa130a3a6c8433c276e609b373e4f) SHA1(121ca6df16084a01c88ef26167b13053c9adc7ce) )
3756ROM_END
3757
37283758ROM_START( drmn3m )
37293759   ROM_REGION32_LE( 0x080000, REGION_USER1, 0 )
37303760   SYS573_BIOS_A
r2241r2242
44344464GAME( 1999, ddrs2kj,  ddrs2k,   konami573, ddrsolo,   ddrsolo,    ROT0, "Konami", "Dance Dance Revolution Solo 2000 (GC905 VER. JAA)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* BOOT VER 1.2 */
44354465GAME( 1999, dsfdct,   sys573,   konami573, ddr,       ddrdigital, ROT0, "Konami", "Dancing Stage featuring Dreams Come True (GC910 VER. JCA)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
44364466GAME( 1999, dsfdcta,  dsfdct,   konami573, ddr,       ddr,        ROT0, "Konami", "Dancing Stage featuring Dreams Come True (GC910 VER. JAA)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4437GAME( 1999, drmn2m,   sys573,   konami573, drmn,      drmndigital,ROT0, "Konami", "DrumMania 2nd Mix (GE912 VER. JAA)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* BOOT VER 1.5 */
4467GAME( 1999, drmn2m,   sys573,   konami573, drmn,      drmndigital,ROT0, "Konami", "DrumMania 2nd Mix (GE912 VER. JAB)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* BOOT VER 1.5 */
4468GAME( 1999, drmn2mpu, drmn2m,   konami573, drmn,      drmndigital,ROT0, "Konami", "DrumMania 2nd Mix Session Power Up Kit (GE912 VER. JAB)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* BOOT VER 1.5 */
44384469GAME( 2000, dncfrks,  sys573,   konami573, dmx,       dmx,        ROT0, "Konami", "Dance Freaks (G*874 VER. KAA)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* BOOT VER 1.6 */
44394470GAME( 2000, dmx,      dncfrks,  konami573, dmx,       dmx,        ROT0, "Konami", "Dance Maniax (G*874 VER. JAA)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* BOOT VER 1.6 */
44404471GAME( 2000, gtrfrk3m, sys573,   konami573, gtrfrks,   gtrfrkdigital,ROT0, "Konami", "Guitar Freaks 3rd Mix (GE949 VER. JAC)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* BOOT VER 1.4 */
src/mame/drivers/atarig1.c
r2241r2242
8989
9090static WRITE16_HANDLER( mo_control_w )
9191{
92   if (ACCESSING_LSB)
92   if (ACCESSING_BITS_0_7)
9393      atarirle_control_w(0, data & 7);
9494}
9595
src/mame/drivers/legionna.c
r2241r2242
28152815/*****************************************************************************/
28162816
28172817static INPUT_PORTS_START( legionna )
2818   SEIBU_COIN_INPUTS   /* Must be port 0: coin inputs read through sound cpu */
2818   SEIBU_COIN_INPUTS   /* coin inputs read through sound cpu */
28192819
28202820   PORT_START
28212821   PORT_DIPNAME( 0x001f, 0x001f, DEF_STR( Coinage ) )
r2241r2242
29032903
29042904
29052905static INPUT_PORTS_START( heatbrl )
2906   SEIBU_COIN_INPUTS   /* Must be port 0: coin inputs read through sound cpu */
2906   SEIBU_COIN_INPUTS   /* coin inputs read through sound cpu */
29072907
29082908   PORT_START
29092909   PORT_DIPNAME( 0x001f, 0x001f, DEF_STR( Coinage ) )
r2241r2242
30073007
30083008
30093009static INPUT_PORTS_START( godzilla )
3010   SEIBU_COIN_INPUTS   /* Must be port 0: coin inputs read through sound cpu */
3010   SEIBU_COIN_INPUTS   /* coin inputs read through sound cpu */
30113011
30123012   PORT_START
30133013   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) )
r2241r2242
31053105INPUT_PORTS_END
31063106
31073107static INPUT_PORTS_START( sdgndmrb )
3108   SEIBU_COIN_INPUTS   /* Must be port 0: coin inputs read through sound cpu */
3108   SEIBU_COIN_INPUTS   /* coin inputs read through sound cpu */
31093109
31103110   PORT_START
31113111   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) )
r2241r2242
32503250INPUT_PORTS_END
32513251
32523252static INPUT_PORTS_START( cupsoc )
3253   SEIBU_COIN_INPUTS   /* Must be port 0: coin inputs read through sound cpu */
3253   SEIBU_COIN_INPUTS   /* coin inputs read through sound cpu */
32543254
32553255   PORT_START
32563256   PORT_DIPNAME( 0x0007, 0x0007, "Coin 1 (3)" )
r2241r2242
43994399GAME( 1993, sdgndmrb, 0,        sdgndmrb, sdgndmrb, 0,         ROT0, "Banpresto", "SD Gundam Sangokushi Rainbow Tairiku Senki", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
44004400GAME( 1993, denjinmk, 0,        denjinmk, godzilla, 0,        ROT0, "Banpresto", "Denjin Makai", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
44014401
4402GAME( 1992, cupsoc,   0,        cupsoc,  cupsoc,    0,        ROT0, "Seibu", "Seibu Cup Soccer (set 1)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
4403GAME( 1992, cupsoc2,  cupsoc,   cupsoc,  cupsoc,    0,        ROT0, "Seibu", "Seibu Cup Soccer (set 2)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
4404GAME( 1992, olysoc92, cupsoc,   cupsoc,  cupsoc,    0,        ROT0, "Seibu", "Olympic Soccer '92", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
4402GAME( 1992, cupsoc,   0,        cupsoc,   cupsoc,   0,        ROT0, "Seibu", "Seibu Cup Soccer (set 1)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
4403GAME( 1992, cupsoc2,  cupsoc,   cupsoc,   cupsoc,   0,        ROT0, "Seibu", "Seibu Cup Soccer (set 2)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
4404GAME( 1992, olysoc92, cupsoc,   cupsoc,   cupsoc,   0,        ROT0, "Seibu", "Olympic Soccer '92", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
44054405GAME( 1992, cupsocbl, cupsoc,   cupsocbl, cupsoc,   cupsoc,   ROT0, "bootleg", "Seibu Cup Soccer (bootleg)", GAME_NOT_WORKING | GAME_NO_SOUND )
src/mame/drivers/midas.c
r2241r2242
185185
186186static WRITE16_HANDLER( livequiz_eeprom_w )
187187{
188   if (ACCESSING_LSB)
188   if (ACCESSING_BITS_0_7)
189189   {
190190      // latch the bit
191191      EEPROM_write_bit(data & 0x04);
src/mame/drivers/mcr68.c
r2241r2242
222222static WRITE16_HANDLER( pigskin_protection_w )
223223{
224224   /* ignore upper-byte only */
225   if (ACCESSING_LSB)
225   if (ACCESSING_BITS_0_7)
226226   {
227227      /* track the last 5 bytes */
228228      protection_data[0] = protection_data[1];
src/mame/drivers/overdriv.c
r2241r2242
5555
5656static WRITE16_HANDLER( K051316_0_msb_w )
5757{
58   if (ACCESSING_MSB)
58   if (ACCESSING_BITS_8_15)
5959      K051316_0_w(machine,offset,data >> 8);
6060}
6161
6262static WRITE16_HANDLER( K051316_1_msb_w )
6363{
64   if (ACCESSING_MSB)
64   if (ACCESSING_BITS_8_15)
6565      K051316_1_w(machine,offset,data >> 8);
6666}
6767
6868static WRITE16_HANDLER( K051316_ctrl_0_msb_w )
6969{
70   if (ACCESSING_MSB)
70   if (ACCESSING_BITS_8_15)
7171      K051316_ctrl_0_w(machine,offset,data >> 8);
7272}
7373
7474static WRITE16_HANDLER( K051316_ctrl_1_msb_w )
7575{
76   if (ACCESSING_MSB)
76   if (ACCESSING_BITS_8_15)
7777      K051316_ctrl_1_w(machine,offset,data >> 8);
7878}
7979
r2241r2242
137137static WRITE16_HANDLER( eeprom_w )
138138{
139139//logerror("%06x: write %04x to eeprom_w\n",activecpu_get_pc(),data);
140   if (ACCESSING_LSB)
140   if (ACCESSING_BITS_0_7)
141141   {
142142      /* bit 0 is data */
143143      /* bit 1 is clock (active high) */
r2241r2242
172172
173173static WRITE16_HANDLER( cpuA_ctrl_w )
174174{
175   if (ACCESSING_LSB)
175   if (ACCESSING_BITS_0_7)
176176   {
177177      /* bit 0 probably enables the second 68000 */
178178      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
r2241r2242
199199{
200200   COMBINE_DATA(&cpuB_ctrl);
201201
202   if (ACCESSING_LSB)
202   if (ACCESSING_BITS_0_7)
203203   {
204204      /* bit 0 = enable sprite ROM reading */
205205      K053246_set_OBJCHA_line((data & 0x01) ? ASSERT_LINE : CLEAR_LINE);
src/mame/drivers/nmg5.c
r2241r2242
243243
244244static WRITE16_HANDLER( nmg5_soundlatch_w )
245245{
246   if (ACCESSING_LSB)
246   if (ACCESSING_BITS_0_7)
247247   {
248248      soundlatch_w(machine,0,data & 0xff);
249249      cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
src/mame/drivers/xmen.c
r2241r2242
106106static WRITE16_HANDLER( eeprom_w )
107107{
108108logerror("%06x: write %04x to 108000\n",activecpu_get_pc(),data);
109   if (ACCESSING_LSB)
109   if (ACCESSING_BITS_0_7)
110110   {
111111      /* bit 0 = coin counter */
112112      coin_counter_w(0,data & 0x01);
r2241r2242
118118      EEPROM_set_cs_line((data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
119119      EEPROM_set_clock_line((data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
120120   }
121   if (ACCESSING_MSB)
121   if (ACCESSING_BITS_8_15)
122122   {
123123      /* bit 8 = enable sprite ROM reading */
124124      K053246_set_OBJCHA_line((data & 0x0100) ? ASSERT_LINE : CLEAR_LINE);
r2241r2242
134134
135135static WRITE16_HANDLER( sound_cmd_w )
136136{
137   if (ACCESSING_LSB) {
137   if (ACCESSING_BITS_0_7) {
138138      data &= 0xff;
139139      soundlatch_w(machine, 0, data);
140140   }
r2241r2242
149149
150150static WRITE16_HANDLER( xmen_18fa00_w )
151151{
152   if(ACCESSING_LSB) {
152   if(ACCESSING_BITS_0_7) {
153153      /* bit 2 is interrupt enable */
154154      interrupt_enable_w(machine,0,data & 0x04);
155155   //  xmen_irqenabled = data;
r2241r2242
175175   AM_RANGE(0x080000, 0x0fffff) AM_ROM
176176   AM_RANGE(0x100000, 0x100fff) AM_READWRITE(K053247_word_r, K053247_word_w)
177177   AM_RANGE(0x101000, 0x101fff) AM_RAM
178   AM_RANGE(0x104000, 0x104fff) AM_READWRITE(SMH_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
178   AM_RANGE(0x104000, 0x104fff) AM_RAM AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
179179   AM_RANGE(0x108000, 0x108001) AM_WRITE(eeprom_w)
180180   AM_RANGE(0x108020, 0x108027) AM_WRITE(K053246_word_w)
181181   AM_RANGE(0x10804c, 0x10804d) AM_WRITE(sound_cmd_w)
src/mame/drivers/silkroad.c
r2241r2242
166166
167167static WRITE32_HANDLER(silk_6295_0_w)
168168{
169   if (!(mem_mask & 0x00ff0000))
169   if (ACCESSING_BITS_16_23)
170170   {
171171      logerror("OKI0: write %x mem_mask %8x\n", data>>16, mem_mask);
172172      OKIM6295_data_0_w(machine, 0, (data>>16) & 0xff);
r2241r2242
180180
181181static WRITE32_HANDLER(silk_6295_1_w)
182182{
183   if (!(mem_mask & 0x00ff0000))
183   if (ACCESSING_BITS_16_23)
184184   {
185185      logerror("OKI1: write %x mem_mask %8x\n", data>>16, mem_mask);
186186      OKIM6295_data_1_w(machine, 0, (data>>16) & 0xff);
r2241r2242
194194
195195static WRITE32_HANDLER(silk_ym_regport_w)
196196{
197   if (!(mem_mask & 0x00ff0000))
197   if (ACCESSING_BITS_16_23)
198198   {
199199      YM2151_register_port_0_w(machine, 0, (data>>16) & 0xff);
200200   }
r2241r2242
202202
203203static WRITE32_HANDLER(silk_ym_dataport_w)
204204{
205   if (!(mem_mask & 0x00ff0000))
205   if (ACCESSING_BITS_16_23)
206206   {
207207      YM2151_data_port_0_w(machine, 0, (data>>16) & 0xff);
208208   }
src/mame/drivers/videopin.c
r2241r2242
192192 *
193193 *************************************/
194194
195static ADDRESS_MAP_START( videopin_readmem, ADDRESS_SPACE_PROGRAM, 8 )
196   AM_RANGE(0x0000, 0x07ff) AM_READ(SMH_RAM)
197   AM_RANGE(0x0800, 0x0800) AM_READ(videopin_misc_r)
198   AM_RANGE(0x1000, 0x1000) AM_READ(input_port_0_r)
199   AM_RANGE(0x1800, 0x1800) AM_READ(input_port_1_r)
200   AM_RANGE(0x2000, 0x3fff) AM_READ(SMH_ROM)
201   AM_RANGE(0xe000, 0xffff) AM_READ(SMH_ROM)   /* mirror for 6502 vectors */
202ADDRESS_MAP_END
203
204
205static ADDRESS_MAP_START( videopin_writemem, ADDRESS_SPACE_PROGRAM, 8 )
206   AM_RANGE(0x0000, 0x01ff) AM_WRITE(SMH_RAM)
207   AM_RANGE(0x0200, 0x07ff) AM_WRITE(videopin_video_ram_w) AM_BASE(&videopin_video_ram)
208   AM_RANGE(0x0800, 0x0800) AM_WRITE(videopin_note_dvsr_w)
195static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
196   AM_RANGE(0x0000, 0x01ff) AM_RAM
197   AM_RANGE(0x0200, 0x07ff) AM_RAM AM_WRITE(videopin_video_ram_w) AM_BASE(&videopin_video_ram)
198   AM_RANGE(0x0800, 0x0800) AM_READWRITE(videopin_misc_r, videopin_note_dvsr_w)
209199   AM_RANGE(0x0801, 0x0801) AM_WRITE(videopin_led_w)
210200   AM_RANGE(0x0802, 0x0802) AM_WRITE(watchdog_reset_w)
211201   AM_RANGE(0x0804, 0x0804) AM_WRITE(videopin_ball_w)
212202   AM_RANGE(0x0805, 0x0805) AM_WRITE(videopin_out1_w)
213203   AM_RANGE(0x0806, 0x0806) AM_WRITE(videopin_out2_w)
214   AM_RANGE(0x2000, 0x3fff) AM_WRITE(SMH_ROM)
204   AM_RANGE(0x1000, 0x1000) AM_READ(input_port_0_r)
205   AM_RANGE(0x1800, 0x1800) AM_READ(input_port_1_r)
206   AM_RANGE(0x2000, 0x3fff) AM_ROM
207   AM_RANGE(0xe000, 0xffff) AM_READ(SMH_ROM)   /* mirror for 6502 vectors */
215208ADDRESS_MAP_END
216209
217210
218
219211/*************************************
220212 *
221213 *  Port definitions
r2241r2242
331323
332324   /* basic machine hardware */
333325   MDRV_CPU_ADD(M6502, 12096000 / 16)
334   MDRV_CPU_PROGRAM_MAP(videopin_readmem, videopin_writemem)
326   MDRV_CPU_PROGRAM_MAP(main_map,0)
335327
336328   MDRV_MACHINE_RESET(videopin)
337329
src/mame/drivers/tecmo16.c
r2241r2242
6060
6161static WRITE16_HANDLER( tecmo16_sound_command_w )
6262{
63   if (ACCESSING_LSB)
63   if (ACCESSING_BITS_0_7)
6464   {
6565      soundlatch_w(machine,0x00,data & 0xff);
6666      cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
src/mame/drivers/taitowlf.c
r2241r2242
55
66#include "driver.h"
77#include "memconv.h"
8#include "devconv.h"
89#include "deprecat.h"
910#include "machine/8237dma.h"
1011#include "machine/pic8259.h"
r2241r2242
152153static UINT32 intel82439tx_pci_r(int function, int reg, UINT32 mem_mask)
153154{
154155   UINT32 r = 0;
155   if (!(mem_mask & 0xff000000))
156   if (ACCESSING_BITS_24_31)
156157   {
157158      r |= mxtc_config_r(function, reg + 3) << 24;
158159   }
159   if (!(mem_mask & 0x00ff0000))
160   if (ACCESSING_BITS_16_23)
160161   {
161162      r |= mxtc_config_r(function, reg + 2) << 16;
162163   }
163   if (!(mem_mask & 0x0000ff00))
164   if (ACCESSING_BITS_8_15)
164165   {
165166      r |= mxtc_config_r(function, reg + 1) << 8;
166167   }
167   if (!(mem_mask & 0x000000ff))
168   if (ACCESSING_BITS_0_7)
168169   {
169170      r |= mxtc_config_r(function, reg + 0) << 0;
170171   }
r2241r2242
173174
174175static void intel82439tx_pci_w(int function, int reg, UINT32 data, UINT32 mem_mask)
175176{
176   if (!(mem_mask & 0xff000000))
177   if (ACCESSING_BITS_24_31)
177178   {
178179      mxtc_config_w(function, reg + 3, (data >> 24) & 0xff);
179180   }
180   if (!(mem_mask & 0x00ff0000))
181   if (ACCESSING_BITS_16_23)
181182   {
182183      mxtc_config_w(function, reg + 2, (data >> 16) & 0xff);
183184   }
184   if (!(mem_mask & 0x0000ff00))
185   if (ACCESSING_BITS_8_15)
185186   {
186187      mxtc_config_w(function, reg + 1, (data >> 8) & 0xff);
187188   }
188   if (!(mem_mask & 0x000000ff))
189   if (ACCESSING_BITS_0_7)
189190   {
190191      mxtc_config_w(function, reg + 0, (data >> 0) & 0xff);
191192   }
r2241r2242
209210static UINT32 intel82371ab_pci_r(int function, int reg, UINT32 mem_mask)
210211{
211212   UINT32 r = 0;
212   if (!(mem_mask & 0xff000000))
213   if (ACCESSING_BITS_24_31)
213214   {
214215      r |= piix4_config_r(function, reg + 3) << 24;
215216   }
216   if (!(mem_mask & 0x00ff0000))
217   if (ACCESSING_BITS_16_23)
217218   {
218219      r |= piix4_config_r(function, reg + 2) << 16;
219220   }
220   if (!(mem_mask & 0x0000ff00))
221   if (ACCESSING_BITS_8_15)
221222   {
222223      r |= piix4_config_r(function, reg + 1) << 8;
223224   }
224   if (!(mem_mask & 0x000000ff))
225   if (ACCESSING_BITS_0_7)
225226   {
226227      r |= piix4_config_r(function, reg + 0) << 0;
227228   }
r2241r2242
230231
231232static void intel82371ab_pci_w(int function, int reg, UINT32 data, UINT32 mem_mask)
232233{
233   if (!(mem_mask & 0xff000000))
234   if (ACCESSING_BITS_24_31)
234235   {
235236      piix4_config_w(function, reg + 3, (data >> 24) & 0xff);
236237   }
237   if (!(mem_mask & 0x00ff0000))
238   if (ACCESSING_BITS_16_23)
238239   {
239240      piix4_config_w(function, reg + 2, (data >> 16) & 0xff);
240241   }
241   if (!(mem_mask & 0x0000ff00))
242   if (ACCESSING_BITS_8_15)
242243   {
243244      piix4_config_w(function, reg + 1, (data >> 8) & 0xff);
244245   }
245   if (!(mem_mask & 0x000000ff))
246   if (ACCESSING_BITS_0_7)
246247   {
247248      piix4_config_w(function, reg + 0, (data >> 0) & 0xff);
248249   }
r2241r2242
251252// ISA Plug-n-Play
252253static WRITE32_HANDLER( pnp_config_w )
253254{
254   if (!(mem_mask & 0x0000ff00))
255   if (ACCESSING_BITS_8_15)
255256   {
256257//      mame_printf_debug("PNP Config: %02X\n", (data >> 8) & 0xff);
257258   }
r2241r2242
259260
260261static WRITE32_HANDLER( pnp_data_w )
261262{
262   if (!(mem_mask & 0x0000ff00))
263   if (ACCESSING_BITS_8_15)
263264   {
264265//      mame_printf_debug("PNP Data: %02X\n", (data >> 8) & 0xff);
265266   }
r2241r2242
298299   }
299300}
300301
302
303DEV_READWRITE8TO32LE( taitowlf_pit8254_32le, pit8253_r, pit8253_w )
304
305
301306/*****************************************************************************/
302307
303308static ADDRESS_MAP_START( taitowlf_map, ADDRESS_SPACE_PROGRAM, 32 )
r2241r2242
314319static ADDRESS_MAP_START(taitowlf_io, ADDRESS_SPACE_IO, 32)
315320   AM_RANGE(0x0000, 0x001f) AM_READWRITE(dma8237_32le_0_r,         dma8237_32le_0_w)
316321   AM_RANGE(0x0020, 0x003f) AM_READWRITE(pic8259_32le_0_r,         pic8259_32le_0_w)
317   AM_RANGE(0x0040, 0x005f) AM_READWRITE(pit8253_32le_0_r,         pit8253_32le_0_w)
322   AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE(PIT8254, "pit8254", taitowlf_pit8254_32le_r, taitowlf_pit8254_32le_w)
318323   AM_RANGE(0x0060, 0x006f) AM_READWRITE(kbdc8042_32le_r,         kbdc8042_32le_w)
319324   AM_RANGE(0x0070, 0x007f) AM_READWRITE(mc146818_port32le_r,      mc146818_port32le_w)
320325   AM_RANGE(0x0080, 0x009f) AM_READWRITE(at_page32_r,            at_page32_w)
r2241r2242
407412   cpunum_set_irq_callback(0, irq_callback);
408413}
409414
415static PIT8253_OUTPUT_CHANGED( pc_timer0_w )
416{
417   pic8259_set_irq_line(0, 0, state);
418}
419
420static const struct pit8253_config taitowlf_pit8254_config =
421{
422   {
423      {
424         4772720/4,            /* heartbeat IRQ */
425         pc_timer0_w,
426         NULL
427      }, {
428         4772720/4,            /* dram refresh */
429         NULL,
430         NULL
431      }, {
432         4772720/4,            /* pio port c pin 4, and speaker polling enough */
433         NULL,
434         NULL
435      }
436   }
437};
438
410439static MACHINE_DRIVER_START(taitowlf)
411440
412441   /* basic machine hardware */
r2241r2242
416445
417446   MDRV_MACHINE_RESET(taitowlf)
418447
448   MDRV_DEVICE_ADD( "pit8254", PIT8254 )
449   MDRV_DEVICE_CONFIG( taitowlf_pit8254_config )
450
419451   MDRV_NVRAM_HANDLER( mc146818 )
420452
421453    /* video hardware */
r2241r2242
475507{
476508   bios_ram = auto_malloc(0x10000);
477509
478   init_pc_common(PCCOMMON_KEYBOARD_AT | PCCOMMON_DMA8237_AT | PCCOMMON_TIMER_8254);
510   init_pc_common(PCCOMMON_KEYBOARD_AT | PCCOMMON_DMA8237_AT);
479511   mc146818_init(MC146818_STANDARD);
480512
481513   intel82439tx_init();
src/mame/drivers/toypop.c
r2241r2242
149149
150150static WRITE16_HANDLER( toypop_m68000_sharedram_w )
151151{
152   if (ACCESSING_LSB)
152   if (ACCESSING_BITS_0_7)
153153      toypop_m68000_sharedram[offset] = data & 0xff;
154154}
155155
src/mame/drivers/tumbleb.c
r2241r2242
847847
848848static WRITE16_HANDLER( semicom_soundcmd_w )
849849{
850   if (ACCESSING_LSB)
850   if (ACCESSING_BITS_0_7)
851851   {
852852      soundlatch_w(machine,0,data & 0xff);
853853      // needed for Super Trio which reads the sound with polling
src/mame/drivers/m90.c
r2241r2242
5959
6060static WRITE16_HANDLER( m90_coincounter_w )
6161{
62   if (ACCESSING_LSB)
62   if (ACCESSING_BITS_0_7)
6363   {
6464      coin_counter_w(0,data & 0x01);
6565      coin_counter_w(1,data & 0x02);
r2241r2242
7070
7171static WRITE16_HANDLER( quizf1_bankswitch_w )
7272{
73   if (ACCESSING_LSB)
73   if (ACCESSING_BITS_0_7)
7474   {
7575      bankaddress = 0x10000 * (data & 0x0f);
7676      set_m90_bank();
src/mame/drivers/gunbustr.c
r2241r2242
124124   {
125125      case 0x00:
126126      {
127         if (ACCESSING_MSB32)   /* $400000 is watchdog */
127         if (ACCESSING_BITS_24_31)   /* $400000 is watchdog */
128128         {
129129            watchdog_reset(machine);
130130         }
131131
132         if (ACCESSING_LSB32)
132         if (ACCESSING_BITS_0_7)
133133         {
134134            EEPROM_set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
135135            EEPROM_write_bit(data & 0x40);
r2241r2242
141141
142142      case 0x01:
143143      {
144         if (ACCESSING_MSB32)
144         if (ACCESSING_BITS_24_31)
145145         {
146146            /* game does not write a separate counter for coin 2!
147147                   It should disable both coins when 9 credits reached
src/mame/drivers/taito_z.c
r2241r2242
846846   parse_control();
847847
848848   // Chase HQ: handle the lights
849   if ((!strcmp(Machine->gamedrv->name, "chasehq")) || (!strcmp(Machine->gamedrv->name, "chasehqj")))
849   if ((!strcmp(machine->gamedrv->name, "chasehq")) || (!strcmp(machine->gamedrv->name, "chasehqj")))
850850   {
851851      output_set_lamp_value(0, (data&0x20) ? 1 : 0);
852852      output_set_lamp_value(1, (data&0x40) ? 1 : 0);
r2241r2242
13041304   switch (offset)
13051305   {
13061306      case 0x0:
1307         return (mame_rand(Machine) &0xff);   /* motor status ?? */
1307         return (mame_rand(machine) &0xff);   /* motor status ?? */
13081308
13091309      case 0x101:
13101310         return 0x55;   /* motor cpu status ? */
src/mame/drivers/lastfght.c
r2241r2242
129129
130130static WRITE16_HANDLER(colordac_w)
131131{
132   if (ACCESSING_LSB)
132   if (ACCESSING_BITS_0_7)
133133   {
134134      colorram[clr_offset] = data;
135135      palette_set_color_rgb(Machine, clr_offset/3,
r2241r2242
140140      clr_offset = (clr_offset+1) % (256*3);
141141   }
142142
143   if (ACCESSING_MSB)
143   if (ACCESSING_BITS_8_15)
144144   {
145145      clr_offset = (data>>8) * 3;
146146   }
r2241r2242
154154// high byte of a 16 bit register
155155static WRITE16_HANDLER( lastfght_hi_w )
156156{
157   if (ACCESSING_MSB)   logerror("%06x: 600000.b = %02x\n", activecpu_get_pc(),data>>8);
158   if (ACCESSING_LSB)
157   if (ACCESSING_BITS_8_15)   logerror("%06x: 600000.b = %02x\n", activecpu_get_pc(),data>>8);
158   if (ACCESSING_BITS_0_7)
159159   {
160160      lastfght_hi   =   data << 8;
161161      //logerror("%06x: lastfght_hi  = %02x\n", activecpu_get_pc(),data);
r2241r2242
164164// screen x
165165static WRITE16_HANDLER( lastfght_x_w )
166166{
167   if (ACCESSING_MSB)   logerror("%06x: 800008.b = %02x\n", activecpu_get_pc(),data>>8);
168   if (ACCESSING_LSB)
167   if (ACCESSING_BITS_8_15)   logerror("%06x: 800008.b = %02x\n", activecpu_get_pc(),data>>8);
168   if (ACCESSING_BITS_0_7)
169169   {
170170      lastfght_x   =   lastfght_hi | data;
171171      //logerror("%06x: lastfght_x   = %02x\n", activecpu_get_pc(),data);
r2241r2242
174174// screen y, screen width - 1
175175static WRITE16_HANDLER( lastfght_yw_w )
176176{
177   if (ACCESSING_MSB)
177   if (ACCESSING_BITS_8_15)
178178   {
179179      lastfght_y   =   lastfght_hi | (data >> 8);
180180      //logerror("%06x: lastfght_y   = %02x\n", activecpu_get_pc(),data>>8);
181181   }
182   if (ACCESSING_LSB)
182   if (ACCESSING_BITS_0_7)
183183   {
184184      lastfght_w   =   lastfght_hi | data;
185185      //logerror("%06x: lastfght_w   = %02x\n", activecpu_get_pc(),data);
r2241r2242
188188// screen height - 1
189189static WRITE16_HANDLER( lastfght_h_w )
190190{
191   if (ACCESSING_MSB)
191   if (ACCESSING_BITS_8_15)
192192   {
193193      lastfght_h   =   lastfght_hi | (data >> 8);
194194      //logerror("%06x: lastfght_h   = %02x\n", activecpu_get_pc(),data>>8);
195195   }
196   if (ACCESSING_LSB)   logerror("%06x: 80000d.b = %02x\n", activecpu_get_pc(),data);
196   if (ACCESSING_BITS_0_7)   logerror("%06x: 80000d.b = %02x\n", activecpu_get_pc(),data);
197197}
198198// source delta x << 6, source x << 6
199199static WRITE16_HANDLER( lastfght_sx_w )
200200{
201   if (ACCESSING_MSB)
201   if (ACCESSING_BITS_8_15)
202202   {
203203      lastfght_dsx   =   lastfght_hi | (data >> 8);
204204      //logerror("%06x: lastfght_dsx = %02x\n", activecpu_get_pc(),data>>8);
205205   }
206   if (ACCESSING_LSB)
206   if (ACCESSING_BITS_0_7)
207207   {
208208      lastfght_sx   =   lastfght_hi | data;
209209      //logerror("%06x: lastfght_sx  = %02x\n", activecpu_get_pc(),data);
r2241r2242
212212// source y << 6, source y1 << 6
213213static WRITE16_HANDLER( lastfght_sy_w )
214214{
215   if (ACCESSING_MSB)
215   if (ACCESSING_BITS_8_15)
216216   {
217217      lastfght_sy   =   lastfght_hi | (data >> 8);
218218      //logerror("%06x: lastfght_sy  = %02x\n", activecpu_get_pc(),data>>8);
219219   }
220   if (ACCESSING_LSB)
220   if (ACCESSING_BITS_0_7)
221221   {
222222      lastfght_sy1   =   lastfght_hi | data;
223223      //logerror("%06x: lastfght_sy1 = %02x\n", activecpu_get_pc(),data);
r2241r2242
226226// source rom (0x200000 bytes), source page (512x256 bytes)
227227static WRITE16_HANDLER( lastfght_sr_w )
228228{
229   if (ACCESSING_MSB)
229   if (ACCESSING_BITS_8_15)
230230   {
231231      lastfght_sp   =   (lastfght_hi>>8) >> 4;
232232      //logerror("%06x: lastfght_sp  = %02x\n", activecpu_get_pc(),data>>8);
233233   }
234   if (ACCESSING_LSB)
234   if (ACCESSING_BITS_0_7)
235235   {
236236      lastfght_sr   =   data;
237237      //logerror("%06x: lastfght_sr  = %02x\n", activecpu_get_pc(),data);
r2241r2242
240240// source x1 << 6, source delta y << 6
241241static WRITE16_HANDLER( lastfght_sd_w )
242242{
243   if (ACCESSING_MSB)
243   if (ACCESSING_BITS_8_15)
244244   {
245245      lastfght_sx1   =   lastfght_hi | (data >> 8);
246246      //logerror("%06x: lastfght_sx1 = %02x\n", activecpu_get_pc(),data>>8);
247247   }
248   if (ACCESSING_LSB)
248   if (ACCESSING_BITS_0_7)
249249   {
250250      lastfght_dsy   =   lastfght_hi | data;
251251      //logerror("%06x: lastfght_dsy = %02x\n", activecpu_get_pc(),data);
r2241r2242
254254// start blit
255255static WRITE16_HANDLER( lastfght_blit_w )
256256{
257   if (ACCESSING_MSB)
257   if (ACCESSING_BITS_8_15)
258258   {
259259      int x,y, addr;
260260      UINT8 *gfxdata = memory_region( REGION_GFX1 );
r2241r2242
285285         }
286286      }
287287   }
288   if (ACCESSING_LSB)   logerror("%06x: 600007.b = %02x\n", activecpu_get_pc(),data);
288   if (ACCESSING_BITS_0_7)   logerror("%06x: 600007.b = %02x\n", activecpu_get_pc(),data);
289289}
290290// toggle framebuffer
291291static WRITE16_HANDLER( lastfght_dest_w )
292292{
293   if (ACCESSING_LSB)   lastfght_dest ^= 1;
293   if (ACCESSING_BITS_0_7)   lastfght_dest ^= 1;
294294}
295295
296296static READ16_HANDLER( lastfght_c00000_r )
r2241r2242
338338
339339static WRITE16_HANDLER( lastfght_sound_w )
340340{
341   if (ACCESSING_MSB)   logerror("%06x: sound_w msb = %02x\n", activecpu_get_pc(),data>>8);
342   if (ACCESSING_LSB)   logerror("%06x: sound_w lsb = %02x\n", activecpu_get_pc(),data);
341   if (ACCESSING_BITS_8_15)   logerror("%06x: sound_w msb = %02x\n", activecpu_get_pc(),data>>8);
342   if (ACCESSING_BITS_0_7)   logerror("%06x: sound_w lsb = %02x\n", activecpu_get_pc(),data);
343343}
344344
345345/***************************************************************************
src/mame/drivers/lockon.c
r2241r2242
8585{
8686   cpuintrf_push_context(GROUND_CPU);
8787
88   if (ACCESSING_LSB)
88   if (ACCESSING_BITS_0_7)
8989      program_write_byte(V30_GND_ADDR | (offset * 2 + 0), data);
90   if (ACCESSING_MSB)
90   if (ACCESSING_BITS_8_15)
9191      program_write_byte(V30_GND_ADDR | (offset * 2 + 1), data >> 8);
9292
9393   cpuintrf_pop_context();
r2241r2242
108108{
109109   cpuintrf_push_context(OBJECT_CPU);
110110
111   if (ACCESSING_LSB)
111   if (ACCESSING_BITS_0_7)
112112      program_write_byte(V30_OBJ_ADDR | (offset * 2 + 0), data);
113   if (ACCESSING_MSB)
113   if (ACCESSING_BITS_8_15)
114114      program_write_byte(V30_OBJ_ADDR | (offset * 2 + 1), data >> 8);
115115
116116   cpuintrf_pop_context();
r2241r2242
121121   if (offset < 0x800)
122122   {
123123      cpuintrf_push_context(GROUND_CPU);
124      if (ACCESSING_LSB)
124      if (ACCESSING_BITS_0_7)
125125         program_write_byte(V30_GND_ADDR | (offset * 2 + 0), data);
126      if (ACCESSING_MSB)
126      if (ACCESSING_BITS_8_15)
127127         program_write_byte(V30_GND_ADDR | (offset * 2 + 1), data >> 8);
128128      cpuintrf_pop_context();
129129
130130      cpuintrf_push_context(OBJECT_CPU);
131      if (ACCESSING_LSB)
131      if (ACCESSING_BITS_0_7)
132132         program_write_byte(V30_OBJ_ADDR | (offset * 2 + 0), data);
133      if (ACCESSING_MSB)
133      if (ACCESSING_BITS_8_15)
134134         program_write_byte(V30_OBJ_ADDR | (offset * 2 + 1), data >> 8);
135135      cpuintrf_pop_context();
136136   }
src/mame/drivers/pntnpuzl.c
r2241r2242
253253{
254254   static int indx,sub,rgb[3];
255255
256   if (ACCESSING_MSB)
256   if (ACCESSING_BITS_8_15)
257257   {
258258      indx = data >> 8;
259259      sub = 0;
260260   }
261   if (ACCESSING_LSB)
261   if (ACCESSING_BITS_0_7)
262262   {
263263      rgb[sub++] = data & 0xff;
264264      if (sub == 3)
src/mame/drivers/gijoe.c
r2241r2242
115115
116116static WRITE16_HANDLER( control2_w )
117117{
118   if(ACCESSING_LSB) {
118   if(ACCESSING_BITS_0_7) {
119119      /* bit 0  is data */
120120      /* bit 1  is cs (active low) */
121121      /* bit 2  is clock (active high) */
r2241r2242
183183
184184static WRITE16_HANDLER( sound_cmd_w )
185185{
186   if(ACCESSING_LSB) {
186   if(ACCESSING_BITS_0_7) {
187187      data &= 0xff;
188188      soundlatch_w(machine, 0, data);
189189   }
src/mame/drivers/tigeroad.c
r2241r2242
158158
159159static WRITE16_HANDLER( tigeroad_soundcmd_w )
160160{
161   if (ACCESSING_MSB)
161   if (ACCESSING_BITS_8_15)
162162      soundlatch_w(machine,offset,data >> 8);
163163}
164164
src/mame/drivers/looping.c
r2241r2242
190190
191191static WRITE8_HANDLER( flip_screen_x_w )
192192{
193   looping_state *state = Machine->driver_data;
193   looping_state *state = machine->driver_data;
194194   flip_screen_x_set(~data & 0x01);
195195   tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get() ? 128 : 0);
196196}
r2241r2242
198198
199199static WRITE8_HANDLER( flip_screen_y_w )
200200{
201   looping_state *state = Machine->driver_data;
201   looping_state *state = machine->driver_data;
202202   flip_screen_y_set(~data & 0x01);
203203   tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get() ? 128 : 0);
204204}
r2241r2242
206206
207207static WRITE8_HANDLER( looping_videoram_w )
208208{
209   looping_state *state = Machine->driver_data;
209   looping_state *state = machine->driver_data;
210210   state->videoram[offset] = data;
211211   tilemap_mark_tile_dirty(state->bg_tilemap, offset);
212212}
r2241r2242
214214
215215static WRITE8_HANDLER( looping_colorram_w )
216216{
217   looping_state *state = Machine->driver_data;
217   looping_state *state = machine->driver_data;
218218   int i;
219219
220220   state->colorram[offset] = data;
r2241r2242
363363        0007 = AFA
364364    */
365365
366   looping_state *state = Machine->driver_data;
366   looping_state *state = machine->driver_data;
367367   state->sound[offset + 1] = data ^ 1;
368368   DAC_data_w(0, ((state->sound[2] << 7) + (state->sound[3] << 6)) * state->sound[7]);
369369}
src/mame/drivers/segas32.c
r2241r2242
527527
528528static WRITE16_HANDLER( interrupt_control_16_w )
529529{
530   if (ACCESSING_LSB)
530   if (ACCESSING_BITS_0_7)
531531      int_control_w(offset*2+0, data);
532   if (ACCESSING_MSB)
532   if (ACCESSING_BITS_8_15)
533533      int_control_w(offset*2+1, data >> 8);
534534}
535535
r2241r2242
550550
551551static WRITE32_HANDLER( interrupt_control_32_w )
552552{
553   if (!(mem_mask & 0x000000ff))
553   if (ACCESSING_BITS_0_7)
554554      int_control_w(offset*4+0, data);
555   if (!(mem_mask & 0x0000ff00))
555   if (ACCESSING_BITS_8_15)
556556      int_control_w(offset*4+1, data >> 8);
557   if (!(mem_mask & 0x00ff0000))
557   if (ACCESSING_BITS_16_23)
558558      int_control_w(offset*4+2, data >> 16);
559   if (!(mem_mask & 0xff000000))
559   if (ACCESSING_BITS_24_31)
560560      int_control_w(offset*4+3, data >> 24);
561561}
562562
r2241r2242
642642   UINT8 old;
643643
644644   /* only LSB matters */
645   if (!ACCESSING_LSB)
645   if (!ACCESSING_BITS_0_7)
646646      return;
647647
648648   /* generic implementation */
r2241r2242
719719
720720static WRITE32_HANDLER( io_chip_0_w )
721721{
722   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
722   if (ACCESSING_BITS_0_15)
723723      common_io_chip_w(0, offset*2+0, data, mem_mask);
724   if ((mem_mask & 0xffff0000) != 0xffff0000)
724   if (ACCESSING_BITS_16_31)
725725      common_io_chip_w(0, offset*2+1, data >> 16, mem_mask >> 16);
726726}
727727
r2241r2242
735735
736736static WRITE32_HANDLER( io_chip_1_w )
737737{
738   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
738   if (ACCESSING_BITS_0_15)
739739      common_io_chip_w(1, offset*2+0, data, mem_mask);
740   if ((mem_mask & 0xffff0000) != 0xffff0000)
740   if (ACCESSING_BITS_16_31)
741741      common_io_chip_w(1, offset*2+1, data >> 16, mem_mask >> 16);
742742}
743743
r2241r2242
762762static WRITE16_HANDLER( io_expansion_w )
763763{
764764   /* only LSB matters */
765   if (!ACCESSING_LSB)
765   if (!ACCESSING_BITS_0_7)
766766      return;
767767
768768   if (custom_io_w[0])
r2241r2242
786786static WRITE32_HANDLER( io_expansion_0_w )
787787{
788788   /* only LSB matters */
789   if ((mem_mask & 0x000000ff) != 0x000000ff)
789   if (ACCESSING_BITS_0_7)
790790   {
791791      if (custom_io_w[0])
792792         (*custom_io_w[0])(machine, offset*2+0, data, mem_mask);
793793      else
794794         logerror("%06X:io_expansion_w(%X) = %02X\n", activecpu_get_pc(), offset, data & 0xff);
795795   }
796   if ((mem_mask & 0x00ff0000) != 0x00ff0000)
796   if (ACCESSING_BITS_16_23)
797797   {
798798      if (custom_io_w[0])
799799         (*custom_io_w[0])(machine, offset*2+1, data >> 16, mem_mask >> 16);
r2241r2242
817817static WRITE32_HANDLER( io_expansion_1_w )
818818{
819819   /* only LSB matters */
820   if ((mem_mask & 0x000000ff) != 0x000000ff)
820   if (ACCESSING_BITS_0_7)
821821   {
822822      if (custom_io_w[1])
823823         (*custom_io_w[1])(machine, offset*2+0, data, mem_mask);
824824      else
825825         logerror("%06X:io_expansion_w(%X) = %02X\n", activecpu_get_pc(), offset, data & 0xff);
826826   }
827   if ((mem_mask & 0x00ff0000) != 0x00ff0000)
827   if (ACCESSING_BITS_16_23)
828828   {
829829      if (custom_io_w[1])
830830         (*custom_io_w[1])(machine, offset*2+1, data >> 16, mem_mask >> 16);
r2241r2242
993993
994994static WRITE16_HANDLER( shared_ram_16_w )
995995{
996   if (ACCESSING_LSB)
996   if (ACCESSING_BITS_0_7)
997997      z80_shared_ram[offset*2+0] = data;
998   if (ACCESSING_MSB)
998   if (ACCESSING_BITS_8_15)
999999      z80_shared_ram[offset*2+1] = data >> 8;
10001000}
10011001
r2241r2242
10091009
10101010static WRITE32_HANDLER( shared_ram_32_w )
10111011{
1012   if (!(mem_mask & 0x000000ff))
1012   if (ACCESSING_BITS_0_7)
10131013      z80_shared_ram[offset*4+0] = data;
1014   if (!(mem_mask & 0x0000ff00))
1014   if (ACCESSING_BITS_8_15)
10151015      z80_shared_ram[offset*4+1] = data >> 8;
1016   if (!(mem_mask & 0x00ff0000))
1016   if (ACCESSING_BITS_16_23)
10171017      z80_shared_ram[offset*4+2] = data >> 16;
1018   if (!(mem_mask & 0xff000000))
1018   if (ACCESSING_BITS_24_31)
10191019      z80_shared_ram[offset*4+3] = data >> 24;
10201020}
10211021
src/mame/drivers/badlands.c
r2241r2242
535535 *************************************/
536536
537537GAME( 1989, badlands, 0, badlands, badlands, badlands, ROT0, "Atari Games", "Bad Lands", 0 )
538
539/* Badlands - Playmark Bootleg support - split this into its own file?
540
541 Year: 1989
542 Producer: Playmark
543
544 cpu: 68000
545 sound cpu:  Z80
546 sound ics: YM2151 + 3012
547
548 other ics: 28c16 2kx8 eeprom.Used to store bookeeping,settings etc. like original pcb.
549
550 Osc: 20 Mhz, 28 Mhz
551
552 ROMs:
553
554 blb21, blb22, blb27, blb28 main program
555 blb26 sound program
556 blb29 to blb40 graphics
557
558 All eproms are 27c512
559
560 Note
561
562 This romset comes from a bootleg pcb produced by Playmark.This pcb was been modified to use as control standard joysticks instead of steering wheels.Game differences are: Copyright string removed.
563
564*/
565
566static READ16_HANDLER( badlandb_unk_r )
567{
568
569   return 0xffff;
570}
571
572static ADDRESS_MAP_START( bootleg_map, ADDRESS_SPACE_PROGRAM, 16 )
573   AM_RANGE(0x000000, 0x03ffff) AM_ROM
574
575
576   AM_RANGE(0x400008, 0x400009) AM_READ(badlandb_unk_r )
577   AM_RANGE(0x4000fe, 0x4000ff) AM_READ(badlandb_unk_r )
578
579   AM_RANGE(0xfc0000, 0xfc0001) AM_READ(badlandb_unk_r )
580
581   AM_RANGE(0xfe4000, 0xfe4001) AM_READ(badlandb_unk_r )
582   AM_RANGE(0xfe4004, 0xfe4005) AM_READ(badlandb_unk_r )
583   AM_RANGE(0xfe4006, 0xfe4007) AM_READ(badlandb_unk_r )
584
585
586   AM_RANGE(0xfd0000, 0xfd1fff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE(&atarigen_eeprom) AM_SIZE(&atarigen_eeprom_size)
587   //AM_RANGE(0xfe0000, 0xfe1fff) AM_WRITE(watchdog_reset16_w)
588   AM_RANGE(0xfe2000, 0xfe3fff) AM_WRITE(atarigen_video_int_ack_w)
589
590   AM_RANGE(0xfec000, 0xfedfff) AM_WRITE(badlands_pf_bank_w)
591   AM_RANGE(0xfee000, 0xfeffff) AM_WRITE(atarigen_eeprom_enable_w)
592   AM_RANGE(0xffc000, 0xffc3ff) AM_READWRITE(SMH_RAM, atarigen_expanded_666_paletteram_w) AM_BASE(&paletteram16)
593   AM_RANGE(0xffe000, 0xffefff) AM_READWRITE(SMH_RAM, atarigen_playfield_w) AM_BASE(&atarigen_playfield)
594   AM_RANGE(0xfff000, 0xfff1ff) AM_READWRITE(SMH_RAM, atarimo_0_spriteram_expanded_w) AM_BASE(&atarimo_0_spriteram)
595   AM_RANGE(0xfff200, 0xffffff) AM_RAM
596ADDRESS_MAP_END
597
598
599static const gfx_layout pflayout_bootleg =
600{
601   8,8,
602   RGN_FRAC(1,4),
603   4,
604   { RGN_FRAC(0,4), RGN_FRAC(1,4), RGN_FRAC(2,4), RGN_FRAC(3,4) },
605   { 0, 1, 2, 3, 4, 5, 6, 7 },
606   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
607   8*8
608};
609
610static GFXDECODE_START( badlandb )
611   GFXDECODE_ENTRY( REGION_GFX1, 0, pflayout_bootleg,    0, 8 )
612   GFXDECODE_ENTRY( REGION_GFX2, 0, molayout,  128, 8 )
613GFXDECODE_END
614
615static void update_interrupts_bootleg(running_machine *machine)
616{
617   int newstate = 0;
618
619   if (atarigen_video_int_state)
620      newstate = 1;
621//  if (atarigen_sound_int_state)
622//      newstate = 2;
623
624   if (newstate)
625      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
626   else
627      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
628}
629
630
631static void scanline_update_bootleg(const device_config *screen, int scanline)
632{
633   /* sound IRQ is on 32V */
634//  if (scanline & 32)
635//      atarigen_6502_irq_ack_r(screen->machine, 0);
636//  else if (!(readinputport(0) & 0x40))
637//      atarigen_6502_irq_gen(screen->machine, 0);
638}
639
640
641
642static MACHINE_RESET( badlandb )
643{
644//  pedal_value[0] = pedal_value[1] = 0x80;
645
646   atarigen_eeprom_reset();
647   atarigen_interrupt_reset(update_interrupts_bootleg);
648   atarigen_scanline_timer_reset(machine->primary_screen, scanline_update_bootleg, 32);
649
650//  atarigen_sound_io_reset(1);
651//  memcpy(bank_base, &bank_source_data[0x0000], 0x1000);
652}
653
654static MACHINE_DRIVER_START( badlandb )
655
656   /* basic machine hardware */
657   MDRV_CPU_ADD(M68000, 2800000/2)
658   MDRV_CPU_PROGRAM_MAP(bootleg_map,0)
659   MDRV_CPU_VBLANK_INT("main", vblank_int)
660
661//  MDRV_CPU_ADD(Z80, 2800000/8)
662//  MDRV_CPU_PROGRAM_MAP(bootleg_soundmap,0)
663
664   MDRV_MACHINE_RESET(badlandb)
665   MDRV_NVRAM_HANDLER(atarigen)
666
667   /* video hardware */
668   MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
669   MDRV_GFXDECODE(badlandb)
670   MDRV_PALETTE_LENGTH(256)
671
672   MDRV_SCREEN_ADD("main", RASTER)
673   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
674   /* note: these parameters are from published specs, not derived */
675   /* the board uses an SOS-2 chip to generate video signals */
676   MDRV_SCREEN_RAW_PARAMS(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240)
677
678   MDRV_VIDEO_START(badlands)
679   MDRV_VIDEO_UPDATE(badlands)
680
681   /* sound hardware */
682   MDRV_SPEAKER_STANDARD_MONO("mono")
683
684   MDRV_SOUND_ADD(YM2151, 2800000/4)
685   MDRV_SOUND_ROUTE(0, "mono", 0.30)
686   MDRV_SOUND_ROUTE(1, "mono", 0.30)
687MACHINE_DRIVER_END
688
689
690
691/* bootleg by Playmark, uses Joystick controls */
692ROM_START( badlandb )
693   /* bootleg 68k Program */
694   ROM_REGION( 0x40000, REGION_CPU1, 0 )   /* 4*64k for 68000 code */
695   ROM_LOAD16_BYTE( "blb28.ic21",  0x00000, 0x10000, CRC(dffb025d) SHA1(f2c17607acbbeee7d5d3f3dd2e8dc768b755e991) )
696   ROM_LOAD16_BYTE( "blb22.ic22",  0x00001, 0x10000, CRC(ca3015c4) SHA1(72e1451498143d920239487704f4b4a8a71410e0) )
697   ROM_LOAD16_BYTE( "blb27.ic19",  0x20000, 0x10000, CRC(0e2e807f) SHA1(5b61de066dca12c44335aa68a13c821845657866) )
698   ROM_LOAD16_BYTE( "blb21.ic20",  0x20001, 0x10000, CRC(99a20c2c) SHA1(9b0a5a5dafb8816e72330d302c60339b600b49a8) )
699
700   /* Z80 on the bootleg! */
701   ROM_REGION( 0x10000, REGION_CPU2, 0 )
702   ROM_LOAD( "blb26.ic27", 0x00000, 0x10000, CRC(59503ab4) SHA1(ea5686ee28f6125c1394d687cc35c6322c8f900c) )
703
704   /* the 2nd half of 122,123,124 and 125 is identical to the first half and not used */
705   ROM_REGION( 0x80000, REGION_GFX1, ROMREGION_DISPOSE )
706   ROM_LOAD( "blb36.ic123",  0x000000, 0x10000, BAD_DUMP CRC(d7978eeb) SHA1(1adc95bebe9eea8c112d40cd04ab7a8d75c4f961) ) /* bad dump -- empty */
707   ROM_LOAD( "blb37.ic92",   0x008000, 0x10000, CRC(9188db9f) SHA1(8f7dc2c4c0dec9a80b6214a2efaa0de0858de84c) )
708   ROM_LOAD( "blb38.ic125",  0x020000, 0x10000, CRC(4839dd54) SHA1(031efbc144e5e088be0f3576aa514c7c2b775f6d) )
709   ROM_LOAD( "blb31.ic91",   0x028000, 0x10000, BAD_DUMP CRC(77e3dabc) SHA1(fa3c93f37ab11cfe82cf17c25ec2f9b8bee8a64e) ) /* bad dump -- BADADDR        xxxx-xxxxxxxxxxx */
710   ROM_LOAD( "blb30.ic122",  0x040000, 0x10000, CRC(61a1bcec) SHA1(fd38bbf8f6c8d1e0e936740db757f9fa85753503) )
711   ROM_LOAD( "blb35.ic90",   0x048000, 0x10000, CRC(649c17f0) SHA1(bed3b7fc2c0516fe309bb81b65d8925ecf3065e4) )
712   ROM_LOAD( "blb32.ic124",  0x060000, 0x10000, CRC(a67c61ba) SHA1(d701eb7f4520b57be54a7113d39f81d52800ee7e) )
713   ROM_LOAD( "blb29.ic88",   0x068000, 0x10000, CRC(a9f280e5) SHA1(daff021d14f17da8c4469270a1e50e5a01d05d49) )
714
715   /* the 1st half of 67 & 68 are empty and not used */
716   ROM_REGION( 0x40000, REGION_GFX2, ROMREGION_DISPOSE )
717   ROM_LOAD16_BYTE( "blb33.ic67", 0x10001, 0x10000, CRC(aebf9938) SHA1(3778aacbde07e5a5d010e41ab62d5b0db8632ad8) )
718   ROM_LOAD16_BYTE( "blb34.ic34", 0x00001, 0x10000, CRC(3eac30a5) SHA1(deefc668185bf30ad3eeba73853f97ce12b85293) )
719   ROM_LOAD16_BYTE( "blb39.ic68", 0x10000, 0x10000, CRC(f398f2d7) SHA1(1eef64680101888425490eb4d5b86072e59753cf) )
720   ROM_LOAD16_BYTE( "blb40.ic35", 0x00000, 0x10000, CRC(b47679ee) SHA1(0bd7d40dad214c54021c2014efbd374a7e4c7a3f) )
721ROM_END
722
723
724static DRIVER_INIT( badlandb )
725{
726   atarigen_eeprom_default = NULL;
727}
728
729
730GAME( 1989, badlandb, badlands, badlandb, badlands, badlandb, ROT0, "[Atari Games] (Playmark bootleg)", "Bad Lands (bootleg)", GAME_NOT_WORKING )
src/mame/drivers/psikyosh.c
r2241r2242
388388
389389static WRITE32_HANDLER( psh_eeprom_w )
390390{
391   if (ACCESSING_MSB32)
391   if (ACCESSING_BITS_24_31)
392392   {
393393      EEPROM_write_bit((data & 0x20000000) ? 1 : 0);
394394      EEPROM_set_cs_line((data & 0x80000000) ? CLEAR_LINE : ASSERT_LINE);
r2241r2242
402402
403403static READ32_HANDLER( psh_eeprom_r )
404404{
405   if (ACCESSING_MSB32)
405   if (ACCESSING_BITS_24_31)
406406   {
407407      return ((EEPROM_read_bit() << 28) | (readinputport(4) << 24)); /* EEPROM | Region */
408408   }
r2241r2242
441441#if ROMTEST
442442   if(offset==4) /* Configure bank for gfx test */
443443   {
444      if (!(mem_mask & 0x000000ff) || !(mem_mask & 0x0000ff00))   // Bank
444      if (ACCESSING_BITS_0_15)   // Bank
445445      {
446446         UINT8 *ROM = memory_region(REGION_GFX1);
447447         memory_set_bankptr(2,&ROM[0x20000 * (psikyosh_vidregs[offset]&0xfff)]); /* Bank comes from vidregs */
r2241r2242
468468
469469static WRITE32_HANDLER( psh_ymf_fm_w )
470470{
471   if (!(mem_mask & 0xff000000))   // FM bank 1 address (OPL2/OPL3 compatible)
471   if (ACCESSING_BITS_24_31)   // FM bank 1 address (OPL2/OPL3 compatible)
472472   {
473473      YMF278B_control_port_0_A_w(machine, 0, data>>24);
474474   }
475475
476   if (!(mem_mask & 0x00ff0000))   // FM bank 1 data
476   if (ACCESSING_BITS_16_23)   // FM bank 1 data
477477   {
478478      YMF278B_data_port_0_A_w(machine, 0, data>>16);
479479   }
480480
481   if (!(mem_mask & 0x0000ff00))   // FM bank 2 address (OPL3/YMF 262 extended)
481   if (ACCESSING_BITS_8_15)   // FM bank 2 address (OPL3/YMF 262 extended)
482482   {
483483      YMF278B_control_port_0_B_w(machine, 0, data>>8);
484484   }
485485
486   if (!(mem_mask & 0x000000ff))   // FM bank 2 data
486   if (ACCESSING_BITS_0_7)   // FM bank 2 data
487487   {
488488      YMF278B_data_port_0_B_w(machine, 0, data);
489489   }
r2241r2242
491491
492492static WRITE32_HANDLER( psh_ymf_pcm_w )
493493{
494   if (!(mem_mask & 0xff000000))   // PCM address (OPL4/YMF 278B extended)
494   if (ACCESSING_BITS_24_31)   // PCM address (OPL4/YMF 278B extended)
495495   {
496496      YMF278B_control_port_0_C_w(machine, 0, data>>24);
497497
r2241r2242
503503#endif
504504   }
505505
506   if (!(mem_mask & 0x00ff0000))   // PCM data
506   if (ACCESSING_BITS_16_23)   // PCM data
507507   {
508508      YMF278B_data_port_0_C_w(machine, 0, data>>16);
509509   }
src/mame/drivers/darkhors.c
r2241r2242
242242   if (data & ~0xff000000)
243243      logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %08X\n",activecpu_get_pc(),data);
244244
245   if ( ACCESSING_MSB32 )
245   if ( ACCESSING_BITS_24_31 )
246246   {
247247      // latch the bit
248248      EEPROM_write_bit(data & 0x04000000);
r2241r2242
257257
258258static WRITE32_HANDLER( OKIM6295_data_0_msb32_w )
259259{
260   if (ACCESSING_MSB32)
260   if (ACCESSING_BITS_24_31)
261261      OKIM6295_data_0_msb_w(machine, offset, data >> 16, mem_mask >> 16);
262262}
263263
r2241r2242
269269static WRITE32_HANDLER( paletteram32_xBBBBBGGGGGRRRRR_dword_w )
270270{
271271   paletteram16 = (UINT16 *)paletteram32;
272   if (ACCESSING_MSW32)   paletteram16_xBBBBBGGGGGRRRRR_word_w(machine, offset*2, data >> 16, mem_mask >> 16);
273   if (ACCESSING_LSW32)   paletteram16_xBBBBBGGGGGRRRRR_word_w(machine, offset*2+1, data, mem_mask);
272   if (ACCESSING_BITS_16_31)   paletteram16_xBBBBBGGGGGRRRRR_word_w(machine, offset*2, data >> 16, mem_mask >> 16);
273   if (ACCESSING_BITS_0_15)   paletteram16_xBBBBBGGGGGRRRRR_word_w(machine, offset*2+1, data, mem_mask);
274274}
275275
276276static UINT32 input_sel;
277277static WRITE32_HANDLER( darkhors_input_sel_w )
278278{
279279   COMBINE_DATA(&input_sel);
280//  if (ACCESSING_MSW32)    popmessage("%04X",data >> 16);
280//  if (ACCESSING_BITS_16_31)    popmessage("%04X",data >> 16);
281281}
282282
283283static int mask_to_bit( int mask )
r2241r2242
309309static WRITE32_HANDLER( darkhors_unk1_w )
310310{
311311   // 0x1000 lockout
312//  if (ACCESSING_MSW32)    popmessage("%04X",data >> 16);
312//  if (ACCESSING_BITS_16_31)    popmessage("%04X",data >> 16);
313313}
314314
315315static ADDRESS_MAP_START( darkhors_readmem, ADDRESS_SPACE_PROGRAM, 32 )
src/mame/drivers/bishjan.c
r2241r2242
122122
123123static WRITE16_HANDLER(colordac_w)
124124{
125   if (ACCESSING_LSB)
125   if (ACCESSING_BITS_0_7)
126126   {
127127      colorram[clr_offset] = data;
128128      palette_set_color_rgb(Machine, clr_offset/3,
r2241r2242
133133      clr_offset = (clr_offset+1) % (256*3);
134134   }
135135
136   if (ACCESSING_MSB)
136   if (ACCESSING_BITS_8_15)
137137   {
138138      clr_offset = (data>>8) * 3;
139139   }
r2241r2242
145145
146146static WRITE16_HANDLER( bishjan_low_w )
147147{
148   if (ACCESSING_MSB)   bishjan_low = data >> 8;
148   if (ACCESSING_BITS_8_15)   bishjan_low = data >> 8;
149149}
150150
151151static WRITE16_HANDLER( bishjan_tmap1_w )
152152{
153   if (ACCESSING_MSB)
153   if (ACCESSING_BITS_8_15)
154154   {
155155      bishjan_videoram1[offset*2] = data | bishjan_low;
156156      tilemap_mark_tile_dirty(tmap1, offset*2);
157157   }
158   if (ACCESSING_LSB)
158   if (ACCESSING_BITS_0_7)
159159   {
160160      bishjan_videoram1[offset*2+1] = (data << 8) | bishjan_low;
161161      tilemap_mark_tile_dirty(tmap1, offset*2+1);
r2241r2242
163163}
164164static WRITE16_HANDLER( bishjan_tmap2_w )
165165{
166   if (ACCESSING_MSB)
166   if (ACCESSING_BITS_8_15)
167167   {
168168      bishjan_videoram2[offset*2] = data | bishjan_low;
169169      tilemap_mark_tile_dirty(tmap2, offset*2);
170170   }
171   if (ACCESSING_LSB)
171   if (ACCESSING_BITS_0_7)
172172   {
173173      bishjan_videoram2[offset*2+1] = (data << 8) | bishjan_low;
174174      tilemap_mark_tile_dirty(tmap2, offset*2+1);
r2241r2242
199199
200200static WRITE16_HANDLER( bishjan_sel_w )
201201{
202   if (ACCESSING_MSB)   bishjan_sel = data >> 8;
202   if (ACCESSING_BITS_8_15)   bishjan_sel = data >> 8;
203203}
204204
205205static READ16_HANDLER( bishjan_unk_r )
r2241r2242
214214
215215static WRITE16_HANDLER( bishjan_input_w )
216216{
217   if (ACCESSING_MSB)   bishjan_input = data >> 8;
217   if (ACCESSING_BITS_8_15)   bishjan_input = data >> 8;
218218}
219219
220220static READ16_HANDLER( bishjan_input_r )
r2241r2242
234234
235235static WRITE16_HANDLER( bishjan_coin_w )
236236{
237   if (ACCESSING_LSB)
237   if (ACCESSING_BITS_0_7)
238238   {
239239      // coin out         data & 0x01;
240240      bishjan_hopper   =   data & 0x02;   // hopper
src/mame/drivers/offtwall.c
r2241r2242
9999static WRITE16_HANDLER( io_latch_w )
100100{
101101   /* lower byte */
102   if (ACCESSING_LSB)
102   if (ACCESSING_BITS_0_7)
103103   {
104104      /* bit 4 resets the sound CPU */
105105      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
src/mame/drivers/equites.c
r2241r2242
685685
686686static WRITE16_HANDLER(mcu_w)
687687{
688   if (ACCESSING_LSB)
688   if (ACCESSING_BITS_0_7)
689689      mcu_ram[offset] = data & 0xff;
690690}
691691
src/mame/drivers/esh.c
r2241r2242
372372{
373373}
374374
375/*    YEAR  NAME  PARENT   MACHINE  INPUT  INIT  MONITOR  COMPANY          FULLNAME                     FLAGS) */
376GAME( 1983, esh,  0,       esh,     esh,   esh,  ROT0,    "Funai/Gakken",  "Esh's Aurunmilla (set 1)",  GAME_NOT_WORKING|GAME_NO_SOUND)
377GAME( 1983, esha, 0,       esh,     esh,   esh,  ROT0,    "Funai/Gakken",  "Esh's Aurunmilla (Set 2)",  GAME_NOT_WORKING|GAME_NO_SOUND)
378GAME( 1983, eshb, 0,       esh,     esh,   esh,  ROT0,    "Funai/Gakken",  "Esh's Aurunmilla (Set 3)",  GAME_NOT_WORKING|GAME_NO_SOUND)
375/*    YEAR  NAME  PARENT       MACHINE  INPUT    INIT     MONITOR  COMPANY          FULLNAME                     FLAGS */
376GAME( 1983, esh,      0,       esh,     esh,     esh,     ROT0,    "Funai/Gakken",  "Esh's Aurunmilla (set 1)",  GAME_NOT_WORKING|GAME_NO_SOUND)
377GAME( 1983, esha,     esh,     esh,     esh,     esh,     ROT0,    "Funai/Gakken",  "Esh's Aurunmilla (Set 2)",  GAME_NOT_WORKING|GAME_NO_SOUND)
378GAME( 1983, eshb,     esh,     esh,     esh,     esh,     ROT0,    "Funai/Gakken",  "Esh's Aurunmilla (Set 3)",  GAME_NOT_WORKING|GAME_NO_SOUND)
src/mame/drivers/neodrvr.c
r2241r2242
402402   ROM_REGION( 0x10000, NEOGEO_REGION_ZOOM_Y_TABLE, 0 )                                          \
403403   ROM_LOAD( "000-lo.lo", 0x00000, 0x10000, CRC(e09e253c) SHA1(2b1c719531dac9bb503f22644e6e4236b91e7cfc) )
404404
405
406405/***************************************************************************
407406
408407    Neo-Geo game pcb infos:
r2241r2242
433432    . NEO-PVC
434433    . NEO-SMA
435434    . PCM
435    . PRO-CT0
436    . SNK-9201
436437
437438
438439    Known pcb's:
439440    ============
440441
441442    MVS CHA:
443    -- SNK --
442444    . NEO-MVS CHA-8M
443445    . NEO-MVS CHA42G
444446    . NEO-MVS CHA42G-1
445    . NEO-MVS CHA42G-2
447    . NEO-MVS CHA 42G-2
448    . NEO-MVS CHA 42G-3
446449    . NEO-MVS CHA42G-3B
447450    . NEO-MVS CHA256
448451    . NEO-MVS CHA256B
449452    . NEO-MVS PSTM CHA136
450453    . NEO-MVS CHA512Y
451    . NEO-MVS CHAFIO
454    . NEO-MVS CHAFIO (1999.6.14)
455    . NEO-MVS CHAFIO (SNK 2002) - MADE IN KOREA
456    -- SNKPLAYMORE --
457    . NEO-MVS CHAFIO (2003.7.24)
452458
453459    MVS PROG:
460    -- SNK --
461    . NEO-MVS PROG-EP
454462    . NEO-MVS PROG8M42
455463    . NEO-MVS PROG16
456464    . NEO-MVS PROG42G
457465    . NEO-MVS PROG42G-1
466    . NEO-MVS PROG-G2
467    . NEO-MVS PROG 4096
468    . NEO-MVS PROG 4096 B
458469    . NEO-MVS PROGGSC
459470    . NEO-MVS PROGTOP
460    . NEO-MVS PROGSF1
461    . NEO-MVS PROGEOP
462    . NEO-MVS PROGLBA - LBA-SUB (2000.2.24)
471    . NEO-MVS PROGSF1 (1998.6.17)
472    . NEO-MVS PROGEOP (1999.2.2)
473    . NEO-MVS PROGLBA (1999.4.12) - LBA-SUB (2000.2.24)
463474    . NEO-MVS PROGBK1
464    . NEO-MVS PROGBK2
465    . NEO-MVS PROGBK2R
466    . NEO-MVS PROGBK3R
467    . NEO-MVS PROGBK3S
475    . NEO-MVS PROGBK2 (2000.3.21)
476    . NEO-MVS PROGBK2 (SNK 2002) - MADE IN KOREA
477    -- SNKPLAYMORE --
478    . NEO-MVS PROGBK2R (2003.8.26) - NEO-HYCS (2003.9.29)
479    . NEO-MVS PROGBK3R (2003.9.2) - NEO-HYCS (2003.9.29)
480    . NEO-MVS PROGBK3S (2003.10.1)
481    . NEO-MVS PROGBK2S (2003.10.xx)
468482
483
469484    AES CHA:
485    -- SNK --
470486    . NEO-AEG CHA-32
487    . NEO-AEG CHA-8M
488    . NEO-AEG CHA42G
471489    . NEO-AEG CHA42G-1
490    . NEO-AEG CHA42G-2B
472491    . NEO-AEG CHA42G-3
473492    . NEO-AEG CHA42G-4
474493    . NEO-AEG CHA256
475494    . NEO-AEG CHA256[B]
476495    . NEO-AEG CHA256RY
477496    . NEO-AEG CHA512Y
478    . NEO-AEG CHAFIO (SNK 1999.8.10)
497    . NEO-AEG CHAFIO (1999.8.10)
498    -- SNKPLAYMORE --
499    . NEO-AEG CHAFIO (2003.7.24)
479500
480501    AES PROG:
502    -- SNK --
481503    . NEO-AEG PROG-NAM
482504    . NEO-AEG PROG-HERO
483    . NEO-AEG PROG B
484505    . NEO-AEG PROG-4A
485506    . NEO-AEG PROG-4B
507    . NEO-AEG PROG 8M42
508    . NEO-AEG PROG B
486509    . NEO-AEG PROG16
510    . NEO-AEG PROG42G
487511    . NEO-AEG PROG42G-COM
488512    . NEO-AEG PROG42G-1
489    . NEO-AEG PROG4096B
513    . NEO-AEG PROG-G2
514    . NEO-AEG PROG4096 B
490515    . NEO-AEG PROGGS
491    . NEO-AEG PROGLBA
516    . NEO-AEG PROGTOP2
517    . NEO-AEG PROGLBA (1999.7.6)
492518    . NEO-AEG PROGRK
493519    . NEO-AEG PROGRKB
494520    . NEO-AEG PROGBK1Y
495    . NEO-AEG PROGBK2
496    . NEO-AEG PROGBK3R
521    -- PLAYMORE --
522    . NEO-AEG PROGBK2 (2002.4.1)
523    -- SNKPLAYMORE --
524    . NEO-AEG PROGBK3R (2003.8.29) - NEO-HYCS (2003.9.29)
497525
498    The above only covers SNK / SNK-PLAYMORE pcb's. There also exists a
526
527    Cartridge colours:
528    ==================
529
530    MVS cartridges were produced in different colours.
531
532    Known cartridge colours:
533    . Black
534    . Green
535    . Grey
536    . Transparent
537    . Transparent Blue
538    . Transparent Green
539    . White
540    . Yellow
541
542    The above listed only covers SNK / PLAYMORE / SNKPLAYMORE pcb's. There also exists a
499543    wide range of 'bootleg' pcb's.
500544
545    Neo-Geo game pcb infos by Johnboy
546
501547****************************************************************************/
502548
503
504ROM_START( nam1975 )
549ROM_START( nam1975 ) /* MVS AND AES VERSION */
505550   ROM_REGION( 0x100000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
506551   ROM_LOAD16_WORD_SWAP( "001-p1.bin", 0x000000, 0x080000, CRC(cc9fc951) SHA1(92f4e6ddeeb825077d92dbb70b50afea985f15c0) )
507552
508553   NEO_SFIX_128K( "001-s1.bin", CRC(7988ba51) SHA1(bc2f661f381b06b34ac2fa215dd5689d3bf84832) )
509554
510   NEO_BIOS_AUDIO_128K( "001-m1.bin", CRC(9e63843f) SHA1(4dcc642ff19636cfc5d294c125afee53cc3ff640) )
555   /* MB832000 */
556   NEO_BIOS_AUDIO_256K( "001-m1.bin", CRC(ba874463) SHA1(a83514f4b20301f84a98699900e2593f1c1b8846) )
511557
512558   ROM_REGION( 0x080000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
513559   ROM_LOAD( "001-v1.bin", 0x000000, 0x080000, CRC(a7c3d5e5) SHA1(e3efc86940f91c53b7724c4566cfc21ea1a7a465) )
r2241r2242
532578
533579   NEO_SFIX_128K( "002-s1.bin", CRC(1a7fd0c6) SHA1(3fc701b7afddab369ddf9dedfbc5e1aaf80b8af3) )
534580
535   NEO_BIOS_AUDIO_128K( "002-m1.bin", CRC(753a2a08) SHA1(4e117120019c420789e20bd4cc6cff845867cbfd) )
581   /* MB832000 */
582   NEO_BIOS_AUDIO_256K( "002-m1.bin", CRC(4ecaa4ee) SHA1(50abfb8eed6cb4887393089f9ccc76f306ef69b5) )
536583
537584   ROM_REGION( 0x200000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
538585   ROM_LOAD( "002-v11.bin", 0x000000, 0x080000, CRC(b7b925bd) SHA1(644c92fa90e74998e73714f74b1e0680ee372a07) )
r2241r2242
544591   ROM_LOAD( "002-v21.bin", 0x000000, 0x080000, CRC(04a733d1) SHA1(84159368c0f6de2c3b8121227201cd3422455cf6) )
545592
546593   ROM_REGION( 0x300000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
547   ROM_LOAD16_BYTE( "002-c1.bin", 0x000000, 0x080000, CRC(aaff2a45) SHA1(c91ee72d1d74514df8ec44fca703409d92158ae3) )
548   ROM_LOAD16_BYTE( "002-c2.bin", 0x000001, 0x080000, CRC(3ba0f7e4) SHA1(f023b134b9c7994f477867307d2732026033501d) )
549   ROM_LOAD16_BYTE( "002-c3.bin", 0x100000, 0x080000, CRC(96f0fdfa) SHA1(9f779a1ae46aeda54d69382b074392ade687f62f) )
550   ROM_LOAD16_BYTE( "002-c4.bin", 0x100001, 0x080000, CRC(5fd87f2f) SHA1(a5dd6f26f9485f216c2428ae1792c182beb10dbc) )
551   ROM_LOAD16_BYTE( "002-c5.bin", 0x200000, 0x080000, CRC(807ed83b) SHA1(3268e7d4602c3f55f1e0da2c80653d5ae461ef67) )
552   ROM_LOAD16_BYTE( "002-c6.bin", 0x200001, 0x080000, CRC(5a3cad41) SHA1(c620d18f4ff32ed5489c941dfc641030a54f1c14) )
594   ROM_LOAD16_BYTE( "002-c1.bin", 0x000000, 0x080000, CRC(aaff2a45) SHA1(c91ee72d1d74514df8ec44fca703409d92158ae3) ) /* Plane 0,1 */
595   ROM_LOAD16_BYTE( "002-c2.bin", 0x000001, 0x080000, CRC(3ba0f7e4) SHA1(f023b134b9c7994f477867307d2732026033501d) ) /* Plane 2,3 */
596   ROM_LOAD16_BYTE( "002-c3.bin", 0x100000, 0x080000, CRC(96f0fdfa) SHA1(9f779a1ae46aeda54d69382b074392ade687f62f) ) /* Plane 0,1 */
597   ROM_LOAD16_BYTE( "002-c4.bin", 0x100001, 0x080000, CRC(5fd87f2f) SHA1(a5dd6f26f9485f216c2428ae1792c182beb10dbc) ) /* Plane 2,3 */
598   ROM_LOAD16_BYTE( "002-c5.bin", 0x200000, 0x080000, CRC(807ed83b) SHA1(3268e7d4602c3f55f1e0da2c80653d5ae461ef67) ) /* Plane 0,1 */
599   ROM_LOAD16_BYTE( "002-c6.bin", 0x200001, 0x080000, CRC(5a3cad41) SHA1(c620d18f4ff32ed5489c941dfc641030a54f1c14) ) /* Plane 2,3 */
553600ROM_END
554601
555ROM_START( tpgolf )
602ROM_START( tpgolf ) /* MVS AND AES VERSION */
556603   ROM_REGION( 0x100000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
557604   ROM_LOAD16_WORD_SWAP( "003-p1.bin", 0x000000, 0x080000, CRC(f75549ba) SHA1(3f7bdf5e2964e921fe1dd87c51a79a1a501fc73f) )
558605   ROM_LOAD16_WORD_SWAP( "003-p2.bin", 0x080000, 0x080000, CRC(b7809a8f) SHA1(1604c889592c9610668bff296de48a0d6906156d) )
559606
560607   NEO_SFIX_128K( "003-s1.bin", CRC(7b3eb9b1) SHA1(39cd8bad9f8bfdeb8ac681b5b79ae5aa81c8dd5f) )
561608
562   NEO_BIOS_AUDIO_64K( "003-m1.bin", BAD_DUMP CRC(7851d0d9) SHA1(d021cef958cc37ab170b78d7a4b3ae94947e4d13) )
609   /* TC531001 */
610   NEO_BIOS_AUDIO_128K( "003-m1.bin", CRC(4cc545e6) SHA1(8e014b8cab3e5b3995756a4ea52ce49c36866377) )
563611
564612   ROM_REGION( 0x080000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
565   ROM_LOAD( "003-v11.bin", 0x000000, 0x080000, CRC(ff97f1cb) SHA1(defa249d46ae220f7bfa70746f5202bbbcc3e5fe) )
613   ROM_LOAD( "003-v1.bin", 0x000000, 0x080000, CRC(ff97f1cb) SHA1(defa249d46ae220f7bfa70746f5202bbbcc3e5fe) )
566614
567615   ROM_REGION( 0x200000, NEOGEO_REGION_AUDIO_DATA_2, 0 )
568   ROM_LOAD( "003-v21.bin", 0x000000, 0x080000, CRC(d34960c6) SHA1(36d5877d5e42aab943f4d693159f4f3ad8b0addc) )
616   ROM_LOAD( "003-v2.bin", 0x000000, 0x080000, CRC(d34960c6) SHA1(36d5877d5e42aab943f4d693159f4f3ad8b0addc) )
569617   ROM_LOAD( "003-v22.bin", 0x080000, 0x080000, CRC(9a5f58d4) SHA1(2b580595e1820430a36f06fd3e0e0b8f7d686889) )
570618   ROM_LOAD( "003-v23.bin", 0x100000, 0x080000, CRC(30f53e54) SHA1(22461f88a56d272b78dbc23204c0c6816200532b) )
571619   ROM_LOAD( "003-v24.bin", 0x180000, 0x080000, CRC(5ba0f501) SHA1(ca02937a611a2c50c9e4b54f8fd4eaea09259894) )
572620
573621   ROM_REGION( 0x400000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
574   ROM_LOAD16_BYTE( "003-c1.bin", 0x000000, 0x80000, CRC(0315fbaf) SHA1(583c9253219c1026d81ee5e0cf5568683adc2633) )
575   ROM_LOAD16_BYTE( "003-c2.bin", 0x000001, 0x80000, CRC(b4c15d59) SHA1(b0d8ec967f9b8e5216301c10b2d36912abce6515) )
576   ROM_LOAD16_BYTE( "003-c3.bin", 0x100000, 0x80000, CRC(b09f1612) SHA1(03fbb5db4e377ce9cb4e65ddbc0b114c02e7bae1) )
577   ROM_LOAD16_BYTE( "003-c4.bin", 0x100001, 0x80000, CRC(150ea7a1) SHA1(13edc30144b56285ef37eb8aa6fb934704de18d8) )
578   ROM_LOAD16_BYTE( "003-c5.bin", 0x200000, 0x80000, CRC(9a7146da) SHA1(2fc83d13e3e9565919aab01bf2a1b028f433b547) )
579   ROM_LOAD16_BYTE( "003-c6.bin", 0x200001, 0x80000, CRC(1e63411a) SHA1(ee397e2f679042e87b37d95837af62bb95a72af9) )
580   ROM_LOAD16_BYTE( "003-c7.bin", 0x300000, 0x80000, CRC(2886710c) SHA1(1533dd935f0a8f92a0a3c47d1d2bc6d035454244) )
581   ROM_LOAD16_BYTE( "003-c8.bin", 0x300001, 0x80000, CRC(422af22d) SHA1(f67c844c34545de6ea187f5bfdf440dec8518532) )
622   ROM_LOAD16_BYTE( "003-c1.bin", 0x000000, 0x80000, CRC(0315fbaf) SHA1(583c9253219c1026d81ee5e0cf5568683adc2633) ) /* Plane 0,1 */
623   ROM_LOAD16_BYTE( "003-c2.bin", 0x000001, 0x80000, CRC(b4c15d59) SHA1(b0d8ec967f9b8e5216301c10b2d36912abce6515) ) /* Plane 2,3 */
624   ROM_LOAD16_BYTE( "003-c3.bin", 0x100000, 0x80000, CRC(8ce3e8da) SHA1(bc6c49b27d498f75a0d1a8c4d0cca75e140b9efc) ) /* Plane 0,1 */
625   ROM_LOAD16_BYTE( "003-c4.bin", 0x100001, 0x80000, CRC(29725969) SHA1(f1407da84919c2b3fe0e8f1fca65934b147c86c7) ) /* Plane 2,3 */
626   ROM_LOAD16_BYTE( "003-c5.bin", 0x200000, 0x80000, CRC(9a7146da) SHA1(2fc83d13e3e9565919aab01bf2a1b028f433b547) ) /* Plane 0,1 */
627   ROM_LOAD16_BYTE( "003-c6.bin", 0x200001, 0x80000, CRC(1e63411a) SHA1(ee397e2f679042e87b37d95837af62bb95a72af9) ) /* Plane 2,3 */
628   ROM_LOAD16_BYTE( "003-c7.bin", 0x300000, 0x80000, CRC(2886710c) SHA1(1533dd935f0a8f92a0a3c47d1d2bc6d035454244) ) /* Plane 0,1 */
629   ROM_LOAD16_BYTE( "003-c8.bin", 0x300001, 0x80000, CRC(422af22d) SHA1(f67c844c34545de6ea187f5bfdf440dec8518532) ) /* Plane 2,3 */
582630ROM_END
583631
584632ROM_START( mahretsu )
r2241r2242
611659
612660   NEO_SFIX_128K( "005-s1.bin", CRC(1c5369a2) SHA1(db0dba0a7dced6c9ca929c5abda491b05d84199c) )
613661
614   NEO_BIOS_AUDIO_128K( "005-m1.bin", CRC(b5253c6a) SHA1(3e9ee04c6c31c951774bda89929188b357bfdf46) )
662   /* MB832000 */
663   NEO_BIOS_AUDIO_256K( "005-m1.bin", CRC(26259f0f) SHA1(4f3e500093d61585048767dbd9fa09b3911a05d6) )
615664
616665   ROM_REGION( 0x080000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
617666   ROM_LOAD( "005-v11.bin", 0x000000, 0x080000, CRC(cc0455fd) SHA1(a8ff4270e7705e263d25ff0b301f503bccea7e59) )
r2241r2242
635684
636685   NEO_SFIX_128K( "005-s1.bin", CRC(1c5369a2) SHA1(db0dba0a7dced6c9ca929c5abda491b05d84199c) )
637686
638   NEO_BIOS_AUDIO_128K( "005-m1.bin", CRC(b5253c6a) SHA1(3e9ee04c6c31c951774bda89929188b357bfdf46) )
687   /* MB832000 */
688   NEO_BIOS_AUDIO_256K( "005-m1.bin", CRC(26259f0f) SHA1(4f3e500093d61585048767dbd9fa09b3911a05d6) )
639689
640690   ROM_REGION( 0x080000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
641691   ROM_LOAD( "005-v11.bin", 0x000000, 0x080000, CRC(cc0455fd) SHA1(a8ff4270e7705e263d25ff0b301f503bccea7e59) )
r2241r2242
659709
660710   NEO_SFIX_128K( "006-s1.bin", CRC(eb5189f0) SHA1(0239c342ea62e73140a2306052f226226461a478) )
661711
662   NEO_BIOS_AUDIO_128K( "006-m1.bin", CRC(f0b6425d) SHA1(ba90c665d3e84c40d0383be64b1399ba831c0cfc) )
712   /* MB832000 */
713   NEO_BIOS_AUDIO_256K( "006-m1.bin", CRC(92e7b4fe) SHA1(d240056cd632f92bdfaa5e0492c09aa9bd7b0471) )
663714
664715   ROM_REGION( 0x100000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
665716   ROM_LOAD( "006-v11.bin", 0x000000, 0x080000, CRC(cdf74a42) SHA1(a17106cc3f9e5c5d52b4def861c0545a98151da2) )
r2241r2242
684735
685736   NEO_SFIX_128K( "006-s1.bin", CRC(eb5189f0) SHA1(0239c342ea62e73140a2306052f226226461a478) )
686737
687   NEO_BIOS_AUDIO_128K( "006-m1.bin", CRC(f0b6425d) SHA1(ba90c665d3e84c40d0383be64b1399ba831c0cfc) )
738   /* MB832000 */
739   NEO_BIOS_AUDIO_256K( "006-m1.bin", CRC(92e7b4fe) SHA1(d240056cd632f92bdfaa5e0492c09aa9bd7b0471) )
688740
689741   ROM_REGION( 0x100000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
690742   ROM_LOAD( "006-v11.bin", 0x000000, 0x080000, CRC(cdf74a42) SHA1(a17106cc3f9e5c5d52b4def861c0545a98151da2) )
r2241r2242
703755   ROM_LOAD16_BYTE( "006-c4.bin", 0x100001, 0x080000, CRC(205e3208) SHA1(aa2acf2c6f48ffffdcc0c94ddc031acc9e4a2e68) ) /* Plane 2,3 */
704756ROM_END
705757
706ROM_START( alpham2 )
758ROM_START( alpham2 ) /* MVS AND AES VERSION */
707759   ROM_REGION( 0x100000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
708760   ROM_LOAD16_WORD_SWAP( "007-p1.bin", 0x000000, 0x080000, CRC(5b266f47) SHA1(8afbf995989f47ad93fea1f31a884afc7228b53a) )
709761   ROM_LOAD16_WORD_SWAP( "007-p2.bin", 0x080000, 0x020000, CRC(eb9c1044) SHA1(65d3416dcd96663bc4e7cefe90ecb7c1eafb2dda) )
r2241r2242
808860
809861   NEO_SFIX_128K( "011-s1.bin", CRC(ec5fdb96) SHA1(8003028025ac7bf531e568add6ba66c02d0b7e84) )
810862
811   NEO_BIOS_AUDIO_128K( "011-m1.bin", CRC(6f737b5a) SHA1(d52f7b6786b6e33f09ba0cf30889082c1dfb9336) )
863   /* MB832000 */
864   NEO_BIOS_AUDIO_256K( "011-m1.bin", CRC(ca661f1b) SHA1(4e3cb57db716ec48487c1b070c3a55a5faf40856) )
812865
813866   ROM_REGION( 0x180000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
814867   ROM_LOAD( "011-v11.bin", 0x000000, 0x100000, CRC(5c674d5c) SHA1(d7b9beddeb247b584cea9ca6c43ec6869809b673) )
r2241r2242
867920   ROM_LOAD16_BYTE( "016-c4.bin", 0x200001, 0x100000, CRC(070506e2) SHA1(3a2ec365e1d87a9c5ce1ee9bea88402a8eef4ed7) ) /* Plane 2,3 */
868921ROM_END
869922
870ROM_START( kotmh )
923ROM_START( kotmh ) /* AES VERSION */
871924   ROM_REGION( 0x100000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
872925   ROM_LOAD16_WORD_SWAP( "016-hp1.bin",0x000000, 0x080000, CRC(b774621e) SHA1(7684b2e07163aec68cd083ef1d8900f855f6cb42) )
873926   ROM_LOAD16_WORD_SWAP( "016-p2.bin", 0x080000, 0x020000, BAD_DUMP CRC(12afdc2b) SHA1(3a95f5910cbb9f17e63ddece995c6e120fa2f622) )
r2241r2242
911964   ROM_LOAD16_BYTE( "017-c4.bin", 0x200001, 0x100000, CRC(f4f3c9cb) SHA1(8faafa89dbd0345218f71f891419d2e4e7578200) ) /* Plane 2,3 */
912965ROM_END
913966
914ROM_START( sengokh )
967ROM_START( sengokh ) /* AES VERSION */
915968   ROM_REGION( 0x100000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
916   ROM_LOAD16_WORD_SWAP( "017-p1h.bin", 0x000000, 0x080000, CRC(33eccae0) SHA1(000ccf9a9c73df75eeba3f2c367c3a1a9e0a3a6b) )
969   ROM_LOAD16_WORD_SWAP( "017-hp1.bin", 0x000000, 0x080000, CRC(33eccae0) SHA1(000ccf9a9c73df75eeba3f2c367c3a1a9e0a3a6b) )
917970   ROM_LOAD16_WORD_SWAP( "017-p2.bin",  0x080000, 0x020000, CRC(3024bbb3) SHA1(88892e1292dd60f35a76f9a22e623d4f0f9693cc) )
918971
919972   NEO_SFIX_128K( "017-s1.bin", CRC(b246204d) SHA1(73dce64c61fb5bb7e836a8e60f081bb77d80d281) )
r2241r2242
933986   ROM_LOAD16_BYTE( "017-c4.bin", 0x200001, 0x100000, CRC(f4f3c9cb) SHA1(8faafa89dbd0345218f71f891419d2e4e7578200) ) /* Plane 2,3 */
934987ROM_END
935988
936ROM_START( burningf )
989ROM_START( burningf ) /* MVS VERSION */
937990   ROM_REGION( 0x100000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
938991   ROM_LOAD16_WORD_SWAP( "018-p1.bin", 0x000000, 0x080000, CRC(4092c8db) SHA1(df194a4ad2c35e0e18bc053ff9284183444a4666) )
939992
r2241r2242
9911044   ROM_LOAD( "019-v21.bin", 0x000000, 0x080000, CRC(2efd5ada) SHA1(8ba70f5f665d566824333075227d9bce1253b8d8) )
9921045
9931046   ROM_REGION( 0x100000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
994   ROM_LOAD16_BYTE( "019-c1.bin", 0x000000, 0x080000, CRC(4ccdef18) SHA1(5011e30ec235d0b0a5a513a11d4275777e61acdb) )
995   ROM_LOAD16_BYTE( "019-c2.bin", 0x000001, 0x080000, CRC(d4dd0802) SHA1(82069752028c118d42384a95befde45844f0f247) )
1047   ROM_LOAD16_BYTE( "019-c1.bin", 0x000000, 0x080000, CRC(4ccdef18) SHA1(5011e30ec235d0b0a5a513a11d4275777e61acdb) ) /* Plane 0,1 */
1048   ROM_LOAD16_BYTE( "019-c2.bin", 0x000001, 0x080000, CRC(d4dd0802) SHA1(82069752028c118d42384a95befde45844f0f247) ) /* Plane 2,3 */
9961049ROM_END
9971050
9981051ROM_START( gpilots )
r2241r2242
10021055
10031056   NEO_SFIX_128K( "020-s1.bin", CRC(a6d83d53) SHA1(9a8c092f89521cc0b27a385aa72e29cbaca926c5) )
10041057
1005   NEO_BIOS_AUDIO_128K( "020-m1.bin", BAD_DUMP CRC(48409377) SHA1(0e212d2c76856a90b2c2fdff675239525972ac43) )
1058   /* TC531001 */
1059   NEO_BIOS_AUDIO_128K( "020-m1.bin", CRC(48409377) SHA1(0e212d2c76856a90b2c2fdff675239525972ac43) )
10061060
10071061   ROM_REGION( 0x180000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
10081062   ROM_LOAD( "020-v11.bin", 0x000000, 0x100000, CRC(1b526c8b) SHA1(2801868d2badcf8aaf5d490e010e4049d81d7bc1) )
r2241r2242
10121066   ROM_LOAD( "020-v21.bin", 0x000000, 0x080000, CRC(7abf113d) SHA1(5b2a0e70f2eaf4638b44702dacd4cb17838fb1d5) )
10131067
10141068   ROM_REGION( 0x400000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
1015   ROM_LOAD16_BYTE( "020-c1.bin", 0x000000, 0x100000, CRC(bd6fe78e) SHA1(50b704862cd79d64fa488e621b079f6e413c33bc) )
1016   ROM_LOAD16_BYTE( "020-c2.bin", 0x000001, 0x100000, CRC(5f4a925c) SHA1(71c5ef8141234daaa7025427a6c65e79766973a5) )
1017   ROM_LOAD16_BYTE( "020-c3.bin", 0x200000, 0x100000, CRC(d1e42fd0) SHA1(f0d476aebbdc2ce008f5f0783be86d295b24aa44) )
1018   ROM_LOAD16_BYTE( "020-c4.bin", 0x200001, 0x100000, CRC(edde439b) SHA1(79be7b10ecdab54c2f77062b8f5fda0e299fa982) )
1069   ROM_LOAD16_BYTE( "020-c1.bin", 0x000000, 0x100000, CRC(bd6fe78e) SHA1(50b704862cd79d64fa488e621b079f6e413c33bc) ) /* Plane 0,1 */
1070   ROM_LOAD16_BYTE( "020-c2.bin", 0x000001, 0x100000, CRC(5f4a925c) SHA1(71c5ef8141234daaa7025427a6c65e79766973a5) ) /* Plane 2,3 */
1071   ROM_LOAD16_BYTE( "020-c3.bin", 0x200000, 0x100000, CRC(d1e42fd0) SHA1(f0d476aebbdc2ce008f5f0783be86d295b24aa44) ) /* Plane 0,1 */
1072   ROM_LOAD16_BYTE( "020-c4.bin", 0x200001, 0x100000, CRC(edde439b) SHA1(79be7b10ecdab54c2f77062b8f5fda0e299fa982) ) /* Plane 2,3 */
10191073ROM_END
10201074
1075ROM_START( gpilotsh ) /* AES VERSION */
1076   ROM_REGION( 0x100000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
1077   ROM_LOAD16_WORD_SWAP( "020-hp1.bin", 0x000000, 0x080000, CRC(7cdb01ce) SHA1(32cae2ddf5e26fb7e8a09132e600220db82df3b8) )
1078   ROM_LOAD16_WORD_SWAP( "020-p2.bin", 0x080000, 0x020000, CRC(edcb22ac) SHA1(505d2db38ae999b7d436e8f2ff56b81796d62b54) )
1079
1080   NEO_SFIX_128K( "020-s1.bin", CRC(a6d83d53) SHA1(9a8c092f89521cc0b27a385aa72e29cbaca926c5) )
1081
1082   /* TC531001 */
1083   NEO_BIOS_AUDIO_128K( "020-m1.bin", CRC(48409377) SHA1(0e212d2c76856a90b2c2fdff675239525972ac43) )
1084
1085   ROM_REGION( 0x180000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
1086   ROM_LOAD( "020-v11.bin", 0x000000, 0x100000, CRC(1b526c8b) SHA1(2801868d2badcf8aaf5d490e010e4049d81d7bc1) )
1087   ROM_LOAD( "020-v12.bin", 0x100000, 0x080000, CRC(4a9e6f03) SHA1(d3ac11f333b03d8a318921bdaefb14598e289a14) )
1088
1089   ROM_REGION( 0x080000, NEOGEO_REGION_AUDIO_DATA_2, 0 )
1090   ROM_LOAD( "020-v21.bin", 0x000000, 0x080000, CRC(7abf113d) SHA1(5b2a0e70f2eaf4638b44702dacd4cb17838fb1d5) )
1091
1092   ROM_REGION( 0x400000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
1093   ROM_LOAD16_BYTE( "020-c1.bin", 0x000000, 0x100000, CRC(bd6fe78e) SHA1(50b704862cd79d64fa488e621b079f6e413c33bc) ) /* Plane 0,1 */
1094   ROM_LOAD16_BYTE( "020-c2.bin", 0x000001, 0x100000, CRC(5f4a925c) SHA1(71c5ef8141234daaa7025427a6c65e79766973a5) ) /* Plane 2,3 */
1095   ROM_LOAD16_BYTE( "020-c3.bin", 0x200000, 0x100000, CRC(d1e42fd0) SHA1(f0d476aebbdc2ce008f5f0783be86d295b24aa44) ) /* Plane 0,1 */
1096   ROM_LOAD16_BYTE( "020-c4.bin", 0x200001, 0x100000, CRC(edde439b) SHA1(79be7b10ecdab54c2f77062b8f5fda0e299fa982) ) /* Plane 2,3 */
1097ROM_END
1098
10211099ROM_START( joyjoy ) /* MVS AND AES VERSION */
10221100   ROM_REGION( 0x100000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
10231101   ROM_LOAD16_WORD_SWAP( "021-p1.bin", 0x000000, 0x080000, CRC(39c3478f) SHA1(06ebe54c9c4e14c5c31e770013d58b7162359ecc) )
r2241r2242
10331111   ROM_LOAD( "021-v21.bin", 0x000000, 0x080000, CRC(8ed20a86) SHA1(d15cba5eac19ea56fdd4877541f1bb3eb755ebba) )
10341112
10351113   ROM_REGION( 0x100000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
1036   ROM_LOAD16_BYTE( "021-c1.bin", 0x000000, 0x080000, CRC(509250ec) SHA1(d6ddb16d8222088f153a85a905bcb99541a5f2cf) )
1037   ROM_LOAD16_BYTE( "021-c2.bin", 0x000001, 0x080000, CRC(09ed5258) SHA1(6bf50cd10236e29146b49e714a0e0ebcfe30a682) )
1114   ROM_LOAD16_BYTE( "021-c1.bin", 0x000000, 0x080000, CRC(509250ec) SHA1(d6ddb16d8222088f153a85a905bcb99541a5f2cf) ) /* Plane 0,1 */
1115   ROM_LOAD16_BYTE( "021-c2.bin", 0x000001, 0x080000, CRC(09ed5258) SHA1(6bf50cd10236e29146b49e714a0e0ebcfe30a682) ) /* Plane 2,3 */
10381116ROM_END
10391117
1040ROM_START( bjourney )
1118ROM_START( bjourney ) /* MVS AND AES VERSION */
10411119   ROM_REGION( 0x100000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
10421120   ROM_LOAD16_WORD_SWAP( "022-p1.bin", 0x000000, 0x100000, CRC(6a2f6d4a) SHA1(b8ca548e56f1c7abcdce415ba7329e0cf698ee13) )
10431121
r2241r2242
10521130   NO_DELTAT_REGION
10531131
10541132   ROM_REGION( 0x300000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
1055   ROM_LOAD16_BYTE( "022-c1.bin", 0x000000, 0x100000, CRC(4d47a48c) SHA1(6e282285be72583d828e7765b1c1695ecdc44777) )
1056   ROM_LOAD16_BYTE( "022-c2.bin", 0x000001, 0x100000, CRC(e8c1491a) SHA1(c468d2556b3de095aaa05edd1bc16d71303e9478) )
1057   ROM_LOAD16_BYTE( "022-c3.bin", 0x200000, 0x080000, CRC(66e69753) SHA1(974b823fc62236fbc23e727f25b61a805a707a9e) )
1058   ROM_LOAD16_BYTE( "022-c4.bin", 0x200001, 0x080000, CRC(71bfd48a) SHA1(47288be69e6992d09ebef108b4de9ffab6293dc8) )
1133   ROM_LOAD16_BYTE( "022-c1.bin", 0x000000, 0x100000, CRC(4d47a48c) SHA1(6e282285be72583d828e7765b1c1695ecdc44777) ) /* Plane 0,1 */
1134   ROM_LOAD16_BYTE( "022-c2.bin", 0x000001, 0x100000, CRC(e8c1491a) SHA1(c468d2556b3de095aaa05edd1bc16d71303e9478) ) /* Plane 2,3 */
1135   ROM_LOAD16_BYTE( "022-c3.bin", 0x200000, 0x080000, CRC(66e69753) SHA1(974b823fc62236fbc23e727f25b61a805a707a9e) ) /* Plane 0,1 */
1136   ROM_LOAD16_BYTE( "022-c4.bin", 0x200001, 0x080000, CRC(71bfd48a) SHA1(47288be69e6992d09ebef108b4de9ffab6293dc8) ) /* Plane 2,3 */
10591137ROM_END
10601138
10611139ROM_START( quizdais )
r2241r2242
10911169   NO_DELTAT_REGION
10921170
10931171   ROM_REGION( 0x300000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
1094   ROM_LOAD16_BYTE( "024-c1.bin", 0x000000, 0x100000, CRC(3617c2dc) SHA1(8de2643a618272f8aa1c705363edb007f4a5f5b7) )
1095   ROM_LOAD16_BYTE( "024-c2.bin", 0x000001, 0x100000, CRC(3f0a7fd8) SHA1(d0c9c7a9dde9ce175fb243d33ec11fa719d0158c) )
1096   ROM_LOAD16_BYTE( "024-c3.bin", 0x200000, 0x080000, CRC(e9f745f8) SHA1(bbe6141da28b0db7bf5cf321d69b7e613e2414d7) )
1097   ROM_LOAD16_BYTE( "024-c4.bin", 0x200001, 0x080000, CRC(7382fefb) SHA1(e916dec5bb5462eb9ae9711f08c7388937abb980) )
1172   ROM_LOAD16_BYTE( "024-c1.bin", 0x000000, 0x100000, CRC(3617c2dc) SHA1(8de2643a618272f8aa1c705363edb007f4a5f5b7) ) /* Plane 0,1 */
1173   ROM_LOAD16_BYTE( "024-c2.bin", 0x000001, 0x100000, CRC(3f0a7fd8) SHA1(d0c9c7a9dde9ce175fb243d33ec11fa719d0158c) ) /* Plane 2,3 */
1174   ROM_LOAD16_BYTE( "024-c3.bin", 0x200000, 0x080000, CRC(e9f745f8) SHA1(bbe6141da28b0db7bf5cf321d69b7e613e2414d7) ) /* Plane 0,1 */
1175   ROM_LOAD16_BYTE( "024-c4.bin", 0x200001, 0x080000, CRC(7382fefb) SHA1(e916dec5bb5462eb9ae9711f08c7388937abb980) ) /* Plane 2,3 */
10981176ROM_END
10991177
11001178ROM_START( eightman )
r2241r2242
11131191
11141192   ROM_REGION( 0x300000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
11151193   ROM_LOAD16_BYTE( "025-c1.bin", 0x000000, 0x100000, CRC(555e16a4) SHA1(1c96f3d2fd0991680fbf627a6cdd26ad2cd60319) ) /* Plane 0,1 */
1116   ROM_LOAD16_BYTE( "025-c2.bin", 0x000001, 0x100000, CRC(e1ee51c3) SHA1(da8d074bb4e923ed7b8a154fd31b42f2d65b8e96) ) /* Plane 0,1 */
1117   ROM_LOAD16_BYTE( "025-c3.bin", 0x200000, 0x080000, CRC(0923d5b0) SHA1(ab72ba1e3ebf56dd356f9ad181f986b1360a1089) ) /* Plane 2,3 */
1194   ROM_LOAD16_BYTE( "025-c2.bin", 0x000001, 0x100000, CRC(e1ee51c3) SHA1(da8d074bb4e923ed7b8a154fd31b42f2d65b8e96) ) /* Plane 2,3 */
1195   ROM_LOAD16_BYTE( "025-c3.bin", 0x200000, 0x080000, CRC(0923d5b0) SHA1(ab72ba1e3ebf56dd356f9ad181f986b1360a1089) ) /* Plane 0,1 */
11181196   ROM_LOAD16_BYTE( "025-c4.bin", 0x200001, 0x080000, CRC(e3eca67b) SHA1(88154cbc1a261c2f425430119ebc08a30adc9675) ) /* Plane 2,3 */
11191197ROM_END
11201198
r2241r2242
12701348
12711349   NEO_SFIX_128K( "032-s1.bin", CRC(ac0daa1b) SHA1(93bae4697dc403fce19422752a514326ccf66a91) )
12721350
1273   NEO_BIOS_AUDIO_128K( "032-m1.bin", BAD_DUMP CRC(98edc671) SHA1(04ed65ccaa1197fa55fcefe2caed2772e7040bdb) )
1351   /* TC531001 */
1352   NEO_BIOS_AUDIO_128K( "032-m1.bin", CRC(35ec952d) SHA1(8aed30e26d7e2c70dbce5de752df416091066f7b) )
12741353
12751354   ROM_REGION( 0x200000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
12761355   ROM_LOAD( "032-v1.bin", 0x000000, 0x100000, CRC(63791533) SHA1(4479e9308cdc906b9e03b985303f4ebedd00512f) )
r2241r2242
12851364   ROM_LOAD16_BYTE( "032-c4.bin", 0x200001, 0x080000, CRC(462571de) SHA1(5c3d610d492f91564423873b3b434dcda700373f) ) /* Plane 2,3 */
12861365ROM_END
12871366
1367   /* Disabled for now, this looks like an emulation hack. Can someone confirm this set is real? */
1368#if 0
12881369ROM_START( roboarma )
12891370   ROM_REGION( 0x100000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
12901371   ROM_LOAD16_WORD_SWAP( "032-p1h.bin", 0x000000, 0x080000, CRC(27c773cb) SHA1(597ca73f142b1129cc7780540bb9cfacd47bc6ce) )
12911372
12921373   NEO_SFIX_128K( "032-s1.bin", CRC(ac0daa1b) SHA1(93bae4697dc403fce19422752a514326ccf66a91) )
12931374
1294   NEO_BIOS_AUDIO_128K( "032-m1h.bin", BAD_DUMP CRC(35ec952d) SHA1(8aed30e26d7e2c70dbce5de752df416091066f7b) )
1375   /* TC531001 */
1376   NEO_BIOS_AUDIO_128K( "032-m1.bin", CRC(35ec952d) SHA1(8aed30e26d7e2c70dbce5de752df416091066f7b) )
12951377
12961378   ROM_REGION( 0x200000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
12971379   ROM_LOAD( "032-v1.bin", 0x000000, 0x100000, CRC(63791533) SHA1(4479e9308cdc906b9e03b985303f4ebedd00512f) )
r2241r2242
13051387   ROM_LOAD16_BYTE( "032-c3.bin", 0x200000, 0x080000, CRC(40adfccd) SHA1(b11f866dd70ba0ed9123424508355cb948b19bdc) ) /* Plane 0,1 */
13061388   ROM_LOAD16_BYTE( "032-c4.bin", 0x200001, 0x080000, CRC(462571de) SHA1(5c3d610d492f91564423873b3b434dcda700373f) ) /* Plane 2,3 */
13071389ROM_END
1390#endif
13081391
13091392ROM_START( fatfury1 )
13101393   ROM_REGION( 0x100000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
r2241r2242
13131396
13141397   NEO_SFIX_128K( "033-s1.bin", CRC(3c3bdf8c) SHA1(2f3e5feed6c27850b2a0f6fae0b97041690e944c) )
13151398
1316   NEO_BIOS_AUDIO_128K( "033-m1.bin", BAD_DUMP CRC(a8603979) SHA1(512f2280a43892d4ca003ac63945ce86c5211b97) )
1399   NEO_BIOS_AUDIO_128K( "033-m1.bin", CRC(5be10ffd) SHA1(90a5e6cbbc58a7883cd2a3a597180d631a466882) )
13171400
13181401   ROM_REGION( 0x200000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
13191402   ROM_LOAD( "033-v1.bin", 0x000000, 0x100000, CRC(212fd20d) SHA1(120c040db8c01a6f140eea03725448bfa9ca98c2) )
r2241r2242
14661549
14671550   NEO_SFIX_128K( "041-s1.bin", CRC(015c5c94) SHA1(f1c60cd3dc54986b39f630ef3bf48f68c68695dc) )
14681551
1469   NEO_BIOS_AUDIO_128K( "041-m1.bin", CRC(790b15eb) SHA1(3a470c0e457cf94ccc8551544e5e4af23edafae5) )
1552   /* TC531001 */
1553   NEO_BIOS_AUDIO_128K( "041-m1.bin", CRC(15c177a6) SHA1(3f4abed635102f9bc8b44809750828c82e79b44f) )
14701554
14711555   ROM_REGION( 0x280000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
14721556   ROM_LOAD( "041-v1.bin", 0x000000, 0x100000, CRC(cb1da093) SHA1(4f4d1d5fefa9dda372083c045bf0d268a57ce8f1) )
r2241r2242
14761560   NO_DELTAT_REGION
14771561
14781562   ROM_REGION( 0x400000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
1479   ROM_LOAD16_BYTE( "041-c1.bin", 0x000000, 0x100000, CRC(b39a12e1) SHA1(bafe383bd7c5a6aac4cb92dabbc56e3672fe174d) )
1480   ROM_LOAD16_BYTE( "041-c2.bin", 0x000001, 0x100000, CRC(766cfc2f) SHA1(79e1063925d54a57df943019a88bea56c9152df3) )
1481   ROM_LOAD16_BYTE( "041-c3.bin", 0x200000, 0x100000, CRC(fb31339d) SHA1(f4e821299680970b2e979acc4a170029b968c807) )
1482   ROM_LOAD16_BYTE( "041-c4.bin", 0x200001, 0x100000, CRC(70457a0c) SHA1(a1e307f11ddab85d2e9c09d0428fac2e6da774b1) )
1563   ROM_LOAD16_BYTE( "041-c1.bin", 0x000000, 0x100000, CRC(b39a12e1) SHA1(bafe383bd7c5a6aac4cb92dabbc56e3672fe174d) ) /* Plane 0,1 */
1564   ROM_LOAD16_BYTE( "041-c2.bin", 0x000001, 0x100000, CRC(766cfc2f) SHA1(79e1063925d54a57df943019a88bea56c9152df3) ) /* Plane 2,3 */
1565   ROM_LOAD16_BYTE( "041-c3.bin", 0x200000, 0x100000, CRC(fb31339d) SHA1(f4e821299680970b2e979acc4a170029b968c807) ) /* Plane 0,1 */
1566   ROM_LOAD16_BYTE( "041-c4.bin", 0x200001, 0x100000, CRC(70457a0c) SHA1(a1e307f11ddab85d2e9c09d0428fac2e6da774b1) ) /* Plane 2,3 */
14831567ROM_END
14841568
14851569ROM_START( quizdai2 )
r2241r2242
15031587   ROM_LOAD16_BYTE( "042-c4.bin", 0x200001, 0x080000, CRC(d602219b) SHA1(34cf0f16db1e224396464ac838f4cd2e6d1c640e) ) /* Plane 2,3 */
15041588ROM_END
15051589
1506/*
15073countb > corrected Cx
1508    > do P1 & P2 set exist ? my set is 8Mbit P1
1509*/
1510
1511ROM_START( 3countb )
1590ROM_START( 3countb ) /* MVS AND AES VERSION */
15121591   ROM_REGION( 0x100000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
1513   ROM_LOAD16_WORD_SWAP( "043-p1.bin", 0x000000, 0x080000, CRC(eb2714c4) SHA1(ba5dbfee4160f27ff36060b777d64b93dc2e929c) )
1514   ROM_LOAD16_WORD_SWAP( "043-p2.bin", 0x080000, 0x080000, CRC(5e764567) SHA1(3e34d051e8e1483073e4fcce0b688e50a1e713ce) )
1592   ROM_LOAD16_WORD_SWAP( "043-p1.bin", 0x000000, 0x100000, CRC(ffbdd928) SHA1(05b24655ca32723661adc5509b450824deb0c176) )
15151593
1594   /* The original p1 is 8mbit; also found sets with p1 / p2 4mbit on eprom. */
1595
15161596   NEO_SFIX_128K( "043-s1.bin", CRC(c362d484) SHA1(a3c029292572842feabe9aa8c3372628fb63978d) )
15171597
1518   NEO_BIOS_AUDIO_128K( "043-m1.bin", CRC(3377cda3) SHA1(5712cd0717585914120ebf307391e1e3171f5396) )
1598   NEO_BIOS_AUDIO_128K( "043-m1.bin", CRC(7eab59cb) SHA1(5ae4107457e091f73960bfba39b589ae36d51ca3) )
15191599
15201600   ROM_REGION( 0x400000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
15211601   ROM_LOAD( "043-v1.bin", 0x000000, 0x200000, CRC(63688ce8) SHA1(5c6ac29a0cc0655a87cfe3ada8706838b86b86e4) )
r2241r2242
15241604   NO_DELTAT_REGION
15251605
15261606   ROM_REGION( 0x0800000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
1527   ROM_LOAD16_BYTE( "043-c1.bin", 0x000000, 0x100000, CRC(bad2d67f) SHA1(04928e50ca75b7fbc52b64e816ec5701901f5893) )
1607   ROM_LOAD16_BYTE( "043-c1.bin", 0x000000, 0x100000, CRC(bad2d67f) SHA1(04928e50ca75b7fbc52b64e816ec5701901f5893) ) /* Plane 0,1 */
15281608   ROM_CONTINUE(                  0x400000, 0x100000 )
1529   ROM_LOAD16_BYTE( "043-c2.bin", 0x000001, 0x100000, CRC(a7fbda95) SHA1(9da3c5faf22592a7eaf8df9fa6454f48c2a927ae) )
1609   ROM_LOAD16_BYTE( "043-c2.bin", 0x000001, 0x100000, CRC(a7fbda95) SHA1(9da3c5faf22592a7eaf8df9fa6454f48c2a927ae) ) /* Plane 2,3 */
15301610   ROM_CONTINUE(                  0x400001, 0x100000 )
1531   ROM_LOAD16_BYTE( "043-c3.bin", 0x200000, 0x100000, CRC(f00be011) SHA1(2721cdba37a511a966a2a53b9bd6240f181d920c) )
1611   ROM_LOAD16_BYTE( "043-c3.bin", 0x200000, 0x100000, CRC(f00be011) SHA1(2721cdba37a511a966a2a53b9bd6240f181d920c) ) /* Plane 0,1 */
15321612   ROM_CONTINUE(                  0x600000, 0x100000 )
1533   ROM_LOAD16_BYTE( "043-c4.bin", 0x200001, 0x100000, CRC(1887e5c0) SHA1(9b915359add7c10c78d8b281b4084eceea8f0499) )
1613   ROM_LOAD16_BYTE( "043-c4.bin", 0x200001, 0x100000, CRC(1887e5c0) SHA1(9b915359add7c10c78d8b281b4084eceea8f0499) ) /* Plane 2,3 */
15341614   ROM_CONTINUE(                  0x600001, 0x100000 )
15351615ROM_END
15361616
1537ROM_START( aof )
1617ROM_START( aof ) /* MVS AND AES VERSION */
15381618   ROM_REGION( 0x100000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
15391619   ROM_LOAD16_WORD_SWAP( "044-p1.bin", 0x000000, 0x080000, CRC(ca9f7a6d) SHA1(4d28ef86696f7e832510a66d3e8eb6c93b5b91a1) )
15401620
15411621   NEO_SFIX_128K( "044-s1.bin", CRC(89903f39) SHA1(a04a0c244a5d5c7a595fcf649107969635a6a8b6) )
15421622
1543   NEO_BIOS_AUDIO_128K( "044-m1.bin", CRC(981345f8) SHA1(5eb6a5a3f633d74a48555808e2562a0ba16d8675) )
1623   /* TC531001 */
1624   NEO_BIOS_AUDIO_128K( "044-m1.bin", CRC(0987e4bb) SHA1(8fae4b7fac09d46d4727928e609ed9d3711dbded) )
15441625
15451626   ROM_REGION( 0x400000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
15461627   ROM_LOAD( "044-v2.bin", 0x000000, 0x200000, CRC(3ec632ea) SHA1(e3f413f580b57f70d2dae16dbdacb797884d3fce) )
r2241r2242
15591640   ROM_CONTINUE(                0x600001, 0x100000 )
15601641ROM_END
15611642
1562ROM_START( samsho )
1643ROM_START( samsho ) /* MVS VERSION */
1644   ROM_REGION( 0x200000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
1645   ROM_LOAD16_WORD_SWAP( "045-p1.bin", 0x000000, 0x100000, CRC(dfe51bf0) SHA1(2243af3770a516ae698b69bcd9daf53632d9128d) )
1646   ROM_LOAD16_WORD_SWAP( "045-pg2.bin", 0x100000, 0x100000, CRC(46745b94) SHA1(d9e959fd1f88c9402915c1d0dcdb4a9e3d49cdcb) )
1647
1648   NEO_SFIX_128K( "045-s1.bin", CRC(9142a4d3) SHA1(54088e99fcfd75fd0f94852890a56350066a05a3) )
1649
1650   NEO_BIOS_AUDIO_128K( "045-m1.bin", CRC(95170640) SHA1(125c502db0693e8d11cef619b090081c14a9a300) )
1651
1652   ROM_REGION( 0x400000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
1653   ROM_LOAD( "045-v1.bin", 0x000000, 0x200000, CRC(37f78a9b) SHA1(6279b497d12fa90b49ab5ac3aae20fb302ec8b81) )
1654   ROM_LOAD( "045-v2.bin", 0x200000, 0x200000, CRC(568b20cf) SHA1(61af858685472a1fad608e230cccc2b108509ddb) )
1655
1656   NO_DELTAT_REGION
1657
1658   ROM_REGION( 0xa00000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
1659   ROM_LOAD16_BYTE( "045-c1.bin", 0x000000, 0x200000, CRC(2e5873a4) SHA1(65c74c1e2d34390666bbb630df7d1f4c9570c3db) ) /* Plane 0,1 */
1660   ROM_LOAD16_BYTE( "045-c2.bin", 0x000001, 0x200000, CRC(04febb10) SHA1(16a8cbf0fd9468e81bf9eab6dbe7a8e3623a843e) ) /* Plane 2,3 */
1661   ROM_LOAD16_BYTE( "045-c3.bin", 0x400000, 0x200000, CRC(f3dabd1e) SHA1(c80e52df42be9f8b2e89b467b11ab140a480cee8) ) /* Plane 0,1 */
1662   ROM_LOAD16_BYTE( "045-c4.bin", 0x400001, 0x200000, CRC(935c62f0) SHA1(0053d40085fac14096b683f4341f65e543b71dc1) ) /* Plane 2,3 */
1663   ROM_LOAD16_BYTE( "045-c51.bin", 0x800000, 0x100000, CRC(81932894) SHA1(550f15dc5892c4602422c51869f0d59f70f01e9e) ) /* Plane 0,1 */
1664   ROM_LOAD16_BYTE( "045-c61.bin", 0x800001, 0x100000, CRC(be30612e) SHA1(5e8b785f917c176d6796eba0caed37b13ddb3e63) ) /* Plane 2,3 */
1665ROM_END
1666
1667ROM_START( samshoh ) /* AES VERSION */
15631668   ROM_REGION( 0x180000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
1564   ROM_LOAD16_WORD_SWAP( "045-p1.bin", 0x000000, 0x080000, CRC(80aa6c97) SHA1(6e07a4aa7b4719ae487a10cee9389cb55a370a7a) )
1565   ROM_LOAD16_WORD_SWAP( "045-p2.bin", 0x080000, 0x080000, CRC(71768728) SHA1(9ff0e01d3fb73ad04279d4fdf4c53c3160888179) )
1566   ROM_LOAD16_WORD_SWAP( "045-p3.bin", 0x100000, 0x080000, CRC(38ee9ba9) SHA1(48190699a6be83cb6257365ae81f93fdd23abe09) )
1669   ROM_LOAD16_WORD_SWAP( "045-p1.bin", 0x000000, 0x100000, CRC(dfe51bf0) SHA1(2243af3770a516ae698b69bcd9daf53632d9128d) )
1670   ROM_LOAD16_WORD_SWAP( "045-p2.bin", 0x100000, 0x080000, CRC(38ee9ba9) SHA1(48190699a6be83cb6257365ae81f93fdd23abe09) )
15671671
15681672   NEO_SFIX_128K( "045-s1.bin", CRC(9142a4d3) SHA1(54088e99fcfd75fd0f94852890a56350066a05a3) )
15691673
r2241r2242
15841688   ROM_LOAD16_BYTE( "045-c6.bin", 0x800001, 0x080000, CRC(4fa71252) SHA1(afe374a9d1f2d955a59efe7b6196b89e021b164c) ) /* Plane 2,3 */
15851689ROM_END
15861690
1587ROM_START( tophuntr )
1691   /* Old version looked like this; p's on eprom?
1692
1693    ROM_START( samsho )
1694    ROM_REGION( 0x180000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
1695    ROM_LOAD16_WORD_SWAP( "045-p1.bin", 0x000000, 0x080000, CRC(80aa6c97) SHA1(6e07a4aa7b4719ae487a10cee9389cb55a370a7a) )
1696    ROM_LOAD16_WORD_SWAP( "045-p2.bin", 0x080000, 0x080000, CRC(71768728) SHA1(9ff0e01d3fb73ad04279d4fdf4c53c3160888179) )
1697    ROM_LOAD16_WORD_SWAP( "045-p3.bin", 0x100000, 0x080000, CRC(38ee9ba9) SHA1(48190699a6be83cb6257365ae81f93fdd23abe09) )
1698
1699    */
1700
1701ROM_START( tophuntr ) /* MVS VERSION */
15881702   ROM_REGION( 0x200000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
15891703   ROM_LOAD16_WORD_SWAP( "046-p1.bin", 0x000000, 0x100000, CRC(69fa9e29) SHA1(9a40a16163193bb506a32bd34f6323b25ec69622) )
1590   ROM_LOAD16_WORD_SWAP( "046-p2.sp2", 0x100000, 0x100000, CRC(f182cb3e) SHA1(6b4e0af5d4e623f0682f37ff5c69e5b705e20028) )
1704   ROM_LOAD16_WORD_SWAP( "046-p2.bin", 0x100000, 0x100000, CRC(f182cb3e) SHA1(6b4e0af5d4e623f0682f37ff5c69e5b705e20028) )
15911705
15921706   NEO_SFIX_128K( "046-s1.bin", CRC(14b01d7b) SHA1(618ce75c25d6cc86a3b46bd64a0aa34ab82f75ae) )
15931707
r2241r2242
16151729ROM_START( tophunta )
16161730   ROM_REGION( 0x200000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
16171731   ROM_LOAD16_WORD_SWAP( "046-pg1.bin",0x000000, 0x100000, CRC(771e39bc) SHA1(c0e05fd1ca81926438bb75e2fa6894e40ab6521e) )
1618   ROM_LOAD16_WORD_SWAP( "046-p2.sp2", 0x100000, 0x100000, CRC(f182cb3e) SHA1(6b4e0af5d4e623f0682f37ff5c69e5b705e20028) )
1732   ROM_LOAD16_WORD_SWAP( "046-p2.bin", 0x100000, 0x100000, CRC(f182cb3e) SHA1(6b4e0af5d4e623f0682f37ff5c69e5b705e20028) )
16191733
16201734   NEO_SFIX_128K( "046-s1.bin", CRC(14b01d7b) SHA1(618ce75c25d6cc86a3b46bd64a0aa34ab82f75ae) )
16211735
r2241r2242
16411755ROM_END
16421756
16431757
1644ROM_START( fatfury2 )
1758ROM_START( fatfury2 ) /* MVS AND AES VERSION */
16451759   ROM_REGION( 0x100000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
16461760   ROM_LOAD16_WORD_SWAP( "047-p1.bin", 0x000000, 0x080000, CRC(be40ea92) SHA1(958b891bb8beb6af122d5467257ab20cbc6cf574) )
16471761   ROM_LOAD16_WORD_SWAP( "047-p2.bin", 0x080000, 0x080000, CRC(2a9beac5) SHA1(61378f89d64fef4c172825694f83229c2ab1a7af) )
r2241r2242
16811795   NO_DELTAT_REGION
16821796
16831797   ROM_REGION( 0x400000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
1684   ROM_LOAD16_BYTE( "048-c1.bin", 0x000000, 0x200000, CRC(3fa890e9) SHA1(e73d2802bacfbc2b2b16fbbedddde17488e4bbde) )
1685   ROM_LOAD16_BYTE( "048-c2.bin", 0x000001, 0x200000, CRC(59c48ad8) SHA1(2630817e735a6d197377558f4324c1442803fe15) )
1798   ROM_LOAD16_BYTE( "048-c1.bin", 0x000000, 0x200000, CRC(3fa890e9) SHA1(e73d2802bacfbc2b2b16fbbedddde17488e4bbde) ) /* Plane 0,1 */
1799   ROM_LOAD16_BYTE( "048-c2.bin", 0x000001, 0x200000, CRC(59c48ad8) SHA1(2630817e735a6d197377558f4324c1442803fe15) ) /* Plane 2,3 */
16861800ROM_END
16871801
16881802ROM_START( androdun )
r2241r2242
17421856   NO_DELTAT_REGION
17431857
17441858   ROM_REGION( 0x600000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
1745   ROM_LOAD16_BYTE( "051-c1.bin", 0x000000, 0x100000, CRC(d624c132) SHA1(49c7e9f020cba45d7083b45252bcc03397f8c286) )
1859   ROM_LOAD16_BYTE( "051-c1.bin", 0x000000, 0x100000, CRC(d624c132) SHA1(49c7e9f020cba45d7083b45252bcc03397f8c286) ) /* Plane 0,1 */
17461860   ROM_CONTINUE(                  0x400000, 0x100000 )
1747   ROM_LOAD16_BYTE( "051-c2.bin", 0x000001, 0x100000, CRC(40d69f1e) SHA1(ec4a13582772594957f927622d50f54b0dfcd8d8) )
1861   ROM_LOAD16_BYTE( "051-c2.bin", 0x000001, 0x100000, CRC(40d69f1e) SHA1(ec4a13582772594957f927622d50f54b0dfcd8d8) ) /* Plane 2,3 */
17481862   ROM_CONTINUE(                  0x400001, 0x100000 )
17491863ROM_END
17501864
r2241r2242
20342148
20352149   ROM_REGION(  0x300000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
20362150   ROM_LOAD( "060-v1.bin", 0x000000, 0x200000, CRC(f417c215) SHA1(0f53b8dd056f43b5d880628e8b74c2b27881ffac) )
2037   ROM_LOAD( "060-v2.bin", 0x200000, 0x100000, CRC(64470036) SHA1(eb2b34b3c01eb5c1a0a40cff6f4c0f2eee7bf7f2) )
2151   ROM_LOAD( "060-v2.bin", 0x200000, 0x100000, CRC(efcff7cf) SHA1(e8372303724284a750b706dc6bf7641e4c52bb95) )
20382152
20392153   NO_DELTAT_REGION
20402154
r2241r2242
20482162ROM_START( fightfva ) /* MVS VERSION */
20492163   ROM_REGION( 0x200000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
20502164   ROM_LOAD16_WORD_SWAP( "060-p1.rom", 0x0000000, 0x100000, CRC(2a104b50) SHA1(3eb663d3df7074e1cdf4c0e450a35c9cf55d8979) )
2051   /* there was also a copy of the 060-p1.bin with the name 060-p2.bin maybe it should be loaded over the top or this
2052       larger rom is an older revision... */
20532165
2166   /* There was also a copy of the 060-p1.bin with the name 060-p2.bin maybe it should be loaded over the top or this
2167    larger rom is an older revision... */
2168
20542169   NEO_SFIX_128K( "060-s1.bin", CRC(7f012104) SHA1(f366dcc3923655dff16ec08a40d5fce22a84257d) )
20552170
20562171   NEO_BIOS_AUDIO_128K( "060-m1.bin", CRC(0b7c4e65) SHA1(999a1e784de18db3f1332b30bc425836ea6970be) )
20572172
20582173   ROM_REGION(  0x300000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
20592174   ROM_LOAD( "060-v1.bin", 0x000000, 0x200000, CRC(f417c215) SHA1(0f53b8dd056f43b5d880628e8b74c2b27881ffac) )
2060   ROM_LOAD( "060-v2.bin", 0x200000, 0x100000, CRC(64470036) SHA1(eb2b34b3c01eb5c1a0a40cff6f4c0f2eee7bf7f2) )
2175   ROM_LOAD( "060-v2.bin", 0x200000, 0x100000, CRC(efcff7cf) SHA1(e8372303724284a750b706dc6bf7641e4c52bb95) )
20612176
20622177   NO_DELTAT_REGION
20632178
r2241r2242
20902205ROM_END
20912206
20922207ROM_START( spinmast )
2093   ROM_REGION( 0x180000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
2208   ROM_REGION( 0x200000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
20942209   ROM_LOAD16_WORD_SWAP( "062-p1.bin", 0x000000, 0x100000, CRC(37aba1aa) SHA1(1a2ab9593371cc2f665121d554eec3f6bb4d09ff) )
2095   ROM_LOAD16_WORD_SWAP( "062-p2.bin", 0x100000, 0x080000, CRC(43763ad2) SHA1(9b08cf1a79294c3206f6364466cae2c8b15acad5) )
2210   ROM_LOAD16_WORD_SWAP( "062-p2.bin", 0x100000, 0x100000, CRC(f025ab77) SHA1(4944be04648296d0b93cfe4c5ca7b9cede072cff) )
20962211
20972212   NEO_SFIX_128K( "062-s1.bin", CRC(289e2bbe) SHA1(f52c7f2bffc89df3130b3cabd200408509a28cdc) )
20982213
r2241r2242
21142229   ROM_LOAD16_BYTE( "062-c8.bin", 0x600001, 0x100000, CRC(8d7be933) SHA1(e7097cfa26a959f90721e2e8368ceb47ea9db661) ) /* Plane 2,3 */
21152230ROM_END
21162231
2117ROM_START( samsho2 )
2232ROM_START( samsho2 ) /* MVS AND AES VERSION */
21182233   ROM_REGION( 0x200000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
21192234   ROM_LOAD16_WORD_SWAP( "063-p1.bin", 0x100000, 0x100000, CRC(22368892) SHA1(0997f8284aa0f57a333be8a0fdea777d0d01afd6) )
21202235   ROM_CONTINUE(                  0x000000, 0x100000 )
r2241r2242
21872302   ROM_LOAD16_BYTE( "064-c5.bin", 0x800000, 0x200000, CRC(8e34a9f4) SHA1(67b839b426ef3fad0a85d951fdd44c0a45c55226) ) /* Plane 0,1 */
21882303   ROM_LOAD16_BYTE( "064-c6.bin", 0x800001, 0x200000, CRC(a43e4766) SHA1(54f282f2b1ff2934cca7acbb4386a2b99a29df3a) ) /* Plane 2,3 */
21892304   ROM_LOAD16_BYTE( "064-c7.bin", 0xc00000, 0x200000, CRC(59d97215) SHA1(85a960dc7f364df13ee0c2f99a4c53aefb081486) ) /* Plane 0,1 */
2190   ROM_LOAD16_BYTE( "064-c8.bin", 0xc00001, 0x200000, CRC(fc092367) SHA1(69ff4ae909dd857de3ca8645d63f8b4bde117448) ) /* Plane 0,1 */
2305   ROM_LOAD16_BYTE( "064-c8.bin", 0xc00001, 0x200000, CRC(fc092367) SHA1(69ff4ae909dd857de3ca8645d63f8b4bde117448) ) /* Plane 2,3 */
21912306ROM_END
21922307
21932308ROM_START( wjammers )
r2241r2242
22072322   NO_DELTAT_REGION
22082323
22092324   ROM_REGION( 0x400000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
2210   ROM_LOAD16_BYTE( "065-c1.bin", 0x000000, 0x100000, CRC(c7650204) SHA1(42918d700d59864f8ab15caf968a062a563c9b09) )
2211   ROM_LOAD16_BYTE( "065-c2.bin", 0x000001, 0x100000, CRC(d9f3e71d) SHA1(fad1f64061eac1bf85bf6d75d2eae974a8c94069) )
2212   ROM_LOAD16_BYTE( "065-c3.bin", 0x200000, 0x100000, CRC(40986386) SHA1(65795a50197049681265946713d416c9cdb68f08) )
2213   ROM_LOAD16_BYTE( "065-c4.bin", 0x200001, 0x100000, CRC(715e15ff) SHA1(ac8b8b01f5c7384b883afbe0cf977430378e3fef) )
2325   ROM_LOAD16_BYTE( "065-c1.bin", 0x000000, 0x100000, CRC(c7650204) SHA1(42918d700d59864f8ab15caf968a062a563c9b09) ) /* Plane 0,1 */
2326   ROM_LOAD16_BYTE( "065-c2.bin", 0x000001, 0x100000, CRC(d9f3e71d) SHA1(fad1f64061eac1bf85bf6d75d2eae974a8c94069) ) /* Plane 2,3 */
2327   ROM_LOAD16_BYTE( "065-c3.bin", 0x200000, 0x100000, CRC(40986386) SHA1(65795a50197049681265946713d416c9cdb68f08) ) /* Plane 0,1 */
2328   ROM_LOAD16_BYTE( "065-c4.bin", 0x200001, 0x100000, CRC(715e15ff) SHA1(ac8b8b01f5c7384b883afbe0cf977430378e3fef) ) /* Plane 2,3 */
22142329ROM_END
22152330
22162331ROM_START( karnovr )
r2241r2242
22772392   ROM_LOAD16_BYTE( "068-c6.bin", 0x400001, 0x100000, CRC(a6722604) SHA1(b40c57fb4be93ac0b918829f88393ced3d4f8bde) ) /* Plane 2,3 */
22782393ROM_END
22792394
2280ROM_START( fatfury3 )
2395ROM_START( fatfury3 ) /* MVS AND AES VERSION */
22812396   ROM_REGION( 0x300000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
22822397   ROM_LOAD16_WORD_SWAP( "069-p1.bin", 0x000000, 0x100000, CRC(a8bcfbbc) SHA1(519c4861151797e5f4d4f33432b83dfabed8e7c4) )
22832398   ROM_LOAD16_WORD_SWAP( "069-sp2.bin", 0x100000, 0x200000, CRC(dbe963ed) SHA1(8ece7f663cfe8e563576a397e41161d392cee67e) )
r2241r2242
23022417   ROM_LOAD16_BYTE( "069-c6.bin", 0x1000001, 0x200000, CRC(69210441) SHA1(6d496c549dba65caabeaffe5b762e86f9d648a26) ) /* Plane 2,3 */
23032418ROM_END
23042419
2420ROM_START( zupapa ) /* Original Version - Encrypted GFX */
2421   ROM_REGION( 0x100000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
2422   ROM_LOAD16_WORD_SWAP( "070-p1.bin", 0x000000, 0x100000, CRC(5a96203e) SHA1(49cddec9ca6cc51e5ecf8a34e447a23e1f8a15a1) )
2423
2424   ROM_Y_ZOOM
2425
2426   /* The Encrypted Boards do _not_ have an s1 rom, data for it comes from the Cx ROMs */
2427   ROM_REGION( 0x20000, NEOGEO_REGION_FIXED_LAYER_CARTRIDGE, 0 )
2428   ROM_FILL(                 0x000000, 0x20000, 0 )
2429   ROM_REGION( 0x20000, NEOGEO_REGION_FIXED_LAYER_BIOS, 0 )
2430   ROM_LOAD( "sfix.sfx",  0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
2431
2432   NEO_BIOS_AUDIO_128K( "070-m1.bin", CRC(5a3b3191) SHA1(fa9a9930e18c64e598841fb344c4471d3d2c1964) )
2433
2434   ROM_REGION( 0x0200000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
2435   ROM_LOAD( "070-v1.bin", 0x000000, 0x200000, CRC(d3a7e1ff) SHA1(4a4a227e10f4af58168f6c26011ea1d414253f92) )
2436
2437   NO_DELTAT_REGION
2438
2439   ROM_REGION( 0x1000000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
2440   /* Encrypted */
2441   ROM_LOAD16_BYTE( "070-c1.bin", 0x0000000, 0x800000, CRC(f8ad02d8) SHA1(9be54532332a8e963ec35ff1e518947bb11ebade) ) /* Plane 0,1 */
2442   ROM_LOAD16_BYTE( "070-c2.bin", 0x0000001, 0x800000, CRC(70156dde) SHA1(06286bf043d50199b47df9a76ca91f39cb28cb90) ) /* Plane 2,3 */
2443ROM_END
2444
23052445ROM_START( panicbom )
23062446   ROM_REGION( 0x100000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
23072447   ROM_LOAD16_WORD_SWAP( "073-p1.bin", 0x000000, 0x080000, CRC(adc356ad) SHA1(801e0a54b65d7a3500e6cef2d6bba40c6356dc1f) )
r2241r2242
24562596
24572597   ROM_REGION( 0x800000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
24582598   ROM_LOAD16_BYTE( "080-c1.bin",  0x000000, 0x200000, CRC(ea1d764a) SHA1(78cc1735624c37f90607baa92e110a3c5cc54c6f) ) /* Plane 0,1 */
2459   ROM_LOAD16_BYTE( "080-c2.bin",  0x000001, 0x200000, CRC(c78c49da) SHA1(0b95a340842847ab304517060e506098f8e5f0e0) ) /* Plane 2,3 */
2599   ROM_LOAD16_BYTE( "080-c2.bin",  0x000001, 0x200000, CRC(d331d4a4) SHA1(94228d13fb1e30973eb54058e697f17456ee16ea) ) /* Plane 2,3 */
24602600   ROM_LOAD16_BYTE( "080-c3.bin",  0x400000, 0x200000, CRC(b4851bfe) SHA1(b8286c601de5755c1681ea46e177fc89006fc066) ) /* Plane 0,1 */
24612601   ROM_LOAD16_BYTE( "080-c4.bin",  0x400001, 0x200000, CRC(ca6f5460) SHA1(ed36e244c9335f4c0a97c57b7b7f1b849dd3a90d) ) /* Plane 2,3 */
24622602ROM_END
r2241r2242
25022642   NO_DELTAT_REGION
25032643
25042644   ROM_REGION( 0xe00000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
2505   ROM_LOAD16_BYTE( "082-c1.bin", 0x000000, 0x200000, CRC(b478c725) SHA1(3a777c5906220f246a6dc06cb084e6ad650d67bb) )
2506   ROM_LOAD16_BYTE( "082-c2.bin", 0x000001, 0x200000, CRC(2857da32) SHA1(9f13245965d23db86d46d7e73dfb6cc63e6f25a1) )
2507   ROM_LOAD16_BYTE( "082-c3.bin", 0x400000, 0x200000, CRC(8b0d378e) SHA1(3a347215e414b738164f1fe4144102f07d4ffb80) )
2508   ROM_LOAD16_BYTE( "082-c4.bin", 0x400001, 0x200000, CRC(c7d2f596) SHA1(e2d09d4d1b1fef9c0c53ecf3629e974b75e559f5) )
2509   ROM_LOAD16_BYTE( "082-c5.bin", 0x800000, 0x200000, CRC(ec87bff6) SHA1(3fa86da93881158c2c23443855922a7b32e55135) )
2510   ROM_LOAD16_BYTE( "082-c6.bin", 0x800001, 0x200000, CRC(844a8a11) SHA1(b2acbd4cacce66fb32c052b2fba9984904679bda) )
2511   ROM_LOAD16_BYTE( "082-c7.bin", 0xc00000, 0x100000, CRC(727c4d02) SHA1(8204c7f037d46e0c58f269f9c7a535bc2589f526) )
2512   ROM_LOAD16_BYTE( "082-c8.bin", 0xc00001, 0x100000, CRC(69a5fa37) SHA1(020e70e0e8b3c5d00a40fe97e418115a3187e50a) )
2645   ROM_LOAD16_BYTE( "082-c1.bin", 0x000000, 0x200000, CRC(b478c725) SHA1(3a777c5906220f246a6dc06cb084e6ad650d67bb) ) /* Plane 0,1 */
2646   ROM_LOAD16_BYTE( "082-c2.bin", 0x000001, 0x200000, CRC(2857da32) SHA1(9f13245965d23db86d46d7e73dfb6cc63e6f25a1) ) /* Plane 2,3 */
2647   ROM_LOAD16_BYTE( "082-c3.bin", 0x400000, 0x200000, CRC(8b0d378e) SHA1(3a347215e414b738164f1fe4144102f07d4ffb80) ) /* Plane 0,1 */
2648   ROM_LOAD16_BYTE( "082-c4.bin", 0x400001, 0x200000, CRC(c7d2f596) SHA1(e2d09d4d1b1fef9c0c53ecf3629e974b75e559f5) ) /* Plane 2,3 */
2649   ROM_LOAD16_BYTE( "082-c5.bin", 0x800000, 0x200000, CRC(ec87bff6) SHA1(3fa86da93881158c2c23443855922a7b32e55135) ) /* Plane 0,1 */
2650   ROM_LOAD16_BYTE( "082-c6.bin", 0x800001, 0x200000, CRC(844a8a11) SHA1(b2acbd4cacce66fb32c052b2fba9984904679bda) ) /* Plane 2,3 */
2651   ROM_LOAD16_BYTE( "082-c7.bin", 0xc00000, 0x100000, CRC(727c4d02) SHA1(8204c7f037d46e0c58f269f9c7a535bc2589f526) ) /* Plane 0,1 */
2652   ROM_LOAD16_BYTE( "082-c8.bin", 0xc00001, 0x100000, CRC(69a5fa37) SHA1(020e70e0e8b3c5d00a40fe97e418115a3187e50a) ) /* Plane 2,3 */
25132653ROM_END
25142654
25152655ROM_START( pbobblen )
r2241r2242
27892929   NO_DELTAT_REGION
27902930
27912931   ROM_REGION( 0x1c00000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
2792   ROM_LOAD16_BYTE( "090-c1.bin", 0x0000000, 0x400000, CRC(cd30ed9b) SHA1(839c20f7ff31251acc875ae402b5d267e55510c7) )
2793   ROM_LOAD16_BYTE( "090-c2.bin", 0x0000001, 0x400000, CRC(10eed5ee) SHA1(12131b1c8c017ea77a98c044b392a5db6aad0143) )
2794   ROM_LOAD16_BYTE( "090-c3.bin", 0x0800000, 0x200000, CRC(436d1b31) SHA1(059776d77b91377ed0bcfc278802d659c917fc0f) )
2795   ROM_LOAD16_BYTE( "090-c4.bin", 0x0800001, 0x200000, CRC(f9c8dd26) SHA1(25a9eea1d49b21b4a988beb32c25bf2f7796f227) )
2932   ROM_LOAD16_BYTE( "090-c1.bin", 0x0000000, 0x400000, CRC(cd30ed9b) SHA1(839c20f7ff31251acc875ae402b5d267e55510c7) ) /* Plane 0,1 */
2933   ROM_LOAD16_BYTE( "090-c2.bin", 0x0000001, 0x400000, CRC(10eed5ee) SHA1(12131b1c8c017ea77a98c044b392a5db6aad0143) ) /* Plane 2,3 */
2934   ROM_LOAD16_BYTE( "090-c3.bin", 0x0800000, 0x200000, CRC(436d1b31) SHA1(059776d77b91377ed0bcfc278802d659c917fc0f) ) /* Plane 0,1 */
2935   ROM_LOAD16_BYTE( "090-c4.bin", 0x0800001, 0x200000, CRC(f9c8dd26) SHA1(25a9eea1d49b21b4a988beb32c25bf2f7796f227) ) /* Plane 2,3 */
27962936   /* 0c00000-0ffffff empty */
2797   ROM_LOAD16_BYTE( "090-c5.bin", 0x1000000, 0x200000, CRC(8e34a9f4) SHA1(67b839b426ef3fad0a85d951fdd44c0a45c55226) )
2798   ROM_LOAD16_BYTE( "090-c6.bin", 0x1000001, 0x200000, CRC(a43e4766) SHA1(54f282f2b1ff2934cca7acbb4386a2b99a29df3a) )
2937   ROM_LOAD16_BYTE( "090-c5.bin", 0x1000000, 0x200000, CRC(8e34a9f4) SHA1(67b839b426ef3fad0a85d951fdd44c0a45c55226) ) /* Plane 0,1 */
2938   ROM_LOAD16_BYTE( "090-c6.bin", 0x1000001, 0x200000, CRC(a43e4766) SHA1(54f282f2b1ff2934cca7acbb4386a2b99a29df3a) ) /* Plane 2,3 */
27992939   /* 1400000-17fffff empty */
2800   ROM_LOAD16_BYTE( "090-c7.bin", 0x1800000, 0x200000, CRC(59d97215) SHA1(85a960dc7f364df13ee0c2f99a4c53aefb081486) )
2801   ROM_LOAD16_BYTE( "090-c8.bin", 0x1800001, 0x200000, CRC(fc092367) SHA1(69ff4ae909dd857de3ca8645d63f8b4bde117448) )
2940   ROM_LOAD16_BYTE( "090-c7.bin", 0x1800000, 0x200000, CRC(59d97215) SHA1(85a960dc7f364df13ee0c2f99a4c53aefb081486) ) /* Plane 0,1 */
2941   ROM_LOAD16_BYTE( "090-c8.bin", 0x1800001, 0x200000, CRC(fc092367) SHA1(69ff4ae909dd857de3ca8645d63f8b4bde117448) ) /* Plane 2,3 */
28022942ROM_END
28032943
28042944ROM_START( kabukikl )
r2241r2242
29033043ROM_START( rbff1a ) /* MVS VERSION */
29043044   ROM_REGION( 0x300000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
29053045
2906        /* This is a bug fixed revision applied over the original cart. The original P1 and P2 stayed in the cart and this */
3046   /* This is a bug fixed revision applied over the original cart. The original P1 and P2 stayed in the cart and this */
29073047   /* 512k ROM was added to replace the first 512k of P1. */
29083048
29093049   ROM_LOAD16_WORD_SWAP( "095-p1.bin",  0x000000, 0x100000, CRC(63b4d8ae) SHA1(03aa9f6bab6aee685d1b57a52823797704eea845) )
r2241r2242
31903330   NO_DELTAT_REGION
31913331
31923332   ROM_REGION( 0x400000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
3193   ROM_LOAD16_BYTE( "zin_c1.rom", 0x000000, 0x200000, CRC(76aee189) SHA1(ad6929804c5b9a59aa609e6baebc6aa37e858a47) )
3194   ROM_LOAD16_BYTE( "zin_c2.rom", 0x000001, 0x200000, CRC(844ed4b3) SHA1(fb7cd057bdc6cbe8b78097dd124118bae7402256) )
3333   ROM_LOAD16_BYTE( "zin_c1.rom", 0x000000, 0x200000, CRC(76aee189) SHA1(ad6929804c5b9a59aa609e6baebc6aa37e858a47) ) /* Plane 0,1 */
3334   ROM_LOAD16_BYTE( "zin_c2.rom", 0x000001, 0x200000, CRC(844ed4b3) SHA1(fb7cd057bdc6cbe8b78097dd124118bae7402256) ) /* Plane 2,3 */
31953335ROM_END
31963336
31973337ROM_START( overtop )
r2241r2242
32373377   ROM_LOAD16_BYTE( "213-c2.bin", 0x000001, 0x400000, CRC(46ae5f16) SHA1(a01310632734e776e889af6a531063cb1661c33a) ) /* Plane 2,3 */
32383378ROM_END
32393379
3240ROM_START( kof96 )
3380ROM_START( kof96 ) /* MVS VERSION */
32413381   ROM_REGION( 0x300000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
32423382   ROM_LOAD16_WORD_SWAP( "214-p1.bin", 0x000000, 0x100000, CRC(52755d74) SHA1(4232d627f1d2e6ea9fc8cf01571d77d4d5b8a1bb) )
32433383   ROM_LOAD16_WORD_SWAP( "214-p2.bin", 0x100000, 0x200000, CRC(002ccb73) SHA1(3ae8df682c75027ca82db25491021eeba00a267e) )
r2241r2242
38563996   NO_DELTAT_REGION
38573997
38583998   ROM_REGION( 0x400000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
3859   ROM_LOAD16_BYTE( "237-c1.bin", 0x000000, 0x200000, CRC(eda42d66) SHA1(2735538fcb9dc0c16e043a8728c8b642650189f4) )
3860   ROM_LOAD16_BYTE( "237-c2.bin", 0x000001, 0x200000, CRC(5e633c65) SHA1(9a82107caf027317c173c1c1ef676f0fdeea79b2) )
3999   ROM_LOAD16_BYTE( "237-c1.bin", 0x000000, 0x200000, CRC(eda42d66) SHA1(2735538fcb9dc0c16e043a8728c8b642650189f4) ) /* Plane 0,1 */
4000   ROM_LOAD16_BYTE( "237-c2.bin", 0x000001, 0x200000, CRC(5e633c65) SHA1(9a82107caf027317c173c1c1ef676f0fdeea79b2) ) /* Plane 2,3 */
38614001ROM_END
38624002
38634003ROM_START( shocktro )
r2241r2242
39474087
39484088   NEO_BIOS_AUDIO_256K( "240-m1.bin", CRC(ed482791) SHA1(1f54a45967cb7842c33aa24be322c9f33ff75ac3) )
39494089
3950   ROM_REGION( 0x1000000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
4090   ROM_REGION( 0x0e00000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
39514091   ROM_LOAD( "240-v1.bin", 0x000000, 0x400000, CRC(f796265a) SHA1(736dff37eb91fc856b4d189249fb0de9b6c0813a) )
39524092   ROM_LOAD( "240-v2.bin", 0x400000, 0x400000, CRC(2cb3f3bb) SHA1(697e677890892f4b028c9a27c66809ca0a8a9b18) )
39534093   //ROM_LOAD( "240-v3.bin", 0x800000, 0x400000, CRC(df77b7fa) SHA1(4df971ce20bdb8c1ce8cc1692a32ac69505ffa9a) ) // bad?
39544094   ROM_LOAD( "240-v3.bin", 0x800000, 0x400000, CRC(8fe1367a) SHA1(093d7a4ac2b54ad7ffb2dc316fe29415f7a99535) )
3955   ROM_LOAD( "240-v4.bin", 0xc00000, 0x400000, CRC(33a356ee) SHA1(b2a08052be670f301f8d4903b36c70088d1a11da) )
4095   ROM_LOAD( "240-v4.bin", 0xc00000, 0x200000, CRC(996704d8) SHA1(0bf7a1d0660199dedf3c25be757eeab75cc6147e) )
39564096
39574097   NO_DELTAT_REGION
39584098
r2241r2242
39744114
39754115   NEO_BIOS_AUDIO_256K( "240-m1.bin", CRC(ed482791) SHA1(1f54a45967cb7842c33aa24be322c9f33ff75ac3) )
39764116
3977   ROM_REGION( 0x1000000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
4117   ROM_REGION( 0x0e00000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
39784118   ROM_LOAD( "240-v1.bin", 0x000000, 0x400000, CRC(f796265a) SHA1(736dff37eb91fc856b4d189249fb0de9b6c0813a) )
39794119   ROM_LOAD( "240-v2.bin", 0x400000, 0x400000, CRC(2cb3f3bb) SHA1(697e677890892f4b028c9a27c66809ca0a8a9b18) )
39804120   //ROM_LOAD( "240-v3.bin", 0x800000, 0x400000, CRC(df77b7fa) SHA1(4df971ce20bdb8c1ce8cc1692a32ac69505ffa9a) ) // bad?
39814121   ROM_LOAD( "240-v3.bin", 0x800000, 0x400000, CRC(8fe1367a) SHA1(093d7a4ac2b54ad7ffb2dc316fe29415f7a99535) )
3982   ROM_LOAD( "240-v4.bin", 0xc00000, 0x400000, CRC(33a356ee) SHA1(b2a08052be670f301f8d4903b36c70088d1a11da) )
4122   ROM_LOAD( "240-v4.bin", 0xc00000, 0x200000, CRC(996704d8) SHA1(0bf7a1d0660199dedf3c25be757eeab75cc6147e) )
39834123
39844124   NO_DELTAT_REGION
39854125
r2241r2242
40014141
40024142   NEO_BIOS_AUDIO_256K( "240-m1.bin", CRC(ed482791) SHA1(1f54a45967cb7842c33aa24be322c9f33ff75ac3) )
40034143
4004   ROM_REGION( 0x1000000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
4144   ROM_REGION( 0x0e00000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
40054145   ROM_LOAD( "240-v1.bin", 0x000000, 0x400000, CRC(f796265a) SHA1(736dff37eb91fc856b4d189249fb0de9b6c0813a) )
40064146   ROM_LOAD( "240-v2.bin", 0x400000, 0x400000, CRC(2cb3f3bb) SHA1(697e677890892f4b028c9a27c66809ca0a8a9b18) )
40074147   //ROM_LOAD( "240-v3.bin", 0x800000, 0x400000, CRC(df77b7fa) SHA1(4df971ce20bdb8c1ce8cc1692a32ac69505ffa9a) ) // bad?
40084148   ROM_LOAD( "240-v3.bin", 0x800000, 0x400000, CRC(8fe1367a) SHA1(093d7a4ac2b54ad7ffb2dc316fe29415f7a99535) )
4009   ROM_LOAD( "240-v4.bin", 0xc00000, 0x400000, CRC(33a356ee) SHA1(b2a08052be670f301f8d4903b36c70088d1a11da) )
4149   ROM_LOAD( "240-v4.bin", 0xc00000, 0x200000, CRC(996704d8) SHA1(0bf7a1d0660199dedf3c25be757eeab75cc6147e) )
40104150
40114151   NO_DELTAT_REGION
40124152
r2241r2242
40194159   ROM_LOAD16_BYTE( "240-c6.bin", 0x2000001, 0x800000, CRC(4609e507) SHA1(bb17f50a377dddb77c1eeda5944a7bcbf0cca5f7) ) /* Plane 2,3 */
40204160ROM_END
40214161
4022
40234162ROM_START( mslug2 )
40244163   ROM_REGION( 0x300000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
40254164   ROM_LOAD16_WORD_SWAP( "241-p1.bin", 0x000000, 0x100000, CRC(2a53c5da) SHA1(5a6aba482cac588a6c2c51179c95b487c6e11899) )
r2241r2242
45294668
45304669   ROM_REGION( 0x1000000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
45314670   /* Encrypted */
4532   ROM_LOAD16_BYTE( "252-c1.bin", 0x0000000, 0x800000, CRC(50ee7882) SHA1(ace0f95407c246d0456341cf2ad8a7668b81df8a) )
4533   ROM_LOAD16_BYTE( "252-c2.bin", 0x0000001, 0x800000, CRC(62585474) SHA1(b35461598087aa82886af0030c61b26cc064af5f) )
4671   ROM_LOAD16_BYTE( "252-c1.bin", 0x0000000, 0x800000, CRC(50ee7882) SHA1(ace0f95407c246d0456341cf2ad8a7668b81df8a) ) /* Plane 0,1 */
4672   ROM_LOAD16_BYTE( "252-c2.bin", 0x0000001, 0x800000, CRC(62585474) SHA1(b35461598087aa82886af0030c61b26cc064af5f) ) /* Plane 2,3 */
45344673ROM_END
45354674
45364675ROM_START( garou )
r2241r2242
47634902
47644903ROM_START( mslug3n ) /* Original Version - Encrypted GFX */
47654904   ROM_REGION( 0x500000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
4766   ROM_LOAD16_WORD_SWAP( "256-ph1.rom",  0x000000, 0x100000, CRC(9c42ca85) SHA1(7a8f77a89867b889295ae9b9dfd4ba28f02d234d) )
4767   ROM_LOAD16_WORD_SWAP( "256-ph2.rom",  0x100000, 0x400000, CRC(1f3d8ce8) SHA1(08b05a8abfb86ec09a5e758d6273acf1489961f9) )
4905   ROM_LOAD16_WORD_SWAP( "256-ph1.bin",  0x000000, 0x100000, CRC(9c42ca85) SHA1(7a8f77a89867b889295ae9b9dfd4ba28f02d234d) )
4906   ROM_LOAD16_WORD_SWAP( "256-ph2.bin",  0x100000, 0x400000, CRC(1f3d8ce8) SHA1(08b05a8abfb86ec09a5e758d6273acf1489961f9) )
47684907
47694908   ROM_Y_ZOOM
47704909
r2241r2242
48955034
48965035   ROM_REGION( 0x1000000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
48975036   /* Encrypted */
4898   ROM_LOAD16_BYTE( "259-c1.bin", 0x0000000, 0x800000, CRC(1f537f74) SHA1(b8ef691e92191c20a5ed4f20a75cca3c7383bca6) )
4899   ROM_LOAD16_BYTE( "259-c2.bin", 0x0000001, 0x800000, CRC(0efd98ff) SHA1(d350315d3c7f26d638458e5ccf2126069a4c7a5b) )
5037   ROM_LOAD16_BYTE( "259-c1.bin", 0x0000000, 0x800000, CRC(1f537f74) SHA1(b8ef691e92191c20a5ed4f20a75cca3c7383bca6) ) /* Plane 0,1 */
5038   ROM_LOAD16_BYTE( "259-c2.bin", 0x0000001, 0x800000, CRC(0efd98ff) SHA1(d350315d3c7f26d638458e5ccf2126069a4c7a5b) ) /* Plane 2,3 */
49005039ROM_END
49015040
49025041/* same data, diff. format roms, not encrypted, it could be a bootleg, not a prototype, since its identical
r2241r2242
49475086
49485087   ROM_REGION( 0x1000000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
49495088   /* Encrypted */
4950   ROM_LOAD16_BYTE( "260-c1.bin", 0x0000000, 0x800000, CRC(147b0c7f) SHA1(a647c3a2f6d146ff47521c1d39f58830601f5781) )
4951   ROM_LOAD16_BYTE( "260-c2.bin", 0x0000001, 0x800000, CRC(d2b04b0d) SHA1(ce4322e6cfacb627fe997efe81018861e21d3c27) )
5089   ROM_LOAD16_BYTE( "260-c1.bin", 0x0000000, 0x800000, CRC(147b0c7f) SHA1(a647c3a2f6d146ff47521c1d39f58830601f5781) ) /* Plane 0,1 */
5090   ROM_LOAD16_BYTE( "260-c2.bin", 0x0000001, 0x800000, CRC(d2b04b0d) SHA1(ce4322e6cfacb627fe997efe81018861e21d3c27) ) /* Plane 2,3 */
49525091ROM_END
49535092
49545093ROM_START( nitdbl ) /* Bootleg of nitd */
r2241r2242
49735112   ROM_LOAD16_BYTE( "260-c4bl.bin", 0x400001, 0x200000, CRC(4c3926e6) SHA1(7fc54a9886dbef911f7b226e3cd20081c535e989) ) /* Plane 2,3 */
49745113ROM_END
49755114
4976ROM_START( zupapa ) /* Original Version - Encrypted GFX */
4977   ROM_REGION( 0x100000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
4978   ROM_LOAD16_WORD_SWAP( "070-p1.bin", 0x000000, 0x100000, CRC(5a96203e) SHA1(49cddec9ca6cc51e5ecf8a34e447a23e1f8a15a1) )
4979
4980   ROM_Y_ZOOM
4981
4982   /* The Encrypted Boards do _not_ have an s1 rom, data for it comes from the Cx ROMs */
4983   ROM_REGION( 0x20000, NEOGEO_REGION_FIXED_LAYER_CARTRIDGE, 0 )
4984   ROM_FILL(                 0x000000, 0x20000, 0 )
4985   ROM_REGION( 0x20000, NEOGEO_REGION_FIXED_LAYER_BIOS, 0 )
4986   ROM_LOAD( "sfix.sfx",  0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
4987
4988   NEO_BIOS_AUDIO_128K( "070-m1.bin", CRC(5a3b3191) SHA1(fa9a9930e18c64e598841fb344c4471d3d2c1964) )
4989
4990   ROM_REGION( 0x0200000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
4991   ROM_LOAD( "070-v1.bin", 0x000000, 0x200000, CRC(d3a7e1ff) SHA1(4a4a227e10f4af58168f6c26011ea1d414253f92) )
4992
4993   NO_DELTAT_REGION
4994
4995   ROM_REGION( 0x1000000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
4996   /* Encrypted */
4997   ROM_LOAD16_BYTE( "070-c1.bin", 0x0000000, 0x800000, CRC(f8ad02d8) SHA1(9be54532332a8e963ec35ff1e518947bb11ebade) )
4998   ROM_LOAD16_BYTE( "070-c2.bin", 0x0000001, 0x800000, CRC(70156dde) SHA1(06286bf043d50199b47df9a76ca91f39cb28cb90) )
4999ROM_END
5000
50015115ROM_START( sengoku3 ) /* Original Version - Encrypted GFX */
50025116   ROM_REGION( 0x200000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
50035117//  ROM_LOAD16_WORD_SWAP( "261-p1.bin", 0x100000, 0x100000, CRC(5b557201) SHA1(d01421d1dc80fe7d2a46b9f79c0f344b3c81c1e7) ) this one is almost certainly bad
r2241r2242
50235137   NO_DELTAT_REGION
50245138
50255139   ROM_REGION( 0x2000000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
5026   ROM_LOAD16_BYTE( "261-c1.bin", 0x0000000, 0x800000, CRC(ded84d9c) SHA1(d960523b813d4fae06d716298d4e431a5c77a0c5) )
5027   ROM_LOAD16_BYTE( "261-c2.bin", 0x0000001, 0x800000, CRC(b8eb4348) SHA1(619d24312549932959481fa58f43f11c048e1ca5) )
5028   ROM_LOAD16_BYTE( "261-c3.bin", 0x1000000, 0x800000, CRC(84e2034a) SHA1(38ec4ae4b86933a25c9a03799b8cade4b1346401) )
5029   ROM_LOAD16_BYTE( "261-c4.bin", 0x1000001, 0x800000, CRC(0b45ae53) SHA1(a19fb21408ab633aee8bbf38bf43b5e26766b355) )
5140   ROM_LOAD16_BYTE( "261-c1.bin", 0x0000000, 0x800000, CRC(ded84d9c) SHA1(d960523b813d4fae06d716298d4e431a5c77a0c5) ) /* Plane 0,1 */
5141   ROM_LOAD16_BYTE( "261-c2.bin", 0x0000001, 0x800000, CRC(b8eb4348) SHA1(619d24312549932959481fa58f43f11c048e1ca5) ) /* Plane 2,3 */
5142   ROM_LOAD16_BYTE( "261-c3.bin", 0x1000000, 0x800000, CRC(84e2034a) SHA1(38ec4ae4b86933a25c9a03799b8cade4b1346401) ) /* Plane 0,1 */
5143   ROM_LOAD16_BYTE( "261-c4.bin", 0x1000001, 0x800000, CRC(0b45ae53) SHA1(a19fb21408ab633aee8bbf38bf43b5e26766b355) ) /* Plane 2,3 */
50305144ROM_END
50315145
50325146ROM_START( kof2001 ) /* MVS VERSION */
r2241r2242
51705284   ROM_LOAD16_BYTE( "263-c6bl.bin",   0x2000001, 0x800000, CRC(5ed018ab) SHA1(e78501fa8a80960093a4d54ce952681a98300148) ) /* Plane 2,3 */
51715285ROM_END
51725286
5173
51745287ROM_START( rotd ) /* Encrypted Set */ /* MVS VERSION */
51755288   ROM_REGION( 0x800000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
51765289   ROM_LOAD16_WORD_SWAP( "264-p1.bin", 0x000000, 0x800000, CRC(b8cc969d) SHA1(4f2205b4bdd32dd1522106ef4df10ac0eb1b852d) )
r2241r2242
52085321   ROM_LOAD16_BYTE( "264-c8.bin", 0x3000001, 0x800000, CRC(c5edb5c4) SHA1(253378c8739daa5da4edb15eff7050820b2b3755) ) /* Plane 2,3 */
52095322ROM_END
52105323
5211
52125324ROM_START( kof2002 ) /* Encrypted Set */
52135325   ROM_REGION( 0x500000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
52145326   ROM_LOAD16_WORD_SWAP( "265-p1.bin", 0x000000, 0x100000, CRC(9ede7323) SHA1(ad9d45498777fda9fa58e75781f48e09aee705a6) )
r2241r2242
53115423   ROM_LOAD16_BYTE( "265-c8.bin", 0x3000001, 0x800000, CRC(ab0bb549) SHA1(d23afb60b7f831f7d4a98ad3c4a00ee19877a1ce) ) /* Plane 2,3 */
53125424ROM_END
53135425
5314ROM_START( kf2k2mp )
5426ROM_START( kf2k2mp ) /* bootleg */
53155427   ROM_REGION( 0x800000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
53165428   ROM_LOAD16_WORD_SWAP( "kf02m-p1.bin", 0x000000, 0x400000, CRC(ff7c6ec0) SHA1(704c14d671dcb4cfed44d9f978a289cb7dd9d065) )
53175429   ROM_LOAD16_WORD_SWAP( "kf02m-p2.bin", 0x400000, 0x400000, CRC(91584716) SHA1(90da863037cf775957fa154cd42536e221df5740) )
r2241r2242
53655477   ROM_LOAD16_BYTE( "265-c8.bin", 0x3000001, 0x800000, CRC(ab0bb549) SHA1(d23afb60b7f831f7d4a98ad3c4a00ee19877a1ce) ) /* Plane 2,3 */
53665478ROM_END
53675479
5368
53695480ROM_START( matrim ) /* Encrypted Set */ /* MVS AND AES VERSION */
53705481   ROM_REGION( 0x500000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
53715482   ROM_LOAD16_WORD_SWAP( "266-p1.bin", 0x000000, 0x100000, CRC(5d4c2dc7) SHA1(8d723b0d28ec344eef26009b361a2b97d300dd51) )
r2241r2242
54045515   ROM_LOAD16_BYTE( "266-c8.bin", 0x3000001, 0x800000, CRC(29873d33) SHA1(dc77f129ed49b8d40d0d4241feef3f6c2f19a987) ) /* Plane 2,3 */
54055516ROM_END
54065517
5407
54085518ROM_START( pnyaa ) /* Encrypted Set */ /* MVS VERSION */
54095519   ROM_REGION( 0x100000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
54105520   ROM_LOAD16_WORD_SWAP( "267-p1.bin", 0x000000, 0x100000, CRC(112fe2c0) SHA1(01420e051f0bdbd4f68ce306a3738161b96f8ba8) )
r2241r2242
55315641   /* Encrypted, we load it here for reference and replace with decrypted ROM */
55325642   ROM_LOAD( "268-m1.bin", 0x00000, 0x10000, CRC(58b107d0) SHA1(cc7fe66ff4f9c026cde4df06f86c848eb21f7af8) )
55335643   /* Decrypted */
5534   ROM_LOAD( "268-m1_decrypted.bin", 0x00000, 0x10000, CRC(3c0655a7) SHA1(ae839d4c2b87a7aa3dd8e5caddc43eb75ee9b732) ) //Incorrect data
5644   ROM_LOAD( "268-m1_decrypted.bin", 0x00000, 0x10000, CRC(3c0655a7) SHA1(ae839d4c2b87a7aa3dd8e5caddc43eb75ee9b732) ) /* not a 100% match for encrypted version */
55355645   ROM_RELOAD( 0x10000, 0x10000 )
55365646
55375647   ROM_Y_ZOOM
r2241r2242
55635673   ROM_REGION( 0x20000, NEOGEO_REGION_FIXED_LAYER_BIOS, 0 )
55645674   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
55655675
5566   ROM_REGION( 0x10000, NEOGEO_REGION_AUDIO_CPU_ENCRYPTED, 0 )
5676   ROM_REGION( 0x80000, NEOGEO_REGION_AUDIO_CPU_ENCRYPTED, 0 )
55675677   /* Encrypted, we load it here for reference and replace with decrypted ROM */
5568   ROM_LOAD( "268-m1.bin", 0x00000, 0x10000, CRC(58b107d0) SHA1(cc7fe66ff4f9c026cde4df06f86c848eb21f7af8) ) //Incorrect size, correct 4 mbit; incomplete
5678   ROM_LOAD( "268-m1.bin", 0x00000, 0x80000, CRC(4a5a6e0e) SHA1(df0f660f2465e1db7be5adfcaf5e88ad61a74a42) )
55695679   /* Decrypted */
5570   NEO_BIOS_AUDIO_64K( "268-m1_decrypted.bin",  CRC(3c0655a7) SHA1(ae839d4c2b87a7aa3dd8e5caddc43eb75ee9b732) ) //Incorrect data
5680   NEO_BIOS_AUDIO_64K( "268-m1_decrypted.bin",  CRC(3c0655a7) SHA1(ae839d4c2b87a7aa3dd8e5caddc43eb75ee9b732) ) /* not a 100% match for encrypted version */
55715681
55725682   ROM_REGION( 0x1000000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
55735683   /* Encrypted */
r2241r2242
55995709
56005710   ROM_REGION16_BE( 0x80000, NEOGEO_REGION_MAIN_CPU_BIOS, 0 )
56015711   /* this contains both an ASIA and JAPAN bios, HARDDIP3 on the PCB selects which to use */
5602   ROM_LOAD16_WORD_SWAP( "269-bios.bin", 0x00000, 0x80000, CRC(b4590283) SHA1(47047ed5b6062babc0a0bebcc30e4b3f021e115a) )
5712   ROM_LOAD16_WORD_SWAP( "sp-4x.sp1", 0x00000, 0x80000, CRC(b4590283) SHA1(47047ed5b6062babc0a0bebcc30e4b3f021e115a) )
56035713
56045714   ROM_REGION( 0x90000, NEOGEO_REGION_AUDIO_CPU_CARTRIDGE, 0 )
5605   /* Encrypted */
5715   /* Encrypted, we load it here for reference and replace with decrypted ROM */
56065716   ROM_LOAD( "269-m1.bin", 0x00000, 0x80000, CRC(f6819d00) SHA1(d3bbe09df502464f104e53501708ac6e2c1832c6) )
56075717   /* Decrypted */
56085718   ROM_LOAD( "269-m1_decrypted.bin", 0x00000, 0x80000, CRC(7b7bf462) SHA1(7466a6962de5242f71b9c52d7bd21a9832115e11) )
r2241r2242
56215731   ROM_LOAD( "269-c2.bin", 0x2000000, 0x2000000, CRC(5a95f294) SHA1(6123cc7b20b494076185d27c2ffea910e124b195) ) /* Plane 0,1 */
56225732ROM_END
56235733
5624/* alt PCB version, this one has the same program roms as the MVS set, and different GFX / Sound rom arrangements */
5734   /* alt PCB version, this one has the same program roms as the MVS set, and different GFX / Sound rom arrangements */
56255735ROM_START( svcpcba ) /* Encrypted Set, JAMMA PCB */
56265736   ROM_REGION( 0x800000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
56275737   ROM_LOAD32_WORD_SWAP( "269-p1a.bin", 0x000000, 0x400000, CRC(38e2005e) SHA1(1b902905916a30969282f1399a756e32ff069097)  )
r2241r2242
56345744
56355745   ROM_REGION16_BE( 0x80000, NEOGEO_REGION_MAIN_CPU_BIOS, 0 )
56365746   /* this contains both an ASIA and JAPAN bios, HARDDIP3 on the PCB selects which to use */
5637   ROM_LOAD16_WORD_SWAP( "269-bios.bin", 0x00000, 0x80000, CRC(b4590283) SHA1(47047ed5b6062babc0a0bebcc30e4b3f021e115a) )
5747   ROM_LOAD16_WORD_SWAP( "sp-4x.sp1", 0x00000, 0x80000, CRC(b4590283) SHA1(47047ed5b6062babc0a0bebcc30e4b3f021e115a) )
56385748
56395749   ROM_REGION( 0x90000, NEOGEO_REGION_AUDIO_CPU_CARTRIDGE, 0 )
5640   /* Encrypted */
5750   /* Encrypted, we load it here for reference and replace with decrypted ROM */
56415751   ROM_LOAD( "269-m1.bin", 0x00000, 0x80000, CRC(f6819d00) SHA1(d3bbe09df502464f104e53501708ac6e2c1832c6) )
56425752   /* Decrypted */
56435753   ROM_LOAD( "269-m1_decrypted.bin", 0x00000, 0x80000, CRC(7b7bf462) SHA1(7466a6962de5242f71b9c52d7bd21a9832115e11) )
r2241r2242
56935803   ROM_LOAD16_BYTE( "269-c8r.bin", 0x3000001, 0x800000, CRC(2570b71b) SHA1(99266e1c2ffcf324793fb5c55325fbc7e6265ac0) ) /* Plane 2,3 */
56945804ROM_END
56955805
5696
5697ROM_START( svcboot )
5806ROM_START( svcboot ) /* bootleg */
56985807   ROM_REGION( 0x800000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
56995808   ROM_LOAD16_WORD_SWAP( "svc-p1.bin", 0x000000, 0x800000, CRC(0348f162) SHA1(c313351d68effd92aeb80ed320e4f8c26a3bb53e) )
57005809
r2241r2242
57255834   NO_DELTAT_REGION
57265835
57275836   ROM_REGION( 0x4000000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
5728   ROM_LOAD16_BYTE( "svc-c1.bin", 0x0000000, 0x800000, CRC(a7826b89) SHA1(3bbe348ce54b80b56ef032ea532a18ef3cafeb11) )
5729   ROM_LOAD16_BYTE( "svc-c2.bin", 0x0000001, 0x800000, CRC(ed3c2089) SHA1(b5d17692f15f5a678c273589fab2e3918711135e) )
5730   ROM_LOAD16_BYTE( "svc-c3.bin", 0x1000000, 0x800000, CRC(71ed8063) SHA1(ea1df9e2e382a8560a06d447421844cc588f43dd) )
5731   ROM_LOAD16_BYTE( "svc-c4.bin", 0x1000001, 0x800000, CRC(250bde2d) SHA1(8c72dcfceef6d022ab4b73ab37cf3ac0c3940c17) )
5732   ROM_LOAD16_BYTE( "svc-c5.bin", 0x2000000, 0x800000, CRC(9817c082) SHA1(1bea9c7220c2b1524896c86841d6d8fd55f5d366) )
5733   ROM_LOAD16_BYTE( "svc-c6.bin", 0x2000001, 0x800000, CRC(2bc0307f) SHA1(8090fa82c46eb503832359093c8cc3cee3141c90) )
5734   ROM_LOAD16_BYTE( "svc-c7.bin", 0x3000000, 0x800000, CRC(4358d7b9) SHA1(9270b58c2abc072a046bedda72f1395df26d0714) )
5735   ROM_LOAD16_BYTE( "svc-c8.bin", 0x3000001, 0x800000, CRC(366deee5) SHA1(d477ad7a5987fd6c7ef2c1680fbb7c884654590e) )
5837   ROM_LOAD16_BYTE( "svc-c1.bin", 0x0000000, 0x800000, CRC(a7826b89) SHA1(3bbe348ce54b80b56ef032ea532a18ef3cafeb11) ) /* Plane 0,1 */
5838   ROM_LOAD16_BYTE( "svc-c2.bin", 0x0000001, 0x800000, CRC(ed3c2089) SHA1(b5d17692f15f5a678c273589fab2e3918711135e) ) /* Plane 2,3 */
5839   ROM_LOAD16_BYTE( "svc-c3.bin", 0x1000000, 0x800000, CRC(71ed8063) SHA1(ea1df9e2e382a8560a06d447421844cc588f43dd) ) /* Plane 0,1 */
5840   ROM_LOAD16_BYTE( "svc-c4.bin", 0x1000001, 0x800000, CRC(250bde2d) SHA1(8c72dcfceef6d022ab4b73ab37cf3ac0c3940c17) ) /* Plane 2,3 */
5841   ROM_LOAD16_BYTE( "svc-c5.bin", 0x2000000, 0x800000, CRC(9817c082) SHA1(1bea9c7220c2b1524896c86841d6d8fd55f5d366) ) /* Plane 0,1 */
5842   ROM_LOAD16_BYTE( "svc-c6.bin", 0x2000001, 0x800000, CRC(2bc0307f) SHA1(8090fa82c46eb503832359093c8cc3cee3141c90) ) /* Plane 2,3 */
5843   ROM_LOAD16_BYTE( "svc-c7.bin", 0x3000000, 0x800000, CRC(4358d7b9) SHA1(9270b58c2abc072a046bedda72f1395df26d0714) ) /* Plane 0,1 */
5844   ROM_LOAD16_BYTE( "svc-c8.bin", 0x3000001, 0x800000, CRC(366deee5) SHA1(d477ad7a5987fd6c7ef2c1680fbb7c884654590e) ) /* Plane 2,3 */
57365845ROM_END
57375846
5738ROM_START( svcplus )
5847ROM_START( svcplus ) /* bootleg */
57395848   ROM_REGION( 0x600000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
57405849   ROM_LOAD16_WORD_SWAP( "svc-p1p.bin", 0x000000, 0x200000, CRC(a194d842) SHA1(72b7bfa34a97632b1aa003488e074d766a6c2f08) )
57415850   ROM_LOAD16_WORD_SWAP( "svc-p2p.bin", 0x200000, 0x200000, CRC(50c0e2b7) SHA1(97b396415ab0e692e43ddf371091e5a456712f0a) )
r2241r2242
57625871   NO_DELTAT_REGION
57635872
57645873   ROM_REGION( 0x4000000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
5765   ROM_LOAD16_BYTE( "svc-c1.bin", 0x0000000, 0x800000, CRC(a7826b89) SHA1(3bbe348ce54b80b56ef032ea532a18ef3cafeb11) )
5766   ROM_LOAD16_BYTE( "svc-c2.bin", 0x0000001, 0x800000, CRC(ed3c2089) SHA1(b5d17692f15f5a678c273589fab2e3918711135e) )
5767   ROM_LOAD16_BYTE( "svc-c3.bin", 0x1000000, 0x800000, CRC(71ed8063) SHA1(ea1df9e2e382a8560a06d447421844cc588f43dd) )
5768   ROM_LOAD16_BYTE( "svc-c4.bin", 0x1000001, 0x800000, CRC(250bde2d) SHA1(8c72dcfceef6d022ab4b73ab37cf3ac0c3940c17) )
5769   ROM_LOAD16_BYTE( "svc-c5.bin", 0x2000000, 0x800000, CRC(9817c082) SHA1(1bea9c7220c2b1524896c86841d6d8fd55f5d366) )
5770   ROM_LOAD16_BYTE( "svc-c6.bin", 0x2000001, 0x800000, CRC(2bc0307f) SHA1(8090fa82c46eb503832359093c8cc3cee3141c90) )
5771   ROM_LOAD16_BYTE( "svc-c7.bin", 0x3000000, 0x800000, CRC(4358d7b9) SHA1(9270b58c2abc072a046bedda72f1395df26d0714) )
5772   ROM_LOAD16_BYTE( "svc-c8.bin", 0x3000001, 0x800000, CRC(366deee5) SHA1(d477ad7a5987fd6c7ef2c1680fbb7c884654590e) )
5874   ROM_LOAD16_BYTE( "svc-c1.bin", 0x0000000, 0x800000, CRC(a7826b89) SHA1(3bbe348ce54b80b56ef032ea532a18ef3cafeb11) ) /* Plane 0,1 */
5875   ROM_LOAD16_BYTE( "svc-c2.bin", 0x0000001, 0x800000, CRC(ed3c2089) SHA1(b5d17692f15f5a678c273589fab2e3918711135e) ) /* Plane 2,3 */
5876   ROM_LOAD16_BYTE( "svc-c3.bin", 0x1000000, 0x800000, CRC(71ed8063) SHA1(ea1df9e2e382a8560a06d447421844cc588f43dd) ) /* Plane 0,1 */
5877   ROM_LOAD16_BYTE( "svc-c4.bin", 0x1000001, 0x800000, CRC(250bde2d) SHA1(8c72dcfceef6d022ab4b73ab37cf3ac0c3940c17) ) /* Plane 2,3 */
5878   ROM_LOAD16_BYTE( "svc-c5.bin", 0x2000000, 0x800000, CRC(9817c082) SHA1(1bea9c7220c2b1524896c86841d6d8fd55f5d366) ) /* Plane 0,1 */
5879   ROM_LOAD16_BYTE( "svc-c6.bin", 0x2000001, 0x800000, CRC(2bc0307f) SHA1(8090fa82c46eb503832359093c8cc3cee3141c90) ) /* Plane 2,3 */
5880   ROM_LOAD16_BYTE( "svc-c7.bin", 0x3000000, 0x800000, CRC(4358d7b9) SHA1(9270b58c2abc072a046bedda72f1395df26d0714) ) /* Plane 0,1 */
5881   ROM_LOAD16_BYTE( "svc-c8.bin", 0x3000001, 0x800000, CRC(366deee5) SHA1(d477ad7a5987fd6c7ef2c1680fbb7c884654590e) ) /* Plane 2,3 */
57735882ROM_END
57745883
5775ROM_START( svcplusa )
5884ROM_START( svcplusa ) /* bootleg */
57765885   ROM_REGION( 0x600000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
57775886   ROM_LOAD16_WORD_SWAP( "svc-p1pl.bin", 0x000000, 0x200000, CRC(16b44144) SHA1(5eab530274b1b6f480a39a86c199da524cddfccc) )
57785887   ROM_LOAD16_WORD_SWAP( "svc-p2pl.bin", 0x200000, 0x400000, CRC(7231ace2) SHA1(d2f13ddd5d3ee29b4b9824e8663f7ee0241f30cf) )
r2241r2242
58045913   NO_DELTAT_REGION
58055914
58065915   ROM_REGION( 0x4000000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
5807   ROM_LOAD16_BYTE( "svc-c1.bin", 0x0000000, 0x800000, CRC(a7826b89) SHA1(3bbe348ce54b80b56ef032ea532a18ef3cafeb11) )
5808   ROM_LOAD16_BYTE( "svc-c2.bin", 0x0000001, 0x800000, CRC(ed3c2089) SHA1(b5d17692f15f5a678c273589fab2e3918711135e) )
5809   ROM_LOAD16_BYTE( "svc-c3.bin", 0x1000000, 0x800000, CRC(71ed8063) SHA1(ea1df9e2e382a8560a06d447421844cc588f43dd) )
5810   ROM_LOAD16_BYTE( "svc-c4.bin", 0x1000001, 0x800000, CRC(250bde2d) SHA1(8c72dcfceef6d022ab4b73ab37cf3ac0c3940c17) )
5811   ROM_LOAD16_BYTE( "svc-c5.bin", 0x2000000, 0x800000, CRC(9817c082) SHA1(1bea9c7220c2b1524896c86841d6d8fd55f5d366) )
5812   ROM_LOAD16_BYTE( "svc-c6.bin", 0x2000001, 0x800000, CRC(2bc0307f) SHA1(8090fa82c46eb503832359093c8cc3cee3141c90) )
5813   ROM_LOAD16_BYTE( "svc-c7.bin", 0x3000000, 0x800000, CRC(4358d7b9) SHA1(9270b58c2abc072a046bedda72f1395df26d0714) )
5814   ROM_LOAD16_BYTE( "svc-c8.bin", 0x3000001, 0x800000, CRC(366deee5) SHA1(d477ad7a5987fd6c7ef2c1680fbb7c884654590e) )
5916   ROM_LOAD16_BYTE( "svc-c1.bin", 0x0000000, 0x800000, CRC(a7826b89) SHA1(3bbe348ce54b80b56ef032ea532a18ef3cafeb11) ) /* Plane 0,1 */
5917   ROM_LOAD16_BYTE( "svc-c2.bin", 0x0000001, 0x800000, CRC(ed3c2089) SHA1(b5d17692f15f5a678c273589fab2e3918711135e) ) /* Plane 2,3 */
5918   ROM_LOAD16_BYTE( "svc-c3.bin", 0x1000000, 0x800000, CRC(71ed8063) SHA1(ea1df9e2e382a8560a06d447421844cc588f43dd) ) /* Plane 0,1 */
5919   ROM_LOAD16_BYTE( "svc-c4.bin", 0x1000001, 0x800000, CRC(250bde2d) SHA1(8c72dcfceef6d022ab4b73ab37cf3ac0c3940c17) ) /* Plane 2,3 */
5920   ROM_LOAD16_BYTE( "svc-c5.bin", 0x2000000, 0x800000, CRC(9817c082) SHA1(1bea9c7220c2b1524896c86841d6d8fd55f5d366) ) /* Plane 0,1 */
5921   ROM_LOAD16_BYTE( "svc-c6.bin", 0x2000001, 0x800000, CRC(2bc0307f) SHA1(8090fa82c46eb503832359093c8cc3cee3141c90) ) /* Plane 2,3 */
5922   ROM_LOAD16_BYTE( "svc-c7.bin", 0x3000000, 0x800000, CRC(4358d7b9) SHA1(9270b58c2abc072a046bedda72f1395df26d0714) ) /* Plane 0,1 */
5923   ROM_LOAD16_BYTE( "svc-c8.bin", 0x3000001, 0x800000, CRC(366deee5) SHA1(d477ad7a5987fd6c7ef2c1680fbb7c884654590e) ) /* Plane 2,3 */
58155924ROM_END
58165925
5817ROM_START( svcsplus )
5926ROM_START( svcsplus ) /* bootleg */
58185927   ROM_REGION( 0x800000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
58195928   ROM_LOAD16_WORD_SWAP( "svc-p1sp.bin", 0x000000, 0x400000, CRC(2601902f) SHA1(202348a13c6480f7de37a3ee983823838822fc98) )
58205929   ROM_LOAD16_WORD_SWAP( "svc-p2sp.bin", 0x400000, 0x400000, CRC(0ca13305) SHA1(ac8fbca71b754acbcdd11802161a62ae1cf32d88) )
r2241r2242
58405949   NO_DELTAT_REGION
58415950
58425951   ROM_REGION( 0x4000000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
5843   ROM_LOAD16_BYTE( "svc-c1.bin", 0x0000000, 0x800000, CRC(a7826b89) SHA1(3bbe348ce54b80b56ef032ea532a18ef3cafeb11) )
5844   ROM_LOAD16_BYTE( "svc-c2.bin", 0x0000001, 0x800000, CRC(ed3c2089) SHA1(b5d17692f15f5a678c273589fab2e3918711135e) )
5845   ROM_LOAD16_BYTE( "svc-c3.bin", 0x1000000, 0x800000, CRC(71ed8063) SHA1(ea1df9e2e382a8560a06d447421844cc588f43dd) )
5846   ROM_LOAD16_BYTE( "svc-c4.bin", 0x1000001, 0x800000, CRC(250bde2d) SHA1(8c72dcfceef6d022ab4b73ab37cf3ac0c3940c17) )
5847   ROM_LOAD16_BYTE( "svc-c5.bin", 0x2000000, 0x800000, CRC(9817c082) SHA1(1bea9c7220c2b1524896c86841d6d8fd55f5d366) )
5848   ROM_LOAD16_BYTE( "svc-c6.bin", 0x2000001, 0x800000, CRC(2bc0307f) SHA1(8090fa82c46eb503832359093c8cc3cee3141c90) )
5849   ROM_LOAD16_BYTE( "svc-c7.bin", 0x3000000, 0x800000, CRC(4358d7b9) SHA1(9270b58c2abc072a046bedda72f1395df26d0714) )
5850   ROM_LOAD16_BYTE( "svc-c8.bin", 0x3000001, 0x800000, CRC(366deee5) SHA1(d477ad7a5987fd6c7ef2c1680fbb7c884654590e) )
5952   ROM_LOAD16_BYTE( "svc-c1.bin", 0x0000000, 0x800000, CRC(a7826b89) SHA1(3bbe348ce54b80b56ef032ea532a18ef3cafeb11) ) /* Plane 0,1 */
5953   ROM_LOAD16_BYTE( "svc-c2.bin", 0x0000001, 0x800000, CRC(ed3c2089) SHA1(b5d17692f15f5a678c273589fab2e3918711135e) ) /* Plane 2,3 */
5954   ROM_LOAD16_BYTE( "svc-c3.bin", 0x1000000, 0x800000, CRC(71ed8063) SHA1(ea1df9e2e382a8560a06d447421844cc588f43dd) ) /* Plane 0,1 */
5955   ROM_LOAD16_BYTE( "svc-c4.bin", 0x1000001, 0x800000, CRC(250bde2d) SHA1(8c72dcfceef6d022ab4b73ab37cf3ac0c3940c17) ) /* Plane 2,3 */
5956   ROM_LOAD16_BYTE( "svc-c5.bin", 0x2000000, 0x800000, CRC(9817c082) SHA1(1bea9c7220c2b1524896c86841d6d8fd55f5d366) ) /* Plane 0,1 */
5957   ROM_LOAD16_BYTE( "svc-c6.bin", 0x2000001, 0x800000, CRC(2bc0307f) SHA1(8090fa82c46eb503832359093c8cc3cee3141c90) ) /* Plane 2,3 */
5958   ROM_LOAD16_BYTE( "svc-c7.bin", 0x3000000, 0x800000, CRC(4358d7b9) SHA1(9270b58c2abc072a046bedda72f1395df26d0714) ) /* Plane 0,1 */
5959   ROM_LOAD16_BYTE( "svc-c8.bin", 0x3000001, 0x800000, CRC(366deee5) SHA1(d477ad7a5987fd6c7ef2c1680fbb7c884654590e) ) /* Plane 2,3 */
58515960ROM_END
58525961
5853ROM_START( samsho5 ) /* Encrypted Set, MVS VERSION */
5962ROM_START( samsho5 ) /* Encrypted Set */ /* MVS VERSION */
58545963   ROM_REGION( 0x800000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
58555964   ROM_LOAD16_WORD_SWAP( "270-p1.bin", 0x000000, 0x400000, CRC(4a2a09e6) SHA1(2644de02cdab8ccc605488a7c76b8c9cd1d5bcb9) )
58565965   ROM_LOAD16_WORD_SWAP( "270-p2.bin", 0x400000, 0x400000, CRC(e0c74c85) SHA1(df24a4ee76438e40c2f04a714175a7f85cacdfe0) )
r2241r2242
59266035   ROM_LOAD16_BYTE( "270-c8.bin", 0x3000001, 0x800000, CRC(02c530a6) SHA1(7a3fafa6075506c6ef78cc4ec2cb72118ec83cb9) ) /* Plane 2,3 */
59276036ROM_END
59286037
5929ROM_START( samsho5b )
6038ROM_START( samsho5b ) /* bootleg */
59306039   ROM_REGION( 0x800000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
59316040   ROM_LOAD16_WORD_SWAP( "270-p2bl.bin", 0x000000, 0x400000, CRC(5023067f) SHA1(b1d682fa7d158f19664356a919da6572e8cfeee0) )
59326041   ROM_LOAD16_WORD_SWAP( "270-p1bl.bin", 0x400000, 0x400000, CRC(b6cbe386) SHA1(99c2407361116c2b2c5fe72df53e05c5f99163c1) )
r2241r2242
59796088   ROM_LOAD16_WORD_SWAP( "271-bios.bin", 0x00000, 0x080000, CRC(148dd727) SHA1(2cf592a16c7157de02a989675d47965f2b3a44dd) ) // encrypted
59806089
59816090   ROM_REGION( 0x90000, NEOGEO_REGION_AUDIO_CPU_CARTRIDGE, 0 )
5982   /* Encrypted */
6091   /* Encrypted, we load it here for reference and replace with decrypted ROM */
59836092   ROM_LOAD( "271-m1.bin", 0x00000, 0x80000, CRC(d6bcf2bc) SHA1(df78bc95990eb8e8f3638dde6e1876354df7fe84) )
59846093   /* Decrypted */
5985   ROM_LOAD( "271-m1_decrypted.bin", 0x00000, 0x80000, CRC(0e86af8f) SHA1(769102b67bb1a699cfa5674d66cdb46ae633cb65) ) // Incorrect data
6094   ROM_LOAD( "271-m1_decrypted.bin", 0x00000, 0x80000, CRC(0e86af8f) SHA1(769102b67bb1a699cfa5674d66cdb46ae633cb65) )
59866095   ROM_RELOAD( 0x10000, 0x80000 )
59876096
59886097   ROM_Y_ZOOM
r2241r2242
60036112   ROM_LOAD32_WORD( "271-c6.bin", 0x4000002, 0x1000000, CRC(1c40de87) SHA1(8d6425aed43ff6a96c88194e203df6a783286373) ) /* Plane 2,3 */
60046113ROM_END
60056114
6006ROM_START( kof2003 ) /* Encrypted Code + Sound + GFX Roms */
6115ROM_START( kof2003 ) /* Encrypted Code + Sound + GFX Roms */ /* MVS VERSION */
60076116   ROM_REGION( 0x900000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
60086117   ROM_LOAD32_WORD_SWAP( "271-p1c.bin", 0x000000, 0x400000, CRC(530ecc14) SHA1(812cf7e9902af3f5e9e330b7c05c2171b139ad2b) )
60096118   ROM_LOAD32_WORD_SWAP( "271-p2c.bin", 0x000002, 0x400000, CRC(fd568da9) SHA1(46364906a1e81dc251117e91a1a7b43af1373ada) )
r2241r2242
60216130   /* The M1 ROM is encrypted, we load it here for reference and replace it with a decrypted version */
60226131   ROM_LOAD( "271-m1c.bin", 0x00000, 0x080000, CRC(f5515629) SHA1(7516bf1b0207a3c8d41dc30c478f8d8b1f71304b) )
60236132   /* Decrypted */
6024   NEO_BIOS_AUDIO_512K( "271-m1_decrypted.bin", CRC(0e86af8f) SHA1(769102b67bb1a699cfa5674d66cdb46ae633cb65) ) //Incorrect data
6133   NEO_BIOS_AUDIO_512K( "271-m1_decrypted.bin", CRC(0e86af8f) SHA1(769102b67bb1a699cfa5674d66cdb46ae633cb65) ) /* not a 100% match for encrypted version */
60256134
60266135   ROM_REGION( 0x1000000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
60276136   /* Encrypted */
r2241r2242
60326141
60336142   ROM_REGION( 0x4000000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
60346143   /* Encrypted */
6035   ROM_LOAD16_BYTE( "271-c1c.bin", 0x0000000, 0x800000, CRC(b1dc25d0) SHA1(50adc3c60d5b4b3abd10a49db2267306c6dbd772) )
6036   ROM_LOAD16_BYTE( "271-c2c.bin", 0x0000001, 0x800000, CRC(d5362437) SHA1(66db36522dc09106388c707252df9fe1c88b4856) )
6037   ROM_LOAD16_BYTE( "271-c3c.bin", 0x1000000, 0x800000, CRC(0a1fbeab) SHA1(9fe30d36ba98d00fda010832ff2f27783dd577c1) )
6038   ROM_LOAD16_BYTE( "271-c4c.bin", 0x1000001, 0x800000, CRC(87b19a0c) SHA1(b72a8e7d9124ce859b5149bb4381ba481c161ea5) )
6039   ROM_LOAD16_BYTE( "271-c5c.bin", 0x2000000, 0x800000, CRC(704ea371) SHA1(e75b80422f0d72eac826f8ffadf79efeccaab124) )
6040   ROM_LOAD16_BYTE( "271-c6c.bin", 0x2000001, 0x800000, CRC(20a1164c) SHA1(c9843b37612a16fc95f6851793b1cfb5d49d811d) )
6041   ROM_LOAD16_BYTE( "271-c7c.bin", 0x3000000, 0x800000, CRC(189aba7f) SHA1(7152195a57ad36b28290810fe87ed8c206262ba9) )
6042   ROM_LOAD16_BYTE( "271-c8c.bin", 0x3000001, 0x800000, CRC(20ec4fdc) SHA1(deb5f7ec5a090e419b9d1a6a74877bee081198e2) )
6144   ROM_LOAD16_BYTE( "271-c1c.bin", 0x0000000, 0x800000, CRC(b1dc25d0) SHA1(50adc3c60d5b4b3abd10a49db2267306c6dbd772) ) /* Plane 0,1 */
6145   ROM_LOAD16_BYTE( "271-c2c.bin", 0x0000001, 0x800000, CRC(d5362437) SHA1(66db36522dc09106388c707252df9fe1c88b4856) ) /* Plane 2,3 */
6146   ROM_LOAD16_BYTE( "271-c3c.bin", 0x1000000, 0x800000, CRC(0a1fbeab) SHA1(9fe30d36ba98d00fda010832ff2f27783dd577c1) ) /* Plane 0,1 */
6147   ROM_LOAD16_BYTE( "271-c4c.bin", 0x1000001, 0x800000, CRC(87b19a0c) SHA1(b72a8e7d9124ce859b5149bb4381ba481c161ea5) ) /* Plane 2,3 */
6148   ROM_LOAD16_BYTE( "271-c5c.bin", 0x2000000, 0x800000, CRC(704ea371) SHA1(e75b80422f0d72eac826f8ffadf79efeccaab124) ) /* Plane 0,1 */
6149   ROM_LOAD16_BYTE( "271-c6c.bin", 0x2000001, 0x800000, CRC(20a1164c) SHA1(c9843b37612a16fc95f6851793b1cfb5d49d811d) ) /* Plane 2,3 */
6150   ROM_LOAD16_BYTE( "271-c7c.bin", 0x3000000, 0x800000, CRC(189aba7f) SHA1(7152195a57ad36b28290810fe87ed8c206262ba9) ) /* Plane 0,1 */
6151   ROM_LOAD16_BYTE( "271-c8c.bin", 0x3000001, 0x800000, CRC(20ec4fdc) SHA1(deb5f7ec5a090e419b9d1a6a74877bee081198e2) ) /* Plane 2,3 */
60436152ROM_END
60446153
6045ROM_START( kf2k3bl )
6154ROM_START( kf2k3bl ) /* bootleg */
60466155   ROM_REGION( 0x800000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
60476156    ROM_LOAD16_WORD_SWAP( "271-p1bl.bin" , 0x100000, 0x400000, CRC(92ed6ee3) SHA1(5e7e21eb40dfcc453ba73808760d5ddedd49c58a) )
60486157   ROM_LOAD16_WORD_SWAP( "271-p2bl.bin" , 0x500000, 0x200000, CRC(5d3d8bb3) SHA1(7f2341f14ca12ff5721eb038b3496228a1f34b60) )
r2241r2242
60626171   NO_DELTAT_REGION
60636172
60646173   ROM_REGION( 0x4000000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
6065   ROM_LOAD16_BYTE( "2k3-c1.bin", 0x0000000, 0x800000, CRC(e42fc226) SHA1(1cd9364993e141facdcdd53ec2277df7b275d8a7) )
6066   ROM_LOAD16_BYTE( "2k3-c2.bin", 0x0000001, 0x800000, CRC(1b5e3b58) SHA1(0eb254477a9479541291e43e415310852a0f0bed) )
6067   ROM_LOAD16_BYTE( "2k3-c3.bin", 0x1000000, 0x800000, CRC(d334fdd9) SHA1(1efe30b4f56a55e25ab518cf6999de797b5e407c) )
6068   ROM_LOAD16_BYTE( "2k3-c4.bin", 0x1000001, 0x800000, CRC(0d457699) SHA1(ec73d0c9fc7094d0ac6c0986a6e07cde25893e57) )
6069   ROM_LOAD16_BYTE( "2k3-c5.bin", 0x2000000, 0x800000, CRC(8a91aae4) SHA1(802f4baacf801646be1ef686e105b2e867a6a5df) )
6070   ROM_LOAD16_BYTE( "2k3-c6.bin", 0x2000001, 0x800000, CRC(9f8674b8) SHA1(65964f40b2227d020023fb436579927e65807dcd) )
6071   ROM_LOAD16_BYTE( "2k3-c7.bin", 0x3000000, 0x800000, CRC(374ea523) SHA1(613827d72c6181f3e08353750c9af0c4dbad020b) )
6072   ROM_LOAD16_BYTE( "2k3-c8.bin", 0x3000001, 0x800000, CRC(75211f4d) SHA1(d82f044e816ee539ff131d9c931200c818d34cd0) )
6174   ROM_LOAD16_BYTE( "2k3-c1.bin", 0x0000000, 0x800000, CRC(e42fc226) SHA1(1cd9364993e141facdcdd53ec2277df7b275d8a7) ) /* Plane 0,1 */
6175   ROM_LOAD16_BYTE( "2k3-c2.bin", 0x0000001, 0x800000, CRC(1b5e3b58) SHA1(0eb254477a9479541291e43e415310852a0f0bed) ) /* Plane 2,3 */
6176   ROM_LOAD16_BYTE( "2k3-c3.bin", 0x1000000, 0x800000, CRC(d334fdd9) SHA1(1efe30b4f56a55e25ab518cf6999de797b5e407c) ) /* Plane 0,1 */
6177   ROM_LOAD16_BYTE( "2k3-c4.bin", 0x1000001, 0x800000, CRC(0d457699) SHA1(ec73d0c9fc7094d0ac6c0986a6e07cde25893e57) ) /* Plane 2,3 */
6178   ROM_LOAD16_BYTE( "2k3-c5.bin", 0x2000000, 0x800000, CRC(8a91aae4) SHA1(802f4baacf801646be1ef686e105b2e867a6a5df) ) /* Plane 0,1 */
6179   ROM_LOAD16_BYTE( "2k3-c6.bin", 0x2000001, 0x800000, CRC(9f8674b8) SHA1(65964f40b2227d020023fb436579927e65807dcd) ) /* Plane 2,3 */
6180   ROM_LOAD16_BYTE( "2k3-c7.bin", 0x3000000, 0x800000, CRC(374ea523) SHA1(613827d72c6181f3e08353750c9af0c4dbad020b) ) /* Plane 0,1 */
6181   ROM_LOAD16_BYTE( "2k3-c8.bin", 0x3000001, 0x800000, CRC(75211f4d) SHA1(d82f044e816ee539ff131d9c931200c818d34cd0) ) /* Plane 2,3 */
60736182ROM_END
60746183
60756184
6076ROM_START( kf2k3bla )
6185ROM_START( kf2k3bla ) /* bootleg */
60776186   ROM_REGION( 0x700000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
60786187   ROM_LOAD16_WORD_SWAP( "271-p1bl.rom", 0x000000, 0x100000, CRC(4ea414dd) SHA1(c242c9709c20a8cde3ad562adbe640a5dd5abcf1) )
60796188   ROM_LOAD16_WORD_SWAP( "271-p3bl.rom", 0x100000, 0x400000, CRC(370acbff) SHA1(e72544de1c5e2e4f7478fc003caba9e33a306c19) )
r2241r2242
60926201   NO_DELTAT_REGION
60936202
60946203   ROM_REGION( 0x4000000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
6095   ROM_LOAD16_BYTE( "2k3-c1.bin", 0x0000000, 0x800000, CRC(e42fc226) SHA1(1cd9364993e141facdcdd53ec2277df7b275d8a7) )
6096   ROM_LOAD16_BYTE( "2k3-c2.bin", 0x0000001, 0x800000, CRC(1b5e3b58) SHA1(0eb254477a9479541291e43e415310852a0f0bed) )
6097   ROM_LOAD16_BYTE( "2k3-c3.bin", 0x1000000, 0x800000, CRC(d334fdd9) SHA1(1efe30b4f56a55e25ab518cf6999de797b5e407c) )
6098   ROM_LOAD16_BYTE( "2k3-c4.bin", 0x1000001, 0x800000, CRC(0d457699) SHA1(ec73d0c9fc7094d0ac6c0986a6e07cde25893e57) )
6099   ROM_LOAD16_BYTE( "2k3-c5.bin", 0x2000000, 0x800000, CRC(8a91aae4) SHA1(802f4baacf801646be1ef686e105b2e867a6a5df) )
6100   ROM_LOAD16_BYTE( "2k3-c6.bin", 0x2000001, 0x800000, CRC(9f8674b8) SHA1(65964f40b2227d020023fb436579927e65807dcd) )
6101   ROM_LOAD16_BYTE( "2k3-c7.bin", 0x3000000, 0x800000, CRC(374ea523) SHA1(613827d72c6181f3e08353750c9af0c4dbad020b) )
6102   ROM_LOAD16_BYTE( "2k3-c8.bin", 0x3000001, 0x800000, CRC(75211f4d) SHA1(d82f044e816ee539ff131d9c931200c818d34cd0) )
6204   ROM_LOAD16_BYTE( "2k3-c1.bin", 0x0000000, 0x800000, CRC(e42fc226) SHA1(1cd9364993e141facdcdd53ec2277df7b275d8a7) ) /* Plane 0,1 */
6205   ROM_LOAD16_BYTE( "2k3-c2.bin", 0x0000001, 0x800000, CRC(1b5e3b58) SHA1(0eb254477a9479541291e43e415310852a0f0bed) ) /* Plane 2,3 */
6206   ROM_LOAD16_BYTE( "2k3-c3.bin", 0x1000000, 0x800000, CRC(d334fdd9) SHA1(1efe30b4f56a55e25ab518cf6999de797b5e407c) ) /* Plane 0,1 */
6207   ROM_LOAD16_BYTE( "2k3-c4.bin", 0x1000001, 0x800000, CRC(0d457699) SHA1(ec73d0c9fc7094d0ac6c0986a6e07cde25893e57) ) /* Plane 2,3 */
6208   ROM_LOAD16_BYTE( "2k3-c5.bin", 0x2000000, 0x800000, CRC(8a91aae4) SHA1(802f4baacf801646be1ef686e105b2e867a6a5df) ) /* Plane 0,1 */
6209   ROM_LOAD16_BYTE( "2k3-c6.bin", 0x2000001, 0x800000, CRC(9f8674b8) SHA1(65964f40b2227d020023fb436579927e65807dcd) ) /* Plane 2,3 */
6210   ROM_LOAD16_BYTE( "2k3-c7.bin", 0x3000000, 0x800000, CRC(374ea523) SHA1(613827d72c6181f3e08353750c9af0c4dbad020b) ) /* Plane 0,1 */
6211   ROM_LOAD16_BYTE( "2k3-c8.bin", 0x3000001, 0x800000, CRC(75211f4d) SHA1(d82f044e816ee539ff131d9c931200c818d34cd0) ) /* Plane 2,3 */
61036212ROM_END
61046213
6105ROM_START( kf2k3pl )
6214ROM_START( kf2k3pl ) /* bootleg */
61066215   ROM_REGION( 0x700000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
61076216   ROM_LOAD16_WORD_SWAP( "271-p1pl.bin", 0x000000, 0x100000, CRC(07b84112) SHA1(0b085a928a39ff9c0745a58bfa4ce6106b5f474a) )
61086217   ROM_LOAD16_WORD_SWAP( "271-p3bl.rom", 0x100000, 0x400000, CRC(370acbff) SHA1(e72544de1c5e2e4f7478fc003caba9e33a306c19) )
r2241r2242
61216230   NO_DELTAT_REGION
61226231
61236232   ROM_REGION( 0x4000000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
6124   ROM_LOAD16_BYTE( "2k3-c1.bin", 0x0000000, 0x800000, CRC(e42fc226) SHA1(1cd9364993e141facdcdd53ec2277df7b275d8a7) )
6125   ROM_LOAD16_BYTE( "2k3-c2.bin", 0x0000001, 0x800000, CRC(1b5e3b58) SHA1(0eb254477a9479541291e43e415310852a0f0bed) )
6126   ROM_LOAD16_BYTE( "2k3-c3.bin", 0x1000000, 0x800000, CRC(d334fdd9) SHA1(1efe30b4f56a55e25ab518cf6999de797b5e407c) )
6127   ROM_LOAD16_BYTE( "2k3-c4.bin", 0x1000001, 0x800000, CRC(0d457699) SHA1(ec73d0c9fc7094d0ac6c0986a6e07cde25893e57) )
6128   ROM_LOAD16_BYTE( "2k3-c5.bin", 0x2000000, 0x800000, CRC(8a91aae4) SHA1(802f4baacf801646be1ef686e105b2e867a6a5df) )
6129   ROM_LOAD16_BYTE( "2k3-c6.bin", 0x2000001, 0x800000, CRC(9f8674b8) SHA1(65964f40b2227d020023fb436579927e65807dcd) )
6130   ROM_LOAD16_BYTE( "2k3-c7.bin", 0x3000000, 0x800000, CRC(374ea523) SHA1(613827d72c6181f3e08353750c9af0c4dbad020b) )
6131   ROM_LOAD16_BYTE( "2k3-c8.bin", 0x3000001, 0x800000, CRC(75211f4d) SHA1(d82f044e816ee539ff131d9c931200c818d34cd0) )
6233   ROM_LOAD16_BYTE( "2k3-c1.bin", 0x0000000, 0x800000, CRC(e42fc226) SHA1(1cd9364993e141facdcdd53ec2277df7b275d8a7) ) /* Plane 0,1 */
6234   ROM_LOAD16_BYTE( "2k3-c2.bin", 0x0000001, 0x800000, CRC(1b5e3b58) SHA1(0eb254477a9479541291e43e415310852a0f0bed) ) /* Plane 2,3 */
6235   ROM_LOAD16_BYTE( "2k3-c3.bin", 0x1000000, 0x800000, CRC(d334fdd9) SHA1(1efe30b4f56a55e25ab518cf6999de797b5e407c) ) /* Plane 0,1 */
6236   ROM_LOAD16_BYTE( "2k3-c4.bin", 0x1000001, 0x800000, CRC(0d457699) SHA1(ec73d0c9fc7094d0ac6c0986a6e07cde25893e57) ) /* Plane 2,3 */
6237   ROM_LOAD16_BYTE( "2k3-c5.bin", 0x2000000, 0x800000, CRC(8a91aae4) SHA1(802f4baacf801646be1ef686e105b2e867a6a5df) ) /* Plane 0,1 */
6238   ROM_LOAD16_BYTE( "2k3-c6.bin", 0x2000001, 0x800000, CRC(9f8674b8) SHA1(65964f40b2227d020023fb436579927e65807dcd) ) /* Plane 2,3 */
6239   ROM_LOAD16_BYTE( "2k3-c7.bin", 0x3000000, 0x800000, CRC(374ea523) SHA1(613827d72c6181f3e08353750c9af0c4dbad020b) ) /* Plane 0,1 */
6240   ROM_LOAD16_BYTE( "2k3-c8.bin", 0x3000001, 0x800000, CRC(75211f4d) SHA1(d82f044e816ee539ff131d9c931200c818d34cd0) ) /* Plane 2,3 */
61326241ROM_END
61336242
6134ROM_START( kf2k3upl )
6243ROM_START( kf2k3upl ) /* bootleg */
61356244   ROM_REGION( 0x800000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
61366245   ROM_LOAD16_WORD_SWAP( "2k3-p1up.bin", 0x000000, 0x800000, CRC(87294c01) SHA1(21420415a6b2ba1b43ecc1934270dc085d6bd7d9) )
61376246
r2241r2242
61486257   NO_DELTAT_REGION
61496258
61506259   ROM_REGION( 0x4000000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
6151   ROM_LOAD16_BYTE( "2k3-c1.bin", 0x0000000, 0x800000, CRC(e42fc226) SHA1(1cd9364993e141facdcdd53ec2277df7b275d8a7) )
6152   ROM_LOAD16_BYTE( "2k3-c2.bin", 0x0000001, 0x800000, CRC(1b5e3b58) SHA1(0eb254477a9479541291e43e415310852a0f0bed) )
6153   ROM_LOAD16_BYTE( "2k3-c3.bin", 0x1000000, 0x800000, CRC(d334fdd9) SHA1(1efe30b4f56a55e25ab518cf6999de797b5e407c) )
6154   ROM_LOAD16_BYTE( "2k3-c4.bin", 0x1000001, 0x800000, CRC(0d457699) SHA1(ec73d0c9fc7094d0ac6c0986a6e07cde25893e57) )
6155   ROM_LOAD16_BYTE( "2k3-c5.bin", 0x2000000, 0x800000, CRC(8a91aae4) SHA1(802f4baacf801646be1ef686e105b2e867a6a5df) )
6156   ROM_LOAD16_BYTE( "2k3-c6.bin", 0x2000001, 0x800000, CRC(9f8674b8) SHA1(65964f40b2227d020023fb436579927e65807dcd) )
6157   ROM_LOAD16_BYTE( "2k3-c7.bin", 0x3000000, 0x800000, CRC(374ea523) SHA1(613827d72c6181f3e08353750c9af0c4dbad020b) )
6158   ROM_LOAD16_BYTE( "2k3-c8.bin", 0x3000001, 0x800000, CRC(75211f4d) SHA1(d82f044e816ee539ff131d9c931200c818d34cd0) )
6260   ROM_LOAD16_BYTE( "2k3-c1.bin", 0x0000000, 0x800000, CRC(e42fc226) SHA1(1cd9364993e141facdcdd53ec2277df7b275d8a7) ) /* Plane 0,1 */
6261   ROM_LOAD16_BYTE( "2k3-c2.bin", 0x0000001, 0x800000, CRC(1b5e3b58) SHA1(0eb254477a9479541291e43e415310852a0f0bed) ) /* Plane 2,3 */
6262   ROM_LOAD16_BYTE( "2k3-c3.bin", 0x1000000, 0x800000, CRC(d334fdd9) SHA1(1efe30b4f56a55e25ab518cf6999de797b5e407c) ) /* Plane 0,1 */
6263   ROM_LOAD16_BYTE( "2k3-c4.bin", 0x1000001, 0x800000, CRC(0d457699) SHA1(ec73d0c9fc7094d0ac6c0986a6e07cde25893e57) ) /* Plane 2,3 */
6264   ROM_LOAD16_BYTE( "2k3-c5.bin", 0x2000000, 0x800000, CRC(8a91aae4) SHA1(802f4baacf801646be1ef686e105b2e867a6a5df) ) /* Plane 0,1 */
6265   ROM_LOAD16_BYTE( "2k3-c6.bin", 0x2000001, 0x800000, CRC(9f8674b8) SHA1(65964f40b2227d020023fb436579927e65807dcd) ) /* Plane 2,3 */
6266   ROM_LOAD16_BYTE( "2k3-c7.bin", 0x3000000, 0x800000, CRC(374ea523) SHA1(613827d72c6181f3e08353750c9af0c4dbad020b) ) /* Plane 0,1 */
6267   ROM_LOAD16_BYTE( "2k3-c8.bin", 0x3000001, 0x800000, CRC(75211f4d) SHA1(d82f044e816ee539ff131d9c931200c818d34cd0) ) /* Plane 2,3 */
61596268ROM_END
61606269
61616270
r2241r2242
62736382   ROM_LOAD16_BYTE( "272-c8.bin", 0x3000001, 0x800000, CRC(d49773cd) SHA1(cd8cf3b762d381c1f8f12919579c84a7ef7efb3f) ) /* Plane 2,3 */
62746383ROM_END
62756384
6276
62776385ROM_START( jockeygp )
62786386   ROM_REGION( 0x200000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
62796387   ROM_LOAD16_WORD_SWAP( "jgp-p1.bin", 0x000000, 0x100000, CRC(2fb7f388) SHA1(e3c9b03944b4c10cf5081caaf9c8be1f08c06493) )
r2241r2242
63006408
63016409   ROM_REGION( 0x1000000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
63026410   /* Encrypted */
6303   ROM_LOAD16_BYTE( "jgp-c1.bin", 0x0000000, 0x800000, CRC(a9acbf18) SHA1(d55122c70cbe78c2679598dc07863e1d1d1a31df) )
6304   ROM_LOAD16_BYTE( "jgp-c2.bin", 0x0000001, 0x800000, CRC(6289eef9) SHA1(a2ede77bb2468a2e1486d74745a22a5451026039) )
6411   ROM_LOAD16_BYTE( "jgp-c1.bin", 0x0000000, 0x800000, CRC(a9acbf18) SHA1(d55122c70cbe78c2679598dc07863e1d1d1a31df) ) /* Plane 0,1 */
6412   ROM_LOAD16_BYTE( "jgp-c2.bin", 0x0000001, 0x800000, CRC(6289eef9) SHA1(a2ede77bb2468a2e1486d74745a22a5451026039) ) /* Plane 2,3 */
63056413ROM_END
63066414
63076415ROM_START( vliner )
r2241r2242
66436751   NO_DELTAT_REGION
66446752
66456753   ROM_REGION( 0x400000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
6646   ROM_LOAD16_BYTE( "dig_c1.rom", 0x000000, 0x080000, CRC(3db0a4ed) SHA1(6214faa883d97ea05809b6af7e0c85a236a18a28) )
6647   ROM_LOAD16_BYTE( "dig_c2.rom", 0x000001, 0x080000, CRC(3e632161) SHA1(83711c4286fb1d9f3f91414ac6e5fed36618033e) )
6754   ROM_LOAD16_BYTE( "dig_c1.rom", 0x000000, 0x080000, CRC(3db0a4ed) SHA1(6214faa883d97ea05809b6af7e0c85a236a18a28) ) /* Plane 0,1 */
6755   ROM_LOAD16_BYTE( "dig_c2.rom", 0x000001, 0x080000, CRC(3e632161) SHA1(83711c4286fb1d9f3f91414ac6e5fed36618033e) ) /* Plane 2,3 */
66486756ROM_END
66496757
66506758
r2241r2242
72167324GAME( 1991, burningf, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Burning Fight (set 1)", 0 )
72177325GAME( 1991, burningh, burningf, neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Burning Fight (set 2)", 0 )
72187326GAME( 1990, lbowling, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "League Bowling", 0 )
7219GAME( 1991, gpilots,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Ghost Pilots", 0 )
7327GAME( 1991, gpilots,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Ghost Pilots (set 1)", 0 )
7328GAME( 1991, gpilotsh, gpilots,  neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Ghost Pilots (set 2)", 0 )
72207329GAME( 1990, joyjoy,   neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Puzzled / Joy Joy Kid", 0 )
72217330GAME( 1991, quizdais, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Quiz Daisousa Sen - The Last Count Down", 0 )
72227331GAME( 1992, lresort,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Last Resort", 0 )
r2241r2242
72287337GAME( 1991, socbrawl, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Soccer Brawl (set 1)", 0 )
72297338GAME( 1991, socbrala, socbrawl, neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Soccer Brawl (set 2)", 0 )
72307339GAME( 1991, fatfury1, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Fatal Fury - King of Fighters / Garou Densetsu - shukumei no tatakai", 0 )
7231GAME( 1991, roboarmy, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Robo Army (set 1)", 0 )
7232GAME( 1991, roboarma, roboarmy, neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Robo Army (set 2)", 0 )
7340GAME( 1991, roboarmy, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Robo Army", 0 )
7341//GAME( 1991, roboarma, roboarmy, neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Robo Army (set 2)", 0 )
72337342GAME( 1992, fbfrenzy, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Football Frenzy", 0 )
72347343GAME( 1992, kotm2,    neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "King of the Monsters 2 - The Next Thing", 0 )
72357344GAME( 1993, sengoku2, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Sengoku 2 / Sengoku Denshou 2", 0 )
r2241r2242
72377346GAME( 1992, quizdai2, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Quiz Meitantei Neo & Geo - Quiz Daisousa Sen part 2", 0 )
72387347GAME( 1993, 3countb,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "3 Count Bout / Fire Suplex", 0 )
72397348GAME( 1992, aof,      neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Art of Fighting / Ryuuko no Ken", 0 )
7240GAME( 1993, samsho,   neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Samurai Shodown / Samurai Spirits", 0 )
7349GAME( 1993, samsho,   neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Samurai Shodown / Samurai Spirits (set 1)", 0 )
7350GAME( 1993, samshoh,  samsho,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Samurai Shodown / Samurai Spirits (set 2)", 0 )
72417351GAME( 1994, tophuntr, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Top Hunter - Roddy & Cathy (set 1)", 0 )
72427352GAME( 1994, tophunta, tophuntr, neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Top Hunter - Roddy & Cathy (set 2)", 0 )
72437353GAME( 1992, fatfury2, neogeo,   neogeo,   neogeo,   fatfury2, ROT0, "SNK", "Fatal Fury 2 / Garou Densetsu 2 - arata-naru tatakai", 0 )
r2241r2242
73327442GAME( 2003, samsho5h, samsho5,  neogeo,   neogeo,   samsho5,  ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V / Samurai Spirits Zero (set 2)", 0 )
73337443GAME( 2003, samsho5b, samsho5,  neogeo,   neogeo,   samsho5b, ROT0, "bootleg", "Samurai Shodown V / Samurai Spirits Zero (bootleg)", 0 ) // different program scrambling
73347444GAME( 2003, kf2k3pcb, 0,        neogeo,   neogeo,   kf2k3pcb, ROT0, "SNK Playmore", "The King of Fighters 2003 (Japan, JAMMA PCB)", 0 ) // not a clone of neogeo because it's NOT a neogeo cart.
7335GAME( 2003, kof2003,  neogeo,   neogeo,   neogeo,   kof2003,  ROT0, "SNK Playmore", "The King of Fighters 2003 (World / US, MVS)", 0 )
7445GAME( 2003, kof2003,  neogeo,   neogeo,   neogeo,   kof2003,  ROT0, "SNK Playmore", "The King of Fighters 2003", 0 )
73367446GAME( 2003, kf2k3bl,  kof2003,  neogeo,   neogeo,   kof2003b, ROT0, "bootleg", "The King of Fighters 2003 (bootleg set 1)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart (unless it was a bootleg pcb with the new bios?)
73377447GAME( 2003, kf2k3bla, kof2003,  neogeo,   neogeo,   kof2k3pl, ROT0, "bootleg", "The King of Fighters 2003 (bootleg set 2)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart
73387448GAME( 2003, kf2k3pl,  kof2003,  neogeo,   neogeo,   kof2k3pl, ROT0, "bootleg", "The King of Fighters 2004 Plus / Hero (The King of Fighters 2003 bootleg)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart
src/mame/drivers/gradius3.c
r2241r2242
4040
4141static WRITE16_HANDLER( K052109_halfword_w )
4242{
43   if (ACCESSING_LSB)
43   if (ACCESSING_BITS_0_7)
4444      K052109_w(machine,offset,data & 0xff);
4545
4646   /* is this a bug in the game or something else? */
47   if (!ACCESSING_LSB)
47   if (!ACCESSING_BITS_0_7)
4848      K052109_w(machine,offset,(data >> 8) & 0xff);
4949//      logerror("%06x half %04x = %04x\n",activecpu_get_pc(),offset,data);
5050}
r2241r2242
5656
5757static WRITE16_HANDLER( K051937_halfword_w )
5858{
59   if (ACCESSING_LSB)
59   if (ACCESSING_BITS_0_7)
6060      K051937_w(machine,offset,data & 0xff);
6161}
6262
r2241r2242
6767
6868static WRITE16_HANDLER( K051960_halfword_w )
6969{
70   if (ACCESSING_LSB)
70   if (ACCESSING_BITS_0_7)
7171      K051960_w(machine,offset,data & 0xff);
7272}
7373
r2241r2242
8686
8787static WRITE16_HANDLER( cpuA_ctrl_w )
8888{
89   if (ACCESSING_MSB)
89   if (ACCESSING_BITS_8_15)
9090   {
9191      data >>= 8;
9292
r2241r2242
110110
111111static WRITE16_HANDLER( cpuB_irqenable_w )
112112{
113   if (ACCESSING_MSB)
113   if (ACCESSING_BITS_8_15)
114114      irqBmask = (data >> 8) & 0x07;
115115}
116116
r2241r2242
147147
148148static WRITE16_HANDLER( sound_command_w )
149149{
150   if (ACCESSING_MSB)
150   if (ACCESSING_BITS_8_15)
151151      soundlatch_w(machine,0,(data >> 8) & 0xff);
152152}
153153
src/mame/drivers/mystwarr.c
r2241r2242
117117
118118static READ16_HANDLER( mweeprom_r )
119119{
120   if (ACCESSING_LSB)
120   if (ACCESSING_BITS_0_7)
121121   {
122122      int res = readinputport(1) | EEPROM_read_bit();
123123
r2241r2242
137137
138138static READ16_HANDLER( vseeprom_r )
139139{
140   if (ACCESSING_LSB)
140   if (ACCESSING_BITS_0_7)
141141   {
142142      int res = readinputport(1) | EEPROM_read_bit();
143143
r2241r2242
157157
158158static WRITE16_HANDLER( mweeprom_w )
159159{
160   if (ACCESSING_MSB)
160   if (ACCESSING_BITS_8_15)
161161   {
162162      EEPROM_write_bit((data&0x0100) ? 1 : 0);
163163      EEPROM_set_cs_line((data&0x0200) ? CLEAR_LINE : ASSERT_LINE);
r2241r2242
171171
172172static READ16_HANDLER( dddeeprom_r )
173173{
174   if (ACCESSING_MSB)
174   if (ACCESSING_BITS_8_15)
175175   {
176176      return (readinputport(1) | EEPROM_read_bit())<<8;
177177   }
r2241r2242
181181
182182static WRITE16_HANDLER( mmeeprom_w )
183183{
184   if (ACCESSING_LSB)
184   if (ACCESSING_BITS_0_7)
185185   {
186186      EEPROM_write_bit((data&0x01) ? 1 : 0);
187187      EEPROM_set_cs_line((data&0x02) ? CLEAR_LINE : ASSERT_LINE);
r2241r2242
305305{
306306   K056832_b_word_w(machine, offset, data, mem_mask);
307307
308   if (offset == 3 && ACCESSING_LSB)
308   if (offset == 3 && ACCESSING_BITS_0_7)
309309   {
310310      mw_irq_control = data&0xff;
311311
r2241r2242
582582
583583static WRITE16_HANDLER( mccontrol_w )
584584{
585   if (ACCESSING_MSB)
585   if (ACCESSING_BITS_8_15)
586586   {
587587      mw_irq_control = data>>8;
588588      // bit 0 = watchdog
src/mame/drivers/klax.c
r2241r2242
8989
9090static WRITE16_HANDLER( adpcm_w )
9191{
92   if (ACCESSING_LSB)
92   if (ACCESSING_BITS_0_7)
9393      OKIM6295_data_0_w(machine, offset, data & 0xff);
9494}
9595
src/mame/drivers/djmain.c
r2241r2242
9696
9797static WRITE32_HANDLER( sndram_bank_w )
9898{
99   if (ACCESSING_MSW32)
99   if (ACCESSING_BITS_16_31)
100100   {
101101      sndram_bank = (data >> 16) & 0x1f;
102102      sndram_set_bank();
r2241r2242
107107{
108108   UINT32 data = 0;
109109
110   if ((mem_mask & 0xff000000) == 0)
110   if (ACCESSING_BITS_24_31)
111111      data |= sndram[offset * 4] << 24;
112112
113   if ((mem_mask & 0x00ff0000) == 0)
113   if (ACCESSING_BITS_16_23)
114114      data |= sndram[offset * 4 + 1] << 16;
115115
116   if ((mem_mask & 0x0000ff00) == 0)
116   if (ACCESSING_BITS_8_15)
117117      data |= sndram[offset * 4 + 2] << 8;
118118
119   if ((mem_mask & 0x000000ff) == 0)
119   if (ACCESSING_BITS_0_7)
120120      data |= sndram[offset * 4 + 3];
121121
122122   return data;
r2241r2242
124124
125125static WRITE32_HANDLER( sndram_w )
126126{
127   if ((mem_mask & 0xff000000) == 0)
127   if (ACCESSING_BITS_24_31)
128128      sndram[offset * 4] = data >> 24;
129129
130   if ((mem_mask & 0x00ff0000) == 0)
130   if (ACCESSING_BITS_16_23)
131131      sndram[offset * 4 + 1] = data >> 16;
132132
133   if ((mem_mask & 0x0000ff00) == 0)
133   if (ACCESSING_BITS_8_15)
134134      sndram[offset * 4 + 2] = data >> 8;
135135
136   if ((mem_mask & 0x000000ff) == 0)
136   if (ACCESSING_BITS_0_7)
137137      sndram[offset * 4 + 3] = data;
138138}
139139
r2241r2242
144144{
145145   UINT16 ret = 0;
146146
147   if (ACCESSING_LSB16)
147   if (ACCESSING_BITS_0_7)
148148      ret |= K054539_1_r(machine, offset);
149   if (ACCESSING_MSB16)
149   if (ACCESSING_BITS_8_15)
150150      ret |= K054539_0_r(machine, offset)<<8;
151151
152152   return ret;
r2241r2242
154154
155155static WRITE16_HANDLER( dual539_16_w )
156156{
157   if (ACCESSING_LSB16)
157   if (ACCESSING_BITS_0_7)
158158      K054539_1_w(machine, offset, data);
159   if (ACCESSING_MSB16)
159   if (ACCESSING_BITS_8_15)
160160      K054539_0_w(machine, offset, data>>8);
161161}
162162
r2241r2242
164164{
165165   UINT32 data = 0;
166166
167   if (~mem_mask & 0xffff0000)
167   if (ACCESSING_BITS_16_31)
168168      data |= dual539_16_r(machine, offset * 2, mem_mask >> 16) << 16;
169   if (~mem_mask & 0x0000ffff)
169   if (ACCESSING_BITS_0_15)
170170      data |= dual539_16_r(machine, offset * 2 + 1, mem_mask);
171171
172172   return data;
r2241r2242
174174
175175static WRITE32_HANDLER( dual539_w )
176176{
177   if (~mem_mask & 0xffff0000)
177   if (ACCESSING_BITS_16_31)
178178      dual539_16_w(machine, offset * 2, data >> 16, mem_mask >> 16);
179   if (~mem_mask & 0x0000ffff)
179   if (ACCESSING_BITS_0_15)
180180      dual539_16_w(machine, offset * 2 + 1, data, mem_mask);
181181}
182182
r2241r2242
206206   offset += bank * 0x200;
207207   offset *= 4;
208208
209   if (~mem_mask & 0x0000ffff)
209   if (ACCESSING_BITS_0_15)
210210      offset += 2;
211211
212212   if (~mem_mask & 0xff00ff00)
r2241r2242
220220
221221static WRITE32_HANDLER( v_ctrl_w )
222222{
223   if (ACCESSING_MSW32)
223   if (ACCESSING_BITS_16_31)
224224   {
225225      data >>= 16;
226226      mem_mask >>= 16;
r2241r2242
241241
242242   offset *= 2;
243243
244   if (!ACCESSING_MSB32)
244   if (!ACCESSING_BITS_24_31)
245245      offset += 1;
246246
247247   offset += bank * 0x800 * 4;
r2241r2242
271271{
272272   UINT32 result = 0;
273273
274   if (!(mem_mask & 0x0000ff00))
274   if (ACCESSING_BITS_8_15)
275275   {
276276      UINT8 pos;
277277      int delta;
r2241r2242
294294
295295static WRITE32_HANDLER( turntable_select_w )
296296{
297   if (!(mem_mask & 0x00ff0000))
297   if (ACCESSING_BITS_16_23)
298298      turntable_select = (data >> 19) & 1;
299299}
300300
r2241r2242
306306
307307static READ32_HANDLER( ide_std_r )
308308{
309   if (ACCESSING_LSB32)
309   if (ACCESSING_BITS_0_7)
310310      return ide_controller16_0_r(machine, IDE_STD_OFFSET + offset, 0x00ff) >> 8;
311311   else
312312      return ide_controller16_0_r(machine, IDE_STD_OFFSET + offset, 0x0000) << 16;
r2241r2242
314314
315315static WRITE32_HANDLER( ide_std_w )
316316{
317   if (ACCESSING_LSB32)
317   if (ACCESSING_BITS_0_7)
318318      ide_controller16_0_w(machine, IDE_STD_OFFSET + offset, data << 8, 0x00ff);
319319   else
320320      ide_controller16_0_w(machine, IDE_STD_OFFSET + offset, data >> 16, 0x0000);
r2241r2242
331331
332332static WRITE32_HANDLER( ide_alt_w )
333333{
334   if (offset == 0 && !(mem_mask & 0x00ff0000))
334   if (offset == 0 && ACCESSING_BITS_16_23)
335335      ide_controller16_0_w(machine, IDE_ALT_OFFSET, data >> 24, 0xff00);
336336}
337337
r2241r2242
371371
372372static WRITE32_HANDLER( light_ctrl_1_w )
373373{
374   if (ACCESSING_MSW32)
374   if (ACCESSING_BITS_16_31)
375375   {
376376      output_set_value("right-red-hlt",  !(data & 0x08000000));   // Right red HIGHLIGHT
377377      output_set_value("left-red-hlt",   !(data & 0x04000000));   // Left red HIGHLIGHT
r2241r2242
382382
383383static WRITE32_HANDLER( light_ctrl_2_w )
384384{
385   if (ACCESSING_MSW32)
385   if (ACCESSING_BITS_16_31)
386386   {
387387      output_set_value("left-ssr",       !!(data & 0x08000000));   // SSR
388388      output_set_value("right-ssr",      !!(data & 0x08000000));   // SSR
src/mame/drivers/segas24.c
r2241r2242
409409   if(!track_size)
410410      return;
411411
412   if(ACCESSING_LSB) {
412   if(ACCESSING_BITS_0_7) {
413413      data &= 0xff;
414414      switch(offset) {
415415      case 0:
r2241r2242
499499
500500static WRITE16_HANDLER( fdc_ctrl_w )
501501{
502   if(ACCESSING_LSB)
502   if(ACCESSING_BITS_0_7)
503503      logerror("FDC control %02x\n", data & 0xff);
504504}
505505
r2241r2242
634634
635635static WRITE16_HANDLER( hotrod3_ctrl_w )
636636{
637   if(ACCESSING_LSB) {
637   if(ACCESSING_BITS_0_7) {
638638      data &= 3;
639639      hotrod_ctrl_cur = readinputport(9+data);
640640   }
r2241r2242
642642
643643static READ16_HANDLER( hotrod3_ctrl_r )
644644{
645   if(ACCESSING_LSB) {
645   if(ACCESSING_BITS_0_7) {
646646      switch(offset) {
647647         // Steering dials
648648      case 0:
r2241r2242
735735
736736static WRITE16_HANDLER( curbank_w )
737737{
738   if(ACCESSING_LSB) {
738   if(ACCESSING_BITS_0_7) {
739739      curbank = data & 0xff;
740740      reset_bank();
741741   }
r2241r2242
751751
752752static WRITE16_HANDLER( ym_register_w )
753753{
754   if(ACCESSING_LSB)
754   if(ACCESSING_BITS_0_7)
755755      YM2151_register_port_0_w(machine, 0, data);
756756}
757757
758758static WRITE16_HANDLER( ym_data_w )
759759{
760   if(ACCESSING_LSB)
760   if(ACCESSING_BITS_0_7)
761761      YM2151_data_port_0_w(machine, 0, data);
762762}
763763
r2241r2242
782782
783783static WRITE16_HANDLER( mlatch_w )
784784{
785   if(ACCESSING_LSB) {
785   if(ACCESSING_BITS_0_7) {
786786      int i;
787787      UINT8 mxor = 0;
788788      if(!mlatch_table) {
r2241r2242
861861      break;
862862   }
863863   case 1:
864      if(ACCESSING_LSB) {
864      if(ACCESSING_BITS_0_7) {
865865         UINT8 old_tb = irq_timerb;
866866         irq_timerb = data;
867867         if(old_tb != irq_timerb)
r2241r2242
870870      break;
871871   case 2:
872872      irq_allow0 = data;
873      cpunum_set_input_line(Machine, 0, IRQ_TIMER+1, irq_timer_pend0 && (irq_allow0 & (1 << IRQ_TIMER)) ? ASSERT_LINE : CLEAR_LINE);
874      cpunum_set_input_line(Machine, 0, IRQ_YM2151+1, irq_yms && (irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE);
873      cpunum_set_input_line(machine, 0, IRQ_TIMER+1, irq_timer_pend0 && (irq_allow0 & (1 << IRQ_TIMER)) ? ASSERT_LINE : CLEAR_LINE);
874      cpunum_set_input_line(machine, 0, IRQ_YM2151+1, irq_yms && (irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE);
875875      break;
876876   case 3:
877877      irq_allow1 = data;
878      cpunum_set_input_line(Machine, 1, IRQ_TIMER+1, irq_timer_pend1 && (irq_allow1 & (1 << IRQ_TIMER)) ? ASSERT_LINE : CLEAR_LINE);
879      cpunum_set_input_line(Machine, 1, IRQ_YM2151+1, irq_yms && (irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE);
878      cpunum_set_input_line(machine, 1, IRQ_TIMER+1, irq_timer_pend1 && (irq_allow1 & (1 << IRQ_TIMER)) ? ASSERT_LINE : CLEAR_LINE);
879      cpunum_set_input_line(machine, 1, IRQ_YM2151+1, irq_yms && (irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE);
880880      break;
881881   }
882882}
r2241r2242
896896   /* These hacks are for Gain Ground */
897897   /* otherwise the interrupt occurs before the correct state has been
898898       set and the game crashes before booting */
899   if (!strcmp(Machine->gamedrv->name,"gground"))
899   if (!strcmp(machine->gamedrv->name,"gground"))
900900   {
901901
902902      if (activecpu_get_pc()==0x0084aa)
903903      {
904904         ggground_kludge = 1;
905         return mame_rand(Machine);
905         return mame_rand(machine);
906906
907907      }
908908      if (activecpu_get_pc()==0x084ba)
909909      {
910910         /* Clear IRQ line so IRQ doesn't happen too early */
911         cpunum_set_input_line(Machine, 1, 5, CLEAR_LINE);
911         cpunum_set_input_line(machine, 1, 5, CLEAR_LINE);
912912
913913         /* set a timer to generate an irq at the needed point */
914914         if (ggground_kludge == 1)
r2241r2242
920920      }
921921   }
922922
923   if (!strcmp(Machine->gamedrv->name,"ggroundj"))
923   if (!strcmp(machine->gamedrv->name,"ggroundj"))
924924   {
925925
926926      if (activecpu_get_pc()==0x0084ac)
927927      {
928928         ggground_kludge = 1;
929         return mame_rand(Machine);
929         return mame_rand(machine);
930930
931931      }
932932      if (activecpu_get_pc()==0x084bc)
933933      {
934934         /* Clear IRQ line so IRQ doesn't happen too early */
935         cpunum_set_input_line(Machine, 1, 5, CLEAR_LINE);
935         cpunum_set_input_line(machine, 1, 5, CLEAR_LINE);
936936
937937         /* set a timer to generate an irq at the needed point */
938938         if (ggground_kludge == 1)
r2241r2242
947947   switch(offset) {
948948   case 2:
949949      irq_timer_pend0 = 0;
950      cpunum_set_input_line(Machine, 0, IRQ_TIMER+1, CLEAR_LINE);
950      cpunum_set_input_line(machine, 0, IRQ_TIMER+1, CLEAR_LINE);
951951      break;
952952   case 3:
953953      irq_timer_pend1 = 0;
954      cpunum_set_input_line(Machine, 1, IRQ_TIMER+1, CLEAR_LINE);
954      cpunum_set_input_line(machine, 1, IRQ_TIMER+1, CLEAR_LINE);
955955      break;
956956   }
957957   return 0xffff;
src/mame/drivers/segas16a.c
r2241r2242
297297      case 0x0000/2:
298298         /* the port C handshaking signals control the Z80 NMI, */
299299         /* so we have to sync whenever we access this PPI */
300         if (ACCESSING_LSB)
300         if (ACCESSING_BITS_0_7)
301301            timer_call_after_resynch(NULL, ((offset & 3) << 8) | (data & 0xff), delayed_ppi8255_w);
302302         return;
303303   }
src/mame/drivers/neogeo.c
r2241r2242
524524
525525static WRITE16_HANDLER( memcard_w )
526526{
527   if (ACCESSING_LSB)
527   if (ACCESSING_BITS_0_7)
528528   {
529529      if (memcard_present() != -1)
530530         memcard_data[offset] = data;
r2241r2242
810810
811811static WRITE16_HANDLER( system_control_w )
812812{
813   if ((mem_mask & 0x00ff) != 0x00ff)
813   if (ACCESSING_BITS_0_7)
814814   {
815815      UINT8 bit = (offset >> 3) & 0x01;
816816
r2241r2242
875875static WRITE16_HANDLER( watchdog_w )
876876{
877877   /* only an LSB write resets the watchdog */
878   if (ACCESSING_LSB)
878   if (ACCESSING_BITS_0_7)
879879   {
880880      watchdog_reset16_w(machine, offset, data, mem_mask);
881881   }
src/mame/drivers/konamigx.c
r2241r2242
496496{
497497   UINT32 odata;
498498
499   if (!(mem_mask & 0xff000000))
499   if (ACCESSING_BITS_24_31)
500500   {
501501      odata = data >> 24;
502502      /*
r2241r2242
517517      konamigx_wrport1_0 = odata;
518518   }
519519
520   if (!(mem_mask & 0xff0000))
520   if (ACCESSING_BITS_16_23)
521521   {
522522      /*
523523          bit 7 = mask all IRQ
r2241r2242
553553   //          results.
554554   // bit 17 = DOTSEL1 : 0 = 6M, 1=8M, 2=12M, 3=16M
555555   // bit 16 = DOTSEL0
556   if (!(mem_mask & 0x00ff0000))
556   if (ACCESSING_BITS_16_23)
557557   {
558558      if (data & 0x400000)
559559      {
r2241r2242
627627   if (offset == 0x1c/4)
628628   {
629629      // vblank interrupt ACK
630      if (!(mem_mask & 0xff000000))
630      if (ACCESSING_BITS_24_31)
631631      {
632632         cpunum_set_input_line(Machine, 0, 1, CLEAR_LINE);
633633         gx_syncen |= 0x20;
634634      }
635635
636636      // hblank interrupt ACK
637      if (!(mem_mask & 0x0000ff00))
637      if (ACCESSING_BITS_8_15)
638638      {
639639         cpunum_set_input_line(Machine, 0, 2, CLEAR_LINE);
640640         gx_syncen |= 0x40;
r2241r2242
764764
765765   reg = offset << 1;
766766
767   if (!(mem_mask & 0xff000000))
767   if (ACCESSING_BITS_24_31)
768768   {
769769      MSW = sndto020[reg];
770770      if (reg == 2) MSW &= ~3; // supress VOLWR busy flags
771771      rv |= MSW<<24;
772772   }
773773
774   if (!(mem_mask & 0x0000ff00))
774   if (ACCESSING_BITS_8_15)
775775   {
776776      LSW = sndto020[reg+1];
777777      rv |= LSW<<8;
r2241r2242
832832{
833833   int reg=0, val=0;
834834
835   if (!(mem_mask & 0xff000000))
835   if (ACCESSING_BITS_24_31)
836836   {
837837      reg = offset<<1;
838838      val = data>>24;
839839      write_snd_020(reg, val);
840840   }
841841
842   if (!(mem_mask & 0x0000ff00))
842   if (ACCESSING_BITS_8_15)
843843   {
844844      reg = (offset<<1)+1;
845845      val = (data>>8)&0xff;
r2241r2242
12071207{
12081208   UINT16 ret = 0;
12091209
1210   if (ACCESSING_LSB16)
1210   if (ACCESSING_BITS_0_7)
12111211      ret |= K054539_1_r(machine, offset);
1212   if (ACCESSING_MSB16)
1212   if (ACCESSING_BITS_8_15)
12131213      ret |= K054539_0_r(machine, offset)<<8;
12141214
12151215   return ret;
r2241r2242
12171217
12181218static WRITE16_HANDLER( dual539_w )
12191219{
1220   if (ACCESSING_LSB16)
1220   if (ACCESSING_BITS_0_7)
12211221      K054539_1_w(machine, offset, data);
1222   if (ACCESSING_MSB16)
1222   if (ACCESSING_BITS_8_15)
12231223      K054539_0_w(machine, offset, data>>8);
12241224}
12251225
src/mame/drivers/segahang.c
r2241r2242
166166
167167static WRITE16_HANDLER( hangon_io_w )
168168{
169   if (ACCESSING_LSB)
169   if (ACCESSING_BITS_0_7)
170170      switch (offset & 0x3020/2)
171171      {
172172         case 0x0000/2: /* PPI @ 4B */
r2241r2242
212212
213213static WRITE16_HANDLER( sharrier_io_w )
214214{
215   if (ACCESSING_LSB)
215   if (ACCESSING_BITS_0_7)
216216      switch (offset & 0x0030/2)
217217      {
218218         case 0x0000/2:
src/mame/drivers/thunderj.c
r2241r2242
9191static WRITE16_HANDLER( latch_w )
9292{
9393   /* reset extra CPU */
94   if (ACCESSING_LSB)
94   if (ACCESSING_BITS_0_7)
9595   {
9696      /* 0 means hold CPU 2's reset low */
9797      if (data & 1)
src/mame/drivers/ultraman.c
r2241r2242
4949
5050static WRITE16_HANDLER( ultraman_K051316_0_w )
5151{
52   if (ACCESSING_LSB)
52   if (ACCESSING_BITS_0_7)
5353      K051316_0_w(machine, offset, data & 0xff);
5454}
5555
5656static WRITE16_HANDLER( ultraman_K051316_1_w )
5757{
58   if (ACCESSING_LSB)
58   if (ACCESSING_BITS_0_7)
5959      K051316_1_w(machine, offset, data & 0xff);
6060}
6161
6262static WRITE16_HANDLER( ultraman_K051316_2_w )
6363{
64   if (ACCESSING_LSB)
64   if (ACCESSING_BITS_0_7)
6565      K051316_2_w(machine, offset, data & 0xff);
6666}
6767
6868static WRITE16_HANDLER( ultraman_K051316_ctrl_0_w )
6969{
70   if (ACCESSING_LSB)
70   if (ACCESSING_BITS_0_7)
7171      K051316_ctrl_0_w(machine, offset, data & 0xff);
7272}
7373
7474static WRITE16_HANDLER( ultraman_K051316_ctrl_1_w )
7575{
76   if (ACCESSING_LSB)
76   if (ACCESSING_BITS_0_7)
7777      K051316_ctrl_1_w(machine, offset, data & 0xff);
7878
7979}
8080
8181static WRITE16_HANDLER( ultraman_K051316_ctrl_2_w )
8282{
83   if (ACCESSING_LSB)
83   if (ACCESSING_BITS_0_7)
8484      K051316_ctrl_2_w(machine, offset, data & 0xff);
8585}
8686
8787static WRITE16_HANDLER( ultraman_K051937_w )
8888{
89   if (ACCESSING_LSB)
89   if (ACCESSING_BITS_0_7)
9090      K051937_w(machine, offset, data & 0xff);
9191}
9292
9393static WRITE16_HANDLER( ultraman_K051960_w )
9494{
95   if (ACCESSING_LSB)
95   if (ACCESSING_BITS_0_7)
9696      K051960_w(machine, offset, data & 0xff);
9797}
9898
9999static WRITE16_HANDLER( sound_cmd_w )
100100{
101   if (ACCESSING_LSB)
101   if (ACCESSING_BITS_0_7)
102102      soundlatch_w(machine,0,data & 0xff);
103103}
104104
105105static WRITE16_HANDLER( sound_irq_trigger_w )
106106{
107   if (ACCESSING_LSB)
107   if (ACCESSING_BITS_0_7)
108108      cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE);
109109}
110110
src/mame/drivers/quantum.c
r2241r2242
9191
9292static WRITE16_HANDLER( led_w )
9393{
94   if (ACCESSING_LSB)
94   if (ACCESSING_BITS_0_7)
9595   {
9696      /* bits 0 and 1 are coin counters */
9797      coin_counter_w(0, data & 2);
src/mame/drivers/blueprnt.c
r2241r2242
4848    - the cross hatch pattern test in service mode is too fast, each phase
4949      should take 15 seconds according to the service manual
5050
51
52    DIP locations verified for:
53    - blueprnt (manual)
54
5155*/
5256
5357#include "driver.h"
r2241r2242
122126/* Input Ports */
123127
124128static INPUT_PORTS_START( blueprnt )
125   PORT_START_TAG("PORT 0")
129   PORT_START_TAG("IN0")
126130   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
127131   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )
128132   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )
r2241r2242
132136   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    ) PORT_8WAY
133137   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  ) PORT_8WAY
134138
135   PORT_START_TAG("PORT 1")
139   PORT_START_TAG("IN1")
136140   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 )
137141   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
138142   PORT_SERVICE( 0x04, IP_ACTIVE_HIGH )
r2241r2242
143147   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  ) PORT_8WAY PORT_COCKTAIL
144148
145149   PORT_START_TAG("DILSW1")
146   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
147   PORT_DIPNAME( 0x06, 0x02, DEF_STR( Bonus_Life ) )
150   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "DILSW1:1" )      /* Listed as "Unused" */
151   PORT_DIPNAME( 0x06, 0x02, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("DILSW1:2,3")
148152   PORT_DIPSETTING(    0x00, "20K" )
149153   PORT_DIPSETTING(    0x02, "30K" )
150154   PORT_DIPSETTING(    0x04, "40K" )
151155   PORT_DIPSETTING(    0x06, "50K" )
152   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Free_Play ) )
156   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Free_Play ) )   PORT_DIPLOCATION("DILSW1:4")
153157   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
154158   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
155   PORT_DIPNAME( 0x10, 0x00, "Maze Monster Appears In" )
159   PORT_DIPNAME( 0x10, 0x00, "Maze Monster Appears In" ) PORT_DIPLOCATION("DILSW1:5")
156160   PORT_DIPSETTING(    0x00, "2nd Maze" )
157161   PORT_DIPSETTING(    0x10, "3rd Maze" )
158   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Coin_A ) )
162   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("DILSW1:6")
159163   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
160164   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
161   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_B ) )
165   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("DILSW1:7") /* Listed as "Unused" */
162166   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
163167   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
164   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
168   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "DILSW1:8" )      /* Listed as "Unused" */
165169
166170   PORT_START_TAG("DILSW2")
167   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
171   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )      PORT_DIPLOCATION("DILSW2:1,2")
168172   PORT_DIPSETTING(    0x00, "2" )
169173   PORT_DIPSETTING(    0x01, "3" )
170174   PORT_DIPSETTING(    0x02, "4" )
171175   PORT_DIPSETTING(    0x03, "5" )
172   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
173   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
176   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "DILSW2:3" )      /* Listed as "Unused" */
177   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("DILSW2:4")
174178   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
175179   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
176   PORT_DIPNAME( 0x30, 0x10, DEF_STR( Difficulty ) )
180   PORT_DIPNAME( 0x30, 0x10, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("DILSW2:5,6")
177181   PORT_DIPSETTING(    0x00, "Level 1" )
178182   PORT_DIPSETTING(    0x10, "Level 2" )
179183   PORT_DIPSETTING(    0x20, "Level 3" )
180184   PORT_DIPSETTING(    0x30, "Level 4" )
181   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
185   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "DILSW2:7" )      /* Listed as "Unused" */
186   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "DILSW2:8" )      /* Listed as "Unused" */
182187INPUT_PORTS_END
183188
184189static INPUT_PORTS_START( saturn )
185   PORT_START_TAG("IN0")
186   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
187   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )
190   PORT_INCLUDE( blueprnt )
191
192   PORT_MODIFY("IN0")
188193   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 )
189   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 )
190   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  ) PORT_8WAY
191   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
192   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    ) PORT_8WAY
193   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  ) PORT_8WAY
194194
195   PORT_START_TAG("IN1")
196   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 )
197   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
195   PORT_MODIFY("IN1")
198196   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
199   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
200   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  ) PORT_8WAY PORT_COCKTAIL
201   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
202   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    ) PORT_8WAY PORT_COCKTAIL
203   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  ) PORT_8WAY PORT_COCKTAIL
204197
205   PORT_START_TAG("DSW0")
206   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
207   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
208   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
209   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) )
198   PORT_MODIFY("DILSW1")
199   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "DILSW1:1" )
200   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("DILSW1:2")
210201   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
211202   PORT_DIPSETTING(    0x02, DEF_STR( Cocktail ) )
212   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
213   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
214   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
215   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
216   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
217   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
218   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
219   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
220   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
221   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
222   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
223   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
224   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Lives ) )
203   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "DILSW1:3" )
204   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "DILSW1:4" )
205   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "DILSW1:5" )
206   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "DILSW1:6" )
207   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION("DILSW1:7,8")
225208   PORT_DIPSETTING(    0x00, "3" )
226209   PORT_DIPSETTING(    0x40, "4" )
227210   PORT_DIPSETTING(    0x80, "5" )
228211   PORT_DIPSETTING(    0xc0, "6" )
229212
230   PORT_START_TAG("DSW1")
231   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
232   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
233   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
234   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Coinage ) )
213   PORT_MODIFY("DILSW2")
214   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "DILSW2:1" )
215   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Coinage ) )      PORT_DIPLOCATION("DILSW2:2")
235216   PORT_DIPSETTING(    0x02, "A 2/1 B 1/3" )
236217   PORT_DIPSETTING(    0x00, "A 1/1 B 1/6" )
237   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) )
218   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("DILSW2:3")
238219   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
239220   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
240   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
241   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
242   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
243   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
244   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
245   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
246   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
247   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
248   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
249   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
250   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
251   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
252   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
253   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
254   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
221   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "DILSW2:4" )
222   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "DILSW2:5" )
223   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "DILSW2:6" )
224   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "DILSW2:7" )
225   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "DILSW2:8" )
255226INPUT_PORTS_END
256227
257228/* Graphics Layouts */
src/mame/drivers/ttchamp.c
r2241r2242
9595    int bank;
9696    UINT8 *ROM1 = memory_region(REGION_USER1);
9797
98    if (ACCESSING_LSB)
98    if (ACCESSING_BITS_0_7)
9999    {
100100        bank = (data>>4) &0x07;
101101        memory_set_bankptr(2,&ROM1[0x80000*(bank)]);
src/mame/drivers/segac2.c
r2241r2242
192192static WRITE16_HANDLER( ym3438_w )
193193{
194194   /* only works if we're accessing the low byte */
195   if (ACCESSING_LSB)
195   if (ACCESSING_BITS_0_7)
196196   {
197197      static UINT8 last_port;
198198
r2241r2242
222222      return;
223223
224224   /* only works if we're accessing the low byte */
225   if (ACCESSING_LSB)
225   if (ACCESSING_BITS_0_7)
226226   {
227227      upd7759_port_w(0, data & 0xff);
228228      upd7759_start_w(0, 0);
r2241r2242
487487static WRITE16_HANDLER( control_w )
488488{
489489   /* skip if not LSB */
490   if (!ACCESSING_LSB)
490   if (!ACCESSING_BITS_0_7)
491491      return;
492492   data &= 0x0f;
493493
r2241r2242
534534   int table_index;
535535
536536   /* only works for the LSB */
537   if (!ACCESSING_LSB)
537   if (!ACCESSING_BITS_0_7)
538538      return;
539539
540540   /* compute the table index */
r2241r2242
575575static WRITE16_HANDLER( counter_timer_w )
576576{
577577   /* only LSB matters */
578   if (ACCESSING_LSB)
578   if (ACCESSING_BITS_0_7)
579579   {
580580      /*int value = data & 1;*/
581581      switch (data & 0x1e)
src/mame/drivers/gotcha.c
r2241r2242
9797
9898static WRITE16_HANDLER( gotcha_oki_bank_w )
9999{
100   if (ACCESSING_MSB)
100   if (ACCESSING_BITS_8_15)
101101   {
102102      OKIM6295_set_bank_base(0,(((~data & 0x0100) >> 8) * 0x40000));
103103   }
src/mame/drivers/taito_f2.c
r2241r2242
315315
316316static WRITE16_HANDLER( growl_coin_word_w )   /* what about coins 3&4 ?? */
317317{
318   if (ACCESSING_LSB)
318   if (ACCESSING_BITS_0_7)
319319   {
320320      coin_lockout_w(0, ~data & 0x01);
321321      coin_lockout_w(1, ~data & 0x02);
r2241r2242
326326
327327static WRITE16_HANDLER( taitof2_4p_coin_word_w )
328328{
329   if (ACCESSING_LSB)
329   if (ACCESSING_BITS_0_7)
330330   {
331331      coin_lockout_w(0, ~data & 0x01);
332332      coin_lockout_w(1, ~data & 0x02);
r2241r2242
341341
342342static WRITE16_HANDLER( ninjak_coin_word_w )
343343{
344   if (ACCESSING_MSB)
344   if (ACCESSING_BITS_8_15)
345345   {
346346      coin_lockout_w(0, ~data & 0x0100);
347347      coin_lockout_w(1, ~data & 0x0200);
r2241r2242
871871{
872872   static int nibble = 0;
873873
874   if (ACCESSING_MSB)
874   if (ACCESSING_BITS_8_15)
875875   {
876876      data >>= 8;
877877      if (offset==0)
src/mame/drivers/sandscrp.c
r2241r2242
138138/* Clear the cause of the interrupt */
139139static WRITE16_HANDLER( sandscrp_irq_cause_w )
140140{
141   if (ACCESSING_LSB)
141   if (ACCESSING_BITS_0_7)
142142   {
143143      kaneko16_sprite_flipx   =   data & 1;
144144      kaneko16_sprite_flipy   =   data & 1;
r2241r2242
159159
160160static WRITE16_HANDLER( sandscrp_coin_counter_w )
161161{
162   if (ACCESSING_LSB)
162   if (ACCESSING_BITS_0_7)
163163   {
164164      coin_counter_w(0,   data  & 0x0001);
165165      coin_counter_w(1,   data  & 0x0002);
r2241r2242
177177
178178static WRITE16_HANDLER( sandscrp_latchstatus_word_w )
179179{
180   if (ACCESSING_LSB)
180   if (ACCESSING_BITS_0_7)
181181   {
182182      latch1_full = data & 0x80;
183183      latch2_full = data & 0x40;
r2241r2242
192192
193193static WRITE16_HANDLER( sandscrp_soundlatch_word_w )
194194{
195   if (ACCESSING_LSB)
195   if (ACCESSING_BITS_0_7)
196196   {
197197      latch1_full = 1;
198198      soundlatch_w(machine, 0, data & 0xff);
src/mame/drivers/ddragon.c
r2241r2242
216216   if (data & 0x10)
217217      dd_sub_cpu_busy = 0;
218218   else if (dd_sub_cpu_busy == 0)
219      cpunum_set_input_line(Machine, 1, sprite_irq, (sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE);
219      cpunum_set_input_line(machine, 1, sprite_irq, (sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE);
220220
221221   memory_set_bank(1, (data & 0xe0) >> 5);
222222}
r2241r2242
244244   so just hack around the protection here.  (The hacks are 'right' as I have
245245   the original source code & notes to this version of TStrike to examine).
246246   */
247   if (!strcmp(Machine->gamedrv->name, "tstrike"))
247   if (!strcmp(machine->gamedrv->name, "tstrike"))
248248   {
249249      /* Static protection checks at boot-up */
250250      if (activecpu_get_pc() == 0x9ace)
r2241r2242
291291   if (data & 0x10)
292292      dd_sub_cpu_busy = 0;
293293   else if (dd_sub_cpu_busy == 0)
294      cpunum_set_input_line(Machine, 1, sprite_irq, (sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE);
294      cpunum_set_input_line(machine, 1, sprite_irq, (sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE);
295295
296296   memory_set_bank(1, newbank);
297297   if (newbank == 4 && oldbank != 4)
r2241r2242
313313   switch (offset)
314314   {
315315      case 0: /* 380b - NMI ack */
316         cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
316         cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
317317         break;
318318
319319      case 1: /* 380c - FIRQ ack */
320         cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, CLEAR_LINE);
320         cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, CLEAR_LINE);
321321         break;
322322
323323      case 2: /* 380d - IRQ ack */
324         cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, CLEAR_LINE);
324         cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, CLEAR_LINE);
325325         break;
326326
327327      case 3: /* 380e - SND irq */
r2241r2242
338338
339339static WRITE8_HANDLER( ddragon2_sub_irq_ack_w )
340340{
341   cpunum_set_input_line(Machine, 1, sprite_irq, CLEAR_LINE );
341   cpunum_set_input_line(machine, 1, sprite_irq, CLEAR_LINE );
342342}
343343
344344
345345static WRITE8_HANDLER( ddragon2_sub_irq_w )
346346{
347   cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, ASSERT_LINE);
347   cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, ASSERT_LINE);
348348}
349349
350350
r2241r2242
391391        it's quite obvious from the Double Dragon 2 code, below). */
392392      if (data & 3)
393393      {
394         cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, ASSERT_LINE);
395         cpunum_set_input_line(Machine, 1, sprite_irq, CLEAR_LINE);
394         cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, ASSERT_LINE);
395         cpunum_set_input_line(machine, 1, sprite_irq, CLEAR_LINE);
396396      }
397397   }
398398}
r2241r2242
570570/* might not be 100% accurate, check bits written */
571571static WRITE8_HANDLER( ddragnba_port_w )
572572{
573   cpunum_set_input_line(Machine, 0,M6809_IRQ_LINE,ASSERT_LINE);
574   cpunum_set_input_line(Machine, 1,sprite_irq, CLEAR_LINE );
573   cpunum_set_input_line(machine, 0,M6809_IRQ_LINE,ASSERT_LINE);
574   cpunum_set_input_line(machine, 1,sprite_irq, CLEAR_LINE );
575575}
576576
577577static ADDRESS_MAP_START( ddragnba_sub_portmap, ADDRESS_SPACE_IO, 8 )
r2241r2242
910910 *
911911 *************************************/
912912
913
913914static const gfx_layout char_layout =
914915{
915916   8,8,
r2241r2242
934935   64*8
935936};
936937
938
937939static GFXDECODE_START( ddragon )
938940   GFXDECODE_ENTRY( REGION_GFX1, 0, char_layout,   0, 8 )   /* colors   0-127 */
939941   GFXDECODE_ENTRY( REGION_GFX2, 0, tile_layout, 128, 8 )   /* colors 128-255 */
r2241r2242
10321034MACHINE_DRIVER_END
10331035
10341036
1037static MACHINE_DRIVER_START( ddgn6809 )
1038
1039   /* basic machine hardware */
1040    MDRV_CPU_ADD_TAG("main", M6809, MAIN_CLOCK)   /* 12MHz / 4 internally */
1041   MDRV_CPU_PROGRAM_MAP(ddragon_map,0)
1042
1043   MDRV_CPU_ADD_TAG("sub", M6809, MAIN_CLOCK/2)   /* 6Mhz / 4 internally */
1044   MDRV_CPU_PROGRAM_MAP(sub_map,0)
1045
1046    MDRV_CPU_ADD_TAG("sound", M6809, MAIN_CLOCK/2)   /* 6MHz / 4 internally */
1047   MDRV_CPU_PROGRAM_MAP(sound_map,0)
1048
1049   MDRV_INTERLEAVE(1000) /* heavy interleaving to sync up sprite<->main cpu's */
1050
1051   MDRV_MACHINE_START(ddragon)
1052   MDRV_MACHINE_RESET(ddragon)
1053
1054   /* video hardware */
1055   MDRV_GFXDECODE(ddragon)
1056   MDRV_PALETTE_LENGTH(384)
1057
1058   MDRV_SCREEN_ADD("main", RASTER)
1059   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1060   MDRV_SCREEN_RAW_PARAMS(MAIN_CLOCK/2, 384, 0, 256, 272, 0, 240)
1061
1062   MDRV_VIDEO_START(ddragon)
1063   MDRV_VIDEO_UPDATE(ddragon)
1064
1065   /* sound hardware */
1066   MDRV_SPEAKER_STANDARD_MONO("mono")
1067
1068   MDRV_SOUND_ADD_TAG("fm", YM2151, SOUND_CLOCK)
1069   MDRV_SOUND_CONFIG(ym2151_interface)
1070   MDRV_SOUND_ROUTE(0, "mono", 0.60)
1071   MDRV_SOUND_ROUTE(1, "mono", 0.60)
1072
1073   MDRV_SOUND_ADD_TAG("oki1", MSM5205, MAIN_CLOCK/32)
1074   MDRV_SOUND_CONFIG(msm5205_interface)
1075   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1076
1077   MDRV_SOUND_ADD_TAG("oki2", MSM5205, MAIN_CLOCK/32)
1078   MDRV_SOUND_CONFIG(msm5205_interface)
1079   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1080MACHINE_DRIVER_END
1081
1082
10351083static MACHINE_DRIVER_START( ddragon2 )
10361084
10371085   /* basic machine hardware */
r2241r2242
13921440ROM_END
13931441
13941442
1443/* this is a well known italian bootleg of Double Dragon it can be identified by the following gameplay trait
1444 -- The Boss of level 4 is coloured like level 1 and 5 instead of green, and is invulnerable to rocks attack.
1445
1446 in terms of code the game code has been heavily modified, banking writes appear to have been removed, and
1447 the graphic roms are all scrambled.  The game also runs on 3x M6809 rather than the original CPUs.
1448
1449 I'm not 100% convinced the program roms are good dumps, apprently ROM3 fails on the original board (could just
1450 be due to the rom hacking, as the game runs fine) but there is a jump to the 0x2000 region in the code, although
1451 this could be additional protection / rom scrambling.  Also the sound roms seem too small.  If you have this
1452 PCB please verify.
1453
1454 */
1455ROM_START( ddgn6809 )
1456   ROM_REGION( 0x30000, REGION_CPU1, 0 )   /* 64k for code + bankswitched memory */
1457   ROM_LOAD( "16.bin",   0x08000, 0x08000, CRC(f4c72690) SHA1(c70d032355acf3f7f6586b6e57a94f80e099bf1a) )
1458   ROM_LOAD( "17.bin",   0x10000, 0x08000, CRC(6489d637) SHA1(fd17fd870e9386a3e3bdd56c8d731c73d8c70b88) ) /* banked at 0x4000-0x8000 */
1459   ROM_LOAD( "18.bin",   0x18000, 0x08000, CRC(154d50c4) SHA1(4ffdd29406b6c6b552344f820f83715b1c7727d1) ) /* banked at 0x4000-0x8000 */
1460   ROM_LOAD( "19.bin",   0x20000, 0x08000, CRC(090e2baf) SHA1(29b775c59c7a4d30a33e3d10e736cd1a83baf3bb) ) /* banked at 0x4000-0x8000 */
1461
1462   ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sprite cpu */
1463   ROM_LOAD( "20.bin",    0x8000, 0x8000, CRC(67e3b4f1) SHA1(4945d76b0694299f2f4739ebfba98da6d96fe4cb) )
1464
1465   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* audio cpu */
1466   ROM_LOAD( "21.bin",      0x08000, 0x08000, CRC(4437fc51) SHA1(fffcf2bec50d0b79861904b4abc607206b7794e6) )
1467
1468   /* all the gfx roms are scrambled on this set */
1469   ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
1470   ROM_LOAD( "13.bin",        0x00000, 0x08000, CRC(b5a54537) SHA1(a6157cde4f9738565008d11a4a6d8576ae3abfef) )   /* chars */
1471
1472   ROM_REGION( 0x80000, REGION_GFX2, ROMREGION_DISPOSE )
1473   ROM_LOAD( "22.bin",        0x00000, 0x08000, CRC(fe08ef61) SHA1(50404936934dc61f3553add4d4b918529b3b5ef3) )
1474   ROM_LOAD( "23.bin",        0x08000, 0x08000, CRC(988bea93) SHA1(053ebb5a71dfdb68ae88ef49d8409a99f8c6926d) )
1475   ROM_LOAD( "24.bin",        0x10000, 0x08000, CRC(437501fc) SHA1(e7758e0fb226ae46eb398bd95f5e95c90b6adb93) )
1476   ROM_LOAD( "25.bin",        0x18000, 0x08000, CRC(d302f69b) SHA1(64d4d8ae38457ee6b361b5157ec0557f9a7639a8) )
1477   ROM_LOAD( "26.bin",        0x20000, 0x08000, CRC(8ece953e) SHA1(12a43e1ed1a99b04299941a9506228490649b181) )
1478   ROM_LOAD( "27.bin",        0x28000, 0x08000, CRC(15cd16cb) SHA1(ab2068ebba14da256e8f2600f34dca0e048a1de9) )
1479   ROM_LOAD( "28.bin",        0x30000, 0x08000, CRC(51b8a217) SHA1(60c067cd7272f856e29cdb64312535236656891a) )
1480   ROM_LOAD( "29.bin",        0x38000, 0x08000, CRC(e4ec2394) SHA1(43376ce2a07c1fc3053f7ac9b750e944d289105b) )
1481   ROM_LOAD( "1.bin",         0x40000, 0x08000, CRC(2485a71d) SHA1(3e987a2f3e9a59da5fdc7bb779a43736ca67aac7) )
1482   ROM_LOAD( "2.bin",         0x48000, 0x08000, CRC(6940120d) SHA1(bbe94f095ef983f54658c936f916ba6a72a84ead) )
1483   ROM_LOAD( "3.bin",         0x50000, 0x08000, CRC(c67aac12) SHA1(aab535507e3889bf1bdc2f4fe4828a70a350ba63) )
1484   ROM_LOAD( "4.bin",         0x58000, 0x08000, CRC(941dcd08) SHA1(266dee264f28affe8c3f57fe569929817ae16508) )
1485   ROM_LOAD( "5.bin",         0x60000, 0x08000, CRC(42d36bc3) SHA1(080cbc3ffda8ab26dc65a8e9eaf948c509d064b3) )
1486   ROM_LOAD( "6.bin",         0x68000, 0x08000, CRC(d5d19a8d) SHA1(c4b044dd12d6468c0ad114644f01813d4fe9a673) )
1487   ROM_LOAD( "7.bin",         0x70000, 0x08000, CRC(d4e350cd) SHA1(78ed2baa8c52b766f998091e7ce9e1a2941352e7) )
1488   ROM_LOAD( "8.bin",         0x78000, 0x08000, CRC(204fdb7d) SHA1(f75b1bc6f65e7a33927cd451267fcd7e2aa44f7e) )
1489
1490   ROM_REGION( 0x40000, REGION_GFX3, ROMREGION_DISPOSE )
1491   ROM_LOAD( "9.bin",         0x00000, 0x10000, CRC(736eff0f) SHA1(ae2ec2d5c8ab1db579a08256d874426dc5d889c6) )
1492   ROM_LOAD( "10.bin",        0x10000, 0x10000, CRC(a670d088) SHA1(27e7b49645753dd039f104c3e0a7e6513a98710d) )
1493   ROM_LOAD( "11.bin",        0x20000, 0x10000, CRC(4171b70d) SHA1(dc300c9bca6481417e97ad03c973e47389f261c1) )
1494   ROM_LOAD( "12.bin",        0x30000, 0x10000, CRC(5f6a6d6f) SHA1(7d546a226cda81c28e7ccfb4c5daebc65072198d) )
1495
1496   ROM_REGION( 0x20000, REGION_SOUND1, 0 ) /* adpcm samples -- roms too small? (please check) */
1497   ROM_LOAD( "14.bin",        0x00000, 0x08000, BAD_DUMP CRC(678f8657) SHA1(2652fdc6719d2c889ca87802f6e2cefae59fc2eb) )
1498   ROM_LOAD( "15.bin",        0x10000, 0x08000, BAD_DUMP CRC(10f21dea) SHA1(739cf649f91490384297a81a2cc9855acb58a1c0) )
1499ROM_END
1500
1501
13951502ROM_START( ddragon2 )
13961503   ROM_REGION( 0x30000, REGION_CPU1, 0 )
13971504   ROM_LOAD( "26a9-04.bin",  0x08000, 0x8000, CRC(f2cfc649) SHA1(d3f1e0bae02472914a940222e4f600170a91736d) )
r2241r2242
17521859   /* should the sound rom be bitswapped too? */
17531860}
17541861
1862DRIVER_INIT( ddgn6809 )
1863{
1864   /* Descramble GFX here */
17551865
1866   sprite_irq = INPUT_LINE_NMI;
1867   sound_irq = M6809_IRQ_LINE;
1868   ym_irq = M6809_FIRQ_LINE;
1869   technos_video_hw = 0;
1870}
17561871
17571872/*************************************
17581873 *
r2241r2242
17671882GAME( 1987, ddragoua, ddragon,  ddragon,  ddragon,  ddragon,  ROT0, "[Technos] (Taito America license)", "Double Dragon (US Set 2)", GAME_SUPPORTS_SAVE )
17681883GAME( 1987, ddragonb, ddragon,  ddragonb, ddragon,  ddragon,  ROT0, "bootleg", "Double Dragon (bootleg with HD6309)", GAME_SUPPORTS_SAVE ) // according to dump notes
17691884GAME( 1987, ddragnba, ddragon,  ddragnba, ddragon,  ddragon,  ROT0, "bootleg", "Double Dragon (bootleg with M6803)", GAME_SUPPORTS_SAVE )
1885GAME( 1987, ddgn6809, ddragon,  ddgn6809, ddragon,  ddgn6809,  ROT0, "bootleg", "Double Dragon (bootleg with 3xM6809)", GAME_NOT_WORKING )
17701886
17711887GAME( 1988, ddragon2, 0,        ddragon2, ddragon2, ddragon2, ROT0, "Technos", "Double Dragon II - The Revenge (World)", GAME_SUPPORTS_SAVE )
17721888GAME( 1988, ddragn2u, ddragon2, ddragon2, ddragon2, ddragon2, ROT0, "Technos", "Double Dragon II - The Revenge (US)", GAME_SUPPORTS_SAVE )
src/mame/drivers/acommand.c
r2241r2242
326326   switch(offset)
327327   {
328328      case 0x16/2:
329         if(ACCESSING_LSB)
329         if(ACCESSING_BITS_0_7)
330330         {
331331            logerror("Request to play sample %02x with rom 2\n",data);
332332            OKIM6295_data_0_w(machine,0,data);
333333         }
334334         break;
335335      case 0x1a/2:
336         if(ACCESSING_LSB)
336         if(ACCESSING_BITS_0_7)
337337         {
338338            logerror("Request to play sample %02x with rom 1\n",data);
339339            OKIM6295_data_1_w(machine,0,data);
src/mame/drivers/asterix.c
r2241r2242
9090
9191static WRITE16_HANDLER( control2_w )
9292{
93   if (ACCESSING_LSB)
93   if (ACCESSING_BITS_0_7)
9494   {
9595      cur_control2 = data;
9696      /* bit 0 is data */
src/mame/drivers/xxmissio.c
r2241r2242
118118   AM_RANGE(0xc800, 0xcfff) AM_SHARE(2) AM_READWRITE(xxmissio_bgram_r, xxmissio_bgram_w) AM_BASE(&xxmissio_bgram)
119119   AM_RANGE(0xd000, 0xd7ff) AM_SHARE(3) AM_RAM AM_BASE(&xxmissio_spriteram)
120120
121   AM_RANGE(0xd800, 0xdaff) AM_SHARE(4) AM_READWRITE(SMH_RAM, xxmissio_paletteram_w) AM_BASE(&paletteram)
121   AM_RANGE(0xd800, 0xdaff) AM_SHARE(4) AM_RAM AM_WRITE(xxmissio_paletteram_w) AM_BASE(&paletteram)
122122
123123   AM_RANGE(0xe000, 0xefff) AM_SHARE(5) AM_RAM
124124   AM_RANGE(0xf000, 0xffff) AM_SHARE(6) AM_RAM
r2241r2242
145145   AM_RANGE(0xc800, 0xcfff) AM_SHARE(2) AM_READWRITE(xxmissio_bgram_r, xxmissio_bgram_w)
146146   AM_RANGE(0xd000, 0xd7ff) AM_SHARE(3) AM_RAM
147147
148   AM_RANGE(0xd800, 0xdaff) AM_SHARE(4) AM_READWRITE(SMH_RAM, xxmissio_paletteram_w)
148   AM_RANGE(0xd800, 0xdaff) AM_SHARE(4) AM_RAM AM_WRITE(xxmissio_paletteram_w)
149149
150150   AM_RANGE(0xe000, 0xefff) AM_SHARE(6) AM_RAM
151151   AM_RANGE(0xf000, 0xffff) AM_SHARE(5) AM_RAM
src/mame/drivers/macrossp.c
r2241r2242
275275
276276static WRITE32_HANDLER( macrossp_soundcmd_w )
277277{
278   if (ACCESSING_MSW32)
278   if (ACCESSING_BITS_16_31)
279279   {
280280      //logerror("%08x write soundcmd %08x (%08x)\n",activecpu_get_pc(),data,mem_mask);
281281      soundlatch_word_w(machine,0,data >> 16,0);
src/mame/drivers/puckpkmn.c
r2241r2242
100100   switch (offset)
101101   {
102102      case 0:
103         if (ACCESSING_MSB)   YM3438_control_port_0_A_w   (machine, 0,   (data >> 8) & 0xff);
103         if (ACCESSING_BITS_8_15)   YM3438_control_port_0_A_w   (machine, 0,   (data >> 8) & 0xff);
104104         else             YM3438_data_port_0_A_w      (machine, 0,   (data >> 0) & 0xff);
105105         break;
106106      case 1:
107         if (ACCESSING_MSB)   YM3438_control_port_0_B_w   (machine, 0,   (data >> 8) & 0xff);
107         if (ACCESSING_BITS_8_15)   YM3438_control_port_0_B_w   (machine, 0,   (data >> 8) & 0xff);
108108         else             YM3438_data_port_0_B_w      (machine, 0,   (data >> 0) & 0xff);
109109         break;
110110   }
src/mame/drivers/groundfx.c
r2241r2242
183183   {
184184      case 0x00:
185185      {
186         if (ACCESSING_MSB32)   /* $500000 is watchdog */
186         if (ACCESSING_BITS_24_31)   /* $500000 is watchdog */
187187         {
188188            watchdog_reset(machine);
189189         }
190190
191         if (ACCESSING_LSB32)
191         if (ACCESSING_BITS_0_7)
192192         {
193193            EEPROM_set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
194194            EEPROM_write_bit(data & 0x40);
r2241r2242
201201
202202      case 0x01:
203203      {
204         if (ACCESSING_MSB32)
204         if (ACCESSING_BITS_24_31)
205205         {
206206            coin_lockout_w(0,~data & 0x01000000);
207207            coin_lockout_w(1,~data & 0x02000000);
r2241r2242
227227
228228static WRITE32_HANDLER( rotate_control_w )   /* only a guess that it's rotation */
229229{
230      if (ACCESSING_LSW32)
230      if (ACCESSING_BITS_0_15)
231231      {
232232         groundfx_rotate_ctrl[port_sel] = data;
233233         return;
234234      }
235235
236      if (ACCESSING_MSW32)
236      if (ACCESSING_BITS_16_31)
237237      {
238238         port_sel = (data &0x70000) >> 16;
239239      }
src/mame/drivers/gamecstl.c
r2241r2242
4040
4141#include "driver.h"
4242#include "memconv.h"
43#include "devconv.h"
4344#include "deprecat.h"
4445#include "machine/8237dma.h"
4546#include "machine/pic8259.h"
r2241r2242
186187static UINT32 intel82439tx_pci_r(int function, int reg, UINT32 mem_mask)
187188{
188189   UINT32 r = 0;
189   if (!(mem_mask & 0xff000000))
190   if (ACCESSING_BITS_24_31)
190191   {
191192      r |= mxtc_config_r(function, reg + 3) << 24;
192193   }
193   if (!(mem_mask & 0x00ff0000))
194   if (ACCESSING_BITS_16_23)
194195   {
195196      r |= mxtc_config_r(function, reg + 2) << 16;
196197   }
197   if (!(mem_mask & 0x0000ff00))
198   if (ACCESSING_BITS_8_15)
198199   {
199200      r |= mxtc_config_r(function, reg + 1) << 8;
200201   }
201   if (!(mem_mask & 0x000000ff))
202   if (ACCESSING_BITS_0_7)
202203   {
203204      r |= mxtc_config_r(function, reg + 0) << 0;
204205   }
r2241r2242
207208
208209static void intel82439tx_pci_w(int function, int reg, UINT32 data, UINT32 mem_mask)
209210{
210   if (!(mem_mask & 0xff000000))
211   if (ACCESSING_BITS_24_31)
211212   {
212213      mxtc_config_w(function, reg + 3, (data >> 24) & 0xff);
213214   }
214   if (!(mem_mask & 0x00ff0000))
215   if (ACCESSING_BITS_16_23)
215216   {
216217      mxtc_config_w(function, reg + 2, (data >> 16) & 0xff);
217218   }
218   if (!(mem_mask & 0x0000ff00))
219   if (ACCESSING_BITS_8_15)
219220   {
220221      mxtc_config_w(function, reg + 1, (data >> 8) & 0xff);
221222   }
222   if (!(mem_mask & 0x000000ff))
223   if (ACCESSING_BITS_0_7)
223224   {
224225      mxtc_config_w(function, reg + 0, (data >> 0) & 0xff);
225226   }
r2241r2242
243244static UINT32 intel82371ab_pci_r(int function, int reg, UINT32 mem_mask)
244245{
245246   UINT32 r = 0;
246   if (!(mem_mask & 0xff000000))
247   if (ACCESSING_BITS_24_31)
247248   {
248249      r |= piix4_config_r(function, reg + 3) << 24;
249250   }
250   if (!(mem_mask & 0x00ff0000))
251   if (ACCESSING_BITS_16_23)
251252   {
252253      r |= piix4_config_r(function, reg + 2) << 16;
253254   }
254   if (!(mem_mask & 0x0000ff00))
255   if (ACCESSING_BITS_8_15)
255256   {
256257      r |= piix4_config_r(function, reg + 1) << 8;
257258   }
258   if (!(mem_mask & 0x000000ff))
259   if (ACCESSING_BITS_0_7)
259260   {
260261      r |= piix4_config_r(function, reg + 0) << 0;
261262   }
r2241r2242
264265
265266static void intel82371ab_pci_w(int function, int reg, UINT32 data, UINT32 mem_mask)
266267{
267   if (!(mem_mask & 0xff000000))
268   if (ACCESSING_BITS_24_31)
268269   {
269270      piix4_config_w(function, reg + 3, (data >> 24) & 0xff);
270271   }
271   if (!(mem_mask & 0x00ff0000))
272   if (ACCESSING_BITS_16_23)
272273   {
273274      piix4_config_w(function, reg + 2, (data >> 16) & 0xff);
274275   }
275   if (!(mem_mask & 0x0000ff00))
276   if (ACCESSING_BITS_8_15)
276277   {
277278      piix4_config_w(function, reg + 1, (data >> 8) & 0xff);
278279   }
279   if (!(mem_mask & 0x000000ff))
280   if (ACCESSING_BITS_0_7)
280281   {
281282      piix4_config_w(function, reg + 0, (data >> 0) & 0xff);
282283   }
r2241r2242
285286// ISA Plug-n-Play
286287static WRITE32_HANDLER( pnp_config_w )
287288{
288   if (!(mem_mask & 0x0000ff00))
289   if (ACCESSING_BITS_8_15)
289290   {
290291//      mame_printf_debug("PNP Config: %02X\n", (data >> 8) & 0xff);
291292   }
r2241r2242
293294
294295static WRITE32_HANDLER( pnp_data_w )
295296{
296   if (!(mem_mask & 0x0000ff00))
297   if (ACCESSING_BITS_8_15)
297298   {
298299//      mame_printf_debug("PNP Data: %02X\n", (data >> 8) & 0xff);
299300   }
r2241r2242
332333   }
333334}
334335
336
337DEV_READWRITE8TO32LE( gamecstl_pit8254_32le, pit8253_r, pit8253_w )
338
339
335340/*****************************************************************************/
336341
337342static ADDRESS_MAP_START( gamecstl_map, ADDRESS_SPACE_PROGRAM, 32 )
r2241r2242
348353static ADDRESS_MAP_START(gamecstl_io, ADDRESS_SPACE_IO, 32)
349354   AM_RANGE(0x0000, 0x001f) AM_READWRITE(dma8237_32le_0_r,         dma8237_32le_0_w)
350355   AM_RANGE(0x0020, 0x003f) AM_READWRITE(pic8259_32le_0_r,         pic8259_32le_0_w)
351   AM_RANGE(0x0040, 0x005f) AM_READWRITE(pit8253_32le_0_r,         pit8253_32le_0_w)
356   AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE(PIT8254, "pit8254", gamecstl_pit8254_32le_r, gamecstl_pit8254_32le_w)
352357   AM_RANGE(0x0060, 0x006f) AM_READWRITE(kbdc8042_32le_r,         kbdc8042_32le_w)
353358   AM_RANGE(0x0070, 0x007f) AM_READWRITE(mc146818_port32le_r,      mc146818_port32le_w)
354359   AM_RANGE(0x0080, 0x009f) AM_READWRITE(at_page32_r,            at_page32_w)
r2241r2242
441446   cpunum_set_irq_callback(0, irq_callback);
442447}
443448
449static PIT8253_OUTPUT_CHANGED( pc_timer0_w )
450{
451    pic8259_set_irq_line(0, 0, state);
452}
453
454static const struct pit8253_config gamecstl_pit8254_config =
455{
456   {
457      {
458         4772720/4,            /* heartbeat IRQ */
459         pc_timer0_w,
460         NULL
461      }, {
462         4772720/4,            /* dram refresh */
463         NULL,
464         NULL
465      }, {
466         4772720/4,            /* pio port c pin 4, and speaker polling enough */
467         NULL,
468         NULL
469      }
470   }
471};
472
444473static MACHINE_DRIVER_START(gamecstl)
445474
446475   /* basic machine hardware */
r2241r2242
450479
451480   MDRV_MACHINE_RESET(gamecstl)
452481
482   MDRV_DEVICE_ADD( "pit8254", PIT8254 )
483   MDRV_DEVICE_CONFIG( gamecstl_pit8254_config )
484
453485   MDRV_NVRAM_HANDLER( mc146818 )
454486
455487    /* video hardware */
r2241r2242
509541{
510542   bios_ram = auto_malloc(0x10000);
511543
512   init_pc_common(PCCOMMON_KEYBOARD_AT | PCCOMMON_DMA8237_AT | PCCOMMON_TIMER_8254);
544   init_pc_common(PCCOMMON_KEYBOARD_AT | PCCOMMON_DMA8237_AT);
513545   mc146818_init(MC146818_STANDARD);
514546
515547   intel82439tx_init();
src/mame/drivers/cidelsa.c
r2241r2242
55#include "video/cdp1869.h"
66#include "sound/cdp1869.h"
77#include "sound/ay8910.h"
8#include "cidelsa.h"
89
910/*
1011
1112    TODO:
1213
13    - auto_malloc cidelsa_pcb
1414    - move set_cpu_mode timer call to MDRV
1515    - fix COP420 core to get sound in Draco
1616
1717*/
1818
19#define DESTRYER_CHR1   3579000.0 // unverified
20#define DESTRYER_CHR2   XTAL_5_7143MHz
21#define ALTAIR_CHR1      3579000.0 // unverified
22#define ALTAIR_CHR2      CDP1869_DOT_CLK_PAL // unverified
23#define DRACO_CHR1      XTAL_4_43361MHz
24#define DRACO_CHR2      CDP1869_DOT_CLK_PAL // unverified
25#define DRACO_SND_CHR1   XTAL_2_01216MHz
19#define CDP1869_TAG   "cdp1869"
2620
2721/* CDP1802 Interface */
2822
29static int cdp1869_prd;
30static int cdp1869_pcb;
31static UINT8 cidelsa_pcb[0x800];  // 2048x1 bit PCB ram
32
33static int cdp1802_mode = CDP1802_MODE_RESET;
34
3523static UINT8 cidelsa_mode_r(void)
3624{
37   return cdp1802_mode;
25   cidelsa_state *state = Machine->driver_data;
26
27   return state->cdp1802_mode;
3828}
3929
4030static UINT8 cidelsa_ef_r(void)
r2241r2242
4939   return readinputportbytag("EF");
5040}
5141
42static void cidelsa_q_w(int q)
43{
44   cidelsa_state *state = Machine->driver_data;
45
46   state->cdp1802_q = q;
47}
48
5249static const CDP1802_CONFIG cidelsa_cdp1802_config =
5350{
54   cidelsa_mode_r,
55   cidelsa_ef_r,
56   NULL,
57   NULL,
58   NULL,
59   NULL
51   cidelsa_mode_r,      // MODE
52   cidelsa_ef_r,      // EF
53   NULL,            // SC
54   cidelsa_q_w,      // Q
55   NULL,            // DMA read
56   NULL            // DMA write
6057};
6158
6259/* Sound Interface */
6360
64static int draco_sound;
65static int draco_ay_latch;
66
67static WRITE8_HANDLER ( draco_sound_bankswitch_w )
61static WRITE8_HANDLER( draco_sound_bankswitch_w )
6862{
69   memory_set_bank(1, (data & 0x08) >> 3);
63   /*
64
65        pin     description
66
67        D0      not connected
68        D1      not connected
69        D2      not connected
70        D3      2716 A10
71
72    */
73
74   int bank = BIT(data, 3);
75
76   memory_set_bank(1, bank);
7077}
7178
72static WRITE8_HANDLER ( draco_sound_g_w )
79static WRITE8_HANDLER( draco_sound_g_w )
7380{
81   cidelsa_state *state = machine->driver_data;
82
7483   /*
7584
7685     G1 G0  description
r2241r2242
8594   switch (data)
8695   {
8796   case 0x01:
88      AY8910_write_port_0_w(machine, 0, draco_ay_latch);
97      AY8910_write_port_0_w(machine, 0, state->draco_ay_latch);
8998      break;
9099
91100   case 0x02:
92      draco_ay_latch = AY8910_read_port_0_r(machine, 0);
101      state->draco_ay_latch = AY8910_read_port_0_r(machine, 0);
93102      break;
94103
95104   case 0x03:
96      AY8910_control_port_0_w(machine, 0, draco_ay_latch);
105      AY8910_control_port_0_w(machine, 0, state->draco_ay_latch);
97106      break;
98107   }
99108}
100109
101static READ8_HANDLER ( draco_sound_in_r )
110static READ8_HANDLER( draco_sound_in_r )
102111{
103   return draco_sound & 0x07;
112   cidelsa_state *state = machine->driver_data;
113
114   return ~(state->draco_sound) & 0x07;
104115}
105116
106static READ8_HANDLER ( draco_sound_ay8910_r )
117static READ8_HANDLER( draco_sound_ay8910_r )
107118{
108   return draco_ay_latch;
119   cidelsa_state *state = machine->driver_data;
120
121   return state->draco_ay_latch;
109122}
110123
111static WRITE8_HANDLER ( draco_sound_ay8910_w )
124static WRITE8_HANDLER( draco_sound_ay8910_w )
112125{
113   draco_ay_latch = data;
126   cidelsa_state *state = machine->driver_data;
127
128   state->draco_ay_latch = data;
114129}
115130
116static WRITE8_HANDLER ( draco_ay8910_port_a_w )
131static WRITE8_HANDLER( draco_ay8910_port_a_w )
117132{
118133   /*
119134      bit   description
120135
121        0   N/C
122        1   N/C
123        2   N/C
124        3   N/C
125        4   N/C
126        5   N/C
127        6   N/C
128        7   N/C
136        0   not connected
137        1   not connected
138        2   not connected
139        3   not connected
140        4   not connected
141        5   not connected
142        6   not connected
143        7   not connected
129144    */
130145}
131146
132static WRITE8_HANDLER ( draco_ay8910_port_b_w )
147static WRITE8_HANDLER( draco_ay8910_port_b_w )
133148{
134149   /*
135150      bit   description
r2241r2242
139154        2   sound output -> * -> 22K capacitor -> GND
140155        3   sound output -> * -> 220K capacitor -> GND
141156        4   5V -> 1K resistor -> * -> 10uF capacitor -> GND (volume pot voltage adjustment)
142        5   N/C
143        6   N/C
144        7   N/C
157        5   not connected
158        6   not connected
159        7   not connected
145160    */
146161}
147162
r2241r2242
155170
156171/* Read/Write Handlers */
157172
158static WRITE8_HANDLER ( destryer_out1_w )
173static WRITE8_HANDLER( destryer_out1_w )
159174{
160175   /*
161176      bit   description
r2241r2242
171186    */
172187}
173188
174static WRITE8_HANDLER ( altair_out1_w )
189static WRITE8_HANDLER( altair_out1_w )
175190{
176191   /*
177192      bit   description
r2241r2242
191206   set_led_status(2, data & 0x20); // FIRE
192207}
193208
194static WRITE8_HANDLER ( draco_out1_w )
209static WRITE8_HANDLER( draco_out1_w )
195210{
211   cidelsa_state *state = machine->driver_data;
212
196213   /*
197214      bit   description
198215
199216        0   3K9 -> Green signal
200217        1   820R -> Blue signal
201218        2   510R -> Red signal
202        3   1K -> N/C
203        4   N/C
219        3   1K -> not connected
220        4   not connected
204221        5   SONIDO A -> COP402 IN0
205222        6   SONIDO B -> COP402 IN1
206223        7   SONIDO C -> COP402 IN2
207224    */
208225
209    draco_sound = (data & 0xe0) >> 5;
226    state->draco_sound = (data & 0xe0) >> 5;
210227}
211228
212static WRITE8_HANDLER ( cidelsa_charram_w )
213{
214   int addr = cdp1869_get_cma(offset);
215
216   cidelsa_pcb[addr] = activecpu_get_reg(CDP1802_Q);
217
218   cdp1869_charram_w(machine, offset, data);
219}
220
221static READ8_HANDLER ( cidelsa_charram_r )
222{
223   int addr = cdp1869_get_cma(offset);
224
225   cdp1869_pcb = cidelsa_pcb[addr];
226
227   return cdp1869_charram_r(machine, offset);
228}
229
230229/* Memory Maps */
231230
232231// Destroyer
r2241r2242
234233static ADDRESS_MAP_START( destryer_map, ADDRESS_SPACE_PROGRAM, 8 )
235234   AM_RANGE(0x0000, 0x1fff) AM_ROM
236235   AM_RANGE(0x2000, 0x20ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
237   AM_RANGE(0xf400, 0xf7ff) AM_READWRITE(cidelsa_charram_r, cidelsa_charram_w)
238   AM_RANGE(0xf800, 0xffff) AM_READWRITE(cdp1869_pageram_r, cdp1869_pageram_w)
236   AM_RANGE(0xf400, 0xf7ff) AM_DEVREADWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_charram_r, cdp1869_charram_w)
237   AM_RANGE(0xf800, 0xffff) AM_DEVREADWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_pageram_r, cdp1869_pageram_w)
239238ADDRESS_MAP_END
240239
241240static ADDRESS_MAP_START( destryea_map, ADDRESS_SPACE_PROGRAM, 8 )
242241   AM_RANGE(0x0000, 0x1fff) AM_ROM
243242   AM_RANGE(0x3000, 0x30ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
244   AM_RANGE(0xf400, 0xf7ff) AM_READWRITE(cidelsa_charram_r, cidelsa_charram_w)
245   AM_RANGE(0xf800, 0xffff) AM_READWRITE(cdp1869_pageram_r, cdp1869_pageram_w)
243   AM_RANGE(0xf400, 0xf7ff) AM_DEVREADWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_charram_r, cdp1869_charram_w)
244   AM_RANGE(0xf800, 0xffff) AM_DEVREADWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_pageram_r, cdp1869_pageram_w)
246245ADDRESS_MAP_END
247246
248247static ADDRESS_MAP_START( destryer_io_map, ADDRESS_SPACE_IO, 8 )
249248   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN0") AM_WRITE(destryer_out1_w)
250249   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN1")
251   AM_RANGE(0x03, 0x03) AM_WRITE(cdp1869_out3_w)
252   AM_RANGE(0x04, 0x04) AM_WRITE(cdp1869_out4_w)
253   AM_RANGE(0x05, 0x05) AM_WRITE(cdp1869_out5_w)
254   AM_RANGE(0x06, 0x06) AM_WRITE(cdp1869_out6_w)
255   AM_RANGE(0x07, 0x07) AM_WRITE(cdp1869_out7_w)
250   AM_RANGE(0x03, 0x03) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out3_w)
251   AM_RANGE(0x04, 0x04) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out4_w)
252   AM_RANGE(0x05, 0x05) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out5_w)
253   AM_RANGE(0x06, 0x06) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out6_w)
254   AM_RANGE(0x07, 0x07) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out7_w)
256255ADDRESS_MAP_END
257256
258257// Altair
r2241r2242
260259static ADDRESS_MAP_START( altair_map, ADDRESS_SPACE_PROGRAM, 8 )
261260   AM_RANGE(0x0000, 0x2fff) AM_ROM
262261   AM_RANGE(0x3000, 0x30ff) AM_RAM
263   AM_RANGE(0xf400, 0xf7ff) AM_READWRITE(cidelsa_charram_r, cidelsa_charram_w)
264   AM_RANGE(0xf800, 0xffff) AM_READWRITE(cdp1869_pageram_r, cdp1869_pageram_w)
262   AM_RANGE(0xf400, 0xf7ff) AM_DEVREADWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_charram_r, cdp1869_charram_w)
263   AM_RANGE(0xf800, 0xffff) AM_DEVREADWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_pageram_r, cdp1869_pageram_w)
265264ADDRESS_MAP_END
266265
267266static ADDRESS_MAP_START( altair_io_map, ADDRESS_SPACE_IO, 8 )
268267   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN0") AM_WRITE(altair_out1_w)
269268   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN1")
270   AM_RANGE(0x03, 0x03) AM_WRITE(cdp1869_out3_w)
271   AM_RANGE(0x04, 0x04) AM_READ_PORT("IN2") AM_WRITE(cdp1869_out4_w)
272   AM_RANGE(0x05, 0x05) AM_WRITE(cdp1869_out5_w)
273   AM_RANGE(0x06, 0x06) AM_WRITE(cdp1869_out6_w)
274   AM_RANGE(0x07, 0x07) AM_WRITE(cdp1869_out7_w)
269   AM_RANGE(0x03, 0x03) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out3_w)
270   AM_RANGE(0x04, 0x04) AM_READ_PORT("IN2") AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out4_w)
271   AM_RANGE(0x05, 0x05) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out5_w)
272   AM_RANGE(0x06, 0x06) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out6_w)
273   AM_RANGE(0x07, 0x07) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out7_w)
275274ADDRESS_MAP_END
276275
277276// Draco
r2241r2242
279278static ADDRESS_MAP_START( draco_map, ADDRESS_SPACE_PROGRAM, 8 )
280279   AM_RANGE(0x0000, 0x3fff) AM_ROM
281280   AM_RANGE(0x8000, 0x83ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
282   AM_RANGE(0xf400, 0xf7ff) AM_READWRITE(cidelsa_charram_r, cidelsa_charram_w)
283   AM_RANGE(0xf800, 0xffff) AM_READWRITE(cdp1869_pageram_r, cdp1869_pageram_w)
281   AM_RANGE(0xf400, 0xf7ff) AM_DEVREADWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_charram_r, cdp1869_charram_w)
282   AM_RANGE(0xf800, 0xffff) AM_DEVREADWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_pageram_r, cdp1869_pageram_w)
284283ADDRESS_MAP_END
285284
286285static ADDRESS_MAP_START( draco_io_map, ADDRESS_SPACE_IO, 8 )
287286   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN0") AM_WRITE(draco_out1_w)
288287   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN1")
289   AM_RANGE(0x03, 0x03) AM_WRITE(cdp1869_out3_w)
290   AM_RANGE(0x04, 0x04) AM_READ_PORT("IN2") AM_WRITE(cdp1869_out4_w)
291   AM_RANGE(0x05, 0x05) AM_WRITE(cdp1869_out5_w)
292   AM_RANGE(0x06, 0x06) AM_WRITE(cdp1869_out6_w)
293   AM_RANGE(0x07, 0x07) AM_WRITE(cdp1869_out7_w)
288   AM_RANGE(0x03, 0x03) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out3_w)
289   AM_RANGE(0x04, 0x04) AM_READ_PORT("IN2") AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out4_w)
290   AM_RANGE(0x05, 0x05) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out5_w)
291   AM_RANGE(0x06, 0x06) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out6_w)
292   AM_RANGE(0x07, 0x07) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out7_w)
294293ADDRESS_MAP_END
295294
296295static ADDRESS_MAP_START( draco_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
r2241r2242
302301   AM_RANGE(COP400_PORT_G, COP400_PORT_G) AM_WRITE(draco_sound_g_w)
303302   AM_RANGE(COP400_PORT_L, COP400_PORT_L) AM_READWRITE(draco_sound_ay8910_r, draco_sound_ay8910_w)
304303   AM_RANGE(COP400_PORT_IN, COP400_PORT_IN) AM_READ(draco_sound_in_r)
304   AM_RANGE(COP400_PORT_SIO, COP400_PORT_SIO) AM_NOP
305   AM_RANGE(COP400_PORT_SK, COP400_PORT_SK) AM_WRITENOP
305306ADDRESS_MAP_END
306307
307308/* Input Ports */
308309
309310static CUSTOM_INPUT( cdp1869_pcb_r )
310311{
311   return cdp1869_pcb;
312   cidelsa_state *state = machine->driver_data;
313
314   return state->cdp1869_pcb;
312315}
313316
314317static CUSTOM_INPUT( cdp1869_predisplay_r )
315318{
316   return cdp1869_prd;
319   cidelsa_state *state = machine->driver_data;
320
321   return state->cdp1869_prd;
317322}
318323
319324static INPUT_PORTS_START( destryer )
r2241r2242
458463   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) // M1
459464INPUT_PORTS_END
460465
461/* Video Timer Callbacks */
462
463static TIMER_DEVICE_CALLBACK( altair_prd_start )
464{
465   cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE);
466   cdp1869_prd = 1; // inverted
467}
468
469static TIMER_DEVICE_CALLBACK( altair_prd_end )
470{
471   cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, CLEAR_LINE);
472   cdp1869_prd = 0; // inverted
473}
474
475static TIMER_DEVICE_CALLBACK( draco_prd_start )
476{
477   cdp1869_prd = 0;
478}
479
480static TIMER_DEVICE_CALLBACK( draco_prd_end )
481{
482   cdp1869_prd = 1;
483}
484
485466/* Machine Start */
486467
487468static TIMER_CALLBACK( set_cpu_mode )
488469{
489   cdp1802_mode = CDP1802_MODE_RUN;
490}
470   cidelsa_state *state = machine->driver_data;
491471
492static UINT8 cidelsa_get_color_bits(UINT8 cramdata, UINT16 cramaddr, UINT16 pramaddr)
493{
494   int ccb0 = (cramdata & 0x40) >> 4;
495   int ccb1 = (cramdata & 0x80) >> 6;
496   int pcb = cidelsa_pcb[cramaddr];
497
498   return ccb0 + ccb1 + pcb;
472   state->cdp1802_mode = CDP1802_MODE_RUN;
499473}
500474
501static const CDP1869_interface destryer_CDP1869_interface =
475static MACHINE_START( cidelsa )
502476{
503   CDP1869_PAL,
504   REGION_INVALID,
505   0x800,
506   0x400,
507   cidelsa_get_color_bits
508};
477   cidelsa_state *state = machine->driver_data;
509478
510static const CDP1869_interface draco_CDP1869_interface =
511{
512   CDP1869_PAL,
513   REGION_INVALID,
514   0x800,
515   0x800,
516   cidelsa_get_color_bits
517};
479   // reset the CPU
518480
519static MACHINE_START( destryer )
520{
521   cdp1869_configure(&destryer_CDP1869_interface);
522
481   state->cdp1802_mode = CDP1802_MODE_RESET;
523482   timer_set(ATTOTIME_IN_MSEC(200), NULL, 0, set_cpu_mode);
524483
525   state_save_register_global(cdp1802_mode);
526   state_save_register_global_array(cidelsa_pcb);
527   state_save_register_global(cdp1869_prd);
528   state_save_register_global(cdp1869_pcb);
484   // register save states
485
486   state_save_register_global(state->cdp1802_mode);
529487}
530488
531489static MACHINE_START( draco )
532490{
533   UINT8 *ROM = memory_region(REGION_CPU2);
534   memory_configure_bank(1, 0, 2, &ROM[0x000], 0x400);
491   cidelsa_state *state = machine->driver_data;
535492
536   cdp1869_configure(&draco_CDP1869_interface);
493   MACHINE_START_CALL( cidelsa );
537494
538   timer_set(ATTOTIME_IN_MSEC(200), NULL, 0, set_cpu_mode);
495   // COP402 memory banking
539496
540   state_save_register_global(cdp1802_mode);
541   state_save_register_global_array(cidelsa_pcb);
542   state_save_register_global(cdp1869_prd);
543   state_save_register_global(cdp1869_pcb);
544   state_save_register_global(draco_sound);
545   state_save_register_global(draco_ay_latch);
497   memory_configure_bank(1, 0, 2, memory_region(REGION_CPU2), 0x400);
498   memory_set_bank(1, 0);
499
500   // register save states
501
502   state_save_register_global(state->draco_sound);
503   state_save_register_global(state->draco_ay_latch);
546504}
547505
548506/* Machine Reset */
549507
550static MACHINE_RESET( destryer )
508static MACHINE_RESET( cidelsa )
551509{
552510   cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE);
553511}
r2241r2242
555513/* Machine Drivers */
556514
557515static MACHINE_DRIVER_START( destryer )
516   MDRV_DRIVER_DATA(cidelsa_state)
517
558518   // basic system hardware
559519
560520   MDRV_CPU_ADD(CDP1802, DESTRYER_CHR1)
r2241r2242
562522   MDRV_CPU_IO_MAP(destryer_io_map, 0)
563523   MDRV_CPU_CONFIG(cidelsa_cdp1802_config)
564524   MDRV_NVRAM_HANDLER(generic_0fill)
565   MDRV_MACHINE_START(destryer)
566   MDRV_MACHINE_RESET(destryer)
567525
526   MDRV_MACHINE_START(cidelsa)
527   MDRV_MACHINE_RESET(cidelsa)
528
568529   // video hardware
569530
570   MDRV_PALETTE_LENGTH(8+64)
571   MDRV_PALETTE_INIT(cdp1869)
572   MDRV_VIDEO_START(cdp1869)
573   MDRV_VIDEO_UPDATE(cdp1869)
531   MDRV_IMPORT_FROM(destryer_video)
574532
575   MDRV_SCREEN_ADD("main", RASTER)
576   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
577   MDRV_SCREEN_RAW_PARAMS(DESTRYER_CHR2, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_PAL, CDP1869_SCANLINE_VBLANK_END_PAL, CDP1869_SCANLINE_VBLANK_START_PAL)
578   MDRV_SCREEN_DEFAULT_POSITION(1.226, 0.012, 1.4, 0.044)
579
580   MDRV_TIMER_ADD_SCANLINE("prd_start", altair_prd_start, "main", CDP1869_SCANLINE_PREDISPLAY_START_PAL, CDP1869_TOTAL_SCANLINES_PAL)
581   MDRV_TIMER_ADD_SCANLINE("prd_end", altair_prd_end, "main", CDP1869_SCANLINE_PREDISPLAY_END_PAL, CDP1869_TOTAL_SCANLINES_PAL)
582
583533   // sound hardware
584534
585535   MDRV_SPEAKER_STANDARD_MONO("mono")
r2241r2242
589539MACHINE_DRIVER_END
590540
591541static MACHINE_DRIVER_START( destryea )
542   MDRV_DRIVER_DATA(cidelsa_state)
543
592544   // basic system hardware
593545
594546   MDRV_CPU_ADD(CDP1802, DESTRYER_CHR1)
r2241r2242
596548   MDRV_CPU_IO_MAP(destryer_io_map, 0)
597549   MDRV_CPU_CONFIG(cidelsa_cdp1802_config)
598550   MDRV_NVRAM_HANDLER(generic_0fill)
599   MDRV_MACHINE_START(destryer)
600   MDRV_MACHINE_RESET(destryer)
601551
552   MDRV_MACHINE_START(cidelsa)
553   MDRV_MACHINE_RESET(cidelsa)
554
602555   // video hardware
603556
604   MDRV_PALETTE_LENGTH(8+64)
605   MDRV_PALETTE_INIT(cdp1869)
606   MDRV_VIDEO_START(cdp1869)
607   MDRV_VIDEO_UPDATE(cdp1869)
557   MDRV_IMPORT_FROM(destryer_video)
608558
609   MDRV_SCREEN_ADD("main", RASTER)
610   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
611   MDRV_SCREEN_RAW_PARAMS(DESTRYER_CHR2, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_PAL, CDP1869_SCANLINE_VBLANK_END_PAL, CDP1869_SCANLINE_VBLANK_START_PAL)
612   MDRV_SCREEN_DEFAULT_POSITION(1.226, 0.012, 1.4, 0.044)
613
614   MDRV_TIMER_ADD_SCANLINE("prd_start", altair_prd_start, "main", CDP1869_SCANLINE_PREDISPLAY_START_PAL, CDP1869_TOTAL_SCANLINES_PAL)
615   MDRV_TIMER_ADD_SCANLINE("prd_end", altair_prd_end, "main", CDP1869_SCANLINE_PREDISPLAY_END_PAL, CDP1869_TOTAL_SCANLINES_PAL)
616
617559   // sound hardware
618560
619561   MDRV_SPEAKER_STANDARD_MONO("mono")
r2241r2242
623565MACHINE_DRIVER_END
624566
625567static MACHINE_DRIVER_START( altair )
568   MDRV_DRIVER_DATA(cidelsa_state)
569
626570   // basic system hardware
627571
628572   MDRV_CPU_ADD(CDP1802, ALTAIR_CHR1)
629573   MDRV_CPU_PROGRAM_MAP(altair_map, 0)
630574   MDRV_CPU_IO_MAP(altair_io_map, 0)
631575   MDRV_CPU_CONFIG(cidelsa_cdp1802_config)
632   MDRV_MACHINE_START(destryer)
633   MDRV_MACHINE_RESET(destryer)
634576
577   MDRV_MACHINE_START(cidelsa)
578   MDRV_MACHINE_RESET(cidelsa)
579
635580   // video hardware
636581
637   MDRV_PALETTE_LENGTH(8+64)
638   MDRV_PALETTE_INIT(cdp1869)
639   MDRV_VIDEO_START(cdp1869)
640   MDRV_VIDEO_UPDATE(cdp1869)
582   MDRV_IMPORT_FROM(altair_video)
641583
642   MDRV_SCREEN_ADD("main", RASTER)
643   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
644   MDRV_SCREEN_RAW_PARAMS(ALTAIR_CHR2, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_PAL, CDP1869_SCANLINE_VBLANK_END_PAL, CDP1869_SCANLINE_VBLANK_START_PAL)
645   MDRV_SCREEN_DEFAULT_POSITION(1.226, 0.012, 1.4, 0.044)
646
647   MDRV_TIMER_ADD_SCANLINE("prd_start", altair_prd_start, "main", CDP1869_SCANLINE_PREDISPLAY_START_PAL, CDP1869_TOTAL_SCANLINES_PAL)
648   MDRV_TIMER_ADD_SCANLINE("prd_end", altair_prd_end, "main", CDP1869_SCANLINE_PREDISPLAY_END_PAL, CDP1869_TOTAL_SCANLINES_PAL)
649
650584   // sound hardware
651585
652586   MDRV_SPEAKER_STANDARD_MONO("mono")
r2241r2242
656590MACHINE_DRIVER_END
657591
658592static MACHINE_DRIVER_START( draco )
593   MDRV_DRIVER_DATA(cidelsa_state)
594
659595   // basic system hardware
660596
661597   MDRV_CPU_ADD(CDP1802, DRACO_CHR1)
r2241r2242
663599   MDRV_CPU_IO_MAP(draco_io_map, 0)
664600   MDRV_CPU_CONFIG(cidelsa_cdp1802_config)
665601   MDRV_NVRAM_HANDLER(generic_0fill)
602
666603   MDRV_MACHINE_START(draco)
667   MDRV_MACHINE_RESET(destryer)
604   MDRV_MACHINE_RESET(cidelsa)
668605
669606   MDRV_CPU_ADD(COP420, DRACO_SND_CHR1) // COP402N
670607   MDRV_CPU_PROGRAM_MAP(draco_sound_map, 0)
r2241r2242
672609
673610   // video hardware
674611
675   MDRV_PALETTE_LENGTH(8+64)
676   MDRV_PALETTE_INIT(cdp1869)
677   MDRV_VIDEO_START(cdp1869)
678   MDRV_VIDEO_UPDATE(cdp1869)
612   MDRV_IMPORT_FROM(draco_video)
679613
680   MDRV_SCREEN_ADD("main", RASTER)
681   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
682   MDRV_SCREEN_RAW_PARAMS(DRACO_CHR2, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_PAL, CDP1869_SCANLINE_VBLANK_END_PAL, CDP1869_SCANLINE_VBLANK_START_PAL)
683   MDRV_SCREEN_DEFAULT_POSITION(1.226, 0.012, 1.360, 0.024)
684
685   MDRV_TIMER_ADD_SCANLINE("prd_start", draco_prd_start, "main", CDP1869_SCANLINE_PREDISPLAY_START_PAL, CDP1869_TOTAL_SCANLINES_PAL)
686   MDRV_TIMER_ADD_SCANLINE("prd_end", draco_prd_end, "main", CDP1869_SCANLINE_PREDISPLAY_END_PAL, CDP1869_TOTAL_SCANLINES_PAL)
687
688614   // sound hardware
689615
690616   MDRV_SPEAKER_STANDARD_MONO("mono")
r2241r2242
743669
744670/* Game Drivers */
745671
746GAME( 1980, destryer, 0,       destryer, destryer, 0, ROT90, "Cidelsa", "Destroyer (Cidelsa) (set 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
747GAME( 1980, destryea, destryer, destryea, destryer, 0, ROT90, "Cidelsa", "Destroyer (Cidelsa) (set 2)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
748GAME( 1981, altair,   0,       altair,   altair,   0, ROT90, "Cidelsa", "Altair", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
672GAME( 1980, destryer, 0,       destryer, destryer, 0, ROT90, "Cidelsa", "Destroyer (Cidelsa) (set 1)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
673GAME( 1980, destryea, destryer, destryea, destryer, 0, ROT90, "Cidelsa", "Destroyer (Cidelsa) (set 2)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
674GAME( 1981, altair,   0,       altair,   altair,   0, ROT90, "Cidelsa", "Altair", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
749675GAME( 1981, draco,    0,       draco,    draco,    0, ROT90, "Cidelsa", "Draco", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
src/mame/drivers/m92.c
r2241r2242
274274{
275275   UINT8 *RAM = memory_region(REGION_USER1);
276276//  logerror("%05x: EEPROM WR %04x\n",activecpu_get_pc(),offset);
277   if (ACCESSING_LSB)
277   if (ACCESSING_BITS_0_7)
278278      RAM[offset] = data;
279279}
280280
281281static WRITE16_HANDLER( m92_coincounter_w )
282282{
283   if (ACCESSING_LSB)
283   if (ACCESSING_BITS_0_7)
284284   {
285285      coin_counter_w(0, data & 0x01);
286286      coin_counter_w(1, data & 0x02);
r2241r2242
292292
293293static WRITE16_HANDLER( m92_bankswitch_w )
294294{
295   if (ACCESSING_LSB)
295   if (ACCESSING_BITS_0_7)
296296   {
297297      bankaddress = 0x100000 + ((data & 0x7) * 0x10000);
298298      set_m92_bank();
src/mame/drivers/segas16b.c
r2241r2242
11871187
11881188static WRITE16_HANDLER( rom_5704_bank_w )
11891189{
1190   if (ACCESSING_LSB)
1190   if (ACCESSING_BITS_0_7)
11911191      segaic16_tilemap_set_bank(0, offset & 1, data & 7);
11921192}
11931193
r2241r2242
12251225         break;
12261226
12271227      case 0x2000/2:
1228         if (ACCESSING_LSB)
1228         if (ACCESSING_BITS_0_7)
12291229            segaic16_tilemap_set_bank(0, offset & 1, data & 7);
12301230         break;
12311231   }
r2241r2242
15311531
15321532static WRITE16_HANDLER( atomicp_sound_w )
15331533{
1534   if (ACCESSING_MSB)
1534   if (ACCESSING_BITS_8_15)
15351535      switch (offset & 1)
15361536      {
15371537         case 0:   YM2413_register_port_0_w(machine, 0, data >> 8);   break;
src/mame/drivers/thoop2.c
r2241r2242
7272{
7373   UINT8 *RAM = memory_region(REGION_SOUND1);
7474
75   if (ACCESSING_LSB){
75   if (ACCESSING_BITS_0_7){
7676      memcpy(&RAM[0x30000], &RAM[0x40000 + (data & 0x0f)*0x10000], 0x10000);
7777   }
7878}
7979
8080static WRITE16_HANDLER( thoop2_coin_w )
8181{
82   if (ACCESSING_LSB){
82   if (ACCESSING_BITS_0_7){
8383      switch ((offset >> 3)){
8484         case 0x00:   /* Coin Lockouts */
8585         case 0x01:
src/mame/drivers/wwfwfest.c
r2241r2242
6767 still some unknown writes however, sound cpu memory map is the same as dd3
6868*******************************************************************************/
6969
70static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 16 )
71   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)   /* Rom */
72   AM_RANGE(0x0c0000, 0x0c1fff) AM_READ(SMH_RAM)   /* FG0 Ram */
73   AM_RANGE(0x0c2000, 0x0c3fff) AM_READ(SMH_RAM)   /* SPR Ram */
74   AM_RANGE(0x080000, 0x080fff) AM_READ(SMH_RAM)   /* BG0 Ram */
75   AM_RANGE(0x082000, 0x082fff) AM_READ(SMH_RAM)   /* BG1 Ram */
76   AM_RANGE(0x140020, 0x140027) AM_READ(wwfwfest_inputs_read)   /* Inputs */
77   AM_RANGE(0x180000, 0x18ffff) AM_READ(wwfwfest_paletteram16_xxxxBBBBGGGGRRRR_word_r)   /* BG0 Ram */
78   AM_RANGE(0x1c0000, 0x1c3fff) AM_READ(SMH_RAM)   /* Work Ram */
79ADDRESS_MAP_END
80
81static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 16 )
82   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)   /* Rom */
83   AM_RANGE(0x0c0000, 0x0c1fff) AM_WRITE(wwfwfest_fg0_videoram_w) AM_BASE(&wwfwfest_fg0_videoram)   /* FG0 Ram - 4 bytes per tile */
84   AM_RANGE(0x0c2000, 0x0c3fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)   /* SPR Ram */
85   AM_RANGE(0x080000, 0x080fff) AM_WRITE(wwfwfest_bg0_videoram_w) AM_BASE(&wwfwfest_bg0_videoram)   /* BG0 Ram - 4 bytes per tile */
86   AM_RANGE(0x082000, 0x082fff) AM_WRITE(wwfwfest_bg1_videoram_w) AM_BASE(&wwfwfest_bg1_videoram)   /* BG1 Ram - 2 bytes per tile */
70static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
71   AM_RANGE(0x000000, 0x07ffff) AM_ROM
72   AM_RANGE(0x0c0000, 0x0c1fff) AM_RAM AM_WRITE(wwfwfest_fg0_videoram_w) AM_BASE(&wwfwfest_fg0_videoram)   /* FG0 Ram - 4 bytes per tile */
73   AM_RANGE(0x0c2000, 0x0c3fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)                  /* SPR Ram */
74   AM_RANGE(0x080000, 0x080fff) AM_RAM AM_WRITE(wwfwfest_bg0_videoram_w) AM_BASE(&wwfwfest_bg0_videoram)   /* BG0 Ram - 4 bytes per tile */
75   AM_RANGE(0x082000, 0x082fff) AM_RAM AM_WRITE(wwfwfest_bg1_videoram_w) AM_BASE(&wwfwfest_bg1_videoram)   /* BG1 Ram - 2 bytes per tile */
8776   AM_RANGE(0x100000, 0x100007) AM_WRITE(wwfwfest_scroll_write)
8877   AM_RANGE(0x10000a, 0x10000b) AM_WRITE(wwfwfest_flipscreen_w)
8978   AM_RANGE(0x140000, 0x140001) AM_WRITE(SMH_NOP) /* Irq 3 ack */
9079   AM_RANGE(0x140002, 0x140003) AM_WRITE(SMH_NOP) /* Irq 2 ack */
9180   AM_RANGE(0x14000C, 0x14000D) AM_WRITE(wwfwfest_soundwrite)
9281   AM_RANGE(0x140010, 0x140011) AM_WRITE(wwfwfest_1410_write)
93   AM_RANGE(0x180000, 0x18ffff) AM_WRITE(wwfwfest_paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE(&paletteram16)
94   AM_RANGE(0x1c0000, 0x1c3fff) AM_WRITE(SMH_RAM)   /* Work Ram */
82   AM_RANGE(0x140020, 0x140027) AM_READ(wwfwfest_inputs_read) /* Inputs */
83   AM_RANGE(0x180000, 0x18ffff) AM_READWRITE(wwfwfest_paletteram16_xxxxBBBBGGGGRRRR_word_r,wwfwfest_paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE(&paletteram16)
84   AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM /* Work Ram */
9585ADDRESS_MAP_END
9686
97static ADDRESS_MAP_START( readmem_sound, ADDRESS_SPACE_PROGRAM, 8 )
98   AM_RANGE(0x0000, 0xbfff) AM_READ(SMH_ROM)
99   AM_RANGE(0xc000, 0xc7ff) AM_READ(SMH_RAM)
100   AM_RANGE(0xc801, 0xc801) AM_READ(YM2151_status_port_0_r)
101   AM_RANGE(0xd800, 0xd800) AM_READ(OKIM6295_status_0_r)
102   AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r)
103ADDRESS_MAP_END
104
105static ADDRESS_MAP_START( writemem_sound, ADDRESS_SPACE_PROGRAM, 8 )
106   AM_RANGE(0x0000, 0xbfff) AM_WRITE(SMH_ROM)
107   AM_RANGE(0xc000, 0xc7ff) AM_WRITE(SMH_RAM)
87static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
88   AM_RANGE(0x0000, 0xbfff) AM_ROM
89   AM_RANGE(0xc000, 0xc7ff) AM_RAM
10890   AM_RANGE(0xc800, 0xc800) AM_WRITE(YM2151_register_port_0_w)
109   AM_RANGE(0xc801, 0xc801) AM_WRITE(YM2151_data_port_0_w)
110   AM_RANGE(0xd800, 0xd800) AM_WRITE(OKIM6295_data_0_w)
91   AM_RANGE(0xc801, 0xc801) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w)
92   AM_RANGE(0xd800, 0xd800) AM_READWRITE(OKIM6295_status_0_r,OKIM6295_data_0_w)
93   AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r)
11194   AM_RANGE(0xe800, 0xe800) AM_WRITE(oki_bankswitch_w)
11295ADDRESS_MAP_END
11396
r2241r2242
404387
405388   /* basic machine hardware */
406389   MDRV_CPU_ADD(M68000, 24000000/2)   /* 24 crystal, 12 rated chip */
407   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
390   MDRV_CPU_PROGRAM_MAP(main_map,0)
408391   MDRV_CPU_VBLANK_INT_HACK(wwfwfest_interrupt,2)
409392
410393   MDRV_CPU_ADD(Z80, 3579545)
411394   /* audio CPU */
412   MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound)
395   MDRV_CPU_PROGRAM_MAP(sound_map,0)
413396
414397   /* video hardware */
415398   MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
src/mame/drivers/multigam.c
r2241r2242
3535         - ROM at 0x80000:  Several things patched and/or relocated.
3636                            Most original NOPs were replaced by proper code.
3737
38    Multi Game III: 21 games included, hardware features MMC3 NES mapper and additional
39    RAM used by Super Mario Bros 3.
3840*/
3941
4042#include "driver.h"
r2241r2242
4345#include "sound/nes_apu.h"
4446#include "cpu/m6502/m6502.h"
4547
48/******************************************************
49
50   NES interface
51
52*******************************************************/
53
4654static WRITE8_HANDLER( sprite_dma_w )
4755{
4856   int source = ( data & 7 );
r2241r2242
6472   NESPSG_0_w(machine, 0x17, data);
6573}
6674
67/* Inputs */
75/******************************************************
6876
77   Inputs
78
79*******************************************************/
80
6981static UINT32 in_0;
7082static UINT32 in_1;
7183static UINT32 in_0_shift;
r2241r2242
109121}
110122
111123
112/*PRG and VROM Banking */
124/******************************************************
113125
126   ROM/VROM banking (Multi Game)
127
128*******************************************************/
129
114130static int multigam_game_gfx_bank = 0;
115131
116static WRITE8_HANDLER( multigam_mapper_w )
132static WRITE8_HANDLER(multigam_switch_prg_rom)
117133{
118   if ( offset == 0x0fff )
134   /* switch PRG rom */
135   UINT8* dst = memory_region( REGION_CPU1 );
136   UINT8* src = memory_region( REGION_USER1 );
137
138   if ( data & 0x80 )
119139   {
120      /* switch PRG rom */
121      UINT8* dst = memory_region( REGION_CPU1 );
122      UINT8* src = memory_region( REGION_USER1 );
123
124      if ( data & 0x80 )
140      if ( data & 0x01 )
125141      {
126         if ( data & 0x01 )
127         {
128            data &= ~0x01;
129         }
130         memcpy( &dst[0x8000], &src[(data & 0x7f) * 0x4000], 0x8000 );
142         data &= ~0x01;
131143      }
132      else
133      {
134         memcpy( &dst[0x8000], &src[data*0x4000], 0x4000 );
135         memcpy( &dst[0xc000], &src[data*0x4000], 0x4000 );
136      }
144      memcpy( &dst[0x8000], &src[(data & 0x7f) * 0x4000], 0x8000 );
137145   }
138   else if ( offset == 0x1fff )
139   {
140      ppu2c0x_set_videorom_bank( 0, 0, 8, data /*& 0x3f*/, 512 );
141      ppu2c0x_set_mirroring( 0, data & 0x40 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
142      multigam_game_gfx_bank = data;
143   }
144146   else
145147   {
146      logerror( "Unmapped multigam_mapper_w: offset = %04X, data = %02X\n", offset, data );
148      memcpy( &dst[0x8000], &src[data*0x4000], 0x4000 );
149      memcpy( &dst[0xc000], &src[data*0x4000], 0x4000 );
147150   }
148}
151};
149152
153static WRITE8_HANDLER(multigam_switch_gfx_rom)
154{
155   ppu2c0x_set_videorom_bank( 0, 0, 8, data /*& 0x3f*/, 512 );
156   ppu2c0x_set_mirroring( 0, data & 0x40 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
157   multigam_game_gfx_bank = data;
158};
159
160
150161static WRITE8_HANDLER(multigam_mapper2_w)
151162{
152163   if ( multigam_game_gfx_bank & 0x80 )
r2241r2242
159170   }
160171}
161172
173/******************************************************
174
175   Memory map (Multi Game)
176
177*******************************************************/
178
162179static ADDRESS_MAP_START( multigam_map, ADDRESS_SPACE_PROGRAM, 8 )
163180   AM_RANGE(0x0000, 0x07ff) AM_RAM   /* NES RAM */
164181   AM_RANGE(0x0800, 0x0fff) AM_RAM /* additional RAM */
r2241r2242
171188   AM_RANGE(0x5002, 0x5002) AM_WRITENOP
172189   AM_RANGE(0x5000, 0x5ffe) AM_ROM
173190   AM_RANGE(0x5fff, 0x5fff) AM_READ(multigam_inputs_r)
174   AM_RANGE(0x6000, 0x7fff) AM_ROM AM_WRITE(multigam_mapper_w)
191   AM_RANGE(0x6000, 0x7fff) AM_ROM
192   AM_RANGE(0x6fff, 0x6fff) AM_WRITE(multigam_switch_prg_rom)
193   AM_RANGE(0x7fff, 0x7fff) AM_WRITE(multigam_switch_gfx_rom)
175194   AM_RANGE(0x8000, 0xffff) AM_ROM AM_WRITE(multigam_mapper2_w)
176195ADDRESS_MAP_END
177196
178static INPUT_PORTS_START( multigam )
197/******************************************************
198
199   MMC3 (Multi Game III)
200
201*******************************************************/
202
203static int multigam3_mmc3_scanline_counter;
204static int multigam3_mmc3_scanline_latch;
205static int multigam3_mmc3_banks[2];
206static int multigam3_mmc3_4screen;
207static int multigam3_mmc3_last_bank = 0xff;
208static UINT8* multigmc_mmc3_6000_ram;
209
210static void multigam3_mmc3_scanline_cb( int num, int scanline, int vblank, int blanked )
211{
212   if ( !vblank && !blanked )
213   {
214      if ( --multigam3_mmc3_scanline_counter == -1 )
215      {
216         multigam3_mmc3_scanline_counter = multigam3_mmc3_scanline_latch;
217         cpunum_set_input_line(Machine, 0, 0, PULSE_LINE );
218      }
219   }
220}
221
222static WRITE8_HANDLER( multigam3_mmc3_rom_switch_w )
223{
224   /* basically, a MMC3 mapper from the nes */
225   static int multigam3_mmc3_command;
226
227   switch( offset & 0x7001 )
228   {
229      case 0x0000:
230         multigam3_mmc3_command = data;
231
232         if ( multigam3_mmc3_last_bank != ( data & 0xc0 ) )
233         {
234            int bank;
235
236            /* reset the banks */
237            if ( multigam3_mmc3_command & 0x40 )
238            {
239               /* high bank */
240               bank = multigam3_mmc3_banks[0] * 0x2000 + 0xa0000;
241
242               memcpy( &memory_region( REGION_CPU1 )[0x0c000], &memory_region( REGION_USER1 )[bank], 0x2000 );
243               memcpy( &memory_region( REGION_CPU1 )[0x08000], &memory_region( REGION_USER1 )[0xa0000 + 0x3c000], 0x2000 );
244            }
245            else
246            {
247               /* low bank */
248               bank = multigam3_mmc3_banks[0] * 0x2000 + 0xa0000;
249
250               memcpy( &memory_region( REGION_CPU1 )[0x08000], &memory_region( REGION_USER1 )[bank], 0x2000 );
251               memcpy( &memory_region( REGION_CPU1 )[0x0c000], &memory_region( REGION_USER1 )[0xa0000 + 0x3c000], 0x2000 );
252            }
253
254            /* mid bank */
255            bank = multigam3_mmc3_banks[1] * 0x2000 + 0xa0000;
256            memcpy( &memory_region( REGION_CPU1 )[0x0a000], &memory_region( REGION_USER1 )[bank], 0x2000 );
257
258            multigam3_mmc3_last_bank = data & 0xc0;
259         }
260      break;
261
262      case 0x0001:
263         {
264            UINT8 cmd = multigam3_mmc3_command & 0x07;
265            int page = ( multigam3_mmc3_command & 0x80 ) >> 5;
266            int bank;
267
268            switch( cmd )
269            {
270               case 0:   /* char banking */
271               case 1: /* char banking */
272                  data &= 0xfe;
273                  page ^= ( cmd << 1 );
274                  ppu2c0x_set_videorom_bank( 0, page, 2, 0x100 + data, 64 );
275               break;
276
277               case 2: /* char banking */
278               case 3: /* char banking */
279               case 4: /* char banking */
280               case 5: /* char banking */
281                  page ^= cmd + 2;
282                  ppu2c0x_set_videorom_bank( 0, page, 1, 0x100 + data, 64 );
283               break;
284
285               case 6: /* program banking */
286                  if ( multigam3_mmc3_command & 0x40 )
287                  {
288                     /* high bank */
289                     multigam3_mmc3_banks[0] = data & 0x1f;
290                     bank = ( multigam3_mmc3_banks[0] ) * 0x2000 + 0xa0000;
291
292                     memcpy( &memory_region( REGION_CPU1 )[0x0c000], &memory_region( REGION_USER1 )[bank], 0x2000 );
293                     memcpy( &memory_region( REGION_CPU1 )[0x08000], &memory_region( REGION_USER1 )[0xa0000 + 0x3c000], 0x2000 );
294                  }
295                  else
296                  {
297                     /* low bank */
298                     multigam3_mmc3_banks[0] = data & 0x1f;
299                     bank = ( multigam3_mmc3_banks[0] ) * 0x2000 + 0xa0000;
300
301                     memcpy( &memory_region( REGION_CPU1 )[0x08000], &memory_region( REGION_USER1 )[bank], 0x2000 );
302                     memcpy( &memory_region( REGION_CPU1 )[0x0c000], &memory_region( REGION_USER1 )[0xa0000 + 0x3c000], 0x2000 );
303                  }
304               break;
305
306               case 7: /* program banking */
307                  {
308                     /* mid bank */
309                     multigam3_mmc3_banks[1] = data & 0x1f;
310                     bank = multigam3_mmc3_banks[1] * 0x2000 + 0xa0000;
311
312                     memcpy( &memory_region( REGION_CPU1 )[0x0a000], &memory_region( REGION_USER1 )[bank], 0x2000 );
313                  }
314               break;
315            }
316         }
317      break;
318
319      case 0x2000: /* mirroring */
320         if( !multigam3_mmc3_4screen )
321         {
322            if ( data & 0x40 )
323               ppu2c0x_set_mirroring( 0, PPU_MIRROR_HIGH );
324            else
325               ppu2c0x_set_mirroring( 0, ( data & 1 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
326         }
327      break;
328
329      case 0x2001: /* enable ram at $6000 */
330         /* ignored - we always enable it */
331      break;
332
333      case 0x4000: /* scanline counter */
334         multigam3_mmc3_scanline_counter = data;
335      break;
336
337      case 0x4001: /* scanline latch */
338         multigam3_mmc3_scanline_latch = data;
339      break;
340
341      case 0x6000: /* disable irqs */
342         ppu2c0x_set_scanline_callback( 0, 0 );
343      break;
344
345      case 0x6001: /* enable irqs */
346         ppu2c0x_set_scanline_callback( 0, multigam3_mmc3_scanline_cb );
347      break;
348   }
349}
350
351static void multigam_init_smb3(void)
352{
353   UINT8* dst = memory_region( REGION_CPU1 );
354   UINT8* src = memory_region( REGION_USER1 );
355
356   memcpy(&dst[0x8000], &src[0xa0000 + 0x3c000], 0x4000);
357   memcpy(&dst[0xc000], &src[0xa0000 + 0x3c000], 0x4000);
358
359   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, multigam3_mmc3_rom_switch_w );
360
361   memory_set_bankptr(1, multigmc_mmc3_6000_ram);
362
363   multigam3_mmc3_banks[0] = 0x1e;
364   multigam3_mmc3_banks[1] = 0x1f;
365   multigam3_mmc3_scanline_counter = 0;
366   multigam3_mmc3_scanline_latch = 0;
367   multigam3_mmc3_4screen = 0;
368   multigam3_mmc3_last_bank = 0xff;
369
370};
371
372static WRITE8_HANDLER(multigm3_mapper2_w)
373{
374   if ( multigam_game_gfx_bank & 0x80 )
375   {
376      ppu2c0x_set_videorom_bank( 0, 0, 8, (multigam_game_gfx_bank & 0xfc)  + (data & 0x3), 512 );
377   }
378   else
379   {
380      logerror( "Unmapped multigam_mapper2_w: offset = %04X, data = %02X\n", offset, data );
381   }
382};
383
384static WRITE8_HANDLER(multigm3_switch_prg_rom)
385{
386   /* switch PRG rom */
387   UINT8* dst = memory_region( REGION_CPU1 );
388   UINT8* src = memory_region( REGION_USER1 );
389
390   if ( data == 0xa8 )
391   {
392      multigam_init_smb3();
393      return;
394   }
395   else
396   {
397      memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, multigm3_mapper2_w );
398      memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x6000);
399   }
400
401   if ( data & 0x80 )
402   {
403      if ( data & 0x01 )
404      {
405         data &= ~0x01;
406      }
407      memcpy( &dst[0x8000], &src[(data & 0x7f) * 0x4000], 0x8000 );
408   }
409   else
410   {
411      memcpy( &dst[0x8000], &src[data*0x4000], 0x4000 );
412      memcpy( &dst[0xc000], &src[data*0x4000], 0x4000 );
413   }
414};
415
416/******************************************************
417
418   Memory map (Multi Game III)
419
420*******************************************************/
421
422static ADDRESS_MAP_START( multigm3_map, ADDRESS_SPACE_PROGRAM, 8 )
423   AM_RANGE(0x0000, 0x07ff) AM_RAM   /* NES RAM */
424   AM_RANGE(0x0800, 0x0fff) AM_RAM /* additional RAM */
425   AM_RANGE(0x2000, 0x3fff) AM_READWRITE(ppu2c0x_0_r, ppu2c0x_0_w)
426   AM_RANGE(0x4000, 0x4013) AM_READWRITE(NESPSG_0_r, NESPSG_0_w)         /* PSG primary registers */
427   AM_RANGE(0x4014, 0x4014) AM_WRITE(sprite_dma_w)
428   AM_RANGE(0x4015, 0x4015) AM_READWRITE(psg_4015_r, psg_4015_w)         /* PSG status / first control register */
429   AM_RANGE(0x4016, 0x4016) AM_READWRITE(multigam_IN0_r,        multigam_IN0_w)         /* IN0 - input port 1 */
430   AM_RANGE(0x4017, 0x4017) AM_READWRITE(multigam_IN1_r,        psg_4017_w)      /* IN1 - input port 2 / PSG second control register */
431   AM_RANGE(0x5001, 0x5001) AM_WRITE(multigm3_switch_prg_rom)
432   AM_RANGE(0x5002, 0x5002) AM_WRITENOP
433   AM_RANGE(0x5003, 0x5003) AM_WRITE(multigam_switch_gfx_rom)
434   AM_RANGE(0x5000, 0x5ffe) AM_ROM
435   AM_RANGE(0x5fff, 0x5fff) AM_READ(multigam_inputs_r)
436   AM_RANGE(0x6000, 0x7fff) AM_RAMBANK(1)
437   AM_RANGE(0x6fff, 0x6fff) AM_WRITENOP /* 0x00 in attract mode, 0xff during play */
438   AM_RANGE(0x8000, 0xffff) AM_ROM AM_WRITE(multigm3_mapper2_w)
439ADDRESS_MAP_END
440
441/******************************************************
442
443   Input ports
444
445*******************************************************/
446
447static INPUT_PORTS_START( multigam_common )
179448   PORT_START /* IN0 */
180449   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)
181450   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
r2241r2242
198467
199468   PORT_START /* IN2 */
200469   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
470INPUT_PORTS_END
201471
472static INPUT_PORTS_START( multigam )
473   PORT_INCLUDE( multigam_common )
474
202475   PORT_START /* IN3 */
203476   PORT_DIPNAME( 0x06, 0x00, "Coin/Time" )
204477   PORT_DIPSETTING( 0x00, "3 min" )
r2241r2242
207480   PORT_DIPSETTING( 0x06, "10 min" )
208481INPUT_PORTS_END
209482
483static INPUT_PORTS_START( multigm3 )
484   PORT_INCLUDE( multigam_common )
485
486   PORT_START /* IN3 */
487   PORT_DIPNAME( 0x06, 0x00, "Coin/Time" )
488   PORT_DIPSETTING( 0x00, "15 min" )
489   PORT_DIPSETTING( 0x04, "8 min" )
490   PORT_DIPSETTING( 0x02, "11 min" )
491   PORT_DIPSETTING( 0x06, "5 min" )
492INPUT_PORTS_END
493
494
495/******************************************************
496
497   PPU/Video interface
498
499*******************************************************/
500
210501static const struct NESinterface multigam_interface_1 =
211502{
212503   REGION_CPU1
213504};
214505
215static MACHINE_RESET( multigam )
216{
217   /* reset the ppu */
218   ppu2c0x_reset( 0, 1 );
219}
220
221506static PALETTE_INIT( multigam )
222507{
223508   ppu2c0x_init_palette(machine, 0 );
r2241r2242
252537   return 0;
253538}
254539
255static DRIVER_INIT( multigam )
256{
257   multigam_mapper_w( machine, 0x0fff, 0x01 );
258}
259
260540static GFXDECODE_START( multigam )
261541   /* none, the ppu generates one */
262542GFXDECODE_END
263543
544/******************************************************
545
546   Machine
547
548*******************************************************/
549
550static MACHINE_RESET( multigam )
551{
552   /* reset the ppu */
553   ppu2c0x_reset( 0, 1 );
554}
555
556static MACHINE_RESET( multigm3 )
557{
558   /* reset the ppu */
559   ppu2c0x_reset( 0, 1 );
560   multigm3_switch_prg_rom(machine, 0, 0x01 );
561};
562
563
264564static MACHINE_DRIVER_START( multigam )
265565   /* basic machine hardware */
266566   MDRV_CPU_ADD_TAG("main", N2A03, N2A03_DEFAULTCLOCK)
r2241r2242
293593   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
294594MACHINE_DRIVER_END
295595
596static MACHINE_DRIVER_START( multigm3 )
597   MDRV_IMPORT_FROM(multigam)
598   MDRV_CPU_MODIFY("main")
599   MDRV_CPU_PROGRAM_MAP(multigm3_map, 0)
600
601   MDRV_MACHINE_RESET( multigm3 )
602MACHINE_DRIVER_END
603
296604ROM_START( multigam )
297605   ROM_REGION( 0x10000, REGION_CPU1, 0 )
298606   ROM_LOAD( "7.bin", 0x0000, 0x8000, CRC(f0fa7cf2) SHA1(7f3b3dca796b964893197aef7f0f31dfd7a2c1a4) )
r2241r2242
331639   ROM_FILL( 0x60000, 0x20000, 0x00 )
332640ROM_END
333641
642ROM_START( multigm3 )
643   ROM_REGION( 0x10000, REGION_CPU1, 0 )
644   ROM_LOAD( "mg3-6.bin", 0x0000, 0x8000, CRC(3c1e53f1) SHA1(2eaf84e592db58cd268738da2642c716895e4eaa) )
334645
646   ROM_REGION( 0x100000, REGION_USER1, 0 )
647   ROM_LOAD( "mg3-2.bin", 0x00000, 0x20000, CRC(de6d2232) SHA1(30a5e6cd44cfbce2c5186dbc45c0c14c8b1510c4) )
648   ROM_LOAD( "mg3-1.bin", 0x40000, 0x20000, CRC(b0dc8136) SHA1(6d7334aae9047ec2028790bd3b326458b5cdc737) )
649   ROM_LOAD( "mg3-3.bin", 0x60000, 0x20000, CRC(6e96d642) SHA1(45eb954a0a905ad48ebc04ee3ed8858a1077817a) )
650   ROM_LOAD( "mg3-5.bin", 0xa0000, 0x40000, CRC(44609e6f) SHA1(c12a63e34b379427a3c146f1f85688fedf55ed0f) )
651   ROM_LOAD( "mg3-4.bin", 0xe0000, 0x20000, CRC(9b022e13) SHA1(96ad9c49cf72fe19a3e9944f8102d2d905266e92) )
652
653
654   ROM_REGION( 0x80000, REGION_GFX1, 0 )
655   ROM_LOAD( "mg3-7.bin", 0x00000, 0x20000, CRC(d8308cdb) SHA1(7bfb864611c32cf3740cfd650bfe275513d511d7) )
656   ROM_LOAD( "mg3-8.bin", 0x20000, 0x20000, CRC(b4a53b9d) SHA1(63d8901149d0d9b69f28bfc096f7932448542032) )
657   ROM_LOAD( "mg3-9.bin", 0x40000, 0x20000, CRC(a0ae2b4b) SHA1(5e026ad8a6b2a8120e386471d5178625bda04525) )
658   ROM_FILL( 0x60000, 0x20000, 0x00 )
659ROM_END
660
661static DRIVER_INIT( multigam )
662{
663   multigam_switch_prg_rom( machine, 0x0, 0x01 );
664}
665
666static void multigm3_decrypt(UINT8* mem, int memsize, const UINT8* decode_nibble)
667{
668   int i;
669   for (i = 0; i < memsize; i++)
670   {
671      mem[i] = decode_nibble[mem[i] & 0x0f] | (decode_nibble[mem[i] >> 4] << 4);
672   }
673};
674
675static DRIVER_INIT(multigm3)
676{
677   const UINT8 decode[16]  = { 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a };
678
679   multigm3_decrypt(memory_region(REGION_CPU1), memory_region_length(REGION_CPU1), decode );
680   multigm3_decrypt(memory_region(REGION_USER1), memory_region_length(REGION_USER1), decode );
681
682   multigmc_mmc3_6000_ram = auto_malloc(0x2000);
683}
684
335685GAME( 1992, multigam, 0,        multigam, multigam, multigam, ROT0, "unknown", "Multi Game (set 1)", 0 )
336686GAME( 1992, multigmb, multigam, multigam, multigam, multigam, ROT0, "unknown", "Multi Game (set 2)", 0 )
687GAME( 19??, multigm3, 0,        multigm3, multigm3, multigm3, ROT0, "Seo Jin", "Multi Game III", 0 )
src/mame/drivers/atarigx2.c
r2241r2242
9898#if 0
9999static WRITE32_HANDLER( a2d_select_w )
100100{
101   if (ACCESSING_MSW32)
101   if (ACCESSING_BITS_16_31)
102102      which_input = offset * 2;
103   if (ACCESSING_LSW32)
103   if (ACCESSING_BITS_0_15)
104104      which_input = offset * 2 + 1;
105105}
106106#endif
r2241r2242
136136   logerror("latch_w(%08X) & %08X\n", data, ~mem_mask);
137137
138138   /* upper byte */
139   if (!(mem_mask & 0xff000000))
139   if (ACCESSING_BITS_24_31)
140140   {
141141      /* bits 13-11 are the MO control bits */
142142      atarirle_control_w(0, (data >> 27) & 7);
143143   }
144144
145145   /* lower byte */
146   if (!(mem_mask & 0x00ff0000))
146   if (ACCESSING_BITS_16_23)
147147      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 0x100000) ? CLEAR_LINE : ASSERT_LINE);
148148}
149149
r2241r2242
151151static WRITE32_HANDLER( mo_command_w )
152152{
153153   COMBINE_DATA(mo_command);
154   if (ACCESSING_LSW32)
154   if (ACCESSING_BITS_0_15)
155155      atarirle_command_w(0, ((data & 0xffff) == 2) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
156156}
157157
r2241r2242
173173//      if (pc == 0x11cbe || pc == 0x11c30)
174174//          logerror("%06X:Protection W@%04X = %04X  (result to %06X)\n", pc, offset, data, activecpu_get_reg(M68K_A2));
175175//      else
176      if (ACCESSING_MSW32)
176      if (ACCESSING_BITS_16_31)
177177         logerror("%06X:Protection W@%04X = %04X\n", pc, offset * 4, data >> 16);
178178      else
179179         logerror("%06X:Protection W@%04X = %04X\n", pc, offset * 4 + 2, data);
r2241r2242
181181
182182   COMBINE_DATA(&protection_base[offset]);
183183
184   if (ACCESSING_MSW32)
184   if (ACCESSING_BITS_16_31)
185185   {
186186      last_write = protection_base[offset] >> 16;
187187      last_write_offset = offset*2;
188188   }
189   if (ACCESSING_LSW32)
189   if (ACCESSING_BITS_0_15)
190190   {
191191      last_write = protection_base[offset] & 0xffff;
192192      last_write_offset = offset*2+1;
r2241r2242
11531153      }
11541154   }
11551155
1156   if (ACCESSING_MSW32)
1156   if (ACCESSING_BITS_16_31)
11571157      logerror("%06X:Protection R@%04X = %04X\n", activecpu_get_previouspc(), offset * 4, result >> 16);
11581158   else
11591159      logerror("%06X:Protection R@%04X = %04X\n", activecpu_get_previouspc(), offset * 4 + 2, result);
src/mame/drivers/fuukifg2.c
r2241r2242
7878
7979static WRITE16_HANDLER( fuuki16_sound_command_w )
8080{
81   if (ACCESSING_LSB)
81   if (ACCESSING_BITS_0_7)
8282   {
8383      soundlatch_w(machine,0,data & 0xff);
8484      cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
src/mame/drivers/nwk-tr.c
r2241r2242
5050{
5151   COMBINE_DATA(&paletteram32[offset]);
5252   data = paletteram32[offset];
53   palette_set_color_rgb(Machine, offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
53   palette_set_color_rgb(machine, offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
5454}
5555
5656
r2241r2242
511511
512512   switch (offset)
513513   {
514      case 0x54/4:   return mame_rand(Machine) << 16; break;
515      case 0x5c/4:   return mame_rand(Machine) << 16 | mame_rand(Machine); break;
514      case 0x54/4:   return mame_rand(machine) << 16; break;
515      case 0x5c/4:   return mame_rand(machine) << 16 | mame_rand(machine); break;
516516   }
517517
518518   return K001604_reg[chip][offset];
r2241r2242
571571   UINT32 r = 0;
572572   if (offset == 0)
573573   {
574      if (!(mem_mask & 0xff000000))
574      if (ACCESSING_BITS_24_31)
575575      {
576576         r |= readinputport(0) << 24;
577577      }
578      if (!(mem_mask & 0x00ff0000))
578      if (ACCESSING_BITS_16_23)
579579      {
580580         r |= readinputport(1) << 16;
581581      }
582      if (!(mem_mask & 0x0000ff00))
582      if (ACCESSING_BITS_8_15)
583583      {
584584         r |= readinputport(2) << 8;
585585      }
586      if (!(mem_mask & 0x000000ff))
586      if (ACCESSING_BITS_0_7)
587587      {
588588         r |= (adc1213x_do_r(0)) | (adc1213x_eoc_r(0) << 2);
589589      }
590590   }
591591   else if (offset == 1)
592592   {
593      if (!(mem_mask & 0xff000000))
593      if (ACCESSING_BITS_24_31)
594594      {
595595         r |= readinputport(3) << 24;
596596      }
r2241r2242
602602{
603603   if( offset == 0 )
604604   {
605      if (!(mem_mask & 0xff000000))
605      if (ACCESSING_BITS_24_31)
606606      {
607607         led_reg0 = (data >> 24) & 0xff;
608608      }
609      if (!(mem_mask & 0x00ff0000))
609      if (ACCESSING_BITS_16_23)
610610      {
611611         led_reg1 = (data >> 16) & 0xff;
612612      }
r2241r2242
614614   }
615615   if( offset == 1 )
616616   {
617      if (!(mem_mask & 0xff000000))
617      if (ACCESSING_BITS_24_31)
618618      {
619619         int cs = (data >> 27) & 0x1;
620620         int conv = (data >> 26) & 0x1;
r2241r2242
626626         adc1213x_di_w(0, di);
627627         adc1213x_sclk_w(0, sclk);
628628      }
629      if (!(mem_mask & 0x000000ff))
629      if (ACCESSING_BITS_0_7)
630630      {
631631         if (data & 0x80)   // CG Board 1 IRQ Ack
632632         {
633            //cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ1, CLEAR_LINE);
633            //cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ1, CLEAR_LINE);
634634         }
635635         if (data & 0x40)   // CG Board 0 IRQ Ack
636636         {
637            //cpunum_set_input_line(Machine, 0, INPUT_LINE_IRQ0, CLEAR_LINE);
637            //cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, CLEAR_LINE);
638638         }
639639      }
640640      return;
r2241r2242
679679
680680   if (offset == 0)
681681   {
682      if (!(mem_mask & 0x000000ff))
682      if (ACCESSING_BITS_0_7)
683683      {
684684         r |= lanc2_ram[lanc2_ram_r & 0x7fff];
685685         lanc2_ram_r++;
r2241r2242
692692
693693   if (offset == 4)
694694   {
695      if (!(mem_mask & 0xff000000))
695      if (ACCESSING_BITS_24_31)
696696      {
697697         r |= 0x00000000;
698698      }
r2241r2242
707707{
708708   if (offset == 0)
709709   {
710      if (!(mem_mask & 0xff000000))
710      if (ACCESSING_BITS_24_31)
711711      {
712712         UINT8 value = data >> 24;
713713
r2241r2242
724724
725725         //printf("lanc2_fpga_w: %02X at %08X\n", value, activecpu_get_pc());
726726      }
727      else if (!(mem_mask & 0x000000ff))
727      else if (ACCESSING_BITS_0_7)
728728      {
729729         lanc2_ram[lanc2_ram_w & 0x7fff] = data & 0xff;
730730         lanc2_ram_w++;
r2241r2242
736736   }
737737   if (offset == 4)
738738   {
739      if (mame_stricmp(Machine->gamedrv->name, "thrilld") == 0)
739      if (mame_stricmp(machine->gamedrv->name, "thrilld") == 0)
740740      {
741741         work_ram[(0x3ffed0/4) + 0] = 0x472a3731;
742742         work_ram[(0x3ffed0/4) + 1] = 0x33202020;
src/mame/drivers/vulgus.c
r2241r2242
6767}
6868
6969
70
71static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
72   AM_RANGE(0x0000, 0x9fff) AM_READ(SMH_ROM)
70static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
71   AM_RANGE(0x0000, 0x9fff) AM_ROM
7372   AM_RANGE(0xc000, 0xc000) AM_READ(input_port_0_r)
7473   AM_RANGE(0xc001, 0xc001) AM_READ(input_port_1_r)
7574   AM_RANGE(0xc002, 0xc002) AM_READ(input_port_2_r)
7675   AM_RANGE(0xc003, 0xc003) AM_READ(input_port_3_r)
7776   AM_RANGE(0xc004, 0xc004) AM_READ(input_port_4_r)
78   AM_RANGE(0xd000, 0xefff) AM_READ(SMH_RAM)
79ADDRESS_MAP_END
80
81static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
82   AM_RANGE(0x0000, 0x9fff) AM_WRITE(SMH_ROM)
8377   AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_w)
84   AM_RANGE(0xc802, 0xc803) AM_WRITE(SMH_RAM) AM_BASE(&vulgus_scroll_low)
78   AM_RANGE(0xc802, 0xc803) AM_RAM AM_BASE(&vulgus_scroll_low)
8579   AM_RANGE(0xc804, 0xc804) AM_WRITE(vulgus_c804_w)
8680   AM_RANGE(0xc805, 0xc805) AM_WRITE(vulgus_palette_bank_w)
87   AM_RANGE(0xc902, 0xc903) AM_WRITE(SMH_RAM) AM_BASE(&vulgus_scroll_high)
88   AM_RANGE(0xcc00, 0xcc7f) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
89   AM_RANGE(0xd000, 0xd7ff) AM_WRITE(vulgus_fgvideoram_w) AM_BASE(&vulgus_fgvideoram)
90   AM_RANGE(0xd800, 0xdfff) AM_WRITE(vulgus_bgvideoram_w) AM_BASE(&vulgus_bgvideoram)
91   AM_RANGE(0xe000, 0xefff) AM_WRITE(SMH_RAM)
81   AM_RANGE(0xc902, 0xc903) AM_RAM AM_BASE(&vulgus_scroll_high)
82   AM_RANGE(0xcc00, 0xcc7f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
83   AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_WRITE(vulgus_fgvideoram_w) AM_BASE(&vulgus_fgvideoram)
84   AM_RANGE(0xd800, 0xdfff) AM_RAM AM_WRITE(vulgus_bgvideoram_w) AM_BASE(&vulgus_bgvideoram)
85   AM_RANGE(0xe000, 0xefff) AM_RAM
9286ADDRESS_MAP_END
9387
94
95static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
96   AM_RANGE(0x0000, 0x1fff) AM_READ(SMH_ROM)
97   AM_RANGE(0x4000, 0x47ff) AM_READ(SMH_RAM)
98   AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r)
99ADDRESS_MAP_END
100
101static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
102   AM_RANGE(0x0000, 0x1fff) AM_WRITE(SMH_ROM)
88static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
89   AM_RANGE(0x0000, 0x1fff) AM_ROM
90   AM_RANGE(0x4000, 0x47ff) AM_RAM
10391   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM)
92   AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r)
10493   AM_RANGE(0x8000, 0x8000) AM_WRITE(AY8910_control_port_0_w)
10594   AM_RANGE(0x8001, 0x8001) AM_WRITE(AY8910_write_port_0_w)
10695   AM_RANGE(0xc000, 0xc000) AM_WRITE(AY8910_control_port_1_w)
r2241r2242
10897ADDRESS_MAP_END
10998
11099
111
112100static INPUT_PORTS_START( vulgus )
113101   PORT_START      /* IN0 */
114102   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
r2241r2242
247235
248236   /* basic machine hardware */
249237   MDRV_CPU_ADD(Z80, 4000000)   /* 4 MHz (?) */
250   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
238   MDRV_CPU_PROGRAM_MAP(main_map,0)
251239   MDRV_CPU_VBLANK_INT_HACK(vulgus_interrupt,2)
252240
253241   MDRV_CPU_ADD(Z80, 3000000)
254242   /* audio CPU */   /* 3 MHz ??? */
255   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
243   MDRV_CPU_PROGRAM_MAP(sound_map,0)
256244   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,8)
257245
258246   /* video hardware */
src/mame/drivers/zac2650.c
r2241r2242
2525
2626static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
2727   AM_RANGE(0x0000, 0x17ff) AM_ROM
28   AM_RANGE(0x1800, 0x1bff) AM_READWRITE(SMH_RAM, tinvader_videoram_w) AM_BASE(&videoram)
28   AM_RANGE(0x1800, 0x1bff) AM_RAM AM_WRITE(tinvader_videoram_w) AM_BASE(&videoram)
2929   AM_RANGE(0x1c00, 0x1cff) AM_RAM
3030   AM_RANGE(0x1d00, 0x1dff) AM_RAM
3131   AM_RANGE(0x1e80, 0x1e80) AM_READWRITE(tinvader_port_0_r, tinvader_sound_w)
src/mame/drivers/shangha3.c
r2241r2242
7777
7878static WRITE16_HANDLER( shangha3_coinctrl_w )
7979{
80   if (ACCESSING_MSB)
80   if (ACCESSING_BITS_8_15)
8181   {
8282      coin_lockout_w(0,~data & 0x0400);
8383      coin_lockout_w(1,~data & 0x0400);
r2241r2242
8888
8989static WRITE16_HANDLER( heberpop_coinctrl_w )
9090{
91   if (ACCESSING_LSB)
91   if (ACCESSING_BITS_0_7)
9292   {
9393      /* the sound ROM bank is selected by the main CPU! */
9494      OKIM6295_set_bank_base(0,(data & 0x08) ? 0x40000 : 0x00000);
r2241r2242
103103
104104static WRITE16_HANDLER( heberpop_sound_command_w )
105105{
106   if (ACCESSING_LSB)
106   if (ACCESSING_BITS_0_7)
107107   {
108108      soundlatch_w(machine,0,data & 0xff);
109109      cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);   /* RST 38h */
src/mame/drivers/taotaido.c
r2241r2242
9191
9292static WRITE16_HANDLER( sound_command_w )
9393{
94   if (ACCESSING_LSB)
94   if (ACCESSING_BITS_0_7)
9595   {
9696      pending_command = 1;
9797      soundlatch_w(machine,offset,data & 0xff);
src/mame/drivers/relief.c
r2241r2242
120120
121121static WRITE16_HANDLER( audio_control_w )
122122{
123   if (ACCESSING_LSB)
123   if (ACCESSING_BITS_0_7)
124124   {
125125      ym2413_volume = (data >> 1) & 15;
126126      atarigen_set_ym2413_vol(machine, (ym2413_volume * overall_volume * 100) / (127 * 15));
127127      adpcm_bank_base = (0x040000 * ((data >> 6) & 3)) | (adpcm_bank_base & 0x100000);
128128   }
129   if (ACCESSING_MSB)
129   if (ACCESSING_BITS_8_15)
130130      adpcm_bank_base = (0x100000 * ((data >> 8) & 1)) | (adpcm_bank_base & 0x0c0000);
131131
132132   OKIM6295_set_bank_base(0, adpcm_bank_base);
r2241r2242
135135
136136static WRITE16_HANDLER( audio_volume_w )
137137{
138   if (ACCESSING_LSB)
138   if (ACCESSING_BITS_0_7)
139139   {
140140      overall_volume = data & 127;
141141      atarigen_set_ym2413_vol(machine, (ym2413_volume * overall_volume * 100) / (127 * 15));
r2241r2242
159159
160160static WRITE16_HANDLER( adpcm_w )
161161{
162   if (ACCESSING_LSB)
162   if (ACCESSING_BITS_0_7)
163163      OKIM6295_data_0_w(machine, offset, data & 0xff);
164164}
165165
r2241r2242
173173
174174static WRITE16_HANDLER( ym2413_w )
175175{
176   if (ACCESSING_LSB)
176   if (ACCESSING_BITS_0_7)
177177   {
178178      if (offset & 1)
179179         YM2413_data_port_0_w(machine, 0, data & 0xff);
src/mame/drivers/taito_f3.c
r2241r2242
8989         watchdog_reset(machine);
9090         return;
9191      case 0x01: /* Coin counters & lockouts */
92         if (ACCESSING_MSB32) {
92         if (ACCESSING_BITS_24_31) {
9393            coin_lockout_w(0,~data & 0x01000000);
9494            coin_lockout_w(1,~data & 0x02000000);
9595            coin_counter_w(0, data & 0x04000000);
r2241r2242
9898         }
9999         return;
100100      case 0x04: /* Eeprom */
101         if (ACCESSING_LSB32) {
101         if (ACCESSING_BITS_0_7) {
102102            EEPROM_set_clock_line((data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
103103            EEPROM_write_bit(data & 0x04);
104104            EEPROM_set_cs_line((data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
105105         }
106106         return;
107107      case 0x05:   /* Player 3 & 4 coin counters */
108         if (ACCESSING_MSB32) {
108         if (ACCESSING_BITS_24_31) {
109109            coin_lockout_w(2,~data & 0x01000000);
110110            coin_lockout_w(3,~data & 0x02000000);
111111            coin_counter_w(2, data & 0x04000000);
r2241r2242
134134      UINT32 idx;
135135
136136      idx = (offset << 1) & 0x1e;
137      if (ACCESSING_LSW32)
137      if (ACCESSING_BITS_0_15)
138138         idx += 1;
139139
140140      if (idx >= 8)
src/mame/drivers/guab.c
r0r2242
1/***************************************************************************
2
3    JPM Give us a Break hardware
4
5    preliminary driver by Phil Bennett
6
7    Games supported:
8        * Give us a Break [2 sets]
9        * Ten Up [2 sets]
10
11    Looking for:
12        * Numbers Game
13        * Pac Quiz
14        * Suit Pursuit
15        * Treasure Trail?
16
17    Known bugs:
18        * Neither game registers coins. Protection maybe?
19
20***************************************************************************/
21
22#include "driver.h"
23#include "machine/6840ptm.h"
24#include "video/tms34061.h"
25#include "sound/sn76496.h"
26#include "deprecat.h"
27
28
29/*************************************
30 *
31 *  Defines
32 *
33 *************************************/
34
35#define LOG_FDC_COMMANDS   0
36
37#if LOG_FDC_COMMANDS
38   #define FDC_LOG(x)      mame_printf_debug x
39#else
40   #define FDC_LOG(x)
41#endif
42
43
44enum
45{
46   INT_UNKNOWN1     = 1,
47   INT_UNKNOWN2     = 2,
48   INT_6840PTM      = 3,
49   INT_6850ACIA     = 4,
50   INT_TMS34061     = 5,
51   INT_FLOPPYCTRL   = 6,
52   INT_WATCHDOG_INT = 7,
53} int_levels;
54
55
56/*************************************
57 *
58 *  6840 PTM
59 *
60 *************************************/
61
62static void ptm_irq(int state)
63{
64   cpunum_set_input_line(Machine, 0, INT_6840PTM, state);
65}
66
67static const ptm6840_interface ptm_intf =
68{
69   1000000,
70   { 0, 0, 0 },
71   { 0, 0, 0 },
72   ptm_irq
73};
74
75
76/*************************************
77 *
78 *  Video hardware
79 *
80 *************************************/
81
82/*****************
83 * TMS34061 CRTC
84 *****************/
85
86static void tms_interrupt(running_machine *machine, int state)
87{
88   cpunum_set_input_line(machine, 0, INT_TMS34061, state);
89}
90
91static const struct tms34061_interface tms34061intf =
92{
93   "main",         /* The screen we are acting on */
94   8,            /* VRAM address is (row << rowshift) | col */
95   0x40000,      /* Size of video RAM */
96   tms_interrupt   /* Interrupt gen callback */
97};
98
99
100static WRITE16_HANDLER( guab_tms34061_w )
101{
102   int func = (offset >> 19) & 3;
103   int row = (offset >> 7) & 0xff;
104   int col;
105
106   if (func == 0 || func == 2)
107      col = offset  & 0xff;
108   else
109      col = offset <<= 1;
110
111   if (ACCESSING_BITS_8_15)
112      tms34061_w(col, row, func, data >> 8);
113
114   if (ACCESSING_BITS_0_7)
115      tms34061_w(col | 1, row, func, data & 0xff);
116}
117
118
119static READ16_HANDLER( guab_tms34061_r )
120{
121   UINT16 data = 0;
122   int func = (offset >> 19) & 3;
123   int row = (offset >> 7) & 0xff;
124   int col;
125
126   if (func == 0 || func == 2)
127      col = offset  & 0xff;
128   else
129      col = offset <<= 1;
130
131   if (ACCESSING_BITS_8_15)
132      data |= tms34061_r(col, row, func) << 8;
133
134   if (ACCESSING_BITS_0_7)
135      data |= tms34061_r(col | 1, row, func);
136
137   return data;
138}
139
140
141/****************************
142 *  EF9369 color palette IC
143 *  (16 colors from 4096)
144 ****************************/
145
146static struct ef9369
147{
148   UINT32 addr;
149   UINT16 clut[16];   /* 13-bits - a marking bit and a 444 color */
150} pal;
151
152
153/* Non-multiplexed mode */
154static WRITE16_HANDLER( ef9369_w )
155{
156   data &= 0x00ff;
157
158   /* Address register */
159   if (offset & 1)
160   {
161      pal.addr = data & 0x1f;
162   }
163   /* Data register */
164   else
165   {
166      UINT32 entry = pal.addr >> 1;
167
168      if ((pal.addr & 1) == 0)
169      {
170         pal.clut[entry] &= ~0x00ff;
171         pal.clut[entry] |= data;
172      }
173      else
174      {
175         UINT16 col;
176
177         pal.clut[entry] &= ~0x1f00;
178         pal.clut[entry] |= (data & 0x1f) << 8;
179
180         /* Remove the marking bit */
181         col = pal.clut[entry] & 0xfff;
182
183         /* Update the MAME palette */
184         palette_set_color_rgb(Machine, entry, pal4bit(col >> 0), pal4bit(col >> 4), pal4bit(col >> 8));
185      }
186
187         /* Address register auto-increment */
188      if (++pal.addr == 32)
189         pal.addr = 0;
190   }
191}
192
193static READ16_HANDLER( ef9369_r )
194{
195   if ((offset & 1) == 0)
196   {
197      UINT16 col = pal.clut[pal.addr >> 1];
198
199      if ((pal.addr & 1) == 0)
200         return col & 0xff;
201      else
202         return col >> 8;
203   }
204   else
205   {
206      /* Address register is write only */
207      return 0xffff;
208   }
209}
210
211
212static VIDEO_START( guab )
213{
214   tms34061_start(machine, &tms34061intf);
215}
216
217
218static VIDEO_UPDATE( guab )
219{
220   int x, y;
221   struct tms34061_display state;
222
223   tms34061_get_display_state(&state);
224
225   /* If blanked, fill with black */
226   if (state.blanked)
227   {
228      fillbitmap(bitmap, get_black_pen(screen->machine), cliprect);
229      return 0;
230   }
231
232   for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
233   {
234      UINT8 *src = &state.vram[256 * y];
235      UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
236
237      for (x = cliprect->min_x; x <= cliprect->max_x; x += 2)
238      {
239         UINT8 pen = src[x >> 1];
240
241         /* Draw two 4-bit pixels */
242         *dest++ = Machine->pens[pen >> 4];
243         *dest++ = Machine->pens[pen & 0x0f];
244      }
245   }
246
247   return 0;
248}
249
250
251/*************************************
252 *
253 *  WD1770 floppy disk controller
254 *  (just enough to get by...)
255 *
256 *************************************/
257
258struct wd1770
259{
260   UINT32   status;
261   UINT8   cmd;
262   UINT8   data;
263
264   UINT32   side;
265   INT32   track;
266   INT32   sector;
267   UINT32   sptr;
268} fdc;
269
270static emu_timer *fdc_timer;
271
272#define USEC_DELAY         40
273#define DISK_SIDES         2
274#define DISK_TRACKS         80
275#define DISK_SECTORS      18
276
277#define DISK_SECTOR_SIZE   256
278#define DISK_TRACK_SIZE      (DISK_SECTOR_SIZE * DISK_SECTORS)
279#define DISK_SIDE_SIZE      (DISK_TRACK_SIZE * DISK_TRACKS)
280
281enum
282{
283   BUSY          = 1 << 0,
284   DATA_REQUEST    = 1 << 1,
285   INDEX          = 1 << 1,
286   LOST_DATA       = 1 << 2,
287   TRACK_00       = 1 << 2,
288   CRC_ERROR       = 1 << 3,
289   RECORD_NOT_FOUND = 1 << 4,
290   RECORD_TYPE       = 1 << 5,
291   SPIN_UP          = 1 << 5,
292   WRITE_PROTECT    = 1 << 6,
293   MOTOR_ON       = 1 << 7
294} wd1770_status;
295
296
297static TIMER_CALLBACK( fdc_data_callback )
298{
299   UINT8* disk = (UINT8*)memory_region(REGION_USER1);
300   int more_data = 0;
301
302   /*
303        Disk dumps are organised as:
304
305        Side 0, Track 0: Sectors 0 - 17
306        Side 1, Track 0: Sectors 0 - 17
307        Side 0, Track 1: Sectors 0 - 17
308        Side 1, Track 1: Sectors 0 - 17
309        etc.
310    */
311
312   int idx = 2 * fdc.track * (DISK_TRACK_SIZE) + (fdc.side ? DISK_TRACK_SIZE : 0)+
313           fdc.sector * (DISK_SECTOR_SIZE) +
314           fdc.sptr;
315
316   /* Write or read? */
317   if (fdc.cmd & 0x20)
318      disk[idx] = fdc.data;
319   else
320      fdc.data = disk[idx];
321
322   fdc.sptr++;
323
324   if (fdc.sptr < DISK_SECTOR_SIZE)
325   {
326      more_data = 1;
327   }
328   else
329   {
330      fdc.sptr = 0;
331
332      /* Multi-sector read */
333      if (fdc.cmd & 0x10)
334      {
335         ++fdc.sector;
336
337         /* Keep going */
338         if (fdc.sector < DISK_SECTORS)
339            more_data = 1;
340      }
341   }
342
343   if (more_data)
344   {
345      timer_adjust_oneshot(fdc_timer, ATTOTIME_IN_USEC(USEC_DELAY), 0);
346   }
347   else
348   {
349      /* Hack!*/
350      fdc.cmd = 0;
351      fdc.status &= ~BUSY;
352   }
353
354   fdc.status |= DATA_REQUEST;
355   cpunum_set_input_line(machine, 0, INT_FLOPPYCTRL, ASSERT_LINE);
356}
357
358
359static WRITE16_HANDLER( wd1770_w )
360{
361   data &= 0xff;
362
363   switch (offset)
364   {
365      case 0:
366      {
367         UINT8 cmd = (data >> 4) & 0xf;
368
369         FDC_LOG(("Command: %x:: ", data));
370
371         switch (cmd)
372         {
373            /**** Type I ****/
374            case 0:
375            {
376               FDC_LOG(("Restore\n"));
377               fdc.track = 0;
378               break;
379            }
380
381            case 1:
382            {
383               FDC_LOG(("Seek to track %d\n", fdc.data));
384               fdc.track = fdc.data;
385               break;
386            }
387
388            /* Step */
389            case 2:
390            case 3:
391            {
392               FDC_LOG(("Step (not implemented)\n"));
393               break;
394            }
395
396            case 4: case 5:
397            {
398               if (++fdc.track >= DISK_TRACKS)
399                  fdc.track = DISK_TRACKS - 1;
400
401               FDC_LOG(("Step-in to track %d\n", fdc.track));
402               break;
403            }
404
405            case 6: case 7:
406            {
407               if (--fdc.track > 0)
408                  fdc.track = 0;
409
410               FDC_LOG(("Step-out to track %d\n", fdc.track));
411               break;
412            }
413
414
415            /**** Type II ****/
416            case 8:
417            case 9:
418            {
419               fdc.cmd = data;
420               fdc.status |= BUSY;
421
422               if (data & 0x10)
423                  FDC_LOG(("Multi "));
424
425               FDC_LOG(("Sector read: H%d T%d S%d\n",   fdc.side,
426                                             fdc.track,
427                                             fdc.sector));
428
429               /* Set the data read timer */
430               timer_adjust_oneshot(fdc_timer, ATTOTIME_IN_USEC(USEC_DELAY), 0);
431
432               break;
433            }
434
435            case 10:
436            case 11:
437            {
438               fdc.cmd = data;
439               fdc.status |= BUSY;
440
441               if (data & 0x10)
442                  FDC_LOG(("Multi "));
443
444               FDC_LOG(("Sector write: H%d T%d S%d\n",   fdc.side,
445                                             fdc.track,
446                                             fdc.sector));
447
448               /* Trigger a DRQ interrupt on the CPU */
449               cpunum_set_input_line(machine, 0, INT_FLOPPYCTRL, ASSERT_LINE);
450               fdc.status |= DATA_REQUEST;
451               break;
452            }
453
454            /**** Type III ****/
455            case 12: /* Read address */
456            case 14: /* Read track */
457            case 15: /* Write track */
458            {
459               FDC_LOG(("Unsupported TYPE III operation\n"));
460               break;
461            }
462
463            /**** Type IV ****/
464            case 13:
465            {
466               /* Stop any operation in progress */
467               timer_reset(fdc_timer, attotime_never);
468               fdc.status &= ~BUSY;
469               FDC_LOG(("Force Interrupt\n"));
470               break;
471            }
472         }
473
474         break;
475      }
476      case 1:
477      {
478         FDC_LOG(("Set track: %d\n", data));
479         fdc.track = data;
480         break;
481      }
482      case 2:
483      {
484         FDC_LOG(("Set sector: %d\n", data));
485         fdc.sector = data;
486         fdc.sptr = 0;
487         break;
488      }
489      case 3:
490      {
491         fdc.data = data;
492
493         /* Clear the DRQ */
494         cpunum_set_input_line(machine, 0, INT_FLOPPYCTRL, CLEAR_LINE);
495
496         /* Queue an event to write the data if write command was specified */
497         if (fdc.cmd & 0x20)
498            timer_adjust_oneshot(fdc_timer, ATTOTIME_IN_USEC(USEC_DELAY), 0);
499
500         break;
501      }
502   }
503}
504
505static READ16_HANDLER( wd1770_r )
506{
507   UINT16 retval = 0;
508
509   switch (offset)
510   {
511      case 0:
512      {
513         retval = fdc.status;
514         break;
515      }
516      case 1:
517      {
518         retval = fdc.track;
519         break;
520      }
521      case 2:
522      {
523         retval = fdc.sector;
524         break;
525      }
526      case 3:
527      {
528         retval = fdc.data;
529
530         /* Clear the DRQ */
531         cpunum_set_input_line(machine, 0, INT_FLOPPYCTRL, CLEAR_LINE);
532         fdc.status &= ~DATA_REQUEST;
533         break;
534      }
535   }
536
537   return retval;
538}
539
540
541/****************************************
542 *
543 *  Hardware inputs (coins, buttons etc)
544 *
545 ****************************************/
546
547static READ16_HANDLER( io_r )
548{
549   switch (offset)
550   {
551      case 0x00:
552      case 0x01:
553      case 0x02:
554      {
555         return readinputport(offset);
556      }
557      case 0x30:
558      {
559         /* Whatever it is, bit 7 must be 0 */
560         return 0x7f;
561      }
562      default:
563      {
564         return 0;
565      }
566   }
567}
568
569
570/****************************************
571 *
572 *  Hardware outputs (lamps, meters etc)
573 *
574 ****************************************/
575
576static WRITE16_HANDLER( io_w )
577{
578   switch (offset)
579   {
580      case 0x10:
581      {
582         /* Outputs 0 - 7 */
583         break;
584      }
585      case 0x11:
586      {
587         /* Outputs 8 - 15 */
588         break;
589      }
590      case 0x12:
591      {
592         /* Outputs 16 - 23 */
593         break;
594      }
595      case 0x20:
596      {
597         /* Outputs 24 - 31 */
598         break;
599      }
600      case 0x21:
601      {
602         /* Outputs 32 - 39 */
603         break;
604      }
605      case 0x22:
606      {
607         /* Outputs 40 - 47 */
608         break;
609      }
610      case 0x30:
611      {
612         SN76496_0_w(0, 0, data & 0xff);
613         break;
614      }
615      case 0x31:
616      {
617         /* Only JPM knows about the other bits... */
618         fdc.side = (data >> 3) & 1;
619         break;
620      }
621      case 0x32:
622      {
623         /* Watchdog? */
624         break;
625      }
626      case 0x33:
627      {
628         /* Dunno */
629         break;
630      }
631      default:
632      {
633         mame_printf_debug("Unknown IO W:0x%x with %x\n", 0xc0000 + (offset * 2), data);
634      }
635   }
636}
637
638
639/*************************************
640 *
641 *  68000 CPU memory handlers
642 *
643 *************************************/
644
645static ADDRESS_MAP_START( guab_map, ADDRESS_SPACE_PROGRAM, 16 )
646   AM_RANGE(0x000000, 0x00ffff) AM_ROM
647   AM_RANGE(0x040000, 0x04ffff) AM_ROM AM_REGION(REGION_CPU1, 0x10000)
648   AM_RANGE(0x0c0000, 0x0c007f) AM_READWRITE(io_r, io_w)
649   AM_RANGE(0x0c0080, 0x0c0083) AM_NOP /* ACIA 1 */
650   AM_RANGE(0x0c00a0, 0x0c00a3) AM_NOP /* ACIA 2 */
651   AM_RANGE(0x0c00c0, 0x0c00cf) AM_READWRITE(ptm6840_0_lsb_r, ptm6840_0_lsb_w)
652   AM_RANGE(0x0c00e0, 0x0c00e7) AM_READWRITE(wd1770_r, wd1770_w)
653   AM_RANGE(0x080000, 0x080fff) AM_RAM
654   AM_RANGE(0x100000, 0x100003) AM_READWRITE(ef9369_r, ef9369_w)
655   AM_RANGE(0x800000, 0xb0ffff) AM_READWRITE(guab_tms34061_r, guab_tms34061_w)
656   AM_RANGE(0xb10000, 0xb1ffff) AM_RAM
657   AM_RANGE(0xb80000, 0xb8ffff) AM_RAM
658   AM_RANGE(0xb90000, 0xb9ffff) AM_RAM
659ADDRESS_MAP_END
660
661
662/*************************************
663 *
664 *  Port definitions
665 *
666 *************************************/
667
668static INPUT_PORTS_START( guab )
669   PORT_START
670   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 )   PORT_NAME("50p")
671   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN4 )   PORT_NAME("100p")
672   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Back door")  PORT_CODE(KEYCODE_R) PORT_TOGGLE
673   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Cash door")  PORT_CODE(KEYCODE_T) PORT_TOGGLE
674   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key switch") PORT_CODE(KEYCODE_Y) PORT_TOGGLE
675   PORT_BIT( 0x20, IP_ACTIVE_HIGH,IPT_UNUSED )  PORT_NAME("50p level")
676   PORT_BIT( 0x40, IP_ACTIVE_HIGH,IPT_UNUSED )  PORT_NAME("100p level")
677   PORT_BIT( 0x80, IP_ACTIVE_HIGH,IPT_UNUSED )
678   PORT_START
679   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
680   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
681   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START )
682   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
683   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
684   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
685   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("A")
686   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("B")
687   PORT_START
688   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Select")
689   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
690   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
691   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
692   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("C")
693   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("D")
694   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )   PORT_NAME("10p")
695   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )   PORT_NAME("20p")
696INPUT_PORTS_END
697
698static INPUT_PORTS_START( tenup )
699   PORT_START
700   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 )   PORT_NAME("50p")
701   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN4 )   PORT_NAME("100p")
702   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Back door")  PORT_CODE(KEYCODE_R) PORT_TOGGLE
703   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Cash door")  PORT_CODE(KEYCODE_T) PORT_TOGGLE
704   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key switch") PORT_CODE(KEYCODE_Y) PORT_TOGGLE
705   PORT_BIT( 0x20, IP_ACTIVE_HIGH,IPT_UNUSED )  PORT_NAME("10p level")
706   PORT_BIT( 0x40, IP_ACTIVE_HIGH,IPT_UNUSED )  PORT_NAME("100p level")
707   PORT_BIT( 0x80, IP_ACTIVE_HIGH,IPT_UNUSED )
708   PORT_START
709   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
710   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
711   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START )
712   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
713   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
714   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
715   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
716   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Pass")
717   PORT_START
718   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Collect")
719   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
720   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
721   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("A")
722   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("B")
723   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("C")
724   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )   PORT_NAME("10p")
725   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )   PORT_NAME("20p")
726INPUT_PORTS_END
727
728
729/*************************************
730 *
731 *  Machine driver
732 *
733 *************************************/
734
735 static MACHINE_START( guab )
736{
737   fdc_timer = timer_alloc(fdc_data_callback, NULL);
738   ptm6840_config(0, &ptm_intf);
739}
740
741static MACHINE_RESET( guab )
742{
743   memset(&fdc, 0, sizeof(fdc));
744}
745
746static MACHINE_DRIVER_START( guab )
747   /* TODO: Verify clock */
748   MDRV_CPU_ADD_TAG("main", M68000, 8000000)
749   MDRV_CPU_PROGRAM_MAP(guab_map, 0)
750
751   MDRV_MACHINE_START(guab)
752   MDRV_MACHINE_RESET(guab)
753
754   /* TODO: Use real video timings */
755   MDRV_SCREEN_ADD("main", RASTER)
756   MDRV_SCREEN_REFRESH_RATE(60)
757   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
758   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
759   MDRV_SCREEN_SIZE(64*8, 32*8)
760   MDRV_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 32*8-1)
761
762   MDRV_PALETTE_LENGTH(16)
763
764   MDRV_VIDEO_START(guab)
765   MDRV_VIDEO_UPDATE(guab)
766
767   MDRV_SPEAKER_STANDARD_MONO("mono")
768
769   /* TODO: Verify clock */
770   MDRV_SOUND_ADD(SN76489, 2000000)
771   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
772MACHINE_DRIVER_END
773
774
775/*************************************
776 *
777 *  ROM definition(s)
778 *
779 *************************************/
780
781ROM_START( guab )
782   ROM_REGION( 0x20000, REGION_CPU1, 0 )
783   ROM_LOAD16_BYTE( "guab1a1.rom", 0x00000, 0x8000, CRC(f23a9d7d) SHA1(f933e131bdcf21cfa6001c8e20fd11d94c7a9450) )
784   ROM_LOAD16_BYTE( "guab1b1.rom", 0x00001, 0x8000, CRC(af3b5492) SHA1(6fd7f29e6ed2fadccc9246f1ebd049c3f9aeff13) )
785   ROM_LOAD16_BYTE( "guab2a1.rom", 0x10000, 0x8000, CRC(ae7a162c) SHA1(d69721818b8e4daba776a678b62bc7f44f371a3f) )
786   ROM_LOAD16_BYTE( "guab2b1.rom", 0x10001, 0x8000, CRC(29aa26a0) SHA1(8d425ad845ccfcd8995dbf6adc1ca17989a5d3ea) )
787
788   ROM_REGION( 0xb4000, REGION_USER1, 0 )
789   ROM_LOAD( "guabf6.dsk", 0x00000, 0xb4000, CRC(08804c28) SHA1(608d89d598b7acb133814540dba98cea29c6cad6) )
790ROM_END
791
792ROM_START( guab3 )
793   ROM_REGION( 0x20000, REGION_CPU1, 0 )
794   ROM_LOAD16_BYTE( "guab1a1.rom", 0x00000, 0x8000, CRC(f23a9d7d) SHA1(f933e131bdcf21cfa6001c8e20fd11d94c7a9450) )
795   ROM_LOAD16_BYTE( "guab1b1.rom", 0x00001, 0x8000, CRC(af3b5492) SHA1(6fd7f29e6ed2fadccc9246f1ebd049c3f9aeff13) )
796   ROM_LOAD16_BYTE( "guab2a1.rom", 0x10000, 0x8000, CRC(ae7a162c) SHA1(d69721818b8e4daba776a678b62bc7f44f371a3f) )
797   ROM_LOAD16_BYTE( "guab2b1.rom", 0x10001, 0x8000, CRC(29aa26a0) SHA1(8d425ad845ccfcd8995dbf6adc1ca17989a5d3ea) )
798
799   ROM_REGION( 0xb4000, REGION_USER1, 0 )
800   ROM_LOAD( "guab3.dsk", 0x00000, 0xb4000, CRC(ecb41e06) SHA1(2900a95046b38312c6035ea394b04b62c1d29f42) )
801ROM_END
802
803ROM_START( tenup )
804   ROM_REGION( 0x20000, REGION_CPU1, 0 )
805   ROM_LOAD16_BYTE( "tu-11.bin", 0x00000, 0x8000, CRC(01843086) SHA1(106a226900e8cf929f89edf801c627f02e4afce3) )
806   ROM_LOAD16_BYTE( "tu-12.bin", 0x00001, 0x8000, CRC(1c7f32b1) SHA1(2b14e2206695ae53909ae838a5c036248d9ab940) )
807   ROM_LOAD16_BYTE( "tu-13.bin", 0x10000, 0x8000, CRC(d19e2bf7) SHA1(76a9cbd4f604ad39eb0e319a9a6d5a6739b0ed8c) )
808   ROM_LOAD16_BYTE( "tu-14.bin", 0x10001, 0x8000, CRC(fd8a0c3c) SHA1(f87289ce6f0d2bc9b7d3a0b6deff38ba3aadf391) )
809
810   ROM_REGION( 0xb4000, REGION_USER1, 0 )
811   ROM_LOAD( "10up17.dsk", 0x00000, 0xb4000, CRC(7bc328df) SHA1(5f8e40d8ffc370fb19be9e386befa5fcd1f35a75) )
812ROM_END
813
814ROM_START( tenup3 )
815   ROM_REGION( 0x20000, REGION_CPU1, 0 )
816   ROM_LOAD16_BYTE( "tu-11.bin", 0x00000, 0x8000, CRC(01843086) SHA1(106a226900e8cf929f89edf801c627f02e4afce3) )
817   ROM_LOAD16_BYTE( "tu-12.bin", 0x00001, 0x8000, CRC(1c7f32b1) SHA1(2b14e2206695ae53909ae838a5c036248d9ab940) )
818   ROM_LOAD16_BYTE( "tu-13.bin", 0x10000, 0x8000, CRC(d19e2bf7) SHA1(76a9cbd4f604ad39eb0e319a9a6d5a6739b0ed8c) )
819   ROM_LOAD16_BYTE( "tu-14.bin", 0x10001, 0x8000, CRC(fd8a0c3c) SHA1(f87289ce6f0d2bc9b7d3a0b6deff38ba3aadf391) )
820
821   ROM_REGION( 0xb4000, REGION_USER1, 0 )
822   ROM_LOAD( "10up3.dsk", 0x00000, 0xb4000, CRC(2767f017) SHA1(1c6551b089c3e3df48e0c03bd502b91fd88f0e94) )
823ROM_END
824
825
826/*************************************
827 *
828 *  Game driver(s)
829 *
830 *************************************/
831
832GAME( 1986, guab,   0,     guab, guab,  0, ROT0, "JPM", "Give us a Break (6th edition)", GAME_NOT_WORKING )
833GAME( 1986, guab3,  guab,  guab, guab,  0, ROT0, "JPM", "Give us a Break (3rd edition)", GAME_NOT_WORKING )
834
835GAME( 1988, tenup,  0,     guab, tenup, 0, ROT0, "JPM", "Ten Up (compendium 17)",        GAME_NOT_WORKING )
836GAME( 1988, tenup3, tenup, guab, tenup, 0, ROT0, "JPM", "Ten Up (compendium 3)",         GAME_NOT_WORKING )
src/mame/drivers/m107.c
r2241r2242
3838
3939static WRITE16_HANDLER( bankswitch_w )
4040{
41   if (ACCESSING_LSB)
41   if (ACCESSING_BITS_0_7)
4242   {
4343      UINT8 *RAM = memory_region(REGION_CPU1);
4444      memory_set_bankptr(1,&RAM[0x100000 + ((data&0x7)*0x10000)]);
r2241r2242
8484
8585static WRITE16_HANDLER( m107_coincounter_w )
8686{
87   if (ACCESSING_LSB)
87   if (ACCESSING_BITS_0_7)
8888   {
8989      coin_counter_w(0,data & 0x01);
9090      coin_counter_w(1,data & 0x02);
src/mame/drivers/megasys1.c
r2241r2242
38593859
38603860static WRITE16_HANDLER( OKIM6295_data_0_both_w )
38613861{
3862   if (ACCESSING_LSB)   OKIM6295_data_0_w(machine, 0, (data >> 0) & 0xff );
3862   if (ACCESSING_BITS_0_7)   OKIM6295_data_0_w(machine, 0, (data >> 0) & 0xff );
38633863   else            OKIM6295_data_0_w(machine, 0, (data >> 8) & 0xff );
38643864}
38653865static WRITE16_HANDLER( OKIM6295_data_1_both_w )
38663866{
3867   if (ACCESSING_LSB)   OKIM6295_data_1_w(machine, 0, (data >> 0) & 0xff );
3867   if (ACCESSING_BITS_0_7)   OKIM6295_data_1_w(machine, 0, (data >> 0) & 0xff );
38683868   else            OKIM6295_data_1_w(machine, 0, (data >> 8) & 0xff );
38693869}
38703870
src/mame/drivers/crshrace.c
r2241r2242
163163
164164static WRITE16_HANDLER( sound_command_w )
165165{
166   if (ACCESSING_LSB)
166   if (ACCESSING_BITS_0_7)
167167   {
168168      pending_command = 1;
169169      soundlatch_w(machine,offset,data & 0xff);
src/mame/drivers/dcheese.c
r2241r2242
142142{
143143   /* toggles bit $0100 very frequently while waiting for things */
144144   /* bits $0080-$0010 are probably lamps */
145   if (ACCESSING_LSB)
145   if (ACCESSING_BITS_0_7)
146146   {
147147      EEPROM_set_cs_line(~data & 8);
148148      EEPROM_write_bit(data & 2);
r2241r2242
154154
155155static WRITE16_HANDLER( sound_command_w )
156156{
157   if (ACCESSING_LSB)
157   if (ACCESSING_BITS_0_7)
158158   {
159159      /* write the latch and set the IRQ */
160160      soundlatch_full = 1;
src/mame/drivers/sf.c
r2241r2242
3838
3939static WRITE16_HANDLER( sf_coin_w )
4040{
41   if (ACCESSING_LSB)
41   if (ACCESSING_BITS_0_7)
4242   {
4343      coin_counter_w(0,data & 0x01);
4444      coin_counter_w(1,data & 0x02);
r2241r2242
5151
5252static WRITE16_HANDLER( soundcmd_w )
5353{
54   if (ACCESSING_LSB)
54   if (ACCESSING_BITS_0_7)
5555   {
5656      soundlatch_w(machine,offset,data & 0xff);
5757      cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
src/mame/drivers/konamim2.c
r2241r2242
146146{
147147   UINT64 r = 0;
148148
149   if (!(mem_mask & U64(0xffffffff00000000)))
149   if (ACCESSING_BITS_32_63)
150150   {
151151      r |= (UINT64)(irq_enable) << 32;
152152   }
r2241r2242
156156
157157static WRITE64_HANDLER(irq_enable_w)
158158{
159   if (!(mem_mask & U64(0xffffffff00000000)))
159   if (ACCESSING_BITS_32_63)
160160   {
161161      irq_enable |= (UINT32)(data >> 32);
162162   }
r2241r2242
166166{
167167   UINT64 r = 0;
168168
169   if (!(mem_mask & U64(0xffffffff00000000)))
169   if (ACCESSING_BITS_32_63)
170170   {
171171      r |= (UINT64)(irq_active) << 32;
172172   }
r2241r2242
185185#ifdef UNUSED_FUNCTION
186186static READ64_HANDLER(unk2_r)
187187{
188   if (!(mem_mask & U64(0xffffffff00000000)))
188   if (ACCESSING_BITS_32_63)
189189   {
190190      return (UINT64)0xa5 << 32;
191191   }
r2241r2242
206206   UINT64 r = 0;
207207//  logerror("unk4_r: %08X, %08X%08X at %08X\n", offset, (UINT32)(mem_mask>>32), (UINT32)(mem_mask), activecpu_get_pc());
208208
209   if (!(mem_mask & U64(0xffffffff00000000)))
209   if (ACCESSING_BITS_32_63)
210210   {
211211      // MCfg
212212      r |= (UINT64)((0 << 13) | (5 << 10)) << 32;
213213   }
214   if (!(mem_mask & U64(0x00000000ffffffff)))
214   if (ACCESSING_BITS_0_31)
215215   {
216216      r |= unk20004 & ~0x800000;
217217   }
r2241r2242
223223//  logerror("unk4_w: %08X%08X, %08X, %08X%08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data),
224224//      offset, (UINT32)(mem_mask>>32), (UINT32)(mem_mask), activecpu_get_pc());
225225
226   if (!(mem_mask & U64(0x00000000ffffffff)))
226   if (ACCESSING_BITS_0_31)
227227   {
228228      if (data & 0x800000)
229229      {
r2241r2242
245245
246246static READ64_HANDLER(unk30030_r)
247247{
248   if (!(mem_mask & U64(0x00000000ffffffff)))
248   if (ACCESSING_BITS_0_31)
249249   {
250250      return 1;
251251   }
r2241r2242
254254
255255static WRITE64_HANDLER(video_w)
256256{
257   if (!(mem_mask & U64(0xffffffff00000000)))
257   if (ACCESSING_BITS_32_63)
258258   {
259259      vdl0_address = (UINT32)(data >> 32);
260260   }
261   if (!(mem_mask & U64(0x00000000ffffffff)))
261   if (ACCESSING_BITS_0_31)
262262   {
263263      vdl1_address = (UINT32)(data);
264264   }
r2241r2242
266266
267267static WRITE64_HANDLER(video_irq_ack_w)
268268{
269   if (!(mem_mask & U64(0xffffffff00000000)))
269   if (ACCESSING_BITS_32_63)
270270   {
271271      if ((data >> 32) & 0x8000)
272272      {
r2241r2242
319319
320320static WRITE64_HANDLER(reset_w)
321321{
322   if (!(mem_mask & U64(0xffffffff00000000)))
322   if (ACCESSING_BITS_32_63)
323323   {
324324      if (data & U64(0x100000000))
325325      {
r2241r2242
725725   UINT32 r = 0;
726726   int reg = offset * 2;
727727
728   if (!(mem_mask & U64(0x00000000ffffffff)))
728   if (ACCESSING_BITS_0_31)
729729      reg++;
730730
731731   switch (reg)
r2241r2242
800800   int reg = offset * 2;
801801   UINT32 d;
802802
803   if (!(mem_mask & U64(0x00000000ffffffff)))
803   if (ACCESSING_BITS_0_31)
804804   {
805805      reg++;
806806      d = (UINT32)(data);
r2241r2242
953953   UINT32 r = 0;
954954   int reg = offset * 2;
955955
956   if (!(mem_mask & U64(0x00000000ffffffff)))
956   if (ACCESSING_BITS_0_31)
957957      reg++;
958958
959959   switch (reg)
r2241r2242
983983{
984984   UINT64 r = 0;
985985
986   if (!(mem_mask & U64(0xffffffff00000000)))
986   if (ACCESSING_BITS_32_63)
987987   {
988988      r = (UINT64)(cpu_getactivecpu() ? 0x80000000 : 0);
989989      //r |= 0x40000000;  // sets Video-LowRes !?
r2241r2242
10581058   MDRV_SCREEN_ADD("main", RASTER)
10591059   MDRV_SCREEN_REFRESH_RATE(60)
10601060   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
1061   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
1061   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10621062   MDRV_SCREEN_SIZE(640, 480)
10631063   MDRV_SCREEN_VISIBLE_AREA(0, 511, 0, 383)
10641064
1065   MDRV_PALETTE_LENGTH(65536)
1065   MDRV_PALETTE_LENGTH(32768)
1066   MDRV_PALETTE_INIT(RRRRR_GGGGG_BBBBB)
10661067
10671068   MDRV_VIDEO_START(m2)
10681069   MDRV_VIDEO_UPDATE(m2)
src/mame/drivers/sengokmj.c
r2241r2242
8080
8181static WRITE16_HANDLER( mahjong_panel_w )
8282{
83   if (ACCESSING_MSB)
83   if (ACCESSING_BITS_8_15)
8484      sengokumj_mux_data = data >> 8;
8585}
8686
r2241r2242
8989   static UINT8 old = 0;
9090   static int coins_used = 0;
9191
92   if(ACCESSING_LSB)
92   if(ACCESSING_BITS_0_7)
9393   {
9494      if((old & 4) == 0 && (data & 4) == 4)
9595      {
r2241r2242
137137
138138
139139static INPUT_PORTS_START( sengokmj )
140   /* Must be port 0: coin inputs read through sound cpu */
141   SEIBU_COIN_INPUTS
140   SEIBU_COIN_INPUTS   /* coin inputs read through sound cpu */
142141
143142   PORT_START
144   PORT_DIPNAME( 0x0001,   0x0000, DEF_STR( Demo_Sounds ) )
143   PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Demo_Sounds ) )
145144   PORT_DIPSETTING(     0x0001, DEF_STR( Off ) )
146145   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
147   PORT_DIPNAME( 0x0002,   0x0002, "Re-start" )
146   PORT_DIPNAME( 0x0002, 0x0002, "Re-start" )
148147   PORT_DIPSETTING(     0x0002, DEF_STR( Off ) )
149148   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
150   PORT_DIPNAME( 0x0004,   0x0004, "Double G" )
149   PORT_DIPNAME( 0x0004, 0x0004, "Double G" )
151150   PORT_DIPSETTING(     0x0004, DEF_STR( Off ) )
152151   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
153   PORT_DIPNAME( 0x0008,   0x0008, "Double L" )
152   PORT_DIPNAME( 0x0008, 0x0008, "Double L" )
154153   PORT_DIPSETTING(     0x0008, DEF_STR( Off ) )
155154   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
156   PORT_DIPNAME( 0x0010,   0x0010, "Kamon" )
155   PORT_DIPNAME( 0x0010, 0x0010, "Kamon" )
157156   PORT_DIPSETTING(     0x0010, DEF_STR( Off ) )
158157   PORT_DIPSETTING(        0x0000, DEF_STR( On ) )
159   PORT_DIPNAME( 0x0020,   0x0020, DEF_STR( Unused ) )
158   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) )
160159   PORT_DIPSETTING(     0x0020, DEF_STR( Off ) )
161160   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
162   PORT_DIPNAME( 0x0040,   0x0040, "Out Sw" )
161   PORT_DIPNAME( 0x0040, 0x0040, "Out Sw" )
163162   PORT_DIPSETTING(     0x0040, DEF_STR( Off ) )
164163   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
165   PORT_DIPNAME( 0x0080,   0x0080, "Hopper" )
164   PORT_DIPNAME( 0x0080, 0x0080, "Hopper" )
166165   PORT_DIPSETTING(     0x0080, DEF_STR( Off ) )
167166   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
168   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
167   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
169168
170169   PORT_START
171170   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
r2241r2242
222221
223222   PORT_START
224223   PORT_DIPNAME( 0x0001, 0x0001, "Door" )
225   PORT_DIPSETTING(   0x0001, DEF_STR( Off ) )
226   PORT_DIPSETTING(   0x0000, DEF_STR( On ) )
224   PORT_DIPSETTING(     0x0001, DEF_STR( Off ) )
225   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
227226   PORT_SERVICE_NO_TOGGLE( 0x0002, IP_ACTIVE_LOW )
228227   PORT_DIPNAME( 0x0004, 0x0004, "Opt. 1st" )
229   PORT_DIPSETTING(   0x0004, DEF_STR( Off ) )
230   PORT_DIPSETTING(   0x0000, DEF_STR( On ) )
228   PORT_DIPSETTING(     0x0004, DEF_STR( Off ) )
229   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
231230   PORT_DIPNAME( 0x0008, 0x0008, "Reset" )
232   PORT_DIPSETTING(   0x0008, DEF_STR( Off ) )
233   PORT_DIPSETTING(   0x0000, DEF_STR( On ) )
231   PORT_DIPSETTING(     0x0008, DEF_STR( Off ) )
232   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
234233   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
235   PORT_DIPSETTING(   0x0010, DEF_STR( Off ) )
236   PORT_DIPSETTING(   0x0000, DEF_STR( On ) )
234   PORT_DIPSETTING(     0x0010, DEF_STR( Off ) )
235   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
237236   PORT_DIPNAME( 0x0020, 0x0020, "Cash" )
238   PORT_DIPSETTING(    0x0020, DEF_STR( Off ) )
239   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
237   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
238   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
240239   /* Used, causes "Hopper RunAway" message if you toggle it */
241240   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
242   PORT_DIPSETTING(    0x0040, DEF_STR( Off ) )
243   PORT_DIPSETTING(   0x0000, DEF_STR( On ) )
241   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
242   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
244243   PORT_DIPNAME( 0x0080, 0x0080, "Meter" )
245   PORT_DIPSETTING(   0x0080, DEF_STR( Off ) )
246   PORT_DIPSETTING(   0x0000, DEF_STR( On ) )
244   PORT_DIPSETTING(     0x0080, DEF_STR( Off ) )
245   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
247246   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
248247INPUT_PORTS_END
249248
src/mame/drivers/cave.c
r2241r2242
271271/* Handles writes to the YMZ280B */
272272static WRITE16_HANDLER( cave_sound_w )
273273{
274   if (ACCESSING_LSB)
274   if (ACCESSING_BITS_0_7)
275275   {
276276      if (offset)   YMZ280B_data_0_w     (machine, offset, data & 0xff);
277277      else      YMZ280B_register_0_w (machine, offset, data & 0xff);
r2241r2242
329329   if (data & ~0xfe00)
330330      logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",activecpu_get_pc(),data);
331331
332   if ( ACCESSING_MSB )  // even address
332   if ( ACCESSING_BITS_8_15 )  // even address
333333   {
334334      coin_lockout_w(1,~data & 0x8000);
335335      coin_lockout_w(0,~data & 0x4000);
r2241r2242
355355
356356static WRITE16_HANDLER( hotdogst_eeprom_msb_w )
357357{
358   if ( ACCESSING_MSB )  // even address
358   if ( ACCESSING_BITS_8_15 )  // even address
359359   {
360360      // latch the bit
361361      EEPROM_write_bit(data & 0x0800);
r2241r2242
373373   if (data & ~0x00ef)
374374      logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",activecpu_get_pc(),data);
375375
376   if ( ACCESSING_LSB )  // odd address
376   if ( ACCESSING_BITS_0_7 )  // odd address
377377   {
378378      coin_lockout_w(1,~data & 0x0008);
379379      coin_lockout_w(0,~data & 0x0004);
r2241r2242
394394/*  - No eeprom or lockouts */
395395static WRITE16_HANDLER( gaia_coin_lsb_w )
396396{
397   if ( ACCESSING_LSB )  // odd address
397   if ( ACCESSING_BITS_0_7 )  // odd address
398398   {
399399      coin_counter_w(1, data & 0x0002);
400400      coin_counter_w(0, data & 0x0001);
r2241r2242
408408   if (data & ~0xff00)
409409      logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",activecpu_get_pc(),data);
410410
411   if ( ACCESSING_MSB )  // even address
411   if ( ACCESSING_BITS_8_15 )  // even address
412412   {
413413      coin_counter_w(1, data & 0x2000);
414414      coin_counter_w(0, data & 0x1000);
r2241r2242
853853      show_leds();
854854   }
855855
856   if ( ACCESSING_MSB )  // even address
856   if ( ACCESSING_BITS_8_15 )  // even address
857857   {
858858      hopper = data & 0x0100;   // ???
859859
src/mame/drivers/fuukifg3.c
r2241r2242
186186
187187static WRITE32_HANDLER( paletteram32_xRRRRRGGGGGBBBBB_dword_w )
188188{
189   if(ACCESSING_MSW32)
189   if(ACCESSING_BITS_16_31)
190190   {
191191      int r,g,b;
192192      COMBINE_DATA(&paletteram32[offset]);
r2241r2242
198198      palette_set_color_rgb(Machine,offset*2,pal5bit(r),pal5bit(g),pal5bit(b));
199199   }
200200
201   if(ACCESSING_LSW32)
201   if(ACCESSING_BITS_0_15)
202202   {
203203      int r,g,b;
204204      COMBINE_DATA(&paletteram32[offset]);
r2241r2242
241241
242242static WRITE32_HANDLER( snd_020_w )
243243{
244   if (!(mem_mask & 0x00ff0000))
244   if (ACCESSING_BITS_16_23)
245245   {
246246      fuuki32_shared_ram[offset*2] = data>>16;
247247   }
248248
249   if (!(mem_mask & 0x000000ff))
249   if (ACCESSING_BITS_0_7)
250250   {
251251      fuuki32_shared_ram[(offset*2)+1] = data & 0xff;
252252   }
src/mame/drivers/atarigt.c
r2241r2242
206206    */
207207
208208   /* upper byte */
209   if (!(mem_mask & 0xff000000))
209   if (ACCESSING_BITS_24_31)
210210   {
211211      /* bits 13-11 are the MO control bits */
212212      atarirle_control_w(0, (data >> 27) & 7);
213213   }
214214
215   if (!(mem_mask & 0x00ff0000))
215   if (ACCESSING_BITS_16_23)
216216   {
217217//      cage_reset_w(data & 0x00100000);
218218      coin_counter_w(0, data & 0x00080000);
r2241r2242
224224static WRITE32_HANDLER( mo_command_w )
225225{
226226   COMBINE_DATA(mo_command);
227   if (ACCESSING_LSW32)
227   if (ACCESSING_BITS_0_15)
228228      atarirle_command_w(0, ((data & 0xffff) == 2) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
229229}
230230
r2241r2242
246246{
247247   UINT32 result = 0;
248248
249   if (ACCESSING_LSW32)
249   if (ACCESSING_BITS_0_15)
250250      result |= cage_control_r();
251   if (ACCESSING_MSW32)
251   if (ACCESSING_BITS_16_31)
252252      result |= main_from_cage_r() << 16;
253253   return result;
254254}
r2241r2242
256256
257257static WRITE32_HANDLER( sound_data_w )
258258{
259   if (ACCESSING_LSW32)
259   if (ACCESSING_BITS_0_15)
260260      cage_control_w(data);
261   if (ACCESSING_MSW32)
261   if (ACCESSING_BITS_16_31)
262262      main_to_cage_w(data >> 16);
263263}
264264
r2241r2242
568568   UINT32 result32 = 0;
569569   UINT16 result;
570570
571   if ((mem_mask & 0xffff0000) != 0xffff0000)
571   if (ACCESSING_BITS_16_31)
572572   {
573573      result = atarigt_colorram_r(address);
574574      (*protection_r)(address, &result);
575575      result32 |= result << 16;
576576   }
577   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
577   if (ACCESSING_BITS_0_15)
578578   {
579579      result = atarigt_colorram_r(address + 2);
580580      (*protection_r)(address + 2, &result);
r2241r2242
589589{
590590   offs_t address = 0xd80000 + offset * 4;
591591
592   if ((mem_mask & 0xffff0000) != 0xffff0000)
592   if (ACCESSING_BITS_16_31)
593593   {
594594      if (!ignore_writes)
595595         atarigt_colorram_w(address, data >> 16, mem_mask >> 16);
596596      (*protection_w)(address, data >> 16);
597597   }
598   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
598   if (ACCESSING_BITS_0_15)
599599   {
600600      if (!ignore_writes)
601601         atarigt_colorram_w(address + 2, data, mem_mask);
src/mame/drivers/rbmk.c
r2241r2242
9494static WRITE16_HANDLER( eeprom_w )
9595{
9696   //bad ?
97   if( ACCESSING_LSB )
97   if( ACCESSING_BITS_0_7 )
9898   {
9999      EEPROM_write_bit(data & 0x04);
100100      EEPROM_set_cs_line((data & 0x01) ? CLEAR_LINE:ASSERT_LINE );
src/mame/drivers/bigfghtr.c
r2241r2242
278278
279279static WRITE16_HANDLER( sound_command_w )
280280{
281   if (ACCESSING_LSB)
281   if (ACCESSING_BITS_0_7)
282282      soundlatch_w(machine,0,((data & 0x7f) << 1) | 1);
283283}
284284
src/mame/drivers/genesis.c
r2241r2242
271271      switch (offset & 3)
272272      {
273273      case 0:
274         if (ACCESSING_MSB)    return YM3438_status_port_0_A_r(machine, 0) << 8;
274         if (ACCESSING_BITS_8_15)    return YM3438_status_port_0_A_r(machine, 0) << 8;
275275         else              return YM3438_read_port_0_r(machine, 0);
276276         break;
277277      case 2:
278         if (ACCESSING_MSB)   return YM3438_status_port_0_B_r(machine, 0) << 8;
278         if (ACCESSING_BITS_8_15)   return YM3438_status_port_0_B_r(machine, 0) << 8;
279279         else             return 0;
280280         break;
281281      }
r2241r2242
331331      switch (offset & 3)
332332      {
333333      case 0:
334         if (ACCESSING_MSB)    return YM3438_status_port_0_A_r(machine, 0) << 8;
334         if (ACCESSING_BITS_8_15)    return YM3438_status_port_0_A_r(machine, 0) << 8;
335335         else              return YM3438_read_port_0_r(machine, 0);
336336         break;
337337      case 2:
338         if (ACCESSING_MSB)   return YM3438_status_port_0_B_r(machine, 0) << 8;
338         if (ACCESSING_BITS_8_15)   return YM3438_status_port_0_B_r(machine, 0) << 8;
339339         else             return 0;
340340         break;
341341      }
r2241r2242
372372   {
373373      offset &=0x1fff;
374374
375   if (ACCESSING_LSB) genesis_z80_ram[offset+1] = data & 0xff;
376   if (ACCESSING_MSB) genesis_z80_ram[offset] = (data >> 8) & 0xff;
375   if (ACCESSING_BITS_0_7) genesis_z80_ram[offset+1] = data & 0xff;
376   if (ACCESSING_BITS_8_15) genesis_z80_ram[offset] = (data >> 8) & 0xff;
377377   }
378378
379379
r2241r2242
383383      switch (offset & 3)
384384      {
385385      case 0:
386         if (ACCESSING_MSB)   YM3438_control_port_0_A_w   (machine, 0,   (data >> 8) & 0xff);
386         if (ACCESSING_BITS_8_15)   YM3438_control_port_0_A_w   (machine, 0,   (data >> 8) & 0xff);
387387         else             YM3438_data_port_0_A_w      (machine, 0,   (data >> 0) & 0xff);
388388         break;
389389      case 2:
390         if (ACCESSING_MSB)   YM3438_control_port_0_B_w   (machine, 0,   (data >> 8) & 0xff);
390         if (ACCESSING_BITS_8_15)   YM3438_control_port_0_B_w   (machine, 0,   (data >> 8) & 0xff);
391391         else             YM3438_data_port_0_B_w      (machine, 0,   (data >> 0) & 0xff);
392392         break;
393393      }
r2241r2242
412412
413413      if ( (offset >= 0x10) && (offset <=0x17) )
414414      {
415         if (ACCESSING_LSB) SN76496_0_w(machine, 0, data & 0xff);
416         if (ACCESSING_MSB) SN76496_0_w(machine, 0, (data >>8) & 0xff);
415         if (ACCESSING_BITS_0_7) SN76496_0_w(machine, 0, data & 0xff);
416         if (ACCESSING_BITS_8_15) SN76496_0_w(machine, 0, (data >>8) & 0xff);
417417      }
418418
419419   }
src/mame/drivers/trvmadns.c
r2241r2242
6161*/
6262
6363#include "driver.h"
64#include "deprecat.h"
6564#include "sound/ay8910.h"
6665
6766static tilemap *bg_tilemap;
r2241r2242
142141static WRITE8_HANDLER( trvmadns_gfxram_w )
143142{
144143   trvmadns_gfxram[offset] = data;
145   decodechar(Machine->gfx[0], offset/16, trvmadns_gfxram);
144   decodechar(machine->gfx[0], offset/16, trvmadns_gfxram);
146145
147146   tilemap_mark_all_tiles_dirty(bg_tilemap);
148147}
r2241r2242
159158   g = (paletteram[offset | 1] & 0xf0) >> 4;
160159   b = paletteram[offset | 1] & 0xf;
161160
162   palette_set_color_rgb(Machine, offset >> 1, pal4bit(r), pal4bit(g), pal4bit(b));
161   palette_set_color_rgb(machine, offset >> 1, pal4bit(r), pal4bit(g), pal4bit(b));
163162}
164163#endif
165164
r2241r2242
185184   {
186185      if(activecpu_get_previouspc()==0x29e9)// || activecpu_get_previouspc()==0x1b3f) //29f5
187186      {
188         cpunum_set_input_line(Machine, 0, 0, HOLD_LINE);
187         cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
189188      }
190189//      else
191190//          printf("%x \n", activecpu_get_previouspc());
src/mame/drivers/rpunch.c
r2241r2242
186186
187187static WRITE16_HANDLER( sound_command_w )
188188{
189   if (ACCESSING_LSB)
189   if (ACCESSING_BITS_0_7)
190190      timer_call_after_resynch(NULL, data & 0xff, sound_command_w_callback);
191191}
192192
src/mame/drivers/backfire.c
r2241r2242
252252static WRITE32_HANDLER(backfire_eeprom_w)
253253{
254254   logerror("%08x:write eprom %08x (%08x) %08x\n",activecpu_get_pc(),offset<<1,mem_mask,data);
255   if (ACCESSING_LSB32) {
255   if (ACCESSING_BITS_0_7) {
256256      EEPROM_set_clock_line((data & 0x2) ? ASSERT_LINE : CLEAR_LINE);
257257      EEPROM_write_bit(data & 0x1);
258258      EEPROM_set_cs_line((data & 0x4) ? CLEAR_LINE : ASSERT_LINE);
src/mame/drivers/wolfpack.c
r2241r2242
142142}
143143
144144
145static ADDRESS_MAP_START( wolfpack_readmem, ADDRESS_SPACE_PROGRAM, 8 )
146   AM_RANGE(0x0000, 0x00ff) AM_READ(SMH_RAM) AM_MIRROR(0x100)
147   AM_RANGE(0x1000, 0x1000) AM_READ(wolfpack_input_r)
148   AM_RANGE(0x2000, 0x2000) AM_READ(wolfpack_misc_r)
149   AM_RANGE(0x3000, 0x3000) AM_READ(input_port_1_r)
150   AM_RANGE(0x7000, 0x7fff) AM_READ(SMH_ROM)
151   AM_RANGE(0x9000, 0x9000) AM_READ(SMH_NOP) /* debugger ROM location? */
152   AM_RANGE(0xf000, 0xffff) AM_READ(SMH_ROM)
153ADDRESS_MAP_END
154
155
156static ADDRESS_MAP_START( wolfpack_writemem, ADDRESS_SPACE_PROGRAM, 8 )
157   AM_RANGE(0x0000, 0x00ff) AM_WRITE(SMH_RAM) AM_MIRROR(0x100)
145static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
146   AM_RANGE(0x0000, 0x00ff) AM_RAM AM_MIRROR(0x100)
147   AM_RANGE(0x1000, 0x1000) AM_READ(wolfpack_input_r)      /* Fallthrough */
158148   AM_RANGE(0x1000, 0x10ff) AM_WRITE(SMH_RAM) AM_BASE(&wolfpack_alpha_num_ram)
149   AM_RANGE(0x2000, 0x2000) AM_READ(wolfpack_misc_r)
159150   AM_RANGE(0x2000, 0x2000) AM_WRITE(wolfpack_high_explo_w)
160151   AM_RANGE(0x2001, 0x2001) AM_WRITE(wolfpack_sonar_ping_w)
161152   AM_RANGE(0x2002, 0x2002) AM_WRITE(wolfpack_sirlat_w)
r2241r2242
171162   AM_RANGE(0x200d, 0x200d) AM_WRITE(wolfpack_attract_w)
172163   AM_RANGE(0x200e, 0x200e) AM_WRITE(wolfpack_pt_pos_select_w)
173164   AM_RANGE(0x200f, 0x200f) AM_WRITE(wolfpack_warning_light_w)
165   AM_RANGE(0x3000, 0x3000) AM_READ(input_port_1_r)
174166   AM_RANGE(0x3000, 0x3000) AM_WRITE(wolfpack_audamp_w)
175167   AM_RANGE(0x3001, 0x3001) AM_WRITE(wolfpack_pt_horz_w)
176168   AM_RANGE(0x3003, 0x3003) AM_WRITE(wolfpack_pt_pic_w)
r2241r2242
184176   AM_RANGE(0x4005, 0x4005) AM_WRITE(wolfpack_torpedo_h_w)
185177   AM_RANGE(0x4006, 0x4006) AM_WRITE(wolfpack_torpedo_v_w)
186178   AM_RANGE(0x5000, 0x5fff) AM_WRITE(watchdog_reset_w)
187   AM_RANGE(0x7000, 0x7fff) AM_WRITE(SMH_ROM)
188   AM_RANGE(0xf000, 0xffff) AM_WRITE(SMH_ROM)
179   AM_RANGE(0x7000, 0x7fff) AM_ROM
180   AM_RANGE(0x9000, 0x9000) AM_READ(SMH_NOP) /* debugger ROM location? */
181   AM_RANGE(0xf000, 0xffff) AM_ROM
189182ADDRESS_MAP_END
190183
191184
r2241r2242
327320
328321
329322static MACHINE_DRIVER_START(wolfpack)
330        MDRV_SPEAKER_STANDARD_MONO("mono")
323   MDRV_SPEAKER_STANDARD_MONO("mono")
331324
332325   /* basic machine hardware */
333326   MDRV_CPU_ADD(M6502, 12096000 / 16)
334   MDRV_CPU_PROGRAM_MAP(wolfpack_readmem, wolfpack_writemem)
327   MDRV_CPU_PROGRAM_MAP(main_map,0)
335328
336329   /* video hardware */
337330   MDRV_MACHINE_RESET(wolfpack)
src/mame/drivers/pirates.c
r2241r2242
126126
127127static WRITE16_HANDLER( pirates_out_w )
128128{
129   if (ACCESSING_LSB)
129   if (ACCESSING_BITS_0_7)
130130   {
131131      /* bits 0-2 control EEPROM */
132132      EEPROM_write_bit(data & 0x04);
src/mame/drivers/wrally.c
r2241r2242
9696WRITE16_HANDLER( wrally_coin_lockout_w );
9797
9898
99
100static ADDRESS_MAP_START( wrally_readmem, ADDRESS_SPACE_PROGRAM, 16 )
101   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM)         /* ROM */
102   AM_RANGE(0x100000, 0x103fff) AM_READ(SMH_RAM)         /* encrypted Video RAM */
103   AM_RANGE(0x200000, 0x203fff) AM_READ(SMH_RAM)         /* Palette */
104   AM_RANGE(0x440000, 0x440fff) AM_READ(SMH_RAM)         /* Sprite RAM */
105   AM_RANGE(0x700000, 0x700001) AM_READ(input_port_0_word_r)/* DSW #1 & #2 */
106   AM_RANGE(0x700002, 0x700003) AM_READ(input_port_1_word_r)/* INPUT 1P & 2P, COINSW, STARTSW */
107   AM_RANGE(0x700004, 0x700005) AM_READ(input_port_2_word_r)/* Wheel */
108   AM_RANGE(0x700008, 0x700009) AM_READ(input_port_3_word_r)/* TESTSW & SERVICESW */
109   AM_RANGE(0x70000e, 0x70000f) AM_READ(OKIM6295_status_0_lsb_r)/* OKI6295 status register */
110   AM_RANGE(0xfe0000, 0xfeffff) AM_READ(SMH_RAM)         /* Work RAM (partially shared with DS5002FP) */
111ADDRESS_MAP_END
112
11399static WRITE16_HANDLER( unknown_w )
114100{
115101   popmessage("write %04x to %04x", data, offset*2 + 0x6a);
116102}
117103
118static ADDRESS_MAP_START( wrally_writemem, ADDRESS_SPACE_PROGRAM, 16 )
119   AM_RANGE(0x000000, 0x0fffff) AM_WRITE(SMH_ROM)                        /* ROM */
120   AM_RANGE(0x100000, 0x103fff) AM_WRITE(wrally_vram_w) AM_BASE(&wrally_videoram)      /* encrypted Video RAM */
121   AM_RANGE(0x108000, 0x108007) AM_WRITE(SMH_RAM) AM_BASE(&wrally_vregs)            /* Video Registers */
122   AM_RANGE(0x10800c, 0x10800d) AM_WRITE(SMH_NOP)                        /* CLR INT Video */
123   AM_RANGE(0x200000, 0x203fff) AM_WRITE(paletteram16_xxxxBBBBRRRRGGGG_word_w) AM_BASE(&paletteram16)/* Palette */
124   AM_RANGE(0x440000, 0x440fff) AM_WRITE(SMH_RAM) AM_BASE(&wrally_spriteram)         /* Sprite RAM */
125   AM_RANGE(0x70000c, 0x70000d) AM_WRITE(OKIM6295_bankswitch_w)               /* OKI6295 bankswitch */
126   AM_RANGE(0x70000e, 0x70000f) AM_WRITE(OKIM6295_data_0_lsb_w)               /* OKI6295 data register */
127   AM_RANGE(0x70000a, 0x70001b) AM_WRITE(wrally_coin_lockout_w)               /* Coin lockouts */
128   AM_RANGE(0x70002a, 0x70003b) AM_WRITE(wrally_coin_counter_w)               /* Coin counters */
129   AM_RANGE(0x70004a, 0x70004b) AM_WRITE(SMH_NOP)                        /* sound muting */
130   AM_RANGE(0x70005a, 0x70005b) AM_WRITE(SMH_NOP)                        /* flip screen */
131   AM_RANGE(0x70006a, 0x70007b) AM_WRITE(unknown_w)                        /* ??? */
132   AM_RANGE(0xfe0000, 0xfeffff) AM_WRITE(SMH_RAM)                        /* Work RAM (partially shared with DS5002FP) */
104static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
105   AM_RANGE(0x000000, 0x0fffff) AM_ROM
106   AM_RANGE(0x100000, 0x103fff) AM_RAM AM_WRITE(wrally_vram_w) AM_BASE(&wrally_videoram)      /* encrypted Video RAM */
107   AM_RANGE(0x108000, 0x108007) AM_RAM AM_BASE(&wrally_vregs)         /* Video Registers */
108   AM_RANGE(0x10800c, 0x10800d) AM_WRITE(SMH_NOP)                  /* CLR INT Video */
109   AM_RANGE(0x200000, 0x203fff) AM_RAM AM_WRITE(paletteram16_xxxxBBBBRRRRGGGG_word_w) AM_BASE(&paletteram16)/* Palette */
110   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&wrally_spriteram)      /* Sprite RAM */
111   AM_RANGE(0x700000, 0x700001) AM_READ(input_port_0_word_r)         /* DSW #1 & #2 */
112   AM_RANGE(0x700002, 0x700003) AM_READ(input_port_1_word_r)         /* INPUT 1P & 2P, COINSW, STARTSW */
113   AM_RANGE(0x700004, 0x700005) AM_READ(input_port_2_word_r)         /* Wheel */
114   AM_RANGE(0x700008, 0x700009) AM_READ(input_port_3_word_r)         /* TESTSW & SERVICESW */
115   AM_RANGE(0x70000c, 0x70000d) AM_WRITE(OKIM6295_bankswitch_w)      /* OKI6295 bankswitch */
116   AM_RANGE(0x70000e, 0x70000f) AM_READWRITE(OKIM6295_status_0_lsb_r,OKIM6295_data_0_lsb_w)/* OKI6295 status register */
117   AM_RANGE(0x70000a, 0x70001b) AM_WRITE(wrally_coin_lockout_w)      /* Coin lockouts */
118   AM_RANGE(0x70002a, 0x70003b) AM_WRITE(wrally_coin_counter_w)      /* Coin counters */
119   AM_RANGE(0x70004a, 0x70004b) AM_WRITE(SMH_NOP)                  /* sound muting */
120   AM_RANGE(0x70005a, 0x70005b) AM_WRITE(SMH_NOP)                  /* flip screen */
121   AM_RANGE(0x70006a, 0x70007b) AM_WRITE(unknown_w)               /* ??? */
122   AM_RANGE(0xfe0000, 0xfeffff) AM_RAM               /* Work RAM (partially shared with DS5002FP) */
133123ADDRESS_MAP_END
134124
135125
r2241r2242
230220static MACHINE_DRIVER_START( wrally )
231221   /* basic machine hardware */
232222   MDRV_CPU_ADD(M68000,XTAL_24MHz/2)   /* verified on pcb */
233   MDRV_CPU_PROGRAM_MAP(wrally_readmem,wrally_writemem)
223   MDRV_CPU_PROGRAM_MAP(main_map,0)
234224   MDRV_CPU_VBLANK_INT("main", irq6_line_hold)
235225
236226   /* video hardware */
src/mame/drivers/segas18.c
r2241r2242
347347      /* I/O chip */
348348      case 0x0000/2:
349349      case 0x1000/2:
350         if (ACCESSING_LSB)
350         if (ACCESSING_BITS_0_7)
351351         {
352352            io_chip_w(machine, offset, data, mem_mask);
353353            return;
r2241r2242
356356
357357      /* video control latch */
358358      case 0x2000/2:
359         if (ACCESSING_LSB)
359         if (ACCESSING_BITS_0_7)
360360         {
361361            system18_set_vdp_mixing(data & 0xff);
362362            return;
r2241r2242
381381
382382static WRITE16_HANDLER( rom_5987_bank_w )
383383{
384   if (!ACCESSING_LSB)
384   if (!ACCESSING_BITS_0_7)
385385      return;
386386   offset &= 0xf;
387387   data &= 0xff;
r2241r2242
389389   /* tile banking */
390390   if (offset < 8)
391391   {
392      int maxbanks = Machine->gfx[0]->total_elements / 1024;
392      int maxbanks = machine->gfx[0]->total_elements / 1024;
393393      if (data >= maxbanks)
394394         data %= maxbanks;
395395      segaic16_tilemap_set_bank(0, offset, data);
r2241r2242
556556static WRITE8_HANDLER( mcu_data_w )
557557{
558558   mcu_data = data;
559   cpunum_set_input_line(Machine, 2, 1, PULSE_LINE);
559   cpunum_set_input_line(machine, 2, 1, PULSE_LINE);
560560}
561561
562562
src/mame/drivers/meijinsn.c
r2241r2242
6868
6969static WRITE16_HANDLER( sound_w )
7070{
71   if(ACCESSING_LSB)
71   if(ACCESSING_BITS_0_7)
7272      soundlatch_w(machine, 0, data&0xff);
7373}
7474
src/mame/drivers/astrocorp.c
r0r2242
1/***************************************************************************
2
3                      -= Astro Corp. Hardware =-
4
5                driver by   Luca Elia (l.elia@tin.it)
6
7CPU:    68000
8GFX:    ASTRO V01 0005 (512 sprites, each made of N x M tiles. Tiles are 16x16x8)
9SOUND:  OKI M6295 (AD-65)
10OTHER:  ASTRO 0001B, EEPROM
11
12***************************************************************************/
13
14#include "driver.h"
15#include "machine/eeprom.h"
16#include "sound/okim6295.h"
17
18/***************************************************************************
19                              Sprites Format
20
21    Offset:    Bits:                  Value:
22
23        0.w    f--- ---- ---- ----    Show This Sprite
24               -edc ba98 7654 3210    X
25
26        1.w                           Code
27
28        2.w    f--- ---- ---- ----    -
29               -edc ba98 7654 3210    Y
30
31        3.w    fedc ba98 ---- ----    X Size
32               ---- ---- 7654 3210    Y Size
33
34***************************************************************************/
35
36static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
37{
38   UINT16 *source = spriteram16;
39   UINT16 *finish = spriteram16 + spriteram_size/2;
40
41   for ( ; source < finish; source += 8/2 )
42   {
43      int x,y;
44
45      int   sx      =   source[ 0x0/2 ];
46      int   code   =   source[ 0x2/2 ];
47      int   sy      =   source[ 0x4/2 ];
48      int   attr   =   source[ 0x6/2 ];
49
50      int dimx   =   (attr >> 8) & 0xff;
51      int dimy   =   (attr >> 0) & 0xff;
52
53      if (!dimx && !dimy)
54         return;
55
56      if (!(sx & 0x8000))
57         continue;
58
59      sx = (sx & 0x3fff) - (sx & 0x4000);
60      sy = (sy & 0x3fff) - (sy & 0x4000);
61
62      for (y = 0 ; y < dimy ; y++)
63      {
64         for (x = 0 ; x < dimx ; x++)
65         {
66            drawgfx(bitmap,machine->gfx[0],
67                  code++, 0,
68                  0, 0,
69                  sx + x * 16, sy + y * 16,
70                  cliprect, TRANSPARENCY_PEN, 0xff);
71         }
72      }
73   }
74}
75
76static UINT16 astrocorp_screen_enable;
77
78static VIDEO_UPDATE(astrocorp)
79{
80   if (astrocorp_screen_enable & 1)
81   {
82      fillbitmap(bitmap,screen->machine->pens[0xff],cliprect);
83      draw_sprites(screen->machine,bitmap,cliprect);
84   }
85   else
86      fillbitmap(bitmap,get_black_pen(screen->machine),cliprect);
87
88   return 0;
89}
90
91
92/***************************************************************************
93                                Memory Maps
94***************************************************************************/
95
96static READ16_HANDLER( astrocorp_eeprom_r )
97{
98   return 0xfff7 | (EEPROM_read_bit() << 3);
99}
100
101static WRITE16_HANDLER( astrocorp_eeprom_w )
102{
103   if (ACCESSING_BITS_0_7)
104   {
105      // latch the bit
106      EEPROM_write_bit(data & 0x01);
107
108      // reset line asserted: reset.
109      EEPROM_set_cs_line((data & 0x04) ? CLEAR_LINE : ASSERT_LINE );
110
111      // clock line asserted: write latch or select next bit to read
112      EEPROM_set_clock_line((data & 0x02) ? ASSERT_LINE : CLEAR_LINE );
113   }
114}
115
116static WRITE16_HANDLER( astrocorp_sound_bank_w )
117{
118   if (ACCESSING_BITS_8_15)
119   {
120      OKIM6295_set_bank_base(0, 0x40000 * ((data >> 8) & 1) );
121//      logerror("CPU #0 PC %06X: OKI bank %08X\n",activecpu_get_pc(),data);
122   }
123}
124
125static WRITE16_HANDLER( astrocorp_outputs_w )
126{
127   if (ACCESSING_BITS_0_7)
128   {
129      coin_counter_w(0,   (data & 0x0004));   // coin counter
130      set_led_status(0,   (data & 0x0008));   // you win
131      if (            (data & 0x0010))   dispensed_tickets++;   // coin out
132      set_led_status(1,   (data & 0x0020));   // coin/hopper jam
133   }
134   if (ACCESSING_BITS_8_15)
135   {
136      set_led_status(2,   (data & 0x0100));   // bet
137      set_led_status(3,   (data & 0x0800));   // start
138      set_led_status(4,   (data & 0x1000));   // ? select/choose
139      set_led_status(5,   (data & 0x2000));   // ? select/choose
140      set_led_status(6,   (data & 0x4000));   // look
141   }
142//  popmessage("%04X",data);
143}
144
145static WRITE16_HANDLER( astrocorp_enable_w )
146{
147   COMBINE_DATA( &astrocorp_screen_enable );
148//  popmessage("%04X",data);
149   if (data & (~1))
150      logerror("CPU #0 PC %06X: screen enable = %04X\n",activecpu_get_pc(),data);
151}
152
153static READ16_HANDLER( astrocorp_unk_r )
154{
155   return 0xffff;   // bit 3?
156}
157
158// 5-6-5 Palette: BBBBB-GGGGGG-RRRRR
159static WRITE16_HANDLER( astrocorp_palette_w )
160{
161   COMBINE_DATA( &paletteram16[offset] );
162   palette_set_color_rgb( machine, offset,
163      pal5bit((paletteram16[offset] >>  0) & 0x1f),
164      pal6bit((paletteram16[offset] >>  5) & 0x3f),
165      pal5bit((paletteram16[offset] >> 11) & 0x1f)
166   );
167}
168
169static ADDRESS_MAP_START( astrocorp_map, ADDRESS_SPACE_PROGRAM, 16 )
170   AM_RANGE( 0x000000, 0x01ffff ) AM_ROM
171   AM_RANGE( 0x050000, 0x050fff ) AM_RAM AM_BASE( &spriteram16 ) AM_SIZE( &spriteram_size )
172   AM_RANGE( 0x052000, 0x052001 ) AM_WRITE( SMH_NOP )
173   AM_RANGE( 0x054000, 0x054001 ) AM_READ_PORT( "INPUTS" )
174   AM_RANGE( 0x058000, 0x058001 ) AM_WRITE( astrocorp_eeprom_w )
175   AM_RANGE( 0x05a000, 0x05a001 ) AM_WRITE( astrocorp_outputs_w )
176   AM_RANGE( 0x05e000, 0x05e001 ) AM_READ( astrocorp_eeprom_r )
177   AM_RANGE( 0x060000, 0x0601ff ) AM_RAM AM_WRITE( astrocorp_palette_w ) AM_BASE( &paletteram16 )
178   AM_RANGE( 0x070000, 0x073fff ) AM_RAM
179   AM_RANGE( 0x080000, 0x080001 ) AM_WRITE( astrocorp_sound_bank_w )
180   AM_RANGE( 0x0a0000, 0x0a0001 ) AM_WRITE( astrocorp_enable_w )
181   AM_RANGE( 0x0d0000, 0x0d0001 ) AM_READWRITE( astrocorp_unk_r, OKIM6295_data_0_msb_w )
182ADDRESS_MAP_END
183
184
185/***************************************************************************
186                                Input Ports
187***************************************************************************/
188
189INPUT_PORTS_START( showhand )
190   PORT_START_TAG("INPUTS")   // 54000
191   PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_COIN1     )   PORT_IMPULSE(1)   // coin
192   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON3   )   PORT_NAME("Payout")   PORT_CODE(KEYCODE_F1) // payout (must be 0 on startup)
193   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_UNKNOWN   )   // ?
194   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_START2    )   PORT_NAME("Bet / Double")
195   PORT_BIT( 0x0010, IP_ACTIVE_LOW,  IPT_BUTTON3   )   PORT_NAME("Look / Small")
196   PORT_SERVICE_NO_TOGGLE( 0x0020,   IP_ACTIVE_LOW )   // settings
197   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_UNKNOWN   )   // ?
198   PORT_BIT( 0x0080, IP_ACTIVE_LOW,  IPT_SPECIAL   )   // coin sensor
199   PORT_BIT( 0x0100, IP_ACTIVE_LOW,  IPT_BUTTON2   )   PORT_NAME("Yes / Big")
200   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_UNKNOWN   )   // hold1?
201   PORT_BIT( 0x0400, IP_ACTIVE_LOW,  IPT_BUTTON1   )   PORT_NAME("Select")
202   PORT_BIT( 0x0800, IP_ACTIVE_LOW,  IPT_START1    )   PORT_NAME("Start / Take")
203   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_SERVICE1  )   PORT_NAME("Reset Settings")   // when 1 in test mode: reset settings (must be 0 on startup)
204   PORT_BIT( 0x2000, IP_ACTIVE_LOW,  IPT_UNKNOWN   )   // ?
205   PORT_BIT( 0x4000, IP_ACTIVE_LOW,  IPT_COIN2     )   // key in
206   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_SPECIAL   )   // coin sensor
207INPUT_PORTS_END
208
209
210/***************************************************************************
211                                Graphics Layout
212***************************************************************************/
213
214static const gfx_layout layout_16x16x8 =
215{
216   16, 16,
217   RGN_FRAC(1, 1),
218   8,
219   { STEP8(0,1) },
220   { STEP16(0,8) },
221   { STEP16(0,16*8) },
222   16*16*8
223};
224
225static GFXDECODE_START( astrocorp )
226   { REGION_GFX1, 0, &layout_16x16x8, 0, 1 },
227GFXDECODE_END
228
229
230/***************************************************************************
231                                Machine Drivers
232***************************************************************************/
233
234static const UINT16 showhand_default_eeprom[] =   {0x0001,0x0007,0x000a,0x0003,0x0000,0x0009,0x0003,0x0000,0x0002,0x0001,0x0000,0x0000,0x0000,0x0000,0x0000};
235
236static NVRAM_HANDLER( showhand )
237{
238   if (read_or_write)
239      EEPROM_save(file);
240   else
241   {
242      EEPROM_init(&eeprom_interface_93C46);
243
244      if (file) EEPROM_load(file);
245      else
246      {
247         /* Set the EEPROM to Factory Defaults */
248         EEPROM_set_data((UINT8*)showhand_default_eeprom,sizeof(showhand_default_eeprom));
249      }
250   }
251}
252
253static MACHINE_DRIVER_START( astrocorp )
254   /* basic machine hardware */
255   MDRV_CPU_ADD(M68000, XTAL_25_601712MHz / 2)
256   MDRV_CPU_PROGRAM_MAP(astrocorp_map,0)
257   MDRV_CPU_VBLANK_INT("main", irq4_line_hold)
258
259   MDRV_NVRAM_HANDLER(showhand)
260
261   /* video hardware */
262   MDRV_SCREEN_ADD("main", RASTER)
263   MDRV_SCREEN_REFRESH_RATE(60)
264   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
265   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
266   MDRV_SCREEN_SIZE(320, 240)
267   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
268
269   MDRV_GFXDECODE(astrocorp)
270   MDRV_PALETTE_LENGTH(0x100)
271
272   MDRV_VIDEO_UPDATE(astrocorp)
273
274   /* sound hardware */
275   MDRV_SPEAKER_STANDARD_MONO("mono")
276
277   MDRV_SOUND_ADD(OKIM6295, XTAL_20MHz/16)
278   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7low)
279   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
280MACHINE_DRIVER_END
281
282
283/***************************************************************************
284                                ROMs Loading
285***************************************************************************/
286
287/***************************************************************************
288
289Show Hand
290(C) 1999? Astro Corp.
291
292PCB CHE-B50-4002A 88 94V-0 0002
293
294CPU     1x MC68HC000FN12 (main)
295        1x pLSI1016-60LJ (main)
296        1x ASTRO V01 0005 (custom)
297        1x AD-65 (equivalent to OKI6295)(sound)
298        1x ASTRO 0001B (custom)
299        1x oscillator 20.000MHz
300        1x oscillator 25.601712MHz
301
302ROMs    2x 27C512 (1,2)
303        2x M27C801 (3,4)
304        1x M27C4001 (5)
305        1x 93C46 (not dumped)
306
307Note    1x 28x2 JAMMA edge connector
308        1x 18x2 edge connector
309        1x 10x2 edge connector
310        1x pushbutton
311        1x trimmer (volume)
312        1x 2x2 switches dip
313
314Hardware info by f205v
315
316***************************************************************************/
317
318ROM_START( showhand )
319   ROM_REGION( 0x20000, REGION_CPU1, 0 )
320   ROM_LOAD16_BYTE( "1-8.even.u16", 0x00000, 0x10000, CRC(cf34bf0d) SHA1(72ad7ca63ef89451b2572d64cccfa764b9d9b353) )
321   ROM_LOAD16_BYTE( "2-8.odd.u17",  0x00001, 0x10000, CRC(dd031c36) SHA1(198d0e685dd2d824a04c787f8a17c173efa272d9) )
322
323   ROM_REGION( 0x200000, REGION_GFX1, 0 )
324   ROM_LOAD16_BYTE( "4.even.u26", 0x000000, 0x100000, CRC(8a706e42) SHA1(989688ee3a5e4fc11fb502e43c9d6012488982ee) )
325   ROM_LOAD16_BYTE( "3.odd.u26",  0x000001, 0x100000, CRC(a624b750) SHA1(fc5b09f8a10cba5fb2474e1edd62a0400177a5ad) )
326
327   ROM_REGION( 0x80000, REGION_SOUND1, 0 )
328   ROM_LOAD( "5", 0x00000, 0x80000, CRC(e6987122) SHA1(fb3e7c2399057c64b5c496a393f6f22a1e54c844) )
329ROM_END
330
331static DRIVER_INIT( showhand )
332{
333/*
334    UINT16 *rom = (UINT16*)memory_region(REGION_CPU1);
335
336    rom[0x0a1a/2] = 0x6000; // hopper jam
337
338    rom[0x1494/2] = 0x4e71; // enable full test mode
339
340    rom[0x12f6/2] = 0x6000; // rom error
341    rom[0x4916/2] = 0x6000; // rom error
342*/
343}
344
345GAME( 1999?, showhand, 0, astrocorp, showhand, showhand, ROT0, "Astro Corp.", "Show Hand", 0 )
src/mame/drivers/crospang.c
r2241r2242
5252
5353static WRITE16_HANDLER ( crospang_soundlatch_w )
5454{
55   if(ACCESSING_LSB)
55   if(ACCESSING_BITS_0_7)
5656   {
5757      soundlatch_w(machine,0,data & 0xff);
5858   }
src/mame/drivers/mquake.c
r2241r2242
8888
8989static READ16_HANDLER( es5503_word_lsb_r )
9090{
91   return (ACCESSING_LSB) ? (ES5503_reg_0_r(machine, offset) | 0xff00) : 0xffff;
91   return (ACCESSING_BITS_0_7) ? (ES5503_reg_0_r(machine, offset) | 0xff00) : 0xffff;
9292}
9393
9494static WRITE16_HANDLER( es5503_word_lsb_w )
9595{
96   if (ACCESSING_LSB)
96   if (ACCESSING_BITS_0_7)
9797   {
9898      // 5503 ROM is banked by the output channel (it's a handy 4-bit output from the 5503)
9999      if (offset < 0xe0)
r2241r2242
116116
117117static WRITE16_HANDLER( output_w )
118118{
119   if (ACCESSING_LSB)
119   if (ACCESSING_BITS_0_7)
120120      logerror("%06x:output_w(%x) = %02x\n", activecpu_get_pc(), offset, data);
121121}
122122
src/mame/drivers/nmk16.c
r2241r2242
186186
187187    dstram = nmk16_mainram;
188188
189   if (!ACCESSING_MSB)
189   if (!ACCESSING_BITS_8_15)
190190   {
191191      dstram[offset] = (data & 0x00ff) |  ((data & 0x00ff)<<8);
192192    }
193   else if (!ACCESSING_LSB)
193   else if (!ACCESSING_BITS_0_7)
194194   {
195195      dstram[offset] = (data & 0xff00) |  ((data & 0xff00)>>8);
196196   }
r2241r2242
280280
281281static WRITE16_HANDLER ( ssmissin_sound_w )
282282{
283   if (ACCESSING_LSB)
283   if (ACCESSING_BITS_0_7)
284284   {
285285      soundlatch_w(machine,0,data & 0xff);
286286      cpunum_set_input_line(machine, 1,0, HOLD_LINE);
r2241r2242
313313{
314314   /* The MCU is mapped as the top byte for byte accesses only,
315315        all word accesses are to the input port */
316   if (ACCESSING_MSB && !ACCESSING_LSB)
316   if (ACCESSING_BITS_8_15 && !ACCESSING_BITS_0_7)
317317   {
318318      static const UINT8 to_main[] =
319319      {
r2241r2242
340340
341341static WRITE16_HANDLER( macross2_sound_command_w )
342342{
343   if (ACCESSING_LSB)
343   if (ACCESSING_BITS_0_7)
344344      soundlatch_w(machine,0,data & 0xff);
345345}
346346
r2241r2242
376376
377377static WRITE16_HANDLER( afega_soundlatch_w )
378378{
379   if (ACCESSING_LSB)
379   if (ACCESSING_BITS_0_7)
380380   {
381381      soundlatch_w(machine,0,data&0xff);
382382      cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
r2241r2242
47614761
47624762static DRIVER_INIT( bjtwin )
47634763{
4764   DRIVER_INIT_CALL(nmk);
47654764
47664765   /* Patch rom to enable test mode */
47674766
r2241r2242
47784777 *  008F78: 33C3 000F FFFE           move.w  D3, $ffffe.l
47794778 *  008F7E: 207C 000F 9000           movea.l #$f9000, A0
47804779 */
4780#if 0
4781   UINT16 *rom = (UINT16 *)memory_region(REGION_CPU1);
4782   rom[0x09172/2] = 0x6006;    /* patch checksum error */
4783   rom[0x08f74/2] = 0x4e71;
4784#endif
47814785
4782//  data 16_t *rom = (UINT16 *)memory_region(REGION_CPU1);
4783//  rom[0x09172/2] = 0x6006;    /* patch checksum error */
4784//  rom[0x08f74/2] = 0x4e71);
4786   DRIVER_INIT_CALL(nmk);
4787
47854788}
47864789
47874790/* NO NMK004, it has a PIC instead */
r2241r2242
48684871
48694872static WRITE16_HANDLER( twinactn_flipscreen_w )
48704873{
4871   if (ACCESSING_LSB)
4874   if (ACCESSING_BITS_0_7)
48724875      flip_screen_set(data & 1);
48734876
48744877   if (data & (~1))
r2241r2242
62716274   ROM_LOAD( "9.bpr",      0x0000, 0x0100, CRC(435653a2) SHA1(575b4a46ea65179de3042614da438d2f6d8b572e) ) /* unknown */
62726275ROM_END
62736276
6277ROM_START( bjtwina )
6278   ROM_REGION( 0x80000, REGION_CPU1, 0 )  /* 68000 code */
6279   ROM_LOAD16_BYTE( "93087.1",  0x00000, 0x20000, CRC(c82b3d8e) SHA1(74435ba7842f1be9968006894cfa5eef05c47395) )
6280   ROM_LOAD16_BYTE( "93087.2",  0x00001, 0x20000, CRC(9be1ec47) SHA1(bf37d9254a7bbdf49b006971886ed9845d72e4b3) )
62746281
6282   ROM_REGION( 0x010000, REGION_GFX1, ROMREGION_DISPOSE )
6283   ROM_LOAD( "93087-3.bin",  0x000000, 0x010000, CRC(aa13df7c) SHA1(162d4f12364c68028e86fe97ee75c262daa4c699) ) /* 8x8 tiles */
6284
6285   ROM_REGION( 0x100000, REGION_GFX2, ROMREGION_DISPOSE )
6286   ROM_LOAD( "93087-4.bin",  0x000000, 0x100000, CRC(8a4f26d0) SHA1(be057a2b6d28c623ac1f16cf02ddbe12ca430b4a) ) /* 16x16 tiles */
6287
6288   ROM_REGION( 0x100000, REGION_GFX3, ROMREGION_DISPOSE )
6289   ROM_LOAD16_WORD_SWAP( "93087-5.bin", 0x000000, 0x100000, CRC(bb06245d) SHA1(c91e2284d95370b8ef2eb1b9d6305fdd6cde23a0) ) /* Sprites */
6290
6291   ROM_REGION( 0x140000, REGION_SOUND1, 0 ) /* OKIM6295 samples */
6292   ROM_LOAD( "93087-6.bin",    0x040000, 0x100000, CRC(372d46dd) SHA1(18f44e777241af50787730652fa018c51b65ea15) ) /* all banked */
6293
6294   ROM_REGION( 0x140000, REGION_SOUND2, 0 ) /* OKIM6295 samples */
6295   ROM_LOAD( "93087-7.bin",    0x040000, 0x100000, CRC(8da67808) SHA1(f042574c097f5a8c2684fcc23f2c817c168254ef) ) /* all banked */
6296
6297   ROM_REGION( 0x0200, REGION_PROMS, 0 )
6298   ROM_LOAD( "8.bpr",      0x0000, 0x0100, CRC(633ab1c9) SHA1(acd99fcca41eaab7948ca84988352f1d7d519c61) ) /* unknown */
6299   ROM_LOAD( "9.bpr",      0x0000, 0x0100, CRC(435653a2) SHA1(575b4a46ea65179de3042614da438d2f6d8b572e) ) /* unknown */
6300ROM_END
6301
62756302ROM_START( nouryoku )
62766303   ROM_REGION( 0x80000, REGION_CPU1, 0 )      /* 68000 code */
62776304   ROM_LOAD16_BYTE( "ic76.1",  0x00000, 0x40000, CRC(26075988) SHA1(c3d0eef0417be3f78008c026915fd7e2fd589563) )
r2241r2242
69817008GAME( 1993, bigbang,  tdragon2, tdragon2, tdragon2, 0,        ROT270, "NMK",                          "Big Bang (9th Nov. 1993)", GAME_NO_COCKTAIL )
69827009GAME( 1994, raphero,  0,        raphero,  raphero,  0,        ROT270, "Media Trading Corp",           "Rapid Hero (Japan?)", GAME_IMPERFECT_SOUND ) // 23rd July 1993 in test mode, (c)1994 on title screen
69837010
6984GAME( 1992, sabotenb, 0,        bjtwin,   sabotenb, nmk,      ROT0,   "NMK / Tecmo",                  "Saboten Bombers (9th Mar. 1992 / set 1)", GAME_NO_COCKTAIL )
6985GAME( 1992, sabotnba, sabotenb, bjtwin,   sabotenb, nmk,      ROT0,   "NMK / Tecmo",                  "Saboten Bombers (9th Mar. 1992 / set 2)", GAME_NO_COCKTAIL )
6986GAME( 1993, bjtwin,   0,        bjtwin,   bjtwin,   bjtwin,   ROT270, "NMK",                          "Bombjack Twin", GAME_NO_COCKTAIL )
7011/* both sets of both these games show a date of 9th Mar 1992 in the test mode, they look like different revisions so I doubt this is accurate */
7012GAME( 1992, sabotenb, 0,        bjtwin,   sabotenb, nmk,      ROT0,   "NMK / Tecmo",                  "Saboten Bombers (set 1)", GAME_NO_COCKTAIL )
7013GAME( 1992, sabotnba, sabotenb, bjtwin,   sabotenb, nmk,      ROT0,   "NMK / Tecmo",                  "Saboten Bombers (set 2)", GAME_NO_COCKTAIL )
7014GAME( 1993, bjtwin,   0,        bjtwin,   bjtwin,   bjtwin,   ROT270, "NMK",                          "Bombjack Twin (set 1)", GAME_NO_COCKTAIL )
7015GAME( 1993, bjtwina,  bjtwin,   bjtwin,   bjtwin,   bjtwin,   ROT270, "NMK",                          "Bombjack Twin (set 2)", GAME_NO_COCKTAIL )
7016
7017
69877018GAME( 1995, nouryoku, 0,        bjtwin,   nouryoku, nmk,      ROT0,   "Tecmo",                        "Nouryoku Koujou Iinkai", GAME_NO_COCKTAIL )
69887019
69897020/* Non NMK boards */
src/mame/drivers/m10.c
r2241r2242
101101
102102***************************************************************************/
103103#include "driver.h"
104#include "deprecat.h"
105104#include "sound/samples.h"
106105#include "m10.h"
107106
r2241r2242
139138
140139static MACHINE_RESET( irem )
141140{
142   m10_state *state = Machine->driver_data;
141   m10_state *state = machine->driver_data;
143142
144143   state_save_register_global(state->bottomline);
145144   state_save_register_global(state->flip);
r2241r2242
172171
173172static WRITE8_HANDLER( m10_ctrl_w )
174173{
175   m10_state *state = Machine->driver_data;
174   m10_state *state = machine->driver_data;
176175
177176#if DEBUG
178177   if (data & 0x40)
r2241r2242
249248
250249static WRITE8_HANDLER( m11_ctrl_w )
251250{
252   m10_state *state = Machine->driver_data;
251   m10_state *state = machine->driver_data;
253252
254253#if DEBUG
255254   if (data & 0x4C)
r2241r2242
282281
283282static WRITE8_HANDLER( m15_ctrl_w )
284283{
285   m10_state *state = Machine->driver_data;
284   m10_state *state = machine->driver_data;
286285
287286#if DEBUG
288287   if (data & 0xF0)
r2241r2242
411410static READ8_HANDLER( m10_a700_r )
412411{
413412      //printf("rd:%d\n",video_screen_get_vpos(machine->primary_screen));
414   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
413   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
415414   return 0x00;
416415}
417416
src/osd/windows/winwork.c
r2241r2242
2626//============================================================
2727
2828#define KEEP_STATISTICS         (0)
29#define USE_SCALABLE_LOCKS      (0)
2930
3031
3132
r2241r2242
7475typedef struct _scalable_lock scalable_lock;
7576struct _scalable_lock
7677{
78#if USE_SCALABLE_LOCKS
7779   struct
7880   {
7981      volatile INT32    haslock;      // do we have the lock?
8082      INT32          filler[64/4-1];   // assumes a 64-byte cache line
8183   } slot[WORK_MAX_THREADS];         // one slot per thread
8284   volatile INT32       nextindex;      // index of next slot to use
85#else
86   CRITICAL_SECTION   section;
87#endif
8388};
8489
8590
r2241r2242
197202INLINE void scalable_lock_init(scalable_lock *lock)
198203{
199204   memset(lock, 0, sizeof(*lock));
205#if USE_SCALABLE_LOCKS
200206   lock->slot[0].haslock = TRUE;
207#else
208   InitializeCriticalSection(&lock->section);
209#endif
201210}
202211
203212
204213INLINE INT32 scalable_lock_acquire(scalable_lock *lock)
205214{
215#if USE_SCALABLE_LOCKS
206216   INT32 myslot = (interlocked_increment(&lock->nextindex) - 1) & (WORK_MAX_THREADS - 1);
207217   INT32 backoff = 1;
208218
r2241r2242
215225   }
216226   lock->slot[myslot].haslock = FALSE;
217227   return myslot;
228#else
229   EnterCriticalSection(&lock->section);
230   return 0;
231#endif
218232}
219233
220234
221235INLINE void scalable_lock_release(scalable_lock *lock, INT32 myslot)
222236{
237#if USE_SCALABLE_LOCKS
223238   interlocked_exchange32(&lock->slot[(myslot + 1) & (WORK_MAX_THREADS - 1)].haslock, TRUE);
239#else
240   LeaveCriticalSection(&lock->section);
241#endif
224242}
225243
226244
src/osd/windows/ledutil.c
r2241r2242
4242
4343// MAME output header file
4444typedef void running_machine;
45#include "osdcomm.h"
4546#include "output.h"
4647
4748
src/emu/debug/debugcpu.c
r2241r2242
9393static UINT64 get_current_pc(UINT32 ref);
9494static UINT64 get_cpu_reg(UINT32 ref);
9595static void set_cpu_reg(UINT32 ref, UINT64 value);
96static void check_watchpoints(int cpunum, int spacenum, int type, offs_t address, offs_t size, UINT64 value_to_write);
96static void check_watchpoints(int cpunum, int spacenum, int type, offs_t address, UINT64 value_to_write, UINT64 mem_mask);
9797static void check_hotspots(int cpunum, int spacenum, offs_t address);
9898
9999
r2241r2242
209209   /* loop over CPUs and build up their info */
210210   for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
211211   {
212      cpu_type cputype = Machine->config->cpu[cpunum].type;
212      cpu_type cputype = machine->config->cpu[cpunum].type;
213213
214214      /* if this is a dummy, stop looking */
215215      if (cputype == CPU_DUMMY)
r2241r2242
10791079    standard_debug_hook_read - standard read hook
10801080-------------------------------------------------*/
10811081
1082static void standard_debug_hook_read(int spacenum, int size, offs_t address)
1082static void standard_debug_hook_read(int spacenum, offs_t address, UINT64 mem_mask)
10831083{
10841084   debug_cpu_info *info = &debug_cpuinfo[memory_hook_cpunum];
10851085
10861086   /* check watchpoints */
10871087   if (info->read_watchpoints)
1088      check_watchpoints(memory_hook_cpunum, spacenum, WATCHPOINT_READ, address, size, 0);
1088      check_watchpoints(memory_hook_cpunum, spacenum, WATCHPOINT_READ, address, 0, mem_mask);
10891089
10901090   /* check hotspots */
10911091   if (info->hotspots)
r2241r2242
10971097    standard_debug_hook_write - standard write hook
10981098-------------------------------------------------*/
10991099
1100static void standard_debug_hook_write(int spacenum, int size, offs_t address, UINT64 data)
1100static void standard_debug_hook_write(int spacenum, offs_t address, UINT64 data, UINT64 mem_mask)
11011101{
11021102   debug_cpu_info *info = &debug_cpuinfo[memory_hook_cpunum];
11031103
11041104   /* check watchpoints */
11051105   if (info->write_watchpoints)
1106      check_watchpoints(memory_hook_cpunum, spacenum, WATCHPOINT_WRITE, address, size, data);
1106      check_watchpoints(memory_hook_cpunum, spacenum, WATCHPOINT_WRITE, address, data, mem_mask);
11071107}
11081108
11091109
r2241r2242
13071307    breakpoints for a given CPU and address space
13081308-------------------------------------------------*/
13091309
1310static void check_watchpoints(int cpunum, int spacenum, int type, offs_t address, offs_t size, UINT64 value_to_write)
1310static void check_watchpoints(int cpunum, int spacenum, int type, offs_t address, UINT64 value_to_write, UINT64 mem_mask)
13111311{
13121312   debug_cpu_watchpoint *wp;
13131313   UINT64 result;
1314   offs_t size = 0;
13141315
13151316   /* if we're within debugger code, don't stop */
13161317   if (within_debugger_code)
r2241r2242
13181319
13191320   within_debugger_code = TRUE;
13201321
1322   /* adjust address, size & value_to_write based on mem_mask. */
1323   if( mem_mask != 0 )
1324   {
1325      const debug_cpu_info *info = &debug_cpuinfo[cpunum];
1326      int address_offset = 0;
1327      int bus_size = info->space[spacenum].databytes;
1328
1329      while (address_offset < bus_size && (mem_mask & 0xff) == 0)
1330      {
1331         address_offset++;
1332         value_to_write >>= 8;
1333         mem_mask >>= 8;
1334      }
1335
1336      while (mem_mask != 0)
1337      {
1338         size++;
1339         mem_mask >>= 8;
1340      }
1341
1342      if (info->endianness == CPU_IS_LE)
1343      {
1344         address += address_offset;
1345      }
1346      else
1347      {
1348         address += bus_size - size - address_offset;
1349      }
1350   }
1351
13211352   /* if we are a write watchpoint, stash the value that will be written */
13221353   wpaddr = address;
13231354   if (type & WATCHPOINT_WRITE)
r2241r2242
13301361         /* if we do, evaluate the condition */
13311362         if (wp->condition == NULL || (expression_execute(wp->condition, &result) == EXPRERR_NONE && result))
13321363         {
1333            static const char *const sizes[] =
1334            {
1335               "0bytes", "byte", "word", "3bytes", "dword", "5bytes", "6bytes", "7bytes", "qword"
1336            };
1337            char buffer[100];
1338
13391364            /* halt in the debugger by default */
13401365            execution_state = EXECUTION_STATE_STOPPED;
13411366
r2241r2242
13461371            /* print a notification, unless the action made us go again */
13471372            if (execution_state == EXECUTION_STATE_STOPPED)
13481373            {
1374               static const char *const sizes[] =
1375               {
1376                  "0bytes", "byte", "word", "3bytes", "dword", "5bytes", "6bytes", "7bytes", "qword"
1377               };
1378               char buffer[100];
1379
13491380               if (type & WATCHPOINT_WRITE)
13501381               {
13511382                  sprintf(buffer, "Stopped at watchpoint %X writing %s to %08X (PC=%X)", wp->index, sizes[size], BYTE2ADDR(address, &debug_cpuinfo[cpunum], spacenum), activecpu_get_pc());
src/emu/debug/debugcpu.h
r2241r2242
5454    TYPE DEFINITIONS
5555***************************************************************************/
5656
57typedef void (*debug_hook_read_func)(int spacenum, int size, offs_t address);
58typedef void (*debug_hook_write_func)(int spacenum, int size, offs_t address, UINT64 data);
57typedef void (*debug_hook_read_func)(int spacenum, offs_t address, UINT64 mem_mask);
58typedef void (*debug_hook_write_func)(int spacenum, offs_t address, UINT64 data, UINT64 mem_mask);
5959
6060
6161typedef struct _debug_trace_info debug_trace_info;
src/emu/debug/debugcon.c
r2241r2242
8888
8989   /* print the opening lines */
9090   debug_console_printf("MAME new debugger version %s\n", build_version);
91   debug_console_printf("Currently targeting %s (%s)\n", Machine->gamedrv->name, Machine->gamedrv->description);
91   debug_console_printf("Currently targeting %s (%s)\n", machine->gamedrv->name, machine->gamedrv->description);
9292
9393   /* request callback upon exiting */
9494   add_exit_callback(machine, debug_console_exit);
src/emu/cpu/cop400/cop420ds.c
r2241r2242
1313
1414offs_t cop420_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
1515{
16   int op;
17   int cnt = 1;
18   UINT16 addr;
19   UINT8 op2;
16   UINT8 opcode = oprom[0];
17   UINT8 next_opcode = oprom[1];
18   UINT16 address;
2019   UINT32 flags = 0;
20   int bytes = 1;
2121
22   op = oprom[0];
23
24   if ((op >= 0x80 && op <= 0xBE) || (op >= 0xC0 && op <= 0xFE))
22   if ((opcode >= 0x80 && opcode <= 0xBE) || (opcode >= 0xC0 && opcode <= 0xFE))
2523   {
2624      if ((pc & 0x3E0) >= 0x80 && (pc & 0x3E0) < 0x100) //JP pages 2,3
2725      {
28         addr = (UINT16)((pc & 0x380) | (op & 0x7F));
29         sprintf(buffer,"JP %x",addr);
26         address = (UINT16)((pc & 0x380) | (opcode & 0x7F));
27         sprintf(buffer, "JP %x", address);
3028      }
3129      else
3230      {
33         if ((op & 0xC0) == 0xC0) //JP other pages
31         if ((opcode & 0xC0) == 0xC0) //JP other pages
3432         {
35            addr = (UINT16)((pc & 0x3C0) | (op & 0x3F));
36            sprintf(buffer,"JP %x",addr);
33            address = (UINT16)((pc & 0x3C0) | (opcode & 0x3F));
34            sprintf(buffer, "JP %x", address);
3735         }
3836         else               //JSRP
3937         {
40            addr = (UINT16)(0x80 | (op & 0x3F));
41            sprintf(buffer,"JSRP %x",addr);
38            address = (UINT16)(0x80 | (opcode & 0x3F));
39            sprintf(buffer, "JSRP %x", address);
4240            flags = DASMFLAG_STEP_OVER;
4341         }
4442      }
4543   }
46   else if (op >= 0x08 && op <= 0x0F)
44   else if (opcode >= 0x08 && opcode <= 0x0F)
4745   {
48      sprintf(buffer,"LBI 0,%u",((op & 0xF) + 1) & 0xF);
46      sprintf(buffer, "LBI 0,%u", ((opcode & 0xF) + 1) & 0xF);
4947   }
50   else if (op >= 0x18 && op <= 0x1F)
48   else if (opcode >= 0x18 && opcode <= 0x1F)
5149   {
52      sprintf(buffer,"LBI 1,%u",((op & 0xF) + 1) & 0xF);
50      sprintf(buffer, "LBI 1,%u", ((opcode & 0xF) + 1) & 0xF);
5351   }
54   else if (op >= 0x28 && op <= 0x2F)
52   else if (opcode >= 0x28 && opcode <= 0x2F)
5553   {
56      sprintf(buffer,"LBI 2,%u",((op & 0xF) + 1) & 0xF);
54      sprintf(buffer, "LBI 2,%u", ((opcode & 0xF) + 1) & 0xF);
5755   }
58   else if (op >= 0x38 && op <= 0x3F)
56   else if (opcode >= 0x38 && opcode <= 0x3F)
5957   {
60      sprintf(buffer,"LBI 3,%u",((op & 0xF) + 1) & 0xF);
58      sprintf(buffer, "LBI 3,%u", ((opcode & 0xF) + 1) & 0xF);
6159   }
62   else if (op >= 0x51 && op <= 0x5F)
60   else if (opcode >= 0x51 && opcode <= 0x5F)
6361   {
64      sprintf(buffer,"AISC %u",op & 0xF);
62      sprintf(buffer, "AISC %u", opcode & 0xF);
6563   }
66   else if (op >= 0x60 && op <= 0x63)
64   else if (opcode >= 0x60 && opcode <= 0x63)
6765   {
68      addr = ((op & 0x03) << 8) | oprom[1];
69      sprintf(buffer,"JMP %x",addr);
70      cnt = 2;
66      address = ((opcode & 0x03) << 8) | next_opcode;
67      sprintf(buffer, "JMP %x", address);
68      bytes = 2;
7169   }
72   else if (op >= 0x68 && op <= 0x6B)
70   else if (opcode >= 0x68 && opcode <= 0x6B)
7371   {
74      addr = ((op & 0x03) << 8) | oprom[1];
75      sprintf(buffer,"JSR %x",addr);
72      address = ((opcode & 0x03) << 8) | next_opcode;
73      sprintf(buffer, "JSR %x", address);
7674      flags = DASMFLAG_STEP_OVER;
77      cnt = 2;
75      bytes = 2;
7876   }
79   else if (op >= 0x70 && op <= 0x7F)
77   else if (opcode >= 0x70 && opcode <= 0x7F)
8078   {
81      sprintf(buffer,"STII %u",op & 0xF);
79      sprintf(buffer, "STII %u", opcode & 0xF);
8280   }
8381   else
8482   {
85      switch (op)
83      switch (opcode)
8684      {
8785      case 0:
88         sprintf(buffer,"CLRA");
86         sprintf(buffer, "CLRA");
8987         break;
9088
9189      case 1:
92         sprintf(buffer,"SKMBZ 0");
90         sprintf(buffer, "SKMBZ 0");
9391         break;
9492
9593      case 2:
96         sprintf(buffer,"XOR");
94         sprintf(buffer, "XOR");
9795         break;
9896
9997      case 3:
100         sprintf(buffer,"SKMBZ 2");
98         sprintf(buffer, "SKMBZ 2");
10199         break;
102100
103101      case 4:
104         sprintf(buffer,"XIS 0");
102         sprintf(buffer, "XIS 0");
105103         break;
106104
107105      case 5:
108         sprintf(buffer,"LD 0");
106         sprintf(buffer, "LD 0");
109107         break;
110108
111109      case 6:
112         sprintf(buffer,"X 0");
110         sprintf(buffer, "X 0");
113111         break;
114112
115113      case 7:
116         sprintf(buffer,"XDS 0");
114         sprintf(buffer, "XDS 0");
117115         break;
118116
119117      case 0x10:
120         sprintf(buffer,"CASC");
118         sprintf(buffer, "CASC");
121119         break;
122120
123121      case 0x11:
124         sprintf(buffer,"SKMBZ 1");
122         sprintf(buffer, "SKMBZ 1");
125123         break;
126124
127125      case 0x12:
128         sprintf(buffer,"XABR");
126         sprintf(buffer, "XABR");
129127         break;
130128
131129      case 0x13:
132         sprintf(buffer,"SKMBZ 3");
130         sprintf(buffer, "SKMBZ 3");
133131         break;
134132
135133      case 0x14:
136         sprintf(buffer,"XIS 1");
134         sprintf(buffer, "XIS 1");
137135         break;
138136
139137      case 0x15:
140         sprintf(buffer,"LD 1");
138         sprintf(buffer, "LD 1");
141139         break;
142140
143141      case 0x16:
144         sprintf(buffer,"X 1");
142         sprintf(buffer, "X 1");
145143         break;
146144
147145      case 0x17:
148         sprintf(buffer,"XDS 1");
146         sprintf(buffer, "XDS 1");
149147         break;
150148
151149      case 0x20:
152         sprintf(buffer,"SKC");
150         sprintf(buffer, "SKC");
153151         break;
154152
155153      case 0x21:
156         sprintf(buffer,"SKE");
154         sprintf(buffer, "SKE");
157155         break;
158156
159157      case 0x22:
160         sprintf(buffer,"SC");
158         sprintf(buffer, "SC");
161159         break;
162160
163161      case 0x23:
164         addr = (UINT16)(oprom[1] & 0x3F);
165         sprintf(buffer,"XAD %x,%x",((addr & 0x30) >> 4),addr & 0x0F);
166         cnt = 2;
162         bytes = 2;
163
164         if (next_opcode <= 0x3f)
165         {
166            address = (UINT16)(next_opcode & 0x3F);
167            sprintf(buffer, "LDD %x,%x", ((address & 0x30) >> 4),address & 0x0F);
168         }
169         else if (next_opcode >= 0x80 && next_opcode <= 0xbf)
170         {
171            address = (UINT16)(next_opcode & 0x3F);
172            sprintf(buffer, "XAD %x,%x", ((address & 0x30) >> 4),address & 0x0F);
173         }
174         else
175         {
176            sprintf(buffer, "Invalid");
177         }
167178         break;
168179
169180      case 0x24:
170         sprintf(buffer,"XIS 2");
181         sprintf(buffer, "XIS 2");
171182         break;
172183
173184      case 0x25:
174         sprintf(buffer,"LD 2");
185         sprintf(buffer, "LD 2");
175186         break;
176187
177188      case 0x26:
178         sprintf(buffer,"X 2");
189         sprintf(buffer, "X 2");
179190         break;
180191
181192      case 0x27:
182         sprintf(buffer,"XDS 2");
193         sprintf(buffer, "XDS 2");
183194         break;
184195
185196      case 0x30:
186         sprintf(buffer,"ASC");
197         sprintf(buffer, "ASC");
187198         break;
188199
189200      case 0x31:
190         sprintf(buffer,"ADD");
201         sprintf(buffer, "ADD");
191202         break;
192203
193204      case 0x32:
194         sprintf(buffer,"RC");
205         sprintf(buffer, "RC");
195206         break;
196207
197208      case 0x33:
198         op2 = oprom[1];
199         cnt = 2;
209         bytes = 2;
200210
201         if (op2 >= 0x50 && op2 <= 0x5F)
211         if (next_opcode >= 0x50 && next_opcode <= 0x5F)
202212         {
203            sprintf(buffer,"OGI %u",op2 & 0xF);
213            sprintf(buffer, "OGI %u", next_opcode & 0xF);
204214         }
205         else if (op2 >= 0x60 && op2 <= 0x6F)
215         else if (next_opcode >= 0x60 && next_opcode <= 0x6F)
206216         {
207            sprintf(buffer,"LEI %u",op2 & 0xF);
217            sprintf(buffer, "LEI %u", next_opcode & 0xF);
208218         }
209         else if (op2 >= 0x81 && op2 <= 0x88)
219         else if (next_opcode >= 0x81 && next_opcode <= 0x88)
210220         {
211            sprintf(buffer,"LBI 0,%u",op2 & 0xF);
221            sprintf(buffer, "LBI 0,%u", next_opcode & 0xF);
212222         }
213         else if (op2 >= 0x91 && op2 <= 0x98)
223         else if (next_opcode >= 0x91 && next_opcode <= 0x98)
214224         {
215            sprintf(buffer,"LBI 1,%u",op2 & 0xF);
225            sprintf(buffer, "LBI 1,%u", next_opcode & 0xF);
216226         }
217         else if (op2 >= 0xA1 && op2 <= 0xA8)
227         else if (next_opcode >= 0xA1 && next_opcode <= 0xA8)
218228         {
219            sprintf(buffer,"LBI 2,%u",op2 & 0xF);
229            sprintf(buffer, "LBI 2,%u", next_opcode & 0xF);
220230         }
221         else if (op2 >= 0xB1 && op2 <= 0xB8)
231         else if (next_opcode >= 0xB1 && next_opcode <= 0xB8)
222232         {
223            sprintf(buffer,"LBI 3,%u",op2 & 0xF);
233            sprintf(buffer, "LBI 3,%u", next_opcode & 0xF);
224234         }
225235         else
226236         {
227            switch (op2)
237            switch (next_opcode)
228238            {
229239            case 0x00:
230               sprintf(buffer,"INIL");
240               sprintf(buffer, "INIL");
231241               break;
232242
233243            case 0x01:
234               sprintf(buffer,"SKGBZ 0");
244               sprintf(buffer, "SKGBZ 0");
235245               break;
236246
237247            case 0x03:
238               sprintf(buffer,"SKGBZ 2");
248               sprintf(buffer, "SKGBZ 2");
239249               break;
240250
241251            case 0x11:
242               sprintf(buffer,"SKGBZ 1");
252               sprintf(buffer, "SKGBZ 1");
243253               break;
244254
245255            case 0x13:
246               sprintf(buffer,"SKGBZ 3");
256               sprintf(buffer, "SKGBZ 3");
247257               break;
248258
249259            case 0x21:
250               sprintf(buffer,"SKGZ");
260               sprintf(buffer, "SKGZ");
251261               break;
252262
253263            case 0x28:
254               sprintf(buffer,"ININ");
264               sprintf(buffer, "ININ");
255265               break;
256266
257267            case 0x2A:
258               sprintf(buffer,"ING");
268               sprintf(buffer, "ING");
259269               break;
260270
261271            case 0x2C:
262               sprintf(buffer,"COMA");
272               sprintf(buffer, "COMA");
263273               break;
264274
265275            case 0x2E:
266               sprintf(buffer,"INL");
276               sprintf(buffer, "INL");
267277               break;
268278
269279            case 0x3A:
270               sprintf(buffer,"OMG");
280               sprintf(buffer, "OMG");
271281               break;
272282
273283            case 0x3C:
274               sprintf(buffer,"CAMQ");
284               sprintf(buffer, "CAMQ");
275285               break;
276286
277287            case 0x3E:
278               sprintf(buffer,"OBD");
288               sprintf(buffer, "OBD");
279289               break;
280290
281291            default:
282               sprintf(buffer,"Invalid");
292               sprintf(buffer, "Invalid");
283293               break;
284294            }
285295         }
286296         break;
287297
288298      case 0x34:
289         sprintf(buffer,"XIS 3");
299         sprintf(buffer, "XIS 3");
290300         break;
291301
292302      case 0x35:
293         sprintf(buffer,"LD 3");
303         sprintf(buffer, "LD 3");
294304         break;
295305
296306      case 0x36:
297         sprintf(buffer,"X 3");
307         sprintf(buffer, "X 3");
298308         break;
299309
300310      case 0x37:
301         sprintf(buffer,"XDS 3");
311         sprintf(buffer, "XDS 3");
302312         break;
303313
304314      case 0x40:
305         sprintf(buffer,"COMP");
315         sprintf(buffer, "COMP");
306316         break;
307317
308318      case 0x41:
309         sprintf(buffer,"SKT");
319         sprintf(buffer, "SKT");
310320         break;
311321
312322      case 0x42:
313         sprintf(buffer,"RMB 2");
323         sprintf(buffer, "RMB 2");
314324         break;
315325
316326      case 0x43:
317         sprintf(buffer,"RMB 3");
327         sprintf(buffer, "RMB 3");
318328         break;
319329
320330      case 0x44:
321         sprintf(buffer,"NOP");
331         sprintf(buffer, "NOP");
322332         break;
323333
324334      case 0x45:
325         sprintf(buffer,"RMB 1");
335         sprintf(buffer, "RMB 1");
326336         break;
327337
328338      case 0x46:
329         sprintf(buffer,"SMB 2");
339         sprintf(buffer, "SMB 2");
330340         break;
331341
332342      case 0x47:
333         sprintf(buffer,"SMB 1");
343         sprintf(buffer, "SMB 1");
334344         break;
335345
336346      case 0x48:
337         sprintf(buffer,"RET");
347         sprintf(buffer, "RET");
338348         flags = DASMFLAG_STEP_OUT;
339349         break;
340350
341351      case 0x49:
342         sprintf(buffer,"RETSK");
352         sprintf(buffer, "RETSK");
343353         flags = DASMFLAG_STEP_OUT;
344354         break;
345355
346356      case 0x4A:
347         sprintf(buffer,"ADT");
357         sprintf(buffer, "ADT");
348358         break;
349359
350360      case 0x4B:
351         sprintf(buffer,"SMB 3");
361         sprintf(buffer, "SMB 3");
352362         break;
353363
354364      case 0x4C:
355         sprintf(buffer,"RMB 0");
365         sprintf(buffer, "RMB 0");
356366         break;
357367
358368      case 0x4D:
359         sprintf(buffer,"SMB 0");
369         sprintf(buffer, "SMB 0");
360370         break;
361371
362372      case 0x4E:
363         sprintf(buffer,"CBA");
373         sprintf(buffer, "CBA");
364374         break;
365375
366376      case 0x4F:
367         sprintf(buffer,"XAS");
377         sprintf(buffer, "XAS");
368378         break;
369379
370380      case 0x50:
371         sprintf(buffer,"CAB");
381         sprintf(buffer, "CAB");
372382         break;
373383
374384      case 0xBF:
375         sprintf(buffer,"LQID");
385         sprintf(buffer, "LQID");
376386         break;
377387
378388      case 0xFF:
379         sprintf(buffer,"JID");
389         sprintf(buffer, "JID");
380390         break;
381391
382392      default:
383         sprintf(buffer,"Invalid");
393         sprintf(buffer, "Invalid");
384394         break;
385395      }
386396   }
387397
388   return cnt | flags | DASMFLAG_SUPPORTED;
398   return bytes | flags | DASMFLAG_SUPPORTED;
389399}
src/emu/cpu/cop400/410ops.c
r2241r2242
99
1010***************************************************************************/
1111
12#define ROM(A)         cpu_readop(A)
13#define RAM_W(A,V)      (data_write_byte_8(A,V))
14#define RAM_R(A)      (data_read_byte_8(A))
12#define INSTRUCTION(mnemonic) INLINE void (mnemonic)(UINT8 opcode)
1513
16#define IN(A)         io_read_byte_8(A)
17#define OUT(A,V)      io_write_byte_8(A,V)
14#define ROM(addr)         cpu_readop(addr)
15#define RAM_W(addr, value)   (data_write_byte_8(addr, value))
16#define RAM_R(addr)         (data_read_byte_8(addr))
1817
18#define IN(addr)         io_read_byte_8(addr)
19#define OUT(addr, value)   io_write_byte_8(addr, value)
20
1921#define A            R.A
2022#define B            R.B
2123#define C            R.C
r2241r2242
3133#define skip         R.skip
3234#define skipLBI         R.skipLBI
3335
34#define READ_M         RAM_R(B)
35#define WRITE_M(VAL)   RAM_W(B,VAL)
36
3736#define IN_G()         IN(COP400_PORT_G)
3837#define IN_L()         IN(COP400_PORT_L)
38#define IN_SI()         IN(COP400_PORT_SIO)
3939#define OUT_G(A)      OUT(COP400_PORT_G, (A) & R.G_mask)
4040#define OUT_L(A)      OUT(COP400_PORT_L, (A))
4141#define OUT_D(A)      OUT(COP400_PORT_D, (A) & R.D_mask)
42#define OUT_SK(A)      OUT(COP400_PORT_SK,A)
42#define OUT_SK(A)      OUT(COP400_PORT_SK, (A))
43#define OUT_SO(A)      OUT(COP400_PORT_SIO, (A))
4344
4445#ifndef PUSH
4546#define PUSH(addr)       { SB = SA; SA = addr; }
4647#define POP()          { PC = SA; SA = SB; }
4748#endif
4849
49INLINE void illegal(void)
50{
51   logerror("ICOP400:  PC = %04x,  Illegal opcode = %02x\n", PC-1, ROM(PC-1));
52}
50/* Serial I/O */
5351
54INLINE void WRITE_SK(UINT8 data)
52static TIMER_CALLBACK(cop410_serial_tick)
5553{
56   SKL = data;
54    int cpunum = param;
5755
58   if (EN & 0x01)
56   cpuintrf_push_context(cpunum);
57
58   if (BIT(EN, 0))
5959   {
60      /* SIO is a binary counter */
61
62      // serial input
63
64      int si = IN_SI();
65
66      if (R.last_si && !si)
67      {
68         SIO--;
69         SIO &= 0x0f;
70      }
71
72      R.last_si = si;
73
74      // serial output
75
76      OUT_SO(BIT(EN, 3));
77
78      // serial clock
79
6080      OUT_SK(SKL);
6181   }
6282   else
6383   {
64      // NOT IMPLEMENTED
65      OUT_SK(SKL);
84      /* SIO is a shift register */
85
86      // serial output
87
88      if (BIT(EN, 3))
89      {
90         OUT_SO(BIT(SIO, 3));
91      }
92      else
93      {
94         OUT_SO(0);
95      }
96
97      SIO <<= 1;
98
99      // serial input
100
101      SIO = (SIO & 0x0e) | BIT(IN_SI(), 0);
102
103      // serial clock
104
105      if (SKL)
106      {
107         OUT_SK(1);
108      }
109      else
110      {
111         OUT_SK(0);
112      }
66113   }
114
115   cpuintrf_pop_context();
67116}
68117
69118INLINE void WRITE_Q(UINT8 data)
70119{
71120   Q = data;
72121
73   if (EN & 0x04)
122   if (BIT(EN, 2))
74123   {
75124      OUT_L(Q);
76125   }
r2241r2242
82131   OUT_G(G);
83132}
84133
85INLINE void add(void) { A = (A + RAM_R(B)) & 0x0F; }
134INSTRUCTION(illegal)
135{
136   logerror("COP400: PC = %04x, Illegal opcode = %02x\n", PC-1, ROM(PC-1));
137}
86138
87INLINE void asc(void)
139/* Arithmetic Instructions */
140
141/*
142
143    Mnemonic:           ASC
144
145    Hex Code:           30
146    Binary:             0 0 1 1 0 0 0 0
147
148    Data Flow:          A + C + RAM(B) -> A
149                        Carry -> C
150
151    Skip Conditions:    Carry
152
153    Description:        Add with Carry, Skip on Carry
154
155*/
156
157INSTRUCTION(asc)
88158{
89159   A = A + C + RAM_R(B);
90160
r2241r2242
100170   }
101171}
102172
103INLINE void AISC(int y)
173/*
174
175    Mnemonic:           ADD
176
177    Hex Code:           31
178    Binary:             0 0 1 1 0 0 0 1
179
180    Data Flow:          A + RAM(B) -> A
181
182    Description:        Add RAM to A
183
184*/
185
186INSTRUCTION(add)
104187{
188   A = (A + RAM_R(B)) & 0x0F;
189}
190
191/*
192
193    Mnemonic:           AISC
194
195    Operand:            y
196    Hex Code:           5-
197    Binary:             0 1 0 1 y3 y2 y1 y0
198
199    Data Flow:          A + y -> A
200
201    Skip Conditions:    Carry
202
203    Description:        Add Immediate, Skip on Carry (y != 0)
204
205*/
206
207INSTRUCTION(aisc)
208{
209   UINT4 y = opcode & 0x0f;
210
105211   A = A + y;
106212
107   if (A > 0xF)
213   if (A > 0x0f)
108214   {
109215      skip = 1;
110216      A &= 0xF;
111217   }
112218}
113219
114INLINE void aisc1(void) { AISC(0x1); }
115INLINE void aisc2(void) { AISC(0x2); }
116INLINE void aisc3(void) { AISC(0x3); }
117INLINE void aisc4(void) { AISC(0x4); }
118INLINE void aisc5(void) { AISC(0x5); }
119INLINE void aisc6(void) { AISC(0x6); }
120INLINE void aisc7(void) { AISC(0x7); }
121INLINE void aisc8(void) { AISC(0x8); }
122INLINE void aisc9(void) { AISC(0x9); }
123INLINE void aisc10(void) { AISC(0xA); }
124INLINE void aisc11(void) { AISC(0xB); }
125INLINE void aisc12(void) { AISC(0xC); }
126INLINE void aisc13(void) { AISC(0xD); }
127INLINE void aisc14(void) { AISC(0xE); }
128INLINE void aisc15(void) { AISC(0xF); }
220/*
129221
130INLINE void cab(void) { B = (B & 0x30) | A; }
222   Mnemonic:   CLRA
131223
132INLINE void camq(void) { WRITE_Q((A << 4) | READ_M); }
224    Hex Code:           00
225    Binary:             0 0 0 0 0 0 0 0
133226
134INLINE void cba(void) { A = B & 0xF; }
227   Data Flow:     0 -> A
135228
136INLINE void clra(void){ A = 0; }
229   Description:     Clear A
137230
138INLINE void comp(void) { A = A ^ 0xF; }
231*/
139232
140INLINE void ing(void) { A = IN_G(); }
233INSTRUCTION(clra)
234{
235   A = 0;
236}
141237
142INLINE void inl(void)
238/*
239
240    Mnemonic:           COMP
241
242    Hex Code:           40
243    Binary:             0 1 0 0 0 0 0 0
244
245    Data Flow:          ~A -> A
246
247    Description:        Ones Complement of A to A
248
249*/
250
251INSTRUCTION(comp)
143252{
144   UINT8 L = IN_L();
145   RAM_W(B, L >> 4);
146   A = L & 0xF;
253   A = A ^ 0xF;
147254}
148255
149INLINE void jid(void)
256/*
257
258    Mnemonic:           NOP
259
260    Hex Code:           44
261    Binary:             0 1 0 0 0 1 0 0
262
263    Description:        No Operation
264
265*/
266
267INSTRUCTION(nop)
150268{
151   UINT16 addr = (PC & 0x300) | (A << 4) | READ_M;
269   // do nothing
270}
271
272/*
273
274    Mnemonic:           RC
275
276    Hex Code:           32
277    Binary:             0 0 1 1 0 0 1 0
278
279    Data Flow:          "0" -> C
280
281    Description:        Reset C
282
283*/
284
285INSTRUCTION(rc)
286{
287   C = 0;
288}
289
290/*
291
292    Mnemonic:           SC
293
294    Hex Code:           22
295    Binary:             0 0 1 0 0 0 1 0
296
297    Data Flow:          "1" -> C
298
299    Description:        Set C
300
301*/
302
303INSTRUCTION(sc)
304{
305   C = 1;
306}
307
308/*
309
310    Mnemonic:           XOR
311
312    Hex Code:           02
313    Binary:             0 0 0 0 0 0 1 0
314
315    Data Flow:          A ^ RAM(B) -> A
316
317    Description:        Exclusive-OR RAM with A
318
319*/
320
321INSTRUCTION(xor)
322{
323   A = A ^ RAM_R(B);
324}
325
326/* Transfer-of-Control Instructions */
327
328/*
329
330    Mnemonic:           JID
331
332    Hex Code:           FF
333    Binary:             1 1 1 1 1 1 1 1
334
335    Data Flow:          ROM(PC9:8,A,M) -> PC7:0
336
337    Description:        Jump Indirect
338
339*/
340
341INSTRUCTION(jid)
342{
343   UINT16 addr = (PC & 0x300) | (A << 4) | RAM_R(B);
152344   PC = (PC & 0x300) | ROM(addr);
153345}
154346
155INLINE void JMP(UINT8 a8)
347/*
348
349    Mnemonic:           JMP
350
351    Operand:            a
352    Hex Code:           6- --
353    Binary:             0 1 1 0 0 0 a9 a8 a7 a6 a5 a4 a3 a2 a1 a0
354
355    Data Flow:          a -> PC
356
357    Description:        Jump
358
359*/
360
361INSTRUCTION(jmp)
156362{
157   PC = (a8 << 8) | ROM(PC);
363   UINT16 a = ((opcode & 0x03) << 8) | ROM(PC);
364
365   PC = a;
158366}
159367
160INLINE void jmp0(void) { JMP(0); }
161INLINE void jmp1(void) { JMP(1); }
162INLINE void jmp2(void) { JMP(2); }
163INLINE void jmp3(void) { JMP(3); }
368/*
164369
165INLINE void jp(void)
370    Mnemonic:           JP
371
372    Operand:            a
373    Hex Code:           --
374    Binary:             1 a6 a5 a4 a3 a2 a1 a0
375                        (pages 2,3 only)
376
377                        1 1 a5 a4 a3 a2 a1 a0
378                        (all other pages)
379
380    Data Flow:          a -> PC6:0
381
382                        a -> PC5:0
383
384    Description:        Jump within Page
385
386*/
387
388INSTRUCTION(jp)
166389{
167   UINT8 op = ROM(prevPC);
390   UINT4 page = PC >> 6;
168391
169   if (((PC & 0x3E0) >= 0x80) && ((PC & 0x3E0) < 0x100)) //JP pages 2,3
392   if (page == 2 || page == 3)
170393   {
171      PC = (UINT16)((PC & 0x380) | (op & 0x7F));
394      UINT8 a = opcode & 0x7f;
395      PC = (PC & 0x380) | a;
172396   }
397   else if ((opcode & 0xc0) == 0xc0)
398   {
399      UINT8 a = opcode & 0x3f;
400      PC = (PC & 0x3c0) | a;
401   }
173402   else
174403   {
175      if ((op & 0xC0) == 0xC0) //JP other pages
176      {
177         PC = (UINT16)((PC & 0x3C0) | (op & 0x3F));
178      }
179      else               //JSRP
180      {
181         PUSH((UINT16)(PC));
182         PC = (UINT16)(0x80 | (op & 0x3F));
183      }
404      // JSRP
405      UINT8 a = opcode & 0x3f;
406      PUSH(PC + 1);
407      PC = 0x80 | a;
184408   }
185409}
186410
187INLINE void JSR(UINT8 a8)
411/*
412
413    Mnemonic:           JSR
414
415    Operand:            a
416    Hex Code:           6- --
417    Binary:             0 1 1 0 1 0 a9 a8 a7 a6 a5 a4 a3 a2 a1 a0
418
419    Data Flow:          PC + 1 -> SA -> SB -> SC
420                        a -> PC
421
422    Description:        Jump to Subroutine
423
424*/
425
426INSTRUCTION(jsr)
188427{
428   UINT16 a = ((opcode & 0x03) << 8) | ROM(PC);
429
189430   PUSH(PC + 1);
190   PC = (a8 << 8) | ROM(PC);
431   PC = a;
191432}
192433
193INLINE void jsr0(void) { JSR(0); }
194INLINE void jsr1(void) { JSR(1); }
195INLINE void jsr2(void) { JSR(2); }
196INLINE void jsr3(void) { JSR(3); }
434/*
197435
198INLINE void LD(UINT8 r)
436    Mnemonic:           RET
437
438    Hex Code:           48
439    Binary:             0 1 0 0 1 0 0 0
440
441    Data Flow:          SC -> SB -> SA -> PC
442
443    Description:        Return from Subroutine
444
445*/
446
447INSTRUCTION(ret)
199448{
200   A = RAM_R(B);
201   B = B ^ (r << 4);
449   POP();
202450}
203451
204INLINE void ld0(void) { LD(0); }
205INLINE void ld1(void) { LD(1); }
206INLINE void ld2(void) { LD(2); }
207INLINE void ld3(void) { LD(3); }
452/*
208453
209INLINE void LBI(UINT8 r, UINT8 d)
454    Mnemonic:           RETSK
455
456    Hex Code:           49
457    Binary:             0 1 0 0 1 0 0 1
458
459    Data Flow:          SC -> SB -> SA -> PC
460
461    Skip Conditions:    Always Skip on Return
462
463    Description:        Return from Subroutine then Skip
464
465*/
466
467INSTRUCTION(retsk)
210468{
211   B = (r << 4) | d;
212   skipLBI = 1;
469   POP();
470   skip = 1;
213471}
214472
215INLINE void lbi0_0(void) { LBI(0,0); }
216INLINE void lbi0_1(void) { LBI(0,1); }
217INLINE void lbi0_2(void) { LBI(0,2); }
218INLINE void lbi0_3(void) { LBI(0,3); }
219INLINE void lbi0_4(void) { LBI(0,4); }
220INLINE void lbi0_5(void) { LBI(0,5); }
221INLINE void lbi0_6(void) { LBI(0,6); }
222INLINE void lbi0_7(void) { LBI(0,7); }
223INLINE void lbi0_8(void) { LBI(0,8); }
224INLINE void lbi0_9(void) { LBI(0,9); }
225INLINE void lbi0_10(void) { LBI(0,10); }
226INLINE void lbi0_11(void) { LBI(0,11); }
227INLINE void lbi0_12(void) { LBI(0,12); }
228INLINE void lbi0_13(void) { LBI(0,13); }
229INLINE void lbi0_14(void) { LBI(0,14); }
230INLINE void lbi0_15(void) { LBI(0,15); }
473/* Memory Reference Instructions */
231474
232INLINE void lbi1_0(void) { LBI(1,0); }
233INLINE void lbi1_1(void) { LBI(1,1); }
234INLINE void lbi1_2(void) { LBI(1,2); }
235INLINE void lbi1_3(void) { LBI(1,3); }
236INLINE void lbi1_4(void) { LBI(1,4); }
237INLINE void lbi1_5(void) { LBI(1,5); }
238INLINE void lbi1_6(void) { LBI(1,6); }
239INLINE void lbi1_7(void) { LBI(1,7); }
240INLINE void lbi1_8(void) { LBI(1,8); }
241INLINE void lbi1_9(void) { LBI(1,9); }
242INLINE void lbi1_10(void) { LBI(1,10); }
243INLINE void lbi1_11(void) { LBI(1,11); }
244INLINE void lbi1_12(void) { LBI(1,12); }
245INLINE void lbi1_13(void) { LBI(1,13); }
246INLINE void lbi1_14(void) { LBI(1,14); }
247INLINE void lbi1_15(void) { LBI(1,15); }
475/*
248476
249INLINE void lbi2_0(void) { LBI(2,0); }
250INLINE void lbi2_1(void) { LBI(2,1); }
251INLINE void lbi2_2(void) { LBI(2,2); }
252INLINE void lbi2_3(void) { LBI(2,3); }
253INLINE void lbi2_4(void) { LBI(2,4); }
254INLINE void lbi2_5(void) { LBI(2,5); }
255INLINE void lbi2_6(void) { LBI(2,6); }
256INLINE void lbi2_7(void) { LBI(2,7); }
257INLINE void lbi2_8(void) { LBI(2,8); }
258INLINE void lbi2_9(void) { LBI(2,9); }
259INLINE void lbi2_10(void) { LBI(2,10); }
260INLINE void lbi2_11(void) { LBI(2,11); }
261INLINE void lbi2_12(void) { LBI(2,12); }
262INLINE void lbi2_13(void) { LBI(2,13); }
263INLINE void lbi2_14(void) { LBI(2,14); }
264INLINE void lbi2_15(void) { LBI(2,15); }
477    Mnemonic:           CAMQ
265478
266INLINE void lbi3_0(void) { LBI(3,0); }
267INLINE void lbi3_1(void) { LBI(3,1); }
268INLINE void lbi3_2(void) { LBI(3,2); }
269INLINE void lbi3_3(void) { LBI(3,3); }
270INLINE void lbi3_4(void) { LBI(3,4); }
271INLINE void lbi3_5(void) { LBI(3,5); }
272INLINE void lbi3_6(void) { LBI(3,6); }
273INLINE void lbi3_7(void) { LBI(3,7); }
274INLINE void lbi3_8(void) { LBI(3,8); }
275INLINE void lbi3_9(void) { LBI(3,9); }
276INLINE void lbi3_10(void) { LBI(3,10); }
277INLINE void lbi3_11(void) { LBI(3,11); }
278INLINE void lbi3_12(void) { LBI(3,12); }
279INLINE void lbi3_13(void) { LBI(3,13); }
280INLINE void lbi3_14(void) { LBI(3,14); }
281INLINE void lbi3_15(void) { LBI(3,15); }
479    Hex Code:           33 3C
480    Binary:             0 0 1 1 0 0 1 1 0 0 1 1 1 1 0 0
282481
283INLINE void LEI(UINT8 y)
482    Data Flow:          A -> Q7:4
483                        RAM(B) -> Q3:0
484
485    Description:        Copy A, RAM to Q
486
487*/
488
489INSTRUCTION(camq)
284490{
285   EN = y & 0x0f;
491   WRITE_Q((A << 4) | RAM_R(B));
492}
286493
287   WRITE_Q(Q);
494/*
495
496    Mnemonic:           LD
497
498    Operand:            r
499    Hex Code:           -5
500    Binary:             0 0 r1 r0 0 1 0 1
501
502    Data Flow:          RAM(B) -> A
503                        Br ^ r -> Br
504
505    Description:        Load RAM into A, Exclusive-OR Br with r
506
507*/
508
509INSTRUCTION(ld)
510{
511   UINT8 r = opcode & 0x30;
512
513   A = RAM_R(B);
514   B = B ^ r;
288515}
289516
290INLINE void lei0(void) { LEI(0); }
291INLINE void lei1(void) { LEI(1); }
292INLINE void lei2(void) { LEI(2); }
293INLINE void lei3(void) { LEI(3); }
294INLINE void lei4(void) { LEI(4); }
295INLINE void lei5(void) { LEI(5); }
296INLINE void lei6(void) { LEI(6); }
297INLINE void lei7(void) { LEI(7); }
298INLINE void lei8(void) { LEI(8); }
299INLINE void lei9(void) { LEI(9); }
300INLINE void lei10(void) { LEI(10); }
301INLINE void lei11(void) { LEI(11); }
302INLINE void lei12(void) { LEI(12); }
303INLINE void lei13(void) { LEI(13); }
304INLINE void lei14(void) { LEI(14); }
305INLINE void lei15(void) { LEI(15); }
517/*
306518
307INLINE void lqid(void)
519    Mnemonic:           LQID
520
521    Hex Code:           BF
522    Binary:             1 0 1 1 1 1 1 1
523
524    Data Flow:          ROM(PC9:8,A,M) -> Q
525                        SB -> SC
526
527    Description:        Load Q Indirect
528
529*/
530
531INSTRUCTION(lqid)
308532{
309533   PUSH(PC + 1);
310   PC = (UINT16)((PC & 0x300) | (A << 4) | READ_M);
534   PC = (PC & 0x300) | (A << 4) | RAM_R(B);
311535   WRITE_Q(ROM(PC));
312536   POP();
313537}
314538
315INLINE void nop(void) { }
539/*
316540
317INLINE void obd(void) { OUT_D(B); }
541   Mnemonic:         RMB
318542
319INLINE void omg(void) { WRITE_G(RAM_R(B)); }
543    Operand:            0
544                        1
545                        2
546                        3
320547
321INLINE void rc(void) { C = 0; }
548    Hex Code:           4C
549                        45
550                        42
551                        43
322552
323INLINE void ret(void) { POP(); }
553    Binary:             0 1 0 0 1 1 0 0
554                        0 1 0 0 0 1 0 1
555                        0 1 0 0 0 0 1 0
556                        0 1 0 0 0 0 1 1
324557
325INLINE void retsk(void) { POP(); skip = 1; }
558    Data Flow:          0 -> RAM(B)0
559                        0 -> RAM(B)1
560                        0 -> RAM(B)2
561                        0 -> RAM(B)3
326562
327INLINE void rmb0(void) { RAM_W(B, RAM_R(B) & 0xE); }
328INLINE void rmb1(void) { RAM_W(B, RAM_R(B) & 0xD); }
329INLINE void rmb2(void) { RAM_W(B, RAM_R(B) & 0xB); }
330INLINE void rmb3(void) { RAM_W(B, RAM_R(B) & 0x7); }
563    Description:        Reset RAM Bit
331564
332INLINE void sc(void) { C = 1; }
565*/
333566
334INLINE void skc(void) { if (C == 1) skip = 1; }
567INSTRUCTION(rmb0) { RAM_W(B, RAM_R(B) & 0xE); }
568INSTRUCTION(rmb1) { RAM_W(B, RAM_R(B) & 0xD); }
569INSTRUCTION(rmb2) { RAM_W(B, RAM_R(B) & 0xB); }
570INSTRUCTION(rmb3) { RAM_W(B, RAM_R(B) & 0x7); }
335571
336INLINE void ske(void) { if (A == RAM_R(B)) skip = 1; }
572/*
337573
338INLINE void skmbz0(void) { if ((RAM_R(B) & 0x01) == 0 ) skip = 1; }
339INLINE void skmbz1(void) { if ((RAM_R(B) & 0x02) == 0 ) skip = 1; }
340INLINE void skmbz2(void) { if ((RAM_R(B) & 0x04) == 0 ) skip = 1; }
341INLINE void skmbz3(void) { if ((RAM_R(B) & 0x08) == 0 ) skip = 1; }
574    Mnemonic:           SMB
342575
343INLINE void skgbz0(void) { if ((IN_G() & 0x01) == 0) skip = 1; }
344INLINE void skgbz1(void) { if ((IN_G() & 0x02) == 0) skip = 1; }
345INLINE void skgbz2(void) { if ((IN_G() & 0x04) == 0) skip = 1; }
346INLINE void skgbz3(void) { if ((IN_G() & 0x08) == 0) skip = 1; }
576    Operand:            0
577                        1
578                        2
579                        3
347580
348INLINE void skgz(void) { if (IN_G() == 0) skip = 1; }
581    Hex Code:           4D
582                        47
583                        46
584                        4B
349585
350INLINE void smb0(void) { RAM_W(B, RAM_R(B) | 0x1); }
351INLINE void smb1(void) { RAM_W(B, RAM_R(B) | 0x2); }
352INLINE void smb2(void) { RAM_W(B, RAM_R(B) | 0x4); }
353INLINE void smb3(void) { RAM_W(B, RAM_R(B) | 0x8); }
586    Binary:             0 1 0 0 1 1 0 1
587                        0 1 0 0 0 1 1 1
588                        0 1 0 0 0 1 1 0
589                        0 1 0 0 1 0 1 1
354590
355INLINE void STII(UINT8 y)
591    Data Flow:          1 -> RAM(B)0
592                        1 -> RAM(B)1
593                        1 -> RAM(B)2
594                        1 -> RAM(B)3
595
596    Description:        Set RAM Bit
597
598*/
599
600INSTRUCTION(smb0) { RAM_W(B, RAM_R(B) | 0x1); }
601INSTRUCTION(smb1) { RAM_W(B, RAM_R(B) | 0x2); }
602INSTRUCTION(smb2) { RAM_W(B, RAM_R(B) | 0x4); }
603INSTRUCTION(smb3) { RAM_W(B, RAM_R(B) | 0x8); }
604
605/*
606
607    Mnemonic:           STII
608
609    Operand:            y
610    Hex Code:           7-
611    Binary:             0 1 1 1 y3 y2 y1 y0
612
613    Data Flow:          y -> RAM(B)
614                        Bd + 1 -> Bd
615
616    Description:        Store Memory Immediate and Increment Bd
617
618*/
619
620INSTRUCTION(stii)
356621{
622   UINT4 y = opcode & 0x0f;
357623   UINT16 Bd;
358624
359625   RAM_W(B, y);
360   Bd = (B & 0x0f) + 1;
361   if (Bd > 15) Bd = 0;
626
627   Bd = ((B & 0x0f) + 1) & 0x0f;
362628   B = (B & 0x30) + Bd;
363629}
364630
365INLINE void stii0(void) { STII(0x0); }
366INLINE void stii1(void) { STII(0x1); }
367INLINE void stii2(void) { STII(0x2); }
368INLINE void stii3(void) { STII(0x3); }
631/*
369632
370INLINE void stii4(void) { STII(0x4); }
371INLINE void stii5(void) { STII(0x5); }
372INLINE void stii6(void) { STII(0x6); }
373INLINE void stii7(void) { STII(0x7); }
633    Mnemonic:           X
374634
375INLINE void stii8(void) { STII(0x8); }
376INLINE void stii9(void) { STII(0x9); }
377INLINE void stii10(void) { STII(0xA); }
378INLINE void stii11(void) { STII(0xB); }
635    Operand:            r
636    Hex Code:           -6
637    Binary:             0 0 r1 r0 0 1 1 0
379638
380INLINE void stii12(void) { STII(0xC); }
381INLINE void stii13(void) { STII(0xD); }
382INLINE void stii14(void) { STII(0xE); }
383INLINE void stii15(void) { STII(0xF); }
639    Data Flow:          RAM(B) <-> A
640                        Br ^ r -> Br
384641
385INLINE void X(UINT8 r)
642    Description:        Exchange RAM with A, Exclusive-OR Br with r
643
644*/
645
646INSTRUCTION(x)
386647{
648   UINT4 r = opcode & 0x30;
387649   UINT8 t = RAM_R(B);
650
388651   RAM_W(B, A);
652
389653   A = t;
390   B = B ^ (r << 4);
654   B = B ^ r;
391655}
392656
393INLINE void x0(void) { X(0); }
394INLINE void x1(void) { X(1); }
395INLINE void x2(void) { X(2); }
396INLINE void x3(void) { X(3); }
657/*
397658
398INLINE void xad(void)
659    Mnemonic:           XAD
660
661    Operand:            r,d
662    Hex Code:           23 --
663    Binary:             0 0 1 0 0 0 1 1 1 0 r1 r0 d3 d2 d1 d0
664
665    Data Flow:          RAM(r,d) <-> A
666
667    Description:        Exchange A with RAM pointed to directly by r,d
668
669*/
670
671INSTRUCTION(xad)
399672{
400   UINT8 addr = ROM(PC++) & 0x3f;
673   UINT8 rd = opcode & 0x3f;
401674   UINT8 t = A;
402   A = RAM_R(addr);
403   RAM_W(addr, t);
404}
405675
406INLINE void xas(void)
407{
408   UINT8 t = SIO;
409   SIO = A;
410   A = t;
676   A = RAM_R(rd);
411677
412   WRITE_SK(C);
678   RAM_W(rd, t);
413679}
414680
415INLINE void XDS(UINT8 r)
681/*
682
683    Mnemonic:           XDS
684
685    Operand:            r
686    Hex Code:           -7
687    Binary:             0 0 r1 r0 0 1 1 1
688
689    Data Flow:          RAM(B) <-> A
690                        Bd - 1 -> Bd
691                        Br ^ r -> Br
692
693    Skip Conditions:    Bd decrements past 0
694
695    Description:        Exchange RAM with A and Decrement Bd, Exclusive-OR Br with r
696
697*/
698
699INSTRUCTION(xds)
416700{
417   UINT8 t, Bd, Br;
701   UINT8 t, Bd;
702   UINT4 r = opcode & 0x30;
418703
419704   t = RAM_R(B);
420705   RAM_W(B, A);
421706   A = t;
422707
423   Br = (UINT8)((B & 0x30) ^ (r << 4));
424   Bd = (UINT8)((B & 0x0F) - 1);
425   B = (UINT8)(Br | (Bd & 0x0F));
708   Bd = ((B & 0x0f) - 1) & 0x0f;
709   B = (B & 0x30) | Bd;
426710
427   if (Bd == 0xFF) skip = 1;
711   B = B ^ r;
712
713   if (Bd == 0x0f) skip = 1;
428714}
429715
430INLINE void XIS(UINT8 r)
716/*
717
718    Mnemonic:           XIS
719
720    Operand:            r
721    Hex Code:           -4
722    Binary:             0 0 r1 r0 0 1 0 0
723
724    Data Flow:          RAM(B) <-> A
725                        Bd + 1 -> Bd
726                        Br ^ r -> Br
727
728    Skip Conditions:    Bd increments past 15
729
730    Description:        Exchange RAM with A and Increment Bd, Exclusive-OR Br with r
731
732*/
733
734INSTRUCTION(xis)
431735{
432   UINT8 t, Bd, Br;
736   UINT8 t, Bd;
737   UINT4 r = opcode & 0x30;
433738
434739   t = RAM_R(B);
435740   RAM_W(B, A);
436741   A = t;
437742
438   Br = (UINT8)((B & 0x30) ^ (r << 4));
439   Bd = (UINT8)((B & 0x0F) + 1);
440   B = (UINT8)(Br | (Bd & 0x0F));
743   Bd = ((B & 0x0f) + 1) & 0x0f;
744   B = (B & 0x30) | Bd;
441745
442   if (Bd == 0x10) skip = 1;
746   B = B ^ r;
747
748   if (Bd == 0x00) skip = 1;
443749}
444750
445INLINE void xis0(void) { XIS(0); }
446INLINE void xis1(void) { XIS(1); }
447INLINE void xis2(void) { XIS(2); }
448INLINE void xis3(void) { XIS(3); }
751/* Register Reference Instructions */
449752
450INLINE void xds0(void) { XDS(0); }
451INLINE void xds1(void) { XDS(1); }
452INLINE void xds2(void) { XDS(2); }
453INLINE void xds3(void) { XDS(3); }
753/*
454754
455INLINE void xor(void) { A = RAM_R(B) ^ A; }
755    Mnemonic:           CAB
756
757    Hex Code:           50
758    Binary:             0 1 0 1 0 0 0 0 0
759
760    Data Flow:          A -> Bd
761
762    Description:        Copy A to Bd
763
764*/
765
766INSTRUCTION(cab)
767{
768   B = (B & 0x30) | A;
769}
770
771/*
772
773    Mnemonic:           CBA
774
775    Hex Code:           4E
776    Binary:             0 1 0 0 1 1 1 0
777
778    Data Flow:          Bd -> A
779
780    Description:        Copy Bd to A
781
782*/
783
784INSTRUCTION(cba)
785{
786   A = B & 0xF;
787}
788
789/*
790
791    Mnemonic:           LBI
792
793    Operand:            r,d
794    Hex Code:           --
795                        33 --
796
797    Binary:             0 0 r1 r0 d3 d2 d1 d0 (d-1)
798                        0 0 1 1 0 0 1 1 1 0 r1 r0 d3 d2 d1 d0
799
800    Data Flow:          r,d -> B
801
802    Skip Conditions:    Skip until not a LBI
803
804    Description:        Load B Immediate with r,d
805
806*/
807
808INSTRUCTION(lbi)
809{
810   if (opcode & 0x80)
811   {
812      B = opcode & 0x3f;
813   }
814   else
815   {
816      B = (opcode & 0x30) | (((opcode & 0x0f) + 1) & 0x0f);
817   }
818
819   skipLBI = 1;
820}
821
822/*
823
824    Mnemonic:           LEI
825
826    Operand:            y
827    Hex Code:           33 6-
828    Binary:             0 0 1 1 0 0 1 1 0 1 1 0 y3 y2 y1 y0
829
830    Data Flow:          y -> EN
831
832    Description:        Load EN Immediate
833
834*/
835
836INSTRUCTION(lei)
837{
838   UINT4 y = opcode & 0x0f;
839
840   EN = y;
841
842   if (!BIT(EN, 2))
843   {
844      OUT_L(0);
845   }
846}
847
848/* Test Instructions */
849
850/*
851
852    Mnemonic:           SKC
853
854    Hex Code:           20
855    Binary:             0 0 1 0 0 0 0 0
856
857    Skip Conditions:    C = "1"
858
859    Description:        Skip if C is True
860
861*/
862
863INSTRUCTION(skc)
864{
865   if (C == 1) skip = 1;
866}
867
868/*
869
870    Mnemonic:           SKE
871
872    Hex Code:           21
873    Binary:             0 0 1 0 0 0 0 1
874
875    Skip Conditions:    A = RAM(B)
876
877    Description:        Skip if A Equals RAM
878
879*/
880
881INSTRUCTION(ske)
882{
883   if (A == RAM_R(B)) skip = 1;
884}
885
886/*
887
888    Mnemonic:           SKGZ
889
890    Hex Code:           33 21
891    Binary:             00 0 1 1 0 0 1 1 0 0 1 0 0 0 0 1
892
893    Skip Conditions:    G3:0 = 0
894
895    Description:        Skip if G is Zero (all 4 bits)
896
897*/
898
899INSTRUCTION(skgz)
900{
901   if (IN_G() == 0) skip = 1;
902}
903
904/*
905
906    Mnemonic:           SKGBZ
907
908    Hex Code:           33 01
909                        33 11
910                        33 03
911                        33 13
912
913    Binary:
914
915    Skip Conditions:    G0 = 0
916                        G1 = 0
917                        G2 = 0
918                        G3 = 0
919
920    Description:        Skip if G Bit is Zero
921
922*/
923
924INLINE void skgbz(int bit)
925{
926   if (!BIT(IN_G(), bit)) skip = 1;
927}
928
929INSTRUCTION(skgbz0) { skgbz(0); }
930INSTRUCTION(skgbz1) { skgbz(1); }
931INSTRUCTION(skgbz2) { skgbz(2); }
932INSTRUCTION(skgbz3) { skgbz(3); }
933
934/*
935
936    Mnemonic:           SKMBZ
937
938    Hex Code:           01
939                        11
940                        03
941                        13
942
943    Binary:
944
945    Skip Conditions:    RAM(B)0 = 0
946                        RAM(B)0 = 1
947                        RAM(B)0 = 2
948                        RAM(B)0 = 3
949
950    Description:        Skip if RAM Bit is Zero
951
952*/
953
954INLINE void skmbz(int bit)
955{
956   if (!BIT(RAM_R(B), bit)) skip = 1;
957}
958
959INSTRUCTION(skmbz0) { skmbz(0); }
960INSTRUCTION(skmbz1) { skmbz(1); }
961INSTRUCTION(skmbz2) { skmbz(2); }
962INSTRUCTION(skmbz3) { skmbz(3); }
963
964/* Input/Output Instructions */
965
966/*
967
968    Mnemonic:           ING
969
970    Hex Code:           33 2A
971    Binary:
972
973    Data Flow:          G -> A
974
975    Description:        Input G Ports to A
976
977*/
978
979INSTRUCTION(ing)
980{
981   A = IN_G();
982}
983
984/*
985
986    Mnemonic:           INL
987
988    Hex Code:           33 2E
989    Binary:
990
991    Data Flow:          L7:4 -> RAM(B)
992                        L3:0 -> A
993
994    Description:        Input L Ports to RAM,A
995
996*/
997
998INSTRUCTION(inl)
999{
1000   UINT8 L = IN_L();
1001
1002   RAM_W(B, L >> 4);
1003   A = L & 0xF;
1004}
1005
1006/*
1007
1008    Mnemonic:           OBD
1009
1010    Hex Code:           33 3E
1011    Binary:
1012
1013    Data Flow:          Bd -> D
1014
1015    Description:        Output Bd to D Outputs
1016
1017*/
1018
1019INSTRUCTION(obd)
1020{
1021   OUT_D(B & 0x0f);
1022}
1023
1024/*
1025
1026    Mnemonic:           OMG
1027
1028    Hex Code:           33 3A
1029    Binary:
1030
1031    Data Flow:          RAM(B) -> G
1032
1033    Description:        Output RAM to G Ports
1034
1035*/
1036
1037INSTRUCTION(omg)
1038{
1039   WRITE_G(RAM_R(B));
1040}
1041
1042/*
1043
1044    Mnemonic:           XAS
1045
1046    Hex Code:           4F
1047    Binary:             0 1 0 0 1 1 1 1
1048
1049    Data Flow:          A <-> SIO
1050                        C -> SK
1051
1052    Description:        Exchange A with SIO
1053
1054*/
1055
1056INSTRUCTION(xas)
1057{
1058   UINT8 t = SIO;
1059   SIO = A;
1060   A = t;
1061
1062   SKL = C;
1063}
src/emu/cpu/cop400/cop410.c
r2241r2242
1313
1414    TODO:
1515
16    - serial I/O
16    - remove LBIops
17    - JP/JSR/JSRP
1718
1819*/
1920
r2241r2242
2526/* The opcode table now is a combination of cycle counts and function pointers */
2627typedef struct {
2728   unsigned cycles;
28   void (*function) (void);
29   void (*function) (UINT8 opcode);
2930}   s_opcode;
3031
3132#define UINT1   UINT8
r2241r2242
4950   UINT8   skip, skipLBI;
5051   UINT8   G_mask;
5152   UINT8   D_mask;
53   int      last_si;
5254} COP410_Regs;
5355
5456static COP410_Regs R;
r2241r2242
5759static int InstLen[256];
5860static int LBIops[256];
5961
62static emu_timer *cop410_serial_timer;
63
6064#include "410ops.c"
6165
62static const s_opcode cop410_opcode_op33[256]=
66/* Opcode Maps */
67
68static const s_opcode opcode_23_map[256]=
6369{
70   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
71   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
72   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
73   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
74   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
75   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
76   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
77   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
78
79   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
80   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
81   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
82   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
83   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
84   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
85   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
86   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
87
88   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
89   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
90   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
91   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
92   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
93   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
94   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
95   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, xad       },
96
97   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
98   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
99   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
100   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
101   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
102   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
103   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
104   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    }
105};
106
107static void cop410_op23(UINT8 opcode)
108{
109   UINT8 opcode23 = ROM(PC++);
110
111   (*(opcode_23_map[opcode23].function))(opcode23);
112}
113
114static const s_opcode opcode_33_map[256]=
115{
64116   {1, illegal    },{1, skgbz0   },{1, illegal   },{1, skgbz2   },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
65117   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
66118   {1, illegal    },{1, skgbz1    },{1, illegal    },{1, skgbz3    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
r2241r2242
69121   {1, illegal    },{1, illegal    },{1, ing       },{1, illegal    },{1, illegal    },{1, illegal    },{1, inl       },{1, illegal    },
70122   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
71123   {1, illegal    },{1, illegal    },{1, omg       },{1, illegal    },{1, camq       },{1, illegal    },{1, obd       },{1, illegal    },
124
72125   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
73126   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
74127   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
75128   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
76   {1, lei0       },{1, lei1       },{1, lei2       },{1, lei3       },{1, lei4       },{1, lei5       },{1, lei6       },{1, lei7       },
77   {1, lei8       },{1, lei9       },{1, lei10    },{1, lei11    },{1, lei12    },{1, lei13    },{1, lei14    },{1, lei15    },
129   {1, lei       },{1, lei       },{1, lei       },{1, lei       },{1, lei       },{1, lei       },{1, lei       },{1, lei       },
130   {1, lei       },{1, lei       },{1, lei       },{1, lei       },{1, lei       },{1, lei       },{1, lei       },{1, lei       },
78131   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
79132   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
133
80134   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
81135   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
82136   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
r2241r2242
85139   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
86140   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
87141   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
142
88143   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
89144   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
90145   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
r2241r2242
95150   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    }
96151};
97152
98static void cop410_op33(void)
153static void cop410_op33(UINT8 opcode)
99154{
100   (*(cop410_opcode_op33[ROM(PC++)].function))();
155   UINT8 opcode33 = ROM(PC++);
156
157   (*(opcode_33_map[opcode33].function))(opcode33);
101158}
102159
103static const s_opcode cop410_opcode_main[256]=
160static const s_opcode opcode_map[256]=
104161{
105   {1, clra      },{1, skmbz0   },{1, xor      },{1, skmbz2      },{1, xis0      },{1, ld0      },{1, x0      },{1, xds0      },
106   {1, lbi0_9      },{1, lbi0_10   },{1, lbi0_11   },{1, lbi0_12      },{1, lbi0_13   },{1, lbi0_14   },{1, lbi0_15   },{1, lbi0_0   },
107   {0, illegal      },{1, skmbz1   },{0, illegal   },{1, skmbz3      },{1, xis0      },{1, ld1      },{1, x1      },{1, xds1      },
108   {1, lbi1_9      },{1, lbi1_10   },{1, lbi1_11   },{1, lbi1_12      },{1, lbi1_13   },{1, lbi1_14   },{1, lbi1_15   },{1, lbi1_0   },
109   {1, skc         },{1, ske      },{1, sc      },{2, xad         },{1, xis2      },{1, ld2      },{1, x2      },{1, xds2       },
110   {1,   lbi2_9      },{1, lbi2_10   },{1, lbi2_11   },{1, lbi2_12      },{1, lbi2_13   },{1, lbi2_14   },{1, lbi2_15   },{1, lbi2_0   },
111   {1, asc         },{1, add      },{1, rc      },{2, cop410_op33   },{1, xis3      },{1, ld3      },{1, x3      },{1, xds3      },
112   {1,   lbi3_9      },{1, lbi3_10   },{1, lbi3_11   },{1, lbi3_12      },{1, lbi3_13   },{1, lbi3_14   },{1, lbi3_15   },{1, lbi3_0   },
113   {1, comp      },{0, illegal   },{1, rmb2      },{1, rmb2         },{1, nop      },{1, rmb1      },{1, smb2      },{1, smb1      },
162   {1, clra      },{1, skmbz0   },{1, xor      },{1, skmbz2      },{1, xis      },{1, ld      },{1, x         },{1, xds      },
163   {1, lbi         },{1, lbi      },{1, lbi      },{1, lbi         },{1, lbi      },{1, lbi      },{1, lbi      },{1, lbi      },
164   {0, illegal      },{1, skmbz1   },{0, illegal   },{1, skmbz3      },{1, xis      },{1, ld      },{1, x         },{1, xds      },
165   {1, lbi         },{1, lbi      },{1, lbi      },{1, lbi         },{1, lbi      },{1, lbi      },{1, lbi      },{1, lbi      },
166   {1, skc         },{1, ske      },{1, sc      },{2, cop410_op23   },{1, xis      },{1, ld      },{1, x         },{1, xds       },
167   {1, lbi         },{1, lbi      },{1, lbi      },{1, lbi         },{1, lbi      },{1, lbi      },{1, lbi      },{1, lbi      },
168   {1, asc         },{1, add      },{1, rc      },{2, cop410_op33   },{1, xis      },{1, ld      },{1, x         },{1, xds      },
169   {1, lbi         },{1, lbi      },{1, lbi      },{1, lbi         },{1, lbi      },{1, lbi      },{1, lbi      },{1, lbi      },
170
171   {1, comp      },{0, illegal   },{1, rmb2      },{1, rmb3         },{1, nop      },{1, rmb1      },{1, smb2      },{1, smb1      },
114172   {1,   ret         },{1, retsk      },{0, illegal   },{1, smb3         },{1, rmb0      },{1, smb0      },{1, cba      },{1, xas      },
115   {1, cab         },{1, aisc1      },{1, aisc2      },{1, aisc3         },{1, aisc4      },{1, aisc5      },{1, aisc6      },{1, aisc7      },
116   {1, aisc8      },{1, aisc9      },{1, aisc10   },{1, aisc11      },{1, aisc12   },{1, aisc13   },{1, aisc14   },{1, aisc15   },
117   {2, jmp0      },{2, jmp1      },{0, illegal   },{0, illegal      },{0, illegal   },{0, illegal   },{0, illegal   },{0, illegal   },
118   {2, jsr0      },{2, jsr1      },{0, illegal   },{0, illegal      },{0, illegal   },{0, illegal   },{0, illegal   },{0, illegal   },
119   {1, stii0      },{1, stii1      },{1, stii2      },{1, stii3         },{1, stii4      },{1, stii5      },{1, stii6      },{1, stii7      },
120   {1, stii8      },{1, stii9      },{1, stii10   },{1, stii11      },{1, stii12   },{1, stii13   },{1, stii14   },{1, stii15   },
173   {1, cab         },{1, aisc      },{1, aisc      },{1, aisc         },{1, aisc      },{1, aisc      },{1, aisc      },{1, aisc      },
174   {1, aisc      },{1, aisc      },{1, aisc      },{1, aisc         },{1, aisc      },{1, aisc      },{1, aisc      },{1, aisc      },
175   {2, jmp         },{2, jmp      },{0, illegal   },{0, illegal      },{0, illegal   },{0, illegal   },{0, illegal   },{0, illegal   },
176   {2, jsr         },{2, jsr      },{0, illegal   },{0, illegal      },{0, illegal   },{0, illegal   },{0, illegal   },{0, illegal   },
177   {1, stii      },{1, stii      },{1, stii      },{1, stii         },{1, stii      },{1, stii      },{1, stii      },{1, stii      },
178   {1, stii      },{1, stii      },{1, stii      },{1, stii         },{1, stii      },{1, stii      },{1, stii      },{1, stii      },
179
121180   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
122181   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
123182   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
r2241r2242
125184   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
126185   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
127186   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
128   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, lqid      },
187   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{2, lqid      },
188
129189   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
130190   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
131191   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
r2241r2242
133193   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
134194   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
135195   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
136   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jid      }
196   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{2, jid      }
137197};
138198
139static ADDRESS_MAP_START( cop410_RAM, ADDRESS_SPACE_DATA, 8 )
140   AM_RANGE(0x00, 0x40) AM_RAM
199/* Memory Maps */
200
201static ADDRESS_MAP_START( cop410_internal_rom, ADDRESS_SPACE_DATA, 8 )
202   AM_RANGE(0x000, 0x1ff) AM_ROM
141203ADDRESS_MAP_END
142204
205static ADDRESS_MAP_START( cop410_internal_ram, ADDRESS_SPACE_DATA, 8 )
206   AM_RANGE(0x00, 0x3f) AM_RAM
207ADDRESS_MAP_END
208
143209/****************************************************************************
144210 * Initialize emulation
145211 ****************************************************************************/
r2241r2242
151217   R.G_mask = 0x0F;
152218   R.D_mask = 0x0F;
153219
220   cop410_serial_timer = timer_alloc(cop410_serial_tick, NULL);
221   timer_adjust_periodic(cop410_serial_timer, attotime_zero, index, ATTOTIME_IN_HZ(clock));
222
154223   for (i=0; i<256; i++) InstLen[i]=1;
155224
156225   InstLen[0x60] = InstLen[0x61] = InstLen[0x68] = InstLen[0x69] = InstLen[0x33] = InstLen[0x23] = 2;
r2241r2242
177246   state_save_register_item("cop410", index, skipLBI);
178247   state_save_register_item("cop410", index, R.G_mask);
179248   state_save_register_item("cop410", index, R.D_mask);
249   state_save_register_item("cop410", index, R.last_si);
180250}
181251
182252static void cop411_init(int index, int clock, const void *config, int (*irqcallback)(int))
r2241r2242
207277 ****************************************************************************/
208278static int cop410_execute(int cycles)
209279{
210   unsigned opcode;
280   UINT8 opcode;
211281
212282   cop410_ICount = cycles;
213283
r2241r2242
226296            skipLBI = 0;
227297         }
228298         else {
229            cop410_ICount -=cop410_opcode_main[opcode].cycles;
299            cop410_ICount -= opcode_map[opcode].cycles;
230300
231301            PC += InstLen[opcode];
232302         }
r2241r2242
234304
235305      if (skipLBI == 0)
236306      {
237         int inst_cycles = cop410_opcode_main[opcode].cycles;
307         int inst_cycles = opcode_map[opcode].cycles;
238308         PC++;
239         (*(cop410_opcode_main[opcode].function))();
309         (*(opcode_map[opcode].function))(opcode);
240310         cop410_ICount -= inst_cycles;
241311
242         if (skip == 1) {
243            opcode=ROM(PC);
244            cop410_ICount -=cop410_opcode_main[opcode].cycles;
312         // skip next instruction?
313
314         if (skip == 1)
315         {
316            void *function = opcode_map[ROM(PC)].function;
317
318            opcode = ROM(PC);
319
320            if ((function == lqid) || (function == jid))
321            {
322               cop410_ICount -= 1;
323            }
324            else
325            {
326               cop410_ICount -= opcode_map[opcode].cycles;
327            }
245328            PC += InstLen[opcode];
329
246330            skip = 0;
247331         }
248332      }
249   } while (cop410_ICount>0);
333   } while (cop410_ICount > 0);
250334
251
252335   return cycles - cop410_ICount;
253336}
254337
r2241r2242
310393      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
311394      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
312395      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
313      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 4;                     break;
396      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 16;                     break;
314397      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
315398      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 2;                     break;
316399      case CPUINFO_INT_MIN_CYCLES:               info->i = 1;                     break;
r2241r2242
355438      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = cop410_dasm;      break;
356439#endif /* ENABLE_DEBUGGER */
357440      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &cop410_ICount;         break;
358       case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:
359          info->internal_map8 = address_map_cop410_RAM;                              break;
360441
442/*      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM:
443            info->internal_map8 = address_map_cop410_internal_rom;                              break;*/
444      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:
445          info->internal_map8 = address_map_cop410_internal_ram;                        break;
446
361447      /* --- the following bits of info are returned as NULL-terminated strings --- */
362448      case CPUINFO_STR_NAME:                     strcpy(info->s, "COP410");            break;
363      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "National Semiconductor COP410"); break;
449      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "National Semiconductor COPS"); break;
364450      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
365451      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
366452      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright MAME Team"); break;
r2241r2242
385471
386472void cop411_get_info(UINT32 state, cpuinfo *info)
387473{
474   // COP411 is a 20-pin package version of the COP410, lacking some ports
475
388476   switch (state)
389477   {
390478      /* --- the following bits of info are returned as pointers to data or functions --- */
r2241r2242
392480
393481      /* --- the following bits of info are returned as NULL-terminated strings --- */
394482      case CPUINFO_STR_NAME:                     strcpy(info->s, "COP411");            break;
395      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "National Semiconductor COP411"); break;
483      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "National Semiconductor COPS"); break;
396484
397485      default: cop410_get_info(state, info); break;
398486   }
399487}
488
489void cop401_get_info(UINT32 state, cpuinfo *info)
490{
491   // COP401 is a ROMless version of the COP410
492
493   switch (state)
494   {
495      case CPUINFO_STR_NAME:                     strcpy(info->s, "COP401");            break;
496      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "National Semiconductor COPS"); break;
497
498      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM:
499          info->internal_map8 = NULL;                                             break;
500
501      default: cop410_get_info(state, info); break;
502   }
503}
src/emu/cpu/cop400/420ops.c
r2241r2242
1010***************************************************************************/
1111
1212#define SC            R.SC
13#define IL            R.IL
1314
1415#define PUSH(addr)       { SC = SB; SB = SA; SA = addr; }
1516#define POP()          { PC = SA; SA = SB; SB = SC; }
r2241r2242
1819
1920#define IN_IN()         IN(COP400_PORT_IN)
2021
21INLINE void adt(void) { A = (A + 10) & 0x0F; }
22/* Arithmetic Instructions */
2223
23INLINE void casc(void)
24/*
25
26    Mnemonic:           ADT
27
28    Hex Code:           4A
29    Binary:             0 1 0 0 1 0 1 0
30
31    Data Flow:          A + 10 -> A
32
33    Description:        Add Ten to A
34
35*/
36
37INSTRUCTION(adt)
2438{
39   A = (A + 10) & 0x0F;
40}
41
42/*
43
44    Mnemonic:           CASC
45
46    Hex Code:           10
47    Binary:             0 0 0 1 0 0 0 0
48
49    Data Flow:          ~A + RAM(B) + C -> A
50                        Carry -> C
51
52    Skip Conditions:    Carry
53
54    Description:        Complement and Add with Carry, Skip on Carry
55
56*/
57
58INSTRUCTION(casc)
59{
2560   A = (A ^ 0xF) + RAM_R(B) + C;
2661
2762   if (A > 0xF)
r2241r2242
3671   }
3772}
3873
39INLINE void cqma(void)
74/* Transfer-of-Control Instructions */
75
76/*
77
78    Mnemonic:           RET
79
80    Hex Code:           48
81    Binary:             0 1 0 0 1 0 0 0
82
83    Data Flow:          SC -> SB -> SA -> PC
84
85    Description:        Return from Subroutine, restore Skip logic
86
87*/
88
89INSTRUCTION(cop420_ret)
4090{
41   WRITE_M(Q >> 4);
42   A = Q & 0xF;
91   POP();
92   skip = R.last_skip;
4393}
4494
45INLINE void inil(void)
95/* Memory Reference Instructions */
96
97/*
98
99    Mnemonic:           CQMA
100
101    Hex Code:           33 2C
102    Binary:             0 0 1 1 0 0 1 1 0 0 1 0 1 1 0 0
103
104    Data Flow:          Q7:4 -> RAM(B)
105                        Q3:0 -> A
106
107    Description:        Copy Q to RAM, A
108
109*/
110
111INSTRUCTION(cqma)
46112{
47   // NOT IMPLEMENTED
48   A = IN_IN();
113   RAM_W(B, Q >> 4);
114   A = Q & 0xF;
49115}
50116
51INLINE void cop421_inil(void)
117/*
118
119    Mnemonic:           LDD
120
121    Operand:            r, d
122    Hex Code:           23 --
123    Binary:             0 0 1 0 0 0 1 1 0 0 r1 r0 d3 d2 d1 d0
124
125    Data Flow:          RAM(r,d) -> A
126
127    Description:        Load A with RAM pointed to directly by r,d
128
129*/
130
131INSTRUCTION(ldd)
52132{
53   // NOT IMPLEMENTED
133   UINT8 rd = opcode & 0x3f;
134
135   A = RAM_R(rd);
54136}
55137
56INLINE void inin(void) { A = IN_IN(); }
138/* Register Reference Instructions */
57139
58INLINE void cop402m_inin(void) { A = IN_IN() | 0x02; }
140/*
59141
60INLINE void ldd(void)
142    Mnemonic:           XABR
143
144    Hex Code:           12
145    Binary:             0 0 0 1 0 0 1 0
146
147    Data Flow:          A <-> Br(0,0 -> A3,A2)
148
149    Description:        Exchange A with Br
150
151*/
152
153INSTRUCTION(xabr)
61154{
62   A = RAM_R(ROM(PC++) & 0x3f);
155   UINT8 Br = A & 0x03;
156   UINT8 Bd = B & 0x0f;
157
158   A = B >> 4;
159   B = (Br << 4) + Bd;
63160}
64161
65INLINE void ogi0(void) { WRITE_G(0); }
66INLINE void ogi1(void) { WRITE_G(1); }
67INLINE void ogi2(void) { WRITE_G(2); }
68INLINE void ogi3(void) { WRITE_G(3); }
69INLINE void ogi4(void) { WRITE_G(4); }
70INLINE void ogi5(void) { WRITE_G(5); }
71INLINE void ogi6(void) { WRITE_G(6); }
72INLINE void ogi7(void) { WRITE_G(7); }
73INLINE void ogi8(void) { WRITE_G(8); }
74INLINE void ogi9(void) { WRITE_G(9); }
75INLINE void ogi10(void) { WRITE_G(10); }
76INLINE void ogi11(void) { WRITE_G(11); }
77INLINE void ogi12(void) { WRITE_G(12); }
78INLINE void ogi13(void) { WRITE_G(13); }
79INLINE void ogi14(void) { WRITE_G(14); }
80INLINE void ogi15(void) { WRITE_G(15); }
162/* Test Instructions */
81163
82INLINE void skt(void)
164/*
165
166    Mnemonic:           SKT
167
168    Hex Code:           41
169    Binary:             0 1 0 0 0 0 0 1
170
171    Skip Conditions:    A time-base counter carry has occurred since last test
172
173    Description:        Skip on Timer
174
175*/
176
177INSTRUCTION(skt)
83178{
84   if (R.timerlatch == 1)
179   if (R.timerlatch)
85180   {
86181      R.timerlatch = 0;
87182      skip = 1;
88183   }
89184}
90185
91INLINE void xabr(void)
186/* Input/Output Instructions */
187
188/*
189
190    Mnemonic:           ININ
191
192    Hex Code:           33 28
193    Binary:
194
195    Data Flow:          IN -> A
196
197    Description:        Input IN Inputs to A
198
199*/
200
201INSTRUCTION(inin)
92202{
93   UINT8 Br = A & 0x03;
94   UINT8 Bd = B & 0x0f;
203   A = IN_IN();
204}
95205
96   A = (B & 0x30) >> 4;
97   B = (Br << 4) + Bd;
206/*
207
208    Processor:          COP402M
209
210    Mnemonic:           ININ
211
212    Hex Code:           33 28
213    Binary:
214
215    Data Flow:          IN -> A, A1 = "1"
216
217    Description:        Input IN Inputs to A
218
219*/
220
221INSTRUCTION(cop402m_inin)
222{
223   A = IN_IN() | 0x02;
98224}
225
226/*
227
228    Mnemonic:           INIL
229
230    Hex Code:           33 29
231    Binary:
232
233    Data Flow:          IL3,"1","0",IL0 -> A
234
235    Description:        Input IL Latches to A
236
237*/
238
239INSTRUCTION(inil)
240{
241   // NOT PROPERLY IMPLEMENTED
242
243   A = (IN_IN() & 0x09) | 0x04;
244}
245
246/*
247
248    Processor:          COP421
249
250    Mnemonic:           INIL
251
252    Hex Code:           33 29
253    Binary:
254
255    Data Flow:          "0",CKO,"0","0" -> A
256
257    Description:        Input CKO to A
258
259*/
260
261INSTRUCTION(cop421_inil)
262{
263   // NOT PROPERLY IMPLEMENTED
264
265   A = 0;
266}
267
268/*
269
270    Mnemonic:           OGI
271
272    Operand:            y
273    Hex Code:           33 5-
274    Binary:             0 0 1 1 0 0 1 1 0 1 0 1 y3 y2 y1 y0
275
276    Data Flow:          y -> G
277
278    Description:        Output to G Ports Immediate
279
280*/
281
282INSTRUCTION(ogi)
283{
284   UINT4 y = opcode & 0x0f;
285
286   WRITE_G(y);
287}
src/emu/cpu/cop400/cop420.c
r2241r2242
1313
1414    TODO:
1515
16    - serial I/O
17    - interrupt
16    - remove LBIops
17    - INIL
1818
1919*/
2020
r2241r2242
2626/* The opcode table now is a combination of cycle counts and function pointers */
2727typedef struct {
2828   unsigned cycles;
29   void (*function) (void);
29   void (*function) (UINT8 opcode);
3030}   s_opcode;
3131
3232#define UINT1   UINT8
r2241r2242
5252   UINT16   counter;
5353   UINT8   G_mask;
5454   UINT8   D_mask;
55   UINT4   IL;
56   int      last_si;
57   int      last_skip;
5558} COP420_Regs;
5659
5760static COP420_Regs R;
r2241r2242
6164static int LBIops[256];
6265static int LBIops33[256];
6366
67static emu_timer *cop420_serial_timer;
68static emu_timer *cop420_counter_timer;
69
6470#include "420ops.c"
6571
66static const s_opcode cop420_opcode_op33[256]=
72/* Opcode Maps */
73
74static const s_opcode opcode_23_map[256]=
6775{
76   {1, ldd          },{1, ldd      },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },
77   {1, ldd          },{1, ldd      },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },
78   {1, ldd          },{1, ldd      },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },
79   {1, ldd          },{1, ldd      },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },
80   {1, ldd          },{1, ldd      },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },
81   {1, ldd          },{1, ldd      },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },
82   {1, ldd          },{1, ldd      },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },
83   {1, ldd          },{1, ldd      },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },{1, ldd       },
84
85   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
86   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
87   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
88   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
89   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
90   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
91   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
92   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
93
94   {1, xad          },{1, xad      },{1, xad       },{1, xad       },{1, xad       },{1, xad       },{1, xad       },{1, xad       },
95   {1, xad          },{1, xad      },{1, xad       },{1, xad       },{1, xad       },{1, xad       },{1, xad       },{1, xad       },
96   {1, xad          },{1, xad      },{1, xad       },{1, xad       },{1, xad       },{1, xad       },{1, xad       },{1, xad       },
97   {1, xad          },{1, xad      },{1, xad       },{1, xad       },{1, xad       },{1, xad       },{1, xad       },{1, xad       },
98   {1, xad          },{1, xad      },{1, xad       },{1, xad       },{1, xad       },{1, xad       },{1, xad       },{1, xad       },
99   {1, xad          },{1, xad      },{1, xad       },{1, xad       },{1, xad       },{1, xad       },{1, xad       },{1, xad       },
100   {1, xad          },{1, xad      },{1, xad       },{1, xad       },{1, xad       },{1, xad       },{1, xad       },{1, xad       },
101   {1, xad          },{1, xad      },{1, xad       },{1, xad       },{1, xad       },{1, xad       },{1, xad       },{1, xad       },
102
103   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
104   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
105   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
106   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
107   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
108   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
109   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
110   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    }
111};
112
113static void cop420_op23(UINT8 opcode)
114{
115   UINT8 opcode23 = ROM(PC++);
116
117   (*(opcode_23_map[opcode23].function))(opcode23);
118}
119
120static const s_opcode opcode_33_map[256]=
121{
68122   {1, inil       },{1, skgbz0    },{1, illegal    },{1, skgbz2    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
69123   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
70124   {1, illegal    },{1, skgbz1    },{1, illegal    },{1, skgbz3    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
r2241r2242
73127   {1, inin       },{1, illegal    },{1, ing       },{1, illegal    },{1, cqma       },{1, illegal    },{1, inl       },{1, illegal    },
74128   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
75129   {1, illegal    },{1, illegal    },{1, omg       },{1, illegal    },{1, camq       },{1, illegal    },{1, obd       },{1, illegal    },
130
76131   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
77132   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
78   {1, ogi0       },{1, ogi1       },{1, ogi2       },{1, ogi3       },{1, ogi4       },{1, ogi5       },{1, ogi6       },{1, ogi7       },
79   {1, ogi8       },{1, ogi9       },{1, ogi10       },{1, ogi11       },{1, ogi12       },{1, ogi13       },{1, ogi14       },{1, ogi15       },
80   {1, lei0       },{1, lei1       },{1, lei2       },{1, lei3       },{1, lei4       },{1, lei5       },{1, lei6       },{1, lei7       },
81   {1, lei8       },{1, lei9       },{1, lei10       },{1, lei11       },{1, lei12       },{1, lei13       },{1, lei14       },{1, lei15       },
133   {1, ogi          },{1, ogi       },{1, ogi       },{1, ogi       },{1, ogi       },{1, ogi       },{1, ogi       },{1, ogi       },
134   {1, ogi          },{1, ogi       },{1, ogi       },{1, ogi       },{1, ogi       },{1, ogi       },{1, ogi       },{1, ogi       },
135   {1, lei       },{1, lei       },{1, lei       },{1, lei       },{1, lei       },{1, lei       },{1, lei       },{1, lei       },
136   {1, lei       },{1, lei       },{1, lei       },{1, lei       },{1, lei       },{1, lei       },{1, lei       },{1, lei       },
82137   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
83138   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
84   {1, illegal    },{1, lbi0_1    },{1, lbi0_2    },{1, lbi0_3    },{1, lbi0_4    },{1, lbi0_5    },{1, lbi0_6    },{1, lbi0_7    },
85   {1, lbi0_8       },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
86   {1, illegal    },{1, lbi1_1    },{1, lbi1_2    },{1, lbi1_3    },{1, lbi1_4    },{1, lbi1_5    },{1, lbi1_6    },{1, lbi1_7    },
87   {1, lbi1_8       },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
88   {1, illegal    },{1, lbi2_1    },{1, lbi2_2    },{1, lbi2_3    },{1, lbi2_4    },{1, lbi2_5    },{1, lbi2_6    },{1, lbi2_7    },
89   {1, lbi2_8       },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
90   {1, illegal    },{1, lbi3_1    },{1, lbi3_2    },{1, lbi3_3    },{1, lbi3_4    },{1, lbi3_5    },{1, lbi3_6    },{1, lbi3_7    },
91   {1, lbi3_8       },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
139
140   {1, illegal    },{1, lbi       },{1, lbi       },{1, lbi       },{1, lbi       },{1, lbi       },{1, lbi       },{1, lbi       },
141   {1, lbi          },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
142   {1, illegal    },{1, lbi       },{1, lbi       },{1, lbi       },{1, lbi       },{1, lbi       },{1, lbi       },{1, lbi       },
143   {1, lbi          },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
144   {1, illegal    },{1, lbi       },{1, lbi       },{1, lbi       },{1, lbi       },{1, lbi       },{1, lbi       },{1, lbi       },
145   {1, lbi          },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
146   {1, illegal    },{1, lbi       },{1, lbi       },{1, lbi       },{1, lbi       },{1, lbi       },{1, lbi       },{1, lbi       },
147   {1, lbi          },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
148
92149   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
93150   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
94151   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
r2241r2242
99156   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    }
100157};
101158
102static void cop420_op33(void)
159static void cop420_op33(UINT8 opcode)
103160{
104   (*(cop420_opcode_op33[ROM(PC++)].function))();
161   UINT8 opcode33 = ROM(PC++);
162
163   (*(opcode_33_map[opcode33].function))(opcode33);
105164}
106165
107static const s_opcode cop420_opcode_main[256]=
166static const s_opcode opcode_map[256]=
108167{
109   {1, clra      },{1, skmbz0   },{1, xor      },{1, skmbz2      },{1, xis0      },{1, ld0      },{1, x0      },{1, xds0      },
110   {1, lbi0_9      },{1, lbi0_10   },{1, lbi0_11   },{1, lbi0_12      },{1, lbi0_13   },{1, lbi0_14   },{1, lbi0_15   },{1, lbi0_0   },
111   {1, casc      },{1, skmbz1   },{1, xabr      },{1, skmbz3      },{1, xis0      },{1, ld1      },{1, x1      },{1, xds1      },
112   {1, lbi1_9      },{1, lbi1_10   },{1, lbi1_11   },{1, lbi1_12      },{1, lbi1_13   },{1, lbi1_14   },{1, lbi1_15   },{1, lbi1_0   },
113   {1, skc         },{1, ske      },{1, sc      },{2, xad         },{1, xis2      },{1, ld2      },{1, x2      },{1, xds2       },
114   {1,   lbi2_9      },{1, lbi2_10   },{1, lbi2_11   },{1, lbi2_12      },{1, lbi2_13   },{1, lbi2_14   },{1, lbi2_15   },{1, lbi2_0   },
115   {1, asc         },{1, add      },{1, rc      },{2, cop420_op33     },{1, xis3      },{1, ld3      },{1, x3      },{1, xds3      },
116   {1,   lbi3_9      },{1, lbi3_10   },{1, lbi3_11   },{1, lbi3_12      },{1, lbi3_13   },{1, lbi3_14   },{1, lbi3_15   },{1, lbi3_0   },
117   {1, comp      },{1, skt      },{1, rmb2      },{1, rmb2         },{1, nop      },{1, rmb1      },{1, smb2      },{1, smb1      },
118   {1,   ret         },{1, retsk      },{1, adt      },{1, smb3         },{1, rmb0      },{1, smb0      },{1, cba      },{1, xas      },
119   {1, cab         },{1, aisc1      },{1, aisc2      },{1, aisc3         },{1, aisc4      },{1, aisc5      },{1, aisc6      },{1, aisc7      },
120   {1, aisc8      },{1, aisc9      },{1, aisc10   },{1, aisc11      },{1, aisc12   },{1, aisc13   },{1, aisc14   },{1, aisc15   },
121   {2, jmp0      },{2, jmp1      },{2, jmp2      },{2, jmp3         },{0, illegal   },{0, illegal   },{0, illegal   },{0, illegal   },
122   {2, jsr0      },{2, jsr1      },{2, jsr2      },{2, jsr3         },{0, illegal   },{0, illegal   },{0, illegal   },{0, illegal   },
123   {1, stii0      },{1, stii1      },{1, stii2      },{1, stii3         },{1, stii4      },{1, stii5      },{1, stii6      },{1, stii7      },
124   {1, stii8      },{1, stii9      },{1, stii10   },{1, stii11      },{1, stii12   },{1, stii13   },{1, stii14   },{1, stii15   },
168   {1, clra      },{1, skmbz0   },{1, xor      },{1, skmbz2      },{1, xis      },{1, ld      },{1, x         },{1, xds      },
169   {1, lbi         },{1, lbi      },{1, lbi      },{1, lbi         },{1, lbi      },{1, lbi      },{1, lbi      },{1, lbi      },
170   {1, casc      },{1, skmbz1   },{1, xabr      },{1, skmbz3      },{1, xis      },{1, ld      },{1, x         },{1, xds      },
171   {1, lbi         },{1, lbi      },{1, lbi      },{1, lbi         },{1, lbi      },{1, lbi      },{1, lbi      },{1, lbi      },
172   {1, skc         },{1, ske      },{1, sc      },{2, cop420_op23   },{1, xis      },{1, ld      },{1, x         },{1, xds       },
173   {1, lbi         },{1, lbi      },{1, lbi      },{1, lbi         },{1, lbi      },{1, lbi      },{1, lbi      },{1, lbi      },
174   {1, asc         },{1, add      },{1, rc      },{2, cop420_op33     },{1, xis      },{1, ld      },{1, x         },{1, xds      },
175   {1, lbi         },{1, lbi      },{1, lbi      },{1, lbi         },{1, lbi      },{1, lbi      },{1, lbi      },{1, lbi      },
176
177   {1, comp      },{1, skt      },{1, rmb2      },{1, rmb3         },{1, nop      },{1, rmb1      },{1, smb2      },{1, smb1      },
178   {1,   cop420_ret   },{1, retsk      },{1, adt      },{1, smb3         },{1, rmb0      },{1, smb0      },{1, cba      },{1, xas      },
179   {1, cab         },{1, aisc      },{1, aisc      },{1, aisc         },{1, aisc      },{1, aisc      },{1, aisc      },{1, aisc      },
180   {1, aisc      },{1, aisc      },{1, aisc      },{1, aisc         },{1, aisc      },{1, aisc      },{1, aisc      },{1, aisc      },
181   {2, jmp         },{2, jmp      },{2, jmp      },{2, jmp         },{0, illegal   },{0, illegal   },{0, illegal   },{0, illegal   },
182   {2, jsr         },{2, jsr      },{2, jsr      },{2, jsr         },{0, illegal   },{0, illegal   },{0, illegal   },{0, illegal   },
183   {1, stii      },{1, stii      },{1, stii      },{1, stii         },{1, stii      },{1, stii      },{1, stii      },{1, stii      },
184   {1, stii      },{1, stii      },{1, stii      },{1, stii         },{1, stii      },{1, stii      },{1, stii      },{1, stii      },
185
125186   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
126187   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
127188   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
r2241r2242
130191   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
131192   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
132193   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{2, lqid      },
194
133195   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
134196   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
135197   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
r2241r2242
137199   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
138200   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
139201   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jp      },
140   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{1, jid      }
202   {1, jp         },{1, jp      },{1, jp      },{1, jp         },{1, jp      },{1, jp      },{1, jp      },{2, jid      }
141203};
142204
143static ADDRESS_MAP_START( cop420_RAM, ADDRESS_SPACE_DATA, 8 )
144   AM_RANGE(0x00, 0x40) AM_RAM
205/* Memory Maps */
206
207static ADDRESS_MAP_START( cop420_internal_rom, ADDRESS_SPACE_DATA, 8 )
208   AM_RANGE(0x000, 0x3ff) AM_ROM
145209ADDRESS_MAP_END
146210
211static ADDRESS_MAP_START( cop420_internal_ram, ADDRESS_SPACE_DATA, 8 )
212   AM_RANGE(0x00, 0x3f) AM_RAM
213ADDRESS_MAP_END
214
215static ADDRESS_MAP_START( cop444_internal_rom, ADDRESS_SPACE_DATA, 8 )
216   AM_RANGE(0x000, 0x7ff) AM_ROM
217ADDRESS_MAP_END
218
219static ADDRESS_MAP_START( cop444_internal_ram, ADDRESS_SPACE_DATA, 8 )
220   AM_RANGE(0x00, 0x7f) AM_RAM
221ADDRESS_MAP_END
222
223/* Binary Counter */
224
225static TIMER_CALLBACK(cop420_counter_tick)
226{
227   R.counter++;
228
229   if (R.counter == 1024)
230   {
231      R.counter = 0;
232      R.timerlatch = 1;
233   }
234}
235
147236/****************************************************************************
148237 * Initialize emulation
149238 ****************************************************************************/
r2241r2242
155244   R.G_mask = 0x0F;
156245   R.D_mask = 0x0F;
157246
158   R.counter = 0x00;
247   cop420_serial_timer = timer_alloc(cop410_serial_tick, NULL);
248   timer_adjust_periodic(cop420_serial_timer, attotime_zero, index, ATTOTIME_IN_HZ(clock));
159249
250   cop420_counter_timer = timer_alloc(cop420_counter_tick, NULL);
251   timer_adjust_periodic(cop420_counter_timer, attotime_zero, index, ATTOTIME_IN_HZ(clock / 1024));
252
160253   for (i=0; i<256; i++) InstLen[i]=1;
161254
162255   InstLen[0x60] = InstLen[0x61] = InstLen[0x62] = InstLen[0x63] =
r2241r2242
194287   state_save_register_item("cop420", index, R.counter);
195288   state_save_register_item("cop420", index, R.G_mask);
196289   state_save_register_item("cop420", index, R.D_mask);
290   state_save_register_item("cop420", index, R.last_si);
291   state_save_register_item("cop420", index, R.last_skip);
197292}
198293
294static void cop422_init(int index, int clock, const void *config, int (*irqcallback)(int))
295{
296   cop420_init(index, clock, config, irqcallback);
297
298   R.G_mask = 0x0e; // only G2, G3 available
299   R.D_mask = 0x0e; // only D2, D3 available
300}
301
302static void cop445_init(int index, int clock, const void *config, int (*irqcallback)(int))
303{
304   cop420_init(index, clock, config, irqcallback);
305
306   R.G_mask = 0x07;
307   R.D_mask = 0x03;
308}
309
199310/****************************************************************************
200311 * Reset registers to their initial values
201312 ****************************************************************************/
r2241r2242
215326 ****************************************************************************/
216327static int cop420_execute(int cycles)
217328{
218   unsigned opcode;
329   UINT8 opcode;
219330
220331   cop420_ICount = cycles;
221332
r2241r2242
244355         {
245356            skipLBI = 0;
246357         }
247         else {
248            cop420_ICount -= cop420_opcode_main[opcode].cycles;
358         else
359         {
360            cop420_ICount -= opcode_map[opcode].cycles;
249361
250362            PC += InstLen[opcode];
251363         }
r2241r2242
253365
254366      if (skipLBI == 0)
255367      {
256         int inst_cycles = cop420_opcode_main[opcode].cycles;
368         int inst_cycles = opcode_map[opcode].cycles;
369
257370         PC++;
258         (*(cop420_opcode_main[opcode].function))();
371
372         (*(opcode_map[opcode].function))(opcode);
259373         cop420_ICount -= inst_cycles;
260374
261         if (skip == 1) {
262            opcode=ROM(PC);
263            cop420_ICount -= cop420_opcode_main[opcode].cycles;
375         // check for interrupt
376
377         if (BIT(EN, 1))
378         {
379            UINT8 in = IN_IN();
380
381            if (BIT(IL, 1) && !BIT(in, 1))
382            {
383               void *function = opcode_map[ROM(PC)].function;
384
385               if ((function != jp) &&   (function != jmp) && (function != jsr))
386               {
387                  // store skip logic
388                  R.last_skip = skip;
389                  skip = 0;
390
391                  // push next PC
392                  PUSH(PC + 1);
393
394                  // jump to interrupt service routine
395                  PC = 0x0ff;
396
397                  // disable interrupt
398                  EN &= ~0x02;
399               }
400            }
401
402            IL = in;
403         }
404
405         // skip next instruction?
406
407         if (skip == 1)
408         {
409            void *function = opcode_map[ROM(PC)].function;
410
411            opcode = ROM(PC);
412
413            if ((function == lqid) || (function == jid))
414            {
415               cop420_ICount -= 1;
416            }
417            else
418            {
419               cop420_ICount -= opcode_map[opcode].cycles;
420            }
264421            PC += InstLen[opcode];
422
265423            skip = 0;
266424         }
267425      }
268
269      /* counter handling */
270      R.counter += cop420_opcode_main[opcode].cycles;
271      if (R.counter > 1024)
272      {
273         R.timerlatch = 1;
274         R.counter = 0;
275      }
276
277426   } while (cop420_ICount > 0);
278427
279428   return cycles - cop420_ICount;
r2241r2242
338487      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
339488      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
340489      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
341      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 4;                     break;
490      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 16;                     break;
342491      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
343492      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 2;                     break;
344493      case CPUINFO_INT_MIN_CYCLES:               info->i = 1;                     break;
r2241r2242
384533      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = cop420_dasm;      break;
385534#endif /* ENABLE_DEBUGGER */
386535      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &cop420_ICount;         break;
387       case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:
388          info->internal_map8 = address_map_cop420_RAM;                              break;
389536
537/*      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM:
538            info->internal_map8 = address_map_cop420_internal_rom;                              break;*/
539      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:
540          info->internal_map8 = address_map_cop420_internal_ram;                        break;
541
390542      /* --- the following bits of info are returned as NULL-terminated strings --- */
391543      case CPUINFO_STR_NAME:                     strcpy(info->s, "COP420");            break;
392      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "National Semiconductor COP420"); break;
544      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "National Semiconductor COPS"); break;
393545      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
394546      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
395547      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright MAME Team"); break;
r2241r2242
412564      case CPUINFO_STR_REGISTER + COP400_SKL:         sprintf(info->s, "SKL:%01X", SKL);      break;
413565   }
414566}
567
568void cop421_get_info(UINT32 state, cpuinfo *info)
569{
570   // COP421 is a 24-pin package version of the COP420, lacking the IN ports
571
572   switch (state)
573   {
574      /* --- the following bits of info are returned as NULL-terminated strings --- */
575      case CPUINFO_STR_NAME:                     strcpy(info->s, "COP421");            break;
576      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "National Semiconductor COPS"); break;
577
578      default: cop410_get_info(state, info); break;
579   }
580}
581
582void cop422_get_info(UINT32 state, cpuinfo *info)
583{
584   // COP422 is a 20-pin package version of the COP420, lacking the IN ports
585
586   switch (state)
587   {
588      /* --- the following bits of info are returned as pointers to data or functions --- */
589      case CPUINFO_PTR_INIT:                     info->init = cop422_init;            break;
590
591      /* --- the following bits of info are returned as NULL-terminated strings --- */
592      case CPUINFO_STR_NAME:                     strcpy(info->s, "COP422");            break;
593      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "National Semiconductor COPS"); break;
594
595      default: cop410_get_info(state, info); break;
596   }
597}
598
599void cop402_get_info(UINT32 state, cpuinfo *info)
600{
601   // COP402 is a ROMless version of the COP420
602
603   switch (state)
604   {
605      /* --- the following bits of info are returned as pointers to data or functions --- */
606      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM:
607          info->internal_map8 = NULL;                                             break;
608
609      /* --- the following bits of info are returned as NULL-terminated strings --- */
610      case CPUINFO_STR_NAME:                     strcpy(info->s, "COP402");            break;
611      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "National Semiconductor COPS"); break;
612
613      default: cop420_get_info(state, info); break;
614   }
615}
616
617void cop444_get_info(UINT32 state, cpuinfo *info)
618{
619   // COP444 is functionally equivalent to COP420, but with twice the RAM/ROM
620
621   switch (state)
622   {
623      /* --- the following bits of info are returned as pointers to data or functions --- */
624      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM:
625          info->internal_map8 = address_map_cop444_internal_rom;                        break;
626      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:
627          info->internal_map8 = address_map_cop444_internal_ram;                        break;
628
629      /* --- the following bits of info are returned as NULL-terminated strings --- */
630      case CPUINFO_STR_NAME:                     strcpy(info->s, "COP444");            break;
631      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "National Semiconductor COPS"); break;
632
633      default: cop420_get_info(state, info); break;
634   }
635}
636
637void cop445_get_info(UINT32 state, cpuinfo *info)
638{
639   // COP445 is a 24-pin package version of the COP444, lacking the IN ports
640
641   switch (state)
642   {
643      /* --- the following bits of info are returned as pointers to data or functions --- */
644      case CPUINFO_PTR_INIT:                     info->init = cop445_init;            break;
645
646      /* --- the following bits of info are returned as NULL-terminated strings --- */
647      case CPUINFO_STR_NAME:                     strcpy(info->s, "COP445");            break;
648      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "National Semiconductor COPS"); break;
649
650      default: cop444_get_info(state, info); break;
651   }
652}
653
654void cop404_get_info(UINT32 state, cpuinfo *info)
655{
656   // COP404 is a ROMless version of the COP444
657
658   switch (state)
659   {
660      /* --- the following bits of info are returned as pointers to data or functions --- */
661      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM:
662          info->internal_map8 = NULL;                                             break;
663
664      /* --- the following bits of info are returned as NULL-terminated strings --- */
665      case CPUINFO_STR_NAME:                     strcpy(info->s, "COP404");            break;
666      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "National Semiconductor COPS"); break;
667
668      default: cop444_get_info(state, info); break;
669   }
670}
src/emu/cpu/cop400/cop400.h
r2241r2242
99
1010***************************************************************************/
1111
12#ifndef _COP400_H
13#define _COP400_H
12#ifndef __COP400__
13#define __COP400__
1414
15#ifndef INLINE
16#define INLINE static inline
17#endif
18
1915#define COP400_PORT_L   0x100
2016#define COP400_PORT_G   0x101
2117#define COP400_PORT_D   0x102
r2241r2242
3834    COP400_SKL
3935};
4036
37extern void cop401_get_info(UINT32 state, cpuinfo *info);
4138extern void cop410_get_info(UINT32 state, cpuinfo *info);
4239extern void cop411_get_info(UINT32 state, cpuinfo *info);
40
41extern void cop402_get_info(UINT32 state, cpuinfo *info);
4342extern void cop420_get_info(UINT32 state, cpuinfo *info);
43extern void cop421_get_info(UINT32 state, cpuinfo *info);
44extern void cop422_get_info(UINT32 state, cpuinfo *info);
4445
46extern void cop404_get_info(UINT32 state, cpuinfo *info);
47extern void cop444_get_info(UINT32 state, cpuinfo *info);
48extern void cop445_get_info(UINT32 state, cpuinfo *info);
49
4550#ifdef ENABLE_DEBUGGER
4651offs_t cop410_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
4752offs_t cop420_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
4853#endif /* ENABLE_DEBUGGER */
4954
50#endif  /* _COP400_H */
55#endif  /* __COP400__ */
src/emu/cpu/cop400/cop410ds.c
r2241r2242
1313
1414offs_t cop410_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
1515{
16   int op;
17   int cnt = 1;
18   UINT16 addr;
19   UINT8 op2;
16   UINT8 opcode = oprom[0];
17   UINT8 next_opcode = oprom[1];
18   UINT16 address;
2019   UINT32 flags = 0;
20   int bytes = 1;
2121
22   op = oprom[0];
23
24   if ((op >= 0x80 && op <= 0xBE) || (op >= 0xC0 && op <= 0xFE))
22   if ((opcode >= 0x80 && opcode <= 0xBE) || (opcode >= 0xC0 && opcode <= 0xFE))
2523   {
2624      if ((pc & 0x3E0) >= 0x80 && (pc & 0x3E0) < 0x100) //JP pages 2,3
2725      {
28         addr = (UINT16)((pc & 0x380) | (op & 0x7F));
29         sprintf(buffer,"JP %x",addr);
26         address = (UINT16)((pc & 0x380) | (opcode & 0x7F));
27         sprintf(buffer, "JP %x", address);
3028      }
3129      else
3230      {
33         if ((op & 0xC0) == 0xC0) //JP other pages
31         if ((opcode & 0xC0) == 0xC0) //JP other pages
3432         {
35            addr = (UINT16)((pc & 0x3C0) | (op & 0x3F));
36            sprintf(buffer,"JP %x",addr);
33            address = (UINT16)((pc & 0x3C0) | (opcode & 0x3F));
34            sprintf(buffer, "JP %x", address);
3735         }
3836         else               //JSRP
3937         {
40            addr = (UINT16)(0x80 | (op & 0x3F));
41            sprintf(buffer,"JSRP %x",addr);
38            address = (UINT16)(0x80 | (opcode & 0x3F));
39            sprintf(buffer, "JSRP %x", address);
4240            flags = DASMFLAG_STEP_OVER;
4341         }
4442      }
4543   }
46   else if (op >= 0x08 && op <= 0x0F)
44   else if (opcode >= 0x08 && opcode <= 0x0F)
4745   {
48      sprintf(buffer,"LBI 0,%u",((op & 0xF) + 1) & 0xF);
46      sprintf(buffer, "LBI 0,%u", ((opcode & 0xF) + 1) & 0xF);
4947   }
50   else if (op >= 0x18 && op <= 0x1F)
48   else if (opcode >= 0x18 && opcode <= 0x1F)
5149   {
52      sprintf(buffer,"LBI 1,%u",((op & 0xF) + 1) & 0xF);
50      sprintf(buffer, "LBI 1,%u", ((opcode & 0xF) + 1) & 0xF);
5351   }
54   else if (op >= 0x28 && op <= 0x2F)
52   else if (opcode >= 0x28 && opcode <= 0x2F)
5553   {
56      sprintf(buffer,"LBI 2,%u",((op & 0xF) + 1) & 0xF);
54      sprintf(buffer, "LBI 2,%u", ((opcode & 0xF) + 1) & 0xF);
5755   }
58   else if (op >= 0x38 && op <= 0x3F)
56   else if (opcode >= 0x38 && opcode <= 0x3F)
5957   {
60      sprintf(buffer,"LBI 3,%u",((op & 0xF) + 1) & 0xF);
58      sprintf(buffer, "LBI 3,%u", ((opcode & 0xF) + 1) & 0xF);
6159   }
62   else if (op >= 0x51 && op <= 0x5F)
60   else if (opcode >= 0x51 && opcode <= 0x5F)
6361   {
64      sprintf(buffer,"AISC %u",op & 0xF);
62      sprintf(buffer, "AISC %u", opcode & 0xF);
6563   }
66   else if (op >= 0x60 && op <= 0x61)
64   else if (opcode >= 0x60 && opcode <= 0x61)
6765   {
68      addr = ((op & 0x01) << 8) | oprom[1];
69      sprintf(buffer,"JMP %x",addr);
70      cnt = 2;
66      address = ((opcode & 0x01) << 8) | next_opcode;
67      sprintf(buffer, "JMP %x", address);
68      bytes = 2;
7169   }
72   else if (op >= 0x68 && op <= 0x69)
70   else if (opcode >= 0x68 && opcode <= 0x69)
7371   {
74      addr = ((op & 0x01) << 8) | oprom[1];
75      sprintf(buffer,"JSR %x",addr);
72      address = ((opcode & 0x01) << 8) | next_opcode;
73      sprintf(buffer, "JSR %x", address);
7674      flags = DASMFLAG_STEP_OVER;
77      cnt = 2;
75      bytes = 2;
7876   }
79   else if (op >= 0x70 && op <= 0x7F)
77   else if (opcode >= 0x70 && opcode <= 0x7F)
8078   {
81      sprintf(buffer,"STII %u",op & 0xF);
79      sprintf(buffer, "STII %u", opcode & 0xF);
8280   }
8381   else
8482   {
85      switch (op)
83      switch (opcode)
8684      {
8785      case 0:
88         sprintf(buffer,"CLRA");
86         sprintf(buffer, "CLRA");
8987         break;
9088
9189      case 1:
92         sprintf(buffer,"SKMBZ 0");
90         sprintf(buffer, "SKMBZ 0");
9391         break;
9492
9593      case 2:
96         sprintf(buffer,"XOR");
94         sprintf(buffer, "XOR");
9795         break;
9896
9997      case 3:
100         sprintf(buffer,"SKMBZ 2");
98         sprintf(buffer, "SKMBZ 2");
10199         break;
102100
103101      case 4:
104         sprintf(buffer,"XIS 0");
102         sprintf(buffer, "XIS 0");
105103         break;
106104
107105      case 5:
108         sprintf(buffer,"LD 0");
106         sprintf(buffer, "LD 0");
109107         break;
110108
111109      case 6:
112         sprintf(buffer,"X 0");
110         sprintf(buffer, "X 0");
113111         break;
114112
115113      case 7:
116         sprintf(buffer,"XDS 0");
114         sprintf(buffer, "XDS 0");
117115         break;
118116
119117      case 0x11:
120         sprintf(buffer,"SKMBZ 1");
118         sprintf(buffer, "SKMBZ 1");
121119         break;
122120
123121      case 0x13:
124         sprintf(buffer,"SKMBZ 3");
122         sprintf(buffer, "SKMBZ 3");
125123         break;
126124
127125      case 0x14:
128         sprintf(buffer,"XIS 1");
126         sprintf(buffer, "XIS 1");
129127         break;
130128
131129      case 0x15:
132         sprintf(buffer,"LD 1");
130         sprintf(buffer, "LD 1");
133131         break;
134132
135133      case 0x16:
136         sprintf(buffer,"X 1");
134         sprintf(buffer, "X 1");
137135         break;
138136
139137      case 0x17:
140         sprintf(buffer,"XDS 1");
138         sprintf(buffer, "XDS 1");
141139         break;
142140
143141      case 0x20:
144         sprintf(buffer,"SKC");
142         sprintf(buffer, "SKC");
145143         break;
146144
147145      case 0x21:
148         sprintf(buffer,"SKE");
146         sprintf(buffer, "SKE");
149147         break;
150148
151149      case 0x22:
152         sprintf(buffer,"SC");
150         sprintf(buffer, "SC");
153151         break;
154152
155153      case 0x23:
156         addr = (UINT16)(oprom[1] & 0x3F);
157         sprintf(buffer,"XAD %x,%x",((addr & 0x30) >> 4),addr & 0x0F);
158         cnt = 2;
154         bytes = 2;
155
156         if (next_opcode >= 0x80 && next_opcode <= 0xbf)
157         {
158            address = (UINT16)(next_opcode & 0x3F);
159            sprintf(buffer, "XAD %x,%x", ((address & 0x30) >> 4),address & 0x0F);
160         }
161         else
162         {
163            sprintf(buffer, "Invalid");
164         }
159165         break;
160166
161167      case 0x24:
162         sprintf(buffer,"XIS 2");
168         sprintf(buffer, "XIS 2");
163169         break;
164170
165171      case 0x25:
166         sprintf(buffer,"LD 2");
172         sprintf(buffer, "LD 2");
167173         break;
168174
169175      case 0x26:
170         sprintf(buffer,"X 2");
176         sprintf(buffer, "X 2");
171177         break;
172178
173179      case 0x27:
174         sprintf(buffer,"XDS 2");
180         sprintf(buffer, "XDS 2");
175181         break;
176182
177183      case 0x30:
178         sprintf(buffer,"ASC");
184         sprintf(buffer, "ASC");
179185         break;
180186
181187      case 0x31:
182         sprintf(buffer,"ADD");
188         sprintf(buffer, "ADD");
183189         break;
184190
185191      case 0x32:
186         sprintf(buffer,"RC");
192         sprintf(buffer, "RC");
187193         break;
188194
189195      case 0x33:
190         op2 = oprom[1];
191         cnt = 2;
196         bytes = 2;
192197
193         if (op2 >= 0x60 || op2 <= 0x6F)
198         if (next_opcode >= 0x60 || next_opcode <= 0x6F)
194199         {
195            sprintf(buffer,"LEI %x",op2 & 0xF);
200            sprintf(buffer, "LEI %x", next_opcode & 0xF);
196201         }
197202         else
198203         {
199            switch (op2)
204            switch (next_opcode)
200205            {
201206            case 0x01:
202               sprintf(buffer,"SKGBZ 0");
207               sprintf(buffer, "SKGBZ 0");
203208               break;
204209
205210            case 0x03:
206               sprintf(buffer,"SKGBZ 2");
211               sprintf(buffer, "SKGBZ 2");
207212               break;
208213
209214            case 0x11:
210               sprintf(buffer,"SKGBZ 1");
215               sprintf(buffer, "SKGBZ 1");
211216               break;
212217
213218            case 0x13:
214               sprintf(buffer,"SKGBZ 3");
219               sprintf(buffer, "SKGBZ 3");
215220               break;
216221
217222            case 0x21:
218               sprintf(buffer,"SKGZ");
223               sprintf(buffer, "SKGZ");
219224               break;
220225
221226            case 0x2A:
222               sprintf(buffer,"ING");
227               sprintf(buffer, "ING");
223228               break;
224229
225230            case 0x2E:
226               sprintf(buffer,"INL");
231               sprintf(buffer, "INL");
227232               break;
228233
229234            case 0x3A:
230               sprintf(buffer,"OMG");
235               sprintf(buffer, "OMG");
231236               break;
232237
233238            case 0x3C:
234               sprintf(buffer,"CAMQ");
239               sprintf(buffer, "CAMQ");
235240               break;
236241
237242            case 0x3E:
238               sprintf(buffer,"OBD");
243               sprintf(buffer, "OBD");
239244               break;
240245
241246            default:
242               sprintf(buffer,"Invalid");
247               sprintf(buffer, "Invalid");
243248               break;
244249            }
245250            break;
246251         }
247252
248253      case 0x34:
249         sprintf(buffer,"XIS 3");
254         sprintf(buffer, "XIS 3");
250255         break;
251256
252257      case 0x35:
253         sprintf(buffer,"LD 3");
258         sprintf(buffer, "LD 3");
254259         break;
255260
256261      case 0x36:
257         sprintf(buffer,"X 3");
262         sprintf(buffer, "X 3");
258263         break;
259264
260265      case 0x37:
261         sprintf(buffer,"XDS 3");
266         sprintf(buffer, "XDS 3");
262267         break;
263268
264269      case 0x40:
265         sprintf(buffer,"COMP");
270         sprintf(buffer, "COMP");
266271         break;
267272
268273      case 0x42:
269         sprintf(buffer,"RMB 2");
274         sprintf(buffer, "RMB 2");
270275         break;
271276
272277      case 0x43:
273         sprintf(buffer,"RMB 3");
278         sprintf(buffer, "RMB 3");
274279         break;
275280
276281      case 0x44:
277         sprintf(buffer,"NOP");
282         sprintf(buffer, "NOP");
278283         break;
279284
280285      case 0x45:
281         sprintf(buffer,"RMB 1");
286         sprintf(buffer, "RMB 1");
282287         break;
283288
284289      case 0x46:
285         sprintf(buffer,"SMB 2");
290         sprintf(buffer, "SMB 2");
286291         break;
287292
288293      case 0x47:
289         sprintf(buffer,"SMB 1");
294         sprintf(buffer, "SMB 1");
290295         break;
291296
292297      case 0x48:
293         sprintf(buffer,"RET");
298         sprintf(buffer, "RET");
294299         flags = DASMFLAG_STEP_OUT;
295300         break;
296301
297302      case 0x49:
298         sprintf(buffer,"RETSK");
303         sprintf(buffer, "RETSK");
299304         flags = DASMFLAG_STEP_OUT;
300305         break;
301306
302307      case 0x4B:
303         sprintf(buffer,"SMB 3");
308         sprintf(buffer, "SMB 3");
304309         break;
305310
306311      case 0x4C:
307         sprintf(buffer,"RMB 0");
312         sprintf(buffer, "RMB 0");
308313         break;
309314
310315      case 0x4D:
311         sprintf(buffer,"SMB 0");
316         sprintf(buffer, "SMB 0");
312317         break;
313318
314319      case 0x4E:
315         sprintf(buffer,"CBA");
320         sprintf(buffer, "CBA");
316321         break;
317322
318323      case 0x4F:
319         sprintf(buffer,"XAS");
324         sprintf(buffer, "XAS");
320325         break;
321326
322327      case 0x50:
323         sprintf(buffer,"CAB");
328         sprintf(buffer, "CAB");
324329         break;
325330
326331      case 0xBF:
327         sprintf(buffer,"LQID");
332         sprintf(buffer, "LQID");
328333         break;
329334
330335      case 0xFF:
331         sprintf(buffer,"JID");
336         sprintf(buffer, "JID");
332337         break;
333338
334339      default:
335         sprintf(buffer,"Invalid");
340         sprintf(buffer, "Invalid");
336341         break;
337342      }
338343   }
339344
340   return cnt | flags | DASMFLAG_SUPPORTED;
345   return bytes | flags | DASMFLAG_SUPPORTED;
341346}
src/emu/cpu/mips/mips3com.c
r2241r2242
894894static UINT64 program_read_qword_masked_32be(offs_t offset, UINT64 mem_mask)
895895{
896896   UINT64 result = 0;
897   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
897   if (ACCESSING_BITS_32_63)
898898      result |= (UINT64)program_read_masked_32be(offset, mem_mask >> 32) << 32;
899   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
899   if (ACCESSING_BITS_0_31)
900900      result |= program_read_masked_32be(offset + 4, mem_mask);
901901   return result;
902902}
r2241r2242
922922static UINT64 program_read_qword_masked_32le(offs_t offset, UINT64 mem_mask)
923923{
924924   UINT64 result = 0;
925   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
925   if (ACCESSING_BITS_0_31)
926926      result |= program_read_masked_32le(offset, mem_mask);
927   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
927   if (ACCESSING_BITS_32_63)
928928      result |= (UINT64)program_read_masked_32le(offset + 4, mem_mask >> 32) << 32;
929929   return result;
930930}
r2241r2242
949949
950950static void program_write_qword_masked_32be(offs_t offset, UINT64 data, UINT64 mem_mask)
951951{
952   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
952   if (ACCESSING_BITS_32_63)
953953      program_write_masked_32be(offset, data >> 32, mem_mask >> 32);
954   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
954   if (ACCESSING_BITS_0_31)
955955      program_write_masked_32be(offset + 4, data, mem_mask);
956956}
957957
r2241r2242
975975
976976static void program_write_qword_masked_32le(offs_t offset, UINT64 data, UINT64 mem_mask)
977977{
978   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
978   if (ACCESSING_BITS_0_31)
979979      program_write_masked_32le(offset, data, mem_mask);
980   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
980   if (ACCESSING_BITS_32_63)
981981      program_write_masked_32le(offset + 4, data >> 32, mem_mask >> 32);
982982}
src/emu/memconv.h
r2241r2242
8888INLINE UINT16 read16be_with_read8_handler(read8_machine_func handler, void *param, 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)(param, offset * 2 + 0)) << 8;
93   if ((mem_mask & 0x00ff) != 0x00ff)
93   if (ACCESSING_BITS_0_7)
9494      result |= ((UINT16)(*handler)(param, offset * 2 + 1)) << 0;
9595   return result;
9696}
r2241r2242
9898
9999INLINE void write16be_with_write8_handler(write8_machine_func handler, void *param, offs_t offset, UINT16 data, UINT16 mem_mask)
100100{
101   if ((mem_mask & 0xff00) != 0xff00)
101   if (ACCESSING_BITS_8_15)
102102      (*handler)(param, offset * 2 + 0, data >> 8);
103   if ((mem_mask & 0x00ff) != 0x00ff)
103   if (ACCESSING_BITS_0_7)
104104      (*handler)(param, offset * 2 + 1, data >> 0);
105105}
106106
r2241r2242
114114INLINE UINT16 read16le_with_read8_handler(read8_machine_func handler, void *param, 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)(param, offset * 2 + 0)) << 0;
119   if ((mem_mask & 0xff00) != 0xff00)
119   if (ACCESSING_BITS_8_15)
120120      result |= ((UINT16) (*handler)(param, offset * 2 + 1)) << 8;
121121   return result;
122122}
r2241r2242
124124
125125INLINE void write16le_with_write8_handler(write8_machine_func handler, void *param, offs_t offset, UINT16 data, UINT16 mem_mask)
126126{
127   if ((mem_mask & 0x00ff) != 0x00ff)
127   if (ACCESSING_BITS_0_7)
128128      (*handler)(param, offset * 2 + 0, data >> 0);
129   if ((mem_mask & 0xff00) != 0xff00)
129   if (ACCESSING_BITS_8_15)
130130      (*handler)(param, offset * 2 + 1, data >> 8);
131131}
132132
r2241r2242
140140INLINE UINT32 read32be_with_read8_handler(read8_machine_func handler, void *param, 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_handler(handler, param, offset * 2 + 0, mem_mask >> 16) << 16;
145   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
145   if (ACCESSING_BITS_0_15)
146146      result |= read16be_with_read8_handler(handler, param, offset * 2 + 1, mem_mask) << 0;
147147   return result;
148148}
r2241r2242
150150
151151INLINE void write32be_with_write8_handler(write8_machine_func handler, void *param, 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_handler(handler, param, offset * 2 + 0, data >> 16, mem_mask >> 16);
155   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
155   if (ACCESSING_BITS_0_15)
156156      write16be_with_write8_handler(handler, param, offset * 2 + 1, data, mem_mask);
157157}
158158
r2241r2242
166166INLINE UINT32 read32le_with_read8_handler(read8_machine_func handler, void *param, 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_handler(handler, param, offset * 2 + 0, mem_mask) << 0;
171   if ((mem_mask & 0xffff0000) != 0xffff0000)
171   if (ACCESSING_BITS_16_31)
172172      result |= read16le_with_read8_handler(handler, param, offset * 2 + 1, mem_mask >> 16) << 16;
173173   return result;
174174}
r2241r2242
176176
177177INLINE void write32le_with_write8_handler(write8_machine_func handler, void *param, 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_handler(handler, param, offset * 2 + 0, data, mem_mask);
181   if ((mem_mask & 0xffff0000) != 0xffff0000)
181   if (ACCESSING_BITS_16_31)
182182      write16le_with_write8_handler(handler, param, offset * 2 + 1, data >> 16, mem_mask >> 16);
183183}
184184
r2241r2242
192192INLINE UINT32 read32be_with_16be_handler(read16_machine_func handler, void *param, 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)(param, offset * 2 + 0, mem_mask >> 16) << 16;
197   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
197   if (ACCESSING_BITS_0_15)
198198      result |= (*handler)(param, offset * 2 + 1, mem_mask) << 0;
199199   return result;
200200}
r2241r2242
202202
203203INLINE void write32be_with_16be_handler(write16_machine_func handler, void *param, offs_t offset, UINT32 data, UINT32 mem_mask)
204204{
205   if ((mem_mask & 0xffff0000) != 0xffff0000)
205   if (ACCESSING_BITS_16_31)
206206      (*handler)(param, offset * 2 + 0, data >> 16, mem_mask >> 16);
207   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
207   if (ACCESSING_BITS_0_15)
208208      (*handler)(param, offset * 2 + 1, data, mem_mask);
209209}
210210
r2241r2242
218218INLINE UINT32 read32le_with_16le_handler(read16_machine_func handler, void *param, 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)(param, offset * 2 + 0, mem_mask) << 0;
223   if ((mem_mask & 0xffff0000) != 0xffff0000)
223   if (ACCESSING_BITS_16_31)
224224      result |= (*handler)(param, offset * 2 + 1, mem_mask >> 16) << 16;
225225   return result;
226226}
r2241r2242
228228
229229INLINE void write32le_with_16le_handler(write16_machine_func handler, void *param, offs_t offset, UINT32 data, UINT32 mem_mask)
230230{
231   if ((mem_mask & 0x0000ffff) != 0x0000ffff)
231   if (ACCESSING_BITS_0_15)
232232      (*handler)(param, offset * 2 + 0, data, mem_mask);
233   if ((mem_mask & 0xffff0000) != 0xffff0000)
233   if (ACCESSING_BITS_16_31)
234234      (*handler)(param, offset * 2 + 1, data >> 16, mem_mask >> 16);
235235}
236236
r2241r2242
290290INLINE UINT64 read64be_with_read8_handler(read8_machine_func handler, void *param, 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_handler(handler, param, 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_handler(handler, param, offset * 2 + 1, mem_mask) << 0;
297297   return result;
298298}
r2241r2242
300300
301301INLINE void write64be_with_write8_handler(write8_machine_func handler, void *param, 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_handler(handler, param, 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_handler(handler, param, offset * 2 + 1, data, mem_mask);
307307}
308308
r2241r2242
316316INLINE UINT64 read64le_with_read8_handler(read8_machine_func handler, void *param, 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_handler(handler, param, 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_handler(handler, param, offset * 2 + 1, mem_mask >> 32) << 32;
323323   return result;
324324}
r2241r2242
326326
327327INLINE void write64le_with_write8_handler(write8_machine_func handler, void *param, 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_handler(handler, param, 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_handler(handler, param, offset * 2 + 1, data >> 32, mem_mask >> 32);
333333}
334334
r2241r2242
342342INLINE UINT32 read64be_with_16be_handler(read16_machine_func handler, void *param, 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_handler(handler, param, 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_handler(handler, param, offset * 2 + 1, mem_mask >> 0) << 0;
349349   return result;
350350}
r2241r2242
352352
353353INLINE void write64be_with_16be_handler(write16_machine_func handler, void *param, 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_handler(handler, param, 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_handler(handler, param, offset * 2 + 1, data >> 0, mem_mask >> 0);
359359}
360360
r2241r2242
368368INLINE UINT32 read64le_with_16le_handler(read16_machine_func handler, void *param, 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_handler(handler, param, 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_handler(handler, param, offset * 2 + 1, mem_mask >> 32) << 32;
375375   return result;
376376}
r2241r2242
378378
379379INLINE void write64le_with_16le_handler(write16_machine_func handler, void *param, 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_handler(handler, param, 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_handler(handler, param, offset * 2 + 1, data >> 32, mem_mask >> 32);
385385}
386386
r2241r2242
394394INLINE UINT32 read64be_with_16le_handler(read16_machine_func handler, void *param, 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_handler(handler, param, 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_handler(handler, param, offset * 2 + 1, mem_mask >> 0) << 0;
401401   return result;
402402}
r2241r2242
404404
405405INLINE void write64be_with_16le_handler(write16_machine_func handler, void *param, 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_handler(handler, param, 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_handler(handler, param, offset * 2 + 1, data >> 0, mem_mask >> 0);
411411}
412412
r2241r2242
420420INLINE UINT32 read64le_with_16be_handler(read16_machine_func handler, void *param, 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_handler(handler, param, 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_handler(handler, param, offset * 2 + 1, mem_mask >> 32) << 32;
427427   return result;
428428}
r2241r2242
430430
431431INLINE void write64le_with_16be_handler(write16_machine_func handler, void *param, 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_handler(handler, param, 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_handler(handler, param, offset * 2 + 1, data >> 32, mem_mask >> 32);
437437}
438438
r2241r2242
446446INLINE UINT64 read64be_with_32be_handler(read32_machine_func handler, void *param, 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)(param, 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)(param, offset * 2 + 1, mem_mask >> 0) << 0;
453453   return result;
454454}
r2241r2242
456456
457457INLINE void write64be_with_32be_handler(write32_machine_func handler, void *param, 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)(param, offset * 2 + 0, data >> 32, mem_mask >> 32);
461   if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff))
461   if (ACCESSING_BITS_0_31)
462462      (*handler)(param, offset * 2 + 1, data >>  0, mem_mask >>  0);
463463}
464464
r2241r2242
472472INLINE UINT64 read64le_with_32le_handler(read32_machine_func handler, void *param, 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)(param, 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)(param, offset * 2 + 1, mem_mask >> 32) << 32;
479479   return result;
480480}
r2241r2242
482482
483483INLINE void write64le_with_32le_handler(write32_machine_func handler, void *param, 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)(param, offset * 2 + 0, data >> 0, mem_mask >> 0);
487   if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000))
487   if (ACCESSING_BITS_32_63)
488488      (*handler)(param, offset * 2 + 1, data >> 32, mem_mask >> 32);
489489}
490490
r2241r2242
617617 ************************************/
618618
619619#define READ8TO16BE_MSB( name, read8 ) \
620READ_TEMPLATE_COND( 16, name, read8, read16be_with_read8_handler, ACCESSING_MSB )
620READ_TEMPLATE_COND( 16, name, read8, read16be_with_read8_handler, ACCESSING_BITS_8_15 )
621621
622622
623623#define WRITE8TO16BE_MSB( name, write8 ) \
624WRITE_TEMPLATE_COND( 16, name, write8, write16be_with_write8_handler, ACCESSING_MSB )
624WRITE_TEMPLATE_COND( 16, name, write8, write16be_with_write8_handler, ACCESSING_BITS_8_15 )
625625
626626
627627#define READWRITE8TO16BE_MSB( name, read8, write8 ) \
r2241r2242
634634 ************************************/
635635
636636#define READ8TO16LE_MSB( name, read8 ) \
637READ_TEMPLATE_COND( 16, name, read8, read16le_with_read8_handler, ACCESSING_MSB )
637READ_TEMPLATE_COND( 16, name, read8, read16le_with_read8_handler, ACCESSING_BITS_8_15 )
638638
639639
640640#define WRITE8TO16LE_MSB( name, write8 ) \
641WRITE_TEMPLATE_COND( 16, name, write8, write16le_with_write8_handler, ACCESSING_MSB )
641WRITE_TEMPLATE_COND( 16, name, write8, write16le_with_write8_handler, ACCESSING_BITS_8_15 )
642642
643643
644644#define READWRITE8TO16LE_MSB( name, read8, write8 ) \
r2241r2242
651651 ************************************/
652652
653653#define READ8TO16BE_LSB( name, read8 ) \
654READ_TEMPLATE_COND( 16, name, read8, read16be_with_read8_handler, ACCESSING_LSB )
654READ_TEMPLATE_COND( 16, name, read8, read16be_with_read8_handler, ACCESSING_BITS_0_7 )
655655
656656
657657#define WRITE8TO16BE_LSB( name, write8 ) \
658WRITE_TEMPLATE_COND( 16, name, write8, write16be_with_write8_handler, ACCESSING_LSB )
658WRITE_TEMPLATE_COND( 16, name, write8, write16be_with_write8_handler, ACCESSING_BITS_0_7 )
659659
660660
661661#define READWRITE8TO16BE_LSB( name, read8, write8 ) \
r2241r2242
668668 ************************************/
669669
670670#define READ8TO16LE_LSB( name, read8 ) \
671READ_TEMPLATE_COND( 16, name, read8, read16le_with_read8_handler, ACCESSING_LSB )
671READ_TEMPLATE_COND( 16, name, read8, read16le_with_read8_handler, ACCESSING_BITS_0_7 )
672672
673673
674674#define WRITE8TO16LE_LSB( name, write8 ) \
675WRITE_TEMPLATE_COND( 16, name, write8, write16le_with_write8_handler, ACCESSING_LSB )
675WRITE_TEMPLATE_COND( 16, name, write8, write16le_with_write8_handler, ACCESSING_BITS_0_7 )
676676
677677
678678#define READWRITE8TO16LE_LSB( name, read8, write8 ) \
r2241r2242
719719 ************************************/
720720
721721#define READ8TO32BE_MSB( name, read8 ) \
722READ_TEMPLATE_COND( 32, name, read8, read32be_with_read8_handler, ACCESSING_MSB32 )
722READ_TEMPLATE_COND( 32, name, read8, read32be_with_read8_handler, ACCESSING_BITS_24_31 )
723723
724724
725725#define WRITE8TO32BE_MSB( name, write8 ) \
726WRITE_TEMPLATE_COND( 32, name, write8, write32be_with_write8_handler, ACCESSING_MSB32 )
726WRITE_TEMPLATE_COND( 32, name, write8, write32be_with_write8_handler, ACCESSING_BITS_24_31 )
727727
728728
729729#define READWRITE8TO32BE_MSB( name, read8, write8 ) \
r2241r2242
736736 ************************************/
737737
738738#define READ8TO32LE_MSB( name, read8 ) \
739READ_TEMPLATE_COND( 32, name, read8, read32le_with_read8_handler, ACCESSING_MSB32 )
739READ_TEMPLATE_COND( 32, name, read8, read32le_with_read8_handler, ACCESSING_BITS_24_31 )
740740
741741
742742#define WRITE8TO32LE_MSB( name, write8 ) \
743WRITE_TEMPLATE_COND( 32, name, write8, write32le_with_write8_handler, ACCESSING_MSB32 )
743WRITE_TEMPLATE_COND( 32, name, write8, write32le_with_write8_handler, ACCESSING_BITS_24_31 )
744744
745745
746746#define READWRITE8TO32LE_MSB( name, read8, write8 ) \
r2241r2242
753753 ************************************/
754754
755755#define READ8TO32BE_LSB( name, read8 ) \
756READ_TEMPLATE_COND( 32, name, read8, read32be_with_read8_handler, ACCESSING_LSB32 )
756READ_TEMPLATE_COND( 32, name, read8, read32be_with_read8_handler, ACCESSING_BITS_0_7 )
757757
758758
759759#define WRITE8TO32BE_LSB( name, write8 ) \
760WRITE_TEMPLATE_COND( 32, name, write8, write32be_with_write8_handler, ACCESSING_LSB32 )
760WRITE_TEMPLATE_COND( 32, name, write8, write32be_with_write8_handler, ACCESSING_BITS_0_7 )
761761
762762
763763#define READWRITE8TO32BE_LSB( name, read8, write8 ) \
r2241r2242
770770 ************************************/
771771
772772#define READ8TO32LE_LSB( name, read8 ) \
773READ_TEMPLATE_COND( 32, name, read8, read32le_with_read8_handler, ACCESSING_LSB32 )
773READ_TEMPLATE_COND( 32, name, read8, read32le_with_read8_handler, ACCESSING_BITS_0_7 )
774774
775775
776776#define WRITE8TO32LE_LSB( name, write8 ) \
777WRITE_TEMPLATE_COND( 32, name, write8, write32le_with_write8_handler, ACCESSING_LSB32 )
777WRITE_TEMPLATE_COND( 32, name, write8, write32le_with_write8_handler, ACCESSING_BITS_0_7 )
778778
779779
780780#define READWRITE8TO32LE_LSB( name, read8, write8 ) \
r2241r2242
889889 *************************************/
890890
891891#define READ16BETO32BE_MSW( name, read16 ) \
892READ_TEMPLATE_COND( 32, name, read16, read32be_with_16be_handler, ACCESSING_MSW32 )
892READ_TEMPLATE_COND( 32, name, read16, read32be_with_16be_handler, ACCESSING_BITS_16_31 )
893893
894894
895895#define WRITE16BETO32BE_MSW( name, write16 ) \
896WRITE_TEMPLATE_COND( 32, name, write16, write32be_with_16be_handler, ACCESSING_MSW32 )
896WRITE_TEMPLATE_COND( 32, name, write16, write32be_with_16be_handler, ACCESSING_BITS_16_31 )
897897
898898
899899#define READWRITE16BETO32BE_MSW( name, read16, write16 ) \
r2241r2242
906906 *************************************/
907907
908908#define READ16LETO32BE_MSW( name, read16 ) \
909READ_TEMPLATE_COND( 32, name, read16, read32be_with_16le_handler, ACCESSING_MSW32 )
909READ_TEMPLATE_COND( 32, name, read16, read32be_with_16le_handler, ACCESSING_BITS_16_31 )
910910
911911
912912#define WRITE16LETO32BE_MSW( name, write16 ) \
913WRITE_TEMPLATE_COND( 32, name, write16, write32be_with_16le_handler, ACCESSING_MSW32 )
913WRITE_TEMPLATE_COND( 32, name, write16, write32be_with_16le_handler, ACCESSING_BITS_16_31 )
914914
915915
916916#define READWRITE16LETO32BE_MSW( name, read16, write16 ) \
r2241r2242
923923 *************************************/
924924
925925#define READ16BETO32LE_MSW( name, read16 ) \
926READ_TEMPLATE_COND( 32, name, read16, read32le_with_16be_handler, ACCESSING_MSW32 )
926READ_TEMPLATE_COND( 32, name, read16, read32le_with_16be_handler, ACCESSING_BITS_16_31 )
927927
928928
929929#define WRITE16BETO32LE_MSW( name, write16 ) \
930WRITE_TEMPLATE_COND( 32, name, write16, write32le_with_16be_handler, ACCESSING_MSW32 )
930WRITE_TEMPLATE_COND( 32, name, write16, write32le_with_16be_handler, ACCESSING_BITS_16_31 )
931931
932932
933933#define READWRITE16BETO32LE_MSW( name, read16, write16 ) \
r2241r2242
940940 *************************************/
941941
942942#define READ16LETO32LE_MSW( name, read16 ) \
943READ_TEMPLATE_COND( 32, name, read16, read32le_with_16le_handler, ACCESSING_MSW32 )
943READ_TEMPLATE_COND( 32, name, read16, read32le_with_16le_handler, ACCESSING_BITS_16_31 )
944944
945945
946946#define WRITE16LETO32LE_MSW( name, write16 ) \
947WRITE_TEMPLATE_COND( 32, name, write16, write32le_with_16le_handler, ACCESSING_MSW32 )
947WRITE_TEMPLATE_COND( 32, name, write16, write32le_with_16le_handler, ACCESSING_BITS_16_31 )
948948
949949
950950#define READWRITE16LETO32LE_MSW( name, read16, write16 ) \
r2241r2242
956956 *************************************/
957957
958958#define READ16BETO32BE_LSW( name, read16 ) \
959READ_TEMPLATE_COND( 32, name, read16, read32be_with_16be_handler, ACCESSING_LSW32 )
959READ_TEMPLATE_COND( 32, name, read16, read32be_with_16be_handler, ACCESSING_BITS_0_15 )
960960
961961
962962#define WRITE16BETO32BE_LSW( name, write16 ) \
963WRITE_TEMPLATE_COND( 32, name, write16, write32be_with_16be_handler, ACCESSING_LSW32 )
963WRITE_TEMPLATE_COND( 32, name, write16, write32be_with_16be_handler, ACCESSING_BITS_0_15 )
964964
965965
966966#define READWRITE16BETO32BE_LSW( name, read16, write16 ) \
r2241r2242
973973 *************************************/
974974
975975#define READ16LETO32BE_LSW( name, read16 ) \
976READ_TEMPLATE_COND( 32, name, read16, read32be_with_16le_handler, ACCESSING_LSW32 )
976READ_TEMPLATE_COND( 32, name, read16, read32be_with_16le_handler, ACCESSING_BITS_0_15 )
977977
978978
979979#define WRITE16LETO32BE_LSW( name, write16 ) \
980WRITE_TEMPLATE_COND( 32, name, write16, write32be_with_16le_handler, ACCESSING_LSW32 )
980WRITE_TEMPLATE_COND( 32, name, write16, write32be_with_16le_handler, ACCESSING_BITS_0_15 )
981981
982982
983983#define READWRITE16LETO32BE_LSW( name, read16, write16 ) \
r2241r2242
990990 *************************************/
991991
992992#define READ16BETO32LE_LSW( name, read16 ) \
993READ_TEMPLATE_COND( 32, name, read16, read32le_with_16be_handler, ACCESSING_LSW32 )
993READ_TEMPLATE_COND( 32, name, read16, read32le_with_16be_handler, ACCESSING_BITS_0_15 )
994994
995995
996996#define WRITE16BETO32LE_LSW( name, write16 ) \
997WRITE_TEMPLATE_COND( 32, name, write16, write32le_with_16be_handler, ACCESSING_LSW32 )
997WRITE_TEMPLATE_COND( 32, name, write16, write32le_with_16be_handler, ACCESSING_BITS_0_15 )
998998
999999
10001000#define READWRITE16BETO32LE_LSW( name, read16, write16 ) \
r2241r2242
10071007 *************************************/
10081008
10091009#define READ16LETO32LE_LSW( name, read16 ) \
1010READ_TEMPLATE_COND( 32, name, read16, read32le_with_16le_handler, ACCESSING_LSW32 )
1010READ_TEMPLATE_COND( 32, name, read16, read32le_with_16le_handler, ACCESSING_BITS_0_15 )
10111011
10121012
10131013#define WRITE16LETO32LE_LSW( name, write16 ) \
1014WRITE_TEMPLATE_COND( 32, name, write16, write32le_with_16le_handler, ACCESSING_LSW32 )
1014WRITE_TEMPLATE_COND( 32, name, write16, write32le_with_16le_handler, ACCESSING_BITS_0_15 )
10151015
10161016
10171017#define READWRITE16LETO32LE_LSW( name, read16, write16 ) \
src/emu/uigfx.c
r2241r2242
119119   /* set up the graphics state */
120120   for (gfx = 0; gfx < MAX_GFX_ELEMENTS; gfx++)
121121   {
122      state->gfxset.rotate[gfx] = Machine->gamedrv->flags & ORIENTATION_MASK;
122      state->gfxset.rotate[gfx] = machine->gamedrv->flags & ORIENTATION_MASK;
123123      state->gfxset.count[gfx] = 16;
124124   }
125125
126126   /* set up the tilemap state */
127   state->tilemap.rotate = Machine->gamedrv->flags & ORIENTATION_MASK;
127   state->tilemap.rotate = machine->gamedrv->flags & ORIENTATION_MASK;
128128}
129129
130130
r2241r2242
155155   ui_gfx_state *state = &ui_gfx;
156156
157157   /* if we have nothing, implicitly cancel */
158   if (Machine->config->total_colors == 0 && Machine->colortable == NULL && Machine->gfx[0] == NULL && tilemap_count() == 0)
158   if (machine->config->total_colors == 0 && machine->colortable == NULL && machine->gfx[0] == NULL && tilemap_count() == 0)
159159      goto cancel;
160160
161161   /* if we're not paused, mark the bitmap dirty */
162   if (!mame_is_paused(Machine))
162   if (!mame_is_paused(machine))
163163      state->bitmap_dirty = TRUE;
164164
165165   /* switch off the state to display something */
r2241r2242
168168   {
169169      case 0:
170170         /* if we have a palette, display it */
171         if (Machine->config->total_colors > 0)
171         if (machine->config->total_colors > 0)
172172         {
173173            palette_handler(state);
174174            break;
r2241r2242
179179
180180      case 1:
181181         /* if we have graphics sets, display them */
182         if (Machine->gfx[0] != NULL)
182         if (machine->gfx[0] != NULL)
183183         {
184184            gfxset_handler(state);
185185            break;
r2241r2242
208208   }
209209
210210   if (input_ui_pressed(IPT_UI_PAUSE))
211      mame_pause(Machine, !mame_is_paused(Machine));
211      mame_pause(machine, !mame_is_paused(machine));
212212
213213   if (input_ui_pressed(IPT_UI_CANCEL) || input_ui_pressed(IPT_UI_SHOW_GFX))
214214      goto cancel;
r2241r2242
217217
218218cancel:
219219   if (!uistate)
220      mame_pause(Machine, FALSE);
220      mame_pause(machine, FALSE);
221221   state->bitmap_dirty = TRUE;
222222   return UI_HANDLER_CANCEL;
223223}
src/emu/video/cdp1869.c
r2241r2242
1010    TODO:
1111
1212    - connect to sound system when possible
13   - white noise
14   - scanline based update
15   - fix flashing spaceship in destryer/altair
16   - fix flashing player in draco
13    - white noise
14    - scanline based update
15    - fix flashing spaceship in destryer/altair
16    - fix flashing player in draco
1717
1818*/
1919
r2241r2242
308308
309309   UINT8 cma = 0;
310310
311   int pcb = cdp1869->intf->pcb_r(device, pma, cma);
312
313311   for (cma = 0; cma < cdp1869_get_lines(device); cma++)
314312   {
315313      UINT8 data = cdp1869->intf->char_ram_r(device, pma, cma);
316314
317315      int ccb0 = BIT(data, CCB0);
318316      int ccb1 = BIT(data, CCB1);
317      int pcb = cdp1869->intf->pcb_r(device, pma, cma);
319318
320319      int color = cdp1869_get_pen(device, ccb0, ccb1, pcb);
321320
src/emu/video/voodoo.c
r2241r2242
31643164   y = (offset >> v->fbi.lfb_stride) & ((1 << v->fbi.lfb_stride) - 1);
31653165
31663166   /* adjust the mask based on which half of the data is written */
3167   if ((mem_mask & 0x0000ffff) == 0x0000ffff)
3167   if (!ACCESSING_BITS_0_15)
31683168      mask &= ~(0x0f - LFB_DEPTH_PRESENT_MSW);
3169   if ((mem_mask & 0xffff0000) == 0xffff0000)
3169   if (!ACCESSING_BITS_16_31)
31703170      mask &= ~(0xf0 + LFB_DEPTH_PRESENT_MSW);
31713171
31723172   /* select the target buffer */
r2241r2242
36883688   /* modify the offset based on the mem_mask */
36893689   if (mem_mask)
36903690   {
3691      if (mem_mask & 0xffff0000)
3691      if (!ACCESSING_BITS_16_31)
36923692         offset |= 0x80000000;
3693      if (mem_mask & 0x0000ffff)
3693      if (!ACCESSING_BITS_0_15)
36943694         offset |= 0x40000000;
36953695   }
36963696
r2241r2242
42684268      case io_vgac0:   case io_vgac4:   case io_vgac8:   case io_vgacc:
42694269      case io_vgad0:   case io_vgad4:   case io_vgad8:   case io_vgadc:
42704270         result = 0;
4271         if (!(mem_mask & 0x000000ff))
4271         if (ACCESSING_BITS_0_7)
42724272            result |= banshee_vga_r(v, offset*4+0) << 0;
4273         if (!(mem_mask & 0x0000ff00))
4273         if (ACCESSING_BITS_8_15)
42744274            result |= banshee_vga_r(v, offset*4+1) << 8;
4275         if (!(mem_mask & 0x00ff0000))
4275         if (ACCESSING_BITS_16_23)
42764276            result |= banshee_vga_r(v, offset*4+2) << 16;
4277         if (!(mem_mask & 0xff000000))
4277         if (ACCESSING_BITS_24_31)
42784278            result |= banshee_vga_r(v, offset*4+3) << 24;
42794279         break;
42804280
r2241r2242
45634563      case io_vgab0:   case io_vgab4:   case io_vgab8:   case io_vgabc:
45644564      case io_vgac0:   case io_vgac4:   case io_vgac8:   case io_vgacc:
45654565      case io_vgad0:   case io_vgad4:   case io_vgad8:   case io_vgadc:
4566         if (!(mem_mask & 0x000000ff))
4566         if (ACCESSING_BITS_0_7)
45674567            banshee_vga_w(v, offset*4+0, data >> 0);
4568         if (!(mem_mask & 0x0000ff00))
4568         if (ACCESSING_BITS_8_15)
45694569            banshee_vga_w(v, offset*4+1, data >> 8);
4570         if (!(mem_mask & 0x00ff0000))
4570         if (ACCESSING_BITS_16_23)
45714571            banshee_vga_w(v, offset*4+2, data >> 16);
4572         if (!(mem_mask & 0xff000000))
4572         if (ACCESSING_BITS_24_31)
45734573            banshee_vga_w(v, offset*4+3, data >> 24);
45744574         break;
45754575
src/emu/video/tlc34076.c
r2241r2242
249249
250250WRITE16_HANDLER( tlc34076_lsb_w )
251251{
252   if (ACCESSING_LSB)
252   if (ACCESSING_BITS_0_7)
253253      tlc34076_w(machine, offset, data);
254254}
255255
r2241r2242
260260
261261WRITE16_HANDLER( tlc34076_msb_w )
262262{
263   if (ACCESSING_MSB)
263   if (ACCESSING_BITS_8_15)
264264      tlc34076_w(machine, offset, data >> 8);
265265}
266266
src/emu/tilemap.c
r2241r2242
943943   int xpos,ypos;
944944
945945   /* set up for the blit, using hard-coded parameters (no priority, etc) */
946   configure_blit_parameters(&blit, tmap, dest, NULL, TILEMAP_DRAW_OPAQUE, 0, 0xff);
946   configure_blit_parameters(&blit, tmap, dest, NULL, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0, 0xff);
947947
948948   /* compute the effective scroll positions */
949949   scrollx = tmap->width  - scrollx % tmap->width;
r2241r2242
14981498      blit->mask &= ~(TILEMAP_PIXEL_LAYER0 | TILEMAP_PIXEL_LAYER1 | TILEMAP_PIXEL_LAYER2);
14991499      blit->value &= ~(TILEMAP_PIXEL_LAYER0 | TILEMAP_PIXEL_LAYER1 | TILEMAP_PIXEL_LAYER2);
15001500   }
1501
1502   /* don't check category if requested */
1503   if (flags & TILEMAP_DRAW_ALL_CATEGORIES)
1504   {
1505      blit->mask &= ~TILEMAP_PIXEL_CATEGORY_MASK;
1506      blit->value &= ~TILEMAP_PIXEL_CATEGORY_MASK;
1507   }
15011508}
15021509
15031510
src/emu/tilemap.h
r2241r2242
321321#define TILEMAP_DRAW_LAYER2            0x40      /* draw layer 2 */
322322#define TILEMAP_DRAW_OPAQUE            0x80      /* draw everything, even transparent stuff */
323323#define TILEMAP_DRAW_ALPHA            0x100      /* draw with alpha blending */
324#define TILEMAP_DRAW_ALL_CATEGORIES      0x200      /* draw all categories */
324325
325326
326327/* per-pixel flags in the transparency_bitmap */
src/emu/video.c
r2241r2242
109109   UINT32               overall_valid_counter;   /* number of consecutive valid time periods */
110110
111111   /* configuration */
112   UINT8               sleep;               /* flag: TRUE if we're allowed to sleep */
113112   UINT8               throttle;            /* flag: TRUE if we're currently throttled */
114113   UINT8               fastforward;         /* flag: TRUE if we're currently fast-forwarding */
115114   UINT32               seconds_to_run;         /* number of seconds to run before quitting */
116115   UINT8               auto_frameskip;         /* flag: TRUE if we're automatically frameskipping */
117116   UINT32               speed;               /* overall speed (*100) */
118   UINT32               original_speed;         /* originally-specified speed */
119   UINT8               refresh_speed;         /* flag: TRUE if we max out our speed according to the refresh */
120   UINT8               update_in_pause;      /* flag: TRUE if video is updated while in pause */
121117
122118   /* frameskipping */
123119   UINT8               empty_skip_count;      /* number of empty frames we have skipped */
r2241r2242
272268}
273269
274270
271/*-------------------------------------------------
272    original_speed_setting - return the original
273    speed setting
274-------------------------------------------------*/
275275
276INLINE int original_speed_setting(void)
277{
278   return options_get_float(mame_options(), OPTION_SPEED) * 100.0 + 0.5;
279}
280
281
282
276283/***************************************************************************
277284    CORE IMPLEMENTATION
278285***************************************************************************/
r2241r2242
296303   memset(&global, 0, sizeof(global));
297304   global.speed_percent = 1.0;
298305
299   /* extract global configuration settings */
300   global.sleep = options_get_bool(mame_options(), OPTION_SLEEP);
306   /* extract initial execution state from global configuration settings */
307   global.speed = original_speed_setting();
301308   global.throttle = options_get_bool(mame_options(), OPTION_THROTTLE);
302309   global.auto_frameskip = options_get_bool(mame_options(), OPTION_AUTOFRAMESKIP);
303310   global.frameskip_level = options_get_int(mame_options(), OPTION_FRAMESKIP);
304311   global.seconds_to_run = options_get_int(mame_options(), OPTION_SECONDS_TO_RUN);
305   global.original_speed = global.speed = (options_get_float(mame_options(), OPTION_SPEED) * 100.0 + 0.5);
306   global.refresh_speed = options_get_bool(mame_options(), OPTION_REFRESHSPEED);
307   global.update_in_pause = options_get_bool(mame_options(), OPTION_UPDATEINPAUSE);
308312
309313   /* set the first screen device as the primary - this will set NULL if screenless */
310314   machine->primary_screen = video_screen_first(machine->config);
r2241r2242
318322   if (machine->config->gfxdecodeinfo != NULL)
319323      allocate_graphics(machine, machine->config->gfxdecodeinfo);
320324
321   /* configure the palette */
322   palette_config(machine);
325   /* call the PALETTE_INIT function */
326   if (machine->config->init_palette != NULL)
327      (*machine->config->init_palette)(machine, memory_region(REGION_PROMS));
323328
324329   /* actually decode the graphics */
325330   if (machine->config->gfxdecodeinfo != NULL)
r2241r2242
562567
563568   /* count total graphics elements */
564569   for (i = 0; i < MAX_GFX_ELEMENTS; i++)
565      if (machine->gfx[i])
570      if (machine->gfx[i] != NULL)
566571         totalgfx += machine->gfx[i]->total_elements;
567572
568573   /* loop over all elements */
r2241r2242
695700      state->vblank_period = config->vblank;
696701
697702   /* adjust speed if necessary */
698   if (global.refresh_speed)
703   if (options_get_bool(mame_options(), OPTION_REFRESHSPEED))
699704   {
700705      float minrefresh = render_get_max_update_rate();
701706      if (minrefresh != 0)
702707      {
703708         UINT32 target_speed = floor(minrefresh * 100.0 / ATTOSECONDS_TO_HZ(frame_period));
704         target_speed = MIN(target_speed, global.original_speed);
709         UINT32 original_speed = original_speed_setting();
710         target_speed = MIN(target_speed, original_speed);
705711         if (target_speed != global.speed)
706712         {
707713            mame_printf_verbose("Adjusting target speed to %d%%\n", target_speed);
r2241r2242
14111417   assert(machine->config != NULL);
14121418
14131419   /* only render sound and video if we're in the running phase */
1414   if (phase == MAME_PHASE_RUNNING && (!mame_is_paused(machine) || global.update_in_pause))
1420   if (phase == MAME_PHASE_RUNNING && (!mame_is_paused(machine) || options_get_bool(mame_options(), OPTION_UPDATEINPAUSE)))
14151421   {
14161422      int anything_changed = finish_screen_updates(machine);
14171423
r2241r2242
18611867   osd_ticks_t minimum_sleep = osd_ticks_per_second() / 1000;
18621868   osd_ticks_t current_ticks = osd_ticks();
18631869   osd_ticks_t new_ticks;
1864   int allowed_to_sleep;
1870   int allowed_to_sleep = FALSE;
18651871
18661872   /* we're allowed to sleep via the OSD code only if we're configured to do so
18671873       and we're not frameskipping due to autoframeskip, or if we're paused */
1868   allowed_to_sleep = mame_is_paused(machine) ||
1869      (global.sleep && (!effective_autoframeskip(machine) || effective_frameskip() == 0));
1874    if (options_get_bool(mame_options(), OPTION_SLEEP) && (!effective_autoframeskip(machine) || effective_frameskip() == 0))
1875       allowed_to_sleep = TRUE;
1876    if (mame_is_paused(machine))
1877       allowed_to_sleep = TRUE;
18701878
18711879   /* loop until we reach our target */
18721880   profiler_mark(PROFILER_IDLE);
src/emu/memory.c
r2241r2242
196196#define SUBTABLE_PTR(tabledata, entry) (&(tabledata)->table[(1 << LEVEL1_BITS) + (((entry) - SUBTABLE_BASE) << LEVEL2_BITS)])
197197
198198#ifdef ENABLE_DEBUGGER
199#define DEBUG_HOOK_READ(a,b,c) if (debug_hook_read) (*debug_hook_read)(a, b, c)
200#define DEBUG_HOOK_WRITE(a,b,c,d) if (debug_hook_write) (*debug_hook_write)(a, b, c, d)
199#define DEBUG_HOOK_READ(spacenum,address,mem_mask) if (debug_hook_read) (*debug_hook_read)(spacenum,address,mem_mask)
200#define DEBUG_HOOK_WRITE(spacenum,address,data,mem_mask) if (debug_hook_write) (*debug_hook_write)(spacenum,address,data,mem_mask)
201201#else
202#define DEBUG_HOOK_READ(a,b,c)
203#define DEBUG_HOOK_WRITE(a,b,c,d)
202#define DEBUG_HOOK_READ(spacenum,address,mem_mask)
203#define DEBUG_HOOK_WRITE(spacenum,address,data,mem_mask)
204204#endif
205205
206206
r2241r2242
735735   /* loop over tokens until we hit the end */
736736   while (entrytype != ADDRMAP_TOKEN_END)
737737   {
738      const char *tag;
739
738740      /* unpack the token from the first entry */
739741      TOKEN_GET_UINT32_UNPACK1(tokens, entrytype, 8);
740742      switch (entrytype)
r2241r2242
804806            break;
805807
806808         case ADDRMAP_TOKEN_READ_PORT:
809            tag = TOKEN_GET_STRING(tokens);
807810            switch (map->databits)
808811            {
809               case 8:      entry->read.mhandler8  = port_tag_to_handler8(TOKEN_GET_STRING(tokens));   break;
810               case 16:   entry->read.mhandler16 = port_tag_to_handler16(TOKEN_GET_STRING(tokens));   break;
811               case 32:   entry->read.mhandler32 = port_tag_to_handler32(TOKEN_GET_STRING(tokens));   break;
812               case 64:   entry->read.mhandler64 = port_tag_to_handler64(TOKEN_GET_STRING(tokens));   break;
812               case 8:      entry->read.mhandler8  = port_tag_to_handler8(tag);      break;
813               case 16:   entry->read.mhandler16 = port_tag_to_handler16(tag);   break;
814               case 32:   entry->read.mhandler32 = port_tag_to_handler32(tag);   break;
815               case 64:   entry->read.mhandler64 = port_tag_to_handler64(tag);   break;
813816            }
817            if (entry->read.generic == NULL)
818               fatalerror("Non-existent port referenced: '%s'\n", tag);
814819            break;
815820
816821         case ADDRMAP_TOKEN_REGION:
r2241r2242
25142519   UINT32 entry;                                                      \
25152520   MEMREADSTART();                                                      \
25162521   PERFORM_LOOKUP(readlookup,readhandlers,spacenum,~0);                        \
2517   DEBUG_HOOK_READ(spacenum, 1, address);                                    \
2522   DEBUG_HOOK_READ(spacenum, address, 0xff);                                 \
25182523                                                                  \
25192524   /* handle banks inline */                                             \
25202525   address = (address - handler->bytestart) & handler->bytemask;                  \
r2241r2242
25342539   UINT32 entry;                                                      \
25352540   MEMREADSTART();                                                      \
25362541   PERFORM_LOOKUP(readlookup,readhandlers,spacenum,~0);                        \
2537   DEBUG_HOOK_READ(spacenum, 1, address);                                    \
2542   DEBUG_HOOK_READ(spacenum, address - xormacro(shiftbytes), (masktype)0xff << (8 * (shiftbytes)));   \
25382543                                                                  \
25392544   /* handle banks inline */                                             \
25402545   address = (address - handler->bytestart) & handler->bytemask;                  \
r2241r2242
25702575   UINT32 entry;                                                      \
25712576   MEMREADSTART();                                                      \
25722577   PERFORM_LOOKUP(readlookup,readhandlers,spacenum,~1);                        \
2573   DEBUG_HOOK_READ(spacenum, 2, address);                                    \
2578   DEBUG_HOOK_READ(spacenum, address, 0xffff);                                 \
25742579                                                                  \
25752580   /* handle banks inline */                                             \
25762581   address = (address - handler->bytestart) & handler->bytemask;                  \
r2241r2242
25902595   UINT32 entry;                                                      \
25912596   MEMREADSTART();                                                      \
25922597   PERFORM_LOOKUP(readlookup,readhandlers,spacenum,~1);                        \
2593   DEBUG_HOOK_READ(spacenum, 2, address);                                    \
2598   DEBUG_HOOK_READ(spacenum, address - xormacro(shiftbytes), (masktype)0xffff << (8 * (shiftbytes)));   \
25942599                                                                  \
25952600   /* handle banks inline */                                             \
25962601   address = (address - handler->bytestart) & handler->bytemask;                  \
r2241r2242
26242629   UINT32 entry;                                                      \
26252630   MEMREADSTART();                                                      \
26262631   PERFORM_LOOKUP(readlookup,readhandlers,spacenum,~3);                        \
2627   DEBUG_HOOK_READ(spacenum, 4, address);                                    \
2632   DEBUG_HOOK_READ(spacenum, address, 0xffffffff);                              \
26282633                                                                  \
26292634   /* handle banks inline */                                             \
26302635   address = (address - handler->bytestart) & handler->bytemask;                  \
r2241r2242
26442649   UINT32 entry;                                                      \
26452650   MEMREADSTART();                                                      \
26462651   PERFORM_LOOKUP(readlookup,readhandlers,spacenum,~3);                        \
2647   DEBUG_HOOK_READ(spacenum, 4, address);                                    \
2652   DEBUG_HOOK_READ(spacenum, address, ~mem_mask);                              \
26482653                                                                  \
26492654   /* handle banks inline */                                             \
26502655   address = (address - handler->bytestart) & handler->bytemask;                  \
r2241r2242
26642669   UINT32 entry;                                                      \
26652670   MEMREADSTART();                                                      \
26662671   PERFORM_LOOKUP(readlookup,readhandlers,spacenum,~3);                        \
2667   DEBUG_HOOK_READ(spacenum, 4, address);                                    \
2672   DEBUG_HOOK_READ(spacenum, address - xormacro(shiftbytes), (masktype)0xffffffff << (8 * (shiftbytes)));   \
26682673                                                                  \
26692674   /* handle banks inline */                                             \
26702675   address = (address - handler->bytestart) & handler->bytemask;                  \
r2241r2242
26962701   UINT32 entry;                                                      \
26972702   MEMREADSTART();                                                      \
26982703   PERFORM_LOOKUP(readlookup,readhandlers,spacenum,~7);                        \
2699   DEBUG_HOOK_READ(spacenum, 8, address);                                    \
2704   DEBUG_HOOK_READ(spacenum, address, ~(UINT64)0);                              \
27002705                                                                  \
27012706   /* handle banks inline */                                             \
27022707   address = (address - handler->bytestart) & handler->bytemask;                  \
r2241r2242
27162721   UINT32 entry;                                                      \
27172722   MEMREADSTART();                                                      \
27182723   PERFORM_LOOKUP(readlookup,readhandlers,spacenum,~7);                        \
2719   DEBUG_HOOK_READ(spacenum, 8, address);                                    \
2724   DEBUG_HOOK_READ(spacenum, address, ~mem_mask);                              \
27202725                                                                  \
27212726   /* handle banks inline */                                             \
27222727   address = (address - handler->bytestart) & handler->bytemask;                  \
r2241r2242
27412746   UINT32 entry;                                                      \
27422747   MEMWRITESTART();                                                   \
27432748   PERFORM_LOOKUP(writelookup,writehandlers,spacenum,~0);                        \
2744   DEBUG_HOOK_WRITE(spacenum, 1, address, data);                              \
2749   DEBUG_HOOK_WRITE(spacenum, address, data, 0xff);                           \
27452750                                                                  \
27462751   /* handle banks inline */                                             \
27472752   address = (address - handler->bytestart) & handler->bytemask;                  \
r2241r2242
27612766   UINT32 entry;                                                      \
27622767   MEMWRITESTART();                                                   \
27632768   PERFORM_LOOKUP(writelookup,writehandlers,spacenum,~0);                        \
2764   DEBUG_HOOK_WRITE(spacenum, 1, address, data);                              \
2769   DEBUG_HOOK_WRITE(spacenum, address - xormacro(shiftbytes), (masktype)data << (8 * (shiftbytes)), (masktype)0xff << (8 * (shiftbytes)));   \
27652770                                                                  \
27662771   /* handle banks inline */                                             \
27672772   address = (address - handler->bytestart) & handler->bytemask;                  \
r2241r2242
27972802   UINT32 entry;                                                      \
27982803   MEMWRITESTART();                                                   \
27992804   PERFORM_LOOKUP(writelookup,writehandlers,spacenum,~1);                        \
2800   DEBUG_HOOK_WRITE(spacenum, 2, address, data);                              \
2805   DEBUG_HOOK_WRITE(spacenum, address, data, 0xffff);                           \
28012806                                                                  \
28022807   /* handle banks inline */                                             \
28032808   address = (address - handler->bytestart) & handler->bytemask;                  \
r2241r2242
28172822   UINT32 entry;                                                      \
28182823   MEMWRITESTART();                                                   \
28192824   PERFORM_LOOKUP(writelookup,writehandlers,spacenum,~1);                        \
2820   DEBUG_HOOK_WRITE(spacenum, 2, address, data);                              \
2825   DEBUG_HOOK_WRITE(spacenum, address - xormacro(shiftbytes), (masktype)data << (8 * (shiftbytes)), (masktype)0xffff << (8 * (shiftbytes)));   \
28212826                                                                  \
28222827   /* handle banks inline */                                             \
28232828   address = (address - handler->bytestart) & handler->bytemask;                  \
r2241r2242
28512856   UINT32 entry;                                                      \
28522857   MEMWRITESTART();                                                   \
28532858   PERFORM_LOOKUP(writelookup,writehandlers,spacenum,~3);                        \
2854   DEBUG_HOOK_WRITE(spacenum, 4, address, data);                              \
2859   DEBUG_HOOK_WRITE(spacenum, address, data, 0xffffffff);                        \
28552860                                                                  \
28562861   /* handle banks inline */                                             \
28572862   address = (address - handler->bytestart) & handler->bytemask;                  \
r2241r2242
28712876   UINT32 entry;                                                      \
28722877   MEMWRITESTART();                                                   \
28732878   PERFORM_LOOKUP(writelookup,writehandlers,spacenum,~3);                        \
2874   DEBUG_HOOK_WRITE(spacenum, 4, address, data);                              \
2879   DEBUG_HOOK_WRITE(spacenum, address, data, ~mem_mask);                        \
28752880                                                                  \
28762881   /* handle banks inline */                                             \
28772882   address = (address - handler->bytestart) & handler->bytemask;                  \
r2241r2242
28942899   UINT32 entry;                                                      \
28952900   MEMWRITESTART();                                                   \
28962901   PERFORM_LOOKUP(writelookup,writehandlers,spacenum,~3);                        \
2897   DEBUG_HOOK_WRITE(spacenum, 4, address, data);                              \
2902   DEBUG_HOOK_WRITE(spacenum, address - xormacro(shiftbytes), (masktype)data << (8 * (shiftbytes)), (masktype)0xffffffff << (8 * (shiftbytes)));   \
28982903                                                                  \
28992904   /* handle banks inline */                                             \
29002905   address = (address - handler->bytestart) & handler->bytemask;                  \
r2241r2242
29262931   UINT32 entry;                                                      \
29272932   MEMWRITESTART();                                                   \
29282933   PERFORM_LOOKUP(writelookup,writehandlers,spacenum,~7);                        \
2929   DEBUG_HOOK_WRITE(spacenum, 8, address, data);                              \
2934   DEBUG_HOOK_WRITE(spacenum, address, data, ~(UINT64)0);                        \
29302935                                                                  \
29312936   /* handle banks inline */                                             \
29322937   address = (address - handler->bytestart) & handler->bytemask;                  \
r2241r2242
29462951   UINT32 entry;                                                      \
29472952   MEMWRITESTART();                                                   \
29482953   PERFORM_LOOKUP(writelookup,writehandlers,spacenum,~7);                        \
2949   DEBUG_HOOK_WRITE(spacenum, 8, address, data);                              \
2954   DEBUG_HOOK_WRITE(spacenum, address, data, ~mem_mask);                        \
29502955                                                                  \
29512956   /* handle banks inline */                                             \
29522957   address = (address - handler->bytestart) & handler->bytemask;                  \
src/emu/memory.h
r2241r2242
412412/* helper macro for merging data with the memory mask */
413413#define COMBINE_DATA(varptr)         (*(varptr) = (*(varptr) & mem_mask) | (data & ~mem_mask))
414414
415#define ACCESSING_BITS_0_7            ((~mem_mask & 0x000000ff) != 0)
416#define ACCESSING_BITS_8_15            ((~mem_mask & 0x0000ff00) != 0)
417#define ACCESSING_BITS_16_23         ((~mem_mask & 0x00ff0000) != 0)
418#define ACCESSING_BITS_24_31         ((~mem_mask & 0xff000000) != 0)
419#define ACCESSING_BITS_32_39         ((~mem_mask & U64(0x000000ff00000000)) != 0)
420#define ACCESSING_BITS_40_47         ((~mem_mask & U64(0x0000ff0000000000)) != 0)
421#define ACCESSING_BITS_48_55         ((~mem_mask & U64(0x00ff000000000000)) != 0)
422#define ACCESSING_BITS_56_63         ((~mem_mask & U64(0xff00000000000000)) != 0)
415423
416/* 16-bit memory access tests */
417#define ACCESSING_LSB16               ((mem_mask & 0x00ff) == 0)
418#define ACCESSING_MSB16               ((mem_mask & 0xff00) == 0)
419#define ACCESSING_LSB               ACCESSING_LSB16
420#define ACCESSING_MSB               ACCESSING_MSB16
424#define ACCESSING_BITS_0_15            ((~mem_mask & 0x0000ffff) != 0)
425#define ACCESSING_BITS_16_31         ((~mem_mask & 0xffff0000) != 0)
426#define ACCESSING_BITS_32_47         ((~mem_mask & U64(0x0000ffff00000000)) != 0)
427#define ACCESSING_BITS_48_63         ((~mem_mask & U64(0xffff000000000000)) != 0)
421428
429#define ACCESSING_BITS_0_31            ((~mem_mask & 0xffffffff) != 0)
430#define ACCESSING_BITS_32_63         ((~mem_mask & U64(0xffffffff00000000)) != 0)
422431
423/* 32-bit memory access tests */
424#define ACCESSING_LSW32               ((mem_mask & 0x0000ffff) == 0)
425#define ACCESSING_MSW32               ((mem_mask & 0xffff0000) == 0)
426#define ACCESSING_LSB32               ((mem_mask & 0x000000ff) == 0)
427#define ACCESSING_MSB32               ((mem_mask & 0xff000000) == 0)
428432
429
430433/* bank switching for CPU cores */
431434#define change_pc(byteaddress)         memory_set_opbase(byteaddress)
432435
src/emu/mame.c
r2241r2242
15671567#ifdef MESS
15681568   /* first MESS initialization */
15691569   mess_predevice_init(machine);
1570#endif
1570#endif /* MESS */
15711571
15721572   /* call the game driver's init function */
15731573   /* this is where decryption is done and memory maps are altered */
r2241r2242
15821582#ifdef MESS
15831583   /* second MESS initialization */
15841584   mess_postdevice_init(machine);
1585#endif
1585#endif /* MESS */
15861586
15871587   /* start the video and audio hardware */
15881588   video_init(machine);
src/emu/inptport.c
r2241r2242
19591959   while (entrytype != INPUT_TOKEN_END)
19601960   {
19611961      UINT32 mask, defval, type, val;
1962      input_port_token temptoken;
1963      int hasdiploc, strindex;
19621964#ifdef MESS
19631965      UINT16 category;
19641966#endif /* MESS */
r2241r2242
19992001            seq_index[0] = seq_index[1] = seq_index[2] = 0;
20002002            break;
20012003
2004         case INPUT_TOKEN_SPECIAL_ONOFF:
2005            TOKEN_UNGET_UINT32(ipt);
2006            TOKEN_GET_UINT32_UNPACK3(ipt, entrytype, 8, hasdiploc, 1, strindex, 23);
2007            TOKEN_GET_UINT64_UNPACK2(ipt, mask, 32, defval, 32);
2008
2009            port = input_port_initialize(param, IPT_DIPSWITCH_NAME, modify_tag, mask, mask & defval);
2010            temptoken.i = strindex;
2011            port->name = input_port_string_from_token(temptoken);
2012            if (strindex == INPUT_STRING_Service_Mode)
2013            {
2014               port->toggle = TRUE;
2015               port->seq.code[0] = KEYCODE_F2;
2016            }
2017            if (hasdiploc)
2018               input_port_parse_diplocation(port, TOKEN_GET_STRING(ipt));
2019
2020            port = input_port_initialize(param, IPT_DIPSWITCH_SETTING, modify_tag, 0, mask & defval);
2021            temptoken.i = INPUT_STRING_Off;
2022            port->name = input_port_string_from_token(temptoken);
2023
2024            port = input_port_initialize(param, IPT_DIPSWITCH_SETTING, modify_tag, 0, mask & ~defval);
2025            temptoken.i = INPUT_STRING_On;
2026            port->name = input_port_string_from_token(temptoken);
2027            break;
2028
20022029         /* append a code */
20032030         case INPUT_TOKEN_CODE:
20042031            TOKEN_UNGET_UINT32(ipt);
src/emu/machine/msm6242.c
r2241r2242
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
89#include "machine/msm6242.h"
910
10
1111static UINT8 msm6264_reg[3] = { 0, 0, 0 };
1212static mame_system_time msm6264_hold_time = { 0 };
1313
14/* temporary buffer to hold values written to the device */
15static UINT8 time_buffer[13];
16
17/* TRUE if the time was just written */
18static int time_just_written = FALSE;
19
20
2114enum
2215{
2316   MSM6264_REG_S1      = 0,
r2241r2242
3831   MSM6264_REG_CF
3932};
4033
41
42static TIMER_CALLBACK( reset_time )
43{
44   time_just_written = FALSE;
45}
46
47
4834READ8_HANDLER( msm6242_r )
4935{
5036   mame_system_time curtime, *systime = &curtime;
5137
52   /* return the buffered time if it has recently been written */
53   if (time_just_written && offset < MSM6264_REG_CD)
54   {
55      return time_buffer[offset];
56   }
57
5838   if ( msm6264_reg[0] & 1 ) /* if HOLD is set, use the hold time */
5939   {
6040      systime = &msm6264_hold_time;
6141   }
6242   else /* otherwise, use the current time */
6343   {
64      mame_get_current_datetime(machine, &curtime);
44      mame_get_current_datetime(Machine, &curtime);
6545   }
6646
6747   switch(offset)
r2241r2242
11090   return 0;
11191}
11292
113
11493WRITE8_HANDLER( msm6242_w )
11594{
116   /* mark as just written and start a timer to reset it again */
117   if (offset < MSM6264_REG_CD)
118   {
119      time_buffer[offset] = data;
120      time_just_written = TRUE;
121      timer_set(ATTOTIME_IN_MSEC(500), NULL, 0, reset_time);
122      return;
123   }
124
12595   switch(offset)
12696   {
12797      case MSM6264_REG_CD:
r2241r2242
130100
131101          if ( data & 1 )   /* was Hold set? */
132102          {
133             mame_get_current_datetime(machine, &msm6264_hold_time);
103             mame_get_current_datetime(Machine, &msm6264_hold_time);
134104          }
135105
136106          return;
r2241r2242
163133   return msm6242_r(machine, offset);
164134}
165135
166
167136WRITE16_HANDLER( msm6242_lsb_w )
168137{
169   if (ACCESSING_LSB)
138   if (ACCESSING_BITS_0_7)
170139      msm6242_w(machine, offset, data);
171140}
src/emu/machine/timekpr.c
r2241r2242
414414static UINT16 timekeeper_msb16_read( UINT32 chip, offs_t offset, UINT16 mem_mask )
415415{
416416   UINT16 data = 0;
417   if( ACCESSING_MSB16 )
417   if( ACCESSING_BITS_8_15 )
418418   {
419419      data |= timekeeper_read( chip, offset ) << 8;
420420   }
r2241r2242
423423
424424static void timekeeper_msb16_write( UINT32 chip, offs_t offset, UINT16 data, UINT16 mem_mask )
425425{
426   if( ACCESSING_MSB16 )
426   if( ACCESSING_BITS_8_15 )
427427   {
428428      timekeeper_write( chip, offset, data >> 8 );
429429   }
r2241r2242
437437static UINT32 timekeeper_32be_read( UINT32 chip, offs_t offset, UINT32 mem_mask )
438438{
439439   UINT32 data = 0;
440   if( ACCESSING_MSB32 )
440   if( ACCESSING_BITS_24_31 )
441441   {
442442      data |= timekeeper_read( chip, ( offset * 4 ) + 0 ) << 24;
443443   }
444   if( ( mem_mask & 0x00ff0000 ) == 0 )
444   if( ACCESSING_BITS_16_23 )
445445   {
446446      data |= timekeeper_read( chip, ( offset * 4 ) + 1 ) << 16;
447447   }
448   if( ( mem_mask & 0x0000ff00 ) == 0 )
448   if( ACCESSING_BITS_8_15 )
449449   {
450450      data |= timekeeper_read( chip, ( offset * 4 ) + 2 ) << 8;
451451   }
452   if( ACCESSING_LSB32 )
452   if( ACCESSING_BITS_0_7 )
453453   {
454454      data |= timekeeper_read( chip, ( offset * 4 ) + 3 ) << 0;
455455   }
r2241r2242
458458
459459static void timekeeper_32be_write( UINT32 chip, offs_t offset, UINT32 data, UINT32 mem_mask )
460460{
461   if( ACCESSING_MSB32 )
461   if( ACCESSING_BITS_24_31 )
462462   {
463463      timekeeper_write( chip, ( offset * 4 ) + 0, data >> 24 );
464464   }
465   if( ( mem_mask & 0x00ff0000 ) == 0 )
465   if( ACCESSING_BITS_16_23 )
466466   {
467467      timekeeper_write( chip, ( offset * 4 ) + 1, data >> 16 );
468468   }
469   if( ( mem_mask & 0x0000ff00 ) == 0 )
469   if( ACCESSING_BITS_8_15 )
470470   {
471471      timekeeper_write( chip, ( offset * 4 ) + 2, data >> 8 );
472472   }
473   if( ACCESSING_LSB32 )
473   if( ACCESSING_BITS_0_7 )
474474   {
475475      timekeeper_write( chip, ( offset * 4 ) + 3, data >> 0 );
476476   }
r2241r2242
482482static UINT32 timekeeper_32le_lsb16_read( UINT32 chip, offs_t offset, UINT32 mem_mask )
483483{
484484   UINT32 data = 0;
485   if( ACCESSING_LSB32 )
485   if( ACCESSING_BITS_0_7 )
486486   {
487487      data |= timekeeper_read( chip, ( offset * 2 ) + 0 ) << 0;
488488   }
489   if( ( mem_mask & 0x00ff0000 ) == 0 )
489   if( ACCESSING_BITS_16_23 )
490490   {
491491      data |= timekeeper_read( chip, ( offset * 2 ) + 1 ) << 16;
492492   }
r2241r2242
495495
496496static void timekeeper_32le_lsb16_write( UINT32 chip, offs_t offset, UINT32 data, UINT32 mem_mask )
497497{
498   if( ACCESSING_LSB32 )
498   if( ACCESSING_BITS_0_7 )
499499   {
500500      timekeeper_write( chip, ( offset * 2 ) + 0, data >> 0 );
501501   }
502   if( ( mem_mask & 0x00ff0000 ) == 0 )
502   if( ACCESSING_BITS_16_23 )
503503   {
504504      timekeeper_write( chip, ( offset * 2 ) + 1, data >> 16 );
505505   }
src/emu/machine/6850acia.c
r2241r2242
5757   UINT8   rx_shift;
5858   UINT8   tx_shift;
5959
60   UINT8   rx_counter;
61   UINT8   tx_counter;
62
6063   int   rx_clock;
6164   int   tx_clock;
6265
r2241r2242
118121   acia_p->rdr = 0;
119122   acia_p->tx_shift = 0;
120123   acia_p->rx_shift = 0;
124   acia_p->tx_counter = 0;
125   acia_p->rx_counter = 0;
126
121127   *acia_p->tx_pin = 1;
122128   acia_p->overrun = 0;
123129   acia_p->status_read = 0;
r2241r2242
163169
164170   acia_p->rx_clock = intf->rx_clock;
165171   acia_p->tx_clock = intf->tx_clock;
172   acia_p->tx_counter = 0;
173   acia_p->rx_counter = 0;
166174   acia_p->rx_pin = intf->rx_pin;
167175   acia_p->tx_pin = intf->tx_pin;
168176   acia_p->cts_pin = intf->cts_pin;
r2241r2242
182190   state_save_register_item("acia6850", which, acia_p->status);
183191   state_save_register_item("acia6850", which, acia_p->rx_clock);
184192   state_save_register_item("acia6850", which, acia_p->tx_clock);
193   state_save_register_item("acia6850", which, acia_p->rx_counter);
194   state_save_register_item("acia6850", which, acia_p->tx_counter);
185195   state_save_register_item("acia6850", which, acia_p->rx_shift);
186196   state_save_register_item("acia6850", which, acia_p->tx_shift);
187197   state_save_register_item("acia6850", which, acia_p->rdr);
r2241r2242
201211   state_save_register_item("acia6850", which, acia_p->status_read);
202212}
203213
214
204215/*
205216    Read Status Register
206217*/
r2241r2242
213224   return acia_p->status;
214225}
215226
227
216228/*
217229    Write Control Register
218230*/
r2241r2242
297309
298310   if (!acia_p->reset)
299311   {
300      attotime rx_period = attotime_mul(ATTOTIME_IN_HZ(acia_p->rx_clock), acia_p->divide);
301      attotime tx_period = attotime_mul(ATTOTIME_IN_HZ(acia_p->tx_clock), acia_p->divide);
302      timer_adjust_periodic(acia_p->rx_timer, rx_period, which, rx_period);
303      timer_adjust_periodic(acia_p->tx_timer, tx_period, which, tx_period);
312      if (acia_p->rx_clock)
313      {
314         attotime rx_period = attotime_mul(ATTOTIME_IN_HZ(acia_p->rx_clock), acia_p->divide);
315         timer_adjust_periodic(acia_p->rx_timer, rx_period, which, rx_period);
316      }
317      if (acia_p->tx_clock)
318      {
319         attotime tx_period = attotime_mul(ATTOTIME_IN_HZ(acia_p->tx_clock), acia_p->divide);
320         timer_adjust_periodic(acia_p->tx_timer, tx_period, which, tx_period);
321      }
304322   }
305323}
306324
325
307326static void acia6850_check_interrupts(int which)
308327{
309328   acia_6850 *acia_p = &acia[which];
r2241r2242
331350   }
332351}
333352
353
334354/*
335355    Write transmit register
336356*/
r2241r2242
350370   }
351371}
352372
373
353374/*
354375    Read character
355376*/
r2241r2242
381402   return acia_p->rdr;
382403}
383404
405
384406/*
385407    Transmit a bit
386408*/
387static TIMER_CALLBACK( transmit_event )
409static void tx_tick(int which)
388410{
389   int which = param;
390411   acia_6850 *acia_p = &acia[which];
391412
392413   if (acia_p->cts_pin && *acia_p->cts_pin)
r2241r2242
499520   }
500521}
501522
502/* Called on receive timer event */
503static TIMER_CALLBACK( receive_event )
523
524/* Called on transmit timer event */
525static TIMER_CALLBACK( transmit_event )
504526{
505527   int which = param;
506528   acia_6850 *acia_p = &acia[which];
529   tx_tick(which);
530   acia_p->tx_counter = 0;
531}
507532
533
534/* As above, but using the tx pin */
535void acia_tx_clock_in(int which)
536{
537   acia_6850 *acia_p = &acia[which];
538
539   if (acia_p->cts_pin && *acia_p->cts_pin)
540   {
541      acia_p->status |= ACIA6850_STATUS_CTS;
542   }
543   else
544   {
545      acia_p->status &= ~ACIA6850_STATUS_CTS;
546   }
547
548   acia_p->tx_counter ++;
549
550   if ( acia_p->tx_counter > acia_p->divide-1)
551   {
552      tx_tick(which);
553      acia_p->tx_counter = 0;
554   }
555
556}
557
558
559/*
560    Receive a bit
561*/
562static void rx_tick(int which)
563{
564   acia_6850 *acia_p = &acia[which];
565
508566   if (acia_p->dcd_pin && *acia_p->dcd_pin)
509567   {
510568      acia_p->status |= ACIA6850_STATUS_DCD;
r2241r2242
639697   }
640698}
641699
700/* Called on receive timer event */
701static TIMER_CALLBACK( receive_event )
702{
703   int which = param;
704   acia_6850 *acia_p = &acia[which];
705   rx_tick(which);
706   acia_p->rx_counter = 0;
707}
708
709
710/* As above, but using the rx pin */
711void acia_rx_clock_in(int which)
712{
713   acia_6850 *acia_p = &acia[which];
714
715   if (acia_p->dcd_pin && *acia_p->dcd_pin)
716   {
717      acia_p->status |= ACIA6850_STATUS_DCD;
718      acia6850_check_interrupts(which);
719   }
720   else if ((acia_p->status & (ACIA6850_STATUS_DCD|ACIA6850_STATUS_IRQ)) == ACIA6850_STATUS_DCD)
721   {
722      acia_p->status &= ~ACIA6850_STATUS_DCD;
723   }
724
725   acia_p->rx_counter ++;
726
727   if ( acia_p->rx_counter > acia_p->divide-1)
728   {
729      rx_tick(which);
730      acia_p->rx_counter = 0;
731   }
732}
733
734
735/* Set clock frequencies dynamically */
642736void acia6850_set_rx_clock(int which, int clock)
643737{
644738   acia_6850 *acia_p = &acia[which];
645739   acia_p->rx_clock = clock;
646740}
647741
742
648743void acia6850_set_tx_clock(int which, int clock)
649744{
650745   acia_6850 *acia_p = &acia[which];
r2241r2242
692787READ16_HANDLER( acia6850_2_data_msb_r ) { return acia6850_data_r(2) << 8; }
693788READ16_HANDLER( acia6850_3_data_msb_r ) { return acia6850_data_r(3) << 8; }
694789
695WRITE16_HANDLER( acia6850_0_ctrl_msb_w ) { if (ACCESSING_MSB) acia6850_ctrl_w(0, (data >> 8) & 0xff); }
696WRITE16_HANDLER( acia6850_1_ctrl_msb_w ) { if (ACCESSING_MSB) acia6850_ctrl_w(1, (data >> 8) & 0xff); }
697WRITE16_HANDLER( acia6850_2_ctrl_msb_w ) { if (ACCESSING_MSB) acia6850_ctrl_w(2, (data >> 8) & 0xff); }
698WRITE16_HANDLER( acia6850_3_ctrl_msb_w ) { if (ACCESSING_MSB) acia6850_ctrl_w(3, (data >> 8) & 0xff); }
790WRITE16_HANDLER( acia6850_0_ctrl_msb_w ) { if (ACCESSING_BITS_8_15) acia6850_ctrl_w(0, (data >> 8) & 0xff); }
791WRITE16_HANDLER( acia6850_1_ctrl_msb_w ) { if (ACCESSING_BITS_8_15) acia6850_ctrl_w(1, (data >> 8) & 0xff); }
792WRITE16_HANDLER( acia6850_2_ctrl_msb_w ) { if (ACCESSING_BITS_8_15) acia6850_ctrl_w(2, (data >> 8) & 0xff); }
793WRITE16_HANDLER( acia6850_3_ctrl_msb_w ) { if (ACCESSING_BITS_8_15) acia6850_ctrl_w(3, (data >> 8) & 0xff); }
699794
700WRITE16_HANDLER( acia6850_0_ctrl_lsb_w ) { if (ACCESSING_LSB) acia6850_ctrl_w(0, data & 0xff); }
701WRITE16_HANDLER( acia6850_1_ctrl_lsb_w ) { if (ACCESSING_LSB) acia6850_ctrl_w(1, data & 0xff); }
702WRITE16_HANDLER( acia6850_2_ctrl_lsb_w ) { if (ACCESSING_LSB) acia6850_ctrl_w(2, data & 0xff); }
703WRITE16_HANDLER( acia6850_3_ctrl_lsb_w ) { if (ACCESSING_LSB) acia6850_ctrl_w(3, data & 0xff); }
795WRITE16_HANDLER( acia6850_0_ctrl_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_ctrl_w(0, data & 0xff); }
796WRITE16_HANDLER( acia6850_1_ctrl_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_ctrl_w(1, data & 0xff); }
797WRITE16_HANDLER( acia6850_2_ctrl_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_ctrl_w(2, data & 0xff); }
798WRITE16_HANDLER( acia6850_3_ctrl_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_ctrl_w(3, data & 0xff); }
704799
705WRITE16_HANDLER( acia6850_0_data_msb_w ) { if (ACCESSING_MSB) acia6850_data_w(0, (data >> 8) & 0xff); }
706WRITE16_HANDLER( acia6850_1_data_msb_w ) { if (ACCESSING_MSB) acia6850_data_w(1, (data >> 8) & 0xff); }
707WRITE16_HANDLER( acia6850_2_data_msb_w ) { if (ACCESSING_MSB) acia6850_data_w(2, (data >> 8) & 0xff); }
708WRITE16_HANDLER( acia6850_3_data_msb_w ) { if (ACCESSING_MSB) acia6850_data_w(3, (data >> 8) & 0xff); }
800WRITE16_HANDLER( acia6850_0_data_msb_w ) { if (ACCESSING_BITS_8_15) acia6850_data_w(0, (data >> 8) & 0xff); }
801WRITE16_HANDLER( acia6850_1_data_msb_w ) { if (ACCESSING_BITS_8_15) acia6850_data_w(1, (data >> 8) & 0xff); }
802WRITE16_HANDLER( acia6850_2_data_msb_w ) { if (ACCESSING_BITS_8_15) acia6850_data_w(2, (data >> 8) & 0xff); }
803WRITE16_HANDLER( acia6850_3_data_msb_w ) { if (ACCESSING_BITS_8_15) acia6850_data_w(3, (data >> 8) & 0xff); }
709804
710WRITE16_HANDLER( acia6850_0_data_lsb_w ) { if (ACCESSING_LSB) acia6850_data_w(0, data & 0xff); }
711WRITE16_HANDLER( acia6850_1_data_lsb_w ) { if (ACCESSING_LSB) acia6850_data_w(1, data & 0xff); }
712WRITE16_HANDLER( acia6850_2_data_lsb_w ) { if (ACCESSING_LSB) acia6850_data_w(2, data & 0xff); }
713WRITE16_HANDLER( acia6850_3_data_lsb_w ) { if (ACCESSING_LSB) acia6850_data_w(3, data & 0xff); }
805WRITE16_HANDLER( acia6850_0_data_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_data_w(0, data & 0xff); }
806WRITE16_HANDLER( acia6850_1_data_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_data_w(1, data & 0xff); }
807WRITE16_HANDLER( acia6850_2_data_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_data_w(2, data & 0xff); }
808WRITE16_HANDLER( acia6850_3_data_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_data_w(3, data & 0xff); }
src/emu/machine/6850acia.h
r2241r2242
2828
2929void acia6850_config(int which, const struct acia6850_interface *intf);
3030
31void acia_tx_clock_in(int which);
32void acia_rx_clock_in(int which);
33
3134void acia6850_set_rx_clock(int which, int clock);
3235void acia6850_set_tx_clock(int which, int clock);
3336
src/emu/machine/idectrl.c
r2241r2242
442442   int size = 4;
443443
444444   /* determine which real offset */
445   if (mem_mask & 0x000000ff)
445   if (!ACCESSING_BITS_0_7)
446446   {
447447      (*offset)++, size = 3;
448      if (mem_mask & 0x0000ff00)
448      if (!ACCESSING_BITS_8_15)
449449      {
450450         (*offset)++, size = 2;
451         if (mem_mask & 0x00ff0000)
451         if (!ACCESSING_BITS_16_23)
452452            (*offset)++, size = 1;
453453      }
454454   }
455455
456456   /* determine the real size */
457   if (!(mem_mask & 0xff000000))
457   if (ACCESSING_BITS_24_31)
458458      return size;
459459   size--;
460   if (!(mem_mask & 0x00ff0000))
460   if (ACCESSING_BITS_16_23)
461461      return size;
462462   size--;
463   if (!(mem_mask & 0x0000ff00))
463   if (ACCESSING_BITS_8_15)
464464      return size;
465465   size--;
466466   return size;
r2241r2242
471471   int size = 2;
472472
473473   /* determine which real offset */
474   if (mem_mask & 0x000000ff)
474   if (!ACCESSING_BITS_0_7)
475475      (*offset)++, size = 1;
476476
477   if (!(mem_mask & 0x0000ff00))
477   if (ACCESSING_BITS_8_15)
478478      return size;
479479   size--;
480480   return size;
src/emu/machine/6821pia.c
r2241r2242
12091209READ16_HANDLER( pia_6_lsb_r ) { return pia_read(6, offset); }
12101210READ16_HANDLER( pia_7_lsb_r ) { return pia_read(7, offset); }
12111211
1212WRITE16_HANDLER( pia_0_lsb_w ) { if (ACCESSING_LSB) pia_write(0, offset, data); }
1213WRITE16_HANDLER( pia_1_lsb_w ) { if (ACCESSING_LSB) pia_write(1, offset, data); }
1214WRITE16_HANDLER( pia_2_lsb_w ) { if (ACCESSING_LSB) pia_write(2, offset, data); }
1215WRITE16_HANDLER( pia_3_lsb_w ) { if (ACCESSING_LSB) pia_write(3, offset, data); }
1216WRITE16_HANDLER( pia_4_lsb_w ) { if (ACCESSING_LSB) pia_write(4, offset, data); }
1217WRITE16_HANDLER( pia_5_lsb_w ) { if (ACCESSING_LSB) pia_write(5, offset, data); }
1218WRITE16_HANDLER( pia_6_lsb_w ) { if (ACCESSING_LSB) pia_write(6, offset, data); }
1219WRITE16_HANDLER( pia_7_lsb_w ) { if (ACCESSING_LSB) pia_write(7, offset, data); }
1212WRITE16_HANDLER( pia_0_lsb_w ) { if (ACCESSING_BITS_0_7) pia_write(0, offset, data); }
1213WRITE16_HANDLER( pia_1_lsb_w ) { if (ACCESSING_BITS_0_7) pia_write(1, offset, data); }
1214WRITE16_HANDLER( pia_2_lsb_w ) { if (ACCESSING_BITS_0_7) pia_write(2, offset, data); }
1215WRITE16_HANDLER( pia_3_lsb_w ) { if (ACCESSING_BITS_0_7) pia_write(3, offset, data); }
1216WRITE16_HANDLER( pia_4_lsb_w ) { if (ACCESSING_BITS_0_7) pia_write(4, offset, data); }
1217WRITE16_HANDLER( pia_5_lsb_w ) { if (ACCESSING_BITS_0_7) pia_write(5, offset, data); }
1218WRITE16_HANDLER( pia_6_lsb_w ) { if (ACCESSING_BITS_0_7) pia_write(6, offset, data); }
1219WRITE16_HANDLER( pia_7_lsb_w ) { if (ACCESSING_BITS_0_7) pia_write(7, offset, data); }
12201220
12211221READ16_HANDLER( pia_0_lsb_alt_r ) { return pia_alt_read(0, offset); }
12221222READ16_HANDLER( pia_1_lsb_alt_r ) { return pia_alt_read(1, offset); }
r2241r2242
12271227READ16_HANDLER( pia_6_lsb_alt_r ) { return pia_alt_read(6, offset); }
12281228READ16_HANDLER( pia_7_lsb_alt_r ) { return pia_alt_read(7, offset); }
12291229
1230WRITE16_HANDLER( pia_0_lsb_alt_w ) { if (ACCESSING_LSB) pia_alt_write(0, offset, data); }
1231WRITE16_HANDLER( pia_1_lsb_alt_w ) { if (ACCESSING_LSB) pia_alt_write(1, offset, data); }
1232WRITE16_HANDLER( pia_2_lsb_alt_w ) { if (ACCESSING_LSB) pia_alt_write(2, offset, data); }
1233WRITE16_HANDLER( pia_3_lsb_alt_w ) { if (ACCESSING_LSB) pia_alt_write(3, offset, data); }
1234WRITE16_HANDLER( pia_4_lsb_alt_w ) { if (ACCESSING_LSB) pia_alt_write(4, offset, data); }
1235WRITE16_HANDLER( pia_5_lsb_alt_w ) { if (ACCESSING_LSB) pia_alt_write(5, offset, data); }
1236WRITE16_HANDLER( pia_6_lsb_alt_w ) { if (ACCESSING_LSB) pia_alt_write(6, offset, data); }
1237WRITE16_HANDLER( pia_7_lsb_alt_w ) { if (ACCESSING_LSB) pia_alt_write(7, offset, data); }
1230WRITE16_HANDLER( pia_0_lsb_alt_w ) { if (ACCESSING_BITS_0_7) pia_alt_write(0, offset, data); }
1231WRITE16_HANDLER( pia_1_lsb_alt_w ) { if (ACCESSING_BITS_0_7) pia_alt_write(1, offset, data); }
1232WRITE16_HANDLER( pia_2_lsb_alt_w ) { if (ACCESSING_BITS_0_7) pia_alt_write(2, offset, data); }
1233WRITE16_HANDLER( pia_3_lsb_alt_w ) { if (ACCESSING_BITS_0_7) pia_alt_write(3, offset, data); }
1234WRITE16_HANDLER( pia_4_lsb_alt_w ) { if (ACCESSING_BITS_0_7) pia_alt_write(4, offset, data); }
1235WRITE16_HANDLER( pia_5_lsb_alt_w ) { if (ACCESSING_BITS_0_7) pia_alt_write(5, offset, data); }
1236WRITE16_HANDLER( pia_6_lsb_alt_w ) { if (ACCESSING_BITS_0_7) pia_alt_write(6, offset, data); }
1237WRITE16_HANDLER( pia_7_lsb_alt_w ) { if (ACCESSING_BITS_0_7) pia_alt_write(7, offset, data); }
12381238
12391239/******************* Standard 16-bit CPU interfaces, D8-D15 *******************/
12401240
r2241r2242
12471247READ16_HANDLER( pia_6_msb_r ) { return pia_read(6, offset) << 8; }
12481248READ16_HANDLER( pia_7_msb_r ) { return pia_read(7, offset) << 8; }
12491249
1250WRITE16_HANDLER( pia_0_msb_w ) { if (ACCESSING_MSB) pia_write(0, offset, data >> 8); }
1251WRITE16_HANDLER( pia_1_msb_w ) { if (ACCESSING_MSB) pia_write(1, offset, data >> 8); }
1252WRITE16_HANDLER( pia_2_msb_w ) { if (ACCESSING_MSB) pia_write(2, offset, data >> 8); }
1253WRITE16_HANDLER( pia_3_msb_w ) { if (ACCESSING_MSB) pia_write(3, offset, data >> 8); }
1254WRITE16_HANDLER( pia_4_msb_w ) { if (ACCESSING_MSB) pia_write(4, offset, data >> 8); }
1255WRITE16_HANDLER( pia_5_msb_w ) { if (ACCESSING_MSB) pia_write(5, offset, data >> 8); }
1256WRITE16_HANDLER( pia_6_msb_w ) { if (ACCESSING_MSB) pia_write(6, offset, data >> 8); }
1257WRITE16_HANDLER( pia_7_msb_w ) { if (ACCESSING_MSB) pia_write(7, offset, data >> 8); }
1250WRITE16_HANDLER( pia_0_msb_w ) { if (ACCESSING_BITS_8_15) pia_write(0, offset, data >> 8); }
1251WRITE16_HANDLER( pia_1_msb_w ) { if (ACCESSING_BITS_8_15) pia_write(1, offset, data >> 8); }
1252WRITE16_HANDLER( pia_2_msb_w ) { if (ACCESSING_BITS_8_15) pia_write(2, offset, data >> 8); }
1253WRITE16_HANDLER( pia_3_msb_w ) { if (ACCESSING_BITS_8_15) pia_write(3, offset, data >> 8); }
1254WRITE16_HANDLER( pia_4_msb_w ) { if (ACCESSING_BITS_8_15) pia_write(4, offset, data >> 8); }
1255WRITE16_HANDLER( pia_5_msb_w ) { if (ACCESSING_BITS_8_15) pia_write(5, offset, data >> 8); }
1256WRITE16_HANDLER( pia_6_msb_w ) { if (ACCESSING_BITS_8_15) pia_write(6, offset, data >> 8); }
1257WRITE16_HANDLER( pia_7_msb_w ) { if (ACCESSING_BITS_8_15) pia_write(7, offset, data >> 8); }
12581258
12591259READ16_HANDLER( pia_0_msb_alt_r ) { return pia_alt_read(0, offset) << 8; }
12601260READ16_HANDLER( pia_1_msb_alt_r ) { return pia_alt_read(1, offset) << 8; }
r2241r2242
12651265READ16_HANDLER( pia_6_msb_alt_r ) { return pia_alt_read(6, offset) << 8; }
12661266READ16_HANDLER( pia_7_msb_alt_r ) { return pia_alt_read(7, offset) << 8; }
12671267
1268WRITE16_HANDLER( pia_0_msb_alt_w ) { if (ACCESSING_MSB) pia_alt_write(0, offset, data >> 8); }
1269WRITE16_HANDLER( pia_1_msb_alt_w ) { if (ACCESSING_MSB) pia_alt_write(1, offset, data >> 8); }
1270WRITE16_HANDLER( pia_2_msb_alt_w ) { if (ACCESSING_MSB) pia_alt_write(2, offset, data >> 8); }
1271WRITE16_HANDLER( pia_3_msb_alt_w ) { if (ACCESSING_MSB) pia_alt_write(3, offset, data >> 8); }
1272WRITE16_HANDLER( pia_4_msb_alt_w ) { if (ACCESSING_MSB) pia_alt_write(4, offset, data >> 8); }
1273WRITE16_HANDLER( pia_5_msb_alt_w ) { if (ACCESSING_MSB) pia_alt_write(5, offset, data >> 8); }
1274WRITE16_HANDLER( pia_6_msb_alt_w ) { if (ACCESSING_MSB) pia_alt_write(6, offset, data >> 8); }
1275WRITE16_HANDLER( pia_7_msb_alt_w ) { if (ACCESSING_MSB) pia_alt_write(7, offset, data >> 8); }
1268WRITE16_HANDLER( pia_0_msb_alt_w ) { if (ACCESSING_BITS_8_15) pia_alt_write(0, offset, data >> 8); }
1269WRITE16_HANDLER( pia_1_msb_alt_w ) { if (ACCESSING_BITS_8_15) pia_alt_write(1, offset, data >> 8); }
1270WRITE16_HANDLER( pia_2_msb_alt_w ) { if (ACCESSING_BITS_8_15) pia_alt_write(2, offset, data >> 8); }
1271WRITE16_HANDLER( pia_3_msb_alt_w ) { if (ACCESSING_BITS_8_15) pia_alt_write(3, offset, data >> 8); }
1272WRITE16_HANDLER( pia_4_msb_alt_w ) { if (ACCESSING_BITS_8_15) pia_alt_write(4, offset, data >> 8); }
1273WRITE16_HANDLER( pia_5_msb_alt_w ) { if (ACCESSING_BITS_8_15) pia_alt_write(5, offset, data >> 8); }
1274WRITE16_HANDLER( pia_6_msb_alt_w ) { if (ACCESSING_BITS_8_15) pia_alt_write(6, offset, data >> 8); }
1275WRITE16_HANDLER( pia_7_msb_alt_w ) { if (ACCESSING_BITS_8_15) pia_alt_write(7, offset, data >> 8); }
12761276
12771277/******************* 8-bit A/B port interfaces *******************/
12781278
src/emu/machine/scsicd.c
r2241r2242
735735      case SCSIOP_READ_DATA:
736736         scsicd_read_data( file, ptrparm, intparm );
737737         return 0;
738             
738
739739      case SCSIOP_WRITE_DATA:
740740         scsicd_write_data( file, ptrparm, intparm );
741741         return 0;
src/emu/machine/ds2401.c
r2241r2242
161161   state_save_register_item( "ds2401", which, c->shift );
162162   state_save_register_item( "ds2401", which, c->rx );
163163   state_save_register_item( "ds2401", which, c->tx );
164   state_save_register_generic( "ds2401", which, "data", (UINT8 *)&data[0], data[0], SIZE_DATA );
165164
166165   c->timer = timer_alloc( ds2401_tick , NULL);
167166   c->reset_timer = timer_alloc( ds2401_reset , NULL);
src/emu/machine/6840ptm.c
r2241r2242
3636#include "deprecat.h"
3737#include "6840ptm.h"
3838
39#ifdef MAME_DEBUG
40#define PTMVERBOSE 1
39// Defines /////////////////////////////////////////////////////////////
40
41#define PTMVERBOSE 0
42
43#if PTMVERBOSE
44   #define PLOG(x)   logerror x;
4145#else
42#define PTMVERBOSE 0
46   #define PLOG(x)
4347#endif
4448
45#define PLOG(x)   do { if (PTMVERBOSE) logerror x; } while (0)
49enum
50{
51   PTM_6840_CTRL1   = 0,
52   PTM_6840_CTRL2   = 1,
53   PTM_6840_STATUS  = 1,
54   PTM_6840_MSBBUF1 = 2,
55   PTM_6840_LSB1    = 3,
56   PTM_6840_MSBBUF2 = 4,
57   PTM_6840_LSB2    = 5,
58   PTM_6840_MSBBUF3 = 6,
59   PTM_6840_LSB3    = 7,
60};
4661
47#define PTM_6840_CTRL1   0
48#define PTM_6840_CTRL2   1
49#define PTM_6840_MSBBUF1 2
50#define PTM_6840_LSB1    3
51#define PTM_6840_MSBBUF2 4
52#define PTM_6840_LSB2    5
53#define PTM_6840_MSBBUF3 6
54#define PTM_6840_LSB3    7
5562
56typedef struct _ptm6840 ptm6840;
57struct _ptm6840
63typedef struct _ptm6840
5864{
5965   const ptm6840_interface *intf;
6066
6167   UINT8 control_reg[3];
62   UINT8 output[3]; // output states
63   UINT8 gate[3]; // input gate states
64   UINT8 clock[3]; // clock states
68   UINT8 output[3]; /* Output states */
69   UINT8 gate[3];   /* Input gate states */
70   UINT8 clock[3];  /* Clock states */
6571   UINT8 enabled[3];
6672   UINT8 mode[3];
6773   UINT8 fired[3];
r2241r2242
7682   int internal_clock;
7783   int external_clock[3];
7884
79   // each PTM has 3 timers
85   /* Each PTM has 3 timers */
8086   emu_timer *timer[3];
8187
8288   UINT16 latch[3];
8389   UINT16 counter[3];
84};
90} ptm6840;
8591
86// local prototypes ///////////////////////////////////////////////////////
92// Local prototypes ///////////////////////////////////////////////////////
8793
8894static void ptm6840_timeout(int which, int idx);
8995static TIMER_CALLBACK( ptm6840_t1_timeout );
9096static TIMER_CALLBACK( ptm6840_t2_timeout );
9197static TIMER_CALLBACK( ptm6840_t3_timeout );
9298
93// local vars /////////////////////////////////////////////////////////////
99// Local vars /////////////////////////////////////////////////////////////
94100
95101static ptm6840 ptm[PTM_6840_MAX];
96102
r2241r2242
115121int ptm6840_get_status(int which, int clock)
116122{
117123   ptm6840 *p = ptm + which;
118   return p->enabled[clock-1];
124   return p->enabled[clock - 1];
119125}
120126
121127///////////////////////////////////////////////////////////////////////////
r2241r2242
143149
144150   ptm6840 *currptr = ptm + which;
145151
146   /* determine the clock frequency for this timer */
152   /* Determine the clock frequency for this timer */
147153   if (currptr->control_reg[counter] & 0x02)
148154      clock = currptr->internal_clock;
149155   else
150156      clock = currptr->external_clock[counter];
151157
152   /* dual-byte mode */
158   /* Dual-byte mode */
153159   if (currptr->control_reg[counter] & 0x04)
154160   {
155161      int lsb = currptr->counter[counter] & 0xff;
156162      int msb = currptr->counter[counter] >> 8;
157163
158      /* count the clocks */
164      /* Count the clocks */
159165      lsb -= count;
160166
161      /* loop while we're less than zero */
167      /* Loop while we're less than zero */
162168      while (lsb < 0)
163169      {
164         /* borrow from the MSB */
170         /* Borrow from the MSB */
165171         lsb += (currptr->latch[counter] & 0xff) + 1;
166172         msb--;
167         /* if MSB goes less than zero, we've expired */
173
174         /* If MSB goes less than zero, we've expired */
168175         if (msb < 0)
169176         {
170177            ptm6840_timeout(which, counter);
r2241r2242
172179         }
173180      }
174181
175      /* store the result */
182      /* Store the result */
176183      currptr->counter[counter] = (msb << 8) | lsb;
177184   }
178185
179   /* word mode */
186   /* Word mode */
180187   else
181188   {
182189      int word = currptr->counter[counter];
183190
184      /* count the clocks */
191      /* Count the clocks */
185192      word -= count;
186193
187194      /* loop while we're less than zero */
188195      while (word < 0)
189196      {
190         /* borrow from the MSB */
197         /* Borrow from the MSB */
191198         word += currptr->latch[counter] + 1;
192199
193         /* we've expired */
200         /* We've expired */
194201         ptm6840_timeout(which, counter);
195202      }
196203
197      /* store the result */
204      /* Store the result */
198205      currptr->counter[counter] = word;
199206   }
200207
201208   if (currptr->enabled[counter])
202209   {
203210      duration = attotime_mul(ATTOTIME_IN_HZ(clock), currptr->counter[counter]);
204      if (counter == 2) duration = attotime_mul(duration, currptr->t3_divisor);
211
212      if (counter == 2)
213         duration = attotime_mul(duration, currptr->t3_divisor);
214
205215      timer_adjust_oneshot(currptr->timer[counter], duration, which);
206216   }
207217}
r2241r2242
213223   if (counter == 2)
214224   {
215225      currptr->t3_scaler += count;
216      if ( currptr->t3_scaler > currptr->t3_divisor-1)
226
227      if ( currptr->t3_scaler > currptr->t3_divisor - 1)
217228      {
218         subtract_from_counter(which,counter,1);
229         subtract_from_counter(which, counter, 1);
219230         currptr->t3_scaler = 0;
220231      }
221232   }
222233   else
223234   {
224      subtract_from_counter(which,counter,count);
235      subtract_from_counter(which, counter, count);
225236   }
226237}
227238
r2241r2242
236247   int new_state;
237248   ptm6840 *currptr = ptm + which;
238249
239   new_state = (((currptr->status_reg & 0x01) && (currptr->control_reg[0] & 0x40)) || ((currptr->status_reg & 0x02) && (currptr->control_reg[1] & 0x40))
240            ||((currptr->status_reg & 0x04) && (currptr->control_reg[2] & 0x80)));
250   new_state = ((currptr->status_reg & 0x01) && (currptr->control_reg[0] & 0x40)) ||
251            ((currptr->status_reg & 0x02) && (currptr->control_reg[1] & 0x40)) ||
252            ((currptr->status_reg & 0x04) && (currptr->control_reg[2] & 0x40));
241253
242   if (new_state != currptr->IRQ)
254//  if (new_state != currptr->IRQ)
243255   {
244256      currptr->IRQ = new_state;
257
245258      if (currptr->IRQ)
246      {
247259         currptr->status_reg |= 0x80;
248      }
249260      else
250      {
251261         currptr->status_reg &= ~0x80;
252      }
253      if (currptr->intf->irq_func) (currptr->intf->irq_func)(currptr->IRQ);
262
263      if (currptr->intf->irq_func)
264         (currptr->intf->irq_func)(currptr->IRQ);
254265   }
255266}
256267
r2241r2242
267278   int clock;
268279   int remaining=0;
269280
270   /* if there's no timer, return the count */
281   /* If there's no timer, return the count */
271282   if (!currptr->enabled[counter])
272283   {
273284      PLOG(("MC6840 #%d: read counter(%d): %d\n", which, counter, currptr->counter[counter]));
r2241r2242
278289   if (currptr->control_reg[counter] & 0x02)
279290   {
280291      clock = currptr->internal_clock;
281      PLOG(("MC6840 #%d: %d internal clock freq %d \n", which,counter,clock));
292      PLOG(("MC6840 #%d: %d internal clock freq %d \n", which, counter, clock));
282293   }
283294   else
284295   {
285296      clock = currptr->external_clock[counter];
286      PLOG(("MC6840 #%d: %d external clock freq %d \n", which,counter,clock));
297      PLOG(("MC6840 #%d: %d external clock freq %d \n", which, counter, clock));
287298   }
288   /* see how many are left */
299   /* See how many are left */
289300   remaining = attotime_to_double(attotime_mul(timer_timeleft(currptr->timer[counter]), clock));
290301
291   /* adjust the count for dual byte mode */
302   /* Adjust the count for dual byte mode */
292303   if (currptr->control_reg[counter] & 0x04)
293304   {
294305      int divisor = (currptr->counter[counter] & 0xff) + 1;
r2241r2242
313324   attotime duration;
314325   ptm6840 *currptr = ptm + which;
315326
316   /* copy the latched value in */
327   /* Copy the latched value in */
317328   currptr->counter[idx] = currptr->latch[idx];
318329
319   /* determine the clock frequency for this timer */
330   /* Determine the clock frequency for this timer */
320331   if (currptr->control_reg[idx] & 0x02)
321332   {
322333      clock = currptr->internal_clock;
r2241r2242
328339      PLOG(("MC6840 #%d: %d external clock freq %d \n", which,idx, clock));
329340   }
330341
331   /* determine the number of clock periods before we expire */
342   /* Determine the number of clock periods before we expire */
332343   count = currptr->counter[idx];
333344   if (currptr->control_reg[idx] & 0x04)
334345      count = ((count >> 8) + 1) * ((count & 0xff) + 1);
r2241r2242
343354      if ( currptr->intf->out_func[idx] ) currptr->intf->out_func[idx](Machine, 0, currptr->output[idx]);
344355   }
345356
346   /* set the timer */
357   /* Set the timer */
347358   PLOG(("MC6840 #%d: reload_count(%d): clock = %d  count = %d\n", which, idx, clock, count));
348359
349360   duration = attotime_mul(ATTOTIME_IN_HZ(clock), count);
r2241r2242
386397   for (i = 0; i < 3; i++)
387398   {
388399      if ( currptr->intf->external_clock[i] )
389      {
390400         ptm[which].external_clock[i] = currptr->intf->external_clock[i];
391      }
392401      else
393      {
394402         ptm[which].external_clock[i] = 1;
395      }
396403   }
397404
398405   ptm[which].timer[0] = timer_alloc(ptm6840_t1_timeout, NULL);
r2241r2242
434441void ptm6840_reset(int which)
435442{
436443   int i;
437   ptm[which].control_reg[2]         = 0x00;
438   ptm[which].control_reg[1]         = 0x00;
439   ptm[which].control_reg[0]         = 0x01;
440   ptm[which].status_reg            = 0x00;
441   ptm[which].t3_divisor            = 1;
442   ptm[which].status_read_since_int   = 0x00;
443444
444   for ( i = 0; i < 3; i++ )
445   ptm[which].control_reg[2]       = 0;
446   ptm[which].control_reg[1]       = 0;
447   ptm[which].control_reg[0]       = 1;
448   ptm[which].status_reg          = 0;
449   ptm[which].t3_divisor          = 1;
450   ptm[which].status_read_since_int = 0;
451   ptm[which].IRQ                   = 0;
452
453   for (i = 0; i < 3; i++)
445454   {
446      ptm[which].counter[i]            = 0xffff;
447      ptm[which].latch[i]               = 0xffff;
448      ptm[which].output[i]            = 0;
449      ptm[which].fired[i]               = 0;
455      ptm[which].counter[i] = 0xffff;
456      ptm[which].latch[i]   = 0xffff;
457      ptm[which].output[i]  = 0;
458      ptm[which].fired[i]   = 0;
450459   }
451460}
452461
r2241r2242
460469{
461470   int val;
462471   ptm6840 *currptr = ptm + which;
472
463473   switch ( offset )
464474   {
465      case PTM_6840_CTRL1 ://0
475      case PTM_6840_CTRL1:
466476      {
467477         val = 0;
468478         break;
469479      }
470480
471      case PTM_6840_CTRL2 ://1
481      case PTM_6840_STATUS:
472482      {
473483         PLOG(("%06X: MC6840 #%d: Status read = %04X\n", activecpu_get_previouspc(), which, currptr->status_reg));
474484         currptr->status_read_since_int |= currptr->status_reg & 0x07;
r2241r2242
476486         break;
477487      }
478488
479      case PTM_6840_MSBBUF1://2
480      case PTM_6840_MSBBUF2://4
481      case PTM_6840_MSBBUF3://6
489      case PTM_6840_MSBBUF1:
490      case PTM_6840_MSBBUF2:
491      case PTM_6840_MSBBUF3:
482492      {
483         int idx = (offset - 2)/2;
493         int idx = (offset - 2) / 2;
484494         int result = compute_counter(which, idx);
485495
486         /* clear the interrupt if the status has been read */
496         /* Clear the interrupt if the status has been read */
487497         if (currptr->status_read_since_int & (1 << idx))
488498         {
489499            currptr->status_reg &= ~(1 << idx);
r2241r2242
497507         break;
498508      }
499509
500      case PTM_6840_LSB1://3
501      case PTM_6840_LSB2://5
502      case PTM_6840_LSB3://7
510      case PTM_6840_LSB1:
511      case PTM_6840_LSB2:
512      case PTM_6840_LSB3:
503513      {
504514         val = currptr->lsb_buffer;
505515         break;
r2241r2242
531541
532542   switch ( offset )
533543   {
534      case PTM_6840_CTRL1 ://0
535      case PTM_6840_CTRL2 ://1
544      case PTM_6840_CTRL1:
545      case PTM_6840_CTRL2:
536546      {
537547         idx = (offset == 1) ? 1 : (currptr->control_reg[1] & 0x01) ? 0 : 2;
538548         diffs = data ^ currptr->control_reg[idx];
539549         currptr->t3_divisor = (currptr->control_reg[2] & 0x01) ? 8 : 1;
540         currptr->mode[idx] = (data>>3)&0x07;
550         currptr->mode[idx] = (data >> 3) & 0x07;
541551         currptr->control_reg[idx] = data;
542552
543         PLOG(("MC6840 #%d : Control register %d selected\n",which,idx));
553         PLOG(("MC6840 #%d : Control register %d selected\n", which, idx));
544554         PLOG(("operation mode   = %s\n", opmode[ currptr->mode[idx] ]));
545555         PLOG(("value            = %04X\n", currptr->control_reg[idx]));
546556         PLOG(("t3divisor        = %d\n", currptr->t3_divisor));
547557
548558         if (!(currptr->control_reg[idx] & 0x80 ))
549         { // output cleared
559         {
560            /* Output cleared */
550561            if ( currptr->intf )
551562            {
552               if ( currptr->intf->out_func[idx] ) currptr->intf->out_func[idx](Machine, 0, 0);
563               if ( currptr->intf->out_func[idx] )
564                  currptr->intf->out_func[idx](Machine, 0, 0);
553565            }
554566         }
555         /* reset? */
567         /* Reset? */
556568         if (idx == 0 && (diffs & 0x01))
557569         {
558            /* holding reset down */
570            /* Holding reset down */
559571            if (data & 0x01)
560572            {
561               PLOG(("MC6840 #%d : Timer reset\n",which));
573               PLOG(("MC6840 #%d : Timer reset\n", which));
562574               for (i = 0; i < 3; i++)
563575               {
564                  timer_enable(currptr->timer[i],FALSE);
565                  currptr->enabled[i]=0;
576                  timer_enable(currptr->timer[i], FALSE);
577                  currptr->enabled[i] = 0;
566578               }
567579            }
568
569            /* releasing reset */
580            /* Releasing reset */
570581            else
571582            {
572583               for (i = 0; i < 3; i++)
573               {
574                  reload_count(which,i);
575               }
584                  reload_count(which, i);
576585            }
577586
578587            currptr->status_reg = 0;
579588            update_interrupts(which);
580589
581            /* changing the clock source? (e.g. Zwackery) */
590            /* Changing the clock source? (e.g. Zwackery) */
582591            if (diffs & 0x02)
583               reload_count(which,idx);
592               reload_count(which, idx);
584593         }
585594         break;
586595      }
587596
588      /* offsets 2, 4, and 6 are MSB buffer registers */
589      case PTM_6840_MSBBUF1://2
590      case PTM_6840_MSBBUF2://4
591      case PTM_6840_MSBBUF3://6
597      case PTM_6840_MSBBUF1:
598      case PTM_6840_MSBBUF2:
599      case PTM_6840_MSBBUF3:
592600      {
593         PLOG(("MC6840 #%d msbbuf%d = %02X\n", which, offset/2, data));
601         PLOG(("MC6840 #%d msbbuf%d = %02X\n", which, offset / 2, data));
594602         currptr->msb_buffer = data;
595603         break;
596604      }
597605
598      /* offsets 3, 5, and 7 are Write Timer Latch commands */
599
600      case PTM_6840_LSB1://3
601      case PTM_6840_LSB2://5
602      case PTM_6840_LSB3://7
606      case PTM_6840_LSB1:
607      case PTM_6840_LSB2:
608      case PTM_6840_LSB3:
603609      {
604         idx = (offset - 3)/2;
610         idx = (offset - 3) / 2;
605611         currptr->latch[idx] = (currptr->msb_buffer << 8) | (data & 0xff);
606         /* clear the interrupt */
612
613         /* Clear the interrupt */
607614         currptr->status_reg &= ~(1 << idx);
608615         update_interrupts(which);
609         /* reload the count if in an appropriate mode */
616
617         /* Reload the count if in an appropriate mode */
610618         if (!(currptr->control_reg[idx] & 0x10))
611         {
612619            reload_count(which,idx);
613         }
620
614621         PLOG(("%06X:MC6840 #%d: Counter %d latch = %04X\n", activecpu_get_previouspc(), which, idx, currptr->latch[idx]));
615622         break;
616623      }
r2241r2242
627634{
628635   ptm6840 *p = ptm + which;
629636
630   PLOG(("**ptm6840 %d t%d timeout**\n", which, idx+1));
637   PLOG(("**ptm6840 %d t%d timeout**\n", which, idx + 1));
631638
632639   if ( p->control_reg[idx] & 0x40 )
633   { // interrupt enabled
640   {
641      /* Interrupt enabled */
634642      p->status_reg |= (1 << idx);
635643      p->status_read_since_int &= ~(1 << idx);
636644      update_interrupts(which);
637645   }
638646
639647   if ( p->control_reg[idx] & 0x80 )
640   { // output enabled
648   {
649      /* Output enabled */
641650      if ( p->intf )
642651      {
643652         if ((p->mode[idx] == 0)||(p->mode[idx] == 2))
644653         {
645654            p->output[idx] = p->output[idx]?0:1;
646            PLOG(("**ptm6840 %d t%d output %d **\n", which, idx+1, p->output[idx]));
647            if ( p->intf->out_func[idx] ) p->intf->out_func[idx](Machine, 0, p->output[idx]);
655            PLOG(("**ptm6840 %d t%d output %d **\n", which, idx + 1, p->output[idx]));
656
657            if ( p->intf->out_func[idx] )
658               p->intf->out_func[idx](Machine, 0, p->output[idx]);
648659         }
649660         if ((p->mode[idx] == 4)||(p->mode[idx] == 6))
650661         {
651662            if (!p->fired[idx])
652663            {
653664               p->output[idx] = 1;
654               PLOG(("**ptm6840 %d t%d output %d **\n", which, idx+1, p->output[idx]));
655               if ( p->intf->out_func[idx] ) p->intf->out_func[idx](Machine, 0, p->output[idx]);
656               p->fired[idx]=1;//no changes in output until reinit
665               PLOG(("**ptm6840 %d t%d output %d **\n", which, idx + 1, p->output[idx]));
666
667               if ( p->intf->out_func[idx] )
668                  p->intf->out_func[idx](Machine, 0, p->output[idx]);
669
670               /* No changes in output until reinit */
671               p->fired[idx] = 1;
657672            }
658673         }
659674      }
660675   }
661676   p->enabled[idx]= 0;
662   reload_count(which,idx);
677   reload_count(which, idx);
663678}
664679
665680static TIMER_CALLBACK( ptm6840_t1_timeout ) { ptm6840_timeout(param, 0); }
r2241r2242
676691{
677692   ptm6840 *p = ptm + which;
678693
679   if ((p->mode[idx] == 0)||(p->mode[idx] == 2)||(p->mode[0] == 4)||(p->mode[idx] == 6))
694   if ( (p->mode[idx] == 0) || (p->mode[idx] == 2) || (p->mode[0] == 4) || (p->mode[idx] == 6) )
680695   {
681696      if (state == 0 && p->gate[idx])
682      reload_count(which,idx);
697         reload_count(which,idx);
683698   }
684699   p->gate[idx] = state;
685700}
r2241r2242
702717
703718   if (!(p->control_reg[idx] & 0x02))
704719   {
705      if (state) ptm_tick(which,idx,1);
720      if (state)
721         ptm_tick(which, idx, 1);
706722   }
707723}
708724
r2241r2242
733749      if (!currptr->intf->external_clock[counter])
734750      {
735751         currptr->enabled[counter] = 0;
736         timer_enable(currptr->timer[counter],FALSE);
752         timer_enable(currptr->timer[counter], FALSE);
737753      }
738754   }
739755   else
r2241r2242
741757      int count;
742758      attotime duration;
743759
744      /* determine the number of clock periods before we expire */
760      /* Determine the number of clock periods before we expire */
745761      count = currptr->counter[counter];
762
746763      if (currptr->control_reg[counter] & 0x04)
747      count = ((count >> 8) + 1) * ((count & 0xff) + 1);
764         count = ((count >> 8) + 1) * ((count & 0xff) + 1);
748765      else
749      count = count + 1;
766         count = count + 1;
750767
751768      duration = attotime_mul(ATTOTIME_IN_HZ(clock), count);
752      if (counter == 2) duration = attotime_mul(duration, currptr->t3_divisor);
769
770      if (counter == 2)
771         duration = attotime_mul(duration, currptr->t3_divisor);
772
753773      currptr->enabled[counter] = 1;
754774      timer_adjust_oneshot(currptr->timer[counter], duration, which);
755      timer_enable(currptr->timer[counter],TRUE);
775      timer_enable(currptr->timer[counter], TRUE);
756776   }
757777}
758778
r2241r2242
784804WRITE8_HANDLER( ptm6840_2_w ) { ptm6840_write(2, offset, data); }
785805WRITE8_HANDLER( ptm6840_3_w ) { ptm6840_write(3, offset, data); }
786806
787READ16_HANDLER( ptm6840_0_msb_r ) { return ptm6840_read(0, offset); }
788READ16_HANDLER( ptm6840_1_msb_r ) { return ptm6840_read(1, offset); }
789READ16_HANDLER( ptm6840_2_msb_r ) { return ptm6840_read(2, offset); }
790READ16_HANDLER( ptm6840_3_msb_r ) { return ptm6840_read(3, offset); }
807READ16_HANDLER( ptm6840_0_msb_r ) { return ptm6840_read(0, offset) << 8; }
808READ16_HANDLER( ptm6840_1_msb_r ) { return ptm6840_read(1, offset) << 8; }
809READ16_HANDLER( ptm6840_2_msb_r ) { return ptm6840_read(2, offset) << 8; }
810READ16_HANDLER( ptm6840_3_msb_r ) { return ptm6840_read(3, offset) << 8; }
791811
792WRITE16_HANDLER( ptm6840_0_msb_w ) { if (ACCESSING_MSB) ptm6840_write(0, offset, (data >> 8) & 0xff); }
793WRITE16_HANDLER( ptm6840_1_msb_w ) { if (ACCESSING_MSB) ptm6840_write(1, offset, (data >> 8) & 0xff); }
794WRITE16_HANDLER( ptm6840_2_msb_w ) { if (ACCESSING_MSB) ptm6840_write(2, offset, (data >> 8) & 0xff); }
795WRITE16_HANDLER( ptm6840_3_msb_w ) { if (ACCESSING_MSB) ptm6840_write(3, offset, (data >> 8) & 0xff); }
812WRITE16_HANDLER( ptm6840_0_msb_w ) { if (ACCESSING_BITS_8_15) ptm6840_write(0, offset, data >> 8); }
813WRITE16_HANDLER( ptm6840_1_msb_w ) { if (ACCESSING_BITS_8_15) ptm6840_write(1, offset, data >> 8); }
814WRITE16_HANDLER( ptm6840_2_msb_w ) { if (ACCESSING_BITS_8_15) ptm6840_write(2, offset, data >> 8); }
815WRITE16_HANDLER( ptm6840_3_msb_w ) { if (ACCESSING_BITS_8_15) ptm6840_write(3, offset, data >> 8); }
796816
797READ16_HANDLER( ptm6840_0_lsb_r ) { return ptm6840_read(0, offset << 8 | 0x00ff); }
798READ16_HANDLER( ptm6840_1_lsb_r ) { return ptm6840_read(1, offset << 8 | 0x00ff); }
799READ16_HANDLER( ptm6840_2_lsb_r ) { return ptm6840_read(2, offset << 8 | 0x00ff); }
800READ16_HANDLER( ptm6840_3_lsb_r ) { return ptm6840_read(3, offset << 8 | 0x00ff); }
817READ16_HANDLER( ptm6840_0_lsb_r ) { return ptm6840_read(0, offset); }
818READ16_HANDLER( ptm6840_1_lsb_r ) { return ptm6840_read(1, offset); }
819READ16_HANDLER( ptm6840_2_lsb_r ) { return ptm6840_read(2, offset); }
820READ16_HANDLER( ptm6840_3_lsb_r ) { return ptm6840_read(3, offset); }
801821
802WRITE16_HANDLER( ptm6840_0_lsb_w ) {if (ACCESSING_LSB) ptm6840_write(0, offset, data & 0xff);}
803WRITE16_HANDLER( ptm6840_1_lsb_w ) {if (ACCESSING_LSB) ptm6840_write(1, offset, data & 0xff);}
804WRITE16_HANDLER( ptm6840_2_lsb_w ) {if (ACCESSING_LSB) ptm6840_write(2, offset, data & 0xff);}
805WRITE16_HANDLER( ptm6840_3_lsb_w ) {if (ACCESSING_LSB) ptm6840_write(3, offset, data & 0xff);}
822WRITE16_HANDLER( ptm6840_0_lsb_w ) { if (ACCESSING_BITS_0_7) ptm6840_write(0, offset, data & 0xff); }
823WRITE16_HANDLER( ptm6840_1_lsb_w ) { if (ACCESSING_BITS_0_7) ptm6840_write(1, offset, data & 0xff); }
824WRITE16_HANDLER( ptm6840_2_lsb_w ) { if (ACCESSING_BITS_0_7) ptm6840_write(2, offset, data & 0xff); }
825WRITE16_HANDLER( ptm6840_3_lsb_w ) { if (ACCESSING_BITS_0_7) ptm6840_write(3, offset, data & 0xff); }
src/emu/machine/at28c16.c
r2241r2242
150150static UINT16 at28c16_16msb_read( UINT32 chip, offs_t offset, UINT32 mem_mask )
151151{
152152   UINT32 data = 0;
153   if( ACCESSING_MSB16 )
153   if( ACCESSING_BITS_8_15 )
154154   {
155155      data |= at28c16_read( chip, offset ) << 8;
156156   }
r2241r2242
159159
160160static void at28c16_16msb_write( UINT32 chip, offs_t offset, UINT32 data, UINT32 mem_mask )
161161{
162   if( ACCESSING_MSB16 )
162   if( ACCESSING_BITS_8_15 )
163163   {
164164      at28c16_write( chip, offset, data >> 8 );
165165   }
r2241r2242
179179static UINT32 at28c16_32le_read( UINT32 chip, offs_t offset, UINT32 mem_mask )
180180{
181181   UINT32 data = 0;
182   if( ACCESSING_LSB32 )
182   if( ACCESSING_BITS_0_7 )
183183   {
184184      data |= at28c16_read( chip, ( offset * 4 ) + 0 ) << 0;
185185   }
186   if( ( mem_mask & 0x0000ff00 ) == 0 )
186   if( ACCESSING_BITS_8_15 )
187187   {
188188      data |= at28c16_read( chip, ( offset * 4 ) + 1 ) << 8;
189189   }
190   if( ( mem_mask & 0x00ff0000 ) == 0 )
190   if( ACCESSING_BITS_16_23 )
191191   {
192192      data |= at28c16_read( chip, ( offset * 4 ) + 2 ) << 16;
193193   }
194   if( ACCESSING_MSB32 )
194   if( ACCESSING_BITS_24_31 )
195195   {
196196      data |= at28c16_read( chip, ( offset * 4 ) + 3 ) << 24;
197197   }
r2241r2242
200200
201201static void at28c16_32le_write( UINT32 chip, offs_t offset, UINT32 data, UINT32 mem_mask )
202202{
203   if( ACCESSING_LSB32 )
203   if( ACCESSING_BITS_0_7 )
204204   {
205205      at28c16_write( chip, ( offset * 4 ) + 0, data >> 0 );
206206   }
207   if( ( mem_mask & 0x0000ff00 ) == 0 )
207   if( ACCESSING_BITS_8_15 )
208208   {
209209      at28c16_write( chip, ( offset * 4 ) + 1, data >> 8 );
210210   }
211   if( ( mem_mask & 0x00ff0000 ) == 0 )
211   if( ACCESSING_BITS_16_23 )
212212   {
213213      at28c16_write( chip, ( offset * 4 ) + 2, data >> 16 );
214214   }
215   if( ACCESSING_MSB32 )
215   if( ACCESSING_BITS_24_31 )
216216   {
217217      at28c16_write( chip, ( offset * 4 ) + 3, data >> 24 );
218218   }
r2241r2242
230230static UINT32 at28c16_32le_16lsb_read( UINT32 chip, offs_t offset, UINT32 mem_mask )
231231{
232232   UINT32 data = 0;
233   if( ACCESSING_LSB32 )
233   if( ACCESSING_BITS_0_7 )
234234   {
235235      data |= at28c16_read( chip, ( offset * 2 ) + 0 ) << 0;
236236   }
237   if( ( mem_mask & 0x00ff0000 ) == 0 )
237   if( ACCESSING_BITS_16_23 )
238238   {
239239      data |= at28c16_read( chip, ( offset * 2 ) + 1 ) << 16;
240240   }
r2241r2242
243243
244244static void at28c16_32le_16lsb_write( UINT32 chip, offs_t offset, UINT32 data, UINT32 mem_mask )
245245{
246   if( ACCESSING_LSB32 )
246   if( ACCESSING_BITS_0_7 )
247247   {
248248      at28c16_write( chip, ( offset * 2 ) + 0, data >> 0 );
249249   }
250   if( ( mem_mask & 0x00ff0000 ) == 0 )
250   if( ACCESSING_BITS_16_23 )
251251   {
252252      at28c16_write( chip, ( offset * 2 ) + 1, data >> 16 );
253253   }
src/emu/machine/generic.c
r2241r2242
484484
485485   /* create a name */
486486   memcard_name(memcard_inserted, name);
487   fname = astring_assemble_3(astring_alloc(), Machine->basename, PATH_SEPARATOR, name);
487   fname = astring_assemble_3(astring_alloc(), machine->basename, PATH_SEPARATOR, name);
488488
489489   /* open the file; if we can't, it's an error */
490490   filerr = mame_fopen(SEARCHPATH_MEMCARD, astring_c(fname), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS, &file);
r2241r2242
684684    8-bit reset read/write handlers
685685-------------------------------------------------*/
686686
687WRITE8_HANDLER( watchdog_reset_w ) { watchdog_reset(Machine); }
688READ8_HANDLER( watchdog_reset_r ) { watchdog_reset(Machine); return 0xff; }
687WRITE8_HANDLER( watchdog_reset_w ) { watchdog_reset(machine); }
688READ8_HANDLER( watchdog_reset_r ) { watchdog_reset(machine); return 0xff; }
689689
690690
691691/*-------------------------------------------------
692692    16-bit reset read/write handlers
693693-------------------------------------------------*/
694694
695WRITE16_HANDLER( watchdog_reset16_w ) {   watchdog_reset(Machine); }
696READ16_HANDLER( watchdog_reset16_r ) { watchdog_reset(Machine); return 0xffff; }
695WRITE16_HANDLER( watchdog_reset16_w ) {   watchdog_reset(machine); }
696READ16_HANDLER( watchdog_reset16_r ) { watchdog_reset(machine); return 0xffff; }
697697
698698
699699/*-------------------------------------------------
700700    32-bit reset read/write handlers
701701-------------------------------------------------*/
702702
703WRITE32_HANDLER( watchdog_reset32_w ) {   watchdog_reset(Machine); }
704READ32_HANDLER( watchdog_reset32_r ) { watchdog_reset(Machine); return 0xffffffff; }
703WRITE32_HANDLER( watchdog_reset32_w ) {   watchdog_reset(machine); }
704READ32_HANDLER( watchdog_reset32_r ) { watchdog_reset(machine); return 0xffffffff; }
705705
706706
707707
src/emu/machine/smc91c9x.c
r2241r2242
418418   switch (offset)
419419   {
420420      case EREG_PNR_ARR:
421         if (!(mem_mask & 0xff00))
421         if (ACCESSING_BITS_8_15)
422422         {
423423            ethernet.reg[EREG_INTERRUPT] &= ~0x0008;
424424            update_ethernet_irq();
r2241r2242
431431         UINT8 *buffer = (ethernet.reg[EREG_POINTER] & 0x8000) ? ethernet.rx : ethernet.tx;
432432         int addr = ethernet.reg[EREG_POINTER] & 0x7ff;
433433         result = buffer[addr++];
434         if (!(mem_mask & 0xff00))
434         if (ACCESSING_BITS_8_15)
435435            result |= buffer[addr++] << 8;
436436         if (ethernet.reg[EREG_POINTER] & 0x4000)
437437            ethernet.reg[EREG_POINTER] = (ethernet.reg[EREG_POINTER] & ~0x7ff) | (addr & 0x7ff);
r2241r2242
549549         UINT8 *buffer = (ethernet.reg[EREG_POINTER] & 0x8000) ? ethernet.rx : ethernet.tx;
550550         int addr = ethernet.reg[EREG_POINTER] & 0x7ff;
551551         buffer[addr++] = data;
552         if (!(mem_mask & 0xff00))
552         if (ACCESSING_BITS_8_15)
553553            buffer[addr++] = data >> 8;
554554         if (ethernet.reg[EREG_POINTER] & 0x4000)
555555            ethernet.reg[EREG_POINTER] = (ethernet.reg[EREG_POINTER] & ~0x7ff) | (addr & 0x7ff);
src/emu/machine/tmp68301.c
r2241r2242
155155{
156156   COMBINE_DATA(&tmp68301_regs[offset]);
157157
158   if (!ACCESSING_LSB)   return;
158   if (!ACCESSING_BITS_0_7)   return;
159159
160160//  logerror("CPU #0 PC %06X: TMP68301 Reg %04X<-%04X & %04X\n",activecpu_get_pc(),offset*2,data,mem_mask^0xffff);
161161
src/emu/inptport.h
r2241r2242
324324   INPUT_TOKEN_START_TAG,
325325   INPUT_TOKEN_MODIFY,
326326   INPUT_TOKEN_BIT,
327   INPUT_TOKEN_SPECIAL_ONOFF,
327328   INPUT_TOKEN_CODE,
328329   INPUT_TOKEN_CODE_DEC,
329330   INPUT_TOKEN_CODE_INC,
r2241r2242
685686   TOKEN_STRING(_tag),
686687
687688/* input bit definition */
688#define PORT_BIT(_mask,_default,_type) \
689#define PORT_BIT(_mask, _default, _type) \
689690   TOKEN_UINT32_PACK2(INPUT_TOKEN_BIT, 8, _type, 24), \
690691   TOKEN_UINT64_PACK2(_mask, 32, _default, 32),
691692
693#define PORT_SPECIAL_ONOFF(_mask, _default, _strindex) \
694   TOKEN_UINT32_PACK3(INPUT_TOKEN_SPECIAL_ONOFF, 8, FALSE, 1, INPUT_STRING_##_strindex, 23), \
695   TOKEN_UINT64_PACK2(_mask, 32, _default, 32),
696
697#define PORT_SPECIAL_ONOFF_DIPLOC(_mask, _default, _strindex, _diploc) \
698   TOKEN_UINT32_PACK3(INPUT_TOKEN_SPECIAL_ONOFF, 8, TRUE, 1, INPUT_STRING_##_strindex, 23), \
699   TOKEN_UINT64_PACK2(_mask, 32, _default, 32), \
700   TOKEN_STRING(_diploc),
701
692702/* append a code */
693703#define PORT_CODE(_code) \
694704   TOKEN_UINT64_PACK2(INPUT_TOKEN_CODE, 8, _code, 32),
r2241r2242
743753
744754/* analog settings */
745755/* if this macro is not used, the minimum defaluts to 0 and maximum defaults to the mask value */
746#define PORT_MINMAX(_min,_max) \
756#define PORT_MINMAX(_min, _max) \
747757   TOKEN_UINT32_PACK1(INPUT_TOKEN_MINMAX, 8), \
748758   TOKEN_UINT64_PACK2(_min, 32, _max, 32),
749759
r2241r2242
798808   TOKEN_PTR(voidptr, _param),
799809
800810/* dip switch definition */
801#define PORT_DIPNAME(_mask,_default,_name) \
811#define PORT_DIPNAME(_mask, _default, _name) \
802812   TOKEN_UINT32_PACK1(INPUT_TOKEN_DIPNAME, 8), \
803813   TOKEN_UINT64_PACK2(_mask, 32, _default, 32), \
804814   TOKEN_STRING(_name),
805815
806#define PORT_DIPSETTING(_default,_name) \
816#define PORT_DIPSETTING(_default, _name) \
807817   TOKEN_UINT64_PACK2(INPUT_TOKEN_DIPSETTING, 8, _default, 32), \
808818   TOKEN_STRING(_name),
809819
r2241r2242
814824   TOKEN_STRING(_location),
815825
816826/* conditionals for dip switch settings */
817#define PORT_CONDITION(_tag,_mask,_condition,_value) \
827#define PORT_CONDITION(_tag, _mask, _condition, _value) \
818828   TOKEN_UINT32_PACK2(INPUT_TOKEN_CONDITION, 8, _condition, 24), \
819829   TOKEN_UINT64_PACK2(_mask, 32, _value, 32), \
820830   TOKEN_STRING(_tag),
821831
822832/* analog adjuster definition */
823#define PORT_ADJUSTER(_default,_name) \
833#define PORT_ADJUSTER(_default, _name) \
824834   TOKEN_UINT64_PACK2(INPUT_TOKEN_ADJUSTER, 8, _default, 32), \
825835   TOKEN_STRING(_name),
826836
827837/* config definition */
828#define PORT_CONFNAME(_mask,_default,_name) \
838#define PORT_CONFNAME(_mask, _default, _name) \
829839   TOKEN_UINT32_PACK1(INPUT_TOKEN_CONFNAME, 8), \
830840   TOKEN_UINT64_PACK2(_mask, 32, _default, 32), \
831841   TOKEN_STRING(_name),
832842
833#define PORT_CONFSETTING(_default,_name) \
843#define PORT_CONFSETTING(_default, _name) \
834844   TOKEN_UINT64_PACK2(INPUT_TOKEN_CONFSETTING, 8, _default, 32), \
835845   TOKEN_STRING(_name),
836846
r2241r2242
843853#define PORT_CATEGORY(_category) \
844854   TOKEN_UINT32_PACK2(INPUT_TOKEN_CHAR, 8, _category, 24),
845855
846#define PORT_CATEGORY_CLASS(_mask,_default,_name) \
856#define PORT_CATEGORY_CLASS(_mask, _default, _name) \
847857   TOKEN_UINT32_PACK1(INPUT_TOKEN_CATEGORY_NAME, 8), \
848858   TOKEN_UINT64_PACK2(_mask, 32, _default, 32), \
849859   TOKEN_STRING(_name),
850860
851#define PORT_CATEGORY_ITEM(_default,_name,_category) \
861#define PORT_CATEGORY_ITEM(_default, _name, _category) \
852862   TOKEN_UINT64_PACK3(INPUT_TOKEN_CATEGORY_SETTING, 8, _default, 32, _category, 16), \
853863   TOKEN_STRING(_name),
854864#endif /* MESS */
r2241r2242
859869    HELPER MACROS
860870***************************************************************************/
861871
862#define PORT_SERVICE_DIPLOC(mask,default,loc)   \
863   PORT_BIT(    mask, mask & default, IPT_DIPSWITCH_NAME ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2) PORT_TOGGLE PORT_DIPLOCATION(loc)   \
864   PORT_DIPSETTING(    mask & default, DEF_STR( Off ) )   \
865   PORT_DIPSETTING(    mask &~default, DEF_STR( On ) )
872#define PORT_DIPUNUSED_DIPLOC(_mask, _default, _diploc) \
873   PORT_SPECIAL_ONOFF_DIPLOC(_mask, _default, Unused, _diploc)
866874
867#define PORT_SERVICE(mask,default)   \
868   PORT_BIT(    mask, mask & default, IPT_DIPSWITCH_NAME ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2) PORT_TOGGLE   \
869   PORT_DIPSETTING(    mask & default, DEF_STR( Off ) )   \
870   PORT_DIPSETTING(    mask &~default, DEF_STR( On ) )
875#define PORT_DIPUNUSED(_mask, _default) \
876   PORT_SPECIAL_ONOFF(_mask, _default, Unused)
871877
872#define PORT_SERVICE_NO_TOGGLE(mask,default)   \
873   PORT_BIT(    mask, mask & default, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode ))
878#define PORT_DIPUNKNOWN_DIPLOC(_mask, _default, _diploc) \
879   PORT_SPECIAL_ONOFF_DIPLOC(_mask, _default, Unknown, _diploc)
874880
875#define PORT_DIPUNUSED_DIPLOC(mask,default,loc)   \
876   PORT_BIT(    mask, mask & default, IPT_DIPSWITCH_NAME ) PORT_NAME( DEF_STR( Unused )) PORT_DIPLOCATION(loc)   \
877   PORT_DIPSETTING(    mask & default, DEF_STR( Off ) )   \
878   PORT_DIPSETTING(    mask &~default, DEF_STR( On ) )
881#define PORT_DIPUNKNOWN(_mask, _default) \
882   PORT_SPECIAL_ONOFF(_mask, _default, Unknown)
879883
880#define PORT_DIPUNUSED(mask,default)   \
881   PORT_BIT(    mask, mask & default, IPT_DIPSWITCH_NAME ) PORT_NAME( DEF_STR( Unused )) \
882   PORT_DIPSETTING(    mask & default, DEF_STR( Off ) )   \
883   PORT_DIPSETTING(    mask &~default, DEF_STR( On ) )
884#define PORT_SERVICE_DIPLOC(_mask, _default, _diploc) \
885   PORT_SPECIAL_ONOFF_DIPLOC(_mask, _default, Service_Mode, _diploc)
884886
885#define PORT_DIPUNKNOWN_DIPLOC(mask,default,loc)   \
886   PORT_BIT(    mask, mask & default, IPT_DIPSWITCH_NAME ) PORT_NAME( DEF_STR( Unknown )) PORT_DIPLOCATION(loc)   \
887   PORT_DIPSETTING(    mask & default, DEF_STR( Off ) )   \
888   PORT_DIPSETTING(    mask &~default, DEF_STR( On ) )
887#define PORT_SERVICE(_mask, _default) \
888   PORT_SPECIAL_ONOFF(_mask, _default, Service_Mode)
889889
890#define PORT_DIPUNKNOWN(mask,default)   \
891   PORT_BIT(    mask, mask & default, IPT_DIPSWITCH_NAME ) PORT_NAME( DEF_STR( Unknown )) \
892   PORT_DIPSETTING(    mask & default, DEF_STR( Off ) )   \
893   PORT_DIPSETTING(    mask &~default, DEF_STR( On ) )
890#define PORT_SERVICE_NO_TOGGLE(_mask, _default) \
891   PORT_BIT( _mask, _mask & _default, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode ))
894892
895893
896894
src/emu/sound/aicadsp.c
r2241r2242
2424   else
2525      val <<= 11;
2626   val >>= 11;
27   val &= 0x7FF;
2728   val |= sign << 15;
2829   val |= exponent << 11;
2930
r2241r2242
4041   mantissa = val & 0x7FF;
4142   uval = mantissa << 11;
4243   if (exponent > 11)
44   {
4345      exponent = 11;
46      uval |= sign << 22;
47   }
4448   else
4549      uval |= (sign ^ 1) << 22;
4650   uval |= sign << 23;
src/emu/sound/iremga20.c
r2241r2242
138138   int channel;
139139
140140   /* only low byte hooked up? */
141   if (!ACCESSING_LSB)
141   if (!ACCESSING_BITS_0_7)
142142      return;
143143
144144   //logerror("GA20:  Offset %02x, data %04x\n",offset,data);
src/emu/sound/disc_inp.c
r2241r2242
4242   {
4343      UINT8 *node_data = node->context;
4444
45      /* Bring the system up to now */
46      stream_update(info->discrete_stream);
47
4548      if ((node->module.type >= DSS_INPUT_DATA) && (node->module.type <= DSS_INPUT_PULSE))
4649      {
4750         data = *node_data;
r2241r2242
6366   {
6467      UINT8 *node_data = node->context;
6568      UINT8 last_data = *node_data;
69      UINT8 new_data = 0;
6670
6771      switch (node->module.type)
6872      {
6973         case DSS_INPUT_DATA:
70            *node_data = data;
74            new_data = data;
7175            break;
7276         case DSS_INPUT_LOGIC:
7377         case DSS_INPUT_PULSE:
74            *node_data = data ? 1 : 0;
78            new_data = data ? 1 : 0;
7579            break;
7680         case DSS_INPUT_NOT:
77            *node_data = data ? 0 : 1;
81            new_data = data ? 0 : 1;
7882            break;
7983      }
84      if (last_data != new_data)
85      {
86         /* Bring the system up to now */
87         stream_update(info->discrete_stream);
8088
81      /* Bring the system up to now */
82      if (last_data != *node_data)
83         stream_update(info->discrete_stream);
89         *node_data = new_data;
90      }
8491   }
8592   else
8693   {
r2241r2242
125132
126133         context->lastpval = rawportval;
127134         if (DSS_ADJUSTMENT__LOG == 0)
128            node->output = scaledval;
135            node->output[0] = scaledval;
129136         else
130            node->output = pow(10, scaledval);
137            node->output[0] = pow(10, scaledval);
131138      }
132139   }
133140   else
134141   {
135      node->output = 0;
142      node->output[0] = 0;
136143   }
137144}
138145
r2241r2242
186193
187194static void dss_constant_step(node_description *node)
188195{
189   node->output= DSS_CONSTANT__INIT;
196   node->output[0]= DSS_CONSTANT__INIT;
190197}
191198
192199
r2241r2242
204211{
205212   UINT8 *node_data = node->context;
206213
207   node->output = *node_data * DSS_INPUT__GAIN + DSS_INPUT__OFFSET;
214   node->output[0] = *node_data * DSS_INPUT__GAIN + DSS_INPUT__OFFSET;
208215}
209216
210217static void dss_input_reset(node_description *node)
r2241r2242
232239   UINT8 *node_data = node->context;
233240
234241   /* Set a valid output */
235   node->output = *node_data;
242   node->output[0] = *node_data;
236243   /* Reset the input to default for the next cycle */
237244   /* node order is now important */
238245   *node_data = DSS_INPUT__INIT;
r2241r2242
258265   stream_sample_t **ptr = node->context;
259266   stream_sample_t *data = *ptr;
260267
261   node->output = data ? (*data) * DSS_INPUT_STREAM__GAIN + DSS_INPUT_STREAM__OFFSET : 0;
268   node->output[0] = data ? (*data) * DSS_INPUT_STREAM__GAIN + DSS_INPUT_STREAM__OFFSET : 0;
262269}
263270
264271static void dss_input_stream_reset(node_description *node)
src/emu/sound/saa1099.c
r2241r2242
459459
460460WRITE16_HANDLER( saa1099_control_port_0_lsb_w )
461461{
462   if (ACCESSING_LSB)
462   if (ACCESSING_BITS_0_7)
463463      saa1099_control_port_w(0, offset, data & 0xff);
464464}
465465
466466WRITE16_HANDLER( saa1099_write_port_0_lsb_w )
467467{
468   if (ACCESSING_LSB)
468   if (ACCESSING_BITS_0_7)
469469      saa1099_write_port_w(0, offset, data & 0xff);
470470}
471471
472472WRITE16_HANDLER( saa1099_control_port_1_lsb_w )
473473{
474   if (ACCESSING_LSB)
474   if (ACCESSING_BITS_0_7)
475475      saa1099_control_port_w(1, offset, data & 0xff);
476476}
477477
478478WRITE16_HANDLER( saa1099_write_port_1_lsb_w )
479479{
480   if (ACCESSING_LSB)
480   if (ACCESSING_BITS_0_7)
481481      saa1099_write_port_w(1, offset, data & 0xff);
482482}
483483
src/emu/sound/ymz280b.c
r2241r2242
10021002WRITE16_HANDLER( YMZ280B_register_0_lsb_w )
10031003{
10041004   struct YMZ280BChip *chip = sndti_token(SOUND_YMZ280B, 0);
1005   if (ACCESSING_LSB)   chip->current_register = data & 0xff;
1005   if (ACCESSING_BITS_0_7)   chip->current_register = data & 0xff;
10061006}
10071007
10081008WRITE16_HANDLER( YMZ280B_register_0_msb_w )
10091009{
10101010   struct YMZ280BChip *chip = sndti_token(SOUND_YMZ280B, 0);
1011   if (ACCESSING_MSB)   chip->current_register = (data >> 8) & 0xff;
1011   if (ACCESSING_BITS_8_15)   chip->current_register = (data >> 8) & 0xff;
10121012}
10131013
10141014WRITE16_HANDLER( YMZ280B_register_1_lsb_w )
10151015{
10161016   struct YMZ280BChip *chip = sndti_token(SOUND_YMZ280B, 1);
1017   if (ACCESSING_LSB)   chip->current_register = data & 0xff;
1017   if (ACCESSING_BITS_0_7)   chip->current_register = data & 0xff;
10181018}
10191019
10201020WRITE16_HANDLER( YMZ280B_register_1_msb_w )
10211021{
10221022   struct YMZ280BChip *chip = sndti_token(SOUND_YMZ280B, 1);
1023   if (ACCESSING_MSB)   chip->current_register = (data >> 8) & 0xff;
1023   if (ACCESSING_BITS_8_15)   chip->current_register = (data >> 8) & 0xff;
10241024}
10251025
10261026/**********************************************************************************************
r2241r2242
10441044WRITE16_HANDLER( YMZ280B_data_0_lsb_w )
10451045{
10461046   struct YMZ280BChip *chip = sndti_token(SOUND_YMZ280B, 0);
1047   if (ACCESSING_LSB)   write_to_register(chip, data & 0xff);
1047   if (ACCESSING_BITS_0_7)   write_to_register(chip, data & 0xff);
10481048}
10491049
10501050WRITE16_HANDLER( YMZ280B_data_0_msb_w )
10511051{
10521052   struct YMZ280BChip *chip = sndti_token(SOUND_YMZ280B, 0);
1053   if (ACCESSING_MSB)   write_to_register(chip, (data >> 8) & 0xff);
1053   if (ACCESSING_BITS_8_15)   write_to_register(chip, (data >> 8) & 0xff);
10541054}
10551055
10561056WRITE16_HANDLER( YMZ280B_data_1_lsb_w )
10571057{
10581058   struct YMZ280BChip *chip = sndti_token(SOUND_YMZ280B, 1);
1059   if (ACCESSING_LSB)   write_to_register(chip, data & 0xff);
1059   if (ACCESSING_BITS_0_7)   write_to_register(chip, data & 0xff);
10601060}
10611061
10621062WRITE16_HANDLER( YMZ280B_data_1_msb_w )
10631063{
10641064   struct YMZ280BChip *chip = sndti_token(SOUND_YMZ280B, 1);
1065   if (ACCESSING_MSB)   write_to_register(chip, (data >> 8) & 0xff);
1065   if (ACCESSING_BITS_8_15)   write_to_register(chip, (data >> 8) & 0xff);
10661066}
10671067
10681068/**********************************************************************************************
src/emu/sound/scspdsp.c
r2241r2242
2424   else
2525      val <<= 11;
2626   val >>= 11;
27   val &= 0x7FF;
2728   val |= sign << 15;
2829   val |= exponent << 11;
2930
r2241r2242
4041   mantissa = val & 0x7FF;
4142   uval = mantissa << 11;
4243   if (exponent > 11)
44   {
4345      exponent = 11;
46      uval |= sign << 22;
47   }
4448   else
4549      uval |= (sign ^ 1) << 22;
4650   uval |= sign << 23;
src/emu/sound/disc_mth.c
r2241r2242
167167{
168168   if(DST_ADDER__ENABLE)
169169   {
170      node->output = DST_ADDER__IN0 + DST_ADDER__IN1 + DST_ADDER__IN2 + DST_ADDER__IN3;
170      node->output[0] = DST_ADDER__IN0 + DST_ADDER__IN1 + DST_ADDER__IN2 + DST_ADDER__IN3;
171171   }
172172   else
173173   {
174      node->output=0;
174      node->output[0]=0;
175175   }
176176}
177177
r2241r2242
200200      switch (info->type)
201201      {
202202         case DISC_COMP_P_CAPACITOR:
203            node->output = info->cDefault;
203            node->output[0] = info->cDefault;
204204            for(bit=0; bit < info->length; bit++)
205205            {
206               if (DST_COMP_ADDER__SELECT & (1 << bit)) node->output += info->c[bit];
206               if (DST_COMP_ADDER__SELECT & (1 << bit)) node->output[0] += info->c[bit];
207207            }
208208            break;
209209         case DISC_COMP_P_RESISTOR:
210            node->output = info->cDefault ? 1.0 / info->cDefault : 0;
210            node->output[0] = info->cDefault ? 1.0 / info->cDefault : 0;
211211            for(bit=0; bit < info->length; bit++)
212212            {
213               if (DST_COMP_ADDER__SELECT & (1 << bit)) node->output += 1.0 / info->c[bit];
213               if (DST_COMP_ADDER__SELECT & (1 << bit)) node->output[0] += 1.0 / info->c[bit];
214214            }
215            if (node->output != 0) node->output = 1.0 / node->output;
215            if (node->output[0] != 0) node->output[0] = 1.0 / node->output[0];
216216            break;
217217      }
218218   }
219219   else
220220   {
221      node->output = 0;
221      node->output[0] = 0;
222222   }
223223}
224224
r2241r2242
244244{
245245   if(DST_CLAMP__ENABLE)
246246   {
247      if(DST_CLAMP__IN < DST_CLAMP__MIN) node->output = DST_CLAMP__MIN;
248      else if(DST_CLAMP__IN > DST_CLAMP__MAX) node->output = DST_CLAMP__MAX;
249      else node->output= DST_CLAMP__IN;
247      if(DST_CLAMP__IN < DST_CLAMP__MIN) node->output[0] = DST_CLAMP__MIN;
248      else if(DST_CLAMP__IN > DST_CLAMP__MAX) node->output[0] = DST_CLAMP__MAX;
249      else node->output[0]= DST_CLAMP__IN;
250250   }
251251   else
252252   {
253      node->output = DST_CLAMP__CLAMP;
253      node->output[0] = DST_CLAMP__CLAMP;
254254   }
255255}
256256
r2241r2242
295295      v = i * context->rTotal;
296296
297297      /* Filter if needed, else just output voltage */
298      node->output = info->cFilter ? node->output + ((v - node->output) * context->exponent) : v;
298      node->output[0] = info->cFilter ? node->output[0] + ((v - node->output[0]) * context->exponent) : v;
299299   }
300300   else
301301   {
r2241r2242
350350   if (info->rGnd) context->rTotal += 1.0 / info->rGnd;
351351   context->rTotal = 1.0 / context->rTotal;
352352
353   node->output = 0;
353   node->output[0] = 0;
354354
355355   if (info->cFilter)
356356   {
r2241r2242
388388      {
389389         if (DST_DIODE_MIX__INP(addr) > max) max = DST_DIODE_MIX__INP(addr);
390390      }
391      node->output = max - DST_DIODE_MIX__VJUNC;
392      if (node->output < 0) node->output = 0;
391      node->output[0] = max - DST_DIODE_MIX__VJUNC;
392      if (node->output[0] < 0) node->output[0] = 0;
393393   }
394394   else
395395   {
396      node->output = 0;
396      node->output[0] = 0;
397397   }
398398}
399399
r2241r2242
426426   {
427427      if(DST_DIVIDE__DIV == 0)
428428      {
429         node->output=DBL_MAX;   /* Max out but don't break */
430         discrete_log("dst_divider_step() - Divide by Zero attempted in NODE_%02d.\n",node->node-NODE_START);
429         node->output[0]=DBL_MAX;   /* Max out but don't break */
430         discrete_log("dst_divider_step() - Divide by Zero attempted in NODE_%02d.\n",NODE_INDEX(node->node));
431431      }
432432      else
433433      {
434         node->output= DST_DIVIDE__IN / DST_DIVIDE__DIV;
434         node->output[0]= DST_DIVIDE__IN / DST_DIVIDE__DIV;
435435      }
436436   }
437437   else
438438   {
439      node->output=0;
439      node->output[0]=0;
440440   }
441441}
442442
r2241r2242
460460{
461461   if(DST_GAIN__ENABLE)
462462   {
463      node->output = DST_GAIN__IN * DST_GAIN__GAIN;
464      node->output += DST_GAIN__OFFSET;
463      node->output[0] = DST_GAIN__IN * DST_GAIN__GAIN;
464      node->output[0] += DST_GAIN__OFFSET;
465465   }
466466   else
467467   {
468      node->output=0;
468      node->output[0]=0;
469469   }
470470}
471471
r2241r2242
535535            /* This forces the cap to completely charge,
536536                 * and the output to go to it's max value.
537537                 */
538            node->output = context->vMaxOut;
538            node->output[0] = context->vMaxOut;
539539            return;
540540         }
541         node->output -= context->change;
541         node->output[0] -= context->change;
542542         break;
543543
544544      case DISC_INTEGRATE_OP_AMP_1 | DISC_OP_AMP_IS_NORTON:
545545         iNeg = context->vMaxIn / info->r1;
546546         iPos = (DST_INTEGRATE__TRG0 - OP_AMP_NORTON_VBE) / info->r2;
547547         if (iPos < 0) iPos = 0;
548         node->output += (iPos - iNeg) / discrete_current_context->sample_rate / info->c;
548         node->output[0] += (iPos - iNeg) / discrete_current_context->sample_rate / info->c;
549549         break;
550550
551551      case DISC_INTEGRATE_OP_AMP_2 | DISC_OP_AMP_IS_NORTON:
r2241r2242
554554         iNeg = dst_trigger_function(trig0, trig1, 0, info->f0) ? context->vMaxInD / info->r1 : 0;
555555         iPos =  dst_trigger_function(trig0, trig1, 0, info->f1) ? context->vMaxIn / info->r2 : 0;
556556         iPos +=  dst_trigger_function(trig0, trig1, 0, info->f2) ? context->vMaxInD / info->r3 : 0;
557         node->output += (iPos - iNeg) / discrete_current_context->sample_rate / info->c;
557         node->output[0] += (iPos - iNeg) / discrete_current_context->sample_rate / info->c;
558558         break;
559559   }
560560
561561   /* Clip the output. */
562   if (node->output < 0) node->output = 0;
563   if (node->output > context->vMaxOut) node->output = context->vMaxOut;
562   if (node->output[0] < 0) node->output[0] = 0;
563   if (node->output[0] > context->vMaxOut) node->output[0] = context->vMaxOut;
564564}
565565
566566static void dst_integrate_reset(node_description *node)
r2241r2242
584584      i = v / info->r1;
585585      context->change = i / discrete_current_context->sample_rate / info->c;
586586   }
587   node->output = 0;
587   node->output[0] = 0;
588588}
589589
590590
r2241r2242
603603{
604604   if(DST_LOGIC_INV__ENABLE)
605605   {
606      node->output = DST_LOGIC_INV__IN ? 0.0 : 1.0;
606      node->output[0] = DST_LOGIC_INV__IN ? 0.0 : 1.0;
607607   }
608608   else
609609   {
610      node->output=0.0;
610      node->output[0]=0.0;
611611   }
612612}
613613
r2241r2242
632632{
633633   if(DST_LOGIC_AND__ENABLE)
634634   {
635      node->output= (DST_LOGIC_AND__IN0 && DST_LOGIC_AND__IN1 && DST_LOGIC_AND__IN2 && DST_LOGIC_AND__IN3)? 1.0 : 0.0;
635      node->output[0]= (DST_LOGIC_AND__IN0 && DST_LOGIC_AND__IN1 && DST_LOGIC_AND__IN2 && DST_LOGIC_AND__IN3)? 1.0 : 0.0;
636636   }
637637   else
638638   {
639      node->output=0.0;
639      node->output[0]=0.0;
640640   }
641641}
642642
r2241r2242
661661{
662662   if(DST_LOGIC_NAND__ENABLE)
663663   {
664      node->output= (DST_LOGIC_NAND__IN0 && DST_LOGIC_NAND__IN1 && DST_LOGIC_NAND__IN2 && DST_LOGIC_NAND__IN3)? 0.0 : 1.0;
664      node->output[0]= (DST_LOGIC_NAND__IN0 && DST_LOGIC_NAND__IN1 && DST_LOGIC_NAND__IN2 && DST_LOGIC_NAND__IN3)? 0.0 : 1.0;
665665   }
666666   else
667667   {
668      node->output=0.0;
668      node->output[0]=0.0;
669669   }
670670}
671671
r2241r2242
690690{
691691   if(DST_LOGIC_OR__ENABLE)
692692   {
693      node->output = (DST_LOGIC_OR__IN0 || DST_LOGIC_OR__IN1 || DST_LOGIC_OR__IN2 || DST_LOGIC_OR__IN3) ? 1.0 : 0.0;
693      node->output[0] = (DST_LOGIC_OR__IN0 || DST_LOGIC_OR__IN1 || DST_LOGIC_OR__IN2 || DST_LOGIC_OR__IN3) ? 1.0 : 0.0;
694694   }
695695   else
696696   {
697      node->output=0.0;
697      node->output[0]=0.0;
698698   }
699699}
700700
r2241r2242
719719{
720720   if(DST_LOGIC_NOR__ENABLE)
721721   {
722      node->output = (DST_LOGIC_NOR__IN0 || DST_LOGIC_NOR__IN1 || DST_LOGIC_NOR__IN2 || DST_LOGIC_NOR__IN3) ? 0.0 : 1.0;
722      node->output[0] = (DST_LOGIC_NOR__IN0 || DST_LOGIC_NOR__IN1 || DST_LOGIC_NOR__IN2 || DST_LOGIC_NOR__IN3) ? 0.0 : 1.0;
723723   }
724724   else
725725   {
726      node->output=0.0;
726      node->output[0]=0.0;
727727   }
728728}
729729
r2241r2242
744744{
745745   if(DST_LOGIC_XOR__ENABLE)
746746   {
747      node->output=((DST_LOGIC_XOR__IN0 && !DST_LOGIC_XOR__IN1) || (!DST_LOGIC_XOR__IN0 && DST_LOGIC_XOR__IN1)) ? 1.0 : 0.0;
747      node->output[0]=((DST_LOGIC_XOR__IN0 && !DST_LOGIC_XOR__IN1) || (!DST_LOGIC_XOR__IN0 && DST_LOGIC_XOR__IN1)) ? 1.0 : 0.0;
748748   }
749749   else
750750   {
751      node->output=0.0;
751      node->output[0]=0.0;
752752   }
753753}
754754
r2241r2242
769769{
770770   if(DST_LOGIC_XNOR__ENABLE)
771771   {
772      node->output=((DST_LOGIC_XNOR__IN0 && !DST_LOGIC_XNOR__IN1) || (!DST_LOGIC_XNOR__IN0 && DST_LOGIC_XNOR__IN1)) ? 0.0 : 1.0;
772      node->output[0]=((DST_LOGIC_XNOR__IN0 && !DST_LOGIC_XNOR__IN1) || (!DST_LOGIC_XNOR__IN0 && DST_LOGIC_XNOR__IN1)) ? 0.0 : 1.0;
773773   }
774774   else
775775   {
776      node->output=0.0;
776      node->output[0]=0.0;
777777   }
778778}
779779
r2241r2242
803803   if (DST_LOGIC_DFF__ENABLE)
804804   {
805805      if (DST_LOGIC_DFF__RESET)
806         node->output = 0;
806         node->output[0] = 0;
807807      else if (DST_LOGIC_DFF__SET)
808         node->output = 1;
808         node->output[0] = 1;
809809      else if (!context->last_clk && clk)   /* low to high */
810810      {
811         node->output = DST_LOGIC_DFF__DATA;
811         node->output[0] = DST_LOGIC_DFF__DATA;
812812      }
813813   }
814814   else
815815   {
816      node->output = 0;
816      node->output[0] = 0;
817817   }
818818   context->last_clk = clk;
819819}
r2241r2242
822822{
823823   struct dst_flipflop_context *context = node->context;
824824   context->last_clk = 0;
825   node->output = 0;
825   node->output[0] = 0;
826826}
827827
828828
r2241r2242
855855   if (DST_LOGIC_JKFF__ENABLE)
856856   {
857857      if (DST_LOGIC_JKFF__RESET)
858         node->output = 0;
858         node->output[0] = 0;
859859      else if (DST_LOGIC_JKFF__SET)
860         node->output = 1;
860         node->output[0] = 1;
861861      else if (context->last_clk && !clk)   /* high to low */
862862      {
863863         if (!j)
r2241r2242
865865            /* J=0, K=0 - Hold */
866866            if (k)
867867               /* J=0, K=1 - Reset */
868               node->output = 0;
868               node->output[0] = 0;
869869         }
870870         else
871871         {
872872            if (!k)
873873               /* J=1, K=0 - Set */
874               node->output = 1;
874               node->output[0] = 1;
875875            else
876876               /* J=1, K=1 - Toggle */
877               node->output = !(int)node->output;
877               node->output[0] = !(int)node->output[0];
878878         }
879879      }
880880   }
881881   else
882882   {
883      node->output=0;
883      node->output[0]=0;
884884   }
885885   context->last_clk = clk;
886886}
r2241r2242
908908   int   addr = DST_LOOKUP_TABLE__IN;
909909
910910   if (!DST_LOOKUP_TABLE__ENABLE || addr < 0 || addr >= DST_LOOKUP_TABLE__SIZE)
911      node->output = 0;
911      node->output[0] = 0;
912912   else
913      node->output = table[addr];
913      node->output[0] = table[addr];
914914}
915915
916916/************************************************************************
r2241r2242
10611061         context->vCapAmp += (v - context->vCapAmp) * context->exponent_cAmp;
10621062         v -= context->vCapAmp;
10631063      }
1064      node->output = v * info->gain;
1064      node->output[0] = v * info->gain;
10651065   }
10661066   else
10671067   {
1068      node->output = 0;
1068      node->output[0] = 0;
10691069   }
10701070}
10711071
r2241r2242
10831083   {
10841084      r_node = discrete_find_node(NULL, info->rNode[bit]);
10851085      if (r_node)
1086         context->rNode[bit] = &(r_node->output);
1086         context->rNode[bit] = &(r_node->output[NODE_CHILD_NODE_NUM(info->rNode[bit])]);
10871087      else
10881088         context->rNode[bit] = NULL;
10891089   }
r2241r2242
11691169
11701170   if ((context->type & DISC_MIXER_TYPE_MASK) == DISC_MIXER_IS_OP_AMP_WITH_RI) context->gain = info->rF / info->rI;
11711171
1172   node->output = 0;
1172   node->output[0] = 0;
11731173}
11741174
11751175
r2241r2242
11991199      addr = DST_MULTIPLEX__ADDR;   // FP to INT
12001200      if ((addr >= 0) && (addr < context->size))
12011201      {
1202         node->output = DST_MULTIPLEX__INP(addr);
1202         node->output[0] = DST_MULTIPLEX__INP(addr);
12031203      }
12041204      else
12051205      {
r2241r2242
12091209   }
12101210   else
12111211   {
1212      node->output=0;
1212      node->output[0]=0;
12131213   }
12141214}
12151215
r2241r2242
12521252   if (DST_ONESHOT__RESET)
12531253   {
12541254      /* Hold in Reset */
1255      node->output = 0;
1255      node->output[0] = 0;
12561256      context->state = 0;
12571257   }
12581258   else
r2241r2242
12701270            {
12711271               /* We have first trigger */
12721272               context->state = 1;
1273               node->output = (DST_ONESHOT__TYPE & DISC_OUT_ACTIVE_LOW) ? 0 : DST_ONESHOT__AMP;
1273               node->output[0] = (DST_ONESHOT__TYPE & DISC_OUT_ACTIVE_LOW) ? 0 : DST_ONESHOT__AMP;
12741274               context->countdown = DST_ONESHOT__WIDTH;
12751275            }
12761276            else
r2241r2242
12911291         context->countdown -= discrete_current_context->sample_time;
12921292         if(context->countdown <= 0.0)
12931293         {
1294            node->output = (DST_ONESHOT__TYPE & DISC_OUT_ACTIVE_LOW) ? DST_ONESHOT__AMP : 0;
1294            node->output[0] = (DST_ONESHOT__TYPE & DISC_OUT_ACTIVE_LOW) ? DST_ONESHOT__AMP : 0;
12951295            context->countdown = 0;
12961296            context->state = 0;
12971297         }
r2241r2242
13071307   context->state = 0;
13081308
13091309    context->lastTrig = 0;
1310    node->output = (DST_ONESHOT__TYPE & DISC_OUT_ACTIVE_LOW) ? DST_ONESHOT__AMP : 0;
1310    node->output[0] = (DST_ONESHOT__TYPE & DISC_OUT_ACTIVE_LOW) ? DST_ONESHOT__AMP : 0;
13111311}
13121312
13131313
r2241r2242
13391339      if (!context->last_en)
13401340      {
13411341         context->last_en = 1;
1342         node->output = DST_RAMP__START;
1342         node->output[0] = DST_RAMP__START;
13431343      }
1344      if(context->dir ? DST_RAMP__DIR : !DST_RAMP__DIR) node->output+=context->step;
1345      else node->output-=context->step;
1344      if(context->dir ? DST_RAMP__DIR : !DST_RAMP__DIR) node->output[0]+=context->step;
1345      else node->output[0]-=context->step;
13461346      /* Clamp to min/max */
1347      if(context->dir ? (node->output < DST_RAMP__START)
1348            : (node->output > DST_RAMP__START)) node->output=DST_RAMP__START;
1349      if(context->dir ? (node->output > DST_RAMP__END)
1350            : (node->output < DST_RAMP__END)) node->output=DST_RAMP__END;
1347      if(context->dir ? (node->output[0] < DST_RAMP__START)
1348            : (node->output[0] > DST_RAMP__START)) node->output[0]=DST_RAMP__START;
1349      if(context->dir ? (node->output[0] > DST_RAMP__END)
1350            : (node->output[0] < DST_RAMP__END)) node->output[0]=DST_RAMP__END;
13511351   }
13521352   else
13531353   {
13541354      context->last_en = 0;
13551355      // Disabled so clamp to output
1356      node->output=DST_RAMP__CLAMP;
1356      node->output[0]=DST_RAMP__CLAMP;
13571357   }
13581358}
13591359
r2241r2242
13611361{
13621362   struct dss_ramp_context *context = node->context;
13631363
1364   node->output=DST_RAMP__CLAMP;
1364   node->output[0]=DST_RAMP__CLAMP;
13651365   context->step = DST_RAMP__GRAD / discrete_current_context->sample_rate;
13661366   context->dir = ((DST_RAMP__END - DST_RAMP__START) == abs(DST_RAMP__END - DST_RAMP__START));
13671367   context->last_en = 0;
r2241r2242
13931393      {
13941394         case DISC_SAMPHOLD_REDGE:
13951395            /* Clock the whole time the input is rising */
1396            if(DST_SAMPHOLD__CLOCK > context->lastinput) node->output=DST_SAMPHOLD__IN0;
1396            if(DST_SAMPHOLD__CLOCK > context->lastinput) node->output[0]=DST_SAMPHOLD__IN0;
13971397            break;
13981398         case DISC_SAMPHOLD_FEDGE:
13991399            /* Clock the whole time the input is falling */
1400            if(DST_SAMPHOLD__CLOCK < context->lastinput) node->output=DST_SAMPHOLD__IN0;
1400            if(DST_SAMPHOLD__CLOCK < context->lastinput) node->output[0]=DST_SAMPHOLD__IN0;
14011401            break;
14021402         case DISC_SAMPHOLD_HLATCH:
14031403            /* Output follows input if clock != 0 */
1404            if(DST_SAMPHOLD__CLOCK) node->output=DST_SAMPHOLD__IN0;
1404            if(DST_SAMPHOLD__CLOCK) node->output[0]=DST_SAMPHOLD__IN0;
14051405            break;
14061406         case DISC_SAMPHOLD_LLATCH:
14071407            /* Output follows input if clock == 0 */
1408            if(DST_SAMPHOLD__CLOCK==0) node->output=DST_SAMPHOLD__IN0;
1408            if(DST_SAMPHOLD__CLOCK==0) node->output[0]=DST_SAMPHOLD__IN0;
14091409            break;
14101410         default:
14111411            discrete_log("dst_samphold_step - Invalid clocktype passed");
r2241r2242
14141414   }
14151415   else
14161416   {
1417      node->output=0;
1417      node->output[0]=0;
14181418   }
14191419   /* Save the last value */
14201420   context->lastinput=DST_SAMPHOLD__CLOCK;
r2241r2242
14241424{
14251425   struct dst_samphold_context *context = node->context;
14261426
1427   node->output=0;
1427   node->output[0]=0;
14281428   context->lastinput=-1;
14291429   /* Only stored in here to speed up and save casting in the step function */
14301430   context->clocktype=(int)DST_SAMPHOLD__TYPE;
r2241r2242
14511451{
14521452   if(DSS_SWITCH__ENABLE)
14531453   {
1454      node->output=DSS_SWITCH__SWITCH ? DSS_SWITCH__IN1 : DSS_SWITCH__IN0;
1454      node->output[0]=DSS_SWITCH__SWITCH ? DSS_SWITCH__IN1 : DSS_SWITCH__IN0;
14551455   }
14561456   else
14571457   {
1458      node->output=0;
1458      node->output[0]=0;
14591459   }
14601460}
14611461
r2241r2242
14791479{
14801480   if(DSS_SWITCH__ENABLE)
14811481   {
1482      node->output=DSS_ASWITCH__CTRL > DSS_ASWITCH__THRESHOLD ? DSS_ASWITCH__IN : 0;
1482      node->output[0]=DSS_ASWITCH__CTRL > DSS_ASWITCH__THRESHOLD ? DSS_ASWITCH__IN : 0;
14831483   }
14841484   else
14851485   {
1486      node->output=0;
1486      node->output[0]=0;
14871487   }
14881488}
14891489
r2241r2242
15331533      int   trans_stack_ptr=0;
15341534
15351535      const char *fPTR = node->custom;
1536      node->output=0;
1536      node->output[0]=0;
15371537
15381538      while(*fPTR!=0)
15391539      {
r2241r2242
16311631               break;
16321632            default:
16331633               discrete_log("dst_transform_step - Invalid function type/variable passed");
1634               node->output = 0;
1634               node->output[0] = 0;
16351635               break;
16361636         }
16371637      }
1638      node->output=dst_transform_pop(trans_stack,&trans_stack_ptr);
1638      node->output[0]=dst_transform_pop(trans_stack,&trans_stack_ptr);
16391639   }
16401640   else
16411641   {
1642      node->output=0;
1642      node->output[0]=0;
16431643   }
16441644}
16451645
r2241r2242
17011701               else
17021702                  /* linear charge */
17031703                  context->vCap += i / context->exponent;
1704               node->output = context->vCap;
1704               node->output[0] = context->vCap;
17051705            }
17061706            else
1707               node->output = i * info->r4;
1707               node->output[0] = i * info->r4;
17081708
17091709            /* clamp output */
1710            if (node->output > context->vMax) node->output = context->vMax;
1711            else if (node->output < info->vN) node->output = info->vN;
1712            context->vCap = node->output;
1710            if (node->output[0] > context->vMax) node->output[0] = context->vMax;
1711            else if (node->output[0] < info->vN) node->output[0] = info->vN;
1712            context->vCap = node->output[0];
17131713            break;
17141714
17151715         default:
1716            node->output = 0;
1716            node->output[0] = 0;
17171717      }
17181718   }
17191719   else
1720      node->output = 0;
1720      node->output[0] = 0;
17211721}
17221722
17231723static void dst_op_amp_reset(node_description *node)
r2241r2242
17741774
17751775   /* update trigger circuit */
17761776   iPos = (DST_OP_AMP_1SHT__TRIGGER - context->vCap2) / info->r2;
1777   iPos += node->output / info->r5;
1777   iPos += node->output[0] / info->r5;
17781778   context->vCap2 += (DST_OP_AMP_1SHT__TRIGGER - context->vCap2) * context->exponent2;
17791779
17801780   /* calculate currents and output */
r2241r2242
17821782   if (iNeg < 0) iNeg = 0;
17831783   iNeg += context->iFixed;
17841784
1785   if (iPos > iNeg) node->output = context->vMax;
1786   else node->output = info->vN;
1785   if (iPos > iNeg) node->output[0] = context->vMax;
1786   else node->output[0] = info->vN;
17871787
17881788   /* update c1 */
17891789   /* rough value of voltage at anode of diode if discharging */
1790   v = node->output + 0.6;
1791   if (context->vCap1 > node->output)
1790   v = node->output[0] + 0.6;
1791   if (context->vCap1 > node->output[0])
17921792   {
17931793      /* discharge */
17941794      if (context->vCap1 > v)
r2241r2242
17961796         context->vCap1 = v;
17971797      else
17981798         /* discharge through r4 */
1799         context->vCap1 += (node->output - context->vCap1) * context->exponent1d;
1799         context->vCap1 += (node->output[0] - context->vCap1) * context->exponent1d;
18001800   }
18011801   else
18021802      /* charge */
1803      context->vCap1 += ((node->output - OP_AMP_NORTON_VBE) * context->r34ratio + OP_AMP_NORTON_VBE - context->vCap1) * context->exponent1c;
1803      context->vCap1 += ((node->output[0] - OP_AMP_NORTON_VBE) * context->r34ratio + OP_AMP_NORTON_VBE - context->vCap1) * context->exponent1c;
18041804}
18051805
18061806static void dst_op_amp_1sht_reset(node_description *node)
r2241r2242
19161916   iOut = iPos - iNeg;
19171917   if (iOut < 0) iOut = 0;
19181918   /* Convert to voltage for final output. */
1919   node->output = iOut * info->r4;
1919   node->output[0] = iOut * info->r4;
19201920   /* Clip the output if needed. */
1921   if (node->output > context->vOutMax) node->output = context->vOutMax;
1921   if (node->output[0] > context->vOutMax) node->output[0] = context->vOutMax;
19221922}
19231923
19241924static void dst_tvca_op_amp_reset(node_description *node)
src/emu/sound/ay8910.c
r2241r2242
262262WRITE8_HANDLER( AY8910_control_port_2_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 2),0,data); }
263263WRITE8_HANDLER( AY8910_control_port_3_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 3),0,data); }
264264WRITE8_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_LSB) ay8910_write_ym(sndti_token(SOUND_AY8910, 0),0,data & 0xff); }
266WRITE16_HANDLER( AY8910_control_port_1_lsb_w ) { if (ACCESSING_LSB) ay8910_write_ym(sndti_token(SOUND_AY8910, 1),0,data & 0xff); }
267WRITE16_HANDLER( AY8910_control_port_2_lsb_w ) { if (ACCESSING_LSB) ay8910_write_ym(sndti_token(SOUND_AY8910, 2),0,data & 0xff); }
268WRITE16_HANDLER( AY8910_control_port_3_lsb_w ) { if (ACCESSING_LSB) ay8910_write_ym(sndti_token(SOUND_AY8910, 3),0,data & 0xff); }
269WRITE16_HANDLER( AY8910_control_port_4_lsb_w ) { if (ACCESSING_LSB) ay8910_write_ym(sndti_token(SOUND_AY8910, 4),0,data & 0xff); }
270WRITE16_HANDLER( AY8910_control_port_0_msb_w ) { if (ACCESSING_MSB) ay8910_write_ym(sndti_token(SOUND_AY8910, 0),0,data >> 8); }
271WRITE16_HANDLER( AY8910_control_port_1_msb_w ) { if (ACCESSING_MSB) ay8910_write_ym(sndti_token(SOUND_AY8910, 1),0,data >> 8); }
272WRITE16_HANDLER( AY8910_control_port_2_msb_w ) { if (ACCESSING_MSB) ay8910_write_ym(sndti_token(SOUND_AY8910, 2),0,data >> 8); }
273WRITE16_HANDLER( AY8910_control_port_3_msb_w ) { if (ACCESSING_MSB) ay8910_write_ym(sndti_token(SOUND_AY8910, 3),0,data >> 8); }
274WRITE16_HANDLER( AY8910_control_port_4_msb_w ) { if (ACCESSING_MSB) ay8910_write_ym(sndti_token(SOUND_AY8910, 4),0,data >> 8); }
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); }
275275
276276WRITE8_HANDLER( AY8910_write_port_0_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 0),1,data); }
277277WRITE8_HANDLER( AY8910_write_port_1_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 1),1,data); }
278278WRITE8_HANDLER( AY8910_write_port_2_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 2),1,data); }
279279WRITE8_HANDLER( AY8910_write_port_3_w ) { ay8910_write_ym(sndti_token(SOUND_AY8910, 3),1,data); }
280280WRITE8_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_LSB) ay8910_write_ym(sndti_token(SOUND_AY8910, 0),1,data & 0xff); }
282WRITE16_HANDLER( AY8910_write_port_1_lsb_w ) { if (ACCESSING_LSB) ay8910_write_ym(sndti_token(SOUND_AY8910, 1),1,data & 0xff); }
283WRITE16_HANDLER( AY8910_write_port_2_lsb_w ) { if (ACCESSING_LSB) ay8910_write_ym(sndti_token(SOUND_AY8910, 2),1,data & 0xff); }
284WRITE16_HANDLER( AY8910_write_port_3_lsb_w ) { if (ACCESSING_LSB) ay8910_write_ym(sndti_token(SOUND_AY8910, 3),1,data & 0xff); }
285WRITE16_HANDLER( AY8910_write_port_4_lsb_w ) { if (ACCESSING_LSB) ay8910_write_ym(sndti_token(SOUND_AY8910, 4),1,data & 0xff); }
286WRITE16_HANDLER( AY8910_write_port_0_msb_w ) { if (ACCESSING_MSB) ay8910_write_ym(sndti_token(SOUND_AY8910, 0),1,data >> 8); }
287WRITE16_HANDLER( AY8910_write_port_1_msb_w ) { if (ACCESSING_MSB) ay8910_write_ym(sndti_token(SOUND_AY8910, 1),1,data >> 8); }
288WRITE16_HANDLER( AY8910_write_port_2_msb_w ) { if (ACCESSING_MSB) ay8910_write_ym(sndti_token(SOUND_AY8910, 2),1,data >> 8); }
289WRITE16_HANDLER( AY8910_write_port_3_msb_w ) { if (ACCESSING_MSB) ay8910_write_ym(sndti_token(SOUND_AY8910, 3),1,data >> 8); }
290WRITE16_HANDLER( AY8910_write_port_4_msb_w ) { if (ACCESSING_MSB) ay8910_write_ym(sndti_token(SOUND_AY8910, 4),1,data >> 8); }
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); }
291291
292292
293293
src/emu/sound/discrete.c
r2241r2242
163163
164164static const discrete_module module_list[] =
165165{
166   { DSO_OUTPUT      ,"DSO_OUTPUT"      ,0                                      ,NULL                  ,NULL                 },
167   { DSO_CSVLOG      ,"DSO_CSVLOG"      ,0                                      ,NULL                  ,NULL                 },
168   { DSO_WAVELOG     ,"DSO_WAVELOG"     ,0                                      ,NULL                  ,NULL                 },
166   { DSO_OUTPUT      ,"DSO_OUTPUT"      , 0 ,0                                      ,NULL                  ,NULL                 },
167   { DSO_CSVLOG      ,"DSO_CSVLOG"      , 0 ,0                                      ,NULL                  ,NULL                 },
168   { DSO_WAVELOG     ,"DSO_WAVELOG"     , 0 ,0                                      ,NULL                  ,NULL                 },
169169
170170   /* from disc_inp.c */
171   { DSS_ADJUSTMENT  ,"DSS_ADJUSTMENT"  ,sizeof(struct dss_adjustment_context)  ,dss_adjustment_reset  ,dss_adjustment_step  },
172   { DSS_CONSTANT    ,"DSS_CONSTANT"    ,0                                      ,NULL                  ,dss_constant_step    },
173   { DSS_INPUT_DATA  ,"DSS_INPUT_DATA"  ,sizeof(UINT8)                          ,dss_input_reset       ,dss_input_step       },
174   { DSS_INPUT_LOGIC ,"DSS_INPUT_LOGIC" ,sizeof(UINT8)                          ,dss_input_reset       ,dss_input_step       },
175   { DSS_INPUT_NOT   ,"DSS_INPUT_NOT"   ,sizeof(UINT8)                          ,dss_input_reset       ,dss_input_step       },
176   { DSS_INPUT_PULSE ,"DSS_INPUT_PULSE" ,sizeof(UINT8)                          ,dss_input_reset       ,dss_input_pulse_step },
177   { DSS_INPUT_STREAM,"DSS_INPUT_STREAM",0                                      ,dss_input_stream_reset,dss_input_stream_step},
171   { DSS_ADJUSTMENT  ,"DSS_ADJUSTMENT"  , 1 ,sizeof(struct dss_adjustment_context)  ,dss_adjustment_reset  ,dss_adjustment_step  },
172   { DSS_CONSTANT    ,"DSS_CONSTANT"    , 1 ,0                                      ,NULL                  ,dss_constant_step    },
173   { DSS_INPUT_DATA  ,"DSS_INPUT_DATA"  , 1 ,sizeof(UINT8)                          ,dss_input_reset       ,dss_input_step       },
174   { DSS_INPUT_LOGIC ,"DSS_INPUT_LOGIC" , 1 ,sizeof(UINT8)                          ,dss_input_reset       ,dss_input_step       },
175   { DSS_INPUT_NOT   ,"DSS_INPUT_NOT"   , 1 ,sizeof(UINT8)                          ,dss_input_reset       ,dss_input_step       },
176   { DSS_INPUT_PULSE ,"DSS_INPUT_PULSE" , 1 ,sizeof(UINT8)                          ,dss_input_reset       ,dss_input_pulse_step },
177   { DSS_INPUT_STREAM,"DSS_INPUT_STREAM", 1 ,0                                      ,dss_input_stream_reset,dss_input_stream_step},
178178
179179   /* from disc_wav.c */
180180   /* Generic modules */
181   { DSS_COUNTER     ,"DSS_COUNTER"     ,sizeof(struct dss_counter_context)     ,dss_counter_reset     ,dss_counter_step     },
182   { DSS_LFSR_NOISE  ,"DSS_LFSR_NOISE"  ,sizeof(struct dss_lfsr_context)        ,dss_lfsr_reset        ,dss_lfsr_step        },
183   { DSS_NOISE       ,"DSS_NOISE"       ,sizeof(struct dss_noise_context)       ,dss_noise_reset       ,dss_noise_step       },
184   { DSS_NOTE        ,"DSS_NOTE"        ,sizeof(struct dss_note_context)        ,dss_note_reset        ,dss_note_step        },
185   { DSS_SAWTOOTHWAVE,"DSS_SAWTOOTHWAVE",sizeof(struct dss_sawtoothwave_context),dss_sawtoothwave_reset,dss_sawtoothwave_step},
186   { DSS_SINEWAVE    ,"DSS_SINEWAVE"    ,sizeof(struct dss_sinewave_context)    ,dss_sinewave_reset    ,dss_sinewave_step    },
187   { DSS_SQUAREWAVE  ,"DSS_SQUAREWAVE"  ,sizeof(struct dss_squarewave_context)  ,dss_squarewave_reset  ,dss_squarewave_step  },
188   { DSS_SQUAREWFIX  ,"DSS_SQUAREWFIX"  ,sizeof(struct dss_squarewfix_context)  ,dss_squarewfix_reset  ,dss_squarewfix_step  },
189   { DSS_SQUAREWAVE2 ,"DSS_SQUAREWAVE2" ,sizeof(struct dss_squarewave_context)  ,dss_squarewave2_reset ,dss_squarewave2_step },
190   { DSS_TRIANGLEWAVE,"DSS_TRIANGLEWAVE",sizeof(struct dss_trianglewave_context),dss_trianglewave_reset,dss_trianglewave_step},
181   { DSS_COUNTER     ,"DSS_COUNTER"     , 1 ,sizeof(struct dss_counter_context)     ,dss_counter_reset     ,dss_counter_step     },
182   { DSS_LFSR_NOISE  ,"DSS_LFSR_NOISE"  , 1 ,sizeof(struct dss_lfsr_context)        ,dss_lfsr_reset        ,dss_lfsr_step        },
183   { DSS_NOISE       ,"DSS_NOISE"       , 1 ,sizeof(struct dss_noise_context)       ,dss_noise_reset       ,dss_noise_step       },
184   { DSS_NOTE        ,"DSS_NOTE"        , 1 ,sizeof(struct dss_note_context)        ,dss_note_reset        ,dss_note_step        },
185   { DSS_SAWTOOTHWAVE,"DSS_SAWTOOTHWAVE", 1 ,sizeof(struct dss_sawtoothwave_context),dss_sawtoothwave_reset,dss_sawtoothwave_step},
186   { DSS_SINEWAVE    ,"DSS_SINEWAVE"    , 1 ,sizeof(struct dss_sinewave_context)    ,dss_sinewave_reset    ,dss_sinewave_step    },
187   { DSS_SQUAREWAVE  ,"DSS_SQUAREWAVE"  , 1 ,sizeof(struct dss_squarewave_context)  ,dss_squarewave_reset  ,dss_squarewave_step  },
188   { DSS_SQUAREWFIX  ,"DSS_SQUAREWFIX"  , 1 ,sizeof(struct dss_squarewfix_context)  ,dss_squarewfix_reset  ,dss_squarewfix_step  },
189   { DSS_SQUAREWAVE2 ,"DSS_SQUAREWAVE2" , 1 ,sizeof(struct dss_squarewave_context)  ,dss_squarewave2_reset ,dss_squarewave2_step },
190   { DSS_TRIANGLEWAVE,"DSS_TRIANGLEWAVE", 1 ,sizeof(struct dss_trianglewave_context),dss_trianglewave_reset,dss_trianglewave_step},
191191   /* Component specific modules */
192   { DSS_INVERTER_OSC ,"DSS_INVERTER_OSC" ,sizeof(struct dss_inverter_osc_context) ,dss_inverter_osc_reset ,dss_inverter_osc_step },
193   { DSS_OP_AMP_OSC  ,"DSS_OP_AMP_OSC"  ,sizeof(struct dss_op_amp_osc_context)  ,dss_op_amp_osc_reset  ,dss_op_amp_osc_step  },
194   { DSS_SCHMITT_OSC ,"DSS_SCHMITT_OSC" ,sizeof(struct dss_schmitt_osc_context) ,dss_schmitt_osc_reset ,dss_schmitt_osc_step },
192   { DSS_INVERTER_OSC ,"DSS_INVERTER_OSC" , 1 ,sizeof(struct dss_inverter_osc_context) ,dss_inverter_osc_reset ,dss_inverter_osc_step },
193   { DSS_OP_AMP_OSC  ,"DSS_OP_AMP_OSC"  , 1 ,sizeof(struct dss_op_amp_osc_context)  ,dss_op_amp_osc_reset  ,dss_op_amp_osc_step  },
194   { DSS_SCHMITT_OSC ,"DSS_SCHMITT_OSC" , 1 ,sizeof(struct dss_schmitt_osc_context) ,dss_schmitt_osc_reset ,dss_schmitt_osc_step },
195195   /* Not yet implemented */
196   { DSS_ADSR        ,"DSS_ADSR"        ,sizeof(struct dss_adsr_context)        ,dss_adsrenv_reset     ,dss_adsrenv_step     },
196   { DSS_ADSR        ,"DSS_ADSR"        , 1 ,sizeof(struct dss_adsr_context)        ,dss_adsrenv_reset     ,dss_adsrenv_step     },
197197
198198   /* from disc_mth.c */
199199   /* Generic modules */
200   { DST_ADDER       ,"DST_ADDER"       ,0                                      ,NULL                  ,dst_adder_step       },
201   { DST_CLAMP       ,"DST_CLAMP"       ,0                                      ,NULL                  ,dst_clamp_step       },
202   { DST_DIVIDE      ,"DST_DIVIDE"      ,0                                      ,NULL                  ,dst_divide_step      },
203   { DST_GAIN        ,"DST_GAIN"        ,0                                      ,NULL                  ,dst_gain_step        },
204   { DST_LOGIC_INV   ,"DST_LOGIC_INV"   ,0                                      ,NULL                  ,dst_logic_inv_step   },
205   { DST_LOGIC_AND   ,"DST_LOGIC_AND"   ,0                                      ,NULL                  ,dst_logic_and_step   },
206   { DST_LOGIC_NAND  ,"DST_LOGIC_NAND"  ,0                                      ,NULL                  ,dst_logic_nand_step  },
207   { DST_LOGIC_OR    ,"DST_LOGIC_OR"    ,0                                      ,NULL                  ,dst_logic_or_step    },
208   { DST_LOGIC_NOR   ,"DST_LOGIC_NOR"   ,0                                      ,NULL                  ,dst_logic_nor_step   },
209   { DST_LOGIC_XOR   ,"DST_LOGIC_XOR"   ,0                                      ,NULL                  ,dst_logic_xor_step   },
210   { DST_LOGIC_NXOR  ,"DST_LOGIC_NXOR"  ,0                                      ,NULL                  ,dst_logic_nxor_step  },
211   { DST_LOGIC_DFF   ,"DST_LOGIC_DFF"   ,sizeof(struct dst_flipflop_context)    ,dst_logic_ff_reset    ,dst_logic_dff_step   },
212   { DST_LOGIC_JKFF  ,"DST_LOGIC_JKFF"  ,sizeof(struct dst_flipflop_context)    ,dst_logic_ff_reset    ,dst_logic_jkff_step  },
213   { DST_LOOKUP_TABLE,"DST_LOOKUP_TABLE",0                                      ,NULL                  ,dst_lookup_table_step},
214   { DST_MULTIPLEX   ,"DST_MULTIPLEX"   ,sizeof(struct dst_size_context)        ,dst_multiplex_reset   ,dst_multiplex_step   },
215   { DST_ONESHOT     ,"DST_ONESHOT"     ,sizeof(struct dst_oneshot_context)     ,dst_oneshot_reset     ,dst_oneshot_step     },
216   { DST_RAMP        ,"DST_RAMP"        ,sizeof(struct dss_ramp_context)        ,dst_ramp_reset        ,dst_ramp_step        },
217   { DST_SAMPHOLD    ,"DST_SAMPHOLD"    ,sizeof(struct dst_samphold_context)    ,dst_samphold_reset    ,dst_samphold_step    },
218   { DST_SWITCH      ,"DST_SWITCH"      ,0                                      ,NULL                  ,dst_switch_step      },
219   { DST_ASWITCH     ,"DST_ASWITCH"     ,0                                      ,NULL                  ,dst_aswitch_step     },
220   { DST_TRANSFORM   ,"DST_TRANSFORM"   ,0                                      ,NULL                  ,dst_transform_step   },
200   { DST_ADDER       ,"DST_ADDER"       , 1 ,0                                      ,NULL                  ,dst_adder_step       },
201   { DST_CLAMP       ,"DST_CLAMP"       , 1 ,0                                      ,NULL                  ,dst_clamp_step       },
202   { DST_DIVIDE      ,"DST_DIVIDE"      , 1 ,0                                      ,NULL                  ,dst_divide_step      },
203   { DST_GAIN        ,"DST_GAIN"        , 1 ,0                                      ,NULL                  ,dst_gain_step        },
204   { DST_LOGIC_INV   ,"DST_LOGIC_INV"   , 1 ,0                                      ,NULL                  ,dst_logic_inv_step   },
205   { DST_LOGIC_AND   ,"DST_LOGIC_AND"   , 1 ,0                                      ,NULL                  ,dst_logic_and_step   },
206   { DST_LOGIC_NAND  ,"DST_LOGIC_NAND"  , 1 ,0                                      ,NULL                  ,dst_logic_nand_step  },
207   { DST_LOGIC_OR    ,"DST_LOGIC_OR"    , 1 ,0                                      ,NULL                  ,dst_logic_or_step    },
208   { DST_LOGIC_NOR   ,"DST_LOGIC_NOR"   , 1 ,0                                      ,NULL                  ,dst_logic_nor_step   },
209   { DST_LOGIC_XOR   ,"DST_LOGIC_XOR"   , 1 ,0                                      ,NULL                  ,dst_logic_xor_step   },
210   { DST_LOGIC_NXOR  ,"DST_LOGIC_NXOR"  , 1 ,0                                      ,NULL                  ,dst_logic_nxor_step  },
211   { DST_LOGIC_DFF   ,"DST_LOGIC_DFF"   , 1 ,sizeof(struct dst_flipflop_context)    ,dst_logic_ff_reset    ,dst_logic_dff_step   },
212   { DST_LOGIC_JKFF  ,"DST_LOGIC_JKFF"  , 1 ,sizeof(struct dst_flipflop_context)    ,dst_logic_ff_reset    ,dst_logic_jkff_step  },
213   { DST_LOOKUP_TABLE,"DST_LOOKUP_TABLE", 1 ,0                                      ,NULL                  ,dst_lookup_table_step},
214   { DST_MULTIPLEX   ,"DST_MULTIPLEX"   , 1 ,sizeof(struct dst_size_context)        ,dst_multiplex_reset   ,dst_multiplex_step   },
215   { DST_ONESHOT     ,"DST_ONESHOT"     , 1 ,sizeof(struct dst_oneshot_context)     ,dst_oneshot_reset     ,dst_oneshot_step     },
216   { DST_RAMP        ,"DST_RAMP"        , 1 ,sizeof(struct dss_ramp_context)        ,dst_ramp_reset        ,dst_ramp_step        },
217   { DST_SAMPHOLD    ,"DST_SAMPHOLD"    , 1 ,sizeof(struct dst_samphold_context)    ,dst_samphold_reset    ,dst_samphold_step    },
218   { DST_SWITCH      ,"DST_SWITCH"      , 1 ,0                                      ,NULL                  ,dst_switch_step      },
219   { DST_ASWITCH     ,"DST_ASWITCH"     , 1 ,0                                      ,NULL                  ,dst_aswitch_step     },
220   { DST_TRANSFORM   ,"DST_TRANSFORM"   , 1 ,0                                      ,NULL                  ,dst_transform_step   },
221221   /* Component specific */
222   { DST_COMP_ADDER  ,"DST_COMP_ADDER"  ,0                                      ,NULL                  ,dst_comp_adder_step  },
223   { DST_DAC_R1      ,"DST_DAC_R1"      ,sizeof(struct dst_dac_r1_context)      ,dst_dac_r1_reset      ,dst_dac_r1_step      },
224   { DST_DIODE_MIX   ,"DST_DIODE_MIX"   ,sizeof(struct dst_size_context)        ,dst_diode_mix_reset   ,dst_diode_mix_step   },
225   { DST_INTEGRATE   ,"DST_INTEGRATE"   ,sizeof(struct dst_integrate_context)   ,dst_integrate_reset   ,dst_integrate_step   },
226   { DST_MIXER       ,"DST_MIXER"       ,sizeof(struct dst_mixer_context)       ,dst_mixer_reset       ,dst_mixer_step       },
227   { DST_OP_AMP      ,"DST_OP_AMP"      ,sizeof(struct dst_op_amp_context)      ,dst_op_amp_reset      ,dst_op_amp_step      },
228   { DST_OP_AMP_1SHT ,"DST_OP_AMP_1SHT" ,sizeof(struct dst_op_amp_1sht_context) ,dst_op_amp_1sht_reset ,dst_op_amp_1sht_step },
229   { DST_TVCA_OP_AMP ,"DST_TVCA_OP_AMP" ,sizeof(struct dst_tvca_op_amp_context) ,dst_tvca_op_amp_reset ,dst_tvca_op_amp_step },
230   { DST_VCA         ,"DST_VCA"         ,0                                      ,NULL                  ,NULL                 },
222   { DST_COMP_ADDER  ,"DST_COMP_ADDER"  , 1 ,0                                      ,NULL                  ,dst_comp_adder_step  },
223   { DST_DAC_R1      ,"DST_DAC_R1"      , 1 ,sizeof(struct dst_dac_r1_context)      ,dst_dac_r1_reset      ,dst_dac_r1_step      },
224   { DST_DIODE_MIX   ,"DST_DIODE_MIX"   , 1 ,sizeof(struct dst_size_context)        ,dst_diode_mix_reset   ,dst_diode_mix_step   },
225   { DST_INTEGRATE   ,"DST_INTEGRATE"   , 1 ,sizeof(struct dst_integrate_context)   ,dst_integrate_reset   ,dst_integrate_step   },
226   { DST_MIXER       ,"DST_MIXER"       , 1 ,sizeof(struct dst_mixer_context)       ,dst_mixer_reset       ,dst_mixer_step       },
227   { DST_OP_AMP      ,"DST_OP_AMP"      , 1 ,sizeof(struct dst_op_amp_context)      ,dst_op_amp_reset      ,dst_op_amp_step      },
228   { DST_OP_AMP_1SHT ,"DST_OP_AMP_1SHT" , 1 ,sizeof(struct dst_op_amp_1sht_context) ,dst_op_amp_1sht_reset ,dst_op_amp_1sht_step },
229   { DST_TVCA_OP_AMP ,"DST_TVCA_OP_AMP" , 1 ,sizeof(struct dst_tvca_op_amp_context) ,dst_tvca_op_amp_reset ,dst_tvca_op_amp_step },
230   { DST_VCA         ,"DST_VCA"         , 1 ,0                                      ,NULL                  ,NULL                 },
231231
232232   /* from disc_flt.c */
233233   /* Generic modules */
234   { DST_FILTER1     ,"DST_FILTER1"     ,sizeof(struct dss_filter1_context)     ,dst_filter1_reset     ,dst_filter1_step     },
235   { DST_FILTER2     ,"DST_FILTER2"     ,sizeof(struct dss_filter2_context)     ,dst_filter2_reset     ,dst_filter2_step     },
234   { DST_FILTER1     ,"DST_FILTER1"     , 1 ,sizeof(struct dss_filter1_context)     ,dst_filter1_reset     ,dst_filter1_step     },
235   { DST_FILTER2     ,"DST_FILTER2"     , 1 ,sizeof(struct dss_filter2_context)     ,dst_filter2_reset     ,dst_filter2_step     },
236236   /* Component specific modules */
237   { DST_CRFILTER    ,"DST_CRFILTER"    ,sizeof(struct dst_rcfilter_context)    ,dst_crfilter_reset    ,dst_crfilter_step    },
238   { DST_OP_AMP_FILT ,"DST_OP_AMP_FILT" ,sizeof(struct dst_op_amp_filt_context) ,dst_op_amp_filt_reset ,dst_op_amp_filt_step },
239   { DST_RCDISC      ,"DST_RCDISC"      ,sizeof(struct dst_rcdisc_context)      ,dst_rcdisc_reset      ,dst_rcdisc_step      },
240   { DST_RCDISC2     ,"DST_RCDISC2"     ,sizeof(struct dst_rcdisc_context)      ,dst_rcdisc2_reset     ,dst_rcdisc2_step     },
241   { DST_RCDISC3     ,"DST_RCDISC3"     ,sizeof(struct dst_rcdisc_context)      ,dst_rcdisc3_reset     ,dst_rcdisc3_step     },
242   { DST_RCDISC4     ,"DST_RCDISC4"     ,sizeof(struct dst_rcdisc4_context)     ,dst_rcdisc4_reset     ,dst_rcdisc4_step     },
243   { DST_RCDISC5     ,"DST_RCDISC5"     ,sizeof(struct dst_rcdisc_context)      ,dst_rcdisc5_reset     ,dst_rcdisc5_step     },
244   { DST_RCINTEGRATE ,"DST_RCINTEGRATE" ,sizeof(struct dst_rcdisc_context)      ,dst_rcintegrate_reset ,dst_rcintegrate_step   },
245   { DST_RCDISC_MOD  ,"DST_RCDISC_MOD"  ,sizeof(struct dst_rcdisc_context)      ,dst_rcdisc_mod_reset  ,dst_rcdisc_mod_step },
246   { DST_RCFILTER    ,"DST_RCFILTER"    ,sizeof(struct dst_rcfilter_context)    ,dst_rcfilter_reset    ,dst_rcfilter_step    },
237   { DST_CRFILTER    ,"DST_CRFILTER"    , 1 ,sizeof(struct dst_rcfilter_context)    ,dst_crfilter_reset    ,dst_crfilter_step    },
238   { DST_OP_AMP_FILT ,"DST_OP_AMP_FILT" , 1 ,sizeof(struct dst_op_amp_filt_context) ,dst_op_amp_filt_reset ,dst_op_amp_filt_step },
239   { DST_RCDISC      ,"DST_RCDISC"      , 1 ,sizeof(struct dst_rcdisc_context)      ,dst_rcdisc_reset      ,dst_rcdisc_step      },
240   { DST_RCDISC2     ,"DST_RCDISC2"     , 1 ,sizeof(struct dst_rcdisc_context)      ,dst_rcdisc2_reset     ,dst_rcdisc2_step     },
241   { DST_RCDISC3     ,"DST_RCDISC3"     , 1 ,sizeof(struct dst_rcdisc_context)      ,dst_rcdisc3_reset     ,dst_rcdisc3_step     },
242   { DST_RCDISC4     ,"DST_RCDISC4"     , 1 ,sizeof(struct dst_rcdisc4_context)     ,dst_rcdisc4_reset     ,dst_rcdisc4_step     },
243   { DST_RCDISC5     ,"DST_RCDISC5"     , 1 ,sizeof(struct dst_rcdisc_context)      ,dst_rcdisc5_reset     ,dst_rcdisc5_step     },
244   { DST_RCINTEGRATE ,"DST_RCINTEGRATE" , 1 ,sizeof(struct dst_rcdisc_context)      ,dst_rcintegrate_reset ,dst_rcintegrate_step },
245   { DST_RCDISC_MOD  ,"DST_RCDISC_MOD"  , 1 ,sizeof(struct dst_rcdisc_context)      ,dst_rcdisc_mod_reset  ,dst_rcdisc_mod_step  },
246   { DST_RCFILTER    ,"DST_RCFILTER"    , 1 ,sizeof(struct dst_rcfilter_context)    ,dst_rcfilter_reset    ,dst_rcfilter_step    },
247   { DST_RCFILTER_SW ,"DST_RCFILTER_SW" , 1 ,sizeof(struct dst_rcfilter_sw_context) ,dst_rcfilter_sw_reset ,dst_rcfilter_sw_step },
247248   /* For testing - seem to be buggered.  Use versions not ending in N. */
248   { DST_RCFILTERN   ,"DST_RCFILTERN"   ,sizeof(struct dss_filter1_context)     ,dst_rcfilterN_reset   ,dst_filter1_step     },
249   { DST_RCDISCN     ,"DST_RCDISCN"     ,sizeof(struct dss_filter1_context)     ,dst_rcdiscN_reset     ,dst_rcdiscN_step     },
250   { DST_RCDISC2N    ,"DST_RCDISC2N"    ,sizeof(struct dss_rcdisc2_context)     ,dst_rcdisc2N_reset    ,dst_rcdisc2N_step    },
249   { DST_RCFILTERN   ,"DST_RCFILTERN"   , 1 ,sizeof(struct dss_filter1_context)     ,dst_rcfilterN_reset   ,dst_filter1_step     },
250   { DST_RCDISCN     ,"DST_RCDISCN"     , 1 ,sizeof(struct dss_filter1_context)     ,dst_rcdiscN_reset     ,dst_rcdiscN_step     },
251   { DST_RCDISC2N    ,"DST_RCDISC2N"    , 1 ,sizeof(struct dss_rcdisc2_context)     ,dst_rcdisc2N_reset    ,dst_rcdisc2N_step    },
251252
252253   /* from disc_dev.c */
253254   /* generic modules */
254   { DST_CUSTOM      ,"DST_CUSTOM"      ,0                                      ,NULL                  ,NULL                 },
255   { DST_CUSTOM      ,"DST_CUSTOM"      , 1 ,0                                      ,NULL                  ,NULL                 },
255256   /* Component specific modules */
256   { DSD_555_ASTBL   ,"DSD_555_ASTBL"   ,sizeof(struct dsd_555_astbl_context)   ,dsd_555_astbl_reset   ,dsd_555_astbl_step   },
257   { DSD_555_MSTBL   ,"DSD_555_MSTBL"   ,sizeof(struct dsd_555_mstbl_context)   ,dsd_555_mstbl_reset   ,dsd_555_mstbl_step   },
258   { DSD_555_CC      ,"DSD_555_CC"      ,sizeof(struct dsd_555_cc_context)      ,dsd_555_cc_reset      ,dsd_555_cc_step      },
259   { DSD_555_VCO1    ,"DSD_555_VCO1"    ,sizeof(struct dsd_555_vco1_context)    ,dsd_555_vco1_reset    ,dsd_555_vco1_step    },
260   { DSD_566         ,"DSD_566"         ,sizeof(struct dsd_566_context)         ,dsd_566_reset         ,dsd_566_step         },
261   { DSD_LS624       ,"DSD_LS624"       ,sizeof(struct dsd_ls624_context)       ,dsd_ls624_reset       ,dsd_ls624_step       },
257   { DSD_555_ASTBL   ,"DSD_555_ASTBL"   , 1 ,sizeof(struct dsd_555_astbl_context)   ,dsd_555_astbl_reset   ,dsd_555_astbl_step   },
258   { DSD_555_MSTBL   ,"DSD_555_MSTBL"   , 1 ,sizeof(struct dsd_555_mstbl_context)   ,dsd_555_mstbl_reset   ,dsd_555_mstbl_step   },
259   { DSD_555_CC      ,"DSD_555_CC"      , 1 ,sizeof(struct dsd_555_cc_context)      ,dsd_555_cc_reset      ,dsd_555_cc_step      },
260   { DSD_555_VCO1    ,"DSD_555_VCO1"    , 1 ,sizeof(struct dsd_555_vco1_context)    ,dsd_555_vco1_reset    ,dsd_555_vco1_step    },
261   { DSD_566         ,"DSD_566"         , 1 ,sizeof(struct dsd_566_context)         ,dsd_566_reset         ,dsd_566_step         },
262   { DSD_LS624       ,"DSD_LS624"       , 1 ,sizeof(struct dsd_ls624_context)       ,dsd_ls624_reset       ,dsd_ls624_step       },
262263   /* must be the last one */
263   { DSS_NULL        ,"DSS_NULL"        ,0                                      ,NULL                  ,NULL                 }
264   { DSS_NULL        ,"DSS_NULL"        , 0 ,0                                      ,NULL                  ,NULL                 }
264265};
265266
266267
r2241r2242
275276{
276277   discrete_info *info = chip ? chip : discrete_current_context;
277278   if (node < NODE_START || node > NODE_END) return NULL;
278   return info->indexed_node[node - NODE_START];
279   return info->indexed_node[NODE_INDEX(node)];
279280}
280281
281282
r2241r2242
323324
324325      /* make sure the node type is valid */
325326      if (intf[info->node_count].type > DSO_OUTPUT)
326         fatalerror("discrete_start() - Invalid function type on NODE_%02d", intf[info->node_count].node - NODE_START);
327         fatalerror("discrete_start() - Invalid function type on NODE_%02d", NODE_INDEX(intf[info->node_count].node) );
328
329      /* make sure this is a main node */
330      if (NODE_CHILD_NODE_NUM(intf[info->node_count].node) > 0)
331         fatalerror("discrete_start() - Child node number on NODE_%02d", NODE_INDEX(intf[info->node_count].node) );
332
333
327334   }
328335   info->node_count++;
329336   discrete_log("discrete_start() - Sanity check counted %d nodes", info->node_count);
r2241r2242
408415   {
409416      node_description *node = info->running_order[nodenum];
410417
411      node->output = 0;
418      node->output[0] = 0;
412419
413420      /* if the node has a reset function, call it */
414421      if (node->module.reset)
r2241r2242
570577      /* otherwise, make sure we are not a duplicate, and put ourselves into the indexed list */
571578      else
572579      {
573         if (info->indexed_node[block->node - NODE_START])
574            fatalerror("init_nodes() - Duplicate entries for NODE_%02d", block->node - NODE_START);
575         info->indexed_node[block->node - NODE_START] = node;
580         if (info->indexed_node[NODE_INDEX(block->node)])
581            fatalerror("init_nodes() - Duplicate entries for NODE_%02d", NODE_INDEX(block->node));
582         info->indexed_node[NODE_INDEX(block->node)] = node;
576583      }
577584
578585      /* find the requested module */
r2241r2242
580587         if (module_list[modulenum].type == block->type)
581588            break;
582589      if (module_list[modulenum].type != block->type)
583         fatalerror("init_nodes() - Unable to find discrete module type %d for NODE_%02d", block->type, block->node - NODE_START);
590         fatalerror("init_nodes() - Unable to find discrete module type %d for NODE_%02d", block->type, NODE_INDEX(block->node));
584591
585592      /* static inits */
586593      node->node = block->node;
587594      node->module = module_list[modulenum];
588      node->output = 0.0;
595      node->output[0] = 0.0;
589596      node->block = block;
590597
591598      node->active_inputs = block->active_inputs;
r2241r2242
658665         /* if this input is node-based, find the node in the indexed list */
659666         if IS_VALUE_A_NODE(inputnode)
660667         {
661            node_description *node_ref = info->indexed_node[inputnode - NODE_START];
668            node_description *node_ref = info->indexed_node[NODE_INDEX(inputnode)];
662669            if (!node_ref)
663               fatalerror("discrete_start - Node NODE_%02d referenced a non existent node NODE_%02d", node->node - NODE_START, inputnode - NODE_START);
670               fatalerror("discrete_start - Node NODE_%02d referenced a non existent node NODE_%02d", NODE_INDEX(node->node), NODE_INDEX(inputnode));
664671
665            node->input[inputnum] = &(node_ref->output);   // Link referenced node out to input
672            if (NODE_CHILD_NODE_NUM(inputnode) >= node_ref->module.num_output)
673               fatalerror("discrete_start - Node NODE_%02d referenced non existent output %d on node NODE_%02d", NODE_INDEX(node->node), NODE_CHILD_NODE_NUM(inputnode), NODE_INDEX(inputnode));
674
675            node->input[inputnum] = &(node_ref->output[NODE_CHILD_NODE_NUM(inputnode)]);   // Link referenced node out to input
666676            node->input_is_node |= 1 << inputnum;         // Bit flag if input is node
667677         }
668678      }
r2241r2242
708718      fprintf(info->disc_csv_file[log_num], "\"Sample\"");
709719      for (node_num = 0; node_num < info->csvlog_node[log_num]->active_inputs; node_num++)
710720      {
711         fprintf(info->disc_csv_file[log_num], ", \"NODE_%2d\"", info->csvlog_node[log_num]->block->input_node[node_num] - NODE_START);
721         fprintf(info->disc_csv_file[log_num], ", \"NODE_%2d\"", NODE_INDEX(info->csvlog_node[log_num]->block->input_node[node_num]));
712722      }
713723      fprintf(info->disc_csv_file[log_num], "\n");
714724   }
r2241r2242
750760      /* --- the following bits of info are returned as NULL-terminated strings --- */
751761      case SNDINFO_STR_NAME:                     info->s = "Discrete";               break;
752762      case SNDINFO_STR_CORE_FAMILY:               info->s = "Analog";                  break;
753      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
763      case SNDINFO_STR_CORE_VERSION:               info->s = "1.1";                  break;
754764      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
755765      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
756766   }
src/emu/sound/discrete.h
r2241r2242
4242 * emulation. So you will need to convert the schematic design into
4343 * a logic block representation.
4444 *
45 * There is the possibility to support multiple outputs per module.
46 * In this case, NODE_XXX is the default ouput. Alternative outputs may
47 * be accessed by using NODE_XXX_YY where 00<=Y<08.
48 *
49 * You may also access nodes with a macros:
50 *
51 *     NODE_XXX = NODE_SUB(XXX, 0)
52 *     NODE_XXX = NODE(XXX)
53 *     NODE_XXX_YY = NODE_SUB(XXX, YY) with YY != 00
54 *
4555 * One node point may feed a number of inputs, for example you could
4656 * connect the output of a DISCRETE_SINEWAVE to the AMPLITUDE input
4757 * of another DISCRETE_SINEWAVE to amplitude modulate its output and
r2241r2242
25852595 * EXAMPLES: see Polaris
25862596 *
25872597 ***********************************************************************
2598 *
2599 * DISCRETE_RCFILTER_SW - Multiple switchable RC filters
2600 *
2601 *                             R
2602 *    INPUT      >-----------ZZZZ-+-------+----......-----> Output
2603 *                                |       |
2604 *                               +-+     +-+
2605 *    SWITCH     > Bit 0 ---->F1 | |  F2 | |
2606 *                               '-'   ^ '-'
2607 *                 Bit 1 ---------|----'  |
2608 *                                |       |
2609 *                 Bit ...       ---     ---
2610 *                               --- C1  --- C2
2611 *                                |       |
2612 *                               GND     GND
2613 *
2614 *
2615 *  Declaration syntax
2616 *
2617 *     DISCRETE_RCFILTER_SW(name of node,
2618 *                          enable,
2619 *                          input node (or value),
2620 *                          switch node (or value),
2621 *                          R in Ohms,
2622 *                          C1 in Farads,
2623 *                          C2 in Farads,
2624 *                          C3 in Farads,
2625 *                          C4 in Farads)
2626 *
2627 *     This is a typical filter circuit in circusc or scramble.
2628 *     Switches are usually CD4066 with a "open" resistance of
2629 *     typical 470 Ohms at 5V.
2630 *     This circuit supports up to 4 filters.
2631 *
2632 * EXAMPLES: see circusc
2633 *
2634 ***********************************************************************
25882635 =======================================================================
25892636 * from from disc_flt.c
25902637 * Component specific modules
r2241r2242
30763123#define DISCRETE_MAX_OUTPUTS         16
30773124#define DISCRETE_MAX_WAVELOGS         10
30783125#define DISCRETE_MAX_CSVLOGS         10
3126#define DISCRETE_MAX_NODE_OUTPUTS       8
30793127
30803128
3081
30823129/*************************************
30833130 *
30843131 *  Node-specific constants
r2241r2242
33033350{
33043351   int            type;
33053352   const char *   name;
3353   int            num_output;            /* Total number of output nodes, i.e. Master node + 1 */
33063354   size_t         contextsize;
33073355   void (*reset)(node_description *node);   /* Called to reset a node after creation or system reset */
33083356   void (*step)(node_description *node);   /* Called to execute one time delta of output update */
r2241r2242
33183366
33193367struct _node_description
33203368{
3321   int            node;                  /* The node's index number in the node list */
3322   double         output;                  /* The node's last output value */
3369   int            node;                        /* The node's index number in the node list */
3370   double         output[DISCRETE_MAX_NODE_OUTPUTS];   /* The node's last output value */
33233371
3324   int            active_inputs;            /* Number of active inputs on this node type */
3325   int            input_is_node;            /* Bit Flags.  1 in bit location means input_is_node */
3326   const double *   input[DISCRETE_MAX_INPUTS];   /* Addresses of Input values */
3372   int            active_inputs;                  /* Number of active inputs on this node type */
3373   int            input_is_node;                  /* Bit Flags.  1 in bit location means input_is_node */
3374   const double *   input[DISCRETE_MAX_INPUTS];         /* Addresses of Input values */
33273375
3328   discrete_module module;                  /* Copy of the node's module info */
3329   const discrete_sound_block *block;         /* Points to the node's setup block. */
3330   void *         context;               /* Contextual information specific to this node type */
3331   const char *   name;                  /* Text name string for identification/debug */
3332   const void *   custom;                  /* Custom function specific initialisation data */
3376   discrete_module module;                        /* Copy of the node's module info */
3377   const discrete_sound_block *block;               /* Points to the node's setup block. */
3378   void *         context;                     /* Contextual information specific to this node type */
3379   const char *   name;                        /* Text name string for identification/debug */
3380   const void *   custom;                        /* Custom function specific initialisation data */
33333381};
33343382
33353383
r2241r2242
36353683 *
36363684 *************************************/
36373685
3638enum { NODE_00=0x40000000
3639              , NODE_01, NODE_02, NODE_03, NODE_04, NODE_05, NODE_06, NODE_07, NODE_08, NODE_09,
3640       NODE_10, NODE_11, NODE_12, NODE_13, NODE_14, NODE_15, NODE_16, NODE_17, NODE_18, NODE_19,
3641       NODE_20, NODE_21, NODE_22, NODE_23, NODE_24, NODE_25, NODE_26, NODE_27, NODE_28, NODE_29,
3642       NODE_30, NODE_31, NODE_32, NODE_33, NODE_34, NODE_35, NODE_36, NODE_37, NODE_38, NODE_39,
3643       NODE_40, NODE_41, NODE_42, NODE_43, NODE_44, NODE_45, NODE_46, NODE_47, NODE_48, NODE_49,
3644       NODE_50, NODE_51, NODE_52, NODE_53, NODE_54, NODE_55, NODE_56, NODE_57, NODE_58, NODE_59,
3645       NODE_60, NODE_61, NODE_62, NODE_63, NODE_64, NODE_65, NODE_66, NODE_67, NODE_68, NODE_69,
3646       NODE_70, NODE_71, NODE_72, NODE_73, NODE_74, NODE_75, NODE_76, NODE_77, NODE_78, NODE_79,
3647       NODE_80, NODE_81, NODE_82, NODE_83, NODE_84, NODE_85, NODE_86, NODE_87, NODE_88, NODE_89,
3648       NODE_90, NODE_91, NODE_92, NODE_93, NODE_94, NODE_95, NODE_96, NODE_97, NODE_98, NODE_99,
3649       NODE_100,NODE_101,NODE_102,NODE_103,NODE_104,NODE_105,NODE_106,NODE_107,NODE_108,NODE_109,
3650       NODE_110,NODE_111,NODE_112,NODE_113,NODE_114,NODE_115,NODE_116,NODE_117,NODE_118,NODE_119,
3651       NODE_120,NODE_121,NODE_122,NODE_123,NODE_124,NODE_125,NODE_126,NODE_127,NODE_128,NODE_129,
3652       NODE_130,NODE_131,NODE_132,NODE_133,NODE_134,NODE_135,NODE_136,NODE_137,NODE_138,NODE_139,
3653       NODE_140,NODE_141,NODE_142,NODE_143,NODE_144,NODE_145,NODE_146,NODE_147,NODE_148,NODE_149,
3654       NODE_150,NODE_151,NODE_152,NODE_153,NODE_154,NODE_155,NODE_156,NODE_157,NODE_158,NODE_159,
3655       NODE_160,NODE_161,NODE_162,NODE_163,NODE_164,NODE_165,NODE_166,NODE_167,NODE_168,NODE_169,
3656       NODE_170,NODE_171,NODE_172,NODE_173,NODE_174,NODE_175,NODE_176,NODE_177,NODE_178,NODE_179,
3657       NODE_180,NODE_181,NODE_182,NODE_183,NODE_184,NODE_185,NODE_186,NODE_187,NODE_188,NODE_189,
3658       NODE_190,NODE_191,NODE_192,NODE_193,NODE_194,NODE_195,NODE_196,NODE_197,NODE_198,NODE_199,
3659       NODE_200,NODE_201,NODE_202,NODE_203,NODE_204,NODE_205,NODE_206,NODE_207,NODE_208,NODE_209,
3660       NODE_210,NODE_211,NODE_212,NODE_213,NODE_214,NODE_215,NODE_216,NODE_217,NODE_218,NODE_219,
3661       NODE_220,NODE_221,NODE_222,NODE_223,NODE_224,NODE_225,NODE_226,NODE_227,NODE_228,NODE_229,
3662       NODE_230,NODE_231,NODE_232,NODE_233,NODE_234,NODE_235,NODE_236,NODE_237,NODE_238,NODE_239,
3663       NODE_240,NODE_241,NODE_242,NODE_243,NODE_244,NODE_245,NODE_246,NODE_247,NODE_248,NODE_249,
3664       NODE_250,NODE_251,NODE_252,NODE_253,NODE_254,NODE_255,NODE_256,NODE_257,NODE_258,NODE_259,
3665       NODE_260,NODE_261,NODE_262,NODE_263,NODE_264,NODE_265,NODE_266,NODE_267,NODE_268,NODE_269,
3666       NODE_270,NODE_271,NODE_272,NODE_273,NODE_274,NODE_275,NODE_276,NODE_277,NODE_278,NODE_279,
3667       NODE_280,NODE_281,NODE_282,NODE_283,NODE_284,NODE_285,NODE_286,NODE_287,NODE_288,NODE_289,
3668       NODE_290,NODE_291,NODE_292,NODE_293,NODE_294,NODE_295,NODE_296,NODE_297,NODE_298,NODE_299 };
3686#define NODE0_DEF(_x) NODE_ ## 0 ## _x = (0x40000000 + (_x) * DISCRETE_MAX_NODE_OUTPUTS), \
3687   NODE_ ## 0 ## _x ## _01, NODE_ ## 0 ## _x ## _02, NODE_ ## 0 ## _x ## _03, NODE_ ## 0 ## _x ## _04, \
3688   NODE_ ## 0 ## _x ## _05, NODE_ ## 0 ## _x ## _06, NODE_ ## 0 ## _x ## _07
3689#define NODE_DEF(_x) NODE_ ## _x = (0x40000000 + (_x) * DISCRETE_MAX_NODE_OUTPUTS), \
3690   NODE_ ## _x ## _01, NODE_ ## _x ## _02, NODE_ ## _x ## _03, NODE_ ## _x ## _04, \
3691   NODE_ ## _x ## _05, NODE_ ## _x ## _06, NODE_ ## _x ## _07
36693692
3693enum {
3694   NODE0_DEF(0), NODE0_DEF(1), NODE0_DEF(2), NODE0_DEF(3), NODE0_DEF(4), NODE0_DEF(5), NODE0_DEF(6), NODE0_DEF(7), NODE0_DEF(8), NODE0_DEF(9),
3695   NODE_DEF(10), NODE_DEF(11), NODE_DEF(12), NODE_DEF(13), NODE_DEF(14), NODE_DEF(15), NODE_DEF(16), NODE_DEF(17), NODE_DEF(18), NODE_DEF(19),
3696   NODE_DEF(20), NODE_DEF(21), NODE_DEF(22), NODE_DEF(23), NODE_DEF(24), NODE_DEF(25), NODE_DEF(26), NODE_DEF(27), NODE_DEF(28), NODE_DEF(29),
3697   NODE_DEF(30), NODE_DEF(31), NODE_DEF(32), NODE_DEF(33), NODE_DEF(34), NODE_DEF(35), NODE_DEF(36), NODE_DEF(37), NODE_DEF(38), NODE_DEF(39),
3698   NODE_DEF(40), NODE_DEF(41), NODE_DEF(42), NODE_DEF(43), NODE_DEF(44), NODE_DEF(45), NODE_DEF(46), NODE_DEF(47), NODE_DEF(48), NODE_DEF(49),
3699   NODE_DEF(50), NODE_DEF(51), NODE_DEF(52), NODE_DEF(53), NODE_DEF(54), NODE_DEF(55), NODE_DEF(56), NODE_DEF(57), NODE_DEF(58), NODE_DEF(59),
3700   NODE_DEF(60), NODE_DEF(61), NODE_DEF(62), NODE_DEF(63), NODE_DEF(64), NODE_DEF(65), NODE_DEF(66), NODE_DEF(67), NODE_DEF(68), NODE_DEF(69),
3701   NODE_DEF(70), NODE_DEF(71), NODE_DEF(72), NODE_DEF(73), NODE_DEF(74), NODE_DEF(75), NODE_DEF(76), NODE_DEF(77), NODE_DEF(78), NODE_DEF(79),
3702   NODE_DEF(80), NODE_DEF(81), NODE_DEF(82), NODE_DEF(83), NODE_DEF(84), NODE_DEF(85), NODE_DEF(86), NODE_DEF(87), NODE_DEF(88), NODE_DEF(89),
3703   NODE_DEF(90), NODE_DEF(91), NODE_DEF(92), NODE_DEF(93), NODE_DEF(94), NODE_DEF(95), NODE_DEF(96), NODE_DEF(97), NODE_DEF(98), NODE_DEF(99),
3704   NODE_DEF(100),NODE_DEF(101),NODE_DEF(102),NODE_DEF(103),NODE_DEF(104),NODE_DEF(105),NODE_DEF(106),NODE_DEF(107),NODE_DEF(108),NODE_DEF(109),
3705   NODE_DEF(110),NODE_DEF(111),NODE_DEF(112),NODE_DEF(113),NODE_DEF(114),NODE_DEF(115),NODE_DEF(116),NODE_DEF(117),NODE_DEF(118),NODE_DEF(119),
3706   NODE_DEF(120),NODE_DEF(121),NODE_DEF(122),NODE_DEF(123),NODE_DEF(124),NODE_DEF(125),NODE_DEF(126),NODE_DEF(127),NODE_DEF(128),NODE_DEF(129),
3707   NODE_DEF(130),NODE_DEF(131),NODE_DEF(132),NODE_DEF(133),NODE_DEF(134),NODE_DEF(135),NODE_DEF(136),NODE_DEF(137),NODE_DEF(138),NODE_DEF(139),
3708   NODE_DEF(140),NODE_DEF(141),NODE_DEF(142),NODE_DEF(143),NODE_DEF(144),NODE_DEF(145),NODE_DEF(146),NODE_DEF(147),NODE_DEF(148),NODE_DEF(149),
3709   NODE_DEF(150),NODE_DEF(151),NODE_DEF(152),NODE_DEF(153),NODE_DEF(154),NODE_DEF(155),NODE_DEF(156),NODE_DEF(157),NODE_DEF(158),NODE_DEF(159),
3710   NODE_DEF(160),NODE_DEF(161),NODE_DEF(162),NODE_DEF(163),NODE_DEF(164),NODE_DEF(165),NODE_DEF(166),NODE_DEF(167),NODE_DEF(168),NODE_DEF(169),
3711   NODE_DEF(170),NODE_DEF(171),NODE_DEF(172),NODE_DEF(173),NODE_DEF(174),NODE_DEF(175),NODE_DEF(176),NODE_DEF(177),NODE_DEF(178),NODE_DEF(179),
3712   NODE_DEF(180),NODE_DEF(181),NODE_DEF(182),NODE_DEF(183),NODE_DEF(184),NODE_DEF(185),NODE_DEF(186),NODE_DEF(187),NODE_DEF(188),NODE_DEF(189),
3713   NODE_DEF(190),NODE_DEF(191),NODE_DEF(192),NODE_DEF(193),NODE_DEF(194),NODE_DEF(195),NODE_DEF(196),NODE_DEF(197),NODE_DEF(198),NODE_DEF(199),
3714   NODE_DEF(200),NODE_DEF(201),NODE_DEF(202),NODE_DEF(203),NODE_DEF(204),NODE_DEF(205),NODE_DEF(206),NODE_DEF(207),NODE_DEF(208),NODE_DEF(209),
3715   NODE_DEF(210),NODE_DEF(211),NODE_DEF(212),NODE_DEF(213),NODE_DEF(214),NODE_DEF(215),NODE_DEF(216),NODE_DEF(217),NODE_DEF(218),NODE_DEF(219),
3716   NODE_DEF(220),NODE_DEF(221),NODE_DEF(222),NODE_DEF(223),NODE_DEF(224),NODE_DEF(225),NODE_DEF(226),NODE_DEF(227),NODE_DEF(228),NODE_DEF(229),
3717   NODE_DEF(230),NODE_DEF(231),NODE_DEF(232),NODE_DEF(233),NODE_DEF(234),NODE_DEF(235),NODE_DEF(236),NODE_DEF(237),NODE_DEF(238),NODE_DEF(239),
3718   NODE_DEF(240),NODE_DEF(241),NODE_DEF(242),NODE_DEF(243),NODE_DEF(244),NODE_DEF(245),NODE_DEF(246),NODE_DEF(247),NODE_DEF(248),NODE_DEF(249),
3719   NODE_DEF(250),NODE_DEF(251),NODE_DEF(252),NODE_DEF(253),NODE_DEF(254),NODE_DEF(255),NODE_DEF(256),NODE_DEF(257),NODE_DEF(258),NODE_DEF(259),
3720   NODE_DEF(260),NODE_DEF(261),NODE_DEF(262),NODE_DEF(263),NODE_DEF(264),NODE_DEF(265),NODE_DEF(266),NODE_DEF(267),NODE_DEF(268),NODE_DEF(269),
3721   NODE_DEF(270),NODE_DEF(271),NODE_DEF(272),NODE_DEF(273),NODE_DEF(274),NODE_DEF(275),NODE_DEF(276),NODE_DEF(277),NODE_DEF(278),NODE_DEF(279),
3722   NODE_DEF(280),NODE_DEF(281),NODE_DEF(282),NODE_DEF(283),NODE_DEF(284),NODE_DEF(285),NODE_DEF(286),NODE_DEF(287),NODE_DEF(288),NODE_DEF(289),
3723   NODE_DEF(290),NODE_DEF(291),NODE_DEF(292),NODE_DEF(293),NODE_DEF(294),NODE_DEF(295),NODE_DEF(296),NODE_DEF(297),NODE_DEF(298),NODE_DEF(299)
3724};
3725
36703726/* Some Pre-defined nodes for convenience */
3727
3728#define NODE(_x)   (NODE_00 + (_x) * DISCRETE_MAX_NODE_OUTPUTS)
3729#define NODE_SUB(_x, _y) (NODE(_x) + (_y))
3730
3731#if DISCRETE_MAX_NODE_OUTPUTS == 8
3732#define NODE_CHILD_NODE_NUM(_x)      ((_x) & 7)
3733#define NODE_DEFAULT_NODE(_x)      ((_x) & ~7)
3734#define NODE_INDEX(_x)            (((_x) - NODE_START)>>3)
3735#else
3736#error "DISCRETE_MAX_NODE_OUTPUTS != 8"
3737#endif
3738
36713739#define NODE_NC  NODE_00
3672#define NODE_SPECIAL  (NODE_00+(DISCRETE_MAX_NODES))
3740#define NODE_SPECIAL  NODE(DISCRETE_MAX_NODES)
36733741
36743742#define NODE_START   NODE_00
36753743#define NODE_END   NODE_SPECIAL
r2241r2242
37723840   DST_RCINTEGRATE,   /* NPN RC charge/discharge network */
37733841   DST_RCDISC_MOD,      /* Two diode mixer with Transistor and charge/discharge network */
37743842   DST_RCFILTER,      /* Simple RC Filter network */
3843   DST_RCFILTER_SW,   /* Switcheable RC Filter network */
37753844   /* For testing - seem to be buggered.  Use versions not ending in N. */
37763845   DST_RCFILTERN,      /* Simple RC Filter network */
37773846   DST_RCDISCN,      /* Simple RC discharge */
r2241r2242
39273996#define DISCRETE_RCINTEGRATE(NODE,ENAB,INP0,RVAL0,RVAL1,RVAL2,CVAL,vP,TYPE)      { NODE, DST_RCINTEGRATE     , 8, { ENAB,INP0,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC }, { ENAB,INP0,RVAL0,RVAL1,RVAL2,CVAL,vP,TYPE }, NULL, "RC Discharge 6" },
39283997#define DISCRETE_RCDISC_MODULATED(NODE,ENAB,INP0,INP1,RVAL0,RVAL1,RVAL2,RVAL3,CVAL,VP)         { NODE, DST_RCDISC_MOD     , 9, { ENAB,INP0,INP1,RVAL0,RVAL1,RVAL2,RVAL3,CVAL,VP }, { ENAB,INP0,INP1,RVAL0,RVAL1,RVAL2,RVAL3,CVAL,VP }, NULL, "Modulated RC Discharge" },
39293998#define DISCRETE_RCFILTER(NODE,ENAB,INP0,RVAL,CVAL)                     { NODE, DST_RCFILTER    , 4, { ENAB,INP0,NODE_NC,NODE_NC }, { ENAB,INP0,RVAL,CVAL }, NULL, "RC Filter" },
3999#define DISCRETE_RCFILTER_SW(NODE,ENAB,INP0,SW,RVAL,CVAL1,CVAL2,CVAL3,CVAL4) { NODE, DST_RCFILTER_SW, 8, { ENAB,INP0,SW,RVAL,CVAL1,CVAL2,CVAL3,CVAL4 }, { ENAB,INP0,SW,RVAL,CVAL1,CVAL2,CVAL3,CVAL4 }, NULL, "RC Filter Switch" },
39304000#define DISCRETE_RCFILTER_VREF(NODE,ENAB,INP0,RVAL,CVAL,VREF)           { NODE, DST_RCFILTER    , 5, { ENAB,INP0,NODE_NC,NODE_NC,NODE_NC }, { ENAB,INP0,RVAL,CVAL,VREF }, NULL, "RC Filter to VREF" },
39314001/* For testing - seem to be buggered.  Use versions not ending in N. */
39324002#define DISCRETE_RCDISCN(NODE,ENAB,INP0,RVAL,CVAL)                      { NODE, DST_RCDISCN     , 4, { ENAB,INP0,NODE_NC,NODE_NC }, { ENAB,INP0,RVAL,CVAL }, NULL, "RC Discharge (New Type)" },
src/emu/sound/2610intf.c
r2241r2242
320320WRITE16_HANDLER( YM2610_control_port_0_A_lsb_w )
321321{
322322//logerror("PC %04x: 2610 Reg A %02X",activecpu_get_pc(),data);
323   if (ACCESSING_LSB)
323   if (ACCESSING_BITS_0_7)
324324   {
325325      struct ym2610_info *info = sndti_token(chip_type,0);
326326      YM2610Write(info->chip,0,data);
r2241r2242
337337WRITE16_HANDLER( YM2610_control_port_0_B_lsb_w )
338338{
339339//logerror("PC %04x: 2610 Reg B %02X",activecpu_get_pc(),data);
340   if (ACCESSING_LSB)
340   if (ACCESSING_BITS_0_7)
341341   {
342342      struct ym2610_info *info = sndti_token(chip_type,0);
343343      YM2610Write(info->chip,2,data);
r2241r2242
354354}
355355
356356WRITE16_HANDLER( YM2610_control_port_1_A_lsb_w ){
357   if (ACCESSING_LSB)
357   if (ACCESSING_BITS_0_7)
358358   {
359359      struct ym2610_info *info = sndti_token(chip_type,1);
360360      YM2610Write(info->chip,0,data);
r2241r2242
367367}
368368
369369WRITE16_HANDLER( YM2610_control_port_1_B_lsb_w ){
370   if (ACCESSING_LSB)
370   if (ACCESSING_BITS_0_7)
371371   {
372372      struct ym2610_info *info = sndti_token(chip_type,1);
373373      YM2610Write(info->chip,2,data);
r2241r2242
388388WRITE16_HANDLER( YM2610_data_port_0_A_lsb_w )
389389{
390390//logerror(" =%02X\n",data);
391   if (ACCESSING_LSB)
391   if (ACCESSING_BITS_0_7)
392392   {
393393      struct ym2610_info *info = sndti_token(chip_type,0);
394394      YM2610Write(info->chip,1,data);
r2241r2242
405405WRITE16_HANDLER( YM2610_data_port_0_B_lsb_w )
406406{
407407//logerror(" =%02X\n",data);
408   if (ACCESSING_LSB)
408   if (ACCESSING_BITS_0_7)
409409   {
410410      struct ym2610_info *info = sndti_token(chip_type,0);
411411      YM2610Write(info->chip,3,data);
r2241r2242
422422}
423423
424424WRITE16_HANDLER( YM2610_data_port_1_A_lsb_w ){
425   if (ACCESSING_LSB)
425   if (ACCESSING_BITS_0_7)
426426   {
427427      struct ym2610_info *info = sndti_token(chip_type,1);
428428      YM2610Write(info->chip,1,data);
r2241r2242
435435}
436436
437437WRITE16_HANDLER( YM2610_data_port_1_B_lsb_w ){
438   if (ACCESSING_LSB)
438   if (ACCESSING_BITS_0_7)
439439   {
440440      struct ym2610_info *info = sndti_token(chip_type,1);
441441      YM2610Write(info->chip,3,data);
src/emu/sound/disc_dev.c
r2241r2242
175175   {
176176      /* We are in RESET */
177177      /* If there was a fatal INIT error then we will also stay in RESET */
178      node->output = 0;
178      node->output[0] = 0;
179179      context->flip_flop = 1;
180180      context->cap_voltage = 0;
181181      return;
r2241r2242
308308   switch (context->output_type)
309309   {
310310      case DISC_555_OUT_SQW:
311         node->output = context->flip_flop * context->output_high_voltage + context->ac_shift;
311         node->output[0] = context->flip_flop * context->output_high_voltage + context->ac_shift;
312312         break;
313313      case DISC_555_OUT_CAP:
314         node->output = vCnext;
314         node->output[0] = vCnext;
315315         /* Fake it to AC if needed */
316316         if (context->output_is_ac)
317            node->output -= context->threshold * 3.0 /4.0;
317            node->output[0] -= context->threshold * 3.0 /4.0;
318318         break;
319319      case DISC_555_OUT_ENERGY:
320         node->output = context->output_high_voltage * (context->flip_flop ? xTime : (1 - xTime));
321         node->output += context->ac_shift;
320         node->output[0] = context->output_high_voltage * (context->flip_flop ? xTime : (1 - xTime));
321         node->output[0] += context->ac_shift;
322322         break;
323323      case DISC_555_OUT_LOGIC_X:
324         node->output = context->flip_flop + xTime;
324         node->output[0] = context->flip_flop + xTime;
325325         break;
326326      case DISC_555_OUT_COUNT_F_X:
327         node->output = count_f ? count_f + xTime : count_f;
327         node->output[0] = count_f ? count_f + xTime : count_f;
328328         break;
329329      case DISC_555_OUT_COUNT_R_X:
330         node->output =  count_r ? count_r + xTime : count_r;
330         node->output[0] =  count_r ? count_r + xTime : count_r;
331331         break;
332332      case DISC_555_OUT_COUNT_F:
333         node->output = count_f;
333         node->output[0] = count_f;
334334         break;
335335      case DISC_555_OUT_COUNT_R:
336         node->output = count_r;
336         node->output[0] = count_r;
337337         break;
338338   }
339339}
r2241r2242
411411   {
412412      /* We are in RESET */
413413      /* If there was a fatal INIT error then we will also stay in RESET */
414      node->output = 0;
414      node->output[0] = 0;
415415      context->flip_flop = 0;
416416      context->cap_voltage = 0;
417417   }
r2241r2242
469469         switch (info->options & DISC_555_OUT_MASK)
470470         {
471471            case DISC_555_OUT_SQW:
472               node->output = context->flip_flop * context->output_high_voltage;
472               node->output[0] = context->flip_flop * context->output_high_voltage;
473473               /* Fake it to AC if needed */
474474               if (context->output_is_ac)
475                  node->output -= context->output_high_voltage / 2.0;
475                  node->output[0] -= context->output_high_voltage / 2.0;
476476               break;
477477            case DISC_555_OUT_CAP:
478               node->output = vCnext;
478               node->output[0] = vCnext;
479479               /* Fake it to AC if needed */
480480               if (context->output_is_ac)
481                  node->output -= context->threshold * 3.0 /4.0;
481                  node->output[0] -= context->threshold * 3.0 /4.0;
482482               break;
483483         }
484484      }
r2241r2242
514514   context->flip_flop = 0;
515515   context->cap_voltage = 0;
516516
517   node->output = 0;
517   node->output[0] = 0;
518518}
519519
520520
r2241r2242
568568   {
569569      /* We are in RESET */
570570      /* If there was a fatal INIT error then we will also stay in RESET */
571      node->output = 0;
571      node->output[0] = 0;
572572      context->flip_flop = 1;
573573      context->cap_voltage = 0;
574574      return;
r2241r2242
782782         if (count_r && (~context->type & 0x01))
783783         {
784784            /* There has been an immediate discharge, so keep low for 1 sample. */
785            node->output = 0;
785            node->output[0] = 0;
786786         }
787787         else
788            node->output = context->flip_flop * context->output_high_voltage;
788            node->output[0] = context->flip_flop * context->output_high_voltage;
789789         /* Fake it to AC if needed */
790         node->output += context->ac_shift;
790         node->output[0] += context->ac_shift;
791791         break;
792792      case DISC_555_OUT_CAP:
793         node->output = vCnext + context->ac_shift;
793         node->output[0] = vCnext + context->ac_shift;
794794         break;
795795      case DISC_555_OUT_ENERGY:
796         node->output = context->output_high_voltage * (context->flip_flop ? xTime : (1 - xTime));
797         node->output += context->ac_shift;
796         node->output[0] = context->output_high_voltage * (context->flip_flop ? xTime : (1 - xTime));
797         node->output[0] += context->ac_shift;
798798         break;
799799      case DISC_555_OUT_LOGIC_X:
800         node->output = context->flip_flop + xTime;
800         node->output[0] = context->flip_flop + xTime;
801801         break;
802802      case DISC_555_OUT_COUNT_F_X:
803         node->output = count_f + xTime;
803         node->output[0] = count_f + xTime;
804804         break;
805805      case DISC_555_OUT_COUNT_R_X:
806         node->output = count_r + xTime;
806         node->output[0] = count_r + xTime;
807807         break;
808808      case DISC_555_OUT_COUNT_F:
809         node->output = count_f;
809         node->output[0] = count_f;
810810         break;
811811      case DISC_555_OUT_COUNT_R:
812         node->output = count_r;
812         node->output[0] = count_r;
813813         break;
814814   }
815815}
r2241r2242
11201120   switch (context->output_type)
11211121   {
11221122      case DISC_555_OUT_SQW:
1123         node->output = context->flip_flop * context->output_high_voltage + context->ac_shift;
1123         node->output[0] = context->flip_flop * context->output_high_voltage + context->ac_shift;
11241124         break;
11251125      case DISC_555_OUT_CAP:
1126         node->output = vCnext;
1126         node->output[0] = vCnext;
11271127         /* Fake it to AC if needed */
11281128         if (context->output_is_ac)
1129            node->output -= context->threshold * 3.0 /4.0;
1129            node->output[0] -= context->threshold * 3.0 /4.0;
11301130         break;
11311131      case DISC_555_OUT_ENERGY:
1132         node->output = context->output_high_voltage * (context->flip_flop ? xTime : (1 - xTime));
1133         node->output += context->ac_shift;
1132         node->output[0] = context->output_high_voltage * (context->flip_flop ? xTime : (1 - xTime));
1133         node->output[0] += context->ac_shift;
11341134         break;
11351135      case DISC_555_OUT_LOGIC_X:
1136         node->output = context->flip_flop + xTime;
1136         node->output[0] = context->flip_flop + xTime;
11371137         break;
11381138      case DISC_555_OUT_COUNT_F_X:
1139         node->output = count_f ? count_f + xTime : count_f;
1139         node->output[0] = count_f ? count_f + xTime : count_f;
11401140         break;
11411141      case DISC_555_OUT_COUNT_R_X:
1142         node->output =  count_r ? count_r + xTime : count_r;
1142         node->output[0] =  count_r ? count_r + xTime : count_r;
11431143         break;
11441144      case DISC_555_OUT_COUNT_F:
1145         node->output = count_f;
1145         node->output[0] = count_f;
11461146         break;
11471147      case DISC_555_OUT_COUNT_R:
1148         node->output = count_r;
1148         node->output[0] = count_r;
11491149         break;
11501150   }
11511151}
r2241r2242
13081308         case DISC_566_OUT_SQUARE:
13091309         case DISC_566_OUT_LOGIC:
13101310            /* use up any output states */
1311            if (node->output && context->state[0])
1311            if (node->output[0] && context->state[0])
13121312            {
1313               node->output = 0;
1313               node->output[0] = 0;
13141314               context->state[0]--;
13151315            }
1316            else if (!node->output && context->state[1])
1316            else if (!node->output[0] && context->state[1])
13171317            {
1318               node->output = 1;
1318               node->output[0] = 1;
13191319               context->state[1]--;
13201320            }
13211321            else
13221322            {
1323               node->output = context->flip_flop;
1323               node->output[0] = context->flip_flop;
13241324            }
13251325            if ((info->options & DISC_566_OUT_MASK) != DISC_566_OUT_LOGIC)
1326               node->output = context->flip_flop ? context->vSqrHigh : context->vSqrLow;
1326               node->output[0] = context->flip_flop ? context->vSqrHigh : context->vSqrLow;
13271327            break;
13281328         case DISC_566_OUT_TRIANGLE:
13291329            /* we can ignore any unused states when
13301330                 * outputting the cap voltage */
1331            node->output = vCnext;
1331            node->output[0] = vCnext;
13321332            if (info->options & DISC_566_OUT_AC)
1333               node->output -= context->triOffset;
1333               node->output[0] -= context->triOffset;
13341334            break;
13351335      }
13361336   }
13371337   else
1338      node->output = 0;
1338      node->output[0] = 0;
13391339}
13401340
13411341static void dsd_566_reset(node_description *node)
r2241r2242
14341434      switch (context->outtype)
14351435      {
14361436         case DISC_LS624_OUT_ENERGY:
1437            node->output = ((double) lst) * (1.0+context->remain/sample_t) - ((double) context->state) * context->remain/sample_t;
1437            node->output[0] = ((double) lst) * (1.0+context->remain/sample_t) - ((double) context->state) * context->remain/sample_t;
14381438            break;
14391439         case DISC_LS624_OUT_LOGIC:
1440            node->output = context->state;
1440            node->output[0] = context->state;
14411441            break;
14421442         case DISC_LS624_OUT_COUNT_F:
1443            node->output = cntf;
1443            node->output[0] = cntf;
14441444            break;
14451445         case DISC_LS624_OUT_COUNT_R:
1446            node->output = cntr;
1446            node->output[0] = cntr;
14471447            break;
14481448      }
14491449
14501450   }
14511451   else
1452      node->output = 0;
1452      node->output[0] = 0;
14531453}
14541454
14551455static void dsd_ls624_reset(node_description *node)
src/emu/sound/okim6295.c
r2241r2242
604604
605605WRITE16_HANDLER( OKIM6295_data_0_lsb_w )
606606{
607   if (ACCESSING_LSB)
607   if (ACCESSING_BITS_0_7)
608608      OKIM6295_data_w(0, data & 0xff);
609609}
610610
611611WRITE16_HANDLER( OKIM6295_data_1_lsb_w )
612612{
613   if (ACCESSING_LSB)
613   if (ACCESSING_BITS_0_7)
614614      OKIM6295_data_w(1, data & 0xff);
615615}
616616
617617WRITE16_HANDLER( OKIM6295_data_2_lsb_w )
618618{
619   if (ACCESSING_LSB)
619   if (ACCESSING_BITS_0_7)
620620      OKIM6295_data_w(2, data & 0xff);
621621}
622622
623623WRITE16_HANDLER( OKIM6295_data_0_msb_w )
624624{
625   if (ACCESSING_MSB)
625   if (ACCESSING_BITS_8_15)
626626      OKIM6295_data_w(0, data >> 8);
627627}
628628
629629WRITE16_HANDLER( OKIM6295_data_1_msb_w )
630630{
631   if (ACCESSING_MSB)
631   if (ACCESSING_BITS_8_15)
632632      OKIM6295_data_w(1, data >> 8);
633633}
634634
635635WRITE16_HANDLER( OKIM6295_data_2_msb_w )
636636{
637   if (ACCESSING_MSB)
637   if (ACCESSING_BITS_8_15)
638638      OKIM6295_data_w(2, data >> 8);
639639}
640640
src/emu/sound/es5506.c
r2241r2242
14671467
14681468WRITE16_HANDLER( ES5506_data_0_word_w )
14691469{
1470   if (ACCESSING_LSB)
1470   if (ACCESSING_BITS_0_7)
14711471      es5506_reg_write(sndti_token(SOUND_ES5506, 0), offset, data);
14721472}
14731473
14741474WRITE16_HANDLER( ES5506_data_1_word_w )
14751475{
1476   if (ACCESSING_LSB)
1476   if (ACCESSING_BITS_0_7)
14771477      es5506_reg_write(sndti_token(SOUND_ES5506, 1), offset, data);
14781478}
14791479
r2241r2242
15451545   switch (offset)
15461546   {
15471547      case 0x00:   /* CR */
1548         if (ACCESSING_LSB)
1548         if (ACCESSING_BITS_0_7)
15491549         {
15501550#if RAINE_CHECK
15511551            voice->control &= ~(CONTROL_STOPMASK | CONTROL_LOOPMASK | CONTROL_DIR);
r2241r2242
15551555            voice->control |= (data & (CONTROL_STOPMASK | CONTROL_LOOPMASK | CONTROL_IRQE | CONTROL_DIR | CONTROL_IRQ)) |
15561556                          ((data << 12) & CONTROL_BS0);
15571557         }
1558         if (ACCESSING_MSB)
1558         if (ACCESSING_BITS_8_15)
15591559         {
15601560            voice->control &= ~(CONTROL_CA0 | CONTROL_CA1 | CONTROL_LPMASK);
15611561            voice->control |= ((data >> 2) & CONTROL_LPMASK) |
r2241r2242
15671567         break;
15681568
15691569      case 0x01:   /* FC */
1570         if (ACCESSING_LSB)
1570         if (ACCESSING_BITS_0_7)
15711571            voice->freqcount = (voice->freqcount & ~0x001fe) | ((data & 0x00ff) << 1);
1572         if (ACCESSING_MSB)
1572         if (ACCESSING_BITS_8_15)
15731573            voice->freqcount = (voice->freqcount & ~0x1fe00) | ((data & 0xff00) << 1);
15741574         if (LOG_COMMANDS && eslog)
15751575            fprintf(eslog, "%06x:voice %d, freq count=%08x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->freqcount);
15761576         break;
15771577
15781578      case 0x02:   /* STRT (hi) */
1579         if (ACCESSING_LSB)
1579         if (ACCESSING_BITS_0_7)
15801580            voice->start = (voice->start & ~0x03fc0000) | ((data & 0x00ff) << 18);
1581         if (ACCESSING_MSB)
1581         if (ACCESSING_BITS_8_15)
15821582            voice->start = (voice->start & ~0x7c000000) | ((data & 0x1f00) << 18);
15831583         if (LOG_COMMANDS && eslog)
15841584            fprintf(eslog, "%06x:voice %d, loop start=%08x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->start);
15851585         break;
15861586
15871587      case 0x03:   /* STRT (lo) */
1588         if (ACCESSING_LSB)
1588         if (ACCESSING_BITS_0_7)
15891589            voice->start = (voice->start & ~0x00000380) | ((data & 0x00e0) << 2);
1590         if (ACCESSING_MSB)
1590         if (ACCESSING_BITS_8_15)
15911591            voice->start = (voice->start & ~0x0003fc00) | ((data & 0xff00) << 2);
15921592         if (LOG_COMMANDS && eslog)
15931593            fprintf(eslog, "%06x:voice %d, loop start=%08x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->start);
15941594         break;
15951595
15961596      case 0x04:   /* END (hi) */
1597         if (ACCESSING_LSB)
1597         if (ACCESSING_BITS_0_7)
15981598            voice->end = (voice->end & ~0x03fc0000) | ((data & 0x00ff) << 18);
1599         if (ACCESSING_MSB)
1599         if (ACCESSING_BITS_8_15)
16001600            voice->end = (voice->end & ~0x7c000000) | ((data & 0x1f00) << 18);
16011601#if RAINE_CHECK
16021602         voice->control |= CONTROL_STOP0;
r2241r2242
16061606         break;
16071607
16081608      case 0x05:   /* END (lo) */
1609         if (ACCESSING_LSB)
1609         if (ACCESSING_BITS_0_7)
16101610            voice->end = (voice->end & ~0x00000380) | ((data & 0x00e0) << 2);
1611         if (ACCESSING_MSB)
1611         if (ACCESSING_BITS_8_15)
16121612            voice->end = (voice->end & ~0x0003fc00) | ((data & 0xff00) << 2);
16131613#if RAINE_CHECK
16141614         voice->control |= CONTROL_STOP0;
r2241r2242
16181618         break;
16191619
16201620      case 0x06:   /* K2 */
1621         if (ACCESSING_LSB)
1621         if (ACCESSING_BITS_0_7)
16221622            voice->k2 = (voice->k2 & ~0x00f0) | (data & 0x00f0);
1623         if (ACCESSING_MSB)
1623         if (ACCESSING_BITS_8_15)
16241624            voice->k2 = (voice->k2 & ~0xff00) | (data & 0xff00);
16251625         if (LOG_COMMANDS && eslog)
16261626            fprintf(eslog, "%06x:voice %d, K2=%04x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->k2);
16271627         break;
16281628
16291629      case 0x07:   /* K1 */
1630         if (ACCESSING_LSB)
1630         if (ACCESSING_BITS_0_7)
16311631            voice->k1 = (voice->k1 & ~0x00f0) | (data & 0x00f0);
1632         if (ACCESSING_MSB)
1632         if (ACCESSING_BITS_8_15)
16331633            voice->k1 = (voice->k1 & ~0xff00) | (data & 0xff00);
16341634         if (LOG_COMMANDS && eslog)
16351635            fprintf(eslog, "%06x:voice %d, K1=%04x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->k1);
16361636         break;
16371637
16381638      case 0x08:   /* LVOL */
1639         if (ACCESSING_MSB)
1639         if (ACCESSING_BITS_8_15)
16401640            voice->lvol = (voice->lvol & ~0xff00) | (data & 0xff00);
16411641         if (LOG_COMMANDS && eslog)
16421642            fprintf(eslog, "%06x:voice %d, left vol=%04x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->lvol);
16431643         break;
16441644
16451645      case 0x09:   /* RVOL */
1646         if (ACCESSING_MSB)
1646         if (ACCESSING_BITS_8_15)
16471647            voice->rvol = (voice->rvol & ~0xff00) | (data & 0xff00);
16481648         if (LOG_COMMANDS && eslog)
16491649            fprintf(eslog, "%06x:voice %d, right vol=%04x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->rvol);
16501650         break;
16511651
16521652      case 0x0a:   /* ACC (hi) */
1653         if (ACCESSING_LSB)
1653         if (ACCESSING_BITS_0_7)
16541654            voice->accum = (voice->accum & ~0x03fc0000) | ((data & 0x00ff) << 18);
1655         if (ACCESSING_MSB)
1655         if (ACCESSING_BITS_8_15)
16561656            voice->accum = (voice->accum & ~0x7c000000) | ((data & 0x1f00) << 18);
16571657         if (LOG_COMMANDS && eslog)
16581658            fprintf(eslog, "%06x:voice %d, accum=%08x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->accum);
16591659         break;
16601660
16611661      case 0x0b:   /* ACC (lo) */
1662         if (ACCESSING_LSB)
1662         if (ACCESSING_BITS_0_7)
16631663            voice->accum = (voice->accum & ~0x000003fc) | ((data & 0x00ff) << 2);
1664         if (ACCESSING_MSB)
1664         if (ACCESSING_BITS_8_15)
16651665            voice->accum = (voice->accum & ~0x0003fc00) | ((data & 0xff00) << 2);
16661666         if (LOG_COMMANDS && eslog)
16671667            fprintf(eslog, "%06x:voice %d, accum=%08x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->accum);
r2241r2242
16711671         break;
16721672
16731673      case 0x0d:   /* ACT */
1674         if (ACCESSING_LSB)
1674         if (ACCESSING_BITS_0_7)
16751675         {
16761676            chip->active_voices = data & 0x1f;
16771677            chip->sample_rate = chip->master_clock / (16 * (chip->active_voices + 1));
r2241r2242
16861686         break;
16871687
16881688      case 0x0f:   /* PAGE */
1689         if (ACCESSING_LSB)
1689         if (ACCESSING_BITS_0_7)
16901690            chip->current_page = data & 0x7f;
16911691         break;
16921692   }
r2241r2242
16981698   switch (offset)
16991699   {
17001700      case 0x00:   /* CR */
1701         if (ACCESSING_LSB)
1701         if (ACCESSING_BITS_0_7)
17021702         {
17031703            voice->control &= ~(CONTROL_STOPMASK | CONTROL_BS0 | CONTROL_LOOPMASK | CONTROL_IRQE | CONTROL_DIR | CONTROL_IRQ);
17041704            voice->control |= (data & (CONTROL_STOPMASK | CONTROL_LOOPMASK | CONTROL_IRQE | CONTROL_DIR | CONTROL_IRQ)) |
17051705                          ((data << 12) & CONTROL_BS0);
17061706         }
1707         if (ACCESSING_MSB)
1707         if (ACCESSING_BITS_8_15)
17081708         {
17091709            voice->control &= ~(CONTROL_CA0 | CONTROL_CA1 | CONTROL_LPMASK);
17101710            voice->control |= ((data >> 2) & CONTROL_LPMASK) |
r2241r2242
17151715         break;
17161716
17171717      case 0x01:   /* O4(n-1) */
1718         if (ACCESSING_LSB)
1718         if (ACCESSING_BITS_0_7)
17191719            voice->o4n1 = (voice->o4n1 & ~0x00ff) | (data & 0x00ff);
1720         if (ACCESSING_MSB)
1720         if (ACCESSING_BITS_8_15)
17211721            voice->o4n1 = (INT16)((voice->o4n1 & ~0xff00) | (data & 0xff00));
17221722         if (LOG_COMMANDS && eslog)
17231723            fprintf(eslog, "%06x:voice %d, O4(n-1)=%05x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->o4n1 & 0x3ffff);
17241724         break;
17251725
17261726      case 0x02:   /* O3(n-1) */
1727         if (ACCESSING_LSB)
1727         if (ACCESSING_BITS_0_7)
17281728            voice->o3n1 = (voice->o3n1 & ~0x00ff) | (data & 0x00ff);
1729         if (ACCESSING_MSB)
1729         if (ACCESSING_BITS_8_15)
17301730            voice->o3n1 = (INT16)((voice->o3n1 & ~0xff00) | (data & 0xff00));
17311731         if (LOG_COMMANDS && eslog)
17321732            fprintf(eslog, "%06x:voice %d, O3(n-1)=%05x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->o3n1 & 0x3ffff);
17331733         break;
17341734
17351735      case 0x03:   /* O3(n-2) */
1736         if (ACCESSING_LSB)
1736         if (ACCESSING_BITS_0_7)
17371737            voice->o3n2 = (voice->o3n2 & ~0x00ff) | (data & 0x00ff);
1738         if (ACCESSING_MSB)
1738         if (ACCESSING_BITS_8_15)
17391739            voice->o3n2 = (INT16)((voice->o3n2 & ~0xff00) | (data & 0xff00));
17401740         if (LOG_COMMANDS && eslog)
17411741            fprintf(eslog, "%06x:voice %d, O3(n-2)=%05x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->o3n2 & 0x3ffff);
17421742         break;
17431743
17441744      case 0x04:   /* O2(n-1) */
1745         if (ACCESSING_LSB)
1745         if (ACCESSING_BITS_0_7)
17461746            voice->o2n1 = (voice->o2n1 & ~0x00ff) | (data & 0x00ff);
1747         if (ACCESSING_MSB)
1747         if (ACCESSING_BITS_8_15)
17481748            voice->o2n1 = (INT16)((voice->o2n1 & ~0xff00) | (data & 0xff00));
17491749         if (LOG_COMMANDS && eslog)
17501750            fprintf(eslog, "%06x:voice %d, O2(n-1)=%05x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff);
17511751         break;
17521752
17531753      case 0x05:   /* O2(n-2) */
1754         if (ACCESSING_LSB)
1754         if (ACCESSING_BITS_0_7)
17551755            voice->o2n2 = (voice->o2n2 & ~0x00ff) | (data & 0x00ff);
1756         if (ACCESSING_MSB)
1756         if (ACCESSING_BITS_8_15)
17571757            voice->o2n2 = (INT16)((voice->o2n2 & ~0xff00) | (data & 0xff00));
17581758         if (LOG_COMMANDS && eslog)
17591759            fprintf(eslog, "%06x:voice %d, O2(n-2)=%05x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->o2n2 & 0x3ffff);
17601760         break;
17611761
17621762      case 0x06:   /* O1(n-1) */
1763         if (ACCESSING_LSB)
1763         if (ACCESSING_BITS_0_7)
17641764            voice->o1n1 = (voice->o1n1 & ~0x00ff) | (data & 0x00ff);
1765         if (ACCESSING_MSB)
1765         if (ACCESSING_BITS_8_15)
17661766            voice->o1n1 = (INT16)((voice->o1n1 & ~0xff00) | (data & 0xff00));
17671767         if (LOG_COMMANDS && eslog)
17681768            fprintf(eslog, "%06x:voice %d, O1(n-1)=%05x (accum=%08x)\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff, voice->accum);
r2241r2242
17771777         break;
17781778
17791779      case 0x0d:   /* ACT */
1780         if (ACCESSING_LSB)
1780         if (ACCESSING_BITS_0_7)
17811781         {
17821782            chip->active_voices = data & 0x1f;
17831783            chip->sample_rate = chip->master_clock / (16 * (chip->active_voices + 1));
r2241r2242
17921792         break;
17931793
17941794      case 0x0f:   /* PAGE */
1795         if (ACCESSING_LSB)
1795         if (ACCESSING_BITS_0_7)
17961796            chip->current_page = data & 0x7f;
17971797         break;
17981798   }
r2241r2242
18211821         break;
18221822
18231823      case 0x0d:   /* ACT */
1824         if (ACCESSING_LSB)
1824         if (ACCESSING_BITS_0_7)
18251825         {
18261826            chip->active_voices = data & 0x1f;
18271827            chip->sample_rate = chip->master_clock / (16 * (chip->active_voices + 1));
r2241r2242
18361836         break;
18371837
18381838      case 0x0f:   /* PAGE */
1839         if (ACCESSING_LSB)
1839         if (ACCESSING_BITS_0_7)
18401840            chip->current_page = data & 0x7f;
18411841         break;
18421842   }
src/emu/sound/disc_wav.c
r2241r2242
204204   if (DSS_COUNTER__RESET)
205205   {
206206      context->count = DSS_COUNTER__INIT;
207      node->output = context->is_7492 ? 0 : context->count;
207      node->output[0] = context->is_7492 ? 0 : context->count;
208208      return;
209209   }
210210
r2241r2242
246246         if (context->count > max) context->count = 0;
247247      }
248248
249      node->output = context->is_7492 ? disc_7492_count[context->count] : context->count;
249      node->output[0] = context->is_7492 ? disc_7492_count[context->count] : context->count;
250250
251251      if (context->count != last_count)
252252      {
r2241r2242
255255         {
256256            case DISC_OUT_IS_ENERGY:
257257               if (xTime != 0)
258                  node->output = (context->count > last_count) ? (last_count + xTime) : (last_count - xTime);
258                  node->output[0] = (context->count > last_count) ? (last_count + xTime) : (last_count - xTime);
259259               break;
260260            case DISC_OUT_HAS_XTIME:
261               node->output += xTime;
261               node->output[0] += xTime;
262262               break;
263263         }
264264      }
265265   }
266266   else
267      node->output = context->count;
267      node->output[0] = context->count;
268268}
269269
270270static void dss_counter_reset(node_description *node)
r2241r2242
280280   else
281281      context->is_7492 = 0;
282282   if ((context->clock_type < DISC_CLK_ON_F_EDGE) || (context->clock_type > DISC_CLK_IS_FREQ))
283      discrete_log("Invalid clock type passed in NODE_%d\n", node->node - NODE_START);
283      discrete_log("Invalid clock type passed in NODE_%d\n", NODE_INDEX(node->node));
284284   context->last = 0;
285285   if (context->clock_type == DISC_CLK_IS_FREQ) context->t_clock = 1.0 / DSS_COUNTER__CLOCK;
286286   context->t_left = 0;
287287   context->count = DSS_COUNTER__INIT; /* count starts at reset value */
288   node->output = DSS_COUNTER__INIT;
288   node->output[0] = DSS_COUNTER__INIT;
289289}
290290
291291
r2241r2242
446446
447447      /* Now select the output bit */
448448      if (context->out_is_f0)
449         node->output = fbresult & 0x01;
449         node->output[0] = fbresult & 0x01;
450450      else
451         node->output=((context->lfsr_reg)>>(lfsr_desc->output_bit))&0x01;
451         node->output[0]=((context->lfsr_reg)>>(lfsr_desc->output_bit))&0x01;
452452
453453      /* Final inversion if required */
454      if(context->invert_output) node->output=(node->output)?0.0:1.0;
454      if(context->invert_output) node->output[0]=(node->output[0])?0.0:1.0;
455455
456456      /* Gain stage */
457      node->output=(node->output)?(DSS_LFSR_NOISE__AMP)/2:-(DSS_LFSR_NOISE__AMP)/2;
457      node->output[0]=(node->output[0])?(DSS_LFSR_NOISE__AMP)/2:-(DSS_LFSR_NOISE__AMP)/2;
458458      /* Bias input as required */
459      node->output=node->output+DSS_LFSR_NOISE__BIAS;
459      node->output[0]=node->output[0]+DSS_LFSR_NOISE__BIAS;
460460   }
461461
462462   if(!DSS_LFSR_NOISE__ENABLE)
463463   {
464      node->output=0;
464      node->output[0]=0;
465465   }
466466}
467467
r2241r2242
476476   context->out_is_f0 = (lfsr_desc->flags & DISC_LFSR_FLAG_OUTPUT_F0) ? 1 : 0;
477477
478478   if ((lfsr_desc->clock_type < DISC_CLK_ON_F_EDGE) || (lfsr_desc->clock_type > DISC_CLK_IS_FREQ))
479      discrete_log("Invalid clock type passed in NODE_%d\n", node->node - NODE_START);
479      discrete_log("Invalid clock type passed in NODE_%d\n", NODE_INDEX(node->node));
480480   context->last = (DSS_COUNTER__CLOCK != 0);
481481   if (lfsr_desc->clock_type == DISC_CLK_IS_FREQ) context->t_clock = 1.0 / DSS_LFSR_NOISE__CLOCK;
482482   context->t_left = 0;
r2241r2242
492492   context->lfsr_reg=dss_lfsr_function(DISC_LFSR_REPLACE,(context->lfsr_reg), fbresult<<(lfsr_desc->bitlength), ((2<<(lfsr_desc->bitlength))-1));
493493
494494   /* Now select and setup the output bit */
495   node->output=((context->lfsr_reg)>>(lfsr_desc->output_bit))&0x01;
495   node->output[0]=((context->lfsr_reg)>>(lfsr_desc->output_bit))&0x01;
496496
497497   /* Final inversion if required */
498   if(lfsr_desc->flags&DISC_LFSR_FLAG_OUT_INVERT) node->output=(node->output)?0.0:1.0;
498   if(lfsr_desc->flags&DISC_LFSR_FLAG_OUT_INVERT) node->output[0]=(node->output[0])?0.0:1.0;
499499
500500   /* Gain stage */
501   node->output=(node->output)?(DSS_LFSR_NOISE__AMP)/2:-(DSS_LFSR_NOISE__AMP)/2;
501   node->output[0]=(node->output[0])?(DSS_LFSR_NOISE__AMP)/2:-(DSS_LFSR_NOISE__AMP)/2;
502502   /* Bias input as required */
503   node->output=node->output+DSS_LFSR_NOISE__BIAS;
503   node->output[0]=node->output[0]+DSS_LFSR_NOISE__BIAS;
504504}
505505
506506
r2241r2242
532532         int newval = (mame_rand(Machine) & 0x7fff) - 16384;
533533
534534         /* make sure the peak to peak values are the amplitude */
535         node->output = DSS_NOISE__AMP / 2;
535         node->output[0] = DSS_NOISE__AMP / 2;
536536         if (newval > 0)
537            node->output *= ((double)newval / 16383);
537            node->output[0] *= ((double)newval / 16383);
538538         else
539            node->output *= ((double)newval / 16384);
539            node->output[0] *= ((double)newval / 16384);
540540
541541         /* Add DC Bias component */
542         node->output += DSS_NOISE__BIAS;
542         node->output[0] += DSS_NOISE__BIAS;
543543      }
544544   }
545545   else
546546   {
547      node->output = 0;
547      node->output[0] = 0;
548548   }
549549
550550   /* Keep the new phasor in the 2Pi range.*/
r2241r2242
651651         }
652652      }
653653
654      node->output = context->count2;
654      node->output[0] = context->count2;
655655      if (context->count2 != last_count2)
656656      {
657657         /* the xTime is only output if the output changed. */
r2241r2242
659659         {
660660            case DISC_OUT_IS_ENERGY:
661661               if (xTime != 0)
662                  node->output = (context->count2 > last_count2) ? (last_count2 + xTime) : (last_count2 - xTime);
662                  node->output[0] = (context->count2 > last_count2) ? (last_count2 + xTime) : (last_count2 - xTime);
663663               break;
664664            case DISC_OUT_HAS_XTIME:
665               node->output += xTime;
665               node->output[0] += xTime;
666666               break;
667667         }
668668      }
669669   }
670670   else
671      node->output = 0;
671      node->output[0] = 0;
672672}
673673
674674static void dss_note_reset(node_description *node)
r2241r2242
685685   context->count2 = 0;
686686   context->max1 = (int)DSS_NOTE__MAX1;
687687   context->max2 = (int)DSS_NOTE__MAX2;
688   node->output = 0;
688   node->output[0] = 0;
689689}
690690
691691/************************************************************************
r2241r2242
867867            /* squarewave to happen in the sample time causing it to be missed. */
868868            /* If we toggle 2 states we force the missed output for 1 sample. */
869869            /* If more then 2 states happen, there is no hope, the sample rate is just too low. */
870            node->output = context->high_out_V * (context->flip_flop ? 0 : 1);
870            node->output[0] = context->high_out_V * (context->flip_flop ? 0 : 1);
871871         else
872            node->output = context->high_out_V * context->flip_flop;
872            node->output[0] = context->high_out_V * context->flip_flop;
873873      }
874874      else
875         node->output = context->vCap;
875         node->output[0] = context->vCap;
876876   }
877877   else
878878   {
879879         /* we will just output 0 for oscillators that have no real enable. */
880         node->output = 0;
880         node->output[0] = 0;
881881   }
882882}
883883
r2241r2242
901901      if IS_VALUE_A_NODE(*r_info_ptr)
902902      {
903903         r_node = discrete_find_node(NULL, *r_info_ptr);
904         *r_context_ptr = &(r_node->output);
904         *r_context_ptr = &(r_node->output[NODE_CHILD_NODE_NUM((int)*r_info_ptr)]);
905905      }
906906      else
907907         *r_context_ptr = r_info_ptr;
r2241r2242
10301030
10311031   if(DSS_SAWTOOTHWAVE__ENABLE)
10321032   {
1033      node->output=(context->type==0)?context->phase*(DSS_SAWTOOTHWAVE__AMP/(2.0*M_PI)):DSS_SAWTOOTHWAVE__AMP-(context->phase*(DSS_SAWTOOTHWAVE__AMP/(2.0*M_PI)));
1034      node->output-=DSS_SAWTOOTHWAVE__AMP/2.0;
1033      node->output[0]=(context->type==0)?context->phase*(DSS_SAWTOOTHWAVE__AMP/(2.0*M_PI)):DSS_SAWTOOTHWAVE__AMP-(context->phase*(DSS_SAWTOOTHWAVE__AMP/(2.0*M_PI)));
1034      node->output[0]-=DSS_SAWTOOTHWAVE__AMP/2.0;
10351035      /* Add DC Bias component */
1036      node->output=node->output+DSS_SAWTOOTHWAVE__BIAS;
1036      node->output[0]=node->output[0]+DSS_SAWTOOTHWAVE__BIAS;
10371037   }
10381038   else
10391039   {
1040      node->output=0;
1040      node->output[0]=0;
10411041   }
10421042
10431043   /* Work out the phase step based on phase/freq & sample rate */
r2241r2242
11431143   switch (context->enable_type)
11441144   {
11451145      case DISC_SCHMITT_OSC_ENAB_IS_AND:
1146         node->output = DSS_SCHMITT_OSC__ENABLE && context->state;
1146         node->output[0] = DSS_SCHMITT_OSC__ENABLE && context->state;
11471147         break;
11481148      case DISC_SCHMITT_OSC_ENAB_IS_NAND:
1149         node->output = !(DSS_SCHMITT_OSC__ENABLE && context->state);
1149         node->output[0] = !(DSS_SCHMITT_OSC__ENABLE && context->state);
11501150         break;
11511151      case DISC_SCHMITT_OSC_ENAB_IS_OR:
1152         node->output = DSS_SCHMITT_OSC__ENABLE || context->state;
1152         node->output[0] = DSS_SCHMITT_OSC__ENABLE || context->state;
11531153         break;
11541154      case DISC_SCHMITT_OSC_ENAB_IS_NOR:
1155         node->output = !(DSS_SCHMITT_OSC__ENABLE || context->state);
1155         node->output[0] = !(DSS_SCHMITT_OSC__ENABLE || context->state);
11561156         break;
11571157   }
1158   node->output *= DSS_SCHMITT_OSC__AMP;
1158   node->output[0] *= DSS_SCHMITT_OSC__AMP;
11591159}
11601160
11611161static void dss_schmitt_osc_reset(node_description *node)
r2241r2242
11831183   context->vCap = 0;
11841184   context->state = 1;
11851185
1186   node->output = info->options ? 0 : DSS_SCHMITT_OSC__AMP;
1186   node->output[0] = info->options ? 0 : DSS_SCHMITT_OSC__AMP;
11871187}
11881188
11891189
r2241r2242
12111211   /* Set the output */
12121212   if(DSS_SINEWAVE__ENABLE)
12131213   {
1214      node->output=(DSS_SINEWAVE__AMPL/2.0) * sin(context->phase);
1214      node->output[0]=(DSS_SINEWAVE__AMPL/2.0) * sin(context->phase);
12151215      /* Add DC Bias component */
1216      node->output=node->output+DSS_SINEWAVE__BIAS;
1216      node->output[0]=node->output[0]+DSS_SINEWAVE__BIAS;
12171217   }
12181218   else
12191219   {
1220      node->output=0;
1220      node->output[0]=0;
12211221   }
12221222
12231223   /* Work out the phase step based on phase/freq & sample rate */
r2241r2242
12741274   if(DSS_SQUAREWAVE__ENABLE)
12751275   {
12761276      if(context->phase>context->trigger)
1277         node->output=(DSS_SQUAREWAVE__AMP/2.0);
1277         node->output[0]=(DSS_SQUAREWAVE__AMP/2.0);
12781278      else
1279         node->output=-(DSS_SQUAREWAVE__AMP/2.0);
1279         node->output[0]=-(DSS_SQUAREWAVE__AMP/2.0);
12801280
12811281      /* Add DC Bias component */
1282      node->output=node->output+DSS_SQUAREWAVE__BIAS;
1282      node->output[0]=node->output[0]+DSS_SQUAREWAVE__BIAS;
12831283   }
12841284   else
12851285   {
1286      node->output=0;
1286      node->output[0]=0;
12871287   }
12881288
12891289   /* Work out the phase step based on phase/freq & sample rate */
r2241r2242
13501350      context->tOn = context->tOff * (DSS_SQUAREWFIX__DUTY / 100.0);
13511351      context->tOff -= context->tOn;
13521352
1353      node->output = (context->flip_flop ? DSS_SQUAREWFIX__AMP / 2.0 : -(DSS_SQUAREWFIX__AMP / 2.0)) + DSS_SQUAREWFIX__BIAS;
1353      node->output[0] = (context->flip_flop ? DSS_SQUAREWFIX__AMP / 2.0 : -(DSS_SQUAREWFIX__AMP / 2.0)) + DSS_SQUAREWFIX__BIAS;
13541354   }
13551355   else
13561356   {
1357      node->output=0;
1357      node->output[0]=0;
13581358   }
13591359}
13601360
r2241r2242
14291429      context->phase = fmod(newphase, 2.0 * M_PI);
14301430
14311431      if(context->phase>context->trigger)
1432         node->output=(DSS_SQUAREWAVE2__AMP/2.0);
1432         node->output[0]=(DSS_SQUAREWAVE2__AMP/2.0);
14331433      else
1434         node->output=-(DSS_SQUAREWAVE2__AMP/2.0);
1434         node->output[0]=-(DSS_SQUAREWAVE2__AMP/2.0);
14351435
14361436      /* Add DC Bias component */
1437      node->output = node->output + DSS_SQUAREWAVE2__BIAS;
1437      node->output[0] = node->output[0] + DSS_SQUAREWAVE2__BIAS;
14381438   }
14391439   else
14401440   {
1441      node->output=0;
1441      node->output[0]=0;
14421442   }
14431443}
14441444
r2241r2242
15891589   context->vCap += diff;
15901590   context->vG2_old = vG2;
15911591   if ((info->options & DISC_OSC_INVERTER_TYPE_MASK)==DISC_OSC_INVERTER_IS_TYPE3)
1592      node->output = vG1;
1592      node->output[0] = vG1;
15931593   else
1594      node->output = vG3;
1594      node->output[0] = vG3;
15951595   if (info->options & DISC_OSC_INVERTER_OUT_IS_LOGIC)
1596      node->output = (node->output > info->vInFall);
1596      node->output[0] = (node->output[0] > info->vInFall);
15971597}
15981598
15991599static void dss_inverter_osc_reset(node_description *node)
r2241r2242
16041604   /* exponent */
16051605   context->w = -1.0 / (DSS_INVERTER_OSC__RC * DSS_INVERTER_OSC__C);
16061606   context->wc = -1.0 / ((DSS_INVERTER_OSC__RC * DSS_INVERTER_OSC__RP) / (DSS_INVERTER_OSC__RP + DSS_INVERTER_OSC__RC) * DSS_INVERTER_OSC__C);
1607   node->output = 0;
1607   node->output[0] = 0;
16081608   context->vCap = 0;
16091609   context->vG2_old = 0;
16101610   context->Rp = DSS_INVERTER_OSC__RP;
r2241r2242
16391639
16401640   if(DSS_TRIANGLEWAVE__ENABLE)
16411641   {
1642      node->output=context->phase < M_PI ? (DSS_TRIANGLEWAVE__AMP * (context->phase / (M_PI/2.0) - 1.0))/2.0 :
1642      node->output[0]=context->phase < M_PI ? (DSS_TRIANGLEWAVE__AMP * (context->phase / (M_PI/2.0) - 1.0))/2.0 :
16431643                           (DSS_TRIANGLEWAVE__AMP * (3.0 - context->phase / (M_PI/2.0)))/2.0 ;
16441644
16451645      /* Add DC Bias component */
1646      node->output=node->output+DSS_TRIANGLEWAVE__BIAS;
1646      node->output[0]=node->output[0]+DSS_TRIANGLEWAVE__BIAS;
16471647   }
16481648   else
16491649   {
1650      node->output=0;
1650      node->output[0]=0;
16511651   }
16521652
16531653   /* Work out the phase step based on phase/freq & sample rate */
r2241r2242
16921692
16931693   if(DSS_ADSR__ENABLE)
16941694   {
1695      node->output=0;
1695      node->output[0]=0;
16961696   }
16971697   else
16981698   {
1699      node->output=0;
1699      node->output[0]=0;
17001700   }
17011701}
17021702
src/emu/sound/2151intf.c
r2241r2242
166166
167167WRITE16_HANDLER( YM2151_register_port_0_lsb_w )
168168{
169   if (ACCESSING_LSB)
169   if (ACCESSING_BITS_0_7)
170170      YM2151_register_port_0_w(machine, 0, data & 0xff);
171171}
172172
173173WRITE16_HANDLER( YM2151_register_port_1_lsb_w )
174174{
175   if (ACCESSING_LSB)
175   if (ACCESSING_BITS_0_7)
176176      YM2151_register_port_1_w(machine, 0, data & 0xff);
177177}
178178
179179WRITE16_HANDLER( YM2151_register_port_2_lsb_w )
180180{
181   if (ACCESSING_LSB)
181   if (ACCESSING_BITS_0_7)
182182      YM2151_register_port_2_w(machine, 0, data & 0xff);
183183}
184184
185185WRITE16_HANDLER( YM2151_data_port_0_lsb_w )
186186{
187   if (ACCESSING_LSB)
187   if (ACCESSING_BITS_0_7)
188188      YM2151_data_port_0_w(machine, 0, data & 0xff);
189189}
190190
191191WRITE16_HANDLER( YM2151_data_port_1_lsb_w )
192192{
193   if (ACCESSING_LSB)
193   if (ACCESSING_BITS_0_7)
194194      YM2151_data_port_1_w(machine, 0, data & 0xff);
195195}
196196
197197WRITE16_HANDLER( YM2151_data_port_2_lsb_w )
198198{
199   if (ACCESSING_LSB)
199   if (ACCESSING_BITS_0_7)
200200      YM2151_data_port_2_w(machine, 0, data & 0xff);
201201}
202202
src/emu/sound/psx.c
r2241r2242
377377      switch( offset % 4 )
378378      {
379379      case SPU_CHANNEL_REG( 0x8 ):
380         if( ACCESSING_LSW32 )
380         if( ACCESSING_BITS_0_15 )
381381         {
382382            verboselog( 1, "psx_spu_r() channel %d attack/decay/sustain = %04x\n", n_channel, chip->m_p_n_attackdecaysustain[ n_channel ] );
383383         }
384         if( ACCESSING_MSW32 )
384         if( ACCESSING_BITS_16_31 )
385385         {
386386            verboselog( 1, "psx_spu_r() channel %d sustain/release = %04x\n", n_channel, chip->m_p_n_sustainrelease[ n_channel ] );
387387         }
388388         return ( chip->m_p_n_sustainrelease[ n_channel ] << 16 ) | chip->m_p_n_attackdecaysustain[ n_channel ];
389389      case SPU_CHANNEL_REG( 0xc ):
390         if( ACCESSING_LSW32 )
390         if( ACCESSING_BITS_0_15 )
391391         {
392392            verboselog( 1, "psx_spu_r() channel %d adsr volume = %04x\n", n_channel, chip->m_p_n_adsrvolume[ n_channel ] );
393393         }
394         if( ACCESSING_MSW32 )
394         if( ACCESSING_BITS_16_31 )
395395         {
396396            verboselog( 1, "psx_spu_r() channel %d repeat address = %04x\n", n_channel, chip->m_p_n_repeataddress[ n_channel ] );
397397         }
r2241r2242
446446      switch( offset % 4 )
447447      {
448448      case SPU_CHANNEL_REG( 0x0 ):
449         if( ACCESSING_LSW32 )
449         if( ACCESSING_BITS_0_15 )
450450         {
451451            chip->m_p_n_volumeleft[ n_channel ] = data & 0xffff;
452452            verboselog( 1, "psx_spu_w() channel %d volume left = %04x\n", n_channel, chip->m_p_n_volumeleft[ n_channel ] );
453453         }
454         if( ACCESSING_MSW32 )
454         if( ACCESSING_BITS_16_31 )
455455         {
456456            chip->m_p_n_volumeright[ n_channel ] = data >> 16;
457457            verboselog( 1, "psx_spu_w() channel %d volume right = %04x\n", n_channel, chip->m_p_n_volumeright[ n_channel ] );
458458         }
459459         break;
460460      case SPU_CHANNEL_REG( 0x4 ):
461         if( ACCESSING_LSW32 )
461         if( ACCESSING_BITS_0_15 )
462462         {
463463            chip->m_p_n_pitch[ n_channel ] = data & 0xffff;
464464            verboselog( 1, "psx_spu_w() channel %d pitch = %04x\n", n_channel, chip->m_p_n_pitch[ n_channel ] );
465465         }
466         if( ACCESSING_MSW32 )
466         if( ACCESSING_BITS_16_31 )
467467         {
468468            chip->m_p_n_address[ n_channel ] = data >> 16;
469469            verboselog( 1, "psx_spu_w() channel %d address = %04x\n", n_channel, chip->m_p_n_address[ n_channel ] );
470470         }
471471         break;
472472      case SPU_CHANNEL_REG( 0x8 ):
473         if( ACCESSING_LSW32 )
473         if( ACCESSING_BITS_0_15 )
474474         {
475475            chip->m_p_n_attackdecaysustain[ n_channel ] = data & 0xffff;
476476            verboselog( 1, "psx_spu_w() channel %d attack/decay/sustain = %04x\n", n_channel, chip->m_p_n_attackdecaysustain[ n_channel ] );
477477         }
478         if( ACCESSING_MSW32 )
478         if( ACCESSING_BITS_16_31 )
479479         {
480480            chip->m_p_n_sustainrelease[ n_channel ] = data >> 16;
481481            verboselog( 1, "psx_spu_w() channel %d sustain/release = %04x\n", n_channel, chip->m_p_n_sustainrelease[ n_channel ] );
482482         }
483483         break;
484484      case SPU_CHANNEL_REG( 0xc ):
485         if( ACCESSING_LSW32 )
485         if( ACCESSING_BITS_0_15 )
486486         {
487487            chip->m_p_n_adsrvolume[ n_channel ] = data & 0xffff;
488488            verboselog( 1, "psx_spu_w() channel %d adsr volume = %04x\n", n_channel, chip->m_p_n_adsrvolume[ n_channel ] );
489489         }
490         if( ACCESSING_MSW32 )
490         if( ACCESSING_BITS_16_31 )
491491         {
492492            chip->m_p_n_repeataddress[ n_channel ] = data >> 16;
493493            verboselog( 1, "psx_spu_w() channel %d repeat address = %04x\n", n_channel, chip->m_p_n_repeataddress[ n_channel ] );
r2241r2242
503503      switch( offset )
504504      {
505505      case SPU_REG( 0xd80 ):
506         if( ACCESSING_LSW32 )
506         if( ACCESSING_BITS_0_15 )
507507         {
508508            chip->m_n_mainvolumeleft = data & 0xffff;
509509            verboselog( 1, "psx_spu_w() main volume left = %04x\n", chip->m_n_mainvolumeleft );
510510         }
511         if( ACCESSING_MSW32 )
511         if( ACCESSING_BITS_16_31 )
512512         {
513513            chip->m_n_mainvolumeright = data >> 16;
514514            verboselog( 1, "psx_spu_w() main volume right = %04x\n", chip->m_n_mainvolumeright );
515515         }
516516         break;
517517      case SPU_REG( 0xd84 ):
518         if( ACCESSING_LSW32 )
518         if( ACCESSING_BITS_0_15 )
519519         {
520520            chip->m_n_reverberationdepthleft = data & 0xffff;
521521            verboselog( 1, "psx_spu_w() reverberation depth left = %04x\n", chip->m_n_reverberationdepthleft );
522522         }
523         if( ACCESSING_MSW32 )
523         if( ACCESSING_BITS_16_31 )
524524         {
525525            chip->m_n_reverberationdepthright = data >> 16;
526526            verboselog( 1, "psx_spu_w() reverberation depth right = %04x\n", chip->m_n_reverberationdepthright );
r2241r2242
564564         verboselog( 1, "psx_spu_w() channel on/off = %08x\n", chip->m_n_channelonoff );
565565         break;
566566      case SPU_REG( 0xda0 ):
567         if( ACCESSING_LSW32 )
567         if( ACCESSING_BITS_0_15 )
568568         {
569569            verboselog( 0, "psx_spu_w( %08x, %08x, %08x ) %08x\n", offset, mem_mask, data, 0xc00 + ( offset * 4 ) );
570570         }
571         if( ACCESSING_MSW32 )
571         if( ACCESSING_BITS_16_31 )
572572         {
573573            chip->m_n_reverbworkareastart = data >> 16;
574574            verboselog( 1, "psx_spu_w() reverb work area start = %04x\n", chip->m_n_reverbworkareastart );
575575         }
576576         break;
577577      case SPU_REG( 0xda4 ):
578         if( ACCESSING_LSW32 )
578         if( ACCESSING_BITS_0_15 )
579579         {
580580            chip->m_n_irqaddress = data & 0xffff;
581581            verboselog( 1, "psx_spu_w() irq address = %04x\n", chip->m_n_irqaddress );
582582         }
583         if( ACCESSING_MSW32 )
583         if( ACCESSING_BITS_16_31 )
584584         {
585585            chip->m_n_spuoffset = ( data >> 16 ) * 4;
586586            chip->m_n_spuoffset %= ( SPU_RAM_SIZE / 2 );
r2241r2242
588588         }
589589         break;
590590      case SPU_REG( 0xda8 ):
591         if( ACCESSING_LSW32 )
591         if( ACCESSING_BITS_0_15 )
592592         {
593593            chip->m_n_spudata = data & 0xffff;
594594            chip->m_p_n_spuram[ chip->m_n_spuoffset++ ] = chip->m_n_spudata;
595595            chip->m_n_spuoffset %= ( SPU_RAM_SIZE / 2 );
596596            verboselog( 1, "psx_spu_w() spu data = %04x\n", chip->m_n_spudata );
597597         }
598         if( ACCESSING_MSW32 )
598         if( ACCESSING_BITS_16_31 )
599599         {
600600            chip->m_n_spucontrol = data >> 16;
601601            verboselog( 1, "psx_spu_w() spu control = %04x\n", chip->m_n_spucontrol );
r2241r2242
607607         verboselog( 1, "psx_spu_w() spu status = %08x\n", chip->m_n_spustatus );
608608         break;
609609      case SPU_REG( 0xdb0 ):
610         if( ACCESSING_LSW32 )
610         if( ACCESSING_BITS_0_15 )
611611         {
612612            chip->m_n_cdvolumeleft = data & 0xffff;
613613            verboselog( 1, "psx_spu_w() cd volume left = %04x\n", chip->m_n_cdvolumeleft );
614614         }
615         if( ACCESSING_MSW32 )
615         if( ACCESSING_BITS_16_31 )
616616         {
617617            chip->m_n_cdvolumeright = data >> 16;
618618            verboselog( 1, "psx_spu_w() cd volume right = %04x\n", chip->m_n_cdvolumeright );
619619         }
620620         break;
621621      case SPU_REG( 0xdb4 ):
622         if( ACCESSING_LSW32 )
622         if( ACCESSING_BITS_0_15 )
623623         {
624624            chip->m_n_externalvolumeleft = data & 0xffff;
625625            verboselog( 1, "psx_spu_w() external volume left = %04x\n", chip->m_n_externalvolumeleft );
626626         }
627         if( ACCESSING_MSW32 )
627         if( ACCESSING_BITS_16_31 )
628628         {
629629            chip->m_n_externalvolumeright = data >> 16;
630630            verboselog( 1, "psx_spu_w() external volume right = %04x\n", chip->m_n_externalvolumeright );
src/emu/sound/k053260.c
r2241r2242
428428
429429WRITE16_HANDLER( K053260_0_lsb_w )
430430{
431   if (ACCESSING_LSB)
431   if (ACCESSING_BITS_0_7)
432432      K053260_0_w (machine, offset, data & 0xff);
433433}
434434
r2241r2242
439439
440440WRITE16_HANDLER( K053260_1_lsb_w )
441441{
442   if (ACCESSING_LSB)
442   if (ACCESSING_BITS_0_7)
443443      K053260_1_w (machine, offset, data & 0xff);
444444}
445445
src/emu/sound/2413intf.c
r2241r2242
139139WRITE8_HANDLER( YM2413_data_port_2_w ) { struct ym2413_info *info = sndti_token(SOUND_YM2413, 2); YM2413Write (info->chip, 1, data); } /* 3rd chip */
140140WRITE8_HANDLER( YM2413_data_port_3_w ) { struct ym2413_info *info = sndti_token(SOUND_YM2413, 3); YM2413Write (info->chip, 1, data); } /* 4th chip */
141141
142WRITE16_HANDLER( YM2413_register_port_0_lsb_w ) { if (ACCESSING_LSB) YM2413_register_port_0_w(machine,offset,data & 0xff); }
143WRITE16_HANDLER( YM2413_register_port_0_msb_w ) { if (ACCESSING_MSB) YM2413_register_port_0_w(machine,offset,((data & 0xff00) >> 8)); }
144WRITE16_HANDLER( YM2413_register_port_1_lsb_w ) { if (ACCESSING_LSB) YM2413_register_port_1_w(machine,offset,data & 0xff); }
145WRITE16_HANDLER( YM2413_register_port_2_lsb_w ) { if (ACCESSING_LSB) YM2413_register_port_2_w(machine,offset,data & 0xff); }
146WRITE16_HANDLER( YM2413_register_port_3_lsb_w ) { if (ACCESSING_LSB) YM2413_register_port_3_w(machine,offset,data & 0xff); }
147WRITE16_HANDLER( YM2413_data_port_0_lsb_w ) { if (ACCESSING_LSB) YM2413_data_port_0_w(machine,offset,data & 0xff); }
148WRITE16_HANDLER( YM2413_data_port_0_msb_w ) { if (ACCESSING_MSB) YM2413_data_port_0_w(machine,offset,((data & 0xff00) >> 8)); }
149WRITE16_HANDLER( YM2413_data_port_1_lsb_w ) { if (ACCESSING_LSB) YM2413_data_port_1_w(machine,offset,data & 0xff); }
150WRITE16_HANDLER( YM2413_data_port_2_lsb_w ) { if (ACCESSING_LSB) YM2413_data_port_2_w(machine,offset,data & 0xff); }
151WRITE16_HANDLER( YM2413_data_port_3_lsb_w ) { if (ACCESSING_LSB) YM2413_data_port_3_w(machine,offset,data & 0xff); }
142WRITE16_HANDLER( YM2413_register_port_0_lsb_w ) { if (ACCESSING_BITS_0_7) YM2413_register_port_0_w(machine,offset,data & 0xff); }
143WRITE16_HANDLER( YM2413_register_port_0_msb_w ) { if (ACCESSING_BITS_8_15) YM2413_register_port_0_w(machine,offset,((data & 0xff00) >> 8)); }
144WRITE16_HANDLER( YM2413_register_port_1_lsb_w ) { if (ACCESSING_BITS_0_7) YM2413_register_port_1_w(machine,offset,data & 0xff); }
145WRITE16_HANDLER( YM2413_register_port_2_lsb_w ) { if (ACCESSING_BITS_0_7) YM2413_register_port_2_w(machine,offset,data & 0xff); }
146WRITE16_HANDLER( YM2413_register_port_3_lsb_w ) { if (ACCESSING_BITS_0_7) YM2413_register_port_3_w(machine,offset,data & 0xff); }
147WRITE16_HANDLER( YM2413_data_port_0_lsb_w ) { if (ACCESSING_BITS_0_7) YM2413_data_port_0_w(machine,offset,data & 0xff); }
148WRITE16_HANDLER( YM2413_data_port_0_msb_w ) { if (ACCESSING_BITS_8_15) YM2413_data_port_0_w(machine,offset,((data & 0xff00) >> 8)); }
149WRITE16_HANDLER( YM2413_data_port_1_lsb_w ) { if (ACCESSING_BITS_0_7) YM2413_data_port_1_w(machine,offset,data & 0xff); }
150WRITE16_HANDLER( YM2413_data_port_2_lsb_w ) { if (ACCESSING_BITS_0_7) YM2413_data_port_2_w(machine,offset,data & 0xff); }
151WRITE16_HANDLER( YM2413_data_port_3_lsb_w ) { if (ACCESSING_BITS_0_7) YM2413_data_port_3_w(machine,offset,data & 0xff); }
152152
153153
154154/**************************************************************************
src/emu/sound/disc_flt.c
r2241r2242
9191   double   vCap;
9292};
9393
94struct dst_rcfilter_sw_context
95{
96   double   vCap[4];
97};
9498
9599/************************************************************************
96100 *
r2241r2242
115119
116120   if(DST_CRFILTER__ENABLE)
117121   {
118      node->output = DST_CRFILTER__IN - context->vCap;
122      node->output[0] = DST_CRFILTER__IN - context->vCap;
119123      context->vCap += ((DST_CRFILTER__IN - DST_CRFILTER__VREF) - context->vCap) * context->exponent;
120124   }
121125   else
122126   {
123      node->output = 0;
127      node->output[0] = 0;
124128   }
125129}
126130
r2241r2242
131135   context->exponent = -1.0 / (DST_CRFILTER__R * DST_CRFILTER__C * discrete_current_context->sample_rate);
132136   context->exponent = 1.0 - exp(context->exponent);
133137   context->vCap = 0;
134   node->output = DST_CRFILTER__IN;
138   node->output[0] = DST_CRFILTER__IN;
135139}
136140
137141
r2241r2242
187191      gain = 0.0;
188192   }
189193
190   node->output = -context->a1*context->y1 + context->b0*gain*DST_FILTER1__IN + context->b1*context->x1;
194   node->output[0] = -context->a1*context->y1 + context->b0*gain*DST_FILTER1__IN + context->b1*context->x1;
191195
192196   context->x1 = gain*DST_FILTER1__IN;
193   context->y1 = node->output;
197   context->y1 = node->output[0];
194198}
195199
196200static void dst_filter1_reset(node_description *node)
r2241r2242
198202   struct dss_filter1_context *context = node->context;
199203
200204   calculate_filter1_coefficients(DST_FILTER1__FREQ, DST_FILTER1__TYPE, &context->a1, &context->b0, &context->b1);
201   node->output=0;
205   node->output[0]=0;
202206}
203207
204208
r2241r2242
271275      gain = 0.0;
272276   }
273277
274   node->output = -context->a1*context->y1 - context->a2*context->y2 +
278   node->output[0] = -context->a1*context->y1 - context->a2*context->y2 +
275279               context->b0*gain*DST_FILTER2__IN + context->b1*context->x1 + context->b2*context->x2;
276280
277281   context->x2 = context->x1;
278282   context->x1 = gain * DST_FILTER2__IN;
279283   context->y2 = context->y1;
280   context->y1 = node->output;
284   context->y1 = node->output[0];
281285}
282286
283287static void dst_filter2_reset(node_description *node)
r2241r2242
287291   calculate_filter2_coefficients(DST_FILTER2__FREQ, DST_FILTER2__DAMP, DST_FILTER2__TYPE,
288292                           &context->a1, &context->a2,
289293                           &context->b0, &context->b1, &context->b2);
290   node->output=0;
294   node->output[0]=0;
291295}
292296
293297
r2241r2242
337341      {
338342         case DISC_OP_AMP_FILTER_IS_LOW_PASS_1:
339343            context->vC1 += (v - context->vC1) * context->exponentC1;
340            node->output = context->vC1 * context->gain + info->vRef;
344            node->output[0] = context->vC1 * context->gain + info->vRef;
341345            break;
342346
343347         case DISC_OP_AMP_FILTER_IS_HIGH_PASS_1:
344            node->output = (v - context->vC1) * context->gain + info->vRef;
348            node->output[0] = (v - context->vC1) * context->gain + info->vRef;
345349            context->vC1 += (v - context->vC1) * context->exponentC1;
346350            break;
347351
348352         case DISC_OP_AMP_FILTER_IS_BAND_PASS_1:
349            node->output = (v - context->vC2);
353            node->output[0] = (v - context->vC2);
350354            context->vC2 += (v - context->vC2) * context->exponentC2;
351            context->vC1 += (node->output - context->vC1) * context->exponentC1;
352            node->output = context->vC1 * context->gain + info->vRef;
355            context->vC1 += (node->output[0] - context->vC1) * context->exponentC1;
356            node->output[0] = context->vC1 * context->gain + info->vRef;
353357            break;
354358
355359         case DISC_OP_AMP_FILTER_IS_BAND_PASS_0 | DISC_OP_AMP_IS_NORTON:
356360            context->vC1 += (v - context->vC1) * context->exponentC1;
357361            context->vC2 += (context->vC1 - context->vC2) * context->exponentC2;
358362            v = context->vC2;
359            node->output = v - context->vC3;
363            node->output[0] = v - context->vC3;
360364            context->vC3 += (v - context->vC3) * context->exponentC3;
361            i = node->output / context->rTotal;
362            node->output = (context->iFixed - i) * info->rF;
365            i = node->output[0] / context->rTotal;
366            node->output[0] = (context->iFixed - i) * info->rF;
363367            break;
364368
365369         case DISC_OP_AMP_FILTER_IS_HIGH_PASS_0 | DISC_OP_AMP_IS_NORTON:
366            node->output = v - context->vC1;
370            node->output[0] = v - context->vC1;
367371            context->vC1 += (v - context->vC1) * context->exponentC1;
368            i = node->output / context->rTotal;
369            node->output = (context->iFixed - i) * info->rF;
372            i = node->output[0] / context->rTotal;
373            node->output[0] = (context->iFixed - i) * info->rF;
370374            break;
371375
372376         case DISC_OP_AMP_FILTER_IS_BAND_PASS_1M:
373377         case DISC_OP_AMP_FILTER_IS_BAND_PASS_1M | DISC_OP_AMP_IS_NORTON:
374            node->output = -context->a1*context->y1 - context->a2*context->y2 +
378            node->output[0] = -context->a1*context->y1 - context->a2*context->y2 +
375379                        context->b0*v + context->b1*context->x1 + context->b2*context->x2 +
376380                        context->vRef;
377381            context->x2 = context->x1;
r2241r2242
383387      /* Clip the output to the voltage rails.
384388         * This way we get the original distortion in all it's glory.
385389         */
386      if (node->output > context->vP) node->output = context->vP;
387      if (node->output < context->vN) node->output = context->vN;
388      context->y1 = node->output - context->vRef;
390      if (node->output[0] > context->vP) node->output[0] = context->vP;
391      if (node->output[0] < context->vN) node->output[0] = context->vN;
392      context->y1 = node->output[0] - context->vRef;
389393   }
390394   else
391      node->output = 0;
395      node->output[0] = 0;
392396
393397}
394398
r2241r2242
494498   context->vC2 = 0;
495499   context->vC3 = 0;
496500
497   node->output = info->vRef;
501   node->output[0] = info->vRef;
498502}
499503
500504
r2241r2242
524528            context->state = 1;
525529            context->t = 0;
526530         }
527         node->output=0;
531         node->output[0]=0;
528532         break;
529533
530534      case 1:
531535         if (DST_RCDISC__ENABLE) {
532            node->output = DST_RCDISC__IN * exp(context->t / context->exponent0);
536            node->output[0] = DST_RCDISC__IN * exp(context->t / context->exponent0);
533537            context->t += discrete_current_context->sample_time;
534538            } else {
535539               context->state = 0;
r2241r2242
541545{
542546   struct dst_rcdisc_context *context = node->context;
543547
544   node->output=0;
548   node->output[0]=0;
545549
546550   context->state = 0;
547551   context->t = 0;
r2241r2242
577581   /* Works differently to other as we are always on, no enable */
578582   /* exponential based in difference between input/output   */
579583
580   diff = ((DST_RCDISC2__ENABLE == 0) ? DST_RCDISC2__IN0 : DST_RCDISC2__IN1) - node->output;
584   diff = ((DST_RCDISC2__ENABLE == 0) ? DST_RCDISC2__IN0 : DST_RCDISC2__IN1) - node->output[0];
581585   diff = diff - (diff * exp(discrete_current_context->sample_time / ((DST_RCDISC2__ENABLE == 0) ? context->exponent0 : context->exponent1)));
582   node->output += diff;
586   node->output[0] += diff;
583587}
584588
585589static void dst_rcdisc2_reset(node_description *node)
586590{
587591   struct dst_rcdisc_context *context = node->context;
588592
589   node->output=0;
593   node->output[0]=0;
590594
591595   context->state = 0;
592596   context->t = 0;
r2241r2242
621625
622626   if(DST_RCDISC3__ENABLE)
623627   {
624      diff = DST_RCDISC3__IN - node->output;
628      diff = DST_RCDISC3__IN - node->output[0];
625629      if( diff > 0 )
626630      {
627631         diff = diff - (diff * exp(discrete_current_context->sample_time / context->exponent0));
r2241r2242
632636         else
633637            diff = diff - (diff * exp(discrete_current_context->sample_time / context->exponent0));
634638      }
635      node->output += diff;
639      node->output[0] += diff;
636640   }
637641   else
638642   {
639      node->output=0;
643      node->output[0]=0;
640644   }
641645}
642646
r2241r2242
644648{
645649   struct dst_rcdisc_context *context = node->context;
646650
647   node->output=0;
651   node->output[0]=0;
648652
649653   context->state = 0;
650654   context->t = 0;
r2241r2242
682686
683687   if (DST_RCDISC4__ENABLE == 0)
684688   {
685      node->output = 0;
689      node->output[0] = 0;
686690      return;
687691   }
688692
r2241r2242
691695      case 1:
692696      case 3:
693697         context->vC1 += ((context->v[inp1] - context->vC1) * context->exp[inp1]);
694         node->output = context->vC1;
698         node->output[0] = context->vC1;
695699         break;
696700   }
697701
698702   /* clip output */
699   if (node->output > context->max_out) node->output = context->max_out;
700   if (node->output < 0) node->output = 0;
703   if (node->output[0] > context->max_out) node->output[0] = context->max_out;
704   if (node->output[0] < 0) node->output[0] = 0;
701705}
702706
703707static void  dst_rcdisc4_reset(node_description *node)
r2241r2242
802806      if( u < 0)
803807         u = 0;
804808
805      diff = u - node->output;
809      diff = u - node->output[0];
806810
807811      if(diff < 0)
808812         //diff = diff - (diff * exp(discrete_current_context->sample_time / context->exponent0));
809         diff = -node->output + (node->output * exp(discrete_current_context->sample_time / context->exponent0));
810      node->output += diff;
813         diff = -node->output[0] + (node->output[0] * exp(discrete_current_context->sample_time / context->exponent0));
814      node->output[0] += diff;
811815   }
812816   else
813817   {
814      node->output=0;
818      node->output[0]=0;
815819   }
816820}
817821
r2241r2242
819823{
820824   struct dst_rcdisc_context *context = node->context;
821825
822   node->output=0;
826   node->output[0]=0;
823827
824828   context->state = 0;
825829   context->t = 0;
r2241r2242
916920      switch (context->state)
917921      {
918922         case DISC_RC_INTEGRATE_TYPE1:
919            node->output = context->vCap;
923            node->output[0] = context->vCap;
920924            break;
921925         case DISC_RC_INTEGRATE_TYPE2:
922            node->output = vE;
926            node->output[0] = vE;
923927            break;
924928         case DISC_RC_INTEGRATE_TYPE3:
925            node->output = MAX(0,vP - iQ * context->R3);
929            node->output[0] = MAX(0,vP - iQ * context->R3);
926930            break;
927931      }
928932   }
929933   else
930934   {
931      node->output=0;
935      node->output[0]=0;
932936   }
933937}
934938
r2241r2242
937941   struct dst_rcdisc_context *context = node->context;
938942   double r;
939943
940   node->output=0;
944   node->output[0]=0;
941945
942946   context->state = DST_RCINTEGRATE__TYPE;
943947   context->R1 = DST_RCINTEGRATE__R1;
r2241r2242
10051009         diff = u + 0.6 - vCap;
10061010         diff = diff - (diff * exp(0.0-discrete_current_context->sample_time / (DST_RCDISC_MOD__C*Rc)));
10071011         vCap += diff;
1008         node->output = (DST_RCDISC_MOD__IN2 <= 0.6) ? -0.6 : 0;
1012         node->output[0] = (DST_RCDISC_MOD__IN2 <= 0.6) ? -0.6 : 0;
10091013      }
10101014      else
10111015      {
10121016         diff = diff - (diff * exp(0.0-discrete_current_context->sample_time / (DST_RCDISC_MOD__C*(Rc+Rc2))));
10131017         vCap += diff;
10141018         /* neglecting current through R3 drawn by next node */
1015         node->output = (DST_RCDISC_MOD__IN2 <= 0.6) ? (u-vCap)*DST_RCDISC_MOD__R4/(DST_RCDISC_MOD__R4+Rc) : 0;
1019         node->output[0] = (DST_RCDISC_MOD__IN2 <= 0.6) ? (u-vCap)*DST_RCDISC_MOD__R4/(DST_RCDISC_MOD__R4+Rc) : 0;
10161020      }
10171021      context->vCap = vCap;
10181022   }
10191023   else
10201024   {
1021      node->output=0;
1025      node->output[0]=0;
10221026   }
10231027}
10241028
r2241r2242
10261030{
10271031   struct dst_rcdisc_context *context = node->context;
10281032
1029   node->output=0;
1033   node->output[0]=0;
10301034   context->vCap = 0;
10311035}
10321036
r2241r2242
10581062   if(DST_RCFILTER__ENABLE)
10591063   {
10601064      context->vCap += ((DST_RCFILTER__VIN - DST_RCFILTER__VREF - context->vCap) * context->exponent);
1061      node->output = context->vCap + DST_RCFILTER__VREF;
1065      node->output[0] = context->vCap + DST_RCFILTER__VREF;
10621066   }
10631067   else
10641068   {
1065      node->output=0;
1069      node->output[0]=0;
10661070   }
10671071}
10681072
r2241r2242
10731077   context->exponent = -1.0 / (DST_RCFILTER__R * DST_RCFILTER__C * discrete_current_context->sample_rate);
10741078   context->exponent = 1.0 - exp(context->exponent);
10751079   context->vCap = 0;
1076   node->output = 0;
1080   node->output[0] = 0;
10771081}
10781082
1083/************************************************************************
1084 *
1085 * DST_RCFILTER_SW - Usage of node_description values for switchable RC filter
1086 *
1087 * input[0]    - Enable input value
1088 * input[1]    - input value
1089 * input[2]    - Resistor value (initialization only)
1090 * input[3]    - Capacitor Value (initialization only)
1091 * input[4]    - Voltage reference. Usually 0V.
1092 *
1093 ************************************************************************/
1094#define DST_RCFILTER_SW__ENABLE      (*(node->input[0]))
1095#define DST_RCFILTER_SW__VIN      (*(node->input[1]))
1096#define DST_RCFILTER_SW__SWITCH      (*(node->input[2]))
1097#define DST_RCFILTER_SW__R         (*(node->input[3]))
1098#define DST_RCFILTER_SW__C(x)      (*(node->input[4+x]))
10791099
1100#define CD4066_ON_RES  470
1101
1102static void dst_rcfilter_sw_step(node_description *node)
1103{
1104   struct dst_rcfilter_sw_context *context = node->context;
1105   int i;
1106   double rcexp;
1107   double us=0, rs=0;
1108
1109   if(DST_RCFILTER_SW__ENABLE)
1110   {
1111      for (i=0;i<4;i++)
1112      {
1113         if ( ( (int)DST_RCFILTER_SW__SWITCH & (1<<i)) == 1)
1114         {
1115            us += context->vCap[i];
1116            rs += DST_RCFILTER_SW__R;
1117         }
1118      }
1119      node->output[0] = CD4066_ON_RES / ( CD4066_ON_RES + rs) * DST_RCFILTER_SW__VIN + DST_RCFILTER_SW__R / (CD4066_ON_RES + rs)  * us;
1120      for (i=0;i<4;i++)
1121      {
1122         if ( ( (int)DST_RCFILTER_SW__SWITCH & (1<<i)) == 1)
1123         {
1124            rcexp = 1.0 - exp(-1.0 / ( CD4066_ON_RES * DST_RCFILTER_SW__C(i)) * discrete_current_context->sample_rate);
1125            context->vCap[i] += ((node->output[0] - context->vCap[i]) * rcexp);
1126         }
1127      }
1128   }
1129   else
1130   {
1131      node->output[0]=0;
1132   }
1133}
1134
1135static void dst_rcfilter_sw_reset(node_description *node)
1136{
1137   struct dst_rcfilter_sw_context *context = node->context;
1138   int i;
1139
1140   for (i=0;i<4;i++)
1141      context->vCap[i] = 0;
1142   node->output[0] = 0;
1143}
1144
10801145/* !!!!!!!!!!! NEW FILTERS for testing !!!!!!!!!!!!!!!!!!!!! */
10811146
10821147
r2241r2242
11531218   /* A rise in the input signal results in an instant charge, */
11541219   /* else discharge through the RC to zero */
11551220   if (gain* DST_RCDISCN__IN > context->x1)
1156      node->output = gain* DST_RCDISCN__IN;
1221      node->output[0] = gain* DST_RCDISCN__IN;
11571222   else
1158      node->output = -context->a1*context->y1;
1223      node->output[0] = -context->a1*context->y1;
11591224
11601225   context->x1 = gain* DST_RCDISCN__IN;
1161   context->y1 = node->output;
1226   context->y1 = node->output[0];
11621227}
11631228
11641229
r2241r2242
11961261   double input = ((DST_RCDISC2N__ENABLE == 0) ? DST_RCDISC2N__IN0 : DST_RCDISC2N__IN1);
11971262
11981263   if (DST_RCDISC2N__ENABLE == 0)
1199      node->output = -context->a1_0*context->y1 + context->b0_0*input + context->b1_0*context->x1;
1264      node->output[0] = -context->a1_0*context->y1 + context->b0_0*input + context->b1_0*context->x1;
12001265   else
1201      node->output = -context->a1_1*context->y1 + context->b0_1*input + context->b1_1*context->x1;
1266      node->output[0] = -context->a1_1*context->y1 + context->b0_1*input + context->b1_1*context->x1;
12021267
12031268   context->x1 = input;
1204   context->y1 = node->output;
1269   context->y1 = node->output[0];
12051270}
12061271
12071272static void dst_rcdisc2N_reset(node_description *node)
r2241r2242
12161281   calculate_filter1_coefficients(f2, DISC_FILTER_LOWPASS, &context->a1_1, &context->b0_1, &context->b1_1);
12171282
12181283   /* Initialize the object */
1219   node->output=0;
1284   node->output[0]=0;
12201285}
src/emu/sound/2203intf.c
r2241r2242
233233WRITE16_HANDLER( YM2203_control_port_0_lsb_w )
234234{
235235   struct ym2203_info *info = sndti_token(SOUND_YM2203, 0);
236   if (ACCESSING_LSB)
236   if (ACCESSING_BITS_0_7)
237237      YM2203Write(info->chip,0,data);
238238}
239239WRITE16_HANDLER( YM2203_control_port_1_lsb_w )
240240{
241241   struct ym2203_info *info = sndti_token(SOUND_YM2203, 1);
242   if (ACCESSING_LSB)
242   if (ACCESSING_BITS_0_7)
243243      YM2203Write(info->chip,0,data);
244244}
245245WRITE16_HANDLER( YM2203_control_port_2_lsb_w )
246246{
247247   struct ym2203_info *info = sndti_token(SOUND_YM2203, 2);
248   if (ACCESSING_LSB)
248   if (ACCESSING_BITS_0_7)
249249      YM2203Write(info->chip,0,data);
250250}
251251WRITE16_HANDLER( YM2203_control_port_3_lsb_w )
252252{
253253   struct ym2203_info *info = sndti_token(SOUND_YM2203, 3);
254   if (ACCESSING_LSB)
254   if (ACCESSING_BITS_0_7)
255255      YM2203Write(info->chip,0,data);
256256}
257257WRITE16_HANDLER( YM2203_control_port_4_lsb_w )
258258{
259259   struct ym2203_info *info = sndti_token(SOUND_YM2203, 4);
260   if (ACCESSING_LSB)
260   if (ACCESSING_BITS_0_7)
261261      YM2203Write(info->chip,0,data);
262262}
263263
264264WRITE16_HANDLER( YM2203_write_port_0_lsb_w )
265265{
266266   struct ym2203_info *info = sndti_token(SOUND_YM2203, 0);
267   if (ACCESSING_LSB)
267   if (ACCESSING_BITS_0_7)
268268      YM2203Write(info->chip,1,data);
269269}
270270WRITE16_HANDLER( YM2203_write_port_1_lsb_w )
271271{
272272   struct ym2203_info *info = sndti_token(SOUND_YM2203, 1);
273   if (ACCESSING_LSB)
273   if (ACCESSING_BITS_0_7)
274274      YM2203Write(info->chip,1,data);
275275}
276276WRITE16_HANDLER( YM2203_write_port_2_lsb_w )
277277{
278278   struct ym2203_info *info = sndti_token(SOUND_YM2203, 2);
279   if (ACCESSING_LSB)
279   if (ACCESSING_BITS_0_7)
280280      YM2203Write(info->chip,1,data);
281281}
282282WRITE16_HANDLER( YM2203_write_port_3_lsb_w )
283283{
284284   struct ym2203_info *info = sndti_token(SOUND_YM2203, 3);
285   if (ACCESSING_LSB)
285   if (ACCESSING_BITS_0_7)
286286      YM2203Write(info->chip,1,data);
287287}
288288WRITE16_HANDLER( YM2203_write_port_4_lsb_w )
289289{
290290   struct ym2203_info *info = sndti_token(SOUND_YM2203, 4);
291   if (ACCESSING_LSB)
291   if (ACCESSING_BITS_0_7)
292292      YM2203Write(info->chip,1,data);
293293}
294294
src/emu/sound/es8712.c
r2241r2242
407407
408408WRITE16_HANDLER( ES8712_data_0_lsb_w )
409409{
410   if (ACCESSING_LSB)
410   if (ACCESSING_BITS_0_7)
411411      ES8712_data_w(0, offset, data & 0xff);
412412}
413413
414414WRITE16_HANDLER( ES8712_data_1_lsb_w )
415415{
416   if (ACCESSING_LSB)
416   if (ACCESSING_BITS_0_7)
417417      ES8712_data_w(1, offset, data & 0xff);
418418}
419419
420420WRITE16_HANDLER( ES8712_data_2_lsb_w )
421421{
422   if (ACCESSING_LSB)
422   if (ACCESSING_BITS_0_7)
423423      ES8712_data_w(2, offset, data & 0xff);
424424}
425425
426426WRITE16_HANDLER( ES8712_data_0_msb_w )
427427{
428   if (ACCESSING_MSB)
428   if (ACCESSING_BITS_8_15)
429429      ES8712_data_w(0, offset, data >> 8);
430430}
431431
432432WRITE16_HANDLER( ES8712_data_1_msb_w )
433433{
434   if (ACCESSING_MSB)
434   if (ACCESSING_BITS_8_15)
435435      ES8712_data_w(1, offset, data >> 8);
436436}
437437
438438WRITE16_HANDLER( ES8712_data_2_msb_w )
439439{
440   if (ACCESSING_MSB)
440   if (ACCESSING_BITS_8_15)
441441      ES8712_data_w(2, offset, data >> 8);
442442}
443443
src/emu/devconv.h
r2241r2242
617617 ************************************/
618618
619619#define DEV_READ8TO16BE_MSB( name, read8 ) \
620DEV_READ_TEMPLATE_COND( 16, name, read8, read16be_with_read8_device_handler, ACCESSING_MSB )
620DEV_READ_TEMPLATE_COND( 16, name, read8, read16be_with_read8_device_handler, ACCESSING_BITS_8_15 )
621621
622622
623623#define DEV_WRITE8TO16BE_MSB( name, write8 ) \
624DEV_WRITE_TEMPLATE_COND( 16, name, write8, write16be_with_write8_device_handler, ACCESSING_MSB )
624DEV_WRITE_TEMPLATE_COND( 16, name, write8, write16be_with_write8_device_handler, ACCESSING_BITS_8_15 )
625625
626626
627627#define DEV_READWRITE8TO16BE_MSB( name, read8, write8 ) \
r2241r2242
634634 ************************************/
635635
636636#define DEV_READ8TO16LE_MSB( name, read8 ) \
637DEV_READ_TEMPLATE_COND( 16, name, read8, read16le_with_read8_device_handler, ACCESSING_MSB )
637DEV_READ_TEMPLATE_COND( 16, name, read8, read16le_with_read8_device_handler, ACCESSING_BITS_8_15 )
638638
639639
640640#define DEV_WRITE8TO16LE_MSB( name, write8 ) \
641DEV_WRITE_TEMPLATE_COND( 16, name, write8, write16le_with_write8_device_handler, ACCESSING_MSB )
641DEV_WRITE_TEMPLATE_COND( 16, name, write8, write16le_with_write8_device_handler, ACCESSING_BITS_8_15 )
642642
643643
644644#define DEV_READWRITE8TO16LE_MSB( name, read8, write8 ) \
r2241r2242
651651 ************************************/
652652
653653#define DEV_READ8TO16BE_LSB( name, read8 ) \
654DEV_READ_TEMPLATE_COND( 16, name, read8, read16be_with_read8_device_handler, ACCESSING_LSB )
654DEV_READ_TEMPLATE_COND( 16, name, read8, read16be_with_read8_device_handler, ACCESSING_BITS_0_7 )
655655
656656
657657#define DEV_WRITE8TO16BE_LSB( name, write8 ) \
658DEV_WRITE_TEMPLATE_COND( 16, name, write8, write16be_with_write8_device_handler, ACCESSING_LSB )
658DEV_WRITE_TEMPLATE_COND( 16, name, write8, write16be_with_write8_device_handler, ACCESSING_BITS_0_7 )
659659
660660
661661#define DEV_READWRITE8TO16BE_LSB( name, read8, write8 ) \
r2241r2242
668668 ************************************/
669669
670670#define DEV_READ8TO16LE_LSB( name, read8 ) \
671DEV_READ_TEMPLATE_COND( 16, name, read8, read16le_with_read8_device_handler, ACCESSING_LSB )
671DEV_READ_TEMPLATE_COND( 16, name, read8, read16le_with_read8_device_handler, ACCESSING_BITS_0_7 )
672672
673673
674674#define DEV_WRITE8TO16LE_LSB( name, write8 ) \
675DEV_WRITE_TEMPLATE_COND( 16, name, write8, write16le_with_write8_device_handler, ACCESSING_LSB )
675DEV_WRITE_TEMPLATE_COND( 16, name, write8, write16le_with_write8_device_handler, ACCESSING_BITS_0_7 )
676676
677677
678678#define DEV_READWRITE8TO16LE_LSB( name, read8, write8 ) \
r2241r2242
719719 ************************************/
720720
721721#define DEV_READ8TO32BE_MSB( name, read8 ) \
722DEV_READ_TEMPLATE_COND( 32, name, read8, read32be_with_read8_device_handler, ACCESSING_MSB32 )
722DEV_READ_TEMPLATE_COND( 32, name, read8, read32be_with_read8_device_handler, ACCESSING_BITS_24_31 )
723723
724724
725725#define DEV_WRITE8TO32BE_MSB( name, write8 ) \
726DEV_WRITE_TEMPLATE_COND( 32, name, write8, write32be_with_write8_device_handler, ACCESSING_MSB32 )
726DEV_WRITE_TEMPLATE_COND( 32, name, write8, write32be_with_write8_device_handler, ACCESSING_BITS_24_31 )
727727
728728
729729#define DEV_READWRITE8TO32BE_MSB( name, read8, write8 ) \
r2241r2242
736736 ************************************/
737737
738738#define DEV_READ8TO32LE_MSB( name, read8 ) \
739DEV_READ_TEMPLATE_COND( 32, name, read8, read32le_with_read8_device_handler, ACCESSING_MSB32 )
739DEV_READ_TEMPLATE_COND( 32, name, read8, read32le_with_read8_device_handler, ACCESSING_BITS_24_31 )
740740
741741
742742#define DEV_WRITE8TO32LE_MSB( name, write8 ) \
743DEV_WRITE_TEMPLATE_COND( 32, name, write8, write32le_with_write8_device_handler, ACCESSING_MSB32 )
743DEV_WRITE_TEMPLATE_COND( 32, name, write8, write32le_with_write8_device_handler, ACCESSING_BITS_24_31 )
744744
745745
746746#define DEV_READWRITE8TO32LE_MSB( name, read8, write8 ) \
r2241r2242
753753 ************************************/
754754
755755#define DEV_READ8TO32BE_LSB( name, read8 ) \
756DEV_READ_TEMPLATE_COND( 32, name, read8, read32be_with_read8_device_handler, ACCESSING_LSB32 )
756DEV_READ_TEMPLATE_COND( 32, name, read8, read32be_with_read8_device_handler, ACCESSING_BITS_0_7 )
757757
758758
759759#define DEV_WRITE8TO32BE_LSB( name, write8 ) \
760DEV_WRITE_TEMPLATE_COND( 32, name, write8, write32be_with_write8_device_handler, ACCESSING_LSB32 )
760DEV_WRITE_TEMPLATE_COND( 32, name, write8, write32be_with_write8_device_handler, ACCESSING_BITS_0_7 )
761761
762762
763763#define DEV_READWRITE8TO32BE_LSB( name, read8, write8 ) \
r2241r2242
770770 ************************************/
771771
772772#define DEV_READ8TO32LE_LSB( name, read8 ) \
773DEV_READ_TEMPLATE_COND( 32, name, read8, read32le_with_read8_device_handler, ACCESSING_LSB32 )
773DEV_READ_TEMPLATE_COND( 32, name, read8, read32le_with_read8_device_handler, ACCESSING_BITS_0_7 )
774774
775775
776776#define DEV_WRITE8TO32LE_LSB( name, write8 ) \
777DEV_WRITE_TEMPLATE_COND( 32, name, write8, write32le_with_write8_device_handler, ACCESSING_LSB32 )
777DEV_WRITE_TEMPLATE_COND( 32, name, write8, write32le_with_write8_device_handler, ACCESSING_BITS_0_7 )
778778
779779
780780#define DEV_READWRITE8TO32LE_LSB( name, read8, write8 ) \
r2241r2242
889889 *************************************/
890890
891891#define DEV_READ16BETO32BE_MSW( name, read16 ) \
892DEV_READ_TEMPLATE_COND( 32, name, read16, read32be_with_16be_device_handler, ACCESSING_MSW32 )
892DEV_READ_TEMPLATE_COND( 32, name, read16, read32be_with_16be_device_handler, ACCESSING_BITS_16_31 )
893893
894894
895895#define DEV_WRITE16BETO32BE_MSW( name, write16 ) \
896DEV_WRITE_TEMPLATE_COND( 32, name, write16, write32be_with_16be_device_handler, ACCESSING_MSW32 )
896DEV_WRITE_TEMPLATE_COND( 32, name, write16, write32be_with_16be_device_handler, ACCESSING_BITS_16_31 )
897897
898898
899899#define DEV_READWRITE16BETO32BE_MSW( name, read16, write16 ) \
r2241r2242
906906 *************************************/
907907
908908#define DEV_READ16LETO32BE_MSW( name, read16 ) \
909DEV_READ_TEMPLATE_COND( 32, name, read16, read32be_with_16le_device_handler, ACCESSING_MSW32 )
909DEV_READ_TEMPLATE_COND( 32, name, read16, read32be_with_16le_device_handler, ACCESSING_BITS_16_31 )
910910
911911
912912#define DEV_WRITE16LETO32BE_MSW( name, write16 ) \
913DEV_WRITE_TEMPLATE_COND( 32, name, write16, write32be_with_16le_device_handler, ACCESSING_MSW32 )
913DEV_WRITE_TEMPLATE_COND( 32, name, write16, write32be_with_16le_device_handler, ACCESSING_BITS_16_31 )
914914
915915
916916#define DEV_READWRITE16LETO32BE_MSW( name, read16, write16 ) \
r2241r2242
923923 *************************************/
924924
925925#define DEV_READ16BETO32LE_MSW( name, read16 ) \
926DEV_READ_TEMPLATE_COND( 32, name, read16, read32le_with_16be_device_handler, ACCESSING_MSW32 )
926DEV_READ_TEMPLATE_COND( 32, name, read16, read32le_with_16be_device_handler, ACCESSING_BITS_16_31 )
927927
928928
929929#define DEV_WRITE16BETO32LE_MSW( name, write16 ) \
930DEV_WRITE_TEMPLATE_COND( 32, name, write16, write32le_with_16be_device_handler, ACCESSING_MSW32 )
930DEV_WRITE_TEMPLATE_COND( 32, name, write16, write32le_with_16be_device_handler, ACCESSING_BITS_16_31 )
931931
932932
933933#define DEV_READWRITE16BETO32LE_MSW( name, read16, write16 ) \
r2241r2242
940940 *************************************/
941941
942942#define DEV_READ16LETO32LE_MSW( name, read16 ) \
943DEV_READ_TEMPLATE_COND( 32, name, read16, read32le_with_16le_device_handler, ACCESSING_MSW32 )
943DEV_READ_TEMPLATE_COND( 32, name, read16, read32le_with_16le_device_handler, ACCESSING_BITS_16_31 )
944944
945945
946946#define DEV_WRITE16LETO32LE_MSW( name, write16 ) \
947DEV_WRITE_TEMPLATE_COND( 32, name, write16, write32le_with_16le_device_handler, ACCESSING_MSW32 )
947DEV_WRITE_TEMPLATE_COND( 32, name, write16, write32le_with_16le_device_handler, ACCESSING_BITS_16_31 )
948948
949949
950950#define DEV_READWRITE16LETO32LE_MSW( name, read16, write16 ) \
r2241r2242
956956 *************************************/
957957
958958#define DEV_READ16BETO32BE_LSW( name, read16 ) \
959DEV_READ_TEMPLATE_COND( 32, name, read16, read32be_with_16be_device_handler, ACCESSING_LSW32 )
959DEV_READ_TEMPLATE_COND( 32, name, read16, read32be_with_16be_device_handler, ACCESSING_BITS_0_15 )
960960
961961
962962#define DEV_WRITE16BETO32BE_LSW( name, write16 ) \
963DEV_WRITE_TEMPLATE_COND( 32, name, write16, write32be_with_16be_device_handler, ACCESSING_LSW32 )
963DEV_WRITE_TEMPLATE_COND( 32, name, write16, write32be_with_16be_device_handler, ACCESSING_BITS_0_15 )
964964
965965
966966#define DEV_READWRITE16BETO32BE_LSW( name, read16, write16 ) \
r2241r2242
973973 *************************************/
974974
975975#define DEV_READ16LETO32BE_LSW( name, read16 ) \
976DEV_READ_TEMPLATE_COND( 32, name, read16, read32be_with_16le_device_handler, ACCESSING_LSW32 )
976DEV_READ_TEMPLATE_COND( 32, name, read16, read32be_with_16le_device_handler, ACCESSING_BITS_0_15 )
977977
978978
979979#define DEV_WRITE16LETO32BE_LSW( name, write16 ) \
980DEV_WRITE_TEMPLATE_COND( 32, name, write16, write32be_with_16le_device_handler, ACCESSING_LSW32 )
980DEV_WRITE_TEMPLATE_COND( 32, name, write16, write32be_with_16le_device_handler, ACCESSING_BITS_0_15 )
981981
982982
983983#define DEV_READWRITE16LETO32BE_LSW( name, read16, write16 ) \
r2241r2242
990990 *************************************/
991991
992992#define DEV_READ16BETO32LE_LSW( name, read16 ) \
993DEV_READ_TEMPLATE_COND( 32, name, read16, read32le_with_16be_device_handler, ACCESSING_LSW32 )
993DEV_READ_TEMPLATE_COND( 32, name, read16, read32le_with_16be_device_handler, ACCESSING_BITS_0_15 )
994994
995995
996996#define DEV_WRITE16BETO32LE_LSW( name, write16 ) \
997DEV_WRITE_TEMPLATE_COND( 32, name, write16, write32le_with_16be_device_handler, ACCESSING_LSW32 )
997DEV_WRITE_TEMPLATE_COND( 32, name, write16, write32le_with_16be_device_handler, ACCESSING_BITS_0_15 )
998998
999999
10001000#define DEV_READWRITE16BETO32LE_LSW( name, read16, write16 ) \
r2241r2242
10071007 *************************************/
10081008
10091009#define DEV_READ16LETO32LE_LSW( name, read16 ) \
1010DEV_READ_TEMPLATE_COND( 32, name, read16, read32le_with_16le_device_handler, ACCESSING_LSW32 )
1010DEV_READ_TEMPLATE_COND( 32, name, read16, read32le_with_16le_device_handler, ACCESSING_BITS_0_15 )
10111011
10121012
10131013#define DEV_WRITE16LETO32LE_LSW( name, write16 ) \
1014DEV_WRITE_TEMPLATE_COND( 32, name, write16, write32le_with_16le_device_handler, ACCESSING_LSW32 )
1014DEV_WRITE_TEMPLATE_COND( 32, name, write16, write32le_with_16le_device_handler, ACCESSING_BITS_0_15 )
10151015
10161016
10171017#define DEV_READWRITE16LETO32LE_LSW( name, read16, write16 ) \
src/emu/sound.c
r2241r2242
244244
245245   /* stop all the sound chips */
246246   for (sndnum = 0; sndnum < MAX_SOUND; sndnum++)
247      if (Machine->config->sound[sndnum].type != SOUND_DUMMY)
247      if (machine->config->sound[sndnum].type != SOUND_DUMMY)
248248         sndintrf_exit_sound(sndnum);
249249
250250   /* reset variables */
r2241r2242
501501
502502   /* reset all the sound chips */
503503   for (sndnum = 0; sndnum < MAX_SOUND; sndnum++)
504      if (Machine->config->sound[sndnum].type != SOUND_DUMMY)
504      if (machine->config->sound[sndnum].type != SOUND_DUMMY)
505505         sndnum_reset(sndnum);
506506}
507507
src/emu/debugger.h
r2241r2242
1616
1717#include "mame.h"
1818#include "memory.h"
19#include "deprecat.h"
1920
2021
2122/***************************************************************************
src/emu/input.c
r2241r2242
4545#define INVALID_AXIS_VALUE      0x7fffffff
4646
4747
48
4948/***************************************************************************
5049    TYPE DEFINITIONS
5150***************************************************************************/
r2241r2242
316315   { ITEM_ID_START,         "START" },
317316   { ITEM_ID_SELECT,        "SELECT" },
318317
318   /* Hats */
319   { ITEM_ID_HAT1UP,        "HAT1UP" },
320   { ITEM_ID_HAT1DOWN,      "HAT1DOWN" },
321   { ITEM_ID_HAT1LEFT,      "HAT1LEFT" },
322   { ITEM_ID_HAT1RIGHT,     "HAT1RIGHT" },
323   { ITEM_ID_HAT2UP,        "HAT2UP" },
324   { ITEM_ID_HAT2DOWN,      "HAT2DOWN" },
325   { ITEM_ID_HAT2LEFT,      "HAT2LEFT" },
326   { ITEM_ID_HAT2RIGHT,     "HAT2RIGHT" },
327   { ITEM_ID_HAT3UP,        "HAT3UP" },
328   { ITEM_ID_HAT3DOWN,      "HAT3DOWN" },
329   { ITEM_ID_HAT3LEFT,      "HAT3LEFT" },
330   { ITEM_ID_HAT3RIGHT,     "HAT3RIGHT" },
331   { ITEM_ID_HAT4UP,        "HAT4UP" },
332   { ITEM_ID_HAT4DOWN,      "HAT4DOWN" },
333   { ITEM_ID_HAT4LEFT,      "HAT4LEFT" },
334   { ITEM_ID_HAT4RIGHT,     "HAT4RIGHT" },
335
336   /* Additional IDs */
337   { ITEM_ID_ADD_SWITCH1,   "ADDSW1" },
338   { ITEM_ID_ADD_SWITCH2,   "ADDSW2" },
339   { ITEM_ID_ADD_SWITCH3,   "ADDSW3" },
340   { ITEM_ID_ADD_SWITCH4,    "ADDSW4" },
341   { ITEM_ID_ADD_SWITCH5,    "ADDSW5" },
342   { ITEM_ID_ADD_SWITCH6,   "ADDSW6" },
343   { ITEM_ID_ADD_SWITCH7,   "ADDSW7" },
344   { ITEM_ID_ADD_SWITCH8,   "ADDSW8" },
345   { ITEM_ID_ADD_SWITCH9,   "ADDSW9" },
346   { ITEM_ID_ADD_SWITCH10,  "ADDSW10" },
347   { ITEM_ID_ADD_SWITCH11,  "ADDSW11" },
348   { ITEM_ID_ADD_SWITCH12,  "ADDSW12" },
349   { ITEM_ID_ADD_SWITCH13,  "ADDSW13" },
350   { ITEM_ID_ADD_SWITCH14,  "ADDSW14" },
351   { ITEM_ID_ADD_SWITCH15,  "ADDSW15" },
352   { ITEM_ID_ADD_SWITCH16,  "ADDSW16" },
353   { ITEM_ID_ADD_ABSOLUTE1, "ADDAXIS1" },
354   { ITEM_ID_ADD_ABSOLUTE2, "ADDAXIS2" },
355   { ITEM_ID_ADD_ABSOLUTE3, "ADDAXIS3" },
356   { ITEM_ID_ADD_ABSOLUTE4, "ADDAXIS4" },
357   { ITEM_ID_ADD_ABSOLUTE5, "ADDAXIS5" },
358   { ITEM_ID_ADD_ABSOLUTE6, "ADDAXIS6" },
359   { ITEM_ID_ADD_ABSOLUTE7, "ADDAXIS7" },
360   { ITEM_ID_ADD_ABSOLUTE8, "ADDAXIS8" },
361   { ITEM_ID_ADD_ABSOLUTE9, "ADDAXIS9" },
362   { ITEM_ID_ADD_ABSOLUTE10,"ADDAXIS10" },
363   { ITEM_ID_ADD_ABSOLUTE11,"ADDAXIS11" },
364   { ITEM_ID_ADD_ABSOLUTE12,"ADDAXIS12" },
365   { ITEM_ID_ADD_ABSOLUTE13,"ADDAXIS13" },
366   { ITEM_ID_ADD_ABSOLUTE14,"ADDAXIS14" },
367   { ITEM_ID_ADD_ABSOLUTE15,"ADDAXIS15" },
368   { ITEM_ID_ADD_ABSOLUTE16,"ADDAXIS16" },
369   { ITEM_ID_ADD_RELATIVE1, "ADDREL1" },
370   { ITEM_ID_ADD_RELATIVE2, "ADDREL2" },
371   { ITEM_ID_ADD_RELATIVE3, "ADDREL3" },
372   { ITEM_ID_ADD_RELATIVE4, "ADDREL4" },
373   { ITEM_ID_ADD_RELATIVE5, "ADDREL5" },
374   { ITEM_ID_ADD_RELATIVE6, "ADDREL6" },
375   { ITEM_ID_ADD_RELATIVE7, "ADDREL7" },
376   { ITEM_ID_ADD_RELATIVE8, "ADDREL8" },
377   { ITEM_ID_ADD_RELATIVE9, "ADDREL9" },
378   { ITEM_ID_ADD_RELATIVE10,"ADDREL10" },
379   { ITEM_ID_ADD_RELATIVE11,"ADDREL11" },
380   { ITEM_ID_ADD_RELATIVE12,"ADDREL12" },
381   { ITEM_ID_ADD_RELATIVE13,"ADDREL13" },
382   { ITEM_ID_ADD_RELATIVE14,"ADDREL14" },
383   { ITEM_ID_ADD_RELATIVE15,"ADDREL15" },
384   { ITEM_ID_ADD_RELATIVE16,"ADDREL16" },
385
319386   { ~0,                    NULL }
320387};
321388
r2241r2242
409476INLINE input_item_class input_item_standard_class(input_device_class devclass, input_item_id itemid)
410477{
411478   /* most everything standard is a switch, apart from the axes */
412   if (itemid == ITEM_ID_OTHER_SWITCH || itemid < ITEM_ID_XAXIS || itemid > ITEM_ID_SLIDER2)
479   if (itemid == ITEM_ID_OTHER_SWITCH || itemid < ITEM_ID_XAXIS || (itemid > ITEM_ID_SLIDER2 && itemid < ITEM_ID_ADD_ABSOLUTE1))
413480      return ITEM_CLASS_SWITCH;
414481
415482   /* standard mouse axes are relative */
416   else if (devclass == DEVICE_CLASS_MOUSE || itemid == ITEM_ID_OTHER_AXIS_RELATIVE)
483   else if (devclass == DEVICE_CLASS_MOUSE || itemid == ITEM_ID_OTHER_AXIS_RELATIVE || (itemid >= ITEM_ID_ADD_RELATIVE1 && itemid <= ITEM_ID_ADD_RELATIVE16))
417484      return ITEM_CLASS_RELATIVE;
418485
419486   /* all other standard axes are absolute */
r2241r2242
11601227   modifier = code_to_string(modifier_token_table, INPUT_CODE_MODIFIER(code));
11611228
11621229   /* determine the itemclass part; if we match the native class, we don't include this */
1163   if (item == NULL || item->itemclass == INPUT_CODE_ITEMCLASS(code))
1230   if (item != NULL && item->itemclass == INPUT_CODE_ITEMCLASS(code))
11641231      itemclass = "";
11651232   else
11661233      itemclass = code_to_string(itemclass_token_table, INPUT_CODE_ITEMCLASS(code));
src/emu/input.h
r2241r2242
5656#define INTERNAL_CODE(x)            (INPUT_CODE_INTERNAL | ((x) & 0xfff))
5757#define INPUT_CODE_INVALID            STANDARD_CODE(INVALID, 0, INVALID, NONE, INVALID)
5858
59/* Maximum number of axis/buttons/hats with ITEM_IDs for use by osd layer*/
5960
61#define INPUT_MAX_AXIS               (8)
62#define INPUT_MAX_BUTTONS            (16)
63#define INPUT_MAX_HATS               (4)
64#define INPUT_MAX_ADD_SWITCH         (16)
65#define INPUT_MAX_ADD_ABSOLUTE         (16)
66#define INPUT_MAX_ADD_RELATIVE         (16)
6067
6168/***************************************************************************
6269    CONSTANTS
r2241r2242
246253   ITEM_ID_START,
247254   ITEM_ID_SELECT,
248255
256   /* Hats */
257   ITEM_ID_HAT1UP,
258   ITEM_ID_HAT1DOWN,
259   ITEM_ID_HAT1LEFT,
260   ITEM_ID_HAT1RIGHT,
261   ITEM_ID_HAT2UP,
262   ITEM_ID_HAT2DOWN,
263   ITEM_ID_HAT2LEFT,
264   ITEM_ID_HAT2RIGHT,
265   ITEM_ID_HAT3UP,
266   ITEM_ID_HAT3DOWN,
267   ITEM_ID_HAT3LEFT,
268   ITEM_ID_HAT3RIGHT,
269   ITEM_ID_HAT4UP,
270   ITEM_ID_HAT4DOWN,
271   ITEM_ID_HAT4LEFT,
272   ITEM_ID_HAT4RIGHT,
273
274   /* Additional IDs */
275   ITEM_ID_ADD_SWITCH1,
276   ITEM_ID_ADD_SWITCH2,
277   ITEM_ID_ADD_SWITCH3,
278   ITEM_ID_ADD_SWITCH4,
279   ITEM_ID_ADD_SWITCH5,
280   ITEM_ID_ADD_SWITCH6,
281   ITEM_ID_ADD_SWITCH7,
282   ITEM_ID_ADD_SWITCH8,
283   ITEM_ID_ADD_SWITCH9,
284   ITEM_ID_ADD_SWITCH10,
285   ITEM_ID_ADD_SWITCH11,
286   ITEM_ID_ADD_SWITCH12,
287   ITEM_ID_ADD_SWITCH13,
288   ITEM_ID_ADD_SWITCH14,
289   ITEM_ID_ADD_SWITCH15,
290   ITEM_ID_ADD_SWITCH16,
291
292   ITEM_ID_ADD_ABSOLUTE1,
293   ITEM_ID_ADD_ABSOLUTE2,
294   ITEM_ID_ADD_ABSOLUTE3,
295   ITEM_ID_ADD_ABSOLUTE4,
296   ITEM_ID_ADD_ABSOLUTE5,
297   ITEM_ID_ADD_ABSOLUTE6,
298   ITEM_ID_ADD_ABSOLUTE7,
299   ITEM_ID_ADD_ABSOLUTE8,
300   ITEM_ID_ADD_ABSOLUTE9,
301   ITEM_ID_ADD_ABSOLUTE10,
302   ITEM_ID_ADD_ABSOLUTE11,
303   ITEM_ID_ADD_ABSOLUTE12,
304   ITEM_ID_ADD_ABSOLUTE13,
305   ITEM_ID_ADD_ABSOLUTE14,
306   ITEM_ID_ADD_ABSOLUTE15,
307   ITEM_ID_ADD_ABSOLUTE16,
308
309   ITEM_ID_ADD_RELATIVE1,
310   ITEM_ID_ADD_RELATIVE2,
311   ITEM_ID_ADD_RELATIVE3,
312   ITEM_ID_ADD_RELATIVE4,
313   ITEM_ID_ADD_RELATIVE5,
314   ITEM_ID_ADD_RELATIVE6,
315   ITEM_ID_ADD_RELATIVE7,
316   ITEM_ID_ADD_RELATIVE8,
317   ITEM_ID_ADD_RELATIVE9,
318   ITEM_ID_ADD_RELATIVE10,
319   ITEM_ID_ADD_RELATIVE11,
320   ITEM_ID_ADD_RELATIVE12,
321   ITEM_ID_ADD_RELATIVE13,
322   ITEM_ID_ADD_RELATIVE14,
323   ITEM_ID_ADD_RELATIVE15,
324   ITEM_ID_ADD_RELATIVE16,
325
249326   /* generic other IDs */
250327   ITEM_ID_OTHER_SWITCH,
251328   ITEM_ID_OTHER_AXIS_ABSOLUTE,
src/emu/emupal.c
r2241r2242
157157}
158158
159159
160/*-------------------------------------------------
161    palette_config - palette initialization that
162    takes place after the display is created
163-------------------------------------------------*/
164160
165void palette_config(running_machine *machine)
166{
167   int i;
168
169   /* now let the driver modify the initial palette and colortable */
170   if (machine->config->init_palette)
171      (*machine->config->init_palette)(machine, memory_region(REGION_PROMS));
172
173   /* set the color table base for each graphics element */
174   for (i = 0; i < MAX_GFX_ELEMENTS; i++)
175      if (machine->gfx[i] != NULL)
176         machine->gfx[i]->color_base = machine->config->gfxdecodeinfo[i].color_codes_start;
177}
178
179
180
181161/***************************************************************************
182162    SHADOW/HIGHLIGHT CONFIGURATION
183163***************************************************************************/
src/emu/emupal.h
r2241r2242
126126/* palette initialization that takes place before the display is created */
127127void palette_init(running_machine *machine);
128128
129/* palette initialization that takes place after the display is created */
130void palette_config(running_machine *machine);
131129
132130
133
134131/* ----- shadow/hilight configuration ----- */
135132
136133/* set the global shadow brightness factor */
src/emu/drivers/xtal.h
r2241r2242
103103   XTAL_24_576MHz     = 24576000,      /* Pole Position h/w, Model 3 CPU board */
104104   XTAL_25MHz         = 25000000,      /* Namco System 22, Taito GNET, Dogyuun h/w */
105105   XTAL_25_1748MHz     = 25174800,      /* Sega S16A, S16B */
106   XTAL_25_601712MHz     = 25601712,      /* Astro Corp.'s Show Hand */
106107   XTAL_26_66666MHz    = 26666660,      /* Irem M92 but most use 27MHz */
107108   XTAL_26_686MHz       = 26686000,      /* Typically used on 90's Taito PCBs to drive the custom chips */
108109   XTAL_27MHz         = 27000000,      /* Some Banpresto games macrossp, Irem M92 and 90's Toaplan games */
src/mess/includes/mz700.h
r2241r2242
1515
1616/*----------- defined in machine/mz700.c -----------*/
1717
18const struct pit8253_config mz700_pit8253_config;
18extern const struct pit8253_config mz700_pit8253_config;
1919
2020DRIVER_INIT( mz700 );
2121MACHINE_RESET( mz700 );
src/mess/includes/special.h
r2241r2242
1010
1111/*----------- defined in machine/special.c -----------*/
1212
13const struct pit8253_config specimx_pit8253_intf;
13extern const struct pit8253_config specimx_pit8253_intf;
1414
1515extern DRIVER_INIT( special );
1616extern MACHINE_RESET( special );
src/mess/video/x68k.c
r2241r2242
394394      logerror("CRTC: Write to raster IRQ register - %i\n",data);
395395      break;
396396   case 20:
397      if(ACCESSING_LSB)
397      if(ACCESSING_BITS_0_7)
398398      {
399399         switch(data & 0x0c)
400400         {
r2241r2242
423423            break;
424424         }
425425      }
426      if(ACCESSING_MSB)
426      if(ACCESSING_BITS_8_15)
427427      {
428428         sys.crtc.interlace = 0;
429429         if(data & 0x0400)  // real size 1024x1024
src/mess/video/atarist.c
r2241r2242
589589
590590READ16_HANDLER( atarist_blitter_op_r )
591591{
592   if (ACCESSING_LSB16)
592   if (ACCESSING_BITS_0_7)
593593   {
594594      return blitter.hop;
595595   }
r2241r2242
601601
602602READ16_HANDLER( atarist_blitter_ctrl_r )
603603{
604   if (ACCESSING_LSB16)
604   if (ACCESSING_BITS_0_7)
605605   {
606606      return blitter.ctrl;
607607   }
r2241r2242
683683
684684WRITE16_HANDLER( atarist_blitter_op_w )
685685{
686   if (ACCESSING_LSB16)
686   if (ACCESSING_BITS_0_7)
687687   {
688688      blitter.hop = (data >> 8) & 0x03;
689689   }
r2241r2242
695695
696696WRITE16_HANDLER( atarist_blitter_ctrl_w )
697697{
698   if (ACCESSING_LSB16)
698   if (ACCESSING_BITS_0_7)
699699   {
700700      blitter.ctrl = (data >> 8) & 0xef;
701701
src/mess/machine/mac.c
r2241r2242
11271127   if (LOG_MAC_IWM)
11281128      logerror("mac_iwm_w: offset=0x%08x data=0x%04x\n", offset, data);
11291129
1130   if (ACCESSING_LSB)
1130   if (ACCESSING_BITS_0_7)
11311131      applefdc_w(machine, offset >> 8, data & 0xff);
11321132}
11331133
r2241r2242
12741274   if (LOG_VIA)
12751275      logerror("mac_via_w: offset=0x%02x data=0x%08x\n", offset, data);
12761276
1277   if (ACCESSING_MSB)
1277   if (ACCESSING_BITS_8_15)
12781278      via_0_w(machine, offset, (data >> 8) & 0xff);
12791279}
12801280
src/mess/machine/concept.c
r2241r2242
281281
282282READ16_HANDLER(concept_io_r)
283283{
284   if (! ACCESSING_LSB)
284   if (! ACCESSING_BITS_0_7)
285285      return 0;
286286
287287   switch ((offset >> 8) & 7)
r2241r2242
416416
417417WRITE16_HANDLER(concept_io_w)
418418{
419   if (! ACCESSING_LSB)
419   if (! ACCESSING_BITS_0_7)
420420      return;
421421
422422   data &= 0xff;
src/mess/machine/lisa.c
r2241r2242
17701770         COMBINE_DATA((UINT16 *) (lisa_ram_ptr + address));
17711771         if (diag2)
17721772         {
1773            if ((ACCESSING_LSB)
1773            if ((ACCESSING_BITS_0_7)
17741774               && ! (bad_parity_table[address >> 3] & (0x1 << (address & 0x7))))
17751775            {
17761776               bad_parity_table[address >> 3] |= 0x1 << (address & 0x7);
17771777               bad_parity_count++;
17781778            }
1779            if ((ACCESSING_MSB)
1779            if ((ACCESSING_BITS_8_15)
17801780               && ! (bad_parity_table[address >> 3] & (0x2 << (address & 0x7))))
17811781            {
17821782               bad_parity_table[address >> 3] |= 0x2 << (address & 0x7);
r2241r2242
17851785         }
17861786         else if (bad_parity_table[address >> 3] & (0x3 << (address & 0x7)))
17871787         {
1788            if ((ACCESSING_LSB)
1788            if ((ACCESSING_BITS_0_7)
17891789               && (bad_parity_table[address >> 3] & (0x1 << (address & 0x7))))
17901790            {
17911791               bad_parity_table[address >> 3] &= ~ (0x1 << (address & 0x7));
17921792               bad_parity_count--;
17931793            }
1794            if ((ACCESSING_MSB)
1794            if ((ACCESSING_BITS_8_15)
17951795               && (bad_parity_table[address >> 3] & (0x2 << (address & 0x7))))
17961796            {
17971797               bad_parity_table[address >> 3] &= ~ (0x2 << (address & 0x7));
r2241r2242
18091809         COMBINE_DATA((UINT16 *) (lisa_ram_ptr + address));
18101810         if (diag2)
18111811         {
1812            if ((ACCESSING_LSB)
1812            if ((ACCESSING_BITS_0_7)
18131813               && ! (bad_parity_table[address >> 3] & (0x1 << (address & 0x7))))
18141814            {
18151815               bad_parity_table[address >> 3] |= 0x1 << (address & 0x7);
18161816               bad_parity_count++;
18171817            }
1818            if ((ACCESSING_MSB)
1818            if ((ACCESSING_BITS_8_15)
18191819               && ! (bad_parity_table[address >> 3] & (0x2 << (address & 0x7))))
18201820            {
18211821               bad_parity_table[address >> 3] |= 0x2 << (address & 0x7);
r2241r2242
18241824         }
18251825         else if (bad_parity_table[address >> 3] & (0x3 << (address & 0x7)))
18261826         {
1827            if ((ACCESSING_LSB)
1827            if ((ACCESSING_BITS_0_7)
18281828               && (bad_parity_table[address >> 3] & (0x1 << (address & 0x7))))
18291829            {
18301830               bad_parity_table[address >> 3] &= ~ (0x1 << (address & 0x7));
18311831               bad_parity_count--;
18321832            }
1833            if ((ACCESSING_MSB)
1833            if ((ACCESSING_BITS_8_15)
18341834               && (bad_parity_table[address >> 3] & (0x2 << (address & 0x7))))
18351835            {
18361836               bad_parity_table[address >> 3] &= ~ (0x2 << (address & 0x7));
r2241r2242
19691969      {
19701970         if (! (offset & 0x400))
19711971         {
1972            /*if (ACCESSING_LSB)*/   /* Geez, who cares ? */
1972            /*if (ACCESSING_BITS_0_7)*/   /* Geez, who cares ? */
19731973               answer = lisa_fdc_ram[offset & 0x03ff] & 0xff;   /* right ??? */
19741974         }
19751975      }
r2241r2242
19861986
19871987         case 2:   /* parallel port */
19881988            /* 1 VIA located at 0xD901 */
1989            if (ACCESSING_LSB)
1989            if (ACCESSING_BITS_0_7)
19901990               return via_read(1, (offset >> 2) & 0xf);
19911991            break;
19921992
19931993         case 3:   /* keyboard/mouse cops via */
19941994            /* 1 VIA located at 0xDD81 */
1995            if (ACCESSING_LSB)
1995            if (ACCESSING_BITS_0_7)
19961996               return via_read(0, offset & 0xf);
19971997            break;
19981998         }
r2241r2242
20642064         /* Floppy Disk Controller shared RAM */
20652065         if (! (offset & 0x0400))
20662066         {
2067            if (ACCESSING_LSB)
2067            if (ACCESSING_BITS_0_7)
20682068               lisa_fdc_ram[offset & 0x03ff] = data & 0xff;
20692069         }
20702070      }
r2241r2242
20772077            break;
20782078
20792079         case 2:   /* paralel port */
2080            if (ACCESSING_LSB)
2080            if (ACCESSING_BITS_0_7)
20812081               via_write(1, (offset >> 2) & 0xf, data & 0xff);
20822082            break;
20832083
20842084         case 3:   /* keyboard/mouse cops via */
2085            if (ACCESSING_LSB)
2085            if (ACCESSING_BITS_0_7)
20862086               via_write(0, offset & 0xf, data & 0xff);
20872087            break;
20882088         }
src/mess/machine/amigacrt.c
r2241r2242
191191{
192192   int pc = safe_activecpu_get_pc();
193193
194   if ( ACCESSING_LSB && offset == 2048 && pc >= 0x40 && pc < 0x120 )
194   if ( ACCESSING_BITS_0_7 && offset == 2048 && pc >= 0x40 && pc < 0x120 )
195195   {
196196      amiga_ar23_freeze(machine);
197197   }
r2241r2242
220220{
221221   UINT16 *mem = (UINT16 *)memory_region( REGION_USER2 );
222222
223   if ( ACCESSING_LSB )
223   if ( ACCESSING_BITS_0_7 )
224224   {
225225      if ( offset < 2 )
226226         return (mem[offset] | (amiga_ar23_mode&3));
src/mess/machine/cybiko.c
r2241r2242
403403READ16_HANDLER( cybiko_lcd_r )
404404{
405405   UINT16 data = 0;
406   if ACCESSING_MSB16 data = data | (hd66421_reg_idx_r() << 8);
407   if ACCESSING_LSB16 data = data | (hd66421_reg_dat_r() << 0);
406   if ACCESSING_BITS_8_15 data = data | (hd66421_reg_idx_r() << 8);
407   if ACCESSING_BITS_0_7 data = data | (hd66421_reg_dat_r() << 0);
408408   return data;
409409}
410410
411411WRITE16_HANDLER( cybiko_lcd_w )
412412{
413   if ACCESSING_MSB16 hd66421_reg_idx_w( (data >> 8) & 0xFF);
414   if ACCESSING_LSB16 hd66421_reg_dat_w( (data >> 0) & 0xFF);
413   if ACCESSING_BITS_8_15 hd66421_reg_idx_w( (data >> 8) & 0xFF);
414   if ACCESSING_BITS_0_7 hd66421_reg_dat_w( (data >> 0) & 0xFF);
415415}
416416
417417static READ8_HANDLER( cybiko_key_r_byte )
r2241r2242
433433{
434434   UINT16 data = 0;
435435   _logerror( 2, ("cybiko_key_r (%08X/%04X)\n", offset, mem_mask));
436   if ACCESSING_MSB16 data = data | (cybiko_key_r_byte(machine, offset * 2 + 0) << 8);
437   if ACCESSING_LSB16 data = data | (cybiko_key_r_byte(machine, offset * 2 + 1) << 0);
436   if ACCESSING_BITS_8_15 data = data | (cybiko_key_r_byte(machine, offset * 2 + 0) << 8);
437   if ACCESSING_BITS_0_7 data = data | (cybiko_key_r_byte(machine, offset * 2 + 1) << 0);
438438   _logerror( 2, ("%04X\n", data));
439439   return data;
440440}
r2241r2242
562562// 20/00, 23/08, 27/01, 2F/08, 2C/02, 2B/08, 28/01, 37/08, 34/04, 33/08, 30/03, 04/80, 05/02, 1B/6C, 00/C8
563563WRITE16_HANDLER( cybiko_unk1_w )
564564{
565   if ACCESSING_MSB16 logerror( "[%08X] <- %02X\n", 0x200000 + offset * 2 + 0, (data >> 8) & 0xFF);
566   if ACCESSING_LSB16 logerror( "[%08X] <- %02X\n", 0x200000 + offset * 2 + 1, (data >> 0) & 0xFF);
565   if ACCESSING_BITS_8_15 logerror( "[%08X] <- %02X\n", 0x200000 + offset * 2 + 0, (data >> 8) & 0xFF);
566   if ACCESSING_BITS_0_7 logerror( "[%08X] <- %02X\n", 0x200000 + offset * 2 + 1, (data >> 0) & 0xFF);
567567}
568568
569569READ16_HANDLER( cybiko_unk2_r )
src/mess/machine/hd63450.c
r2241r2242
8787   switch(reg)
8888   {
8989   case 0x00:  // CSR / CER
90      if(ACCESSING_MSB)
90      if(ACCESSING_BITS_8_15)
9191      {
9292//         dmac.reg[channel].csr = (data & 0xff00) >> 8;
9393//         logerror("DMA#%i: Channel status write : %02x\n",channel,dmac.reg[channel].csr);
r2241r2242
9595      // CER is read-only, so no action needed there.
9696      break;
9797   case 0x02:  // DCR / OCR
98      if(ACCESSING_MSB)
98      if(ACCESSING_BITS_8_15)
9999      {
100100         dmac.reg[channel].dcr = (data & 0xff00) >> 8;
101101         logerror("DMA#%i: Device Control write : %02x\n",channel,dmac.reg[channel].dcr);
102102      }
103      if(ACCESSING_LSB)
103      if(ACCESSING_BITS_0_7)
104104      {
105105         dmac.reg[channel].ocr = data & 0x00ff;
106106         logerror("DMA#%i: Operation Control write : %02x\n",channel,dmac.reg[channel].ocr);
107107      }
108108      break;
109109   case 0x03:  // SCR / CCR
110      if(ACCESSING_MSB)
110      if(ACCESSING_BITS_8_15)
111111      {
112112         dmac.reg[channel].scr = (data & 0xff00) >> 8;
113113         logerror("DMA#%i: Sequence Control write : %02x\n",channel,dmac.reg[channel].scr);
114114      }
115      if(ACCESSING_LSB)
115      if(ACCESSING_BITS_0_7)
116116      {
117117         dmac.reg[channel].ccr = data & 0x00ff;
118118         if((data & 0x0080))// && !dmac.intf->dma_read[channel] && !dmac.intf->dma_write[channel])
src/mess/machine/genesis.c
r2241r2242
11021102      switch (offset & 3)
11031103      {
11041104         case 0:
1105            if (ACCESSING_MSB)    return YM2612_status_port_0_A_r(0) << 8;
1105            if (ACCESSING_BITS_8_15)    return YM2612_status_port_0_A_r(0) << 8;
11061106            else              return YM2612_read_port_0_r(0);
11071107            break;
11081108         case 2:
1109            if (ACCESSING_MSB)   return YM2612_status_port_0_B_r(0) << 8;
1109            if (ACCESSING_BITS_8_15)   return YM2612_status_port_0_B_r(0) << 8;
11101110            else             return 0;
11111111            break;
11121112      }
r2241r2242
11371137
11381138//      logerror("Write Data %04x Mask %04x to Z80 offset %04x\n", data, mem_mask, offset);
11391139
1140      if ((ACCESSING_LSB) && (ACCESSING_MSB))
1140      if ((ACCESSING_BITS_0_7) && (ACCESSING_BITS_8_15))
11411141      {
11421142      //   logerror("word access wrote to z80!\n");
11431143         // ignore LSB
r2241r2242
11461146         return;
11471147      }
11481148
1149      if (ACCESSING_LSB)
1149      if (ACCESSING_BITS_0_7)
11501150         memory_region(REGION_CPU2)[offset^1] = data & 0x00ff;
11511151
1152      if (ACCESSING_MSB)
1152      if (ACCESSING_BITS_8_15)
11531153         memory_region(REGION_CPU2)[offset] = (data & 0xff00)>>8;
11541154   }
11551155   else if ((offset>=0x4000) && (offset<=0x5fff))
r2241r2242
11571157      switch (offset & 3)
11581158      {
11591159         case 0:
1160            if (ACCESSING_MSB)   YM2612_control_port_0_A_w   (0,   (data >> 8) & 0xff);
1160            if (ACCESSING_BITS_8_15)   YM2612_control_port_0_A_w   (0,   (data >> 8) & 0xff);
11611161            else             YM2612_data_port_0_A_w      (0,   (data >> 0) & 0xff);
11621162            break;
11631163         case 2:
1164            if (ACCESSING_MSB)   YM2612_control_port_0_B_w   (0,   (data >> 8) & 0xff);
1164            if (ACCESSING_BITS_8_15)   YM2612_control_port_0_B_w   (0,   (data >> 8) & 0xff);
11651165            else             YM2612_data_port_0_B_w      (0,   (data >> 0) & 0xff);
11661166            break;
11671167      }
r2241r2242
20002000      case 0x00: // Data Port
20012001      case 0x02: // Data Port (mirror)
20022002         /* for 8-bit writes data gets duplicated in each half */
2003         if (!ACCESSING_LSB)   data = (data & 0xff00) | ((data >>8 )& 0x00ff);
2004         if (!ACCESSING_MSB)   data = (data & 0x00ff) | ((data <<8 )& 0xff00);
2003         if (!ACCESSING_BITS_0_7)   data = (data & 0xff00) | ((data >>8 )& 0x00ff);
2004         if (!ACCESSING_BITS_8_15)   data = (data & 0x00ff) | ((data <<8 )& 0xff00);
20052005         genesis_vdp_data_write(current_vdp,data);
20062006         break;
20072007
20082008      case 0x04: // Control Port
20092009      case 0x06: // Control Port (mirror)
20102010         /* for 8-bit writes data gets duplicated in each half */
2011         if (!ACCESSING_LSB)   data = (data & 0xff00) | ((data >>8 )& 0x00ff);
2012         if (!ACCESSING_MSB)   data = (data & 0x00ff) | ((data <<8 )& 0xff00);
2011         if (!ACCESSING_BITS_0_7)   data = (data & 0xff00) | ((data >>8 )& 0x00ff);
2012         if (!ACCESSING_BITS_8_15)   data = (data & 0x00ff) | ((data <<8 )& 0xff00);
20132013         genesis_vdp_control_write(current_vdp,data);
20142014         break;
20152015
r2241r2242
20292029      case 0x16: // SN76489 PSG (mirror)
20302030                  SN76496_1_w(0, (data) & 0xff); break;
20312031
2032      //   if (ACCESSING_MSB) SN76496_0_w(0, (data >>8) & 0xff);
2032      //   if (ACCESSING_BITS_8_15) SN76496_0_w(0, (data >>8) & 0xff);
20332033
20342034   //      break;
20352035
src/mess/machine/99_hsgpl.c
r2241r2242
594594      return;      /* right??? */
595595   }
596596
597   if ((hsgpl.cru_reg & cr_mbxena) && (offset == 0x07ff) && ACCESSING_MSB16)
597   if ((hsgpl.cru_reg & cr_mbxena) && (offset == 0x07ff) && ACCESSING_BITS_8_15)
598598   {   /* MBX: mapper at 0x6ffe */
599599      hsgpl.cur_bank = (data >> 8) & 0x3;
600600      return;
r2241r2242
611611      case 1:
612612         if (hsgpl.cru_reg & cr_ramena)
613613         {
614            if (ACCESSING_LSB16)
614            if (ACCESSING_BITS_0_7)
615615               hsgpl.RAM6_ptr[1 + 2*offset + 0x2000*hsgpl.cur_bank + 0x8000*port] = data;
616            if (ACCESSING_MSB16)
616            if (ACCESSING_BITS_8_15)
617617               hsgpl.RAM6_ptr[2*offset + 0x2000*hsgpl.cur_bank + 0x8000*port] = data >> 8;
618618            break;
619619         }
r2241r2242
639639
640640      case 32:
641641      case 33:
642         if (ACCESSING_LSB16)
642         if (ACCESSING_BITS_0_7)
643643            hsgpl.RAM6_ptr[1 + 2*offset + 0x2000*hsgpl.cur_bank + 0x8000*(port-32)] = data;
644         if (ACCESSING_MSB16)
644         if (ACCESSING_BITS_8_15)
645645            hsgpl.RAM6_ptr[2*offset + 0x2000*hsgpl.cur_bank + 0x8000*(port-32)] = data >> 8;
646646         break;
647647
src/mess/machine/ti99_4x.c
r2241r2242
10461046      /* mapper at 0x6ffe */
10471047      if ((offset >= 0x0600) && (offset <= 0x07fe))
10481048         COMBINE_DATA(cartridge_pages[0]+offset);
1049      else if ((offset == 0x07ff) && ACCESSING_MSB16)
1049      else if ((offset == 0x07ff) && ACCESSING_BITS_8_15)
10501050         current_page_ptr = cartridge_pages[cartridge_paged ? ((data >> 8) & 1) : 0];
10511051   }
10521052   else if (cartridge_paged)
src/mess/mess.mak
r2241r2242
370370   $(MESSOBJ)/gce.a \
371371   $(MESSOBJ)/glasgow.a \
372372   $(MESSOBJ)/gmaster.a \
373   $(MESSOBJ)/pasogo.a \
374373   $(MESSOBJ)/hp48.a \
375374   $(MESSOBJ)/intv.a \
376375   $(MESSOBJ)/jupiter.a \
r2241r2242
395394   $(MESSOBJ)/nintendo.a \
396395   $(MESSOBJ)/osborne.a \
397396   $(MESSOBJ)/p2000.a \
397   $(MESSOBJ)/pasogo.a \
398398   $(MESSOBJ)/pc.a \
399399   $(MESSOBJ)/pcshare.a \
400400   $(MESSOBJ)/pdp1.a \
src/mess/drivers/x68k.c
r2241r2242
11271127      }
11281128      break;
11291129   default:
1130      if (ACCESSING_LSB) mc68901_register_w(x68k_mfp, offset, data & 0xff);
1130      if (ACCESSING_BITS_0_7) mc68901_register_w(x68k_mfp, offset, data & 0xff);
11311131      return;
11321132   }
11331133}
r2241r2242
12201220      break;
12211221   case 0x280:  // priority levels
12221222      COMBINE_DATA(sys.video.reg+1);
1223      if(ACCESSING_LSB)
1223      if(ACCESSING_BITS_0_7)
12241224      {
12251225         sys.video.gfxlayer_pri[0] = data & 0x0003;
12261226         sys.video.gfxlayer_pri[1] = (data & 0x000c) >> 2;
12271227         sys.video.gfxlayer_pri[2] = (data & 0x0030) >> 4;
12281228         sys.video.gfxlayer_pri[3] = (data & 0x00c0) >> 6;
12291229      }
1230      if(ACCESSING_MSB)
1230      if(ACCESSING_BITS_8_15)
12311231      {
12321232         sys.video.gfx_pri = (data & 0x0300) >> 8;
12331233         sys.video.text_pri = (data & 0x0c00) >> 10;
r2241r2242
13531353      current_vector[2] = 0x02;  // bus error
13541354      current_irq_line = 2;
13551355      offset *= 2;
1356      if(ACCESSING_LSB)
1356      if(ACCESSING_BITS_0_7)
13571357         offset++;
13581358      timer_set(ATTOTIME_IN_CYCLES(16,0), NULL, 0xeafa00+offset,x68k_fake_bus_error);
13591359//      cpunum_set_input_line_and_vector(machine, 0,2,ASSERT_LINE,current_vector[2]);
r2241r2242
13691369      current_vector[2] = 0x02;  // bus error
13701370      current_irq_line = 2;
13711371      offset *= 2;
1372      if(ACCESSING_LSB)
1372      if(ACCESSING_BITS_0_7)
13731373         offset++;
13741374      timer_set(ATTOTIME_IN_CYCLES(16,0), NULL, 0xeafa00+offset,x68k_fake_bus_error);
13751375//      cpunum_set_input_line_and_vector(machine, 0,2,ASSERT_LINE,current_vector[2]);
src/mess/drivers/atarist.c
r2241r2242
6060{
6161   atarist_state *state = machine->driver_data;
6262
63   if (ACCESSING_LSB) mc68901_register_w(state->mfp, offset, data & 0xff);
63   if (ACCESSING_BITS_0_7) mc68901_register_w(state->mfp, offset, data & 0xff);
6464}
6565
6666/* Floppy Disk Controller */
r2241r2242
752752
753753static READ16_HANDLER( megaste_scc8530_r )
754754{
755   if (ACCESSING_MSB16)
755   if (ACCESSING_BITS_8_15)
756756   {
757757      return scc_r(machine, offset);
758758   }
r2241r2242
764764
765765static WRITE16_HANDLER( megaste_scc8530_w )
766766{
767   if (ACCESSING_MSB16)
767   if (ACCESSING_BITS_8_15)
768768   {
769769      scc_w(machine, offset, data);
770770   }
src/mess/drivers/compis.c
r2241r2242
5151
5252static ADDRESS_MAP_START( compis_io, ADDRESS_SPACE_IO, 16)
5353   AM_RANGE( 0x0000, 0x0007) AM_READWRITE( compis_ppi_r, compis_ppi_w )   /* PPI 8255         */
54   AM_RANGE( 0x0080, 0x0087) AM_READWRITE( compis_pit_r, compis_pit_w )   /* PIT 8253         */
54//   AM_RANGE( 0x0080, 0x0087) AM_READWRITE( compis_pit_r, compis_pit_w )   /* PIT 8253         */
5555   AM_RANGE( 0x0100, 0x011b) AM_READWRITE( compis_rtc_r, compis_rtc_w )    /* RTC 58174            */
5656   AM_RANGE( 0x0280, 0x0283) AM_READWRITE( compis_osp_pic_r, compis_osp_pic_w ) /* PIC 8259 (80150/80130)  */
5757//  AM_RANGE( 0x0288, 0x028e) AM_READWRITE( compis_osp_pit_r, compis_osp_pit_w ) /* PIT 8254 (80150/80130)  */
docs/messnew.txt
r2241r2242
3838
3939Source Changes:
4040----------------
41- The core is based on MAME 0.124u1.  This incorporates all features of the
42  update to this core.  [MAME team]
43
4144- Major changes to transition MESS's device system onto MAME's device system.
4245  [Nate Woods]
4346
makefile
r2241r2242
139139# uncomment next line to generate a link map for exception handling in windows
140140# MAP = 1
141141
142# uncomment next line to generate verbose build information
143# VERBOSE = 1
144
142145# specify optimization level or leave commented to use the default
143146# (default is OPTIMIZE = 3 normally, or OPTIMIZE = 0 with symbols)
144147# OPTIMIZE = 3
r2241r2242
301304CFLAGS += -g
302305endif
303306
307# add -v if we need verbose build information
308ifdef VERBOSE
309CFLAGS += -v
310endif
311
304312# add a basic set of warnings
305313CFLAGS += \
306314   -Wall \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team